@sketch-hq/sketch-file-format
Advanced tools
Comparing version
@@ -5,2 +5,9 @@ # Changelog | ||
## [1.1.0](https://github.com/sketch-hq/sketch-file-format/compare/v1.0.3...v1.1.0) (2019-10-30) | ||
### Features | ||
* integrate the new sketch-reference-files dependency ([#17](https://github.com/sketch-hq/sketch-file-format/issues/17)) ([3b9bc98](https://github.com/sketch-hq/sketch-file-format/commit/3b9bc9891092ca63ae94d17ada9811908ac53d49)), closes [#13](https://github.com/sketch-hq/sketch-file-format/issues/13) | ||
### [1.0.3](https://github.com/sketch-hq/sketch-file-format/compare/v1.0.2...v1.0.3) (2019-10-25) | ||
@@ -7,0 +14,0 @@ |
@@ -84,3 +84,3 @@ { | ||
"appVersion": { | ||
"const": "57" | ||
"type": "string" | ||
}, | ||
@@ -94,6 +94,6 @@ "build": { | ||
"compatibilityVersion": { | ||
"const": 99 | ||
"type": "number" | ||
}, | ||
"version": { | ||
"const": 119 | ||
"type": "number" | ||
}, | ||
@@ -113,3 +113,4 @@ "variant": { | ||
"appVersion": { | ||
"const": "57" | ||
"type": "string", | ||
"enum": ["55.2", "56", "56.1", "56.2", "56.3", "57", "57.1"] | ||
}, | ||
@@ -120,3 +121,3 @@ "build": { | ||
}, | ||
"$id": "https://unpkg.com/@sketch-hq/sketch-file-format@1.0.3/dist/meta.schema.json", | ||
"$id": "https://unpkg.com/@sketch-hq/sketch-file-format@1.1.0/dist/meta.schema.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
@@ -123,0 +124,0 @@ "definitions": { |
@@ -43,3 +43,3 @@ { | ||
}, | ||
"$id": "https://unpkg.com/@sketch-hq/sketch-file-format@1.0.3/dist/user.schema.json", | ||
"$id": "https://unpkg.com/@sketch-hq/sketch-file-format@1.1.0/dist/user.schema.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
@@ -46,0 +46,0 @@ "definitions": { |
@@ -0,1 +1,2 @@ | ||
exports.version = 119 | ||
exports.document = require('./dist/document.schema.json') | ||
@@ -2,0 +3,0 @@ exports.fileFormat = require('./dist/file-format.schema.json') |
{ | ||
"name": "@sketch-hq/sketch-file-format", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -13,2 +13,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@sketch-hq/sketch-reference-files": "2.0.0", | ||
"ajv": "6.10.2", | ||
@@ -15,0 +16,0 @@ "chalk": "2.4.2", |
@@ -30,2 +30,6 @@ # Sketch File Format | ||
## Related projects | ||
- [sketch-reference-files](https://github.com/sketch-hq/sketch-reference-files/) | ||
## Use cases | ||
@@ -40,5 +44,5 @@ | ||
### Node/TypeScript/JavaScript | ||
### JavaScript | ||
Setup/create your npm-based JavaScript project as usual, then | ||
Add the npm module using `npm` or `yarn` | ||
@@ -53,10 +57,15 @@ ``` | ||
The `schemas` object above has the following properties. See the | ||
[Schemas](./#schemas) section for definitions. | ||
The shape of the `schemas` object above is illustrated by the following type | ||
definition (see the [Schemas](./#schemas) section for explanations): | ||
- `fileFormat` | ||
- `document` | ||
- `page` | ||
- `meta` | ||
- `user` | ||
```typescript | ||
type Schemas = { | ||
version: number // Supported document version | ||
fileFormat: JSONSchema | ||
document: JSONSchema | ||
page: JSONSchema | ||
meta: JSONSchema | ||
user: JSONSchema | ||
} | ||
``` | ||
@@ -71,3 +80,3 @@ ### HTTP | ||
1. Check you have sufficient versions of Yarn (>=1.13) and Node (>=12) installed | ||
1. Check you have modern versions of Yarn and Node installed | ||
1. Check out the repo | ||
@@ -96,4 +105,5 @@ 1. Run `yarn` to setup the dependencies | ||
[_document version_ and _app version_](https://developer.sketch.com/file-format/versioning). | ||
These schemas are related to the _document version_ only, which can change less | ||
frequently than the Sketch major version. | ||
These schemas are related to the _document version_ only. This value can change | ||
less frequently than the Sketch desktop app version but will increment everytime | ||
there's any change to the Sketch file format. | ||
@@ -103,4 +113,4 @@ Conceptually this file format spec sits _upstream_ of Sketch. This means we will | ||
version of Sketch that supports it. A future goal is that this file format spec | ||
is incorporated into Sketch's build and test process, formalising the | ||
relationship between the two. | ||
is incorporated into our internal processes, strengthening the relationship | ||
between this spec and our products that implement it. | ||
@@ -112,3 +122,3 @@ The table below indicates the relationship between file format versions and the | ||
| ------------------ | ---------------------------- | | ||
| `1.0.*` | `119` (Sketch `55.2 - 57.0`) | | ||
| `1.*.*` | `119` (Sketch `55.2 - 57.1`) | | ||
@@ -119,12 +129,15 @@ > Check the [changelog](./CHANGELOG.md) for more information. | ||
The version of these file format schemas will strictly follow | ||
[semver](https://semver.org/), remaining entirely independent of the Sketch app | ||
or document version. | ||
The version of these file format schemas will follow | ||
[semver](https://semver.org/), remaining independent of the Sketch version. | ||
- **Major version bump** The schemas fail to validate a document that was | ||
previously considered valid by prior versions | ||
- **Minor version bump** Introduction of changes in a backwards compatible | ||
manner, for example adding a new optional field and/or§ adding a deprecated | ||
flag on an old one | ||
- **Patch version bump** Bug fixes, documentation improvements and other trivial | ||
previously considered valid by prior versions. A change in Sketch document | ||
version will mean a major bump too, since document version is currently | ||
declared as a constant in the schemas | ||
- **Minor version bump** While any document version change results in a major | ||
bump we're unlikely to see many backwards compatible new features and an | ||
associated minor version bump. This may change in future though as we | ||
normalise the relationship between this spec and other Sketch products, in | ||
which case we'll be able to make better use of the full semver semantics | ||
- **Patch version bump** Bug fixes, documentation improvements or trivial | ||
changes that don't affect the semantics of the schemas | ||
@@ -131,0 +144,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
284981
0.42%179
7.83%15
7.14%11029
-0.11%