@openpkg-ts/spec 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Ryan Waits
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.js CHANGED
@@ -250,11 +250,7 @@ var openpkg_schema_default = {
250
250
  title: "OpenPkg Specification",
251
251
  description: "Schema for OpenPkg specification files",
252
252
  type: "object",
253
- required: [
254
- "openpkg",
255
- "meta",
256
- "exports"
257
- ],
253
+ required: ["openpkg", "meta", "exports"],
258
254
  properties: {
259
255
  $schema: {
260
256
  type: "string",
@@ -270,9 +266,7 @@ var openpkg_schema_default = {
270
266
  meta: {
271
267
  type: "object",
272
268
  description: "Package metadata",
273
- required: [
274
- "name"
275
- ],
269
+ required: ["name"],
276
270
  properties: {
277
271
  name: {
278
272
  type: "string",
@@ -322,12 +316,7 @@ var openpkg_schema_default = {
322
316
  $defs: {
323
317
  docSignal: {
324
318
  type: "string",
325
- enum: [
326
- "description",
327
- "params",
328
- "returns",
329
- "examples"
330
- ]
319
+ enum: ["description", "params", "returns", "examples"]
331
320
  },
332
321
  docDrift: {
333
322
  type: "object",
@@ -335,7 +324,17 @@ var openpkg_schema_default = {
335
324
  properties: {
336
325
  type: {
337
326
  type: "string",
338
- enum: ["param-mismatch", "param-type-mismatch", "return-type-mismatch", "generic-constraint-mismatch", "optionality-mismatch", "deprecated-mismatch", "visibility-mismatch", "example-drift", "broken-link"]
327
+ enum: [
328
+ "param-mismatch",
329
+ "param-type-mismatch",
330
+ "return-type-mismatch",
331
+ "generic-constraint-mismatch",
332
+ "optionality-mismatch",
333
+ "deprecated-mismatch",
334
+ "visibility-mismatch",
335
+ "example-drift",
336
+ "broken-link"
337
+ ]
339
338
  },
340
339
  target: {
341
340
  type: "string",
@@ -382,11 +381,7 @@ var openpkg_schema_default = {
382
381
  },
383
382
  export: {
384
383
  type: "object",
385
- required: [
386
- "id",
387
- "name",
388
- "kind"
389
- ],
384
+ required: ["id", "name", "kind"],
390
385
  properties: {
391
386
  id: {
392
387
  type: "string",
@@ -415,14 +410,7 @@ var openpkg_schema_default = {
415
410
  kind: {
416
411
  type: "string",
417
412
  description: "Kind of export",
418
- enum: [
419
- "function",
420
- "class",
421
- "variable",
422
- "interface",
423
- "type",
424
- "enum"
425
- ]
413
+ enum: ["function", "class", "variable", "interface", "type", "enum"]
426
414
  },
427
415
  description: {
428
416
  type: "string",
@@ -444,10 +432,7 @@ var openpkg_schema_default = {
444
432
  },
445
433
  type: {
446
434
  description: "Type reference or inline schema for variables",
447
- oneOf: [
448
- { type: "string" },
449
- { $ref: "#/$defs/schema" }
450
- ]
435
+ oneOf: [{ type: "string" }, { $ref: "#/$defs/schema" }]
451
436
  },
452
437
  members: {
453
438
  type: "array",
@@ -478,11 +463,7 @@ var openpkg_schema_default = {
478
463
  },
479
464
  typeDef: {
480
465
  type: "object",
481
- required: [
482
- "id",
483
- "name",
484
- "kind"
485
- ],
466
+ required: ["id", "name", "kind"],
486
467
  properties: {
487
468
  id: {
488
469
  type: "string",
@@ -511,12 +492,7 @@ var openpkg_schema_default = {
511
492
  kind: {
512
493
  type: "string",
513
494
  description: "Kind of type definition",
514
- enum: [
515
- "interface",
516
- "type",
517
- "enum",
518
- "class"
519
- ]
495
+ enum: ["interface", "type", "enum", "class"]
520
496
  },
521
497
  description: {
522
498
  type: "string",
@@ -572,10 +548,7 @@ var openpkg_schema_default = {
572
548
  },
573
549
  parameter: {
574
550
  type: "object",
575
- required: [
576
- "name",
577
- "required"
578
- ],
551
+ required: ["name", "required"],
579
552
  properties: {
580
553
  name: {
581
554
  type: "string",
@@ -620,17 +593,13 @@ var openpkg_schema_default = {
620
593
  pattern: "^#/types/[A-Za-z0-9_.-]+$"
621
594
  }
622
595
  },
623
- required: [
624
- "$ref"
625
- ],
596
+ required: ["$ref"],
626
597
  additionalProperties: false
627
598
  },
628
599
  {
629
600
  type: "object",
630
601
  not: {
631
- required: [
632
- "$ref"
633
- ]
602
+ required: ["$ref"]
634
603
  },
635
604
  additionalProperties: true
636
605
  }
@@ -638,10 +607,7 @@ var openpkg_schema_default = {
638
607
  },
639
608
  sourceLocation: {
640
609
  type: "object",
641
- required: [
642
- "file",
643
- "line"
644
- ],
610
+ required: ["file", "line"],
645
611
  properties: {
646
612
  file: {
647
613
  type: "string",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpkg-ts/spec",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Shared schema, validation, and diff utilities for OpenPkg specs",
5
5
  "keywords": [
6
6
  "openpkg",
@@ -4,11 +4,7 @@
4
4
  "title": "OpenPkg Specification",
5
5
  "description": "Schema for OpenPkg specification files",
6
6
  "type": "object",
7
- "required": [
8
- "openpkg",
9
- "meta",
10
- "exports"
11
- ],
7
+ "required": ["openpkg", "meta", "exports"],
12
8
  "properties": {
13
9
  "$schema": {
14
10
  "type": "string",
@@ -24,9 +20,7 @@
24
20
  "meta": {
25
21
  "type": "object",
26
22
  "description": "Package metadata",
27
- "required": [
28
- "name"
29
- ],
23
+ "required": ["name"],
30
24
  "properties": {
31
25
  "name": {
32
26
  "type": "string",
@@ -72,11 +66,7 @@
72
66
  "$defs": {
73
67
  "export": {
74
68
  "type": "object",
75
- "required": [
76
- "id",
77
- "name",
78
- "kind"
79
- ],
69
+ "required": ["id", "name", "kind"],
80
70
  "properties": {
81
71
  "id": {
82
72
  "type": "string",
@@ -105,14 +95,7 @@
105
95
  "kind": {
106
96
  "type": "string",
107
97
  "description": "Kind of export",
108
- "enum": [
109
- "function",
110
- "class",
111
- "variable",
112
- "interface",
113
- "type",
114
- "enum"
115
- ]
98
+ "enum": ["function", "class", "variable", "interface", "type", "enum"]
116
99
  },
117
100
  "description": {
118
101
  "type": "string",
@@ -134,10 +117,7 @@
134
117
  },
135
118
  "type": {
136
119
  "description": "Type reference or inline schema for variables",
137
- "oneOf": [
138
- { "type": "string" },
139
- { "$ref": "#/$defs/schema" }
140
- ]
120
+ "oneOf": [{ "type": "string" }, { "$ref": "#/$defs/schema" }]
141
121
  },
142
122
  "members": {
143
123
  "type": "array",
@@ -164,11 +144,7 @@
164
144
  },
165
145
  "typeDef": {
166
146
  "type": "object",
167
- "required": [
168
- "id",
169
- "name",
170
- "kind"
171
- ],
147
+ "required": ["id", "name", "kind"],
172
148
  "properties": {
173
149
  "id": {
174
150
  "type": "string",
@@ -197,12 +173,7 @@
197
173
  "kind": {
198
174
  "type": "string",
199
175
  "description": "Kind of type definition",
200
- "enum": [
201
- "interface",
202
- "type",
203
- "enum",
204
- "class"
205
- ]
176
+ "enum": ["interface", "type", "enum", "class"]
206
177
  },
207
178
  "description": {
208
179
  "type": "string",
@@ -258,10 +229,7 @@
258
229
  },
259
230
  "parameter": {
260
231
  "type": "object",
261
- "required": [
262
- "name",
263
- "required"
264
- ],
232
+ "required": ["name", "required"],
265
233
  "properties": {
266
234
  "name": {
267
235
  "type": "string",
@@ -302,17 +270,13 @@
302
270
  "pattern": "^#/types/[A-Za-z0-9_.-]+$"
303
271
  }
304
272
  },
305
- "required": [
306
- "$ref"
307
- ],
273
+ "required": ["$ref"],
308
274
  "additionalProperties": false
309
275
  },
310
276
  {
311
277
  "type": "object",
312
278
  "not": {
313
- "required": [
314
- "$ref"
315
- ]
279
+ "required": ["$ref"]
316
280
  },
317
281
  "additionalProperties": true
318
282
  }
@@ -320,10 +284,7 @@
320
284
  },
321
285
  "sourceLocation": {
322
286
  "type": "object",
323
- "required": [
324
- "file",
325
- "line"
326
- ],
287
+ "required": ["file", "line"],
327
288
  "properties": {
328
289
  "file": {
329
290
  "type": "string",
@@ -4,11 +4,7 @@
4
4
  "title": "OpenPkg Specification",
5
5
  "description": "Schema for OpenPkg specification files",
6
6
  "type": "object",
7
- "required": [
8
- "openpkg",
9
- "meta",
10
- "exports"
11
- ],
7
+ "required": ["openpkg", "meta", "exports"],
12
8
  "properties": {
13
9
  "$schema": {
14
10
  "type": "string",
@@ -24,9 +20,7 @@
24
20
  "meta": {
25
21
  "type": "object",
26
22
  "description": "Package metadata",
27
- "required": [
28
- "name"
29
- ],
23
+ "required": ["name"],
30
24
  "properties": {
31
25
  "name": {
32
26
  "type": "string",
@@ -76,12 +70,7 @@
76
70
  "$defs": {
77
71
  "docSignal": {
78
72
  "type": "string",
79
- "enum": [
80
- "description",
81
- "params",
82
- "returns",
83
- "examples"
84
- ]
73
+ "enum": ["description", "params", "returns", "examples"]
85
74
  },
86
75
  "docDrift": {
87
76
  "type": "object",
@@ -89,7 +78,17 @@
89
78
  "properties": {
90
79
  "type": {
91
80
  "type": "string",
92
- "enum": ["param-mismatch", "param-type-mismatch", "return-type-mismatch", "generic-constraint-mismatch", "optionality-mismatch", "deprecated-mismatch", "visibility-mismatch", "example-drift", "broken-link"]
81
+ "enum": [
82
+ "param-mismatch",
83
+ "param-type-mismatch",
84
+ "return-type-mismatch",
85
+ "generic-constraint-mismatch",
86
+ "optionality-mismatch",
87
+ "deprecated-mismatch",
88
+ "visibility-mismatch",
89
+ "example-drift",
90
+ "broken-link"
91
+ ]
93
92
  },
94
93
  "target": {
95
94
  "type": "string",
@@ -136,11 +135,7 @@
136
135
  },
137
136
  "export": {
138
137
  "type": "object",
139
- "required": [
140
- "id",
141
- "name",
142
- "kind"
143
- ],
138
+ "required": ["id", "name", "kind"],
144
139
  "properties": {
145
140
  "id": {
146
141
  "type": "string",
@@ -169,14 +164,7 @@
169
164
  "kind": {
170
165
  "type": "string",
171
166
  "description": "Kind of export",
172
- "enum": [
173
- "function",
174
- "class",
175
- "variable",
176
- "interface",
177
- "type",
178
- "enum"
179
- ]
167
+ "enum": ["function", "class", "variable", "interface", "type", "enum"]
180
168
  },
181
169
  "description": {
182
170
  "type": "string",
@@ -198,10 +186,7 @@
198
186
  },
199
187
  "type": {
200
188
  "description": "Type reference or inline schema for variables",
201
- "oneOf": [
202
- { "type": "string" },
203
- { "$ref": "#/$defs/schema" }
204
- ]
189
+ "oneOf": [{ "type": "string" }, { "$ref": "#/$defs/schema" }]
205
190
  },
206
191
  "members": {
207
192
  "type": "array",
@@ -232,11 +217,7 @@
232
217
  },
233
218
  "typeDef": {
234
219
  "type": "object",
235
- "required": [
236
- "id",
237
- "name",
238
- "kind"
239
- ],
220
+ "required": ["id", "name", "kind"],
240
221
  "properties": {
241
222
  "id": {
242
223
  "type": "string",
@@ -265,12 +246,7 @@
265
246
  "kind": {
266
247
  "type": "string",
267
248
  "description": "Kind of type definition",
268
- "enum": [
269
- "interface",
270
- "type",
271
- "enum",
272
- "class"
273
- ]
249
+ "enum": ["interface", "type", "enum", "class"]
274
250
  },
275
251
  "description": {
276
252
  "type": "string",
@@ -326,10 +302,7 @@
326
302
  },
327
303
  "parameter": {
328
304
  "type": "object",
329
- "required": [
330
- "name",
331
- "required"
332
- ],
305
+ "required": ["name", "required"],
333
306
  "properties": {
334
307
  "name": {
335
308
  "type": "string",
@@ -374,17 +347,13 @@
374
347
  "pattern": "^#/types/[A-Za-z0-9_.-]+$"
375
348
  }
376
349
  },
377
- "required": [
378
- "$ref"
379
- ],
350
+ "required": ["$ref"],
380
351
  "additionalProperties": false
381
352
  },
382
353
  {
383
354
  "type": "object",
384
355
  "not": {
385
- "required": [
386
- "$ref"
387
- ]
356
+ "required": ["$ref"]
388
357
  },
389
358
  "additionalProperties": true
390
359
  }
@@ -392,10 +361,7 @@
392
361
  },
393
362
  "sourceLocation": {
394
363
  "type": "object",
395
- "required": [
396
- "file",
397
- "line"
398
- ],
364
+ "required": ["file", "line"],
399
365
  "properties": {
400
366
  "file": {
401
367
  "type": "string",