Skip to content

Commit

Permalink
Merge pull request #1931 from vega/next
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
domoritz committed Apr 20, 2024
2 parents 5a45839 + 294bafc commit d723c6b
Show file tree
Hide file tree
Showing 295 changed files with 2,427 additions and 2,013 deletions.
15 changes: 4 additions & 11 deletions .autorc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
{
"plugins": [
"npm",
"conventional-commits",
"first-time-contributor",
"released"
],
"baseBranch": "stable",
"prereleaseBranches": [
"next"
],
"author": "GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>"
"plugins": ["npm", "conventional-commits", "first-time-contributor", "released"],
"baseBranch": "stable",
"prereleaseBranches": ["next"],
"author": "GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>"
}
23 changes: 0 additions & 23 deletions .editorconfig

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

41 changes: 0 additions & 41 deletions .eslintrc.js

This file was deleted.

3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
azure-pipelines.yml
package.json
test/valid-data/**/*.json
babel.config.cjs
jest.config.cjs
2 changes: 0 additions & 2 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"trailingComma": "es5",
"printWidth": 120,
"tabWidth": 4,
"endOfLine": "lf",
"overrides": [
{
"files": "*.json",
Expand Down
69 changes: 29 additions & 40 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,31 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
//
// Helps with debugging parsing.
// - Set break points in the code
// - Open the file you want to parse: test/**/main.ts
// - F5 to run the debugger.
"name": "Debug Test Case",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": [
"--nolazy",
"-r",
"ts-node/register"
],
"args": [
"ts-json-schema-generator.ts",
"-p",
"${file}"
],
"cwd": "${workspaceFolder}",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"<node_internals>/**",
"node_modules/**"
]
},
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9229,
"protocol": "inspector"
}
]
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
//
// Helps with debugging parsing.
// - Set break points in the code
// - Open the file you want to parse: test/**/main.ts
// - F5 to run the debugger.
"name": "Debug Test Case",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"args": ["ts-json-schema-generator.ts", "-p", "${file}"],
"cwd": "${workspaceFolder}",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": ["<node_internals>/**", "node_modules/**"]
},
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9229,
"protocol": "inspector"
}
]
}
9 changes: 5 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// Place your settings in this file to overwrite default and user settings.
{
"search.exclude": {
"dist": true,
"bin": true
"dist": true
},
"files.trimTrailingWhitespace": true,
"typescript.tsdk": "node_modules/typescript/lib",
"files.insertFinalNewline": true,
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"eslint.validate": ["javascript", "javascriptreact", "typescript"],
"editor.tabSize": 4,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"jest.autoRun": "off"
"eslint.experimental.useFlatConfig": true,
"jest.runMode": "on-demand",
"javascript.preferences.importModuleSpecifierEnding": "js"
}
File renamed without changes.
2 changes: 1 addition & 1 deletion bin/ts-json-schema-generator
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env node
require('../dist/ts-json-schema-generator');
import("../dist/ts-json-schema-generator.js");
78 changes: 78 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import eslint from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";

/** @type {import('@types/eslint').Linter.FlatConfig[]} */
export default tseslint.config(
{
ignores: ["dist"],
},
eslint.configs.recommended,
{
files: [
"ts-json-schema-generator.ts",
"index.ts",
"src/**/*.ts",
"factory/**/*.ts",
"bin/**",
"test/**/*.test.ts",
"test/utils.ts",
],
extends: tseslint.configs.recommendedTypeChecked,
languageOptions: {
sourceType: "module",
parserOptions: {
project: "tsconfig.eslint.json",
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-parameter-properties": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
vars: "all",
args: "none",
ignoreRestSiblings: true,
},
],
"@typescript-eslint/no-object-literal-type-assertion": "off",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"no-alert": "error",
"prefer-const": "error",
"no-return-assign": "error",
"no-useless-call": "error",
"no-shadow": "error",
"no-useless-concat": "error",
"no-undef": "off",
"no-prototype-builtins": "off",
},
},
{
files: ["*.js"],
...tseslint.configs.disableTypeChecked,
},
{
files: ["test/**/*.test.ts"],
languageOptions: {
globals: {
...globals.jest,
},
},
},
eslintPluginPrettierRecommended,
);
68 changes: 34 additions & 34 deletions factory/formatter.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
import { ChainTypeFormatter } from "../src/ChainTypeFormatter";
import { CircularReferenceTypeFormatter } from "../src/CircularReferenceTypeFormatter";
import { CompletedConfig } from "../src/Config";
import { MutableTypeFormatter } from "../src/MutableTypeFormatter";
import { TypeFormatter } from "../src/TypeFormatter";
import { AliasTypeFormatter } from "../src/TypeFormatter/AliasTypeFormatter";
import { AnnotatedTypeFormatter } from "../src/TypeFormatter/AnnotatedTypeFormatter";
import { AnyTypeFormatter } from "../src/TypeFormatter/AnyTypeFormatter";
import { ArrayTypeFormatter } from "../src/TypeFormatter/ArrayTypeFormatter";
import { BooleanTypeFormatter } from "../src/TypeFormatter/BooleanTypeFormatter";
import { ConstructorTypeFormatter } from "../src/TypeFormatter/ConstructorTypeFormatter";
import { DefinitionTypeFormatter } from "../src/TypeFormatter/DefinitionTypeFormatter";
import { EnumTypeFormatter } from "../src/TypeFormatter/EnumTypeFormatter";
import { FunctionTypeFormatter } from "../src/TypeFormatter/FunctionTypeFormatter";
import { HiddenTypeFormatter } from "../src/TypeFormatter/HiddenTypeFormatter";
import { IntersectionTypeFormatter } from "../src/TypeFormatter/IntersectionTypeFormatter";
import { LiteralTypeFormatter } from "../src/TypeFormatter/LiteralTypeFormatter";
import { LiteralUnionTypeFormatter } from "../src/TypeFormatter/LiteralUnionTypeFormatter";
import { NeverTypeFormatter } from "../src/TypeFormatter/NeverTypeFormatter";
import { NullTypeFormatter } from "../src/TypeFormatter/NullTypeFormatter";
import { NumberTypeFormatter } from "../src/TypeFormatter/NumberTypeFormatter";
import { ObjectTypeFormatter } from "../src/TypeFormatter/ObjectTypeFormatter";
import { OptionalTypeFormatter } from "../src/TypeFormatter/OptionalTypeFormatter";
import { PrimitiveUnionTypeFormatter } from "../src/TypeFormatter/PrimitiveUnionTypeFormatter";
import { ReferenceTypeFormatter } from "../src/TypeFormatter/ReferenceTypeFormatter";
import { RestTypeFormatter } from "../src/TypeFormatter/RestTypeFormatter";
import { StringTypeFormatter } from "../src/TypeFormatter/StringTypeFormatter";
import { SymbolTypeFormatter } from "../src/TypeFormatter/SymbolTypeFormatter";
import { TupleTypeFormatter } from "../src/TypeFormatter/TupleTypeFormatter";
import { UndefinedTypeFormatter } from "../src/TypeFormatter/UndefinedTypeFormatter";
import { UnionTypeFormatter } from "../src/TypeFormatter/UnionTypeFormatter";
import { UnknownTypeFormatter } from "../src/TypeFormatter/UnknownTypeFormatter";
import { VoidTypeFormatter } from "../src/TypeFormatter/VoidTypeFormatter";
import { ChainTypeFormatter } from "../src/ChainTypeFormatter.js";
import { CircularReferenceTypeFormatter } from "../src/CircularReferenceTypeFormatter.js";
import { CompletedConfig } from "../src/Config.js";
import { MutableTypeFormatter } from "../src/MutableTypeFormatter.js";
import { TypeFormatter } from "../src/TypeFormatter.js";
import { AliasTypeFormatter } from "../src/TypeFormatter/AliasTypeFormatter.js";
import { AnnotatedTypeFormatter } from "../src/TypeFormatter/AnnotatedTypeFormatter.js";
import { AnyTypeFormatter } from "../src/TypeFormatter/AnyTypeFormatter.js";
import { ArrayTypeFormatter } from "../src/TypeFormatter/ArrayTypeFormatter.js";
import { BooleanTypeFormatter } from "../src/TypeFormatter/BooleanTypeFormatter.js";
import { ConstructorTypeFormatter } from "../src/TypeFormatter/ConstructorTypeFormatter.js";
import { DefinitionTypeFormatter } from "../src/TypeFormatter/DefinitionTypeFormatter.js";
import { EnumTypeFormatter } from "../src/TypeFormatter/EnumTypeFormatter.js";
import { FunctionTypeFormatter } from "../src/TypeFormatter/FunctionTypeFormatter.js";
import { HiddenTypeFormatter } from "../src/TypeFormatter/HiddenTypeFormatter.js";
import { IntersectionTypeFormatter } from "../src/TypeFormatter/IntersectionTypeFormatter.js";
import { LiteralTypeFormatter } from "../src/TypeFormatter/LiteralTypeFormatter.js";
import { LiteralUnionTypeFormatter } from "../src/TypeFormatter/LiteralUnionTypeFormatter.js";
import { NeverTypeFormatter } from "../src/TypeFormatter/NeverTypeFormatter.js";
import { NullTypeFormatter } from "../src/TypeFormatter/NullTypeFormatter.js";
import { NumberTypeFormatter } from "../src/TypeFormatter/NumberTypeFormatter.js";
import { ObjectTypeFormatter } from "../src/TypeFormatter/ObjectTypeFormatter.js";
import { OptionalTypeFormatter } from "../src/TypeFormatter/OptionalTypeFormatter.js";
import { PrimitiveUnionTypeFormatter } from "../src/TypeFormatter/PrimitiveUnionTypeFormatter.js";
import { ReferenceTypeFormatter } from "../src/TypeFormatter/ReferenceTypeFormatter.js";
import { RestTypeFormatter } from "../src/TypeFormatter/RestTypeFormatter.js";
import { StringTypeFormatter } from "../src/TypeFormatter/StringTypeFormatter.js";
import { SymbolTypeFormatter } from "../src/TypeFormatter/SymbolTypeFormatter.js";
import { TupleTypeFormatter } from "../src/TypeFormatter/TupleTypeFormatter.js";
import { UndefinedTypeFormatter } from "../src/TypeFormatter/UndefinedTypeFormatter.js";
import { UnionTypeFormatter } from "../src/TypeFormatter/UnionTypeFormatter.js";
import { UnknownTypeFormatter } from "../src/TypeFormatter/UnknownTypeFormatter.js";
import { VoidTypeFormatter } from "../src/TypeFormatter/VoidTypeFormatter.js";

