@oaknational/oak-components 2.32.0 → 2.34.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 +9 -11
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/types.d.ts +591 -812
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ This is a React Typescript components library which supports React and Next appl
|
|
|
12
12
|
|
|
13
13
|
This library is suitable for use in an app using React 18 and Next.js 13.5+
|
|
14
14
|
|
|
15
|
-
You can install it using `
|
|
15
|
+
You can install it using `pnpm i @oaknational/oak-components` or any other package manager that supports the NPM registry.
|
|
16
16
|
|
|
17
17
|
👉 You'll need two environment variables to enable images `NEXT_PUBLIC_OAK_ASSETS_HOST` and `NEXT_PUBLIC_OAK_ASSETS_PATH`. Values for these can be obtained from the `.env` config from OWA or from a fellow engineer.
|
|
18
18
|
|
|
@@ -43,17 +43,15 @@ export default function RootLayout({ children }) {
|
|
|
43
43
|
|
|
44
44
|
To enable SSR of styles and avoid a flicker of unstyled content you'll need to configure your Next.js app to support [styled-components](https://nextjs.org/docs/app/building-your-application/styling/css-in-js#styled-components)
|
|
45
45
|
|
|
46
|
-
### TypeScript
|
|
47
|
-
|
|
48
|
-
If you're using TypeScript you might want to add `@types/styled-components` to your development dependencies (`npm i -D @types/styled-components`). This will ensure that all components are properly type hinted in your IDE.
|
|
49
46
|
|
|
50
47
|
## Development
|
|
51
48
|
|
|
52
49
|
1. Copy the example env config `cp .env.example .env`
|
|
53
50
|
2. Populate `.env` with values from the 1Password developer vault, search for: "Oak components .env"
|
|
54
|
-
3. run `
|
|
55
|
-
4. run `
|
|
56
|
-
5.
|
|
51
|
+
3. run `corepack enable && corepack install`
|
|
52
|
+
4. run `nvm use`
|
|
53
|
+
5. run `pnpm install`
|
|
54
|
+
6. To view the storybook run `pnpm storybook`
|
|
57
55
|
|
|
58
56
|
## Making changes
|
|
59
57
|
|
|
@@ -75,14 +73,14 @@ Commit messages that begin with `chore`, `refactor` or `docs`, etc. will not tri
|
|
|
75
73
|
|
|
76
74
|
Sometimes it isn't enough to develop entirely inside Storybook and it might be necessary to try local changes inside a target app. You can do this with [yalc](https://github.com/wclr/yalc)
|
|
77
75
|
|
|
78
|
-
1. Install yalc `
|
|
79
|
-
2. Run `
|
|
76
|
+
1. Install yalc `pnpm i yalc -g`
|
|
77
|
+
2. Run `pnpm run publish:local` to add the package to yalc's local registry.
|
|
80
78
|
3. Inside the target app run `yalc add @oaknational/oak-components` — this will install the package from the local registry like it would from NPM
|
|
81
|
-
- 🚨 if you're an Oak engineer developing in OWA there is a convenience script and you should use `
|
|
79
|
+
- 🚨 if you're an Oak engineer developing in OWA there is a convenience script and you should use `pnpm run use-local-components` instead
|
|
82
80
|
as it will perform some additional work to remove any existing installation of the package.
|
|
83
81
|
4. Now when you start your target app you should have access to the locally packaged version of the library
|
|
84
82
|
5. To uninstall the local package you can run `yalc remove @oaknational/oak-components` inside the target app
|
|
85
|
-
- 🚨 if you're an Oak engineer developing in OWA there is a convenience script and you should use `
|
|
83
|
+
- 🚨 if you're an Oak engineer developing in OWA there is a convenience script and you should use `pnpm run remove-local-components` instead
|
|
86
84
|
as it will automatically re-install the library from NPM.
|
|
87
85
|
|
|
88
86
|
## Organisational structure
|