From 220c3c1aba96a1934c849690eb7b024405527543 Mon Sep 17 00:00:00 2001 From: Mark Kaylor Date: Fri, 13 Jan 2023 09:56:57 +0100 Subject: [PATCH 1/2] Add linking the design system docs --- .../core/admin/link-strapi-design-system.md | 25 +++++++++++++++++++ docs/sidebars.js | 11 ++++++++ 2 files changed, 36 insertions(+) create mode 100644 docs/docs/core/admin/link-strapi-design-system.md diff --git a/docs/docs/core/admin/link-strapi-design-system.md b/docs/docs/core/admin/link-strapi-design-system.md new file mode 100644 index 0000000000..b63b5b6597 --- /dev/null +++ b/docs/docs/core/admin/link-strapi-design-system.md @@ -0,0 +1,25 @@ +# Linking the Strapi Design System + +Follow these steps to use a local version of the Strapi design system with the Strapi monorepo + +First, run `yarn build` in `strapi-design-system/packages/strapi-design-system` to generate the bundle. + +In your copy of Strapi, you can link the design system using either a [relative path](#relative-path) or [yarn link](#yarn-link). + +### Relative path + +Replace the version number in both `strapi/packages/core/admin/package.json` and `strapi/packages/core/helper-plugin/package.json` with the relative path to your copy of the design system: + +``` +"@strapi/design-system": "link:../../../../strapi-design-system/packages/strapi-design-system" +``` + +### Yarn link + +Alternatively, you can use [`yarn link`](https://classic.yarnpkg.com/lang/en/docs/cli/link/) by first running `yarn link` in `strapi-design-system/packages/design-system` and then `yarn link @strapi/design-system` in both `strapi/packages/core/admin` and `strapi/packages/core/helper-plugin`. With this approach, no changes need to be made to the `package.json` + +Once the link is setup, run the following command from the root of `@strapi/strapi` + +``` +yarn lerna clean && yarn setup +``` diff --git a/docs/sidebars.js b/docs/sidebars.js index 6154e8ff2a..c7b203ad87 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -50,6 +50,17 @@ const sidebars = { }, ], }, + { + type: 'category', + label: 'Admin', + items: [ + { + type: 'doc', + label: 'Link Strapi Design System', + id: 'core/admin/link-strapi-design-system', + }, + ], + }, { type: 'category', label: 'Content Type Builder', From 89f7fe49993112684ed0fd6b8f965992c96d4b17 Mon Sep 17 00:00:00 2001 From: markkaylor Date: Fri, 13 Jan 2023 11:33:51 +0100 Subject: [PATCH 2/2] Fix incorrect location for command --- docs/docs/core/admin/link-strapi-design-system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/core/admin/link-strapi-design-system.md b/docs/docs/core/admin/link-strapi-design-system.md index b63b5b6597..31bdaca868 100644 --- a/docs/docs/core/admin/link-strapi-design-system.md +++ b/docs/docs/core/admin/link-strapi-design-system.md @@ -18,7 +18,7 @@ Replace the version number in both `strapi/packages/core/admin/package.json` and Alternatively, you can use [`yarn link`](https://classic.yarnpkg.com/lang/en/docs/cli/link/) by first running `yarn link` in `strapi-design-system/packages/design-system` and then `yarn link @strapi/design-system` in both `strapi/packages/core/admin` and `strapi/packages/core/helper-plugin`. With this approach, no changes need to be made to the `package.json` -Once the link is setup, run the following command from the root of `@strapi/strapi` +Once the link is setup, run the following command from the root of the monorepo ``` yarn lerna clean && yarn setup