export type FormatterAugmentor = (
formatter: MutableTypeFormatter,
circularReferenceTypeFormatter: CircularReferenceTypeFormatter
circularReferenceTypeFormatter: CircularReferenceTypeFormatter,
) => void;

export function createFormatter(config: CompletedConfig, augmentor?: FormatterAugmentor): TypeFormatter {
Expand Down
10 changes: 5 additions & 5 deletions factory/generator.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Config, DEFAULT_CONFIG } from "../src/Config";
import { SchemaGenerator } from "../src/SchemaGenerator";
import { createFormatter } from "./formatter";
import { createParser } from "./parser";
import { createProgram } from "./program";
import { Config, DEFAULT_CONFIG } from "../src/Config.js";
import { SchemaGenerator } from "../src/SchemaGenerator.js";
import { createFormatter } from "./formatter.js";
import { createParser } from "./parser.js";
import { createProgram } from "./program.js";

export function createGenerator(config: Config): SchemaGenerator {
const completedConfig = { ...DEFAULT_CONFIG, ...config };
Expand Down
8 changes: 4 additions & 4 deletions factory/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./formatter";
export * from "./generator";
export * from "./parser";
export * from "./program";
export * from "./formatter.js";
export * from "./generator.js";
export * from "./parser.js";
export * from "./program.js";

0 comments on commit d723c6b

Please sign in to comment.