@vaadin/hilla-generator-core 24.7.0-alpha9 → 24.8.0-alpha1

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.d.ts CHANGED
@@ -1,13 +1,11 @@
1
- import type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';
2
- import File from './File.js';
3
- import type { PluginConstructor } from './Plugin.js';
1
+ import type LoggerFactory from "@vaadin/hilla-generator-utils/LoggerFactory.js";
2
+ import type { PluginConstructor } from "./Plugin.js";
4
3
  export type GeneratorContext = Readonly<{
5
- logger: LoggerFactory;
6
- outputDir?: string;
4
+ logger: LoggerFactory
5
+ outputDir?: string
7
6
  }>;
8
7
  export default class Generator {
9
- #private;
10
- constructor(plugins: readonly PluginConstructor[], context: GeneratorContext);
11
- process(input: string): Promise<readonly File[]>;
8
+ #private;
9
+ constructor(plugins: readonly PluginConstructor[], context: GeneratorContext);
10
+ process(input: string): Promise<readonly File[]>;
12
11
  }
13
- //# sourceMappingURL=Generator.d.ts.map
package/Generator.js CHANGED
@@ -1,37 +1,34 @@
1
1
  import SwaggerParser from "@apidevtools/swagger-parser";
2
2
  import ts from "typescript";
3
- import File from "./File.js";
4
3
  import PluginManager from "./PluginManager.js";
5
4
  import ReferenceResolver from "./ReferenceResolver.js";
6
- class Generator {
7
- #logger;
8
- #manager;
9
- #parser;
10
- #outputDir;
11
- constructor(plugins, context) {
12
- this.#parser = new SwaggerParser();
13
- this.#manager = new PluginManager(plugins, new ReferenceResolver(this.#parser), context.logger);
14
- this.#logger = context.logger;
15
- this.#outputDir = context.outputDir;
16
- }
17
- async process(input) {
18
- this.#logger.global.debug("Processing OpenAPI");
19
- const api = await this.#parser.bundle(JSON.parse(input));
20
- const storage = {
21
- api,
22
- apiRefs: this.#parser.$refs,
23
- outputDir: this.#outputDir,
24
- pluginStorage: /* @__PURE__ */ new Map(),
25
- sources: []
26
- };
27
- this.#logger.global.debug("Executing plugins");
28
- await this.#manager.execute(storage);
29
- this.#logger.global.debug("Printing files");
30
- const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed });
31
- return storage.sources.map((file) => new File([printer.printFile(file)], file.fileName));
32
- }
5
+ export default class Generator {
6
+ #logger;
7
+ #manager;
8
+ #parser;
9
+ #outputDir;
10
+ constructor(plugins, context) {
11
+ this.#parser = new SwaggerParser();
12
+ this.#manager = new PluginManager(plugins, new ReferenceResolver(this.#parser), context.logger);
13
+ this.#logger = context.logger;
14
+ this.#outputDir = context.outputDir;
15
+ }
16
+ async process(input) {
17
+ this.#logger.global.debug("Processing OpenAPI");
18
+ const api = await this.#parser.bundle(JSON.parse(input));
19
+ const storage = {
20
+ api,
21
+ apiRefs: this.#parser.$refs,
22
+ outputDir: this.#outputDir,
23
+ pluginStorage: new Map(),
24
+ sources: [],
25
+ transferTypes: new Map()
26
+ };
27
+ this.#logger.global.debug("Executing plugins");
28
+ await this.#manager.execute(storage);
29
+ this.#logger.global.debug("Printing files");
30
+ const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed });
31
+ return storage.sources.map((file) => new File([printer.printFile(file)], file.fileName));
32
+ }
33
33
  }
