Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
# SWRdata/components

Experimental component library for SWR Data Lab interactives.
Component library for SWR Data Lab interactives.

[![Deploy Storybook](https://github.com/SWRdata/components/actions/workflows/deploy-storybook.yml/badge.svg)](https://github.com/SWRdata/components/actions/workflows/deploy-storybook.yml) [![Run Storybook Tests](https://github.com/SWRdata/components/actions/workflows/test-storybook.yml/badge.svg)](https://github.com/SWRdata/components/actions/workflows/test-storybook.yml) [![Release to NPM](https://github.com/SWRdata/components/actions/workflows/release.yml/badge.svg)](https://github.com/SWRdata/components/actions/workflows/release.yml)
[![Package version](https://img.shields.io/npm/v/%40swr-data-lab%2Fcomponents)](https://www.npmjs.com/package/@swr-data-lab/components) [![Deploy Storybook](https://github.com/SWRdata/components/actions/workflows/deploy-storybook.yml/badge.svg)](https://github.com/SWRdata/components/actions/workflows/deploy-storybook.yml) [![Run Storybook Tests](https://github.com/SWRdata/components/actions/workflows/test-storybook.yml/badge.svg)](https://github.com/SWRdata/components/actions/workflows/test-storybook.yml) [![Release to NPM](https://github.com/SWRdata/components/actions/workflows/release.yml/badge.svg)](https://github.com/SWRdata/components/actions/workflows/release.yml)

## Usage

[`swr-data-lab/components`](https://www.npmjs.com/package/@swr-data-lab/components) is a private package, so installing it takes some extra steps:

1. Ensure you're a member of the `swr-data-lab` organisation on [npm](https://www.npmjs.com/)
2. Log into npm and generate an [access token](https://docs.npmjs.com/about-access-tokens) of type `automation`
3. For local development, add the token as an environment variable using the command line:
- MacOS/Linux: `export NPM_TOKEN=[your-npm-token]` (test with `echo $NPM_TOKEN`)
- Windows: `set NPM_TOKEN=[your-npm-token]` (test with `echo %NPM_TOKEN%`)
4. For usage with Github Actions, add the token as a [repository secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions) called `NPM_TOKEN`
5. Add the following `.npmrc` file to your project:
```
engine-strict=true
registry=https://registry.npmjs.org/
@swr-data-lab:registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
```
6. Run `npm install --save @swr-data-lab/components` to install the package
Run `npm install --save @swr-data-lab/components` to install the package

See also this [sample repository](https://github.com/SWRdata/components-usage-example). Refer to [Storybook](https://static.datenhub.net/apps/components/main/index.html?path=/docs/about--docs) for component-level usage examples and documentation.

Expand All @@ -32,6 +17,7 @@ See also this [sample repository](https://github.com/SWRdata/components-usage-ex
1. `/components`: Central repository for reusable components, utility scripts, and other reusable assets. We use [Storybook](https://storybook.js.org/) for previewing and component-level testing.
2. `/mock-sveltekit`: Sample [SvelteKit](https://kit.svelte.dev/) application used to test our components and develop the configuration needed to build our applications for SWR.de, the SWR Aktuell native app and wherever else they need to go.
3. `/mock-sophora`: Testing environment designed to mimic the SWR.de environment, featuring [`defunkt/jquery-pjax`](https://github.com/defunkt/jquery-pjax) navigation, global styles and server-side includes.
4. `/sophora-components`: Experimental components that are intended to be used directly within SWR.de articles and pages via the "Datenjournalismus" module in the Sophora CMS.

### Release workflow

Expand Down