## Description - Move [ADS](https://github.com/appsmithorg/design-system) to local packages - Fix ADS stories according of Storybook 8 - Fix type errors - Update Storybook to latest version to be able to run `test-storybook` - Remove unused files(components, tests, stories) from ADS-old(design-system-old) Following steps: - Merge `ads-old` and `widgets-old`, only 1 package should remain - Rename packages https://github.com/appsmithorg/appsmith/issues/27658 - Use `importSvg` `importRemixIcon` from ADS remove this functionality from `ads-old` Fixes #34252 ## Automation /ok-to-test tags="@tag.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10114839347> > Commit: 64cdfec4d2acd45ca955cc0d19c3cb582e1ac0ad > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10114839347&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Fri, 26 Jul 2024 17:49:25 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
3.5 KiB
Refer to the README for a guide on how to get started with contributing.
Using yalc
When you make a change in the design system, you will want to ensure that the component works as expected in the app you are using it for. To emulate working with published packages locally, we use yalc.
Installation
Run
yarn global add yalc
Setting up for appsmith usage
If we're going to use this package in the appsmith repository, we need to make some additional changes to this repository.
- navigate to the
package/design-system/package.jsonfile - Make sure you change the field
"name": "@appsmithorg/design-system"to"name": "design-system". We do this so that we don't run into alias conflicts later. - Make sure you do not commit this file
In this repository
We need to "publish" our package.
- Make sure the package builds by running
yarn build - Make sure the functionality works as expected in the playground by running
yarn storybookand then testing your component out in the relevant story - If you are writing a new component, write a story for it taking another story from this repository as reference. You could also refer to the official docs.
- When you've done all of this, run
yalc publish. It will output the package name and number.
In the other repository
- Run
yalc add design-systemin the appsmith repository. - This will create changes in your
package.lockfile. Runyarnto get the new package version fromyalc. - This will create changes in your
yarn.lockfile, which is what we want. Make sure you do not commit these changes.
Now you can test your app while including the changes made in this package. Go ahead and run your local development environment, or some cypress tests.
Please note that yalc will not test any uncommitted changes you make in your file system. Make sure you have everything you need in the commits (you can always revert bad ones!)
Non-local testing
You can create an alpha release of your branch so that other people can see and test your changes in a different repository (on a CI, for example). To do this,
- In your
package.json, make sure theversionkey is set to be the latest alpha version listed on theversionstab on our npm package listing. If you don't do this, the alpha version you create will overwrite an existing version and bad things might happen. - Run
./alpha-release.shin your shell. In order to complete this script, you will need an OTP which only members of the @appsmithorg organisation on npm have access to. Please contact someone from the design system pod before you start this action.
Creating stories
When you create a component, make sure you write a well-defined story for it. A well defined story is one that
- Denotes the default state of the component
- Denotes all the variants of the component
- Has a list of all the things the component can be
You can create a template for your stories by running
yarn create-story -f <DIRECTORY_NAME>
where ideally your directory name matches your component name exactly.
Contribution Guidelines: Code Style
- Destructure function props where possible: https://github.com/appsmithorg/design-system/pull/109