-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into new/modal
- Loading branch information
Showing
62 changed files
with
11,316 additions
and
766 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,50 @@ | ||
# General Guidelines | ||
|
||
## New Component | ||
## Showcase | ||
|
||
Globally install [Yarn](https://yarnpkg.com/getting-started/install) and [Lerna](https://lerna.js.org/). Since showcase is managed by Storybook run this in the root directory to install Storybook CLI: | ||
|
||
``` | ||
npx lerna create foo | ||
npx sb init | ||
``` | ||
|
||
Follow lerna steps to configure your new package, but make sure to name it correctly by addinf `@wpmudev/react-` prefix. | ||
Now you can initialize your local environment: | ||
|
||
``` | ||
$ package name: @wpmudev/react-foo | ||
$ version (default value): | ||
$ description: WPMU DEV Shared UI React Foo Component | ||
$ keywords: | ||
$ homepage: | ||
$ license: GPL-3.0 | ||
$ entry point (default value): | ||
$ git repository (default value): | ||
yarn storybook | ||
``` | ||
|
||
## Install Packages | ||
## New Package | ||
|
||
``` | ||
lerna create @wpmudev/react-foo --yes | ||
``` | ||
|
||
## Install NPM Packages | ||
|
||
Since SUI React is a mono-repo managed by Lerna there are two ways to install packages: | ||
|
||
### Global Package | ||
|
||
When package is going to be shared between multiple components or going to be used on root. | ||
When package is going to be affect project root only. | ||
|
||
``` | ||
yarn add -W --dev package-name | ||
``` | ||
|
||
### Component Package | ||
|
||
When package is required for an specific component. | ||
When package is required for an specific component you could run: | ||
|
||
``` | ||
# Regular dependency | ||
npx lerna add package-name --scope=@wpmudev/react-foo | ||
lerna add package-name --scope=@wpmudev/react-foo | ||
# Development dependency | ||
npx lerna add package-name --dev --scope=@wpmudev/react-foo | ||
lerna add package-name --dev --scope=@wpmudev/react-foo | ||
# Peer dependency | ||
npx lerna add package-name --peer --scope=@wpmudev/react-foo | ||
lerna add package-name --peer --scope=@wpmudev/react-foo | ||
``` | ||
|
||
> **Note:** Remove `npx` if the package to be installed is an external package and not part of this monorepo. | ||
## Showcase | ||
|
||
Globally install [Yarn](https://yarnpkg.com/getting-started/install) and [Lerna](https://lerna.js.org/). Since showcase is managed by Storybook run this in the root directory to install Storybook CLI: | ||
|
||
``` | ||
npx sb init | ||
``` | ||
|
||
Now you can initialize your local environment: | ||
|
||
``` | ||
yarn run storybook | ||
``` | ||
>**Note:** Packages can only be manually upgraded and removed, after doing that it is necessary to run `lerna bootstrap` for all packages to upgrade. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.