Development
There are 3 ways to develop:
-
Change and run tests on local machine:
- add a new functionality or change any existing
- change
variables.json
file in the root folder - change related tests of changed functionality
-
Link this repository with your real project as its dependence:
- In
figma-extractor
repository, it's necessary to runpnpm link --global
. It creates a link inside the cache folder of pnpm with name:@shakuroinc/figma-extractor
- Inside your project, you need to run
pnpm link --global @shakuroinc/figma-extractor
. It should replace your real package@shakuroinc/figma-extractor
in node_module to earlier created link as symbol link folder. - Inside
figma-extractor
folder, you need to launchyarn build
every time after any changes. It's necessary to create compiled JS files intodist
folder for proper work. - Inside project folder, you can run
pnpm extract
to launch your linkedfigma-extractor
.
- In
Remember! You need to launch
yarn build
after any changes infigma-extractor
repository
Note: In this case, you create a just a link between extractor and your project without installing
peerDependecies
offigma-extractor
If you want to installpeerDependecies
you should use 3 way which is described below
- Link this repository with your real project through file protocol:
- Inside your project, you need replace the line
"@shakuroinc/figma-extractor": "{number of your current version}"
insidepackage.json
to"@shakuroinc/figma-extractor": "file:{here the absolute path of figma-extractor folder}"
. - This way creates link between your project and figma-extractor and installs all
peerDependecies
of figma-extractor. - Launch
pnpm install
in the root of your project to create a link - Use
pnpm extract
as usually
- Inside your project, you need replace the line
Remember! You need to launch
yarn build
as well when there are any changes infigma-extractor
repository