It would be useful if I could somehow “hook” into the yarn plasmic sync
command, e.g. run something right after it is done.
The way it could be implemented is that after yarn plasmic sync
is done, if there is plasmic:postsync
script in package.json , it would be run automatically.
Or, it could be configured what command should be run after yarn plasmic sync
via plasmic.json
.
Why do I need this?
To automatically lint or improve Plasmic code before it is committed to the repository through the GH workflow (through plasmicapp/plasmic-action@master
sync github action command).
For example, I have a Custom Font called var(--hubot-sans-family)
. We use it throughout the project. However sometimes developers forget to use it and they refer to "Hubot Sans"
directly (this especially happens when importing stuff from Figma through Plasmic plugin).
This causes the font to render incorrectly. Currently we have to manually find and correct such font usages 1-by-1 …
What I’m trying to do now, is to search & replace "Hubot Sans"
in all plasmic *.css
files and replace them with var(--hubot-sans-family)
, which is easy - but unfortunately I have to do that during the build phase (causing dirty changes in the worktree, which may be annoying in local development), instead of during the sync phase.