Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

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

Closed
wants to merge 3 commits into from

Conversation

macintoshhelper
Copy link

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 for setting symbol IDs:

  symbolMiddleware: ({ symbol, node, suffix }) => {
    const symbolName = node.dataset.sketchSymbol;

    symbol.setId(`${symbolName}${suffix}`);
    symbol.setName(symbolName);
  },

New config options:

{
  name: 'project-id-here',
  customIds: true
}

Depends on changes in html-sketchapp/html-sketchapp#151 (that would need to be merged first).

#18

@macintoshhelper
Copy link
Author

symbol-middleware.test.js fails because of a snapshot test mismatch. Not sure what's causing this and whether it's safe to override the snapshot test.

@macintoshhelper macintoshhelper changed the title Support custom IDs for Sketch library sync feat(ids): Support custom IDs for Sketch library sync Nov 23, 2018
@markdalgleish
Copy link
Member

Hey, thanks for this PR! Definitely keen to support this behaviour. However, since we're unable to merge this PR until html-sketchapp/html-sketchapp#151 is merged first, I'm closing this for now. Please feel free to reopen once this is no longer the case.

@michalsnik
Copy link

The html-sketchapp/html-sketchapp#151 has been merged, can you please reopen this PR @macintoshhelper @markdalgleish ? :)

@macintoshhelper
Copy link
Author

I've reopened it with changes for the new text middleware, apologies for the delay!

@michalsnik @markdalgleish

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants