From bc48f7eefb72b03586ddef6fafe0a7f0b8157305 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 15:06:53 -0700 Subject: [PATCH 01/25] Clean temp/sass-ts. --- ...nc-json-schema-typings-plugin_2025-07-07-22-05.json | 10 ++++++++++ rigs/heft-web-rig/profiles/app/config/heft.json | 4 +++- rigs/heft-web-rig/profiles/library/config/heft.json | 4 +++- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 common/changes/@rushstack/heft-web-rig/user-ianc-json-schema-typings-plugin_2025-07-07-22-05.json diff --git a/common/changes/@rushstack/heft-web-rig/user-ianc-json-schema-typings-plugin_2025-07-07-22-05.json b/common/changes/@rushstack/heft-web-rig/user-ianc-json-schema-typings-plugin_2025-07-07-22-05.json new file mode 100644 index 00000000000..1ae9569490c --- /dev/null +++ b/common/changes/@rushstack/heft-web-rig/user-ianc-json-schema-typings-plugin_2025-07-07-22-05.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-web-rig", + "comment": "Clean the temp/sass-ts folder.", + "type": "minor" + } + ], + "packageName": "@rushstack/heft-web-rig" +} \ No newline at end of file diff --git a/rigs/heft-web-rig/profiles/app/config/heft.json b/rigs/heft-web-rig/profiles/app/config/heft.json index 9830c15f31c..8e80c606118 100644 --- a/rigs/heft-web-rig/profiles/app/config/heft.json +++ b/rigs/heft-web-rig/profiles/app/config/heft.json @@ -21,7 +21,9 @@ "phasesByName": { "build": { - "cleanFiles": [{ "includeGlobs": ["dist", "lib", "lib-amd", "lib-commonjs", "lib-es6"] }], + "cleanFiles": [ + { "includeGlobs": ["dist", "lib", "lib-amd", "lib-commonjs", "lib-es6", "temp/sass-ts"] } + ], "tasksByName": { "set-browserslist-ignore-old-data-env-var": { diff --git a/rigs/heft-web-rig/profiles/library/config/heft.json b/rigs/heft-web-rig/profiles/library/config/heft.json index 9830c15f31c..8e80c606118 100644 --- a/rigs/heft-web-rig/profiles/library/config/heft.json +++ b/rigs/heft-web-rig/profiles/library/config/heft.json @@ -21,7 +21,9 @@ "phasesByName": { "build": { - "cleanFiles": [{ "includeGlobs": ["dist", "lib", "lib-amd", "lib-commonjs", "lib-es6"] }], + "cleanFiles": [ + { "includeGlobs": ["dist", "lib", "lib-amd", "lib-commonjs", "lib-es6", "temp/sass-ts"] } + ], "tasksByName": { "set-browserslist-ignore-old-data-env-var": { From 1dec3d0805b0f870857ea054822596abee2795a1 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sun, 6 Jul 2025 17:12:04 -0700 Subject: [PATCH 02/25] Add an option to the typings generator to override the write function. --- ...chema-typings-plugin_2025-07-07-00-11.json | 10 ++++ common/reviews/api/typings-generator.api.md | 4 +- .../typings-generator/src/TypingsGenerator.ts | 52 ++++++++++++------- 3 files changed, 45 insertions(+), 21 deletions(-) create mode 100644 common/changes/@rushstack/typings-generator/user-ianc-json-schema-typings-plugin_2025-07-07-00-11.json diff --git a/common/changes/@rushstack/typings-generator/user-ianc-json-schema-typings-plugin_2025-07-07-00-11.json b/common/changes/@rushstack/typings-generator/user-ianc-json-schema-typings-plugin_2025-07-07-00-11.json new file mode 100644 index 00000000000..3f9f9f634fc --- /dev/null +++ b/common/changes/@rushstack/typings-generator/user-ianc-json-schema-typings-plugin_2025-07-07-00-11.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/typings-generator", + "comment": "Add an option to provide a `writeFileAsync` function.", + "type": "minor" + } + ], + "packageName": "@rushstack/typings-generator" +} \ No newline at end of file diff --git a/common/reviews/api/typings-generator.api.md b/common/reviews/api/typings-generator.api.md index a942f38b474..f66c7d8d96d 100644 --- a/common/reviews/api/typings-generator.api.md +++ b/common/reviews/api/typings-generator.api.md @@ -79,6 +79,8 @@ export interface ITypingsGeneratorOptionsWithoutReadFile string[]; // (undocumented) parseAndGenerateTypings: (fileContents: TFileContents, filePath: string, relativePath: string) => TTypingsResult | Promise; + // (undocumented) + writeFileAsync?: (filePath: string, contents: string) => Promise; } // @public (undocumented) @@ -100,7 +102,7 @@ export class TypingsGenerator { readonly ignoredFileGlobs: readonly string[]; readonly inputFileGlob: string; // (undocumented) - protected readonly _options: ITypingsGeneratorOptionsWithCustomReadFile; + protected readonly _options: Required, 'writeFileAsync'>> & ITypingsGeneratorOptionsWithCustomReadFile; registerDependency(consumer: string, rawDependency: string): void; // (undocumented) runWatcherAsync(): Promise; diff --git a/libraries/typings-generator/src/TypingsGenerator.ts b/libraries/typings-generator/src/TypingsGenerator.ts index 39cef23ebbe..4a77c9033fd 100644 --- a/libraries/typings-generator/src/TypingsGenerator.ts +++ b/libraries/typings-generator/src/TypingsGenerator.ts @@ -33,6 +33,7 @@ export interface ITypingsGeneratorOptionsWithoutReadFile< relativePath: string ) => TTypingsResult | Promise; getAdditionalOutputFiles?: (relativePath: string) => string[]; + writeFileAsync?: (filePath: string, contents: string) => Promise; } /** @@ -80,7 +81,10 @@ export class TypingsGenerator { // Map of resolved file path -> relative file path private readonly _relativePaths: Map; - protected readonly _options: ITypingsGeneratorOptionsWithCustomReadFile; + protected readonly _options: Required< + Pick, 'writeFileAsync'> + > & + ITypingsGeneratorOptionsWithCustomReadFile; protected readonly terminal: ITerminal; @@ -106,46 +110,56 @@ export class TypingsGenerator { ); public constructor(options: ITypingsGeneratorOptionsWithCustomReadFile); public constructor(options: ITypingsGeneratorOptionsWithCustomReadFile) { - this._options = { + this._options = options = { ...options, readFile: options.readFile ?? ((filePath: string, relativePath: string): Promise => - FileSystem.readFileAsync(filePath) as Promise) + FileSystem.readFileAsync(filePath) as Promise), + writeFileAsync: + options.writeFileAsync ?? + ((filePath: string, contents: string): Promise => + FileSystem.writeFileAsync(filePath, contents, { + ensureFolderExists: true, + convertLineEndings: NewlineKind.OsDefault + })) }; - if (!options.generatedTsFolder) { + const { generatedTsFolder, srcFolder, fileExtensions, globsToIgnore, terminal } = options; + + if (!generatedTsFolder) { throw new Error('generatedTsFolder must be provided'); } - if (!options.srcFolder) { + if (!srcFolder) { throw new Error('srcFolder must be provided'); } - this.sourceFolderPath = options.srcFolder; + this.sourceFolderPath = srcFolder; - if (Path.isUnder(options.srcFolder, options.generatedTsFolder)) { + if (Path.isUnder(srcFolder, generatedTsFolder)) { throw new Error('srcFolder must not be under generatedTsFolder'); } - if (Path.isUnder(options.generatedTsFolder, options.srcFolder)) { + if (Path.isUnder(generatedTsFolder, srcFolder)) { throw new Error('generatedTsFolder must not be under srcFolder'); } - if (!options.fileExtensions || options.fileExtensions.length === 0) { + if (!fileExtensions?.length) { throw new Error('At least one file extension must be provided.'); } - this.ignoredFileGlobs = options.globsToIgnore || []; + this.ignoredFileGlobs = globsToIgnore || []; - this.terminal = options.terminal ?? new Terminal(new ConsoleTerminalProvider({ verboseEnabled: true })); + this.terminal = terminal ?? new Terminal(new ConsoleTerminalProvider({ verboseEnabled: true })); - this._options.fileExtensions = this._normalizeFileExtensions(options.fileExtensions); + const normalizedFileExtensions: string[] = this._normalizeFileExtensions(fileExtensions); + this._options.fileExtensions = normalizedFileExtensions; this._dependenciesOfFile = new Map(); this._consumersOfFile = new Map(); this._relativePaths = new Map(); - this.inputFileGlob = `**/*+(${this._options.fileExtensions.join('|')})`; + this.inputFileGlob = `**/*+(${normalizedFileExtensions.join('|')})`; } /** @@ -165,7 +179,7 @@ export class TypingsGenerator { }); } - await this._reprocessFilesAsync(relativeFilePaths!, checkFilePaths); + await this._reprocessFilesAsync(relativeFilePaths, checkFilePaths); } public async runWatcherAsync(): Promise { @@ -316,10 +330,11 @@ export class TypingsGenerator { private async _parseFileAndGenerateTypingsAsync(relativePath: string, resolvedPath: string): Promise { // Clear registered dependencies prior to reprocessing. this._clearDependencies(resolvedPath); + const { readFile, parseAndGenerateTypings, writeFileAsync } = this._options; try { - const fileContents: TFileContents = await this._options.readFile(resolvedPath, relativePath); - const typingsData: string | undefined = await this._options.parseAndGenerateTypings( + const fileContents: TFileContents = await readFile(resolvedPath, relativePath); + const typingsData: string | undefined = await parseAndGenerateTypings( fileContents, resolvedPath, relativePath @@ -338,10 +353,7 @@ export class TypingsGenerator { const generatedTsFilePaths: Iterable = this._getTypingsFilePaths(relativePath); for (const generatedTsFilePath of generatedTsFilePaths) { - await FileSystem.writeFileAsync(generatedTsFilePath, prefixedTypingsData, { - ensureFolderExists: true, - convertLineEndings: NewlineKind.OsDefault - }); + await writeFileAsync(generatedTsFilePath, prefixedTypingsData); } } catch (e) { this.terminal.writeError( From 9a350452c77a96442081835a280f4a409aa0d3f5 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sun, 6 Jul 2025 17:22:53 -0700 Subject: [PATCH 03/25] Normalize the test schema filenames in node-core-library. --- .../src/test/JsonSchema.test.ts | 30 +++++++++---------- .../__snapshots__/JsonSchema.test.ts.snap | 2 +- .../test-invalid-additional.schema.json} | 0 .../test-invalid-format.schema.json} | 0 .../test-schema-draft-04.schema.json} | 0 .../test-schema-draft-07.schema.json} | 0 .../test-schema-invalid.schema.json} | 0 .../test-schema-nested-child.schema.json} | 0 .../test-schema-nested.schema.json} | 0 .../test-schema.schema.json} | 0 .../test-valid.schema.json} | 0 11 files changed, 16 insertions(+), 16 deletions(-) rename libraries/node-core-library/src/test/test-data/{test-invalid-additional.json => test-schemas/test-invalid-additional.schema.json} (100%) rename libraries/node-core-library/src/test/test-data/{test-invalid-format.json => test-schemas/test-invalid-format.schema.json} (100%) rename libraries/node-core-library/src/test/test-data/{test-schema-draft-04.json => test-schemas/test-schema-draft-04.schema.json} (100%) rename libraries/node-core-library/src/test/test-data/{test-schema-draft-07.json => test-schemas/test-schema-draft-07.schema.json} (100%) rename libraries/node-core-library/src/test/test-data/{test-schema-invalid.json => test-schemas/test-schema-invalid.schema.json} (100%) rename libraries/node-core-library/src/test/test-data/{test-schema-nested-child.json => test-schemas/test-schema-nested-child.schema.json} (100%) rename libraries/node-core-library/src/test/test-data/{test-schema-nested.json => test-schemas/test-schema-nested.schema.json} (100%) rename libraries/node-core-library/src/test/test-data/{test-schema.json => test-schemas/test-schema.schema.json} (100%) rename libraries/node-core-library/src/test/test-data/{test-valid.json => test-schemas/test-valid.schema.json} (100%) diff --git a/libraries/node-core-library/src/test/JsonSchema.test.ts b/libraries/node-core-library/src/test/JsonSchema.test.ts index e2d537056ae..c5f9ffa9df3 100644 --- a/libraries/node-core-library/src/test/JsonSchema.test.ts +++ b/libraries/node-core-library/src/test/JsonSchema.test.ts @@ -4,9 +4,9 @@ import { JsonFile, type JsonObject } from '../JsonFile'; import { JsonSchema, type IJsonSchemaErrorInfo } from '../JsonSchema'; -const SCHEMA_PATH: string = `${__dirname}/test-data/test-schema.json`; -const DRAFT_04_SCHEMA_PATH: string = `${__dirname}/test-data/test-schema-draft-04.json`; -const DRAFT_07_SCHEMA_PATH: string = `${__dirname}/test-data/test-schema-draft-07.json`; +const SCHEMA_PATH: string = `${__dirname}/test-data/test-schemas/test-schema.schema.json`; +const DRAFT_04_SCHEMA_PATH: string = `${__dirname}/test-data/test-schemas/test-schema-draft-04.schema.json`; +const DRAFT_07_SCHEMA_PATH: string = `${__dirname}/test-data/test-schemas/test-schema-draft-07.schema.json`; describe(JsonSchema.name, () => { const schema: JsonSchema = JsonSchema.fromFile(SCHEMA_PATH, { @@ -15,7 +15,7 @@ describe(JsonSchema.name, () => { describe(JsonFile.loadAndValidate.name, () => { test('successfully validates a JSON file', () => { - const jsonPath: string = `${__dirname}/test-data/test-valid.json`; + const jsonPath: string = `${__dirname}/test-data/test-schemas/test-valid.schema.json`; const jsonObject: JsonObject = JsonFile.loadAndValidate(jsonPath, schema); expect(jsonObject).toMatchObject({ @@ -27,7 +27,7 @@ describe(JsonSchema.name, () => { test('successfully validates a JSON file against a draft-04 schema', () => { const schemaDraft04: JsonSchema = JsonSchema.fromFile(DRAFT_04_SCHEMA_PATH); - const jsonPath: string = `${__dirname}/test-data/test-valid.json`; + const jsonPath: string = `${__dirname}/test-data/test-schemas/test-valid.schema.json`; const jsonObject: JsonObject = JsonFile.loadAndValidate(jsonPath, schemaDraft04); expect(jsonObject).toMatchObject({ @@ -41,14 +41,14 @@ describe(JsonSchema.name, () => { schemaVersion: 'draft-07' }); - const jsonPath: string = `${__dirname}/test-data/test-valid.json`; + const jsonPath: string = `${__dirname}/test-data/test-schemas/test-valid.schema.json`; expect(() => JsonFile.loadAndValidate(jsonPath, schemaDraft04)).toThrowErrorMatchingSnapshot(); }); test('validates a JSON file against a draft-07 schema', () => { const schemaDraft07: JsonSchema = JsonSchema.fromFile(DRAFT_07_SCHEMA_PATH); - const jsonPath: string = `${__dirname}/test-data/test-valid.json`; + const jsonPath: string = `${__dirname}/test-data/test-schemas/test-valid.schema.json`; const jsonObject: JsonObject = JsonFile.loadAndValidate(jsonPath, schemaDraft07); expect(jsonObject).toMatchObject({ @@ -58,15 +58,15 @@ describe(JsonSchema.name, () => { }); test('validates a JSON file using nested schemas', () => { - const schemaPathChild: string = `${__dirname}/test-data/test-schema-nested-child.json`; + const schemaPathChild: string = `${__dirname}/test-data/test-schemas/test-schema-nested-child.schema.json`; const schemaChild: JsonSchema = JsonSchema.fromFile(schemaPathChild); - const schemaPathNested: string = `${__dirname}/test-data/test-schema-nested.json`; + const schemaPathNested: string = `${__dirname}/test-data/test-schemas/test-schema-nested.schema.json`; const schemaNested: JsonSchema = JsonSchema.fromFile(schemaPathNested, { dependentSchemas: [schemaChild] }); - const jsonPath: string = `${__dirname}/test-data/test-valid.json`; + const jsonPath: string = `${__dirname}/test-data/test-schemas/test-valid.schema.json`; const jsonObject: JsonObject = JsonFile.loadAndValidate(jsonPath, schemaNested); expect(jsonObject).toMatchObject({ @@ -76,15 +76,15 @@ describe(JsonSchema.name, () => { }); test('throws an error for an invalid nested schema', () => { - const schemaPathChild: string = `${__dirname}/test-data/test-schema-invalid.json`; + const schemaPathChild: string = `${__dirname}/test-data/test-schemas/test-schema-invalid.schema.json`; const schemaInvalidChild: JsonSchema = JsonSchema.fromFile(schemaPathChild); - const schemaPathNested: string = `${__dirname}/test-data/test-schema-nested.json`; + const schemaPathNested: string = `${__dirname}/test-data/test-schemas/test-schema-nested.schema.json`; const schemaNested: JsonSchema = JsonSchema.fromFile(schemaPathNested, { dependentSchemas: [schemaInvalidChild] }); - const jsonPath: string = `${__dirname}/test-data/test-valid.json`; + const jsonPath: string = `${__dirname}/test-data/test-schemas/test-valid.schema.json`; expect.assertions(1); try { @@ -97,7 +97,7 @@ describe(JsonSchema.name, () => { describe(JsonSchema.prototype.validateObjectWithCallback.name, () => { test('successfully reports a compound validation error schema errors', () => { - const jsonPath: string = `${__dirname}/test-data/test-invalid-additional.json`; + const jsonPath: string = `${__dirname}/test-data/test-schemas/test-invalid-additional.schema.json`; const jsonObject: JsonObject = JsonFile.load(jsonPath); const errorDetails: string[] = []; @@ -108,7 +108,7 @@ describe(JsonSchema.name, () => { expect(errorDetails).toMatchSnapshot(); }); test('successfully reports a compound validation error for format errors', () => { - const jsonPath: string = `${__dirname}/test-data/test-invalid-format.json`; + const jsonPath: string = `${__dirname}/test-data/test-schemas/test-invalid-format.schema.json`; const jsonObject: JsonObject = JsonFile.load(jsonPath); const errorDetails: string[] = []; diff --git a/libraries/node-core-library/src/test/__snapshots__/JsonSchema.test.ts.snap b/libraries/node-core-library/src/test/__snapshots__/JsonSchema.test.ts.snap index eb426e41e46..005df0f3e40 100644 --- a/libraries/node-core-library/src/test/__snapshots__/JsonSchema.test.ts.snap +++ b/libraries/node-core-library/src/test/__snapshots__/JsonSchema.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`JsonSchema loadAndValidate throws an error for an invalid nested schema 1`] = ` -"Failed to validate schema \\"test-schema-invalid.json\\": +"Failed to validate schema \\"test-schema-invalid.schema.json\\": Error: #/type must be equal to one of the allowed values diff --git a/libraries/node-core-library/src/test/test-data/test-invalid-additional.json b/libraries/node-core-library/src/test/test-data/test-schemas/test-invalid-additional.schema.json similarity index 100% rename from libraries/node-core-library/src/test/test-data/test-invalid-additional.json rename to libraries/node-core-library/src/test/test-data/test-schemas/test-invalid-additional.schema.json diff --git a/libraries/node-core-library/src/test/test-data/test-invalid-format.json b/libraries/node-core-library/src/test/test-data/test-schemas/test-invalid-format.schema.json similarity index 100% rename from libraries/node-core-library/src/test/test-data/test-invalid-format.json rename to libraries/node-core-library/src/test/test-data/test-schemas/test-invalid-format.schema.json diff --git a/libraries/node-core-library/src/test/test-data/test-schema-draft-04.json b/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-draft-04.schema.json similarity index 100% rename from libraries/node-core-library/src/test/test-data/test-schema-draft-04.json rename to libraries/node-core-library/src/test/test-data/test-schemas/test-schema-draft-04.schema.json diff --git a/libraries/node-core-library/src/test/test-data/test-schema-draft-07.json b/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-draft-07.schema.json similarity index 100% rename from libraries/node-core-library/src/test/test-data/test-schema-draft-07.json rename to libraries/node-core-library/src/test/test-data/test-schemas/test-schema-draft-07.schema.json diff --git a/libraries/node-core-library/src/test/test-data/test-schema-invalid.json b/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-invalid.schema.json similarity index 100% rename from libraries/node-core-library/src/test/test-data/test-schema-invalid.json rename to libraries/node-core-library/src/test/test-data/test-schemas/test-schema-invalid.schema.json diff --git a/libraries/node-core-library/src/test/test-data/test-schema-nested-child.json b/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-nested-child.schema.json similarity index 100% rename from libraries/node-core-library/src/test/test-data/test-schema-nested-child.json rename to libraries/node-core-library/src/test/test-data/test-schemas/test-schema-nested-child.schema.json diff --git a/libraries/node-core-library/src/test/test-data/test-schema-nested.json b/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-nested.schema.json similarity index 100% rename from libraries/node-core-library/src/test/test-data/test-schema-nested.json rename to libraries/node-core-library/src/test/test-data/test-schemas/test-schema-nested.schema.json diff --git a/libraries/node-core-library/src/test/test-data/test-schema.json b/libraries/node-core-library/src/test/test-data/test-schemas/test-schema.schema.json similarity index 100% rename from libraries/node-core-library/src/test/test-data/test-schema.json rename to libraries/node-core-library/src/test/test-data/test-schemas/test-schema.schema.json diff --git a/libraries/node-core-library/src/test/test-data/test-valid.json b/libraries/node-core-library/src/test/test-data/test-schemas/test-valid.schema.json similarity index 100% rename from libraries/node-core-library/src/test/test-data/test-valid.json rename to libraries/node-core-library/src/test/test-data/test-schemas/test-valid.schema.json From b5c585e3c54bf42ddc33d76f4041a702032bf98f Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 13:45:18 -0700 Subject: [PATCH 04/25] fixup! Normalize the test schema filenames in node-core-library. --- .../test-schemas/test-schema-invalid.schema.json | 2 +- .../test-schemas/test-schema-nested-child.schema.json | 2 +- .../test-data/test-schemas/test-schema-nested.schema.json | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-invalid.schema.json b/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-invalid.schema.json index cd03f58b497..4825f561184 100644 --- a/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-invalid.schema.json +++ b/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-invalid.schema.json @@ -1,5 +1,5 @@ { - "$id": "http://example.com/schemas/test-schema-nested-child.json", + "$id": "http://example.com/schemas/test-schema-nested-child.schema.json", "$schema": "http://json-schema.org/draft-07/schema#", "type": "wrong_type" } diff --git a/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-nested-child.schema.json b/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-nested-child.schema.json index c9c67f1b160..ef1836cb7cc 100644 --- a/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-nested-child.schema.json +++ b/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-nested-child.schema.json @@ -1,5 +1,5 @@ { - "$id": "http://example.com/schemas/test-schema-nested-child.json", + "$id": "http://example.com/schemas/test-schema-nested-child.schema.json", "definitions": { "type1": { "description": "Description for type1", diff --git a/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-nested.schema.json b/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-nested.schema.json index 5efcb3118e1..7e25cf3db3c 100644 --- a/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-nested.schema.json +++ b/libraries/node-core-library/src/test/test-data/test-schemas/test-schema-nested.schema.json @@ -1,5 +1,5 @@ { - "$id": "http://example.com/schemas/test-schema-nested.json", + "$id": "http://example.com/schemas/test-schema-nested.schema.json", "title": "Test Schema File", "type": "object", @@ -21,14 +21,14 @@ "description": "Description for exampleOneOf - this is a very long description to show in an error message", "type": "object", "oneOf": [ - { "$ref": "test-schema-nested-child.json#/definitions/type1" }, - { "$ref": "test-schema-nested-child.json#/definitions/type2" } + { "$ref": "test-schema-nested-child.schema.json#/definitions/type1" }, + { "$ref": "test-schema-nested-child.schema.json#/definitions/type2" } ] }, "exampleUniqueObjectArray": { "type": "array", "uniqueItems": true, - "items": { "$ref": "test-schema-nested-child.json#/definitions/type2" } + "items": { "$ref": "test-schema-nested-child.schema.json#/definitions/type2" } } }, "additionalProperties": false, From f2cd0b6acc776fad842b0710dbaa40bca8f7366d Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 13:55:22 -0700 Subject: [PATCH 05/25] fixup! Normalize the test schema filenames in node-core-library. --- ...nc-json-schema-typings-plugin_2025-07-07-20-54.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@rushstack/node-core-library/user-ianc-json-schema-typings-plugin_2025-07-07-20-54.json diff --git a/common/changes/@rushstack/node-core-library/user-ianc-json-schema-typings-plugin_2025-07-07-20-54.json b/common/changes/@rushstack/node-core-library/user-ianc-json-schema-typings-plugin_2025-07-07-20-54.json new file mode 100644 index 00000000000..d702845598d --- /dev/null +++ b/common/changes/@rushstack/node-core-library/user-ianc-json-schema-typings-plugin_2025-07-07-20-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/node-core-library", + "comment": "", + "type": "none" + } + ], + "packageName": "@rushstack/node-core-library" +} \ No newline at end of file From 056e92fae372d717aa9639da94eee828a9928dc6 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 13:57:26 -0700 Subject: [PATCH 06/25] Initial implementation of the json-schema-typings-plugin. --- .../config/heft.json | 24 ++ .../config/jest.config.json | 3 + .../config/rig.json | 7 + .../eslint.config.js | 21 ++ .../package.json | 20 ++ .../test/JsonSchemaTypingsGenerator.test.ts | 40 +++ .../JsonSchemaTypingsGenerator.test.ts.snap | 248 ++++++++++++++++++ .../tsconfig.json | 3 + ...chema-typings-plugin_2025-07-07-20-54.json | 10 + .../rush/browser-approved-packages.json | 8 - .../rush/nonbrowser-approved-packages.json | 16 ++ .../.eslintrc.js | 12 + .../.npmignore | 33 +++ .../heft-json-schema-typings-plugin/LICENSE | 24 ++ .../heft-json-schema-typings-plugin/README.md | 12 + .../config/rig.json | 7 + .../heft-plugin.json | 11 + .../package.json | 30 +++ .../src/JsonSchemaTypingsGenerator.ts | 44 ++++ .../src/JsonSchemaTypingsPlugin.ts | 97 +++++++ .../src/schemas/options.schema.json | 23 ++ .../tsconfig.json | 3 + .../src/schemas/options.schema.json | 12 +- rush.json | 12 + 24 files changed, 708 insertions(+), 12 deletions(-) create mode 100644 build-tests/heft-json-schema-typings-plugin-test/config/heft.json create mode 100644 build-tests/heft-json-schema-typings-plugin-test/config/jest.config.json create mode 100644 build-tests/heft-json-schema-typings-plugin-test/config/rig.json create mode 100644 build-tests/heft-json-schema-typings-plugin-test/eslint.config.js create mode 100644 build-tests/heft-json-schema-typings-plugin-test/package.json create mode 100644 build-tests/heft-json-schema-typings-plugin-test/src/test/JsonSchemaTypingsGenerator.test.ts create mode 100644 build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap create mode 100644 build-tests/heft-json-schema-typings-plugin-test/tsconfig.json create mode 100644 common/changes/@rushstack/heft-json-schema-typings-plugin/user-ianc-json-schema-typings-plugin_2025-07-07-20-54.json create mode 100644 heft-plugins/heft-json-schema-typings-plugin/.eslintrc.js create mode 100644 heft-plugins/heft-json-schema-typings-plugin/.npmignore create mode 100644 heft-plugins/heft-json-schema-typings-plugin/LICENSE create mode 100644 heft-plugins/heft-json-schema-typings-plugin/README.md create mode 100644 heft-plugins/heft-json-schema-typings-plugin/config/rig.json create mode 100644 heft-plugins/heft-json-schema-typings-plugin/heft-plugin.json create mode 100644 heft-plugins/heft-json-schema-typings-plugin/package.json create mode 100644 heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts create mode 100644 heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsPlugin.ts create mode 100644 heft-plugins/heft-json-schema-typings-plugin/src/schemas/options.schema.json create mode 100644 heft-plugins/heft-json-schema-typings-plugin/tsconfig.json diff --git a/build-tests/heft-json-schema-typings-plugin-test/config/heft.json b/build-tests/heft-json-schema-typings-plugin-test/config/heft.json new file mode 100644 index 00000000000..9ca23a6775b --- /dev/null +++ b/build-tests/heft-json-schema-typings-plugin-test/config/heft.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json", + + "extends": "local-node-rig/profiles/default/config/heft.json", + + "phasesByName": { + "build": { + "cleanFiles": [{ "includeGlobs": ["temp/schema-dts"] }], + + "tasksByName": { + "json-schema-typings": { + "taskPlugin": { + "pluginPackage": "@rushstack/heft-json-schema-typings-plugin", + "pluginName": "json-schema-typings-plugin", + "options": { + "srcFolder": "node_modules/@rushstack/node-core-library/src/test/test-data/test-schemas", + "generatedTsFolders": ["temp/schema-dts"] + } + } + } + } + } + } +} diff --git a/build-tests/heft-json-schema-typings-plugin-test/config/jest.config.json b/build-tests/heft-json-schema-typings-plugin-test/config/jest.config.json new file mode 100644 index 00000000000..d1749681d90 --- /dev/null +++ b/build-tests/heft-json-schema-typings-plugin-test/config/jest.config.json @@ -0,0 +1,3 @@ +{ + "extends": "local-node-rig/profiles/default/config/jest.config.json" +} diff --git a/build-tests/heft-json-schema-typings-plugin-test/config/rig.json b/build-tests/heft-json-schema-typings-plugin-test/config/rig.json new file mode 100644 index 00000000000..165ffb001f5 --- /dev/null +++ b/build-tests/heft-json-schema-typings-plugin-test/config/rig.json @@ -0,0 +1,7 @@ +{ + // The "rig.json" file directs tools to look for their config files in an external package. + // Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + + "rigPackageName": "local-node-rig" +} diff --git a/build-tests/heft-json-schema-typings-plugin-test/eslint.config.js b/build-tests/heft-json-schema-typings-plugin-test/eslint.config.js new file mode 100644 index 00000000000..ceb5a1bee40 --- /dev/null +++ b/build-tests/heft-json-schema-typings-plugin-test/eslint.config.js @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool'); +const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals'); + +module.exports = [ + ...nodeTrustedToolProfile, + ...friendlyLocalsMixin, + { + files: ['**/*.ts', '**/*.tsx'], + languageOptions: { + parserOptions: { + tsconfigRootDir: __dirname + } + }, + rules: { + 'no-console': 'off' + } + } +]; diff --git a/build-tests/heft-json-schema-typings-plugin-test/package.json b/build-tests/heft-json-schema-typings-plugin-test/package.json new file mode 100644 index 00000000000..5b1d3fd9a96 --- /dev/null +++ b/build-tests/heft-json-schema-typings-plugin-test/package.json @@ -0,0 +1,20 @@ +{ + "name": "heft-json-schema-typings-plugin-test", + "description": "This project illustrates configuring Jest reporters in a minimal Heft project", + "version": "1.0.0", + "private": true, + "scripts": { + "build": "heft build --clean", + "start": "heft build-watch", + "_phase:build": "heft run --only build -- --clean", + "_phase:test": "heft run --only test -- --clean" + }, + "devDependencies": { + "@rushstack/heft-json-schema-typings-plugin": "workspace:*", + "@rushstack/heft": "workspace:*", + "eslint": "~9.25.1", + "local-node-rig": "workspace:*", + "@rushstack/node-core-library": "workspace:*", + "@rushstack/terminal": "workspace:*" + } +} diff --git a/build-tests/heft-json-schema-typings-plugin-test/src/test/JsonSchemaTypingsGenerator.test.ts b/build-tests/heft-json-schema-typings-plugin-test/src/test/JsonSchemaTypingsGenerator.test.ts new file mode 100644 index 00000000000..d6dbe196c5d --- /dev/null +++ b/build-tests/heft-json-schema-typings-plugin-test/src/test/JsonSchemaTypingsGenerator.test.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import { FileSystem, type FolderItem, PackageJsonLookup } from '@rushstack/node-core-library'; + +async function* getFolderItemsAsync( + absolutePath: string, + relativePath: string +): AsyncGenerator<[string, string]> { + const folderItems: FolderItem[] = await FileSystem.readFolderItemsAsync(absolutePath); + for (const item of folderItems) { + const itemName: string = item.name; + const itemAbsolutePath: string = `${absolutePath}/${itemName}`; + const itemRelativePath: string = `${relativePath}/${itemName}`; + if (item.isDirectory()) { + yield* getFolderItemsAsync(itemAbsolutePath, itemRelativePath); + } else { + const itemContents: string = await FileSystem.readFileAsync(itemAbsolutePath); + yield [itemRelativePath, itemContents]; + } + } +} + +describe('json-schema-typings-plugin', () => { + it('should generate typings for JSON Schemas', async () => { + const rootFolder: string | undefined = PackageJsonLookup.instance.tryGetPackageFolderFor(__dirname); + if (!rootFolder) { + throw new Error('Could not find root folder for the test'); + } + + const folderItemsArray: [string, string][] = []; + for await (const item of getFolderItemsAsync(`${rootFolder}/temp/schema-dts`, '.')) { + folderItemsArray.push(item); + } + + folderItemsArray.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)); + const folderItems: Record = Object.fromEntries(folderItemsArray); + expect(folderItems).toMatchSnapshot(); + }); +}); diff --git a/build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap b/build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap new file mode 100644 index 00000000000..f28612d97ef --- /dev/null +++ b/build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap @@ -0,0 +1,248 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`json-schema-typings-plugin should generate typings for JSON Schemas 1`] = ` +Object { + "./test-invalid-additional.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior + +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface TestInvalidAdditional { + [k: string]: unknown; +} +", + "./test-invalid-format.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior + +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface TestInvalidFormat { + [k: string]: unknown; +} +", + "./test-schema-draft-04.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior + +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface TestSchemaFile { + exampleString: string; + exampleLink?: string; + exampleArray: string[]; + /** + * Description for exampleOneOf - this is a very long description to show in an error message + */ + exampleOneOf?: Type1 | Type2; + exampleUniqueObjectArray?: { + field2?: string; + field3?: string; + }[]; +} +/** + * Description for type1 + */ +export interface Type1 { + /** + * Description for field1 + */ + field1: string; +} +/** + * Description for type2 + */ +export interface Type2 { + /** + * Description for field2 + */ + field2: string; + /** + * Description for field3 + */ + field3: string; +} +", + "./test-schema-draft-07.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior + +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface TestSchemaFile { + exampleString: string; + exampleLink?: string; + exampleArray: string[]; + /** + * Description for exampleOneOf - this is a very long description to show in an error message + */ + exampleOneOf?: Type1 | Type2; + exampleUniqueObjectArray?: { + field2?: string; + field3?: string; + }[]; +} +/** + * Description for type1 + */ +export interface Type1 { + /** + * Description for field1 + */ + field1: string; +} +/** + * Description for type2 + */ +export interface Type2 { + /** + * Description for field2 + */ + field2: string; + /** + * Description for field3 + */ + field3: string; +} +", + "./test-schema-invalid.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior + +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface HttpExampleComSchemasTestSchemaNestedChildSchemaJson { + [k: string]: unknown; +} +", + "./test-schema-nested-child.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior + +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface HttpExampleComSchemasTestSchemaNestedChildSchemaJson { + [k: string]: unknown; +} +", + "./test-schema-nested.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior + +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface TestSchemaFile { + exampleString: string; + exampleLink?: string; + exampleArray: string[]; + /** + * Description for exampleOneOf - this is a very long description to show in an error message + */ + exampleOneOf?: Type1 | Type2; + exampleUniqueObjectArray?: Type2[]; +} +/** + * Description for type1 + */ +export interface Type1 { + /** + * Description for field1 + */ + field1: string; +} +/** + * Description for type2 + */ +export interface Type2 { + /** + * Description for field2 + */ + field2: string; + /** + * Description for field3 + */ + field3: string; +} +", + "./test-schema.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior + +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface TestSchemaFile { + exampleString: string; + exampleLink?: string; + exampleArray: string[]; + /** + * Description for exampleOneOf - this is a very long description to show in an error message + */ + exampleOneOf?: Type1 | Type2; + exampleUniqueObjectArray?: { + field2?: string; + field3?: string; + }[]; +} +/** + * Description for type1 + */ +export interface Type1 { + /** + * Description for field1 + */ + field1: string; +} +/** + * Description for type2 + */ +export interface Type2 { + /** + * Description for field2 + */ + field2: string; + /** + * Description for field3 + */ + field3: string; +} +", + "./test-valid.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior + +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface TestValid { + [k: string]: unknown; +} +", +} +`; diff --git a/build-tests/heft-json-schema-typings-plugin-test/tsconfig.json b/build-tests/heft-json-schema-typings-plugin-test/tsconfig.json new file mode 100644 index 00000000000..dac21d04081 --- /dev/null +++ b/build-tests/heft-json-schema-typings-plugin-test/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json" +} diff --git a/common/changes/@rushstack/heft-json-schema-typings-plugin/user-ianc-json-schema-typings-plugin_2025-07-07-20-54.json b/common/changes/@rushstack/heft-json-schema-typings-plugin/user-ianc-json-schema-typings-plugin_2025-07-07-20-54.json new file mode 100644 index 00000000000..957560b6f99 --- /dev/null +++ b/common/changes/@rushstack/heft-json-schema-typings-plugin/user-ianc-json-schema-typings-plugin_2025-07-07-20-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-json-schema-typings-plugin", + "comment": "Initial release.", + "type": "minor" + } + ], + "packageName": "@rushstack/heft-json-schema-typings-plugin" +} \ No newline at end of file diff --git a/common/config/rush/browser-approved-packages.json b/common/config/rush/browser-approved-packages.json index e34c53ccdde..15e248ddeba 100644 --- a/common/config/rush/browser-approved-packages.json +++ b/common/config/rush/browser-approved-packages.json @@ -58,14 +58,6 @@ "name": "dependency-path", "allowedCategories": [ "libraries" ] }, - { - "name": "heft-example-lifecycle-plugin", - "allowedCategories": [ "tests" ] - }, - { - "name": "local-web-rig", - "allowedCategories": [ "libraries", "vscode-extensions" ] - }, { "name": "office-ui-fabric-core", "allowedCategories": [ "libraries" ] diff --git a/common/config/rush/nonbrowser-approved-packages.json b/common/config/rush/nonbrowser-approved-packages.json index 4c93eec71d3..13e6fa0f8eb 100644 --- a/common/config/rush/nonbrowser-approved-packages.json +++ b/common/config/rush/nonbrowser-approved-packages.json @@ -174,6 +174,10 @@ "name": "@rushstack/heft-jest-plugin", "allowedCategories": [ "libraries", "tests" ] }, + { + "name": "@rushstack/heft-json-schema-typings-plugin", + "allowedCategories": [ "tests" ] + }, { "name": "@rushstack/heft-lint-plugin", "allowedCategories": [ "libraries", "tests" ] @@ -622,6 +626,10 @@ "name": "heft-action-plugin", "allowedCategories": [ "tests" ] }, + { + "name": "heft-example-lifecycle-plugin", + "allowedCategories": [ "tests" ] + }, { "name": "heft-example-plugin-01", "allowedCategories": [ "tests" ] @@ -726,6 +734,10 @@ "name": "js-yaml", "allowedCategories": [ "libraries" ] }, + { + "name": "json-schema-to-typescript", + "allowedCategories": [ "libraries" ] + }, { "name": "json-stable-stringify-without-jsonify", "allowedCategories": [ "libraries" ] @@ -750,6 +762,10 @@ "name": "local-node-rig", "allowedCategories": [ "libraries", "tests", "vscode-extensions" ] }, + { + "name": "local-web-rig", + "allowedCategories": [ "libraries", "vscode-extensions" ] + }, { "name": "lodash", "allowedCategories": [ "libraries", "tests" ] diff --git a/heft-plugins/heft-json-schema-typings-plugin/.eslintrc.js b/heft-plugins/heft-json-schema-typings-plugin/.eslintrc.js new file mode 100644 index 00000000000..bc633c3e1b9 --- /dev/null +++ b/heft-plugins/heft-json-schema-typings-plugin/.eslintrc.js @@ -0,0 +1,12 @@ +// This is a workaround for https://github.com/eslint/eslint/issues/3458 +require('decoupled-local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution'); +// This is a workaround for https://github.com/microsoft/rushstack/issues/3021 +require('decoupled-local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names'); + +module.exports = { + extends: [ + 'decoupled-local-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool', + 'decoupled-local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals' + ], + parserOptions: { tsconfigRootDir: __dirname } +}; diff --git a/heft-plugins/heft-json-schema-typings-plugin/.npmignore b/heft-plugins/heft-json-schema-typings-plugin/.npmignore new file mode 100644 index 00000000000..e15a94aeb84 --- /dev/null +++ b/heft-plugins/heft-json-schema-typings-plugin/.npmignore @@ -0,0 +1,33 @@ +# THIS IS A STANDARD TEMPLATE FOR .npmignore FILES IN THIS REPO. + +# Ignore all files by default, to avoid accidentally publishing unintended files. +* + +# Use negative patterns to bring back the specific things we want to publish. +!/bin/** +!/lib/** +!/lib-*/** +!/dist/** + +!CHANGELOG.md +!CHANGELOG.json +!heft-plugin.json +!rush-plugin-manifest.json +!ThirdPartyNotice.txt + +# Ignore certain patterns that should not get published. +/dist/*.stats.* +/lib/**/test/ +/lib-*/**/test/ +*.test.js + +# NOTE: These don't need to be specified, because NPM includes them automatically. +# +# package.json +# README.md +# LICENSE + +# --------------------------------------------------------------------------- +# DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. +# --------------------------------------------------------------------------- + diff --git a/heft-plugins/heft-json-schema-typings-plugin/LICENSE b/heft-plugins/heft-json-schema-typings-plugin/LICENSE new file mode 100644 index 00000000000..4c95bdfe909 --- /dev/null +++ b/heft-plugins/heft-json-schema-typings-plugin/LICENSE @@ -0,0 +1,24 @@ +@rushstack/heft-json-schema-typings-plugin + +Copyright (c) Microsoft Corporation. All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/heft-plugins/heft-json-schema-typings-plugin/README.md b/heft-plugins/heft-json-schema-typings-plugin/README.md new file mode 100644 index 00000000000..e6fc6cd0be1 --- /dev/null +++ b/heft-plugins/heft-json-schema-typings-plugin/README.md @@ -0,0 +1,12 @@ +# @rushstack/heft-json-schema-typings-plugin + +This is a Heft plugin for generating TypeScript typings from JSON schema files. + +## Links + +- [CHANGELOG.md]( + https://github.com/microsoft/rushstack/blob/main/heft-plugins/heft-json-schema-typings-plugin/CHANGELOG.md) - Find +out what's new in the latest version +- [@rushstack/heft](https://www.npmjs.com/package/@rushstack/heft) - Heft is a config-driven toolchain that invokes popular tools such as TypeScript, ESLint, Jest, Webpack, and API Extractor. + +Heft is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/heft-plugins/heft-json-schema-typings-plugin/config/rig.json b/heft-plugins/heft-json-schema-typings-plugin/config/rig.json new file mode 100644 index 00000000000..cc98dea43dd --- /dev/null +++ b/heft-plugins/heft-json-schema-typings-plugin/config/rig.json @@ -0,0 +1,7 @@ +{ + // The "rig.json" file directs tools to look for their config files in an external package. + // Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + + "rigPackageName": "decoupled-local-node-rig" +} diff --git a/heft-plugins/heft-json-schema-typings-plugin/heft-plugin.json b/heft-plugins/heft-json-schema-typings-plugin/heft-plugin.json new file mode 100644 index 00000000000..29eec2267b7 --- /dev/null +++ b/heft-plugins/heft-json-schema-typings-plugin/heft-plugin.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft-plugin.schema.json", + + "taskPlugins": [ + { + "pluginName": "json-schema-typings-plugin", + "entryPoint": "./lib/JsonSchemaTypingsPlugin", + "optionsSchema": "./lib/schemas/options.schema.json" + } + ] +} diff --git a/heft-plugins/heft-json-schema-typings-plugin/package.json b/heft-plugins/heft-json-schema-typings-plugin/package.json new file mode 100644 index 00000000000..f1008fbe8d8 --- /dev/null +++ b/heft-plugins/heft-json-schema-typings-plugin/package.json @@ -0,0 +1,30 @@ +{ + "name": "@rushstack/heft-json-schema-typings-plugin", + "version": "0.0.0", + "description": "A Heft plugin for generating TypeScript typings from JSON schema files.", + "repository": { + "type": "git", + "url": "https://github.com/microsoft/rushstack.git", + "directory": "heft-plugins/heft-json-schema-typings-plugin" + }, + "homepage": "https://rushstack.io/pages/heft/overview/", + "license": "MIT", + "scripts": { + "build": "heft test --clean", + "start": "heft build-watch", + "_phase:build": "heft run --only build -- --clean" + }, + "peerDependencies": { + "@rushstack/heft": "0.74.0" + }, + "dependencies": { + "@rushstack/node-core-library": "workspace:*", + "@rushstack/typings-generator": "workspace:*", + "json-schema-to-typescript": "~15.0.4" + }, + "devDependencies": { + "@rushstack/heft": "workspace:*", + "@rushstack/terminal": "workspace:*", + "decoupled-local-node-rig": "workspace:*" + } +} diff --git a/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts b/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts new file mode 100644 index 00000000000..793a1cabeeb --- /dev/null +++ b/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import { Path } from '@rushstack/node-core-library'; +import { + type ITypingsGeneratorBaseOptions, + type ITypingsGeneratorOptionsWithoutReadFile, + TypingsGenerator +} from '@rushstack/typings-generator'; +import { compileFromFile } from 'json-schema-to-typescript'; +import path from 'path'; + +interface IJsonSchemaTypingsGeneratorBaseOptions + extends ITypingsGeneratorBaseOptions, + Pick {} + +export class JsonSchemaTypingsGenerator extends TypingsGenerator { + public constructor(options: IJsonSchemaTypingsGeneratorBaseOptions) { + super({ + ...options, + srcFolder: Path.convertToPlatformDefault(options.srcFolder), + fileExtensions: ['.schema.json'], + // Don't bother reading the file contents, compileFromFile will read the file + readFile: () => '', + // eslint-disable-next-line @typescript-eslint/naming-convention + parseAndGenerateTypings: async (fileContents: string, filePath: string): Promise => + await compileFromFile(filePath, { + // $refOptions: { + // resolve: { + // file: { + // canRead: true, + // // eslint-disable-next-line @typescript-eslint/naming-convention + // read: async (fileInfo) => { + // debugger; + // return await FileSystem.readFileAsync(fileInfo.url); + // } + // } + // } + // }, + cwd: path.dirname(filePath) + }) + }); + } +} diff --git a/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsPlugin.ts b/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsPlugin.ts new file mode 100644 index 00000000000..573e8cf5ce9 --- /dev/null +++ b/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsPlugin.ts @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import type { + HeftConfiguration, + IHeftTaskSession, + IHeftTaskPlugin, + IHeftTaskRunIncrementalHookOptions, + IWatchedFileState +} from '@rushstack/heft'; +import type { ITerminal } from '@rushstack/terminal'; + +import { JsonSchemaTypingsGenerator } from './JsonSchemaTypingsGenerator'; + +const PLUGIN_NAME: 'json-schema-typings-plugin' = 'json-schema-typings-plugin'; + +// TODO: Replace this with usage of this plugin after this plugin is published +export interface IJsonSchemaTypingsPluginOptions { + srcFolder?: string; + generatedTsFolders?: string[]; +} + +export default class JsonSchemaTypingsPlugin implements IHeftTaskPlugin { + /** + * Generate typings for JSON Schemas. + */ + public apply( + taskSession: IHeftTaskSession, + heftConfiguration: HeftConfiguration, + options: IJsonSchemaTypingsPluginOptions + ): void { + const { + logger: { terminal }, + hooks: { run, runIncremental } + } = taskSession; + const { buildFolderPath } = heftConfiguration; + const { srcFolder = 'src', generatedTsFolders = ['temp/schemas-ts'] } = options; + + const resolvedTsFolders: string[] = []; + for (const generatedTsFolder of generatedTsFolders) { + resolvedTsFolders.push(`${buildFolderPath}/${generatedTsFolder}`); + } + + const [generatedTsFolder, ...secondaryGeneratedTsFolders] = resolvedTsFolders; + + const typingsGenerator: JsonSchemaTypingsGenerator = new JsonSchemaTypingsGenerator({ + srcFolder: `${buildFolderPath}/${srcFolder}`, + generatedTsFolder, + secondaryGeneratedTsFolders, + terminal + }); + + run.tapPromise(PLUGIN_NAME, async () => { + await this._runTypingsGeneratorAsync(typingsGenerator, terminal, undefined); + }); + + runIncremental.tapPromise( + PLUGIN_NAME, + async (runIncrementalOptions: IHeftTaskRunIncrementalHookOptions) => { + await this._runTypingsGeneratorAsync(typingsGenerator, terminal, runIncrementalOptions); + } + ); + } + + private async _runTypingsGeneratorAsync( + typingsGenerator: JsonSchemaTypingsGenerator, + terminal: ITerminal, + runIncrementalOptions: IHeftTaskRunIncrementalHookOptions | undefined + ): Promise { + // If we have the incremental options, use them to determine which files to process. + // Otherwise, process all files. The typings generator also provides the file paths + // as relative paths from the sourceFolderPath. + let changedRelativeFilePaths: string[] | undefined; + if (runIncrementalOptions) { + changedRelativeFilePaths = []; + const relativeFilePaths: Map = await runIncrementalOptions.watchGlobAsync( + typingsGenerator.inputFileGlob, + { + cwd: typingsGenerator.sourceFolderPath, + ignore: Array.from(typingsGenerator.ignoredFileGlobs), + absolute: false + } + ); + for (const [relativeFilePath, { changed }] of relativeFilePaths) { + if (changed) { + changedRelativeFilePaths.push(relativeFilePath); + } + } + if (changedRelativeFilePaths.length === 0) { + return; + } + } + + terminal.writeLine('Generating typings for JSON schemas...'); + await typingsGenerator.generateTypingsAsync(changedRelativeFilePaths); + } +} diff --git a/heft-plugins/heft-json-schema-typings-plugin/src/schemas/options.schema.json b/heft-plugins/heft-json-schema-typings-plugin/src/schemas/options.schema.json new file mode 100644 index 00000000000..27716523997 --- /dev/null +++ b/heft-plugins/heft-json-schema-typings-plugin/src/schemas/options.schema.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + + "type": "object", + "additionalProperties": false, + + "properties": { + "srcFolder": { + "type": "string", + "description": "Source code root directory. Defaults to \"src/\".", + "pattern": "[^\\\\]" + }, + + "generatedTsFolders": { + "type": "array", + "description": "Output directories for generated typings. Defaults to [\"temp/schemas-ts\"].", + "minItems": 1, + "items": { + "type": "string" + } + } + } +} diff --git a/heft-plugins/heft-json-schema-typings-plugin/tsconfig.json b/heft-plugins/heft-json-schema-typings-plugin/tsconfig.json new file mode 100644 index 00000000000..1a33d17b873 --- /dev/null +++ b/heft-plugins/heft-json-schema-typings-plugin/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/decoupled-local-node-rig/profiles/default/tsconfig-base.json" +} diff --git a/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json b/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json index ae9cf8f52c3..f39a3a69112 100644 --- a/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json +++ b/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json @@ -50,27 +50,31 @@ "srcFolder": { "type": "string", - "description": "Source code root directory. Defaults to \"src/\"." + "description": "Source code root directory. Defaults to \"src/\".", + "pattern": "[^\\\\]" }, "trimmedJsonOutputFolders": { "type": "array", "description": "Output folders, relative to the project root, where JSON files that have had comments and any ignored strings discarded should be emitted to.", "items": { - "type": "string" + "type": "string", + "pattern": "[^\\\\]" } }, "generatedTsFolder": { "type": "string", - "description": "Output directory for generated typings. Defaults to \"temp/loc-ts/\"." + "description": "Output directory for generated typings. Defaults to \"temp/loc-ts/\".", + "pattern": "[^\\\\]" }, "secondaryGeneratedTsFolders": { "type": "array", "description": "Additional folders, relative to the project root, where the generated typings should be emitted to.", "items": { - "type": "string" + "type": "string", + "pattern": "[^\\\\]" } }, diff --git a/rush.json b/rush.json index 45f7bc1ccda..cc4812d6565 100644 --- a/rush.json +++ b/rush.json @@ -839,6 +839,12 @@ "reviewCategory": "tests", "shouldPublish": false }, + { + "packageName": "heft-json-schema-typings-plugin-test", + "projectFolder": "build-tests/heft-json-schema-typings-plugin-test", + "reviewCategory": "tests", + "shouldPublish": false + }, { "packageName": "heft-fastify-test", "projectFolder": "build-tests/heft-fastify-test", @@ -1047,6 +1053,12 @@ "reviewCategory": "libraries", "shouldPublish": true }, + { + "packageName": "@rushstack/heft-json-schema-typings-plugin", + "projectFolder": "heft-plugins/heft-json-schema-typings-plugin", + "reviewCategory": "libraries", + "shouldPublish": true + }, { "packageName": "@rushstack/heft-lint-plugin", "projectFolder": "heft-plugins/heft-lint-plugin", From 68d0d83239fa274476043f5478c3d99eeea36e6d Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 15:09:19 -0700 Subject: [PATCH 07/25] fixup! Initial implementation of the json-schema-typings-plugin. --- .../src/schemas/options.schema.json | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json b/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json index f39a3a69112..ae9cf8f52c3 100644 --- a/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json +++ b/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json @@ -50,31 +50,27 @@ "srcFolder": { "type": "string", - "description": "Source code root directory. Defaults to \"src/\".", - "pattern": "[^\\\\]" + "description": "Source code root directory. Defaults to \"src/\"." }, "trimmedJsonOutputFolders": { "type": "array", "description": "Output folders, relative to the project root, where JSON files that have had comments and any ignored strings discarded should be emitted to.", "items": { - "type": "string", - "pattern": "[^\\\\]" + "type": "string" } }, "generatedTsFolder": { "type": "string", - "description": "Output directory for generated typings. Defaults to \"temp/loc-ts/\".", - "pattern": "[^\\\\]" + "description": "Output directory for generated typings. Defaults to \"temp/loc-ts/\"." }, "secondaryGeneratedTsFolders": { "type": "array", "description": "Additional folders, relative to the project root, where the generated typings should be emitted to.", "items": { - "type": "string", - "pattern": "[^\\\\]" + "type": "string" } }, From 5de5b40368abe0ba4179e4683a1083bdb2558c83 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 15:11:07 -0700 Subject: [PATCH 08/25] Ensure path paramters don't contain backslashes. --- ...-json-schema-typings-plugin_2025-07-07-22-10.json | 10 ++++++++++ .../src/schemas/options.schema.json | 12 ++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 common/changes/@rushstack/heft-localization-typings-plugin/user-ianc-json-schema-typings-plugin_2025-07-07-22-10.json diff --git a/common/changes/@rushstack/heft-localization-typings-plugin/user-ianc-json-schema-typings-plugin_2025-07-07-22-10.json b/common/changes/@rushstack/heft-localization-typings-plugin/user-ianc-json-schema-typings-plugin_2025-07-07-22-10.json new file mode 100644 index 00000000000..b61b5ecca87 --- /dev/null +++ b/common/changes/@rushstack/heft-localization-typings-plugin/user-ianc-json-schema-typings-plugin_2025-07-07-22-10.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-localization-typings-plugin", + "comment": "Ensure the `srcFolder`, `trimmedJsonOutputFolders`, `generatedTsFolder`, and `secondaryGeneratedTsFolders` options don't contain backslashes.", + "type": "minor" + } + ], + "packageName": "@rushstack/heft-localization-typings-plugin" +} \ No newline at end of file diff --git a/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json b/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json index ae9cf8f52c3..f39a3a69112 100644 --- a/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json +++ b/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json @@ -50,27 +50,31 @@ "srcFolder": { "type": "string", - "description": "Source code root directory. Defaults to \"src/\"." + "description": "Source code root directory. Defaults to \"src/\".", + "pattern": "[^\\\\]" }, "trimmedJsonOutputFolders": { "type": "array", "description": "Output folders, relative to the project root, where JSON files that have had comments and any ignored strings discarded should be emitted to.", "items": { - "type": "string" + "type": "string", + "pattern": "[^\\\\]" } }, "generatedTsFolder": { "type": "string", - "description": "Output directory for generated typings. Defaults to \"temp/loc-ts/\"." + "description": "Output directory for generated typings. Defaults to \"temp/loc-ts/\".", + "pattern": "[^\\\\]" }, "secondaryGeneratedTsFolders": { "type": "array", "description": "Additional folders, relative to the project root, where the generated typings should be emitted to.", "items": { - "type": "string" + "type": "string", + "pattern": "[^\\\\]" } }, From 62af9415d4ee6fb108603999a2a9ea5502df57c9 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 16:26:01 -0700 Subject: [PATCH 09/25] fixup! Initial implementation of the json-schema-typings-plugin. --- .../heft-json-schema-typings-plugin/.eslintrc.js | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 heft-plugins/heft-json-schema-typings-plugin/.eslintrc.js diff --git a/heft-plugins/heft-json-schema-typings-plugin/.eslintrc.js b/heft-plugins/heft-json-schema-typings-plugin/.eslintrc.js deleted file mode 100644 index bc633c3e1b9..00000000000 --- a/heft-plugins/heft-json-schema-typings-plugin/.eslintrc.js +++ /dev/null @@ -1,12 +0,0 @@ -// This is a workaround for https://github.com/eslint/eslint/issues/3458 -require('decoupled-local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution'); -// This is a workaround for https://github.com/microsoft/rushstack/issues/3021 -require('decoupled-local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names'); - -module.exports = { - extends: [ - 'decoupled-local-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool', - 'decoupled-local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals' - ], - parserOptions: { tsconfigRootDir: __dirname } -}; From cbac99f2f6a9dacd9c4c55ba60e9b7a7523ded86 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 16:43:32 -0700 Subject: [PATCH 10/25] Rush update. --- .../config/subspaces/default/pnpm-lock.yaml | 563 +++++++++++++++--- .../config/subspaces/default/repo-state.json | 2 +- 2 files changed, 469 insertions(+), 96 deletions(-) diff --git a/common/config/subspaces/default/pnpm-lock.yaml b/common/config/subspaces/default/pnpm-lock.yaml index be57987e37c..b0667a01126 100644 --- a/common/config/subspaces/default/pnpm-lock.yaml +++ b/common/config/subspaces/default/pnpm-lock.yaml @@ -1569,6 +1569,27 @@ importers: specifier: ~5.8.2 version: 5.8.2 + ../../../build-tests/heft-json-schema-typings-plugin-test: + devDependencies: + '@rushstack/heft': + specifier: workspace:* + version: link:../../apps/heft + '@rushstack/heft-json-schema-typings-plugin': + specifier: workspace:* + version: link:../../heft-plugins/heft-json-schema-typings-plugin + '@rushstack/node-core-library': + specifier: workspace:* + version: link:../../libraries/node-core-library + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal + eslint: + specifier: ~9.25.1 + version: 9.25.1(supports-color@8.1.1) + local-node-rig: + specifier: workspace:* + version: link:../../rigs/local-node-rig + ../../../build-tests/heft-minimal-rig-test: dependencies: '@microsoft/api-extractor': @@ -2865,6 +2886,28 @@ importers: specifier: 2.0.0 version: 2.0.0 + ../../../heft-plugins/heft-json-schema-typings-plugin: + dependencies: + '@rushstack/node-core-library': + specifier: workspace:* + version: link:../../libraries/node-core-library + '@rushstack/typings-generator': + specifier: workspace:* + version: link:../../libraries/typings-generator + json-schema-to-typescript: + specifier: ~15.0.4 + version: 15.0.4 + devDependencies: + '@rushstack/heft': + specifier: workspace:* + version: link:../../apps/heft + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal + decoupled-local-node-rig: + specifier: workspace:* + version: link:../../rigs/decoupled-local-node-rig + ../../../heft-plugins/heft-lint-plugin: dependencies: '@rushstack/node-core-library': @@ -5057,6 +5100,15 @@ packages: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 + /@apidevtools/json-schema-ref-parser@11.9.3: + resolution: {integrity: sha512-60vepv88RwcJtSHrD6MjIL6Ta3SOYbgfnkHb+ppAVK+o9mXprRtulx7VlRl3lN3bbvysAfCS7WMVfhUYemB0IQ==} + engines: {node: '>= 16'} + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + js-yaml: 4.1.0 + dev: false + /@aws-cdk/asset-awscli-v1@2.2.230: resolution: {integrity: sha512-kUnhKIYu42hqBa6a8x2/7o29ObpJgjYGQy28lZDq9awXyvpR62I2bRxrNKNR3uFUQz3ySuT9JXhGHhuZPdbnFw==} dev: true @@ -9929,6 +9981,10 @@ packages: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.4.15 + /@jsdevtools/ono@7.1.3: + resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} + dev: false + /@jsep-plugin/assignment@1.3.0(jsep@1.4.0): resolution: {integrity: sha512-VVgV+CXrhbMI3aSusQyclHkenWSAm95WaiKrMxRFam3JSUiIaQjoMIw2sEs/OX4XifnqeQUN4DYbJjlA8EfktQ==} engines: {node: '>= 10.16.0'} @@ -13723,6 +13779,10 @@ packages: /@types/lodash@4.14.116: resolution: {integrity: sha512-lRnAtKnxMXcYYXqOiotTmJd74uawNWuPnsnPrrO7HiFuE3npE2iQhfABatbYDyxTNqZNuXzcKGhw37R7RjBFLg==} + /@types/lodash@4.17.20: + resolution: {integrity: sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==} + dev: false + /@types/long@4.0.0: resolution: {integrity: sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==} dev: false @@ -15140,8 +15200,8 @@ packages: array.prototype.flatmap: 1.3.3 es5-shim: 4.6.7 es6-shim: 0.35.8 - function.prototype.name: 1.1.8 - globalthis: 1.0.4 + function.prototype.name: 1.1.6 + globalthis: 1.0.3 object.entries: 1.1.9 object.fromentries: 2.0.8 object.getownpropertydescriptors: 2.1.7 @@ -15419,6 +15479,13 @@ packages: resolution: {integrity: sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==} engines: {node: '>=0.10.0'} + /array-buffer-byte-length@1.0.1: + resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + is-array-buffer: 3.0.4 + /array-buffer-byte-length@1.0.2: resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} engines: {node: '>= 0.4'} @@ -15521,23 +15588,23 @@ packages: resolution: {integrity: sha512-XpcFfLoBEAhezrrNw1V+yLXkE7M6uR7xJEsxbG6c/V9v043qurwVJB9r9UTnoSioFDoz1i1VOydpWGmJpfVZbg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.8 + call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.9 es-array-method-boxes-properly: 1.0.0 - es-object-atoms: 1.1.1 - is-string: 1.1.1 + es-object-atoms: 1.0.0 + is-string: 1.0.7 dev: true /array.prototype.reduce@1.0.6: resolution: {integrity: sha512-UW+Mz8LG/sPSU8jRDCjVr6J/ZKAGpHfwrZ6kWTG5qCxIEiXdVshqGnu5vEZA8S1y6X4aCSbQZ0/EEsfvEvBiSg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.8 + call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.23.9 + es-abstract: 1.23.2 es-array-method-boxes-properly: 1.0.0 - is-string: 1.1.1 + is-string: 1.0.7 /array.prototype.tosorted@1.1.4: resolution: {integrity: sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==} @@ -15549,6 +15616,19 @@ packages: es-errors: 1.3.0 es-shim-unscopables: 1.0.2 + /arraybuffer.prototype.slice@1.0.3: + resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.1 + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + is-array-buffer: 3.0.4 + is-shared-array-buffer: 1.0.3 + /arraybuffer.prototype.slice@1.0.4: resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} engines: {node: '>= 0.4'} @@ -16491,10 +16571,10 @@ packages: resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} engines: {node: '>= 0.4'} dependencies: - es-define-property: 1.0.1 + es-define-property: 1.0.0 es-errors: 1.3.0 function-bind: 1.1.2 - get-intrinsic: 1.3.0 + get-intrinsic: 1.2.4 set-function-length: 1.2.2 /call-bind@1.0.8: @@ -17592,6 +17672,14 @@ packages: whatwg-mimetype: 3.0.0 whatwg-url: 11.0.0 + /data-view-buffer@1.0.1: + resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + /data-view-buffer@1.0.2: resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==} engines: {node: '>= 0.4'} @@ -17600,6 +17688,14 @@ packages: es-errors: 1.3.0 is-data-view: 1.0.2 + /data-view-byte-length@1.0.1: + resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + /data-view-byte-length@1.0.2: resolution: {integrity: sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==} engines: {node: '>= 0.4'} @@ -17608,6 +17704,14 @@ packages: es-errors: 1.3.0 is-data-view: 1.0.2 + /data-view-byte-offset@1.0.0: + resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + /data-view-byte-offset@1.0.1: resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==} engines: {node: '>= 0.4'} @@ -18323,52 +18427,52 @@ packages: resolution: {integrity: sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==} engines: {node: '>= 0.4'} dependencies: - array-buffer-byte-length: 1.0.2 - arraybuffer.prototype.slice: 1.0.4 + array-buffer-byte-length: 1.0.1 + arraybuffer.prototype.slice: 1.0.3 available-typed-arrays: 1.0.7 - call-bind: 1.0.8 - data-view-buffer: 1.0.2 - data-view-byte-length: 1.0.2 - data-view-byte-offset: 1.0.1 - es-define-property: 1.0.1 + call-bind: 1.0.7 + data-view-buffer: 1.0.1 + data-view-byte-length: 1.0.1 + data-view-byte-offset: 1.0.0 + es-define-property: 1.0.0 es-errors: 1.3.0 - es-object-atoms: 1.1.1 - es-set-tostringtag: 2.1.0 - es-to-primitive: 1.3.0 - function.prototype.name: 1.1.8 - get-intrinsic: 1.3.0 - get-symbol-description: 1.1.0 - globalthis: 1.0.4 - gopd: 1.2.0 + es-object-atoms: 1.0.0 + es-set-tostringtag: 2.0.3 + es-to-primitive: 1.2.1 + function.prototype.name: 1.1.6 + get-intrinsic: 1.2.4 + get-symbol-description: 1.0.2 + globalthis: 1.0.3 + gopd: 1.0.1 has-property-descriptors: 1.0.2 - has-proto: 1.2.0 - has-symbols: 1.1.0 + has-proto: 1.0.3 + has-symbols: 1.0.3 hasown: 2.0.2 - internal-slot: 1.1.0 - is-array-buffer: 3.0.5 + internal-slot: 1.0.7 + is-array-buffer: 3.0.4 is-callable: 1.2.7 - is-data-view: 1.0.2 + is-data-view: 1.0.1 is-negative-zero: 2.0.3 - is-regex: 1.2.1 - is-shared-array-buffer: 1.0.4 - is-string: 1.1.1 - is-typed-array: 1.1.15 - is-weakref: 1.1.1 - object-inspect: 1.13.4 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.3 + is-string: 1.0.7 + is-typed-array: 1.1.13 + is-weakref: 1.0.2 + object-inspect: 1.13.1 object-keys: 1.1.1 - object.assign: 4.1.7 - regexp.prototype.flags: 1.5.4 - safe-array-concat: 1.1.3 - safe-regex-test: 1.1.0 - string.prototype.trim: 1.2.10 - string.prototype.trimend: 1.0.9 - string.prototype.trimstart: 1.0.8 - typed-array-buffer: 1.0.3 - typed-array-byte-length: 1.0.3 - typed-array-byte-offset: 1.0.4 - typed-array-length: 1.0.7 - unbox-primitive: 1.1.0 - which-typed-array: 1.1.19 + object.assign: 4.1.5 + regexp.prototype.flags: 1.5.2 + safe-array-concat: 1.1.2 + safe-regex-test: 1.0.3 + string.prototype.trim: 1.2.9 + string.prototype.trimend: 1.0.8 + string.prototype.trimstart: 1.0.7 + typed-array-buffer: 1.0.2 + typed-array-byte-length: 1.0.1 + typed-array-byte-offset: 1.0.2 + typed-array-length: 1.0.5 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.15 /es-abstract@1.23.9: resolution: {integrity: sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==} @@ -18384,7 +18488,7 @@ packages: data-view-byte-offset: 1.0.1 es-define-property: 1.0.1 es-errors: 1.3.0 - es-object-atoms: 1.1.1 + es-object-atoms: 1.0.0 es-set-tostringtag: 2.1.0 es-to-primitive: 1.3.0 function.prototype.name: 1.1.8 @@ -18429,6 +18533,12 @@ packages: /es-array-method-boxes-properly@1.0.0: resolution: {integrity: sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==} + /es-define-property@1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.3.0 + /es-define-property@1.0.1: resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} @@ -18440,13 +18550,13 @@ packages: /es-get-iterator@1.1.3: resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} dependencies: - call-bind: 1.0.8 + call-bind: 1.0.7 get-intrinsic: 1.3.0 - has-symbols: 1.1.0 + has-symbols: 1.0.3 is-arguments: 1.1.1 is-map: 2.0.3 is-set: 2.0.3 - is-string: 1.1.1 + is-string: 1.0.7 isarray: 2.0.5 stop-iteration-iterator: 1.0.0 dev: true @@ -18516,13 +18626,21 @@ packages: hasown: 2.0.2 dev: false + /es-to-primitive@1.2.1: + resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + /es-to-primitive@1.3.0: resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} engines: {node: '>= 0.4'} dependencies: is-callable: 1.2.7 - is-date-object: 1.1.0 - is-symbol: 1.1.1 + is-date-object: 1.0.5 + is-symbol: 1.0.4 /es5-shim@4.6.7: resolution: {integrity: sha512-jg21/dmlrNQI7JyyA2w7n+yifSxBng0ZralnSfVZjoCawgNTCnS+yBCyVM9DL5itm7SUnDGgv7hcq2XCZX4iRQ==} @@ -19981,6 +20099,17 @@ packages: pend: 1.2.0 dev: true + /fdir@6.4.6(picomatch@4.0.2): + resolution: {integrity: sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + dependencies: + picomatch: 4.0.2 + dev: false + /figgy-pudding@3.5.2: resolution: {integrity: sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==} deprecated: This module is no longer supported. @@ -20216,6 +20345,11 @@ packages: debug: optional: true + /for-each@0.3.3: + resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + dependencies: + is-callable: 1.2.7 + /for-each@0.3.5: resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} engines: {node: '>= 0.4'} @@ -20445,6 +20579,15 @@ packages: /function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + /function.prototype.name@1.1.6: + resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.9 + functions-have-names: 1.2.3 + /function.prototype.name@1.1.8: resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==} engines: {node: '>= 0.4'} @@ -20521,8 +20664,8 @@ packages: dependencies: es-errors: 1.3.0 function-bind: 1.1.2 - has-proto: 1.2.0 - has-symbols: 1.1.0 + has-proto: 1.0.3 + has-symbols: 1.0.3 hasown: 2.0.2 /get-intrinsic@1.3.0: @@ -20573,6 +20716,14 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + /get-symbol-description@1.0.2: + resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + /get-symbol-description@1.1.0: resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} engines: {node: '>= 0.4'} @@ -20655,7 +20806,6 @@ packages: /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -20746,6 +20896,12 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} + /globalthis@1.0.3: + resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} + engines: {node: '>= 0.4'} + dependencies: + define-properties: 1.2.1 + /globalthis@1.0.4: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} @@ -20778,6 +20934,11 @@ packages: slash: 2.0.0 dev: true + /gopd@1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.3.0 + /gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} @@ -20868,7 +21029,11 @@ packages: /has-property-descriptors@1.0.2: resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} dependencies: - es-define-property: 1.0.1 + es-define-property: 1.0.0 + + /has-proto@1.0.3: + resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + engines: {node: '>= 0.4'} /has-proto@1.2.0: resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==} @@ -20879,7 +21044,6 @@ packages: /has-symbols@1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} - dev: true /has-symbols@1.1.0: resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} @@ -20889,7 +21053,7 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} dependencies: - has-symbols: 1.1.0 + has-symbols: 1.0.3 /has-unicode@2.0.1: resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} @@ -21447,7 +21611,6 @@ packages: /inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. dependencies: once: 1.4.0 wrappy: 1.0.2 @@ -21492,6 +21655,14 @@ packages: through: 2.3.8 dev: false + /internal-slot@1.0.7: + resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + hasown: 2.0.2 + side-channel: 1.0.6 + /internal-slot@1.1.0: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} @@ -21563,10 +21734,17 @@ packages: resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.8 + call-bind: 1.0.7 has-tostringtag: 1.0.2 dev: true + /is-array-buffer@3.0.4: + resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.3.0 + /is-array-buffer@3.0.5: resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} engines: {node: '>= 0.4'} @@ -21584,6 +21762,11 @@ packages: dependencies: has-tostringtag: 1.0.2 + /is-bigint@1.0.4: + resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + dependencies: + has-bigints: 1.0.2 + /is-bigint@1.1.0: resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} engines: {node: '>= 0.4'} @@ -21604,6 +21787,13 @@ packages: dependencies: binary-extensions: 2.3.0 + /is-boolean-object@1.1.2: + resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + has-tostringtag: 1.0.2 + /is-boolean-object@1.2.2: resolution: {integrity: sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==} engines: {node: '>= 0.4'} @@ -21646,6 +21836,12 @@ packages: dependencies: hasown: 2.0.2 + /is-data-view@1.0.1: + resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} + engines: {node: '>= 0.4'} + dependencies: + is-typed-array: 1.1.13 + /is-data-view@1.0.2: resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} engines: {node: '>= 0.4'} @@ -21654,6 +21850,12 @@ packages: get-intrinsic: 1.3.0 is-typed-array: 1.1.15 + /is-date-object@1.0.5: + resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.2 + /is-date-object@1.1.0: resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} engines: {node: '>= 0.4'} @@ -21715,6 +21917,11 @@ packages: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} + /is-finalizationregistry@1.0.2: + resolution: {integrity: sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==} + dependencies: + call-bind: 1.0.8 + /is-finalizationregistry@1.1.1: resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==} engines: {node: '>= 0.4'} @@ -21808,6 +22015,12 @@ packages: resolution: {integrity: sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==} engines: {node: '>=10'} + /is-number-object@1.0.7: + resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.2 + /is-number-object@1.1.1: resolution: {integrity: sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==} engines: {node: '>= 0.4'} @@ -21875,7 +22088,6 @@ packages: dependencies: call-bind: 1.0.7 has-tostringtag: 1.0.2 - dev: true /is-regex@1.2.1: resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} @@ -21890,6 +22102,12 @@ packages: resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} engines: {node: '>= 0.4'} + /is-shared-array-buffer@1.0.3: + resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + /is-shared-array-buffer@1.0.4: resolution: {integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==} engines: {node: '>= 0.4'} @@ -21930,7 +22148,6 @@ packages: engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 - dev: true /is-symbol@1.1.1: resolution: {integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==} @@ -21944,8 +22161,7 @@ packages: resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} engines: {node: '>= 0.4'} dependencies: - which-typed-array: 1.1.19 - dev: true + which-typed-array: 1.1.15 /is-typed-array@1.1.15: resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} @@ -21964,6 +22180,11 @@ packages: resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} engines: {node: '>= 0.4'} + /is-weakref@1.0.2: + resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + dependencies: + call-bind: 1.0.7 + /is-weakref@1.1.1: resolution: {integrity: sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==} engines: {node: '>= 0.4'} @@ -22107,7 +22328,7 @@ packages: engines: {node: '>= 0.4'} dependencies: define-data-property: 1.1.4 - es-object-atoms: 1.1.1 + es-object-atoms: 1.0.0 get-intrinsic: 1.3.0 get-proto: 1.0.1 has-symbols: 1.1.0 @@ -22960,6 +23181,22 @@ packages: /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + /json-schema-to-typescript@15.0.4: + resolution: {integrity: sha512-Su9oK8DR4xCmDsLlyvadkXzX6+GGXJpbhwoLtOGArAG61dvbW4YQmSEno2y66ahpIdmLMg6YUf/QHLgiwvkrHQ==} + engines: {node: '>=16.0.0'} + hasBin: true + dependencies: + '@apidevtools/json-schema-ref-parser': 11.9.3 + '@types/json-schema': 7.0.15 + '@types/lodash': 4.17.20 + is-glob: 4.0.3 + js-yaml: 4.1.0 + lodash: 4.17.21 + minimist: 1.2.8 + prettier: 3.6.2 + tinyglobby: 0.2.14 + dev: false + /json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -24413,9 +24650,9 @@ packages: resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.8 + call-bind: 1.0.7 define-properties: 1.2.1 - has-symbols: 1.1.0 + has-symbols: 1.0.3 object-keys: 1.1.1 /object.assign@4.1.7: @@ -24425,7 +24662,7 @@ packages: call-bind: 1.0.8 call-bound: 1.0.4 define-properties: 1.2.1 - es-object-atoms: 1.1.1 + es-object-atoms: 1.0.0 has-symbols: 1.1.0 object-keys: 1.1.1 @@ -24938,6 +25175,11 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + /picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + dev: false + /pidof@1.0.2: resolution: {integrity: sha512-LLJhTVEUCZnotdAM5rd7KiTdLGgk6i763/hsd5pO+8yuF7mdgg0ob8w/98KrTAcPsj6YzGrkFLPVtBOr1uW2ag==} dev: false @@ -25536,6 +25778,12 @@ packages: hasBin: true dev: true + /prettier@3.6.2: + resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==} + engines: {node: '>=14'} + hasBin: true + dev: false + /pretty-error@2.1.2: resolution: {integrity: sha512-EY5oDzmsX5wvuynAByrmY0P0hcp+QpnAKbJng2A2MPjVKXCxrDSUkzghVJ4ZGPIv+JC4gX8fPUWscC0RtjsWGw==} dependencies: @@ -25617,7 +25865,7 @@ packages: engines: {node: '>= 0.4'} dependencies: array.prototype.map: 1.0.7 - call-bind: 1.0.8 + call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.9 get-intrinsic: 1.3.0 @@ -25628,7 +25876,7 @@ packages: resolution: {integrity: sha512-aVDtsXOml9iuMJzUco9J1je/UrIT3oMYfWkCTiUhkt+AvZw72q4dUZnR/R/eB3h5GeAagQVXvM1ApoYniJiwoA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.8 + call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.9 es-errors: 1.3.0 @@ -26318,11 +26566,23 @@ packages: define-properties: 1.2.1 es-abstract: 1.23.9 es-errors: 1.3.0 - es-object-atoms: 1.1.1 + es-object-atoms: 1.0.0 get-intrinsic: 1.3.0 get-proto: 1.0.1 which-builtin-type: 1.2.1 + /reflect.getprototypeof@1.0.6: + resolution: {integrity: sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + globalthis: 1.0.4 + which-builtin-type: 1.1.3 + /refractor@3.6.0: resolution: {integrity: sha512-MY9W41IOWxxk31o+YvFCNyNzdkc9M20NoZK5vq6jkv4I/uh2zkWcfudj0Q1fovjUQJrNewS9NMzeTtqPf+n5EA==} dependencies: @@ -26362,6 +26622,15 @@ packages: extend-shallow: 3.0.2 safe-regex: 1.1.0 + /regexp.prototype.flags@1.5.2: + resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-errors: 1.3.0 + set-function-name: 2.0.2 + /regexp.prototype.flags@1.5.4: resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} engines: {node: '>= 0.4'} @@ -26714,9 +26983,9 @@ packages: resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} engines: {node: '>=0.4'} dependencies: - call-bind: 1.0.8 + call-bind: 1.0.7 get-intrinsic: 1.3.0 - has-symbols: 1.1.0 + has-symbols: 1.0.3 isarray: 2.0.5 /safe-array-concat@1.1.3: @@ -26746,6 +27015,14 @@ packages: es-errors: 1.3.0 isarray: 2.0.5 + /safe-regex-test@1.0.3: + resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-regex: 1.1.4 + /safe-regex-test@1.1.0: resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} engines: {node: '>= 0.4'} @@ -27348,7 +27625,7 @@ packages: dependencies: dunder-proto: 1.0.1 es-errors: 1.3.0 - es-object-atoms: 1.1.1 + es-object-atoms: 1.0.0 /set-value@2.0.1: resolution: {integrity: sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==} @@ -27794,7 +28071,7 @@ packages: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} engines: {node: '>= 0.4'} dependencies: - internal-slot: 1.1.0 + internal-slot: 1.0.7 dev: true /stoppable@1.1.0: @@ -27923,7 +28200,7 @@ packages: resolution: {integrity: sha512-DOB27b/2UTTD+4myKUFh+/fXWcu/UDyASIXfg+7VzoCNNGOfWvoyU/x5pvVHr++ztyt/oSYI1BcWBBG/hmlNjA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.8 + call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.9 dev: true @@ -27932,10 +28209,10 @@ packages: resolution: {integrity: sha512-1y15lz7otgfRTAVK5qbp3eHIga+w8j7+jIH+7HpUrOfnLVl6n0hbspi4EXf4tR+PNOpBjPstltemkx0SvViOCg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.8 + call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.9 - es-object-atoms: 1.1.1 + es-object-atoms: 1.0.0 dev: true /string.prototype.repeat@1.0.0: @@ -27953,16 +28230,24 @@ packages: define-data-property: 1.1.4 define-properties: 1.2.1 es-abstract: 1.23.9 - es-object-atoms: 1.1.1 + es-object-atoms: 1.0.0 has-property-descriptors: 1.0.2 + /string.prototype.trim@1.2.9: + resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-object-atoms: 1.0.0 + /string.prototype.trimend@1.0.8: resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-object-atoms: 1.0.0 - dev: false /string.prototype.trimend@1.0.9: resolution: {integrity: sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==} @@ -27971,7 +28256,14 @@ packages: call-bind: 1.0.8 call-bound: 1.0.4 define-properties: 1.2.1 - es-object-atoms: 1.1.1 + es-object-atoms: 1.0.0 + + /string.prototype.trimstart@1.0.7: + resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.9 /string.prototype.trimstart@1.0.8: resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} @@ -27979,7 +28271,7 @@ packages: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 - es-object-atoms: 1.1.1 + es-object-atoms: 1.0.0 /string_decoder@1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} @@ -28154,10 +28446,10 @@ packages: resolution: {integrity: sha512-VgVgtEabORsQtmuindtO7v8fF+bsKxUkvEMFj+ecBK6bomrwv5JUSWdMoC3ypa9+Jaqp/wOzkWk4f6I+p5GzyA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.8 + call-bind: 1.0.7 es-errors: 1.3.0 - get-symbol-description: 1.1.0 - has-symbols: 1.1.0 + get-symbol-description: 1.0.2 + has-symbols: 1.0.3 object.getownpropertydescriptors: 2.1.7 dev: true @@ -28465,6 +28757,14 @@ packages: engines: {node: '>=6'} dev: false + /tinyglobby@0.2.14: + resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==} + engines: {node: '>=12.0.0'} + dependencies: + fdir: 6.4.6(picomatch@4.0.2) + picomatch: 4.0.2 + dev: false + /tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} @@ -28853,6 +29153,14 @@ packages: mime-types: 3.0.1 dev: false + /typed-array-buffer@1.0.2: + resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-typed-array: 1.1.13 + /typed-array-buffer@1.0.3: resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} engines: {node: '>= 0.4'} @@ -28861,38 +29169,70 @@ packages: es-errors: 1.3.0 is-typed-array: 1.1.15 + /typed-array-byte-length@1.0.1: + resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.2.0 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + /typed-array-byte-length@1.0.3: resolution: {integrity: sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.8 - for-each: 0.3.5 + for-each: 0.3.3 gopd: 1.2.0 has-proto: 1.2.0 is-typed-array: 1.1.15 + /typed-array-byte-offset@1.0.2: + resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.2.0 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + /typed-array-byte-offset@1.0.4: resolution: {integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==} engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.7 call-bind: 1.0.8 - for-each: 0.3.5 + for-each: 0.3.3 gopd: 1.2.0 has-proto: 1.2.0 is-typed-array: 1.1.15 reflect.getprototypeof: 1.0.10 + /typed-array-length@1.0.5: + resolution: {integrity: sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.2.0 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + possible-typed-array-names: 1.0.0 + /typed-array-length@1.0.7: resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.8 - for-each: 0.3.5 + for-each: 0.3.3 gopd: 1.2.0 is-typed-array: 1.1.15 possible-typed-array-names: 1.0.0 - reflect.getprototypeof: 1.0.10 + reflect.getprototypeof: 1.0.6 /typed-rest-client@1.8.11: resolution: {integrity: sha512-5UvfMpd1oelmUPRbbaVnq+rHP7ng2cE4qoQkQeAqxRL6PklkxsM0g32/HL0yfvruK6ojQ5x8EE+HF4YV6DtuCA==} @@ -28945,6 +29285,14 @@ packages: dev: true optional: true + /unbox-primitive@1.0.2: + resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + dependencies: + call-bind: 1.0.7 + has-bigints: 1.0.2 + has-symbols: 1.0.3 + which-boxed-primitive: 1.0.2 + /unbox-primitive@1.1.0: resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} engines: {node: '>= 0.4'} @@ -29862,6 +30210,15 @@ packages: webidl-conversions: 3.0.1 dev: true + /which-boxed-primitive@1.0.2: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.7 + is-string: 1.0.7 + is-symbol: 1.0.4 + /which-boxed-primitive@1.1.1: resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} engines: {node: '>= 0.4'} @@ -29872,6 +30229,23 @@ packages: is-string: 1.1.1 is-symbol: 1.1.1 + /which-builtin-type@1.1.3: + resolution: {integrity: sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==} + engines: {node: '>= 0.4'} + dependencies: + function.prototype.name: 1.1.8 + has-tostringtag: 1.0.2 + is-async-function: 2.0.0 + is-date-object: 1.0.5 + is-finalizationregistry: 1.0.2 + is-generator-function: 1.0.10 + is-regex: 1.2.1 + is-weakref: 1.1.1 + isarray: 2.0.5 + which-boxed-primitive: 1.0.2 + which-collection: 1.0.2 + which-typed-array: 1.1.19 + /which-builtin-type@1.2.1: resolution: {integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==} engines: {node: '>= 0.4'} @@ -29916,11 +30290,10 @@ packages: engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.7 - call-bind: 1.0.8 - for-each: 0.3.5 + call-bind: 1.0.7 + for-each: 0.3.3 gopd: 1.2.0 has-tostringtag: 1.0.2 - dev: true /which-typed-array@1.1.19: resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==} diff --git a/common/config/subspaces/default/repo-state.json b/common/config/subspaces/default/repo-state.json index fa9e7b64668..d3eff4b0498 100644 --- a/common/config/subspaces/default/repo-state.json +++ b/common/config/subspaces/default/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "328eb19a95817a4785b548aecbe426b9c5ac3432", + "pnpmShrinkwrapHash": "f7608960f8f1a8c1232f2d12dabeaa3369bc428b", "preferredVersionsHash": "550b4cee0bef4e97db6c6aad726df5149d20e7d9" } From 0a5fc4d42181695565744338008ee3a8cf4ad8cd Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 17:45:45 -0700 Subject: [PATCH 11/25] fixup! Initial implementation of the json-schema-typings-plugin. --- heft-plugins/heft-json-schema-typings-plugin/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/heft-plugins/heft-json-schema-typings-plugin/package.json b/heft-plugins/heft-json-schema-typings-plugin/package.json index f1008fbe8d8..49f464ecf9e 100644 --- a/heft-plugins/heft-json-schema-typings-plugin/package.json +++ b/heft-plugins/heft-json-schema-typings-plugin/package.json @@ -25,6 +25,7 @@ "devDependencies": { "@rushstack/heft": "workspace:*", "@rushstack/terminal": "workspace:*", - "decoupled-local-node-rig": "workspace:*" + "decoupled-local-node-rig": "workspace:*", + "eslint": "~9.25.1" } } From 521cc0814e0414a3264ba273009efa93b60e893f Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 17:46:17 -0700 Subject: [PATCH 12/25] fixup! Rush update. --- common/config/subspaces/default/pnpm-lock.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/config/subspaces/default/pnpm-lock.yaml b/common/config/subspaces/default/pnpm-lock.yaml index b0667a01126..a188800d773 100644 --- a/common/config/subspaces/default/pnpm-lock.yaml +++ b/common/config/subspaces/default/pnpm-lock.yaml @@ -2907,6 +2907,9 @@ importers: decoupled-local-node-rig: specifier: workspace:* version: link:../../rigs/decoupled-local-node-rig + eslint: + specifier: ~9.25.1 + version: 9.25.1(supports-color@8.1.1) ../../../heft-plugins/heft-lint-plugin: dependencies: From ff2a5993f0fc3b7d40effea2a63b997a290572b6 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 17:51:26 -0700 Subject: [PATCH 13/25] fixup! Initial implementation of the json-schema-typings-plugin. --- heft-plugins/heft-json-schema-typings-plugin/config/rig.json | 2 +- heft-plugins/heft-json-schema-typings-plugin/eslint.config.js | 4 ++-- heft-plugins/heft-json-schema-typings-plugin/package.json | 4 ++-- heft-plugins/heft-json-schema-typings-plugin/tsconfig.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/heft-plugins/heft-json-schema-typings-plugin/config/rig.json b/heft-plugins/heft-json-schema-typings-plugin/config/rig.json index cc98dea43dd..165ffb001f5 100644 --- a/heft-plugins/heft-json-schema-typings-plugin/config/rig.json +++ b/heft-plugins/heft-json-schema-typings-plugin/config/rig.json @@ -3,5 +3,5 @@ // Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - "rigPackageName": "decoupled-local-node-rig" + "rigPackageName": "local-node-rig" } diff --git a/heft-plugins/heft-json-schema-typings-plugin/eslint.config.js b/heft-plugins/heft-json-schema-typings-plugin/eslint.config.js index e54effd122a..c15e6077310 100644 --- a/heft-plugins/heft-json-schema-typings-plugin/eslint.config.js +++ b/heft-plugins/heft-json-schema-typings-plugin/eslint.config.js @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -const nodeTrustedToolProfile = require('decoupled-local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool'); -const friendlyLocalsMixin = require('decoupled-local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals'); +const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool'); +const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals'); module.exports = [ ...nodeTrustedToolProfile, diff --git a/heft-plugins/heft-json-schema-typings-plugin/package.json b/heft-plugins/heft-json-schema-typings-plugin/package.json index 49f464ecf9e..fd5a016b033 100644 --- a/heft-plugins/heft-json-schema-typings-plugin/package.json +++ b/heft-plugins/heft-json-schema-typings-plugin/package.json @@ -25,7 +25,7 @@ "devDependencies": { "@rushstack/heft": "workspace:*", "@rushstack/terminal": "workspace:*", - "decoupled-local-node-rig": "workspace:*", - "eslint": "~9.25.1" + "eslint": "~9.25.1", + "local-node-rig": "workspace:*" } } diff --git a/heft-plugins/heft-json-schema-typings-plugin/tsconfig.json b/heft-plugins/heft-json-schema-typings-plugin/tsconfig.json index 1a33d17b873..dac21d04081 100644 --- a/heft-plugins/heft-json-schema-typings-plugin/tsconfig.json +++ b/heft-plugins/heft-json-schema-typings-plugin/tsconfig.json @@ -1,3 +1,3 @@ { - "extends": "./node_modules/decoupled-local-node-rig/profiles/default/tsconfig-base.json" + "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json" } From c498ca7a0e3e09003ad0a4ffaa9a315aeafeac7d Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 17:51:51 -0700 Subject: [PATCH 14/25] fixup! Rush update. --- common/config/subspaces/default/pnpm-lock.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/config/subspaces/default/pnpm-lock.yaml b/common/config/subspaces/default/pnpm-lock.yaml index a188800d773..f176e6ee982 100644 --- a/common/config/subspaces/default/pnpm-lock.yaml +++ b/common/config/subspaces/default/pnpm-lock.yaml @@ -2904,12 +2904,12 @@ importers: '@rushstack/terminal': specifier: workspace:* version: link:../../libraries/terminal - decoupled-local-node-rig: - specifier: workspace:* - version: link:../../rigs/decoupled-local-node-rig eslint: specifier: ~9.25.1 version: 9.25.1(supports-color@8.1.1) + local-node-rig: + specifier: workspace:* + version: link:../../rigs/local-node-rig ../../../heft-plugins/heft-lint-plugin: dependencies: From 5d14f5c93c3653f5790ce5d1f832d015a1f1be56 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 18:25:53 -0700 Subject: [PATCH 15/25] fixup! Initial implementation of the json-schema-typings-plugin. --- .../heft-json-schema-typings-plugin-test/package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build-tests/heft-json-schema-typings-plugin-test/package.json b/build-tests/heft-json-schema-typings-plugin-test/package.json index 5b1d3fd9a96..91bccae2ee3 100644 --- a/build-tests/heft-json-schema-typings-plugin-test/package.json +++ b/build-tests/heft-json-schema-typings-plugin-test/package.json @@ -12,9 +12,8 @@ "devDependencies": { "@rushstack/heft-json-schema-typings-plugin": "workspace:*", "@rushstack/heft": "workspace:*", - "eslint": "~9.25.1", - "local-node-rig": "workspace:*", "@rushstack/node-core-library": "workspace:*", - "@rushstack/terminal": "workspace:*" + "eslint": "~9.25.1", + "local-node-rig": "workspace:*" } } From 967f96bc7bc97874ccf0c0af250ceb45663848bb Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 18:26:50 -0700 Subject: [PATCH 16/25] fixup! Rush update. --- common/config/subspaces/default/pnpm-lock.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/config/subspaces/default/pnpm-lock.yaml b/common/config/subspaces/default/pnpm-lock.yaml index f176e6ee982..7bcb706acaa 100644 --- a/common/config/subspaces/default/pnpm-lock.yaml +++ b/common/config/subspaces/default/pnpm-lock.yaml @@ -1580,9 +1580,6 @@ importers: '@rushstack/node-core-library': specifier: workspace:* version: link:../../libraries/node-core-library - '@rushstack/terminal': - specifier: workspace:* - version: link:../../libraries/terminal eslint: specifier: ~9.25.1 version: 9.25.1(supports-color@8.1.1) From bc28620c3351e9e60815d483904cb22b97687ca4 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 18:31:07 -0700 Subject: [PATCH 17/25] fixup! Initial implementation of the json-schema-typings-plugin. --- .../src/JsonSchemaTypingsGenerator.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts b/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts index 793a1cabeeb..e7169c55d59 100644 --- a/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts +++ b/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts @@ -25,18 +25,8 @@ export class JsonSchemaTypingsGenerator extends TypingsGenerator { // eslint-disable-next-line @typescript-eslint/naming-convention parseAndGenerateTypings: async (fileContents: string, filePath: string): Promise => await compileFromFile(filePath, { - // $refOptions: { - // resolve: { - // file: { - // canRead: true, - // // eslint-disable-next-line @typescript-eslint/naming-convention - // read: async (fileInfo) => { - // debugger; - // return await FileSystem.readFileAsync(fileInfo.url); - // } - // } - // } - // }, + // The typings generator adds its own banner comment + bannerComment: '/* eslint-disable */', cwd: path.dirname(filePath) }) }); From 19aba59a6d71288a17d450afd655d633a82fd01d Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 18:31:22 -0700 Subject: [PATCH 18/25] fixup! Initial implementation of the json-schema-typings-plugin. --- .../JsonSchemaTypingsGenerator.test.ts.snap | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap b/build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap index f28612d97ef..510fc110807 100644 --- a/build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap +++ b/build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap @@ -5,11 +5,6 @@ Object { "./test-invalid-additional.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior /* eslint-disable */ -/** - * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run json-schema-to-typescript to regenerate this file. - */ export interface TestInvalidAdditional { [k: string]: unknown; @@ -18,11 +13,6 @@ export interface TestInvalidAdditional { "./test-invalid-format.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior /* eslint-disable */ -/** - * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run json-schema-to-typescript to regenerate this file. - */ export interface TestInvalidFormat { [k: string]: unknown; @@ -31,11 +21,6 @@ export interface TestInvalidFormat { "./test-schema-draft-04.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior /* eslint-disable */ -/** - * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run json-schema-to-typescript to regenerate this file. - */ export interface TestSchemaFile { exampleString: string; @@ -76,11 +61,6 @@ export interface Type2 { "./test-schema-draft-07.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior /* eslint-disable */ -/** - * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run json-schema-to-typescript to regenerate this file. - */ export interface TestSchemaFile { exampleString: string; @@ -121,11 +101,6 @@ export interface Type2 { "./test-schema-invalid.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior /* eslint-disable */ -/** - * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run json-schema-to-typescript to regenerate this file. - */ export interface HttpExampleComSchemasTestSchemaNestedChildSchemaJson { [k: string]: unknown; @@ -134,11 +109,6 @@ export interface HttpExampleComSchemasTestSchemaNestedChildSchemaJson { "./test-schema-nested-child.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior /* eslint-disable */ -/** - * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run json-schema-to-typescript to regenerate this file. - */ export interface HttpExampleComSchemasTestSchemaNestedChildSchemaJson { [k: string]: unknown; @@ -147,11 +117,6 @@ export interface HttpExampleComSchemasTestSchemaNestedChildSchemaJson { "./test-schema-nested.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior /* eslint-disable */ -/** - * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run json-schema-to-typescript to regenerate this file. - */ export interface TestSchemaFile { exampleString: string; @@ -189,11 +154,6 @@ export interface Type2 { "./test-schema.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior /* eslint-disable */ -/** - * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run json-schema-to-typescript to regenerate this file. - */ export interface TestSchemaFile { exampleString: string; @@ -234,11 +194,6 @@ export interface Type2 { "./test-valid.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior /* eslint-disable */ -/** - * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run json-schema-to-typescript to regenerate this file. - */ export interface TestValid { [k: string]: unknown; From bf9d43f125fee83ce11340900b9ea19c2a2795b4 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 7 Jul 2025 18:34:14 -0700 Subject: [PATCH 19/25] Update repo readme. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 00c9bcaaa0d..066b4ee740e 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ These GitHub repositories provide supplementary resources for Rush Stack: | [/heft-plugins/heft-dev-cert-plugin](./heft-plugins/heft-dev-cert-plugin/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fheft-dev-cert-plugin.svg)](https://badge.fury.io/js/%40rushstack%2Fheft-dev-cert-plugin) | [changelog](./heft-plugins/heft-dev-cert-plugin/CHANGELOG.md) | [@rushstack/heft-dev-cert-plugin](https://www.npmjs.com/package/@rushstack/heft-dev-cert-plugin) | | [/heft-plugins/heft-isolated-typescript-transpile-plugin](./heft-plugins/heft-isolated-typescript-transpile-plugin/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fheft-isolated-typescript-transpile-plugin.svg)](https://badge.fury.io/js/%40rushstack%2Fheft-isolated-typescript-transpile-plugin) | [changelog](./heft-plugins/heft-isolated-typescript-transpile-plugin/CHANGELOG.md) | [@rushstack/heft-isolated-typescript-transpile-plugin](https://www.npmjs.com/package/@rushstack/heft-isolated-typescript-transpile-plugin) | | [/heft-plugins/heft-jest-plugin](./heft-plugins/heft-jest-plugin/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fheft-jest-plugin.svg)](https://badge.fury.io/js/%40rushstack%2Fheft-jest-plugin) | [changelog](./heft-plugins/heft-jest-plugin/CHANGELOG.md) | [@rushstack/heft-jest-plugin](https://www.npmjs.com/package/@rushstack/heft-jest-plugin) | +| [/heft-plugins/heft-json-schema-typings-plugin](./heft-plugins/heft-json-schema-typings-plugin/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fheft-json-schema-typings-plugin.svg)](https://badge.fury.io/js/%40rushstack%2Fheft-json-schema-typings-plugin) | [changelog](./heft-plugins/heft-json-schema-typings-plugin/CHANGELOG.md) | [@rushstack/heft-json-schema-typings-plugin](https://www.npmjs.com/package/@rushstack/heft-json-schema-typings-plugin) | | [/heft-plugins/heft-lint-plugin](./heft-plugins/heft-lint-plugin/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fheft-lint-plugin.svg)](https://badge.fury.io/js/%40rushstack%2Fheft-lint-plugin) | [changelog](./heft-plugins/heft-lint-plugin/CHANGELOG.md) | [@rushstack/heft-lint-plugin](https://www.npmjs.com/package/@rushstack/heft-lint-plugin) | | [/heft-plugins/heft-localization-typings-plugin](./heft-plugins/heft-localization-typings-plugin/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fheft-localization-typings-plugin.svg)](https://badge.fury.io/js/%40rushstack%2Fheft-localization-typings-plugin) | [changelog](./heft-plugins/heft-localization-typings-plugin/CHANGELOG.md) | [@rushstack/heft-localization-typings-plugin](https://www.npmjs.com/package/@rushstack/heft-localization-typings-plugin) | | [/heft-plugins/heft-sass-load-themed-styles-plugin](./heft-plugins/heft-sass-load-themed-styles-plugin/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fheft-sass-load-themed-styles-plugin.svg)](https://badge.fury.io/js/%40rushstack%2Fheft-sass-load-themed-styles-plugin) | [changelog](./heft-plugins/heft-sass-load-themed-styles-plugin/CHANGELOG.md) | [@rushstack/heft-sass-load-themed-styles-plugin](https://www.npmjs.com/package/@rushstack/heft-sass-load-themed-styles-plugin) | @@ -175,6 +176,7 @@ These GitHub repositories provide supplementary resources for Rush Stack: | [/build-tests/heft-fastify-test](./build-tests/heft-fastify-test/) | This project tests Heft support for the Fastify framework for Node.js services | | [/build-tests/heft-jest-preset-test](./build-tests/heft-jest-preset-test/) | This project illustrates configuring a Jest preset in a minimal Heft project | | [/build-tests/heft-jest-reporters-test](./build-tests/heft-jest-reporters-test/) | This project illustrates configuring Jest reporters in a minimal Heft project | +| [/build-tests/heft-json-schema-typings-plugin-test](./build-tests/heft-json-schema-typings-plugin-test/) | This project illustrates configuring Jest reporters in a minimal Heft project | | [/build-tests/heft-minimal-rig-test](./build-tests/heft-minimal-rig-test/) | This is a minimal rig package that is imported by the 'heft-minimal-rig-usage-test' project | | [/build-tests/heft-minimal-rig-usage-test](./build-tests/heft-minimal-rig-usage-test/) | A test project for Heft that resolves its compiler from the 'heft-minimal-rig-test' package | | [/build-tests/heft-node-everything-esm-module-test](./build-tests/heft-node-everything-esm-module-test/) | Building this project tests every task and config file for Heft when targeting the Node.js runtime when configured to use ESM module support | From f8fcf48b36fd36d4770cce193c8721a0748486c6 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Tue, 8 Jul 2025 15:39:34 -0700 Subject: [PATCH 20/25] fixup! Initial implementation of the json-schema-typings-plugin. --- .../heft-json-schema-typings-plugin-test/eslint.config.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-tests/heft-json-schema-typings-plugin-test/eslint.config.js b/build-tests/heft-json-schema-typings-plugin-test/eslint.config.js index ceb5a1bee40..c15e6077310 100644 --- a/build-tests/heft-json-schema-typings-plugin-test/eslint.config.js +++ b/build-tests/heft-json-schema-typings-plugin-test/eslint.config.js @@ -13,9 +13,6 @@ module.exports = [ parserOptions: { tsconfigRootDir: __dirname } - }, - rules: { - 'no-console': 'off' } } ]; From 0a7e95edc6a4d255bc499f5c26dfb7d557836435 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Tue, 8 Jul 2025 16:11:10 -0700 Subject: [PATCH 21/25] Revert "Ensure path paramters don't contain backslashes." This reverts commit 5de5b40368abe0ba4179e4683a1083bdb2558c83. --- ...-json-schema-typings-plugin_2025-07-07-22-10.json | 10 ---------- .../src/schemas/options.schema.json | 12 ++++-------- 2 files changed, 4 insertions(+), 18 deletions(-) delete mode 100644 common/changes/@rushstack/heft-localization-typings-plugin/user-ianc-json-schema-typings-plugin_2025-07-07-22-10.json diff --git a/common/changes/@rushstack/heft-localization-typings-plugin/user-ianc-json-schema-typings-plugin_2025-07-07-22-10.json b/common/changes/@rushstack/heft-localization-typings-plugin/user-ianc-json-schema-typings-plugin_2025-07-07-22-10.json deleted file mode 100644 index b61b5ecca87..00000000000 --- a/common/changes/@rushstack/heft-localization-typings-plugin/user-ianc-json-schema-typings-plugin_2025-07-07-22-10.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@rushstack/heft-localization-typings-plugin", - "comment": "Ensure the `srcFolder`, `trimmedJsonOutputFolders`, `generatedTsFolder`, and `secondaryGeneratedTsFolders` options don't contain backslashes.", - "type": "minor" - } - ], - "packageName": "@rushstack/heft-localization-typings-plugin" -} \ No newline at end of file diff --git a/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json b/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json index f39a3a69112..ae9cf8f52c3 100644 --- a/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json +++ b/heft-plugins/heft-localization-typings-plugin/src/schemas/options.schema.json @@ -50,31 +50,27 @@ "srcFolder": { "type": "string", - "description": "Source code root directory. Defaults to \"src/\".", - "pattern": "[^\\\\]" + "description": "Source code root directory. Defaults to \"src/\"." }, "trimmedJsonOutputFolders": { "type": "array", "description": "Output folders, relative to the project root, where JSON files that have had comments and any ignored strings discarded should be emitted to.", "items": { - "type": "string", - "pattern": "[^\\\\]" + "type": "string" } }, "generatedTsFolder": { "type": "string", - "description": "Output directory for generated typings. Defaults to \"temp/loc-ts/\".", - "pattern": "[^\\\\]" + "description": "Output directory for generated typings. Defaults to \"temp/loc-ts/\"." }, "secondaryGeneratedTsFolders": { "type": "array", "description": "Additional folders, relative to the project root, where the generated typings should be emitted to.", "items": { - "type": "string", - "pattern": "[^\\\\]" + "type": "string" } }, From 13597d569275ee7a539038fcf040506cadd23011 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Tue, 8 Jul 2025 16:13:29 -0700 Subject: [PATCH 22/25] Simplify the schema testing. --- .../test/JsonSchemaTypingsGenerator.test.ts | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/build-tests/heft-json-schema-typings-plugin-test/src/test/JsonSchemaTypingsGenerator.test.ts b/build-tests/heft-json-schema-typings-plugin-test/src/test/JsonSchemaTypingsGenerator.test.ts index d6dbe196c5d..a0adc753617 100644 --- a/build-tests/heft-json-schema-typings-plugin-test/src/test/JsonSchemaTypingsGenerator.test.ts +++ b/build-tests/heft-json-schema-typings-plugin-test/src/test/JsonSchemaTypingsGenerator.test.ts @@ -3,22 +3,29 @@ import { FileSystem, type FolderItem, PackageJsonLookup } from '@rushstack/node-core-library'; -async function* getFolderItemsAsync( +async function getFolderItemsAsync( absolutePath: string, relativePath: string -): AsyncGenerator<[string, string]> { - const folderItems: FolderItem[] = await FileSystem.readFolderItemsAsync(absolutePath); - for (const item of folderItems) { - const itemName: string = item.name; - const itemAbsolutePath: string = `${absolutePath}/${itemName}`; - const itemRelativePath: string = `${relativePath}/${itemName}`; - if (item.isDirectory()) { - yield* getFolderItemsAsync(itemAbsolutePath, itemRelativePath); - } else { - const itemContents: string = await FileSystem.readFileAsync(itemAbsolutePath); - yield [itemRelativePath, itemContents]; +): Promise> { + const folderQueue: [string, string][] = [[absolutePath, relativePath]]; + const results: [string, string][] = []; + for (const [folderAbsolutePath, folderRelativePath] of folderQueue) { + const folderItems: FolderItem[] = await FileSystem.readFolderItemsAsync(folderAbsolutePath); + for (const item of folderItems) { + const itemName: string = item.name; + const itemAbsolutePath: string = `${folderAbsolutePath}/${itemName}`; + const itemRelativePath: string = `${folderRelativePath}/${itemName}`; + if (item.isDirectory()) { + folderQueue.push([itemAbsolutePath, itemRelativePath]); + } else { + const itemContents: string = await FileSystem.readFileAsync(itemAbsolutePath); + results.push([itemRelativePath, itemContents]); + } } } + + results.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)); + return Object.fromEntries(results); } describe('json-schema-typings-plugin', () => { @@ -28,13 +35,10 @@ describe('json-schema-typings-plugin', () => { throw new Error('Could not find root folder for the test'); } - const folderItemsArray: [string, string][] = []; - for await (const item of getFolderItemsAsync(`${rootFolder}/temp/schema-dts`, '.')) { - folderItemsArray.push(item); - } - - folderItemsArray.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)); - const folderItems: Record = Object.fromEntries(folderItemsArray); + const folderItems: Record = await getFolderItemsAsync( + `${rootFolder}/temp/schema-dts`, + '.' + ); expect(folderItems).toMatchSnapshot(); }); }); From 1ea0ae3caea8f511d526d93e6ee6dae89af2ee18 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Tue, 8 Jul 2025 16:16:15 -0700 Subject: [PATCH 23/25] Don't include the eslint-disable header. --- .../JsonSchemaTypingsGenerator.test.ts.snap | 18 ------------------ .../src/JsonSchemaTypingsGenerator.ts | 4 +--- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap b/build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap index 510fc110807..42c458407d8 100644 --- a/build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap +++ b/build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap @@ -4,24 +4,18 @@ exports[`json-schema-typings-plugin should generate typings for JSON Schemas 1`] Object { "./test-invalid-additional.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior -/* eslint-disable */ - export interface TestInvalidAdditional { [k: string]: unknown; } ", "./test-invalid-format.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior -/* eslint-disable */ - export interface TestInvalidFormat { [k: string]: unknown; } ", "./test-schema-draft-04.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior -/* eslint-disable */ - export interface TestSchemaFile { exampleString: string; exampleLink?: string; @@ -60,8 +54,6 @@ export interface Type2 { ", "./test-schema-draft-07.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior -/* eslint-disable */ - export interface TestSchemaFile { exampleString: string; exampleLink?: string; @@ -100,24 +92,18 @@ export interface Type2 { ", "./test-schema-invalid.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior -/* eslint-disable */ - export interface HttpExampleComSchemasTestSchemaNestedChildSchemaJson { [k: string]: unknown; } ", "./test-schema-nested-child.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior -/* eslint-disable */ - export interface HttpExampleComSchemasTestSchemaNestedChildSchemaJson { [k: string]: unknown; } ", "./test-schema-nested.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior -/* eslint-disable */ - export interface TestSchemaFile { exampleString: string; exampleLink?: string; @@ -153,8 +139,6 @@ export interface Type2 { ", "./test-schema.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior -/* eslint-disable */ - export interface TestSchemaFile { exampleString: string; exampleLink?: string; @@ -193,8 +177,6 @@ export interface Type2 { ", "./test-valid.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior -/* eslint-disable */ - export interface TestValid { [k: string]: unknown; } diff --git a/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts b/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts index e7169c55d59..93eb4ac7531 100644 --- a/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts +++ b/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { Path } from '@rushstack/node-core-library'; import { type ITypingsGeneratorBaseOptions, type ITypingsGeneratorOptionsWithoutReadFile, @@ -18,7 +17,6 @@ export class JsonSchemaTypingsGenerator extends TypingsGenerator { public constructor(options: IJsonSchemaTypingsGeneratorBaseOptions) { super({ ...options, - srcFolder: Path.convertToPlatformDefault(options.srcFolder), fileExtensions: ['.schema.json'], // Don't bother reading the file contents, compileFromFile will read the file readFile: () => '', @@ -26,7 +24,7 @@ export class JsonSchemaTypingsGenerator extends TypingsGenerator { parseAndGenerateTypings: async (fileContents: string, filePath: string): Promise => await compileFromFile(filePath, { // The typings generator adds its own banner comment - bannerComment: '/* eslint-disable */', + bannerComment: '', cwd: path.dirname(filePath) }) }); From 62aea76d2a0716c536e4673a1de3043e34279735 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Tue, 8 Jul 2025 16:17:56 -0700 Subject: [PATCH 24/25] Revert "Add an option to the typings generator to override the write function." This reverts commit 1dec3d0805b0f870857ea054822596abee2795a1. --- ...chema-typings-plugin_2025-07-07-00-11.json | 10 ---- common/reviews/api/typings-generator.api.md | 4 +- .../typings-generator/src/TypingsGenerator.ts | 52 +++++++------------ 3 files changed, 21 insertions(+), 45 deletions(-) delete mode 100644 common/changes/@rushstack/typings-generator/user-ianc-json-schema-typings-plugin_2025-07-07-00-11.json diff --git a/common/changes/@rushstack/typings-generator/user-ianc-json-schema-typings-plugin_2025-07-07-00-11.json b/common/changes/@rushstack/typings-generator/user-ianc-json-schema-typings-plugin_2025-07-07-00-11.json deleted file mode 100644 index 3f9f9f634fc..00000000000 --- a/common/changes/@rushstack/typings-generator/user-ianc-json-schema-typings-plugin_2025-07-07-00-11.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@rushstack/typings-generator", - "comment": "Add an option to provide a `writeFileAsync` function.", - "type": "minor" - } - ], - "packageName": "@rushstack/typings-generator" -} \ No newline at end of file diff --git a/common/reviews/api/typings-generator.api.md b/common/reviews/api/typings-generator.api.md index f66c7d8d96d..a942f38b474 100644 --- a/common/reviews/api/typings-generator.api.md +++ b/common/reviews/api/typings-generator.api.md @@ -79,8 +79,6 @@ export interface ITypingsGeneratorOptionsWithoutReadFile string[]; // (undocumented) parseAndGenerateTypings: (fileContents: TFileContents, filePath: string, relativePath: string) => TTypingsResult | Promise; - // (undocumented) - writeFileAsync?: (filePath: string, contents: string) => Promise; } // @public (undocumented) @@ -102,7 +100,7 @@ export class TypingsGenerator { readonly ignoredFileGlobs: readonly string[]; readonly inputFileGlob: string; // (undocumented) - protected readonly _options: Required, 'writeFileAsync'>> & ITypingsGeneratorOptionsWithCustomReadFile; + protected readonly _options: ITypingsGeneratorOptionsWithCustomReadFile; registerDependency(consumer: string, rawDependency: string): void; // (undocumented) runWatcherAsync(): Promise; diff --git a/libraries/typings-generator/src/TypingsGenerator.ts b/libraries/typings-generator/src/TypingsGenerator.ts index 4a77c9033fd..39cef23ebbe 100644 --- a/libraries/typings-generator/src/TypingsGenerator.ts +++ b/libraries/typings-generator/src/TypingsGenerator.ts @@ -33,7 +33,6 @@ export interface ITypingsGeneratorOptionsWithoutReadFile< relativePath: string ) => TTypingsResult | Promise; getAdditionalOutputFiles?: (relativePath: string) => string[]; - writeFileAsync?: (filePath: string, contents: string) => Promise; } /** @@ -81,10 +80,7 @@ export class TypingsGenerator { // Map of resolved file path -> relative file path private readonly _relativePaths: Map; - protected readonly _options: Required< - Pick, 'writeFileAsync'> - > & - ITypingsGeneratorOptionsWithCustomReadFile; + protected readonly _options: ITypingsGeneratorOptionsWithCustomReadFile; protected readonly terminal: ITerminal; @@ -110,56 +106,46 @@ export class TypingsGenerator { ); public constructor(options: ITypingsGeneratorOptionsWithCustomReadFile); public constructor(options: ITypingsGeneratorOptionsWithCustomReadFile) { - this._options = options = { + this._options = { ...options, readFile: options.readFile ?? ((filePath: string, relativePath: string): Promise => - FileSystem.readFileAsync(filePath) as Promise), - writeFileAsync: - options.writeFileAsync ?? - ((filePath: string, contents: string): Promise => - FileSystem.writeFileAsync(filePath, contents, { - ensureFolderExists: true, - convertLineEndings: NewlineKind.OsDefault - })) + FileSystem.readFileAsync(filePath) as Promise) }; - const { generatedTsFolder, srcFolder, fileExtensions, globsToIgnore, terminal } = options; - - if (!generatedTsFolder) { + if (!options.generatedTsFolder) { throw new Error('generatedTsFolder must be provided'); } - if (!srcFolder) { + if (!options.srcFolder) { throw new Error('srcFolder must be provided'); } - this.sourceFolderPath = srcFolder; + this.sourceFolderPath = options.srcFolder; - if (Path.isUnder(srcFolder, generatedTsFolder)) { + if (Path.isUnder(options.srcFolder, options.generatedTsFolder)) { throw new Error('srcFolder must not be under generatedTsFolder'); } - if (Path.isUnder(generatedTsFolder, srcFolder)) { + if (Path.isUnder(options.generatedTsFolder, options.srcFolder)) { throw new Error('generatedTsFolder must not be under srcFolder'); } - if (!fileExtensions?.length) { + if (!options.fileExtensions || options.fileExtensions.length === 0) { throw new Error('At least one file extension must be provided.'); } - this.ignoredFileGlobs = globsToIgnore || []; + this.ignoredFileGlobs = options.globsToIgnore || []; - this.terminal = terminal ?? new Terminal(new ConsoleTerminalProvider({ verboseEnabled: true })); + this.terminal = options.terminal ?? new Terminal(new ConsoleTerminalProvider({ verboseEnabled: true })); - const normalizedFileExtensions: string[] = this._normalizeFileExtensions(fileExtensions); - this._options.fileExtensions = normalizedFileExtensions; + this._options.fileExtensions = this._normalizeFileExtensions(options.fileExtensions); this._dependenciesOfFile = new Map(); this._consumersOfFile = new Map(); this._relativePaths = new Map(); - this.inputFileGlob = `**/*+(${normalizedFileExtensions.join('|')})`; + this.inputFileGlob = `**/*+(${this._options.fileExtensions.join('|')})`; } /** @@ -179,7 +165,7 @@ export class TypingsGenerator { }); } - await this._reprocessFilesAsync(relativeFilePaths, checkFilePaths); + await this._reprocessFilesAsync(relativeFilePaths!, checkFilePaths); } public async runWatcherAsync(): Promise { @@ -330,11 +316,10 @@ export class TypingsGenerator { private async _parseFileAndGenerateTypingsAsync(relativePath: string, resolvedPath: string): Promise { // Clear registered dependencies prior to reprocessing. this._clearDependencies(resolvedPath); - const { readFile, parseAndGenerateTypings, writeFileAsync } = this._options; try { - const fileContents: TFileContents = await readFile(resolvedPath, relativePath); - const typingsData: string | undefined = await parseAndGenerateTypings( + const fileContents: TFileContents = await this._options.readFile(resolvedPath, relativePath); + const typingsData: string | undefined = await this._options.parseAndGenerateTypings( fileContents, resolvedPath, relativePath @@ -353,7 +338,10 @@ export class TypingsGenerator { const generatedTsFilePaths: Iterable = this._getTypingsFilePaths(relativePath); for (const generatedTsFilePath of generatedTsFilePaths) { - await writeFileAsync(generatedTsFilePath, prefixedTypingsData); + await FileSystem.writeFileAsync(generatedTsFilePath, prefixedTypingsData, { + ensureFolderExists: true, + convertLineEndings: NewlineKind.OsDefault + }); } } catch (e) { this.terminal.writeError( From ce5aa233d1ff23cd0e30ea1c748a24ae13faed5e Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Tue, 8 Jul 2025 16:20:29 -0700 Subject: [PATCH 25/25] fixup! Revert "Add an option to the typings generator to override the write function." --- .../src/JsonSchemaTypingsGenerator.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts b/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts index 93eb4ac7531..f97ffbdbe85 100644 --- a/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts +++ b/heft-plugins/heft-json-schema-typings-plugin/src/JsonSchemaTypingsGenerator.ts @@ -1,17 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { - type ITypingsGeneratorBaseOptions, - type ITypingsGeneratorOptionsWithoutReadFile, - TypingsGenerator -} from '@rushstack/typings-generator'; +import { type ITypingsGeneratorBaseOptions, TypingsGenerator } from '@rushstack/typings-generator'; import { compileFromFile } from 'json-schema-to-typescript'; import path from 'path'; -interface IJsonSchemaTypingsGeneratorBaseOptions - extends ITypingsGeneratorBaseOptions, - Pick {} +interface IJsonSchemaTypingsGeneratorBaseOptions extends ITypingsGeneratorBaseOptions {} export class JsonSchemaTypingsGenerator extends TypingsGenerator { public constructor(options: IJsonSchemaTypingsGeneratorBaseOptions) {