schemastore-to-typescript 1.0.3 → 1.0.5

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/CHANGELOG.json CHANGED
@@ -2,7 +2,189 @@
2
2
  "name": "schemastore-to-typescript",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 07 Oct 2026 10:15:38 GMT",
5
+ "date": "Thu, 22 Oct 2026 22:27:08 GMT",
6
+ "version": "1.0.5",
7
+ "tag": "schemastore-to-typescript_v1.0.5",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "filip.dupanovic@gmail.com",
12
+ "package": "schemastore-to-typescript",
13
+ "commit": "a5e55015e4e296164838792f7e182c7e8f71b75f",
14
+ "comment": "Keep the optional members of a root that allows additional properties"
15
+ },
16
+ {
17
+ "author": "email not defined",
18
+ "package": "schemastore-to-typescript",
19
+ "commit": "a5e55015e4e296164838792f7e182c7e8f71b75f",
20
+ "comment": "Update dependency @langri-sha/projen-project to v0.40.0"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Mon, 19 Oct 2026 17:11:45 GMT",
27
+ "version": "1.0.4",
28
+ "tag": "schemastore-to-typescript_v1.0.4",
29
+ "comments": {
30
+ "patch": [
31
+ {
32
+ "author": "email not defined",
33
+ "package": "schemastore-to-typescript",
34
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
35
+ "comment": "Update dependency pnpm to v12.10.0"
36
+ },
37
+ {
38
+ "author": "email not defined",
39
+ "package": "schemastore-to-typescript",
40
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
41
+ "comment": "Update dependency pnpm to v12.10.1"
42
+ },
43
+ {
44
+ "author": "email not defined",
45
+ "package": "schemastore-to-typescript",
46
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
47
+ "comment": "Update @langri-sha/projen-project to 0.37.0"
48
+ },
49
+ {
50
+ "author": "email not defined",
51
+ "package": "schemastore-to-typescript",
52
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
53
+ "comment": "Update dependency got to v16.1.0"
54
+ },
55
+ {
56
+ "author": "email not defined",
57
+ "package": "schemastore-to-typescript",
58
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
59
+ "comment": "Update dependency pnpm to v12.14.0"
60
+ },
61
+ {
62
+ "author": "filip.dupanovic@gmail.com",
63
+ "package": "schemastore-to-typescript",
64
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
65
+ "comment": "Compile Renovate 44.168.4 and later schemas"
66
+ },
67
+ {
68
+ "author": "email not defined",
69
+ "package": "schemastore-to-typescript",
70
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
71
+ "comment": "Update dependency @langri-sha/projen-project to v0.36.0"
72
+ },
73
+ {
74
+ "author": "email not defined",
75
+ "package": "schemastore-to-typescript",
76
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
77
+ "comment": "Update dependency @types/node to v24.19.2"
78
+ },
79
+ {
80
+ "author": "email not defined",
81
+ "package": "schemastore-to-typescript",
82
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
83
+ "comment": "Update dependency keyv to v6"
84
+ },
85
+ {
86
+ "author": "email not defined",
87
+ "package": "schemastore-to-typescript",
88
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
89
+ "comment": "Update dependency pnpm to v12.11.2"
90
+ },
91
+ {
92
+ "author": "email not defined",
93
+ "package": "schemastore-to-typescript",
94
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
95
+ "comment": "Update dependency vitest to v5.0.5"
96
+ },
97
+ {
98
+ "author": "email not defined",
99
+ "package": "schemastore-to-typescript",
100
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
101
+ "comment": "Update langri-sha projen toolchain"
102
+ },
103
+ {
104
+ "author": "email not defined",
105
+ "package": "schemastore-to-typescript",
106
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
107
+ "comment": "Update dependency @langri-sha/projen-project to v0.33.0"
108
+ },
109
+ {
110
+ "author": "email not defined",
111
+ "package": "schemastore-to-typescript",
112
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
113
+ "comment": "Update dependency pnpm to v12.11.1"
114
+ },
115
+ {
116
+ "author": "email not defined",
117
+ "package": "schemastore-to-typescript",
118
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
119
+ "comment": "Update langri-sha projen toolchain"
120
+ },
121
+ {
122
+ "author": "email not defined",
123
+ "package": "schemastore-to-typescript",
124
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
125
+ "comment": "Update dependency pnpm to v12.13.0"
126
+ },
127
+ {
128
+ "author": "email not defined",
129
+ "package": "schemastore-to-typescript",
130
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
131
+ "comment": "Update langri-sha projen toolchain"
132
+ },
133
+ {
134
+ "author": "email not defined",
135
+ "package": "schemastore-to-typescript",
136
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
137
+ "comment": "Update dependency pnpm to v12.11.0"
138
+ },
139
+ {
140
+ "author": "filip.dupanovic@gmail.com",
141
+ "package": "schemastore-to-typescript",
142
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
143
+ "comment": "Restore the Keyv version supported by got caching"
144
+ },
145
+ {
146
+ "author": "email not defined",
147
+ "package": "schemastore-to-typescript",
148
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
149
+ "comment": "Update dependency vitest to v5.0.4"
150
+ },
151
+ {
152
+ "author": "email not defined",
153
+ "package": "schemastore-to-typescript",
154
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
155
+ "comment": "Update dependency @langri-sha/projen-project to v0.39.0"
156
+ }
157
+ ],
158
+ "none": [
159
+ {
160
+ "author": "filip.dupanovic@gmail.com",
161
+ "package": "schemastore-to-typescript",
162
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
163
+ "comment": "Opt into the default Worktrunk hooks"
164
+ },
165
+ {
166
+ "author": "filip.dupanovic@gmail.com",
167
+ "package": "schemastore-to-typescript",
168
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
169
+ "comment": "Simplify the README"
170
+ },
171
+ {
172
+ "author": "filip.dupanovic@gmail.com",
173
+ "package": "schemastore-to-typescript",
174
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
175
+ "comment": "Keep the Dagger files out of the package"
176
+ },
177
+ {
178
+ "author": "filip.dupanovic@gmail.com",
179
+ "package": "schemastore-to-typescript",
180
+ "commit": "50260cd9b6fc9520f5c7e9a6d55720e90b329d4e",
181
+ "comment": "Link the contributing guide from the readme"
182
+ }
183
+ ]
184
+ }
185
+ },
186
+ {
187
+ "date": "Wed, 07 Oct 2026 10:15:46 GMT",
6
188
  "version": "1.0.3",
7
189
  "tag": "schemastore-to-typescript_v1.0.3",
8
190
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,49 @@
1
1
  # Change Log - schemastore-to-typescript
2
2
 
3
- <!-- This log was last generated on Wed, 07 Oct 2026 10:15:38 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Thu, 22 Oct 2026 22:27:08 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.0.5
8
+
9
+ Thu, 22 Oct 2026 22:27:08 GMT
10
+
11
+ ### Patches
12
+
13
+ - Keep the optional members of a root that allows additional properties (filip.dupanovic@gmail.com)
14
+ - Update dependency @langri-sha/projen-project to v0.40.0
15
+
16
+ ## 1.0.4
17
+
18
+ Mon, 19 Oct 2026 17:11:45 GMT
19
+
20
+ ### Patches
21
+
22
+ - Update dependency pnpm to v12.10.0
23
+ - Update dependency pnpm to v12.10.1
24
+ - Update @langri-sha/projen-project to 0.37.0
25
+ - Update dependency got to v16.1.0
26
+ - Update dependency pnpm to v12.14.0
27
+ - Compile Renovate 44.168.4 and later schemas (filip.dupanovic@gmail.com)
28
+ - Update dependency @langri-sha/projen-project to v0.36.0
29
+ - Update dependency @types/node to v24.19.2
30
+ - Update dependency keyv to v6
31
+ - Update dependency pnpm to v12.11.2
32
+ - Update dependency vitest to v5.0.5
33
+ - Update langri-sha projen toolchain
34
+ - Update dependency @langri-sha/projen-project to v0.33.0
35
+ - Update dependency pnpm to v12.11.1
36
+ - Update langri-sha projen toolchain
37
+ - Update dependency pnpm to v12.13.0
38
+ - Update langri-sha projen toolchain
39
+ - Update dependency pnpm to v12.11.0
40
+ - Restore the Keyv version supported by got caching (filip.dupanovic@gmail.com)
41
+ - Update dependency vitest to v5.0.4
42
+ - Update dependency @langri-sha/projen-project to v0.39.0
43
+
7
44
  ## 1.0.3
8
45
 
9
- Wed, 07 Oct 2026 10:15:38 GMT
46
+ Wed, 07 Oct 2026 10:15:46 GMT
10
47
 
11
48
  ### Patches
12
49
 
package/dist/index.js CHANGED
@@ -60,25 +60,45 @@ const nonSchemaKeys = new Set(['default', 'examples', 'const', 'enum']);
60
60
  * So optional members are dropped in favour of `additionalProperties`, which
61
61
  * is the general contract they were there to narrow. Required ones stay: they
62
62
  * are a promise the type has to keep.
63
+ *
64
+ * The root is the exception when it declares `additionalProperties: true`: the
65
+ * document lists its known keys and merely tolerates others, so the members
66
+ * are the contract and dropping them leaves `{ [k: string]: unknown }` (Claude
67
+ * Code's settings). The index type is `unknown`, so there is no TS2411. Only
68
+ * the root qualifies; open nested nodes remain extension points whose members
69
+ * are advisory, such as Cargo's `package.metadata`.
70
+ *
71
+ * Renovate 44.168.4 began listing the per-manager overrides (`lockFileMaintenance`,
72
+ * `minor`, `group`, …) among the members of every manager, while each of them
73
+ * still declares `$ref: '#'` beside an `allOf` that spells out the same
74
+ * members. `json-schema-to-typescript` cannot resolve that cycle and throws
75
+ * on an intersection with no parameters. The `allOf` already carries what the
76
+ * self-reference would inherit, so the `$ref` goes.
63
77
  */
64
- const sanitizeSchema = (node) => {
78
+ const sanitizeSchema = (node, isRoot = true) => {
65
79
  if (Array.isArray(node)) {
66
- return node.map(sanitizeSchema);
80
+ return node.map((item) => sanitizeSchema(item, false));
67
81
  }
68
82
  if (node === null || typeof node !== 'object') {
69
83
  return node;
70
84
  }
71
85
  const sanitized = {};
72
86
  for (const [key, value] of Object.entries(node)) {
73
- sanitized[key] = nonSchemaKeys.has(key) ? value : sanitizeSchema(value);
87
+ sanitized[key] = nonSchemaKeys.has(key)
88
+ ? value
89
+ : sanitizeSchema(value, false);
74
90
  }
75
91
  if (typeof sanitized.$ref === 'string' &&
76
92
  typeof sanitized.additionalProperties === 'object' &&
77
93
  sanitized.additionalProperties !== null) {
78
94
  delete sanitized.$ref;
79
95
  }
96
+ if (sanitized.$ref === '#' && Array.isArray(sanitized.allOf)) {
97
+ delete sanitized.$ref;
98
+ }
80
99
  if (sanitized.additionalProperties !== undefined &&
81
100
  sanitized.additionalProperties !== false &&
101
+ !(isRoot && sanitized.additionalProperties === true) &&
82
102
  typeof sanitized.properties === 'object' &&
83
103
  sanitized.properties !== null) {
84
104
  const required = new Set(Array.isArray(sanitized.required) ? sanitized.required : []);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,WAAW,MAAM,OAAO,CAAA;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAA;AAChC,OAAO,GAAG,EAAE,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AACpC,OAAO,EAEL,OAAO,IAAI,aAAa,GACzB,MAAM,2BAA2B,CAAA;AAClC,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC,OAAO,EAAE,eAA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,UAAU,KAAK,GAAG,EAAE,CAAC;gBAClC,MAAM,IAAI,KAAK,CACb,wBAAwB,IAAI,OAAO,aAAa,CAAC,GAAG,2BAA2B,EAC/E,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAA;YACH,CAAC;YAED,MAAM,IAAI,KAAK,CACb,iCAAiC,aAAa,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,QAAQ,CAAC,UAAU,EAAE,EAClG,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAA;QACH,CAAC;QAED,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;YAClE,MAAM,IAAI,KAAK,CACb,6BAA6B,aAAa,CAAC,GAAG,yEAAyE,CAAC,CAAC,OAAO,EAAE,EAClI,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAA;QACH,CAAC;QAED,MAAM,CAAC,CAAA;IACT,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,UAAU,EAAE,CAAA;IACpB,CAAC;IAED,OAAO,aAAa,CAAC,cAAc,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AACrE,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "schemastore-to-typescript",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Fetch JSON schemas from the JSON Schema Store catalog and compile them to TypeScript typings",
5
5
  "keywords": [
6
6
  "cli",
@@ -29,43 +29,45 @@
29
29
  "schemastore-to-typescript": "dist/cli.js"
30
30
  },
31
31
  "scripts": {
32
- "change": "pnpm exec projen change",
33
- "default": "pnpm exec projen default",
32
+ "change": "projen change",
33
+ "default": "projen default",
34
34
  "prepare": "husky",
35
35
  "prepublishOnly": "rm -rf dist; tsc --project tsconfig.build.json",
36
- "renovate": "pnpm exec projen renovate",
37
- "test": "vitest"
36
+ "renovate": "projen renovate",
37
+ "test": "vitest",
38
+ "worktrunk:dry-run": "projen worktrunk:dry-run",
39
+ "worktrunk:show": "projen worktrunk:show"
38
40
  },
39
41
  "dependencies": {
40
42
  "commander": "15.0.0",
41
43
  "debug": "4.4.3",
42
44
  "env-paths": "4.0.0",
43
45
  "es-main": "1.4.0",
44
- "got": "16.0.0",
46
+ "got": "16.1.0",
45
47
  "json-schema-to-typescript": "16.0.0",
46
48
  "keyv": "5.6.0",
47
49
  "keyv-file": "5.3.5"
48
50
  },
49
51
  "devDependencies": {
50
- "@langri-sha/eslint-config": "0.9.18",
51
- "@langri-sha/lint-staged": "0.9.9",
52
- "@langri-sha/prettier": "0.4.10",
53
- "@langri-sha/projen-project": "0.32.0",
54
- "@langri-sha/tsconfig": "1.1.0",
55
- "@langri-sha/vitest": "0.2.2",
52
+ "@langri-sha/eslint-config": "0.10.0",
53
+ "@langri-sha/lint-staged": "0.9.11",
54
+ "@langri-sha/prettier": "0.4.11",
55
+ "@langri-sha/projen-project": "0.40.0",
56
+ "@langri-sha/tsconfig": "1.1.1",
57
+ "@langri-sha/vitest": "0.2.3",
56
58
  "@types/debug": "4.1.13",
57
- "@types/node": "24.19.1",
59
+ "@types/node": "24.19.2",
58
60
  "beachball": "2.66.0",
59
- "eslint": "10.11.0",
61
+ "eslint": "10.12.0",
60
62
  "husky": "9.1.7",
61
63
  "lint-staged": "17.6.0",
62
64
  "prettier": "3.9.9",
63
- "projen": "0.86.5",
65
+ "projen": "0.104.1",
64
66
  "tsx": "4.23.15",
65
67
  "typescript": "5.9.3",
66
- "vitest": "5.0.3"
68
+ "vitest": "5.0.5"
67
69
  },
68
- "packageManager": "pnpm@12.9.1",
70
+ "packageManager": "pnpm@12.14.0",
69
71
  "devEngines": {
70
72
  "runtime": {
71
73
  "name": "node",
package/readme.md CHANGED
@@ -1,11 +1,7 @@
1
1
  # schemastore-to-typescript
2
2
 
3
- Fetch [JSON Schema] from the [JSON Schema Store] catalog and compile [TypeScript
4
- typings].
5
-
6
- The tool first fetches the schema catalog from the JSON Schema Store API,
7
- searches for the requested schema by name (case-insensitive), and then downloads
8
- and compiles the schema to TypeScript definitions.
3
+ Generate [TypeScript typings] for any schema in the [JSON Schema Store] catalog,
4
+ by name.
9
5
 
10
6
  ## Features
11
7
 
@@ -20,19 +16,17 @@ and compiles the schema to TypeScript definitions.
20
16
  npm install -D schemastore-to-typescript
21
17
  ```
22
18
 
23
- Name a schema as it appears in the catalog, and optionally where to write its
24
- typings — `<schema>.d.ts` in the working directory by default:
19
+ Name a schema as it appears in the catalog, in any case, and optionally where to
20
+ write its typings — `<schema>.d.ts` in the working directory by default:
25
21
 
26
22
  ```sh
27
23
  schemastore-to-typescript renovate src/renovate.ts
28
24
  schemastore-to-typescript 'cargo manifest' src/cargo.ts
29
25
  ```
30
26
 
31
- Requests are cached in the user cache directory, such as
32
- `~/.cache/schemastore-to-typescript-nodejs` on Linux. Pass `--no-cache` to skip
33
- it.
27
+ Downloads are cached; pass `--no-cache` to skip the cache.
34
28
 
35
- The same is available as a function, which resolves to the compiled module and
29
+ The same is available as a function, which resolves to the generated module and
36
30
  takes `false` as its second argument to skip the cache:
37
31
 
38
32
  ```ts
@@ -41,12 +35,17 @@ import { compile } from 'schemastore-to-typescript'
41
35
  const typings = await compile('swcrc')
42
36
  ```
43
37
 
38
+ ## Contributing
39
+
40
+ See [CONTRIBUTING.md] in `langri-sha/github`.
41
+
42
+ [contributing.md]:
43
+ https://github.com/langri-sha/github/blob/main/CONTRIBUTING.md
44
44
  [`got`]: https://www.npmjs.com/package/got
45
45
  [`json-schema-to-typescript`]:
46
46
  https://www.npmjs.com/package/json-schema-to-typescript
47
47
  [json schema store]: https://www.schemastore.org/
48
48
  [json schema store catalog api]:
49
49
  https://www.schemastore.org/api/json/catalog.json
50
- [json schema]: https://json-schema.org/
51
50
  [typescript typings]:
52
51
  https://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-d-ts.html