"Hook" needed for `yarn plasmic sync` command for automatic post-sync tasks

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.

Hi @marketable_crab
I think you can still achieve your goal by adding a custom command in your project package.json such as

"plasmic-sync": "npx plasmic sync && echo 'Command 1 completed!'"

You can chain as many commands using && operator. The above command will log Command 1 completed! after the plasmic sync.

Using the similar technique you can add your pre-commit commands.

Yeah I have it already like that:

"plasmic:sync": "plasmic sync --yes && yarn plasmic:postsync",
    "plasmic:postsync": "node plasmic-postsync.mjs",

But plasmic’s GH workflow runs plasmic sync not npm run plasmic-sync under the hood, so I can’t hook into that

(I’d have to reimplement plasmic’s GH workflow but I’d rather not)

P.S. I could submit a PR somewhere, but it’d be good to agree on a desired interface/implementation first, before I do it