html-sketchapp-cli
html-sketchapp-cli copied to clipboard
feat(ids): Support custom IDs for Sketch library sync
This adds a document/page name option in the config together with a customIds opt-in option that uses permanent IDs for shared styles in html-sketchapp if you know all IDs (data-sketch-text) are unique and will not change.
This PR should fix library sync between updates (symbols can have a permanent ID).
Documentation should probably be added to the README.md or a new file for setting symbol IDs:
symbolMiddleware: ({ symbol, node, suffix }) => {
const symbolName = node.dataset.sketchSymbol;
symbol.setId(`${symbolName}${suffix}`);
symbol.setName(symbolName);
},
I've added documentation to the README for text middleware.
New config options:
{
name: 'project-id-here',
customIds: true
}
#18
@macintoshhelper This PR seems to be just what I need 🙏 But I’m a little bit confused by symbolMiddleware, the textMiddleware from the README, and the new config options. Is the symbolMiddleware all I need for this to work?