Development
There are 3 ways to develop:
-
Change and run tests on local machine:
- add a new functionality or change any existing
- change
variables.jsonfile in the root folder - change related tests of changed functionality
-
Link this repository with your real project as its dependence:
- In
figma-extractorrepository, 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-extractorin node_module to earlier created link as symbol link folder. - Inside
figma-extractorfolder, you need to launchyarn buildevery time after any changes. It's necessary to create compiled JS files intodistfolder for proper work. - Inside project folder, you can run
pnpm extractto launch your linkedfigma-extractor.
- In
Remember! You need to launch
yarn buildafter any changes infigma-extractorrepository
Note: In this case, you create a just a link between extractor and your project without installing
peerDependeciesoffigma-extractorIf you want to installpeerDependeciesyou 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.jsonto"@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
peerDependeciesof figma-extractor. - Launch
pnpm installin the root of your project to create a link - Use
pnpm extractas usually
- Inside your project, you need replace the line
Remember! You need to launch
yarn buildas well when there are any changes infigma-extractorrepository