html-sketchapp-cli icon indicating copy to clipboard operation
html-sketchapp-cli copied to clipboard

feat(ids): Support custom IDs for Sketch library sync

Open macintoshhelper opened this issue 6 years ago • 1 comments

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 avatar Jan 04 '19 18:01 macintoshhelper

@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?

JacobBlomgren avatar Feb 19 '19 17:02 JacobBlomgren