34
- export {
35
- Generator as default
36
- };
37
- //# sourceMappingURL=Generator.js.map
34
+ //# sourceMappingURL=./Generator.js.map
package/Generator.js.map CHANGED
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["src/Generator.ts"],
4
- "sourcesContent": ["import SwaggerParser from '@apidevtools/swagger-parser';\nimport type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';\nimport type { OpenAPIV3 } from 'openapi-types';\nimport type { ReadonlyDeep } from 'type-fest';\nimport ts from 'typescript';\nimport File from './File.js';\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 ReadonlyDeep<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 };\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"],
5
- "mappings": "AAAA,OAAO,mBAAmB;AAI1B,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,OAAO,mBAAmB;AAC1B,OAAO,uBAAuB;AAQ9B,MAAO,UAAwB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,SAAuC,SAA2B;AAC5E,SAAK,UAAU,IAAI,cAAc;AACjC,SAAK,WAAW,IAAI,cAAc,SAAS,IAAI,kBAAkB,KAAK,OAAO,GAAG,QAAQ,MAAM;AAC9F,SAAK,UAAU,QAAQ;AACvB,SAAK,aAAa,QAAQ;AAAA,EAC5B;AAAA,EAEA,MAAM,QAAQ,OAAyC;AACrD,SAAK,QAAQ,OAAO,MAAM,oBAAoB;AAC9C,UAAM,MAAO,MAAM,KAAK,QAAQ,OAAO,KAAK,MAAM,KAAK,CAAC;AAExD,UAAM,UAAyB;AAAA,MAC7B;AAAA,MACA,SAAS,KAAK,QAAQ;AAAA,MACtB,WAAW,KAAK;AAAA,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AAQ,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/1af72d8adc613024/hilla/packages/ts/generator-core/src/Generator.ts"],"sourcesContent":["import SwaggerParser from '@apidevtools/swagger-parser';\nimport type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';\nimport type { OpenAPIV3 } from 'openapi-types';\nimport ts from 'typescript';\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/Plugin.d.ts CHANGED
@@ -1,15 +1,14 @@
1
- import type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';
2
- import type { Logger } from '@vaadin/hilla-generator-utils/LoggerFactory.js';
3
- import type { Constructor } from 'type-fest';
4
- import type ReferenceResolver from './ReferenceResolver.js';
5
- import type SharedStorage from './SharedStorage.js';
1
+ import type LoggerFactory from "@vaadin/hilla-generator-utils/LoggerFactory.js";
2
+ import type { Logger } from "@vaadin/hilla-generator-utils/LoggerFactory.js";
3
+ import type { Constructor } from "type-fest";
4
+ import type ReferenceResolver from "./ReferenceResolver.js";
5
+ import type { SharedStorage } from "./SharedStorage.js";
6
6
  export default abstract class Plugin {
7
- readonly resolver: ReferenceResolver;
8
- readonly logger: Logger;
9
- constructor(resolver: ReferenceResolver, logger: LoggerFactory);
10
- get name(): string;
11
- abstract get path(): string;
12
- abstract execute(storage: SharedStorage): Promise<void>;
7
+ readonly resolver: ReferenceResolver;
8
+ readonly logger: Logger;
9
+ constructor(resolver: ReferenceResolver, logger: LoggerFactory);
10
+ get name(): string;
11
+ abstract get path(): string;
12
+ abstract execute(storage: SharedStorage): Promise<void> | void;
13
13
  }
14
14
  export type PluginConstructor = Constructor<Plugin, ConstructorParameters<typeof Plugin>>;
15
- //# sourceMappingURL=Plugin.d.ts.map
package/Plugin.js CHANGED
@@ -1,15 +1,12 @@
1
- class Plugin {
2
- resolver;
3
- logger;
4
- constructor(resolver, logger) {
5
- this.logger = logger.for(this.constructor.name);
6
- this.resolver = resolver;
7
- }
8
- get name() {
9
- return this.constructor.name;
10
- }
1
+ export default class Plugin {
2
+ resolver;
3
+ logger;
4
+ constructor(resolver, logger) {
5
+ this.logger = logger.for(this.constructor.name);
6
+ this.resolver = resolver;
7
+ }
8
+ get name() {
9
+ return this.constructor.name;
10
+ }
11
11
  }
12
- export {
13
- Plugin as default
14
- };
15
- //# sourceMappingURL=Plugin.js.map
12
+ //# sourceMappingURL=./Plugin.js.map
package/Plugin.js.map CHANGED
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["src/Plugin.ts"],
4
- "sourcesContent": ["import type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';\nimport type { Logger } from '@vaadin/hilla-generator-utils/LoggerFactory.js';\nimport type { Constructor } from 'type-fest';\nimport type ReferenceResolver from './ReferenceResolver.js';\nimport type SharedStorage from './SharedStorage.js';\n\nexport default abstract class Plugin {\n readonly resolver: ReferenceResolver;\n readonly logger: Logger;\n\n constructor(resolver: ReferenceResolver, logger: LoggerFactory) {\n this.logger = logger.for(this.constructor.name);\n this.resolver = resolver;\n }\n\n get name(): string {\n return this.constructor.name;\n }\n\n abstract get path(): string;\n\n abstract execute(storage: SharedStorage): Promise<void>;\n}\n\nexport type PluginConstructor = Constructor<Plugin, ConstructorParameters<typeof Plugin>>;\n"],
5
- "mappings": "AAMA,MAAO,OAA8B;AAAA,EAC1B;AAAA,EACA;AAAA,EAET,YAAY,UAA6B,QAAuB;AAC9D,SAAK,SAAS,OAAO,IAAI,KAAK,YAAY,IAAI;AAC9C,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,IAAI,OAAe;AACjB,WAAO,KAAK,YAAY;AAAA,EAC1B;AAKF;",
6
- "names": []
7
- }
1
+ {"mappings":"AAMA,eAAe,MAAe,OAAO;CACnC,AAAS;CACT,AAAS;CAET,YAAYA,UAA6BC,QAAuB;AAC9D,OAAK,SAAS,OAAO,IAAI,KAAK,YAAY,KAAK;AAC/C,OAAK,WAAW;CACjB;CAED,IAAI,OAAe;AACjB,SAAO,KAAK,YAAY;CACzB;AAKF","names":["resolver: ReferenceResolver","logger: LoggerFactory"],"sources":["/opt/agent/work/1af72d8adc613024/hilla/packages/ts/generator-core/src/Plugin.ts"],"sourcesContent":["import type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';\nimport type { Logger } from '@vaadin/hilla-generator-utils/LoggerFactory.js';\nimport type { Constructor } from 'type-fest';\nimport type ReferenceResolver from './ReferenceResolver.js';\nimport type { SharedStorage } from './SharedStorage.js';\n\nexport default abstract class Plugin {\n readonly resolver: ReferenceResolver;\n readonly logger: Logger;\n\n constructor(resolver: ReferenceResolver, logger: LoggerFactory) {\n this.logger = logger.for(this.constructor.name);\n this.resolver = resolver;\n }\n\n get name(): string {\n return this.constructor.name;\n }\n\n abstract get path(): string;\n\n abstract execute(storage: SharedStorage): Promise<void> | void;\n}\n\nexport type PluginConstructor = Constructor<Plugin, ConstructorParameters<typeof Plugin>>;\n"],"version":3}
@@ -1,10 +1,9 @@
1
- import type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';
2
- import type { PluginConstructor } from './Plugin.js';
3
- import type ReferenceResolver from './ReferenceResolver.js';
4
- import type SharedStorage from './SharedStorage.js';
1
+ import type LoggerFactory from "@vaadin/hilla-generator-utils/LoggerFactory.js";
2
+ import type { PluginConstructor } from "./Plugin.js";
3
+ import type ReferenceResolver from "./ReferenceResolver.js";
4
+ import type { SharedStorage } from "./SharedStorage.js";
5
5
  export default class PluginManager {
6
- #private;
7
- constructor(plugins: readonly PluginConstructor[], resolver: ReferenceResolver, logger: LoggerFactory);
8
- execute(storage: SharedStorage): Promise<void>;
6
+ #private;
7
+ constructor(plugins: readonly PluginConstructor[], resolver: ReferenceResolver, logger: LoggerFactory);
8
+ execute(storage: SharedStorage): Promise<void>;
9
9
  }
10
- //# sourceMappingURL=PluginManager.d.ts.map
package/PluginManager.js CHANGED
@@ -1,30 +1,31 @@
1
- class PluginManager {
2
- #plugins;
3
- constructor(plugins, resolver, logger) {
4
- const standardPlugins = [
5
- "BackbonePlugin",
6
- "ClientPlugin",
7
- "BarrelPlugin",
8
- "ModelPlugin",
9
- "PushPlugin",
10
- "SubTypesPlugin",
11
- "SignalsPlugin"
12
- ];
13
- const customPlugins = plugins.filter((p) => !standardPlugins.includes(p.name));
14
- if (customPlugins.length > 0) {
15
- logger.global.info(`Plugins: ${plugins.map(({ name }) => name).join(", ")}`);
16
- }
17
- this.#plugins = plugins.map((PluginClass) => new PluginClass(resolver, logger));
18
- }
19
- async execute(storage) {
20
- for (const plugin of this.#plugins) {
21
- const { name, path } = plugin;
22
- plugin.logger.debug({ plugin: { name, path } }, `Executing plugin '${plugin.name}'`);
23
- await plugin.execute(storage);
24
- }
25
- }
1
+ export default class PluginManager {
2
+ #plugins;
3
+ constructor(plugins, resolver, logger) {
4
+ const standardPlugins = [
5
+ "TransferTypesPlugin",
6
+ "BackbonePlugin",
7
+ "ClientPlugin",
8
+ "BarrelPlugin",
9
+ "ModelPlugin",
10
+ "PushPlugin",
11
+ "SubTypesPlugin",
12
+ "SignalsPlugin"
13
+ ];
14
+ const customPlugins = plugins.filter((p) => !standardPlugins.includes(p.name));
15
+ if (customPlugins.length > 0) {
16
+ logger.global.info(`Plugins: ${plugins.map(({ name }) => name).join(", ")}`);
17
+ }
18
+ this.#plugins = plugins.map((PluginClass) => new PluginClass(resolver, logger));
19
+ }
20
+ async execute(storage) {
21
+ for (const plugin of this.#plugins) {
22
+ const { name, path } = plugin;
23
+ plugin.logger.debug({ plugin: {
24
+ name,
25
+ path
26
+ } }, `Executing plugin '${plugin.name}'`);
27
+ await plugin.execute(storage);
28
+ }
29
+ }
26
30
  }
27
- export {
28
- PluginManager as default
29
- };
30
- //# sourceMappingURL=PluginManager.js.map
31
+ //# sourceMappingURL=./PluginManager.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["src/PluginManager.ts"],
4
- "sourcesContent": ["import type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';\nimport type Plugin from './Plugin.js';\nimport type { PluginConstructor } from './Plugin.js';\nimport type ReferenceResolver from './ReferenceResolver.js';\nimport type SharedStorage from './SharedStorage.js';\n\nexport default class PluginManager {\n readonly #plugins: Plugin[];\n\n constructor(plugins: readonly PluginConstructor[], resolver: ReferenceResolver, logger: LoggerFactory) {\n const standardPlugins = [\n 'BackbonePlugin',\n 'ClientPlugin',\n 'BarrelPlugin',\n 'ModelPlugin',\n 'PushPlugin',\n 'SubTypesPlugin',\n 'SignalsPlugin',\n ];\n const customPlugins = plugins.filter((p) => !standardPlugins.includes(p.name));\n if (customPlugins.length > 0) {\n logger.global.info(`Plugins: ${plugins.map(({ name }) => name).join(', ')}`);\n }\n this.#plugins = plugins.map((PluginClass) => new PluginClass(resolver, logger));\n }\n\n async execute(storage: SharedStorage): Promise<void> {\n // We need to run plugins sequentially\n for (const plugin of this.#plugins) {\n const { name, path } = plugin;\n plugin.logger.debug({ plugin: { name, path } }, `Executing plugin '${plugin.name}'`);\n // eslint-disable-next-line no-await-in-loop\n await plugin.execute(storage);\n }\n }\n}\n"],
5
- "mappings": "AAMA,MAAO,cAA4B;AAAA,EACxB;AAAA,EAET,YAAY,SAAuC,UAA6B,QAAuB;AACrG,UAAM,kBAAkB;AAAA,MACtB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AACA,UAAM,gBAAgB,QAAQ,OAAO,CAAC,MAAM,CAAC,gBAAgB,SAAS,EAAE,IAAI,CAAC;AAC7E,QAAI,cAAc,SAAS,GAAG;AAC5B,aAAO,OAAO,KAAK,YAAY,QAAQ,IAAI,CAAC,EAAE,KAAK,MAAM,IAAI,EAAE,KAAK,IAAI,CAAC,EAAE;AAAA,IAC7E;AACA,SAAK,WAAW,QAAQ,IAAI,CAAC,gBAAgB,IAAI,YAAY,UAAU,MAAM,CAAC;AAAA,EAChF;AAAA,EAEA,MAAM,QAAQ,SAAuC;AAEnD,eAAW,UAAU,KAAK,UAAU;AAClC,YAAM,EAAE,MAAM,KAAK,IAAI;AACvB,aAAO,OAAO,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,EAAE,GAAG,qBAAqB,OAAO,IAAI,GAAG;AAEnF,YAAM,OAAO,QAAQ,OAAO;AAAA,IAC9B;AAAA,EACF;AACF;",
6
- "names": []
7
- }
1
+ {"mappings":"AAMA,eAAe,MAAM,cAAc;CACjC,AAASA;CAET,YAAYC,SAAuCC,UAA6BC,QAAuB;EACrG,MAAM,kBAAkB;GACtB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD;EACD,MAAM,gBAAgB,QAAQ,OAAO,CAAC,OAAO,gBAAgB,SAAS,EAAE,KAAK,CAAC;AAC9E,MAAI,cAAc,SAAS,GAAG;AAC5B,UAAO,OAAO,MAAM,WAAW,QAAQ,IAAI,CAAC,EAAE,MAAM,KAAK,KAAK,CAAC,KAAK,KAAK,CAAC,EAAE;EAC7E;AACD,OAAKH,WAAW,QAAQ,IAAI,CAAC,gBAAgB,IAAI,YAAY,UAAU,QAAQ;CAChF;CAED,MAAM,QAAQI,SAAuC;AAEnD,OAAK,MAAM,UAAU,KAAKJ,UAAU;GAClC,MAAM,EAAE,MAAM,MAAM,GAAG;AACvB,UAAO,OAAO,MAAM,EAAE,QAAQ;IAAE;IAAM;GAAM,EAAE,IAAG,oBAAoB,OAAO,KAAK,GAAG;AAEpF,SAAM,OAAO,QAAQ,QAAQ;EAC9B;CACF;AACF","names":["#plugins","plugins: readonly PluginConstructor[]","resolver: ReferenceResolver","logger: LoggerFactory","storage: SharedStorage"],"sources":["/opt/agent/work/1af72d8adc613024/hilla/packages/ts/generator-core/src/PluginManager.ts"],"sourcesContent":["import type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';\nimport type Plugin from './Plugin.js';\nimport type { PluginConstructor } from './Plugin.js';\nimport type ReferenceResolver from './ReferenceResolver.js';\nimport type { SharedStorage } from './SharedStorage.js';\n\nexport default class PluginManager {\n readonly #plugins: Plugin[];\n\n constructor(plugins: readonly PluginConstructor[], resolver: ReferenceResolver, logger: LoggerFactory) {\n const standardPlugins = [\n 'TransferTypesPlugin',\n 'BackbonePlugin',\n 'ClientPlugin',\n 'BarrelPlugin',\n 'ModelPlugin',\n 'PushPlugin',\n 'SubTypesPlugin',\n 'SignalsPlugin',\n ];\n const customPlugins = plugins.filter((p) => !standardPlugins.includes(p.name));\n if (customPlugins.length > 0) {\n logger.global.info(`Plugins: ${plugins.map(({ name }) => name).join(', ')}`);\n }\n this.#plugins = plugins.map((PluginClass) => new PluginClass(resolver, logger));\n }\n\n async execute(storage: SharedStorage): Promise<void> {\n // We need to run plugins sequentially\n for (const plugin of this.#plugins) {\n const { name, path } = plugin;\n plugin.logger.debug({ plugin: { name, path } }, `Executing plugin '${plugin.name}'`);\n // eslint-disable-next-line no-await-in-loop\n await plugin.execute(storage);\n }\n }\n}\n"],"version":3}
@@ -1,9 +1,7 @@
1
- import type SwaggerParser from '@apidevtools/swagger-parser';
2
- import type { OpenAPIV3 } from 'openapi-types';
3
- import type { ReadonlyDeep } from 'type-fest';
1
+ import type SwaggerParser from "@apidevtools/swagger-parser";
2
+ import type { OpenAPIV3 } from "openapi-types";
4
3
  export default class ReferenceResolver {
5
- #private;
6
- constructor(parser: SwaggerParser);
7
- resolve<T extends ReadonlyDeep<object>>(obj: ReadonlyDeep<OpenAPIV3.ReferenceObject> | T): T;
4
+ #private;
5
+ constructor(parser: SwaggerParser);
6
+ resolve<T extends object>(obj: OpenAPIV3.ReferenceObject | T): T;
8
7
  }
9
- //# sourceMappingURL=ReferenceResolver.d.ts.map
@@ -1,14 +1,10 @@
1
- class ReferenceResolver {
2
- #parser;
3
- constructor(parser) {
4
- this.#parser = parser;
5
- }
6
- // eslint-disable-next-line @typescript-eslint/ban-types
7
- resolve(obj) {
8
- return "$ref" in obj ? this.#parser.$refs.get(obj.$ref) : obj;
9
- }
1
+ export default class ReferenceResolver {
2
+ #parser;
3
+ constructor(parser) {
4
+ this.#parser = parser;
5
+ }
6
+ resolve(obj) {
7
+ return "$ref" in obj ? this.#parser.$refs.get(obj.$ref) : obj;
8
+ }
10
9
  }
11
- export {
12
- ReferenceResolver as default
13
- };
14
- //# sourceMappingURL=ReferenceResolver.js.map
10
+ //# sourceMappingURL=./ReferenceResolver.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["src/ReferenceResolver.ts"],
4
- "sourcesContent": ["import type SwaggerParser from '@apidevtools/swagger-parser';\nimport type { OpenAPIV3 } from 'openapi-types';\nimport type { ReadonlyDeep } from 'type-fest';\n\nexport default class ReferenceResolver {\n readonly #parser: SwaggerParser;\n\n constructor(parser: SwaggerParser) {\n this.#parser = parser;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n resolve<T extends ReadonlyDeep<object>>(obj: ReadonlyDeep<OpenAPIV3.ReferenceObject> | T): T {\n return '$ref' in obj ? this.#parser.$refs.get(obj.$ref) : obj;\n }\n}\n"],
5
- "mappings": "AAIA,MAAO,kBAAgC;AAAA,EAC5B;AAAA,EAET,YAAY,QAAuB;AACjC,SAAK,UAAU;AAAA,EACjB;AAAA;AAAA,EAGA,QAAwC,KAAqD;AAC3F,WAAO,UAAU,MAAM,KAAK,QAAQ,MAAM,IAAI,IAAI,IAAI,IAAI;AAAA,EAC5D;AACF;",
6
- "names": []
7
- }
1
+ {"mappings":"AAGA,eAAe,MAAM,kBAAkB;CACrC,AAASA;CAET,YAAYC,QAAuB;AACjC,OAAKD,UAAU;CAChB;CAED,QAA0BE,KAAuC;AAC/D,SAAO,UAAU,MAAM,KAAKF,QAAQ,MAAM,IAAI,IAAI,KAAK,GAAG;CAC3D;AACF","names":["#parser","parser: SwaggerParser","obj: OpenAPIV3.ReferenceObject | T"],"sources":["/opt/agent/work/1af72d8adc613024/hilla/packages/ts/generator-core/src/ReferenceResolver.ts"],"sourcesContent":["import type SwaggerParser from '@apidevtools/swagger-parser';\nimport type { OpenAPIV3 } from 'openapi-types';\n\nexport default class ReferenceResolver {\n readonly #parser: SwaggerParser;\n\n constructor(parser: SwaggerParser) {\n this.#parser = parser;\n }\n\n resolve<T extends object>(obj: OpenAPIV3.ReferenceObject | T): T {\n return '$ref' in obj ? this.#parser.$refs.get(obj.$ref) : obj;\n }\n}\n"],"version":3}
package/Schema.d.ts CHANGED
@@ -1,37 +1,39 @@
1
- import type { OpenAPIV3 } from 'openapi-types';
2
- import type { ReadonlyDeep } from 'type-fest';
3
- import { type Nullified } from './utils.js';
4
- export type ReferenceSchema = ReadonlyDeep<OpenAPIV3.ReferenceObject>;
5
- export type ArraySchema = ReadonlyDeep<OpenAPIV3.ArraySchemaObject>;
6
- export type NonArraySchema = ReadonlyDeep<OpenAPIV3.NonArraySchemaObject>;
1
+ import type { OpenAPIV3 } from "openapi-types";
2
+ export type Nullified<
3
+ T,
4
+ K extends keyof T
5
+ > = T & Record<K, undefined>;
6
+ export type ReferenceSchema = OpenAPIV3.ReferenceObject;
7
+ export type ArraySchema = OpenAPIV3.ArraySchemaObject;
8
+ export type NonArraySchema = OpenAPIV3.NonArraySchemaObject;
7
9
  export type RegularSchema = ArraySchema | NonArraySchema;
8
- export type NullableSchema = Readonly<Required<Pick<RegularSchema, 'nullable'>>> & RegularSchema;
9
- export type AnyOfRuleComposedSchema = Readonly<Required<Pick<RegularSchema, 'anyOf'>>> & RegularSchema;
10
- export type AllOfRuleComposedSchema = Readonly<Required<Pick<RegularSchema, 'allOf'>>> & RegularSchema;
11
- export type OneOfRuleComposedSchema = Readonly<Required<Pick<RegularSchema, 'oneOf'>>> & RegularSchema;
12
- export type NotRuleComposedSchema = Readonly<Required<Pick<RegularSchema, 'not'>>> & RegularSchema;
10
+ export type NullableSchema = Readonly<Required<Pick<RegularSchema, "nullable">>> & RegularSchema;
11
+ export type AnyOfRuleComposedSchema = Readonly<Required<Pick<RegularSchema, "anyOf">>> & RegularSchema;
12
+ export type AllOfRuleComposedSchema = Readonly<Required<Pick<RegularSchema, "allOf">>> & RegularSchema;
13
+ export type OneOfRuleComposedSchema = Readonly<Required<Pick<RegularSchema, "oneOf">>> & RegularSchema;
14
+ export type NotRuleComposedSchema = Readonly<Required<Pick<RegularSchema, "not">>> & RegularSchema;
13
15
  export type ComposedSchema = AllOfRuleComposedSchema | AnyOfRuleComposedSchema | NotRuleComposedSchema | OneOfRuleComposedSchema;
14
- export type NonComposedRegularSchema = Readonly<Nullified<RegularSchema, 'allOf' | 'anyOf' | 'oneOf'>> & RegularSchema;
16
+ export type NonComposedRegularSchema = Readonly<Nullified<RegularSchema, "allOf" | "anyOf" | "oneOf">> & RegularSchema;
15
17
  export type NonComposedSchema = NonComposedRegularSchema | ReferenceSchema;
16
18
  export type BooleanSchema = NonComposedRegularSchema & Readonly<{
17
- type: 'boolean';
19
+ type: "boolean"
18
20
  }>;
19
21
  export type IntegerSchema = NonComposedRegularSchema & Readonly<{
20
- type: 'integer';
22
+ type: "integer"
21
23
  }>;
22
24
  export type NumberSchema = NonComposedRegularSchema & Readonly<{
23
- type: 'number';
25
+ type: "number"
24
26
  }>;
25
27
  export type ObjectSchema = NonComposedRegularSchema & Readonly<{
26
- type: 'object';
28
+ type: "object"
27
29
  }>;
28
30
  export type StringSchema = NonComposedRegularSchema & Readonly<{
29
- type: 'string';
31
+ type: "string"
30
32
  }>;
31
- export type EnumSchema = Readonly<Required<Pick<StringSchema, 'enum'>>> & StringSchema;
32
- export type EmptyObjectSchema = ObjectSchema & Readonly<Nullified<ObjectSchema, 'properties'>>;
33
- export type NonEmptyObjectSchema = ObjectSchema & Readonly<Required<Pick<ObjectSchema, 'properties'>>>;
34
- export type MapSchema = EmptyObjectSchema & Readonly<Required<Pick<ObjectSchema, 'additionalProperties'>>>;
33
+ export type EnumSchema = Readonly<Required<Pick<StringSchema, "enum">>> & StringSchema;
34
+ export type EmptyObjectSchema = ObjectSchema & Readonly<Nullified<ObjectSchema, "properties">>;
35
+ export type NonEmptyObjectSchema = ObjectSchema & Readonly<Required<Pick<ObjectSchema, "properties">>>;
36
+ export type MapSchema = EmptyObjectSchema & Readonly<Required<Pick<ObjectSchema, "additionalProperties">>>;
35
37
  export type Schema = ReferenceSchema | RegularSchema;
36
38
  export declare function isReferenceSchema(schema: Schema): schema is ReferenceSchema;
37
39
  export declare function isAnyOfRuleComposedSchema(schema: Schema): schema is AnyOfRuleComposedSchema;
@@ -52,7 +54,9 @@ export declare function isStringSchema(schema: Schema): schema is StringSchema;
52
54
  export declare function isEnumSchema(schema: Schema): schema is EnumSchema;
53
55
  export declare function isEmptyObject(schema: Schema): schema is EmptyObjectSchema;
54
56
  export declare function isMapSchema(schema: Schema): schema is MapSchema;
57
+ export declare function simplifyFullyQualifiedName(name: string): string;
55
58
  export declare function convertReferenceSchemaToSpecifier({ $ref }: ReferenceSchema): string;
56
- export declare function convertReferenceSchemaToPath({ $ref }: ReferenceSchema): string;
57
- export declare function resolveReference(schemas: ReadonlyDeep<OpenAPIV3.ComponentsObject>['schemas'], { $ref }: ReferenceSchema): Schema | undefined;
58
- //# sourceMappingURL=Schema.d.ts.map
59
+ export declare function convertReferenceSchemaToFullyQualifiedName({ $ref }: ReferenceSchema): string;
60
+ export declare function convertFullyQualifiedNameToRelativePath(name: string): string;
61
+ export declare function convertReferenceSchemaToPath(schema: ReferenceSchema): string;
62
+ export declare function resolveReference(schemas: OpenAPIV3.ComponentsObject["schemas"], { $ref }: ReferenceSchema): Schema | undefined;
package/Schema.js CHANGED
@@ -1,109 +1,93 @@
1
- import { convertFullyQualifiedNameToRelativePath, simplifyFullyQualifiedName } from "./utils.js";
2
- function isReferenceSchema(schema) {
3
- return "$ref" in schema;
1
+ export function isReferenceSchema(schema) {
2
+ return "$ref" in schema;
4
3
  }
5
- function isAnyOfRuleComposedSchema(schema) {
6
- return "anyOf" in schema;
4
+ export function isAnyOfRuleComposedSchema(schema) {
5
+ return "anyOf" in schema;
7
6
  }
8
- function isAllOfRuleComposedSchema(schema) {
9
- return "allOf" in schema;
7
+ export function isAllOfRuleComposedSchema(schema) {
8
+ return "allOf" in schema;
10
9
  }
11
- function isOneOfRuleComposedSchema(schema) {
12
- return "oneOf" in schema;
10
+ export function isOneOfRuleComposedSchema(schema) {
11
+ return "oneOf" in schema;
13
12
  }
14
- function isNotRuleComposedSchema(schema) {
15
- return "not" in schema;
13
+ export function isNotRuleComposedSchema(schema) {
14
+ return "not" in schema;
16
15
  }
17
- function isComposedSchema(schema) {
18
- return isAnyOfRuleComposedSchema(schema) || isAllOfRuleComposedSchema(schema) || isOneOfRuleComposedSchema(schema) || isNotRuleComposedSchema(schema);
16
+ export function isComposedSchema(schema) {
17
+ return isAnyOfRuleComposedSchema(schema) || isAllOfRuleComposedSchema(schema) || isOneOfRuleComposedSchema(schema) || isNotRuleComposedSchema(schema);
19
18
  }
20
- function isNonComposedSchema(schema) {
21
- return !isComposedSchema(schema);
19
+ export function isNonComposedSchema(schema) {
20
+ return !isComposedSchema(schema);
22
21
  }
23
- function isNonComposedRegularSchema(schema) {
24
- return isNonComposedSchema(schema) && !isReferenceSchema(schema);
22
+ export function isNonComposedRegularSchema(schema) {
23
+ return isNonComposedSchema(schema) && !isReferenceSchema(schema);
25
24
  }
26
- function isNullableSchema(schema) {
27
- return !isReferenceSchema(schema) && !!schema.nullable;
25
+ export function isNullableSchema(schema) {
26
+ return !isReferenceSchema(schema) && !!schema.nullable;
28
27
  }
29
- function decomposeSchema(schema) {
30
- if (isAnyOfRuleComposedSchema(schema)) {
31
- return schema.anyOf;
32
- }
33
- if (isAllOfRuleComposedSchema(schema)) {
34
- return schema.allOf;
35
- }
36
- if (isOneOfRuleComposedSchema(schema)) {
37
- return schema.oneOf;
38
- }
39
- return [schema.not];
28
+ export function decomposeSchema(schema) {
29
+ if (isAnyOfRuleComposedSchema(schema)) {
30
+ return schema.anyOf;
31
+ }
32
+ if (isAllOfRuleComposedSchema(schema)) {
33
+ return schema.allOf;
34
+ }
35
+ if (isOneOfRuleComposedSchema(schema)) {
36
+ return schema.oneOf;
37
+ }
38
+ return [schema.not];
40
39
  }
41
- function isArraySchema(schema) {
42
- return isNonComposedRegularSchema(schema) && schema.type === "array";
40
+ export function isArraySchema(schema) {
41
+ return isNonComposedRegularSchema(schema) && schema.type === "array";
43
42
  }
44
- function isBooleanSchema(schema) {
45
- return isNonComposedRegularSchema(schema) && schema.type === "boolean";
43
+ export function isBooleanSchema(schema) {
44
+ return isNonComposedRegularSchema(schema) && schema.type === "boolean";
46
45
  }
47
- function isIntegerSchema(schema) {
48
- return isNonComposedRegularSchema(schema) && schema.type === "integer";
46
+ export function isIntegerSchema(schema) {
47
+ return isNonComposedRegularSchema(schema) && schema.type === "integer";
49
48
  }
50
- function isNumberSchema(schema) {
51
- return isNonComposedRegularSchema(schema) && schema.type === "number";
49
+ export function isNumberSchema(schema) {
50
+ return isNonComposedRegularSchema(schema) && schema.type === "number";
52
51
  }
53
- function isObjectSchema(schema) {
54
- return isNonComposedRegularSchema(schema) && schema.type === "object";
52
+ export function isObjectSchema(schema) {
53
+ return isNonComposedRegularSchema(schema) && schema.type === "object";
55
54
  }
56
- function isStringSchema(schema) {
57
- return isNonComposedRegularSchema(schema) && schema.type === "string";
55
+ export function isStringSchema(schema) {
56
+ return isNonComposedRegularSchema(schema) && schema.type === "string";
58
57
  }
59
- function isEnumSchema(schema) {
60
- return isStringSchema(schema) && !!schema.enum;
58
+ export function isEnumSchema(schema) {
59
+ return isStringSchema(schema) && !!schema.enum;
61
60
  }
62
- function isEmptyObject(schema) {
63
- return isObjectSchema(schema) && !schema.properties;
61
+ export function isEmptyObject(schema) {
62
+ return isObjectSchema(schema) && !schema.properties;
64
63
  }
65
- function isMapSchema(schema) {
66
- return isEmptyObject(schema) && !!schema.additionalProperties;
64
+ export function isMapSchema(schema) {
65
+ return isEmptyObject(schema) && !!schema.additionalProperties;
67
66
  }
68
- function convertReferenceSchemaToSpecifier({ $ref }) {
69
- return simplifyFullyQualifiedName($ref);
67
+ export function simplifyFullyQualifiedName(name) {
68
+ return name.substring(name.lastIndexOf(name.includes("$") ? "$" : ".") + 1, name.length);
69
+ }
70
+ export function convertReferenceSchemaToSpecifier({ $ref }) {
71
+ return simplifyFullyQualifiedName($ref);
70
72
  }
71
73
  const COMPONENTS_SCHEMAS_REF_LENGTH = "#/components/schemas/".length;
72
- function convertReferenceSchemaToPath({ $ref }) {
73
- return convertFullyQualifiedNameToRelativePath($ref.substring(COMPONENTS_SCHEMAS_REF_LENGTH));
74
- }
75
- function resolveReference(schemas, { $ref }) {
76
- if (schemas) {
77
- for (const [name, schema] of Object.entries(schemas)) {
78
- if ($ref.includes(name)) {
79
- return schema;
80
- }
81
- }
82
- }
83
- return void 0;
84
- }
85
- export {
86
- convertReferenceSchemaToPath,
87
- convertReferenceSchemaToSpecifier,
88
- decomposeSchema,
89
- isAllOfRuleComposedSchema,
90
- isAnyOfRuleComposedSchema,
91
- isArraySchema,
92
- isBooleanSchema,
93
- isComposedSchema,
94
- isEmptyObject,
95
- isEnumSchema,
96
- isIntegerSchema,
97
- isMapSchema,
98
- isNonComposedRegularSchema,
99
- isNonComposedSchema,
100
- isNotRuleComposedSchema,
101
- isNullableSchema,
102
- isNumberSchema,
103
- isObjectSchema,
104
- isOneOfRuleComposedSchema,
105
- isReferenceSchema,
106
- isStringSchema,
107
- resolveReference
108
- };
109
- //# sourceMappingURL=Schema.js.map
74
+ export function convertReferenceSchemaToFullyQualifiedName({ $ref }) {
75
+ return $ref.substring(COMPONENTS_SCHEMAS_REF_LENGTH);
76
+ }
77
+ export function convertFullyQualifiedNameToRelativePath(name) {
78
+ return name.replace(/[$.]/gu, "/");
79
+ }
80
+ export function convertReferenceSchemaToPath(schema) {
81
+ return convertFullyQualifiedNameToRelativePath(convertReferenceSchemaToFullyQualifiedName(schema));
82
+ }
83
+ export function resolveReference(schemas, { $ref }) {
84
+ if (schemas) {
85
+ for (const [name, schema] of Object.entries(schemas)) {
86
+ if ($ref.includes(name)) {
87
+ return schema;
88
+ }
89
+ }
90
+ }
91
+ return undefined;
92
+ }
93
+ //# sourceMappingURL=./Schema.js.map
package/Schema.js.map CHANGED
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["src/Schema.ts"],
4
- "sourcesContent": ["import type { OpenAPIV3 } from 'openapi-types';\nimport type { ReadonlyDeep } from 'type-fest';\nimport { convertFullyQualifiedNameToRelativePath, simplifyFullyQualifiedName, type Nullified } from './utils.js';\n\nexport type ReferenceSchema = ReadonlyDeep<OpenAPIV3.ReferenceObject>;\nexport type ArraySchema = ReadonlyDeep<OpenAPIV3.ArraySchemaObject>;\nexport type NonArraySchema = ReadonlyDeep<OpenAPIV3.NonArraySchemaObject>;\nexport type RegularSchema = ArraySchema | NonArraySchema;\n\nexport type NullableSchema = Readonly<Required<Pick<RegularSchema, 'nullable'>>> & RegularSchema;\n\nexport type AnyOfRuleComposedSchema = Readonly<Required<Pick<RegularSchema, 'anyOf'>>> & RegularSchema;\nexport type AllOfRuleComposedSchema = Readonly<Required<Pick<RegularSchema, 'allOf'>>> & RegularSchema;\nexport type OneOfRuleComposedSchema = Readonly<Required<Pick<RegularSchema, 'oneOf'>>> & RegularSchema;\nexport type NotRuleComposedSchema = Readonly<Required<Pick<RegularSchema, 'not'>>> & RegularSchema;\nexport type ComposedSchema =\n | AllOfRuleComposedSchema\n | AnyOfRuleComposedSchema\n | NotRuleComposedSchema\n | OneOfRuleComposedSchema;\n\nexport type NonComposedRegularSchema = Readonly<Nullified<RegularSchema, 'allOf' | 'anyOf' | 'oneOf'>> & RegularSchema;\nexport type NonComposedSchema = NonComposedRegularSchema | ReferenceSchema;\n\nexport type BooleanSchema = NonComposedRegularSchema & Readonly<{ type: 'boolean' }>;\nexport type IntegerSchema = NonComposedRegularSchema & Readonly<{ type: 'integer' }>;\nexport type NumberSchema = NonComposedRegularSchema & Readonly<{ type: 'number' }>;\nexport type ObjectSchema = NonComposedRegularSchema & Readonly<{ type: 'object' }>;\nexport type StringSchema = NonComposedRegularSchema & Readonly<{ type: 'string' }>;\n\nexport type EnumSchema = Readonly<Required<Pick<StringSchema, 'enum'>>> & StringSchema;\nexport type EmptyObjectSchema = ObjectSchema & Readonly<Nullified<ObjectSchema, 'properties'>>;\nexport type NonEmptyObjectSchema = ObjectSchema & Readonly<Required<Pick<ObjectSchema, 'properties'>>>;\nexport type MapSchema = EmptyObjectSchema & Readonly<Required<Pick<ObjectSchema, 'additionalProperties'>>>;\n\nexport type Schema = ReferenceSchema | RegularSchema;\n\nexport function isReferenceSchema(schema: Schema): schema is ReferenceSchema {\n return '$ref' in schema;\n}\n\nexport function isAnyOfRuleComposedSchema(schema: Schema): schema is AnyOfRuleComposedSchema {\n return 'anyOf' in schema;\n}\n\nexport function isAllOfRuleComposedSchema(schema: Schema): schema is AllOfRuleComposedSchema {\n return 'allOf' in schema;\n}\n\nexport function isOneOfRuleComposedSchema(schema: Schema): schema is OneOfRuleComposedSchema {\n return 'oneOf' in schema;\n}\n\nexport function isNotRuleComposedSchema(schema: Schema): schema is NotRuleComposedSchema {\n return 'not' in schema;\n}\n\nexport function isComposedSchema(schema: Schema): schema is ComposedSchema {\n return (\n isAnyOfRuleComposedSchema(schema) ||\n isAllOfRuleComposedSchema(schema) ||\n isOneOfRuleComposedSchema(schema) ||\n isNotRuleComposedSchema(schema)\n );\n}\n\nexport function isNonComposedSchema(schema: Schema): schema is NonComposedSchema {\n return !isComposedSchema(schema);\n}\n\nexport function isNonComposedRegularSchema(schema: Schema): schema is NonComposedRegularSchema {\n return isNonComposedSchema(schema) && !isReferenceSchema(schema);\n}\n\nexport function isNullableSchema(schema: Schema): schema is NullableSchema {\n return !isReferenceSchema(schema) && !!schema.nullable;\n}\n\nexport function decomposeSchema(schema: ComposedSchema): readonly Schema[] {\n if (isAnyOfRuleComposedSchema(schema)) {\n return schema.anyOf;\n }\n\n if (isAllOfRuleComposedSchema(schema)) {\n return schema.allOf;\n }\n\n if (isOneOfRuleComposedSchema(schema)) {\n return schema.oneOf;\n }\n\n return [schema.not];\n}\n\nexport function isArraySchema(schema: Schema): schema is ArraySchema {\n return isNonComposedRegularSchema(schema) && schema.type === 'array';\n}\n\nexport function isBooleanSchema(schema: Schema): schema is BooleanSchema {\n return isNonComposedRegularSchema(schema) && schema.type === 'boolean';\n}\n\nexport function isIntegerSchema(schema: Schema): schema is IntegerSchema {\n return isNonComposedRegularSchema(schema) && schema.type === 'integer';\n}\n\nexport function isNumberSchema(schema: Schema): schema is NumberSchema {\n return isNonComposedRegularSchema(schema) && schema.type === 'number';\n}\n\nexport function isObjectSchema(schema: Schema): schema is ObjectSchema {\n return isNonComposedRegularSchema(schema) && schema.type === 'object';\n}\n\nexport function isStringSchema(schema: Schema): schema is StringSchema {\n return isNonComposedRegularSchema(schema) && schema.type === 'string';\n}\n\nexport function isEnumSchema(schema: Schema): schema is EnumSchema {\n return isStringSchema(schema) && !!schema.enum;\n}\n\nexport function isEmptyObject(schema: Schema): schema is EmptyObjectSchema {\n return isObjectSchema(schema) && !schema.properties;\n}\n\nexport function isMapSchema(schema: Schema): schema is MapSchema {\n return isEmptyObject(schema) && !!schema.additionalProperties;\n}\n\nexport function convertReferenceSchemaToSpecifier({ $ref }: ReferenceSchema): string {\n return simplifyFullyQualifiedName($ref);\n}\n\nconst COMPONENTS_SCHEMAS_REF_LENGTH = '#/components/schemas/'.length;\n\nexport function convertReferenceSchemaToPath({ $ref }: ReferenceSchema): string {\n return convertFullyQualifiedNameToRelativePath($ref.substring(COMPONENTS_SCHEMAS_REF_LENGTH));\n}\n\nexport function resolveReference(\n schemas: ReadonlyDeep<OpenAPIV3.ComponentsObject>['schemas'],\n { $ref }: ReferenceSchema,\n): Schema | undefined {\n if (schemas) {\n for (const [name, schema] of Object.entries(schemas)) {\n if ($ref.includes(name)) {\n return schema;\n }\n }\n }\n\n return undefined;\n}\n"],
5
- "mappings": "AAEA,SAAS,yCAAyC,kCAAkD;AAmC7F,SAAS,kBAAkB,QAA2C;AAC3E,SAAO,UAAU;AACnB;AAEO,SAAS,0BAA0B,QAAmD;AAC3F,SAAO,WAAW;AACpB;AAEO,SAAS,0BAA0B,QAAmD;AAC3F,SAAO,WAAW;AACpB;AAEO,SAAS,0BAA0B,QAAmD;AAC3F,SAAO,WAAW;AACpB;AAEO,SAAS,wBAAwB,QAAiD;AACvF,SAAO,SAAS;AAClB;AAEO,SAAS,iBAAiB,QAA0C;AACzE,SACE,0BAA0B,MAAM,KAChC,0BAA0B,MAAM,KAChC,0BAA0B,MAAM,KAChC,wBAAwB,MAAM;AAElC;AAEO,SAAS,oBAAoB,QAA6C;AAC/E,SAAO,CAAC,iBAAiB,MAA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ED,OAAO,SAAS,iBACdC,SACA,EAAE,MAAuB,EACL;AACpB,KAAI,SAAS;AACX,OAAK,MAAM,CAAC,MAAM,OAAO,IAAI,OAAO,QAAQ,QAAQ,EAAE;AACpD,OAAI,KAAK,SAAS,KAAK,EAAE;AACvB,WAAO;GACR;EACF;CACF;AAED,QAAO;AACR","names":["schema: Schema","schema: ComposedSchema","name: string","schema: ReferenceSchema","schemas: OpenAPIV3.ComponentsObject['schemas']"],"sources":["/opt/agent/work/1af72d8adc613024/hilla/packages/ts/generator-core/src/Schema.ts"],"sourcesContent":["import type { OpenAPIV3 } from 'openapi-types';\n\nexport type Nullified<T, K extends keyof T> = T & Record<K, undefined>;\n\nexport type ReferenceSchema = OpenAPIV3.ReferenceObject;\nexport type ArraySchema = OpenAPIV3.ArraySchemaObject;\nexport type NonArraySchema = OpenAPIV3.NonArraySchemaObject;\nexport type RegularSchema = ArraySchema | NonArraySchema;\n\nexport type NullableSchema = Readonly<Required<Pick<RegularSchema, 'nullable'>>> & RegularSchema;\n\nexport type AnyOfRuleComposedSchema = Readonly<Required<Pick<RegularSchema, 'anyOf'>>> & RegularSchema;\nexport type AllOfRuleComposedSchema = Readonly<Required<Pick<RegularSchema, 'allOf'>>> & RegularSchema;\nexport type OneOfRuleComposedSchema = Readonly<Required<Pick<RegularSchema, 'oneOf'>>> & RegularSchema;\nexport type NotRuleComposedSchema = Readonly<Required<Pick<RegularSchema, 'not'>>> & RegularSchema;\nexport type ComposedSchema =\n | AllOfRuleComposedSchema\n | AnyOfRuleComposedSchema\n | NotRuleComposedSchema\n | OneOfRuleComposedSchema;\n\nexport type NonComposedRegularSchema = Readonly<Nullified<RegularSchema, 'allOf' | 'anyOf' | 'oneOf'>> & RegularSchema;\nexport type NonComposedSchema = NonComposedRegularSchema | ReferenceSchema;\n\nexport type BooleanSchema = NonComposedRegularSchema & Readonly<{ type: 'boolean' }>;\nexport type IntegerSchema = NonComposedRegularSchema & Readonly<{ type: 'integer' }>;\nexport type NumberSchema = NonComposedRegularSchema & Readonly<{ type: 'number' }>;\nexport type ObjectSchema = NonComposedRegularSchema & Readonly<{ type: 'object' }>;\nexport type StringSchema = NonComposedRegularSchema & Readonly<{ type: 'string' }>;\n\nexport type EnumSchema = Readonly<Required<Pick<StringSchema, 'enum'>>> & StringSchema;\nexport type EmptyObjectSchema = ObjectSchema & Readonly<Nullified<ObjectSchema, 'properties'>>;\nexport type NonEmptyObjectSchema = ObjectSchema & Readonly<Required<Pick<ObjectSchema, 'properties'>>>;\nexport type MapSchema = EmptyObjectSchema & Readonly<Required<Pick<ObjectSchema, 'additionalProperties'>>>;\n\nexport type Schema = ReferenceSchema | RegularSchema;\n\nexport function isReferenceSchema(schema: Schema): schema is ReferenceSchema {\n return '$ref' in schema;\n}\n\nexport function isAnyOfRuleComposedSchema(schema: Schema): schema is AnyOfRuleComposedSchema {\n return 'anyOf' in schema;\n}\n\nexport function isAllOfRuleComposedSchema(schema: Schema): schema is AllOfRuleComposedSchema {\n return 'allOf' in schema;\n}\n\nexport function isOneOfRuleComposedSchema(schema: Schema): schema is OneOfRuleComposedSchema {\n return 'oneOf' in schema;\n}\n\nexport function isNotRuleComposedSchema(schema: Schema): schema is NotRuleComposedSchema {\n return 'not' in schema;\n}\n\nexport function isComposedSchema(schema: Schema): schema is ComposedSchema {\n return (\n isAnyOfRuleComposedSchema(schema) ||\n isAllOfRuleComposedSchema(schema) ||\n isOneOfRuleComposedSchema(schema) ||\n isNotRuleComposedSchema(schema)\n );\n}\n\nexport function isNonComposedSchema(schema: Schema): schema is NonComposedSchema {\n return !isComposedSchema(schema);\n}\n\nexport function isNonComposedRegularSchema(schema: Schema): schema is NonComposedRegularSchema {\n return isNonComposedSchema(schema) && !isReferenceSchema(schema);\n}\n\nexport function isNullableSchema(schema: Schema): schema is NullableSchema {\n return !isReferenceSchema(schema) && !!schema.nullable;\n}\n\nexport function decomposeSchema(schema: ComposedSchema): readonly Schema[] {\n if (isAnyOfRuleComposedSchema(schema)) {\n return schema.anyOf;\n }\n\n if (isAllOfRuleComposedSchema(schema)) {\n return schema.allOf;\n }\n\n if (isOneOfRuleComposedSchema(schema)) {\n return schema.oneOf;\n }\n\n return [schema.not];\n}\n\nexport function isArraySchema(schema: Schema): schema is ArraySchema {\n return isNonComposedRegularSchema(schema) && schema.type === 'array';\n}\n\nexport function isBooleanSchema(schema: Schema): schema is BooleanSchema {\n return isNonComposedRegularSchema(schema) && schema.type === 'boolean';\n}\n\nexport function isIntegerSchema(schema: Schema): schema is IntegerSchema {\n return isNonComposedRegularSchema(schema) && schema.type === 'integer';\n}\n\nexport function isNumberSchema(schema: Schema): schema is NumberSchema {\n return isNonComposedRegularSchema(schema) && schema.type === 'number';\n}\n\nexport function isObjectSchema(schema: Schema): schema is ObjectSchema {\n return isNonComposedRegularSchema(schema) && schema.type === 'object';\n}\n\nexport function isStringSchema(schema: Schema): schema is StringSchema {\n return isNonComposedRegularSchema(schema) && schema.type === 'string';\n}\n\nexport function isEnumSchema(schema: Schema): schema is EnumSchema {\n return isStringSchema(schema) && !!schema.enum;\n}\n\nexport function isEmptyObject(schema: Schema): schema is EmptyObjectSchema {\n return isObjectSchema(schema) && !schema.properties;\n}\n\nexport function isMapSchema(schema: Schema): schema is MapSchema {\n return isEmptyObject(schema) && !!schema.additionalProperties;\n}\n\nexport function simplifyFullyQualifiedName(name: string): string {\n return name.substring(name.lastIndexOf(name.includes('$') ? '$' : '.') + 1, name.length);\n}\n\nexport function convertReferenceSchemaToSpecifier({ $ref }: ReferenceSchema): string {\n return simplifyFullyQualifiedName($ref);\n}\n\nconst COMPONENTS_SCHEMAS_REF_LENGTH = '#/components/schemas/'.length;\n\nexport function convertReferenceSchemaToFullyQualifiedName({ $ref }: ReferenceSchema): string {\n return $ref.substring(COMPONENTS_SCHEMAS_REF_LENGTH);\n}\n\nexport function convertFullyQualifiedNameToRelativePath(name: string): string {\n return name.replace(/[$.]/gu, '/');\n}\n\nexport function convertReferenceSchemaToPath(schema: ReferenceSchema): string {\n return convertFullyQualifiedNameToRelativePath(convertReferenceSchemaToFullyQualifiedName(schema));\n}\n\nexport function resolveReference(\n schemas: OpenAPIV3.ComponentsObject['schemas'],\n { $ref }: ReferenceSchema,\n): Schema | undefined {\n if (schemas) {\n for (const [name, schema] of Object.entries(schemas)) {\n if ($ref.includes(name)) {\n return schema;\n }\n }\n }\n\n return undefined;\n}\n"],"version":3}
@@ -1,14 +1,13 @@
1
- import type { $Refs } from '@apidevtools/swagger-parser';
2
- import type { OpenAPIV3 } from 'openapi-types';
3
- import type { ReadonlyDeep } from 'type-fest';
4
- import type { SourceFile } from 'typescript';
5
-
6
- type SharedStorage = Readonly<{
7
- api: ReadonlyDeep<OpenAPIV3.Document>;
8
- apiRefs: $Refs;
9
- sources: SourceFile[];
10
- pluginStorage: Map<string, unknown>;
11
- outputDir?: string;
1
+ import type { $Refs } from "@apidevtools/swagger-parser";
2
+ import type { OpenAPIV3 } from "openapi-types";
3
+ import type { SourceFile, TypeNode } from "typescript";
4
+ export type TransferTypeMaker = (typeArguments: readonly TypeNode[] | undefined) => TypeNode;
5
+ export type TransferTypes = Map<string, TransferTypeMaker>;
6
+ export type SharedStorage = Readonly<{
7
+ api: OpenAPIV3.Document
8
+ apiRefs: $Refs
9
+ outputDir?: string
10
+ pluginStorage: Map<string, unknown>
11
+ sources: SourceFile[]
12
+ transferTypes: TransferTypes
12
13
  }>;
13
-
14
- export default SharedStorage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/hilla-generator-core",
3
- "version": "24.7.0-alpha9",
3
+ "version": "24.8.0-alpha1",
4
4
  "description": "A Hilla tool to generate TypeScript code from the OpenAPI document",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -9,14 +9,12 @@
9
9
  },
10
10
  "scripts": {
11
11
  "clean:build": "git clean -fx . -e .vite -e node_modules",
12
- "build": "concurrently npm:build:*",
13
- "build:esbuild": "tsx ../../../scripts/build.ts",
14
- "build:dts": "tsc --isolatedModules -p tsconfig.build.json",
15
- "build:copy": "cd src && copyfiles **/*.d.ts ..",
12
+ "build": "tsx ../../../scripts/fast-build.ts",
16
13
  "lint": "eslint src test",
17
14
  "lint:fix": "eslint src test --fix",
18
- "test": "mocha test/**/*.spec.ts --config ../../../.mocharc.cjs",
19
- "test:coverage": "c8 --experimental-monocart -c ../../../.c8rc.json npm test",
15
+ "test": "vitest --run",
16
+ "test:coverage": "vitest --run --coverage",
17
+ "test:watch": "vitest",
20
18
  "typecheck": "tsc --noEmit"
21
19
  },
22
20
  "exports": {
@@ -43,9 +41,6 @@
43
41
  },
44
42
  "./SharedStorage.js": {
45
43
  "types": "./SharedStorage.d.ts"
46
- },
47
- "./utils.js": {
48
- "default": "./utils.js"
49
44
  }
50
45
  },
51
46
  "repository": {
@@ -71,26 +66,10 @@
71
66
  "access": "public"
72
67
  },
73
68
  "dependencies": {
74
- "@apidevtools/swagger-parser": "^10.1.1",
75
- "@vaadin/hilla-generator-utils": "24.7.0-alpha9",
76
- "meow": "^13.2.0",
77
- "openapi-types": "^12.1.3",
69
+ "@apidevtools/swagger-parser": "10.1.1",
70
+ "@vaadin/hilla-generator-utils": "24.8.0-alpha1",
71
+ "meow": "13.2.0",
72
+ "openapi-types": "12.1.3",
78
73
  "typescript": "5.7.3"
79
- },
80
- "devDependencies": {
81
- "@types/chai": "^4.3.20",
82
- "@types/mocha": "^10.0.10",
83
- "@types/node": "^20.17.12",
84
- "@types/sinon": "^10.0.20",
85
- "@types/sinon-chai": "^3.2.12",
86
- "c8": "^10.1.3",
87
- "chai": "^4.5.0",
88
- "concurrently": "^9.1.2",
89
- "copyfiles": "^2.4.1",
90
- "mocha": "^11.1.0",
91
- "monocart-coverage-reports": "^2.11.5",
92
- "sinon": "^16.1.3",
93
- "sinon-chai": "^3.7.0",
94
- "type-fest": "^4.32.0"
95
74
  }
96
75
  }
package/File.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { Blob, type BlobOptions } from 'node:buffer';
2
- import type { BinaryLike } from 'node:crypto';
3
- export type FileOptions = Readonly<BlobOptions & {
4
- lastModified?: number;
5
- }>;
6
- export default class File extends Blob {
7
- #private;
8
- constructor(fileBits: Array<BinaryLike | Blob>, fileName: string, options?: FileOptions);
9
- get name(): string;
10
- }
11
- //# sourceMappingURL=File.d.ts.map
package/File.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"File.d.ts","sourceRoot":"","sources":["src/File.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,QAAQ,CAChC,WAAW,GAAG;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CACF,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,IAAI;;gBAGxB,QAAQ,EAAE,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW;IAKvF,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
package/File.js DELETED
@@ -1,15 +0,0 @@
1
- import { Blob } from "node:buffer";
2
- class File extends Blob {
3
- #name;
4
- constructor(fileBits, fileName, options) {
5
- super(fileBits, options);
6
- this.#name = fileName;
7
- }
8
- get name() {
9
- return this.#name;
10
- }
11
- }
12
- export {
13
- File as default
14
- };
15
- //# sourceMappingURL=File.js.map
package/File.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["src/File.ts"],
4
- "sourcesContent": ["import { Blob, type BlobOptions } from 'node:buffer';\nimport type { BinaryLike } from 'node:crypto';\n\nexport type FileOptions = Readonly<\n BlobOptions & {\n lastModified?: number;\n }\n>;\n\nexport default class File extends Blob {\n readonly #name: string;\n\n constructor(fileBits: Array<BinaryLike | Blob>, fileName: string, options?: FileOptions) {\n super(fileBits, options);\n this.#name = fileName;\n }\n\n get name(): string {\n return this.#name;\n }\n}\n"],
5
- "mappings": "AAAA,SAAS,YAA8B;AASvC,MAAO,aAA2B,KAAK;AAAA,EAC5B;AAAA,EAET,YAAY,UAAoC,UAAkB,SAAuB;AACvF,UAAM,UAAU,OAAO;AACvB,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,IAAI,OAAe;AACjB,WAAO,KAAK;AAAA,EACd;AACF;",
6
- "names": []
7
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"Generator.d.ts","sourceRoot":"","sources":["src/Generator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,aAAa,MAAM,gDAAgD,CAAC;AAIhF,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAKrD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,OAAO,SAAS;;gBAMhB,OAAO,EAAE,SAAS,iBAAiB,EAAE,EAAE,OAAO,EAAE,gBAAgB;IAOtE,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;CAoBvD"}
package/Plugin.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,gDAAgD,CAAC;AAChF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,MAAM;IAClC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,QAAQ,EAAE,iBAAiB,EAAE,MAAM,EAAE,aAAa;IAK9D,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAC;IAE5B,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CACxD;AAED,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,MAAM,EAAE,qBAAqB,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PluginManager.d.ts","sourceRoot":"","sources":["src/PluginManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,gDAAgD,CAAC;AAEhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,aAAa;;gBAGpB,OAAO,EAAE,SAAS,iBAAiB,EAAE,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,EAAE,aAAa;IAiB/F,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CASrD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReferenceResolver.d.ts","sourceRoot":"","sources":["src/ReferenceResolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,CAAC,OAAO,OAAO,iBAAiB;;gBAGxB,MAAM,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gB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY,CAErE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY,CAErE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY,CAErE;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,UAAU,CAEjE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,iBAAiB,CAEzE;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,SAAS,CAE/D;AAED,wBAAgB,iCAAiC,CAAC,EAAE,IAAI,EAAE,EAAE,eAAe,GAAG,MAAM,CAEnF;AAID,wBAAgB,4BAA4B,CAAC,EAAE,IAAI,EAAE,EAAE,eAAe,GAAG,MAAM,CAE9E;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,EAC5D,EAAE,IAAI,EAAE,EAAE,eAAe,GACxB,MAAM,GAAG,SAAS,CAUpB"}
package/utils.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export type Nullified<T, K extends keyof T> = T & {
2
- [P in K]: undefined;
3
- };
4
- export declare function simplifyFullyQualifiedName(name: string): string;
5
- export declare function convertFullyQualifiedNameToRelativePath(name: string): string;
6
- //# sourceMappingURL=utils.d.ts.map
package/utils.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG;KAAG,CAAC,IAAI,CAAC,GAAG,SAAS;CAAE,CAAC;AAE1E,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/D;AAID,wBAAgB,uCAAuC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5E"}
package/utils.js DELETED
@@ -1,12 +0,0 @@
1
- function simplifyFullyQualifiedName(name) {
2
- return name.substring(name.lastIndexOf(name.includes("$") ? "$" : ".") + 1, name.length);
3
- }
4
- const QUALIFIED_NAME_DELIMITER = /[$.]/gu;
5
- function convertFullyQualifiedNameToRelativePath(name) {
6
- return name.replace(QUALIFIED_NAME_DELIMITER, "/");
7
- }
8
- export {
9
- convertFullyQualifiedNameToRelativePath,
10
- simplifyFullyQualifiedName
11
- };
12
- //# sourceMappingURL=utils.js.map
package/utils.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["src/utils.ts"],
4
- "sourcesContent": ["export type Nullified<T, K extends keyof T> = T & { [P in K]: undefined };\n\nexport function simplifyFullyQualifiedName(name: string): string {\n return name.substring(name.lastIndexOf(name.includes('$') ? '$' : '.') + 1, name.length);\n}\n\nconst QUALIFIED_NAME_DELIMITER = /[$.]/gu;\n\nexport function convertFullyQualifiedNameToRelativePath(name: string): string {\n return name.replace(QUALIFIED_NAME_DELIMITER, '/');\n}\n"],
5
- "mappings": "AAEO,SAAS,2BAA2B,MAAsB;AAC/D,SAAO,KAAK,UAAU,KAAK,YAAY,KAAK,SAAS,GAAG,IAAI,MAAM,GAAG,IAAI,GAAG,KAAK,MAAM;AACzF;AAEA,MAAM,2BAA2B;AAE1B,SAAS,wCAAwC,MAAsB;AAC5E,SAAO,KAAK,QAAQ,0BAA0B,GAAG;AACnD;",
6
- "names": []
7
- }