Skip to content

Commit

Permalink
Merge pull request #16463 from strapi/docs/update-yarn-link
Browse files Browse the repository at this point in the history
  • Loading branch information
markkaylor committed Apr 21, 2023
2 parents cd4c329 + 82db28a commit 21641cd
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions docs/docs/core/admin/link-strapi-design-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,18 @@

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 the design system run `yarn build` 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:
In the Strapi monorepo link your local copy of the design system with [`yarn link`](https://yarnpkg.com/cli/link#gatsby-focus-wrapper):

```
"@strapi/design-system": "link:../../../../strapi-design-system/packages/strapi-design-system"
yarn link -r ../<relative-path-to-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`
Running yarn build in `examples/getstarted` should now use your local version of the design system.

Once the link is setup, run the following command from the root of the monorepo
To revert back to the released version of the design system use [`yarn unlink`](https://yarnpkg.com/cli/unlink#usage):

```
yarn clean && yarn setup
yarn unlink ../<relative-path-to-strapi-design-system>
```

0 comments on commit 21641cd

Please sign in to comment.