Skip to content

Commit 5369bbe

Browse files
authored
Merge pull request #2222 from vega/next
Release
2 parents 1f4bfca + b9c7171 commit 5369bbe

File tree

149 files changed

+13886
-7681
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+13886
-7681
lines changed

.github/workflows/publish-auto.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ jobs:
2020
- uses: actions/setup-node@v4
2121
with:
2222
registry-url: "https://registry.npmjs.org"
23-
cache: "yarn"
23+
cache: "npm"
24+
node-version: 22
2425
env:
2526
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2627

2728
- name: Install Node dependencies
28-
run: yarn --frozen-lockfile
29+
run: npm ci
2930

3031
- name: Create release
3132
run: npm run release

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ jobs:
2525
- uses: actions/setup-node@v4
2626
with:
2727
node-version: 22
28-
cache: "yarn"
28+
cache: "npm"
2929

3030
- name: Install Node dependencies
31-
run: yarn --frozen-lockfile
31+
run: npm ci
3232

3333
- name: Lint
34-
run: yarn lint
34+
run: npm run lint
3535

3636
- name: Build
37-
run: yarn build
37+
run: npm run build
3838

3939
- name: Test coverage
40-
run: yarn jest test/ --collectCoverage=true
40+
run: npx jest test/ --collectCoverage=true
4141

4242
- name: Upload coverage to Codecov
43-
uses: codecov/codecov-action@v4
43+
uses: codecov/codecov-action@v5

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ node_modules/
1111

1212
# Other package managers
1313
pnpm-lock.yaml
14-
package-lock.json
14+
yarn.lock

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Note that different platforms (e.g. Windows) may use different path separators s
3535

3636
Also note that you need to quote paths with `*` as otherwise the shell will expand the paths and therefore only pass the first path to the generator.
3737

38+
By default, the command-line generator will use the `tsconfig.json` file in the current working directory, or the first parent directory that contains a `tsconfig.json` file up to the root of the filesystem. If you want to use a different `tsconfig.json` file, you can use the `--tsconfig` option. In particular, if you need to use different compilation options for types, you may want to create a separate `tsconfig.json` file for the schema generation only.
39+
3840
### Options
3941

4042
```
@@ -232,14 +234,15 @@ fs.writeFile(outputPath, schemaString, (err) => {
232234
- conditional types
233235
- functions
234236
- `Promise<T>` unwraps to `T`
237+
- Overrides (like `@format`)
235238

236239
## Run locally
237240

238-
`yarn --silent run run --path 'test/valid-data/type-mapped-array/*.ts' --type 'MyObject'`
241+
`npm run --silent run -- --path 'test/valid-data/type-mapped-array/*.ts' --type 'MyObject'`
239242

240243
## Debug
241244

242-
`yarn --silent run debug --path 'test/valid-data/type-mapped-array/*.ts' --type 'MyObject'`
245+
`npm run --silent debug -- --path 'test/valid-data/type-mapped-array/*.ts' --type 'MyObject'`
243246

244247
And connect via the debugger protocol.
245248

eslint.config.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import globals from "globals";
33
import tseslint from "typescript-eslint";
44
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
55

6-
/** @type {import('@types/eslint').Linter.FlatConfig[]} */
6+
/** @type {import('@types/eslint').Linter.Config[]} */
77
export default tseslint.config(
88
{
9-
ignores: ["dist", "cjs", "build", "eslint.config.mjs"],
9+
ignores: ["dist", "cjs", "build", "eslint.config.mjs", "bin/ts-json-schema-generator.js"],
1010
},
1111
eslint.configs.recommended,
1212
{
@@ -30,6 +30,7 @@ export default tseslint.config(
3030
rules: {
3131
"@typescript-eslint/explicit-function-return-type": "off",
3232
"@typescript-eslint/no-explicit-any": "off",
33+
"@typescript-eslint/consistent-type-imports": "error",
3334
"@typescript-eslint/prefer-for-of": "error",
3435
"@typescript-eslint/no-require-imports": "error",
3536
"@typescript-eslint/no-parameter-properties": "off",

factory/formatter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { ChainTypeFormatter } from "../src/ChainTypeFormatter.js";
22
import { CircularReferenceTypeFormatter } from "../src/CircularReferenceTypeFormatter.js";
3-
import { CompletedConfig } from "../src/Config.js";
4-
import { MutableTypeFormatter } from "../src/MutableTypeFormatter.js";
5-
import { TypeFormatter } from "../src/TypeFormatter.js";
3+
import type { CompletedConfig } from "../src/Config.js";
4+
import type { MutableTypeFormatter } from "../src/MutableTypeFormatter.js";
5+
import type { TypeFormatter } from "../src/TypeFormatter.js";
66
import { AliasTypeFormatter } from "../src/TypeFormatter/AliasTypeFormatter.js";
77
import { AnnotatedTypeFormatter } from "../src/TypeFormatter/AnnotatedTypeFormatter.js";
88
import { AnyTypeFormatter } from "../src/TypeFormatter/AnyTypeFormatter.js";

factory/generator.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Config, DEFAULT_CONFIG } from "../src/Config.js";
1+
import type { Config } from "../src/Config.js";
2+
import { DEFAULT_CONFIG } from "../src/Config.js";
23
import { SchemaGenerator } from "../src/SchemaGenerator.js";
34
import { createFormatter } from "./formatter.js";
45
import { createParser } from "./parser.js";

factory/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function createParser(program: ts.Program, config: CompletedConfig, augme
114114
.addNodeParser(new NumberLiteralNodeParser())
115115
.addNodeParser(new BooleanLiteralNodeParser())
116116
.addNodeParser(new NullLiteralNodeParser())
117-
.addNodeParser(new ObjectLiteralExpressionNodeParser(chainNodeParser))
117+
.addNodeParser(new ObjectLiteralExpressionNodeParser(chainNodeParser, typeChecker))
118118
.addNodeParser(new ArrayLiteralExpressionNodeParser(chainNodeParser))
119119

120120
.addNodeParser(new PrefixUnaryExpressionNodeParser(chainNodeParser))

0 commit comments

Comments
 (0)