@vaadin/hilla-generator-core 25.3.0-alpha8 → 25.3.0-alpha9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Generator.js +1 -1
- package/Generator.js.map +1 -1
- package/SharedStorage.d.ts +1 -1
- package/package.json +4 -4
package/Generator.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
2
|
-
import ts from "typescript";
|
|
2
|
+
import ts from "@typescript/typescript6";
|
|
3
3
|
import PluginManager from "./PluginManager.js";
|
|
4
4
|
import ReferenceResolver from "./ReferenceResolver.js";
|
|
5
5
|
export default class Generator {
|
package/Generator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,OAAO,gDAAiD;
|
|
1
|
+
{"mappings":"AAAA,OAAO,gDAAiD;AACxD,OAAO,iCAAkC;AAIzC,OAAO,uCAAwC;AAC/C,OAAO,+CAAgD;AAQvD,eAAe,MAAM,UAAU;CAC7B,AAASA;CACT,AAASC;CACT,AAASC;CACT,AAASC;CAET,YAAYC,SAAuCC,SAA2B;AAC5E,OAAKH,UAAU,IAAI;AACnB,OAAKD,WAAW,IAAI,cAAc,SAAS,IAAI,kBAAkB,KAAKC,UAAU,QAAQ;AACxF,OAAKF,UAAU,QAAQ;AACvB,OAAKG,aAAa,QAAQ;CAC3B;CAED,MAAM,QAAQG,OAAyC;AACrD,OAAKN,QAAQ,OAAO,MAAM,qBAAqB;EAC/C,MAAM,MAAO,MAAM,KAAKE,QAAQ,OAAO,KAAK,MAAM,MAAM,CAAC;EAEzD,MAAMK,UAAyB;GAC7B;GACA,SAAS,KAAKL,QAAQ;GACtB,WAAW,KAAKC;GAChB,eAAe,IAAI;GACnB,SAAS,CAAE;GACX,eAAe,IAAI;EACpB;AAED,OAAKH,QAAQ,OAAO,MAAM,oBAAoB;AAC9C,QAAM,KAAKC,SAAS,QAAQ,QAAQ;AAEpC,OAAKD,QAAQ,OAAO,MAAM,iBAAiB;EAC3C,MAAM,UAAU,GAAG,cAAc,EAAE,SAAS,GAAG,YAAY,SAAU,EAAC;AAEtE,SAAO,QAAQ,QAAQ,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,QAAQ,UAAU,KAAK,AAAC,GAAE,KAAK,UAAU;CACzF;AACF","names":["#logger","#manager","#parser","#outputDir","plugins: readonly PluginConstructor[]","context: GeneratorContext","input: string","storage: SharedStorage"],"sources":["/opt/agent/work/649c11185a3798db/packages/ts/generator-core/src/Generator.ts"],"sourcesContent":["import SwaggerParser from '@apidevtools/swagger-parser';\nimport ts from '@typescript/typescript6';\nimport type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';\nimport type { OpenAPIV3 } from 'openapi-types';\nimport type { PluginConstructor } from './Plugin.js';\nimport PluginManager from './PluginManager.js';\nimport ReferenceResolver from './ReferenceResolver.js';\nimport type { SharedStorage } from './SharedStorage.js';\n\nexport type GeneratorContext = Readonly<{\n logger: LoggerFactory;\n outputDir?: string;\n}>;\n\nexport default class Generator {\n readonly #logger: LoggerFactory;\n readonly #manager: PluginManager;\n readonly #parser: SwaggerParser;\n readonly #outputDir: string | undefined;\n\n constructor(plugins: readonly PluginConstructor[], context: GeneratorContext) {\n this.#parser = new SwaggerParser();\n this.#manager = new PluginManager(plugins, new ReferenceResolver(this.#parser), context.logger);\n this.#logger = context.logger;\n this.#outputDir = context.outputDir;\n }\n\n async process(input: string): Promise<readonly File[]> {\n this.#logger.global.debug('Processing OpenAPI');\n const api = (await this.#parser.bundle(JSON.parse(input))) as OpenAPIV3.Document;\n\n const storage: SharedStorage = {\n api,\n apiRefs: this.#parser.$refs,\n outputDir: this.#outputDir,\n pluginStorage: new Map(),\n sources: [],\n transferTypes: new Map(),\n };\n\n this.#logger.global.debug('Executing plugins');\n await this.#manager.execute(storage);\n\n this.#logger.global.debug('Printing files');\n const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed });\n\n return storage.sources.map((file) => new File([printer.printFile(file)], file.fileName));\n }\n}\n"],"version":3}
|
package/SharedStorage.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { $Refs } from "@apidevtools/swagger-parser";
|
|
2
|
+
import type { SourceFile, TypeNode } from "@typescript/typescript6";
|
|
2
3
|
import type DependencyManager from "@vaadin/hilla-generator-utils/dependencies/DependencyManager.js";
|
|
3
4
|
import type { OpenAPIV3 } from "openapi-types";
|
|
4
|
-
import type { SourceFile, TypeNode } from "typescript";
|
|
5
5
|
export type TransferTypeMakerContext = Readonly<{
|
|
6
6
|
dependencies: DependencyManager
|
|
7
7
|
typeArguments?: readonly TypeNode[]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/hilla-generator-core",
|
|
3
|
-
"version": "25.3.0-
|
|
3
|
+
"version": "25.3.0-alpha9",
|
|
4
4
|
"description": "A Hilla tool to generate TypeScript code from the OpenAPI document",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
+
"@typescript/typescript6": "6.0.2",
|
|
69
70
|
"@apidevtools/swagger-parser": "10.1.1",
|
|
70
|
-
"@vaadin/hilla-generator-utils": "25.3.0-
|
|
71
|
+
"@vaadin/hilla-generator-utils": "25.3.0-alpha9",
|
|
71
72
|
"meow": "13.2.0",
|
|
72
|
-
"openapi-types": "12.1.3"
|
|
73
|
-
"typescript": "npm:@typescript/typescript6@6.0.2"
|
|
73
|
+
"openapi-types": "12.1.3"
|
|
74
74
|
}
|
|
75
75
|
}
|