Skip to content

Commit e432d1c

Browse files
authored
fix publish, exports (#22)
1 parent 3a578e9 commit e432d1c

File tree

7 files changed

+83
-78
lines changed

7 files changed

+83
-78
lines changed

.github/workflows/release.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ jobs:
4646
uses: changesets/action@v1
4747
with:
4848
# This expects you to have a script called release which does a build for your packages and calls changeset publish
49-
publish: pnpm build && pnpm changeset publish
49+
publish: pnpm release
50+
version: pnpm version-packages
5051
env:
5152
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5253
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

docs/modules/index.md

+16-72
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
- [getJsonPointerAt](index.md#getjsonpointerat)
1616
- [getJsonPointers](index.md#getjsonpointers)
1717
- [jsonPointerForPosition](index.md#jsonpointerforposition)
18-
- [parseJSON5Document](index.md#parsejson5document)
19-
- [parseJSON5DocumentState](index.md#parsejson5documentstate)
2018
- [parseJSONDocument](index.md#parsejsondocument)
2119
- [parseJSONDocumentState](index.md#parsejsondocumentstate)
2220

@@ -63,7 +61,7 @@ provides a JSON schema enabled autocomplete extension for codemirror
6361

6462
#### Defined in
6563

66-
[json-completion.ts:820](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/json-completion.ts#L820)
64+
[json-completion.ts:820](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/json-completion.ts#L820)
6765

6866
---
6967

@@ -100,7 +98,7 @@ provides a JSON schema enabled tooltip extension for codemirror
10098

10199
#### Defined in
102100

103-
[json-hover.ts:24](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/json-hover.ts#L24)
101+
[json-hover.ts:24](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/json-hover.ts#L24)
104102

105103
---
106104

@@ -135,7 +133,7 @@ Helper for simpler class instantiaton
135133

136134
#### Defined in
137135

138-
[json-validation.ts:35](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/json-validation.ts#L35)
136+
[json-validation.ts:35](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/json-validation.ts#L35)
139137

140138
## Utilities
141139

@@ -162,7 +160,7 @@ this could be useful for other things later!
162160

163161
#### Defined in
164162

165-
[utils/jsonPointers.ts:37](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/utils/jsonPointers.ts#L37)
163+
[utils/jsonPointers.ts:37](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/utils/jsonPointers.ts#L37)
166164

167165
---
168166

@@ -185,7 +183,7 @@ retrieve a Map of all the json pointers in a document
185183

186184
#### Defined in
187185

188-
[utils/jsonPointers.ts:98](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/utils/jsonPointers.ts#L98)
186+
[utils/jsonPointers.ts:98](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/utils/jsonPointers.ts#L98)
189187

190188
---
191189

@@ -210,61 +208,7 @@ retrieve a JSON pointer for a given position in the editor
210208

211209
#### Defined in
212210

213-
[utils/jsonPointers.ts:81](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/utils/jsonPointers.ts#L81)
214-
215-
---
216-
217-
### parseJSON5Document
218-
219-
**parseJSON5Document**(`jsonString`): `Object`
220-
221-
Mimics the behavior of `json-source-map`'s `parseJSONDocument` function, for json5!
222-
223-
#### Parameters
224-
225-
| Name | Type |
226-
| :----------- | :------- |
227-
| `jsonString` | `string` |
228-
229-
#### Returns
230-
231-
`Object`
232-
233-
| Name | Type |
234-
| :--------- | :-------------------------------------------- |
235-
| `data` | `any` |
236-
| `pointers` | [`JSONPointersMap`](index.md#jsonpointersmap) |
237-
238-
#### Defined in
239-
240-
[utils/parseJSON5Document.ts:28](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/utils/parseJSON5Document.ts#L28)
241-
242-
---
243-
244-
### parseJSON5DocumentState
245-
246-
**parseJSON5DocumentState**(`state`): `Object`
247-
248-
Return parsed data and json5 pointers for a given codemirror EditorState
249-
250-
#### Parameters
251-
252-
| Name | Type |
253-
| :------ | :------------ |
254-
| `state` | `EditorState` |
255-
256-
#### Returns
257-
258-
`Object`
259-
260-
| Name | Type |
261-
| :--------- | :-------------------------------------------- |
262-
| `data` | `any` |
263-
| `pointers` | [`JSONPointersMap`](index.md#jsonpointersmap) |
264-
265-
#### Defined in
266-
267-
[utils/parseJSON5Document.ts:14](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/utils/parseJSON5Document.ts#L14)
211+
[utils/jsonPointers.ts:81](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/utils/jsonPointers.ts#L81)
268212

269213
---
270214

@@ -291,7 +235,7 @@ Mimics the behavior of `json-source-map`'s `parseJSONDocument` function using co
291235

292236
#### Defined in
293237

294-
[utils/parseJSONDocument.ts:23](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/utils/parseJSONDocument.ts#L23)
238+
[utils/parseJSONDocument.ts:23](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/utils/parseJSONDocument.ts#L23)
295239

296240
---
297241

@@ -318,7 +262,7 @@ Return parsed data and json pointers for a given codemirror EditorState
318262

319263
#### Defined in
320264

321-
[utils/parseJSONDocument.ts:9](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/utils/parseJSONDocument.ts#L9)
265+
[utils/parseJSONDocument.ts:9](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/utils/parseJSONDocument.ts#L9)
322266

323267
## Type Aliases
324268

@@ -335,7 +279,7 @@ Return parsed data and json pointers for a given codemirror EditorState
335279

336280
#### Defined in
337281

338-
[json-hover.ts:9](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/json-hover.ts#L9)
282+
[json-hover.ts:9](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/json-hover.ts#L9)
339283

340284
---
341285

@@ -345,7 +289,7 @@ Return parsed data and json pointers for a given codemirror EditorState
345289

346290
#### Defined in
347291

348-
[json-hover.ts:11](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/json-hover.ts#L11)
292+
[json-hover.ts:11](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/json-hover.ts#L11)
349293

350294
---
351295

@@ -362,7 +306,7 @@ Return parsed data and json pointers for a given codemirror EditorState
362306

363307
#### Defined in
364308

365-
[json-hover.ts:13](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/json-hover.ts#L13)
309+
[json-hover.ts:13](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/json-hover.ts#L13)
366310

367311
---
368312

@@ -372,7 +316,7 @@ Return parsed data and json pointers for a given codemirror EditorState
372316

373317
#### Defined in
374318

375-
[utils/jsonPointers.ts:8](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/utils/jsonPointers.ts#L8)
319+
[utils/jsonPointers.ts:8](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/utils/jsonPointers.ts#L8)
376320

377321
---
378322

@@ -389,7 +333,7 @@ Return parsed data and json pointers for a given codemirror EditorState
389333

390334
#### Defined in
391335

392-
[types.ts:3](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/types.ts#L3)
336+
[types.ts:3](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/types.ts#L3)
393337

394338
---
395339

@@ -408,7 +352,7 @@ Return parsed data and json pointers for a given codemirror EditorState
408352

409353
#### Defined in
410354

411-
[types.ts:8](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/types.ts#L8)
355+
[types.ts:8](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/types.ts#L8)
412356

413357
---
414358

@@ -418,7 +362,7 @@ Return parsed data and json pointers for a given codemirror EditorState
418362

419363
#### Defined in
420364

421-
[types.ts:15](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/types.ts#L15)
365+
[types.ts:15](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/types.ts#L15)
422366

423367
---
424368

@@ -435,4 +379,4 @@ Return parsed data and json pointers for a given codemirror EditorState
435379

436380
#### Defined in
437381

438-
[json-validation.ts:24](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/json-validation.ts#L24)
382+
[json-validation.ts:24](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/json-validation.ts#L24)

docs/modules/json5.md

+61-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
- [json5SchemaHover](json5.md#json5schemahover)
1010
- [json5SchemaLinter](json5.md#json5schemalinter)
1111

12+
### Utilities
13+
14+
- [parseJSON5Document](json5.md#parsejson5document)
15+
- [parseJSON5DocumentState](json5.md#parsejson5documentstate)
16+
1217
## Codemirror Extensions
1318

1419
### json5SchemaHover
@@ -44,7 +49,7 @@ Instantiates a JSONHover instance with the JSON5 mode
4449

4550
#### Defined in
4651

47-
[json5-hover.ts:11](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/json5-hover.ts#L11)
52+
[json5-hover.ts:11](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/json5-hover.ts#L11)
4853

4954
---
5055

@@ -79,4 +84,58 @@ Instantiates a JSONValidation instance with the JSON5 mode
7984

8085
#### Defined in
8186

82-
[json5-validation.ts:10](https://github.com/acao/codemirror-json-schema/blob/c97650d/src/json5-validation.ts#L10)
87+
[json5-validation.ts:10](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/json5-validation.ts#L10)
88+
89+
## Utilities
90+
91+
### parseJSON5Document
92+
93+
**parseJSON5Document**(`jsonString`): `Object`
94+
95+
Mimics the behavior of `json-source-map`'s `parseJSONDocument` function, for json5!
96+
97+
#### Parameters
98+
99+
| Name | Type |
100+
| :----------- | :------- |
101+
| `jsonString` | `string` |
102+
103+
#### Returns
104+
105+
`Object`
106+
107+
| Name | Type |
108+
| :--------- | :-------------------------------------------- |
109+
| `data` | `any` |
110+
| `pointers` | [`JSONPointersMap`](index.md#jsonpointersmap) |
111+
112+
#### Defined in
113+
114+
[utils/parseJSON5Document.ts:28](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/utils/parseJSON5Document.ts#L28)
115+
116+
---
117+
118+
### parseJSON5DocumentState
119+
120+
**parseJSON5DocumentState**(`state`): `Object`
121+
122+
Return parsed data and json5 pointers for a given codemirror EditorState
123+
124+
#### Parameters
125+
126+
| Name | Type |
127+
| :------ | :------------ |
128+
| `state` | `EditorState` |
129+
130+
#### Returns
131+
132+
`Object`
133+
134+
| Name | Type |
135+
| :--------- | :-------------------------------------------- |
136+
| `data` | `any` |
137+
| `pointers` | [`JSONPointersMap`](index.md#jsonpointersmap) |
138+
139+
#### Defined in
140+
141+
[utils/parseJSON5Document.ts:14](https://github.com/acao/codemirror-json-schema/blob/3a578e9/src/utils/parseJSON5Document.ts#L14)

lefthook.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ pre-commit:
1212
run: pnpm prettier --write {staged_files}
1313
stage_fixed: true
1414
typedoc:
15-
run: pnpm typedoc
15+
run: pnpm typedoc && git add docs
1616
glob: "*.{js,ts,jsx,tsx}"
17-
stage_fixed: true
1817
test:
1918
run: pnpm vitest related --run --dom {staged_files}
2019
glob: "*.{js,ts,jsx,tsx}"

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
"build": "tsc && vite build ./dev --outDir ../public --emptyOutDir && pnpm typedoc",
8686
"test": "vitest --dom",
8787
"test:coverage": "vitest run --dom --coverage",
88+
"version-packages": "changeset version && prettier --write .",
8889
"release": "pnpm build && changeset publish",
8990
"typedoc": "typedoc --out docs src/index.ts src/json5.ts",
9091
"postinstall": "lefthook install"

src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ export type {
2121
*/
2222
export * from "./utils/parseJSONDocument";
2323
export * from "./utils/jsonPointers";
24-
export * from "./utils/parseJSON5Document";

src/json5.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// json5
22
export { json5SchemaLinter } from "./json5-validation";
33
export { json5SchemaHover } from "./json5-hover";
4+
5+
export * from "./utils/parseJSON5Document";

0 commit comments

Comments
 (0)