Skip to content

Commit

Permalink
feat: workspaces (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedrichards authored May 6, 2020
1 parent a541bc5 commit 7b43342
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-pumas-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sketch-hq/sketch-file-format': patch
---

Add workspace schema.
3 changes: 3 additions & 0 deletions schema/file-format.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ description:
merged into a single object. A concrete example of an expanded sketch file is
the return value of the `fromFile` function
type: object
optional:
- workspace
properties:
document:
allOf:
Expand All @@ -16,3 +18,4 @@ properties:
items: { $ref: ./layers/page.schema.yaml }
meta: { $ref: ./meta.schema.yaml }
user: { $ref: ./user.schema.yaml }
workspace: { $ref: ./workspace.schema.yaml }
29 changes: 29 additions & 0 deletions schema/objects/assistants-workspace.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
title: Assistants Workspace Entry
description:
Contains Assistant configuration that travels with the document in the file
workspace. Maintains a record of which Assistants have been installed to the
document and where they've been installed from in the `dependencies` field.
Additionally Assistant metadata from their package.json files are cached in
the `dependencyMetadata` field.
type: object
properties:
dependencies:
type: object
patternProperties:
^.+$: { type: string }
dependencyMetadata:
type: object
patternProperties:
^.+$:
type: object
properties:
sketch: { type: string }
homepage: { type: string }
name: { type: string }
version: { type: string }
sketch-assistants:
type: object
properties:
title: { type: string }
icon: { type: string }
description: { type: string }
16 changes: 16 additions & 0 deletions schema/workspace.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
title: Workspace
description:
The workspace is a folder in the Sketch file archive that can contain
arbitrary JSON files, allowing Sketch and 3rd party products and tools to
store settings that should travel with the Sketch document. To avoid clashes
or settings being overridden, select a unique name for your workspace file. A
workspace file named `assistants` has been reserved for Sketch Assistant
settings, and is specified below. Note that custom layer-level data should
continue to be stored in `userInfo` of these objects, not within the
workspace.
type: object
additionalProperties:
type: object
additionalProperties: true
properties:
assistants: { $ref: ./objects/assistants-workspace.schema.yaml }

0 comments on commit 7b43342

Please sign in to comment.