-
Run
yarn
at the root of the repo. -
Run
yarn lerna link --force-local
at the root of the repo. -
Run
yarn build
at the root of the repo. -
Run
yarn dev
at each of the packages that depends on the other.
You can run a package individually:
yarn workspace {packageName} develop
-
Repeat the steps from the above section
-
Run
yarn link
on the package that you are developing -
Run
yarn
at the store's repo -
If the store's repo already have the package that you are developing as a dependency, just run
yarn link {packageName}
-
If your package is not an npm dependency yet, you can develop locally by referring to your local version of the package on gatsby config.
Example:
{
resolve: '/Users/jmgris/work/faststore/packages/gatsby-plugin-pixel-facebook'
}
You can generate the boilerplate files for your new component using the following command:
- run
yarn generate-ui-component
# What is your component name?
ComponentName
# What is your component atomic group? (Use arrow keys)
> atoms
> molecules
> organisms
- It will automatically generate the files below:
✔ ++ faststore/packages/ui/src/atoms/ComponentName/ComponentName.tsx
✔ ++ faststore/packages/ui/src/atoms/ComponentName/index.tsx
✔ ++ faststore/packages/styles/src/atoms/component-name.css
✔ ++ faststore/packages/ui/src/atoms/ComponentName/ComponentName.test.tsx
✔ ++ faststore/packages/ui/src/atoms/ComponentName/stories/ComponentName.stories.tsx
✔ ++ faststore/packages/ui/src/atoms/ComponentName/stories/ComponentName.mdx
✔ _+ faststore/packages/ui/src/index.ts
And that is it! You will be ready to work on your component. 🎉
For the component name, please follow the Pascal Case pattern, and do not use
-
, i.e., Component-Name.
Please do not edit
// Atoms
,// Molecules
and// Organisms
comments onpackages/ui/scr/index.ts
file, because we are using it as a pattern to update the file. For more details, check here.
-
Create a production build by running
yarn build
at the root of the package that you are developing -
Commit your changes in a branch
-
Push your changes to the remote repo and open a Pull Request
-
Use the
Local Install Instructions
provided on theCodeSandBox
bot in the PR to add your version of the packages as dependencies in thepackage.json
file of the storecomponents. -
Submit a Pull Request with this changes to
storecomponents
-
Wait for checks to pass and reviews to be approved.
-
After acquiring the necessary approval, rebase and squash-merge your PR in master
-
A bot will commit on master releasing your changes. In the meantime, go grab a coffee ☕
If the bot isn't working or you want to release it manually, use the following command to clean any artifact and release a clean build:
git clean -fdx && yarn && lerna run build && lerna publish patch --yes
- Update
package.json
of thestorecomponents
with:
yarn upgrade -L --scope @vtex
- Stage, commit and push your changes with:
git add . && git commit -m "upgrade deps" && git push
- Rebase with master
git rebase origin/master && git push --force
-
Wait for the PR checks to have been passed
-
Squash-merge for releasing a new store version 🎉