Skip to content

Commit 04d9368

Browse files
github-actions[bot]acao
authored andcommitted
chore(release): changesets versioning & publication
1 parent a73c517 commit 04d9368

File tree

5 files changed

+169
-96
lines changed

5 files changed

+169
-96
lines changed

.changeset/strange-chicken-smell.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
# codemirror-json-schema
22

3+
## 0.5.0
4+
5+
### Minor Changes
6+
7+
- [#63](https://github.com/acao/codemirror-json-schema/pull/63) [`a73c517`](https://github.com/acao/codemirror-json-schema/commit/a73c517722bbe9d37124993117c091e259eb6998) Thanks [@acao](https://github.com/acao)! - **breaking change**: only impacts those following the "custom usage" approach, it _does not_ effect users using the high level, "bundled" `jsonSchema()` or `json5Schema()` modes.
8+
9+
Previously, we ask you to pass schema to each of the linter, completion and hover extensions.
10+
11+
Now, we ask you to use these new exports to instantiate your schema like this, with `stateExtensions(schema)` as a new extension, and the only one that you pass schema to, like so:
12+
13+
```ts
14+
import type { JSONSchema7 } from "json-schema";
15+
import { json, jsonLanguage, jsonParseLinter } from "@codemirror/lang-json";
16+
import { hoverTooltip } from "@codemirror/view";
17+
import { linter } from "@codemirror/lint";
18+
19+
import {
20+
jsonCompletion,
21+
handleRefresh,
22+
jsonSchemaLinter,
23+
jsonSchemaHover,
24+
stateExtensions,
25+
} from "codemirror-json-schema";
26+
27+
import schema from "./myschema.json";
28+
29+
// ...
30+
extensions: [
31+
json(),
32+
linter(jsonParseLinter()),
33+
linter(jsonSchemaLinter(), {
34+
needsRefresh: handleRefresh,
35+
}),
36+
jsonLanguage.data.of({
37+
autocomplete: jsonCompletion(),
38+
}),
39+
hoverTooltip(jsonSchemaHover()),
40+
// this is where we pass the schema!
41+
// very important!!!!
42+
stateExtensions(schema),
43+
];
44+
```
45+
346
## 0.4.5
447

548
### Patch Changes

0 commit comments

Comments
 (0)