@twin.org/ts-to-schema 0.0.2-next.1 → 0.0.2-next.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.
@@ -90,7 +90,7 @@ async function tsToSchema(config, outputFolder, workingDirectory) {
90
90
  else {
91
91
  cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.ts-to-schema.progress.generatingSchema"));
92
92
  const autoExpandTypes = config.autoExpandTypes ?? [];
93
- const defaultExpandTypes = ["ObjectOrArray<.*>"];
93
+ const defaultExpandTypes = ["/ObjectOrArray<.*>/"];
94
94
  for (const defaultType of defaultExpandTypes) {
95
95
  if (!autoExpandTypes.includes(defaultType)) {
96
96
  autoExpandTypes.push(defaultType);
@@ -145,7 +145,7 @@ async function generateSchemas(typeSource, type, autoExpandTypes, outputWorkingD
145
145
  }
146
146
  }
147
147
  const referencedSchemas = {};
148
- toolsCore.JsonSchemaHelper.extractTypes(allSchemas, [type, ...autoExpandTypes], referencedSchemas);
148
+ toolsCore.JsonSchemaHelper.extractTypes(allSchemas, [type, ...autoExpandTypes.map(t => (t.startsWith("/") && t.endsWith("/") ? new RegExp(t) : t))], referencedSchemas);
149
149
  toolsCore.JsonSchemaHelper.expandTypes(referencedSchemas, autoExpandTypes);
150
150
  return referencedSchemas;
151
151
  }
@@ -185,7 +185,7 @@ class CLI extends cliCore.CLIBase {
185
185
  return this.execute({
186
186
  title: "TWIN TypeScript To Schema",
187
187
  appName: "ts-to-schema",
188
- version: "0.0.2-next.1", // x-release-please-version
188
+ version: "0.0.2-next.2", // x-release-please-version
189
189
  icon: "⚙️ ",
190
190
  supportsEnvFiles: false,
191
191
  overrideOutputWidth: options?.overrideOutputWidth
@@ -87,7 +87,7 @@ async function tsToSchema(config, outputFolder, workingDirectory) {
87
87
  else {
88
88
  CLIDisplay.task(I18n.formatMessage("commands.ts-to-schema.progress.generatingSchema"));
89
89
  const autoExpandTypes = config.autoExpandTypes ?? [];
90
- const defaultExpandTypes = ["ObjectOrArray<.*>"];
90
+ const defaultExpandTypes = ["/ObjectOrArray<.*>/"];
91
91
  for (const defaultType of defaultExpandTypes) {
92
92
  if (!autoExpandTypes.includes(defaultType)) {
93
93
  autoExpandTypes.push(defaultType);
@@ -142,7 +142,7 @@ async function generateSchemas(typeSource, type, autoExpandTypes, outputWorkingD
142
142
  }
143
143
  }
144
144
  const referencedSchemas = {};
145
- JsonSchemaHelper.extractTypes(allSchemas, [type, ...autoExpandTypes], referencedSchemas);
145
+ JsonSchemaHelper.extractTypes(allSchemas, [type, ...autoExpandTypes.map(t => (t.startsWith("/") && t.endsWith("/") ? new RegExp(t) : t))], referencedSchemas);
146
146
  JsonSchemaHelper.expandTypes(referencedSchemas, autoExpandTypes);
147
147
  return referencedSchemas;
148
148
  }
@@ -182,7 +182,7 @@ class CLI extends CLIBase {
182
182
  return this.execute({
183
183
  title: "TWIN TypeScript To Schema",
184
184
  appName: "ts-to-schema",
185
- version: "0.0.2-next.1", // x-release-please-version
185
+ version: "0.0.2-next.2", // x-release-please-version
186
186
  icon: "⚙️ ",
187
187
  supportsEnvFiles: false,
188
188
  overrideOutputWidth: options?.overrideOutputWidth
package/docs/changelog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @twin.org/ts-to-schema - Changelog
2
2
 
3
+ ## [0.0.2-next.2](https://github.com/twinfoundation/tools/compare/ts-to-schema-v0.0.2-next.1...ts-to-schema-v0.0.2-next.2) (2025-07-17)
4
+
5
+
6
+ ### Features
7
+
8
+ * improve auto expand types ([6181d1d](https://github.com/twinfoundation/tools/commit/6181d1daded1f91323195cf7efbc2f1881f38b41))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/tools-core bumped from 0.0.2-next.1 to 0.0.2-next.2
16
+
3
17
  ## [0.0.2-next.1](https://github.com/twinfoundation/tools/compare/ts-to-schema-v0.0.2-next.0...ts-to-schema-v0.0.2-next.1) (2025-07-14)
4
18
 
5
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/ts-to-schema",
3
- "version": "0.0.2-next.1",
3
+ "version": "0.0.2-next.2",
4
4
  "description": "Tool to convert TypeScript definitions to JSON schemas",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,9 +17,9 @@
17
17
  "@twin.org/cli-core": "next",
18
18
  "@twin.org/core": "next",
19
19
  "@twin.org/nameof": "next",
20
- "@twin.org/tools-core": "0.0.2-next.1",
20
+ "@twin.org/tools-core": "0.0.2-next.2",
21
21
  "commander": "14.0.0",
22
- "glob": "11.0.2",
22
+ "glob": "11.0.3",
23
23
  "ts-json-schema-generator": "2.4.0"
24
24
  },
25
25
  "main": "./dist/cjs/index.cjs",