@raspberrypifoundation/design-system-react 1.1.15 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,40 +2,51 @@
2
2
 
3
3
  ## Usage
4
4
 
5
- ### Using a local running NPM
5
+ Using `npm`:
6
6
 
7
- `design-system-react` is published to the GitHub package registry and is dependent on `design-system-core`.
7
+ ```bash
8
+ npm install @raspberrypifoundation/design-system-react
9
+ npm run storybook
10
+ ```
8
11
 
9
- Installation of `design-system-core` requires a user-level `~/.npmrc` file that contains a GitHub access token.
12
+ Using `yarn`:
10
13
 
11
- Follow the steps in the `design-system-core` [README](https://github.com/RaspberryPiFoundation/design-system-core) to create a token and set up a local version of that project.
14
+ ```bash
15
+ yarn install @raspberrypifoundation/design-system-react
16
+ yarn storybook
17
+ ```
12
18
 
13
- You should have:
19
+ ### Working with a local version of [design-system-core](https://github.com/RaspberryPiFoundation/design-system-core)
14
20
 
15
- - generated a token via the GitHub website: it will typically be prefixed with "ghp"; and
16
- - created a file called `.npmrc` in your user root directory (not the directory of this project) that contains the following:
17
- `//npm.pkg.github.com/:_authToken={GITHUB_TOKEN}`
21
+ Sometimes you may want to work on `design-system-core` and `design-system-react` at the same time. You can do this by working with your local version of core using `npm link`.
18
22
 
19
- Once that's complete, use `npm` - not `yarn` - to install this package.
23
+ 1. Navigate to your local `design-system-core` repo create a global symbolic link.
20
24
 
21
25
  ```
22
- npm i
23
-
24
- npm run storybook
26
+ npm link
25
27
  ```
26
28
 
27
- ### Adding design-system-react to a project
29
+ 2. In `design-system-react` remove the node_modules folder and install the application.
28
30
 
29
- Projects that need to import this package must have an `.npmrc` file at their root level. The file should contain:
31
+ ```
32
+ rm -rf node_modules && npm i
33
+ ```
34
+
35
+ 3. Navigate to your local `design-system-react` repo and tell the application to use the global symbolic link. You should notice "changed 1 package" in the response.
30
36
 
31
37
  ```
32
- # Sets GitHub as the registry for packages scoped to @RaspberryPiFoundation
33
- @raspberrypifoundation:registry=https://npm.pkg.github.com
38
+ npm link @raspberrypifoundation/design-system-core
34
39
  ```
35
40
 
36
- `design-system-react` can then be installed using the project's package manager.
41
+ #### Troubleshooting
42
+
43
+ If you are experiencing issues and believe design-system-react is not using your local version of design-system-core, or if you are running into issues running `npm link`, try the following:
44
+
45
+ - Check that `design-system-react` and `design-system-core` are both using the same `nodejs` version in `.tool_versions`. If they are not, update the node version(s) in `.tool_versions` locally and retry the steps above. If this was the issues / the `nodejs` versions are not the same, consider creating a PR to bring them in-line.
46
+
47
+ - Ensure that you are running the `npm link` command in step 3 AFTER step 2. Doing these in the wrong order will not work.
37
48
 
38
- ### Deployment
49
+ ## Deployment
39
50
 
40
51
  Create a new [release](https://github.com/RaspberryPiFoundation/design-system-react/releases):
41
52
 
@@ -46,6 +57,6 @@ Create a new [release](https://github.com/RaspberryPiFoundation/design-system-re
46
57
  - Click 'Publish release' (leave 'Set as latest release' checked) and a build will be kicked off
47
58
  - Add new version to `package.json` in your app
48
59
 
49
- ### Using Docker
60
+ ## Using Docker
50
61
 
51
62
  TODO