@vaadin/hilla-generator-cli 24.6.5 → 24.7.0-alpha11

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/GeneratorIO.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type File from '@vaadin/hilla-generator-core/File.js';
2
1
  import { type PluginConstructor } from '@vaadin/hilla-generator-core/Plugin.js';
3
2
  import type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';
4
3
  export default class GeneratorIO {
@@ -1 +1 @@
1
- {"version":3,"file":"GeneratorIO.d.ts","sourceRoot":"","sources":["src/GeneratorIO.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,IAAI,MAAM,sCAAsC,CAAC;AAC7D,OAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,KAAK,aAAa,MAAM,gDAAgD,CAAC;AAShF,MAAM,CAAC,OAAO,OAAO,WAAW;;IAC9B,MAAM,CAAC,QAAQ,CAAC,cAAc,6BAA6B;IACnD,CAAC,aAAa,CAAC,EAAE,OAAO,WAAW,CAAC;IAC5C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBAIT,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa;IAQpD;;;OAGG;IACG,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAiB/C;;;;OAIG;IACG,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAyB1F,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD,mBAAmB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAuBpE;;;OAGG;WAEU,MAAM,CAAC,IAAI,EAAE,MAAM,G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AAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAYhE,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIxC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKnC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAO9D"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["src/GeneratorIO.ts"],
4
- "sourcesContent": ["import { constants } from 'node:fs';\nimport { access, mkdir, readFile, rm, writeFile } from 'node:fs/promises';\nimport { createRequire } from 'node:module';\nimport { dirname, isAbsolute, join, resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport type File from '@vaadin/hilla-generator-core/File.js';\nimport Plugin, { type PluginConstructor } from '@vaadin/hilla-generator-core/Plugin.js';\nimport type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';\nimport GeneratorIOException from './GeneratorIOException.js';\n\nconst require = createRequire(import.meta.url);\n\ntype PluginConstructorModule = Readonly<{\n default: PluginConstructor;\n}>;\n\nexport default class GeneratorIO {\n static readonly INDEX_FILENAME = 'generated-file-list.txt';\n declare ['constructor']: typeof GeneratorIO;\n readonly cwd: string;\n readonly #logger: LoggerFactory;\n readonly #outputDir: string;\n\n constructor(outputDir: string, logger: LoggerFactory) {\n this.cwd = process.cwd();\n this.#outputDir = isAbsolute(outputDir) ? outputDir : resolve(this.cwd, outputDir);\n this.#logger = logger;\n\n logger.global.debug(`Output directory: ${this.#outputDir}`);\n }\n\n /**\n * Gets the list of files generated the last time. The info is found in {@link INDEX_FILENAME}.\n * @returns a list of files that have been generated by us\n */\n async getGeneratedFiles(): Promise<Set<string>> {\n const files = new Set<string>();\n try {\n const indexFileContents = await this.read(this.resolveGeneratedFile(this.constructor.INDEX_FILENAME));\n indexFileContents\n .split('\\n')\n .filter((n) => n.length)\n .forEach((fileName) => files.add(fileName));\n } catch (e) {\n // non-existing file is OK, all other errors must be rethrown\n if (!(e instanceof Error && 'code' in e && e.code === 'ENOENT')) {\n throw e;\n }\n }\n return files;\n }\n\n /**\n * Cleans the output directory by keeping the generated files and deleting the rest of the given files.\n *\n * @returns a set containing deleted filenames\n */\n async cleanOutputDir(generatedFiles: string[], filesToDelete: Set<string>): Promise<Set<string>> {\n this.#logger.global.debug(`Cleaning ${this.#outputDir}`);\n await mkdir(this.#outputDir, { recursive: true });\n\n generatedFiles.forEach((filename) => {\n this.#logger.global.debug(`File ${filename} was re-written, should not delete it`);\n filesToDelete.delete(filename);\n });\n\n const deletedFiles = new Set(\n await Promise.all(\n [...filesToDelete].map(async (filename) => {\n const resolved = this.resolveGeneratedFile(filename);\n if (await GeneratorIO.exists(resolved)) {\n this.#logger.global.debug(`Deleting file ${filename}.`);\n await rm(resolved);\n }\n return filename;\n }),\n ),\n );\n\n return deletedFiles;\n }\n\n async createFileIndex(filenames: string[]): Promise<void> {\n await this.write(this.constructor.INDEX_FILENAME, filenames.join('\\n'));\n }\n\n async writeGeneratedFiles(files: readonly File[]): Promise<string[]> {\n await this.createFileIndex(files.map((file) => file.name));\n this.#logger.global.debug(`created index`);\n\n return Promise.all(\n files.map(async (file) => {\n const newFileContent = await file.text();\n let oldFileContent;\n try {\n oldFileContent = await this.read(this.resolveGeneratedFile(file.name));\n } catch (_e) {}\n\n if (newFileContent !== oldFileContent) {\n this.#logger.global.debug(`writing file ${file.name}`);\n await this.write(file.name, await file.text());\n } else {\n this.#logger.global.debug(`File ${file.name} stayed the same`);\n }\n return file.name;\n }),\n );\n }\n\n /**\n * Checks that a file exists (is visible)\n * @param path - the file path to check\n */\n // eslint-disable-next-line class-methods-use-this\n static async exists(path: string): Promise<boolean> {\n try {\n await access(path, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n }\n\n async loadPlugin(modulePath: string): Promise<PluginConstructor> {\n this.#logger.global.debug(`Loading plugin: ${modulePath}`);\n const module: PluginConstructorModule = await import(pathToFileURL(require.resolve(modulePath)).toString());\n const ctr: PluginConstructor = module.default;\n\n if (!Object.prototype.isPrototypeOf.call(Plugin, ctr)) {\n throw new GeneratorIOException(`Plugin '${modulePath}' is not an instance of a Plugin class`);\n }\n\n return ctr;\n }\n\n resolveGeneratedFile(filename: string): string {\n return resolve(this.#outputDir, filename);\n }\n\n async read(path: string): Promise<string> {\n this.#logger.global.debug(`Reading file: ${path}`);\n return readFile(path, 'utf8');\n }\n\n async write(filename: string, content: string): Promise<void> {\n const filePath = join(this.#outputDir, filename);\n this.#logger.global.debug(`Writing file ${filePath}.`);\n const dir = dirname(filePath);\n await mkdir(dir, { recursive: true });\n return writeFile(filePath, content, 'utf-8');\n }\n}\n"],
5
- "mappings": "AAAA,SAAS,iBAAiB;AAC1B,SAAS,QAAQ,OAAO,UAAU,IAAI,iBAAiB;AACvD,SAAS,qBAAqB;AAC9B,SAAS,SAAS,YAAY,MAAM,eAAe;AACnD,SAAS,qBAAqB;AAE9B,OAAO,gBAAwC;AAE/C,OAAO,0BAA0B;AAEjC,MAAMA,WAAU,cAAc,YAAY,GAAG;AAM7C,MAAO,YAA0B;AAAA,EAC/B,OAAgB,iBAAiB;AAAA,EAExB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,WAAmB,QAAuB;AACpD,SAAK,MAAM,QAAQ,IAAI;AACvB,SAAK,aAAa,WAAW,SAAS,IAAI,YAAY,QAAQ,KAAK,KAAK,SAAS;AACjF,SAAK,UAAU;AAEf,WAAO,OAAO,MAAM,qBAAqB,KAAK,UAAU,EAAE;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,oBAA0C;AAC9C,UAAM,QAAQ,oBAAI,IAAY;AAC9B,QAAI;AACF,YAAM,oBAAoB,MAAM,KAAK,KAAK,KAAK,qBAAqB,KAAK,YAAY,cAAc,CAAC;AACpG,wBACG,MAAM,IAAI,EACV,OAAO,CAAC,MAAM,EAAE,MAAM,EACtB,QA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ACrD,UAAM,MAAM,QAAQ,QAAQ;AAC5B,UAAM,MAAM,KAAK,EAAE,WAAW,KAAK,CAAC;AACpC,WAAO,UAAU,UAAU,SAAS,OAAO;AAAA,EAC7C;AACF;",
4
+ "sourcesContent": ["import { constants } from 'node:fs';\nimport { access, mkdir, readFile, rm, writeFile } from 'node:fs/promises';\nimport { createRequire } from 'node:module';\nimport { dirname, isAbsolute, join, resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport Plugin, { type PluginConstructor } from '@vaadin/hilla-generator-core/Plugin.js';\nimport type LoggerFactory from '@vaadin/hilla-generator-utils/LoggerFactory.js';\nimport GeneratorIOException from './GeneratorIOException.js';\n\nconst require = createRequire(import.meta.url);\n\ntype PluginConstructorModule = Readonly<{\n default: PluginConstructor;\n}>;\n\nexport default class GeneratorIO {\n static readonly INDEX_FILENAME = 'generated-file-list.txt';\n declare ['constructor']: typeof GeneratorIO;\n readonly cwd: string;\n readonly #logger: LoggerFactory;\n readonly #outputDir: string;\n\n constructor(outputDir: string, logger: LoggerFactory) {\n this.cwd = process.cwd();\n this.#outputDir = isAbsolute(outputDir) ? outputDir : resolve(this.cwd, outputDir);\n this.#logger = logger;\n\n logger.global.debug(`Output directory: ${this.#outputDir}`);\n }\n\n /**\n * Gets the list of files generated the last time. The info is found in {@link INDEX_FILENAME}.\n * @returns a list of files that have been generated by us\n */\n async getGeneratedFiles(): Promise<Set<string>> {\n const files = new Set<string>();\n try {\n const indexFileContents = await this.read(this.resolveGeneratedFile(this.constructor.INDEX_FILENAME));\n indexFileContents\n .split('\\n')\n .filter((n) => n.length)\n .forEach((fileName) => files.add(fileName));\n } catch (e) {\n // non-existing file is OK, all other errors must be rethrown\n if (!(e instanceof Error && 'code' in e && e.code === 'ENOENT')) {\n throw e;\n }\n }\n return files;\n }\n\n /**\n * Cleans the output directory by keeping the generated files and deleting the rest of the given files.\n *\n * @returns a set containing deleted filenames\n */\n async cleanOutputDir(generatedFiles: string[], filesToDelete: Set<string>): Promise<Set<string>> {\n this.#logger.global.debug(`Cleaning ${this.#outputDir}`);\n await mkdir(this.#outputDir, { recursive: true });\n\n generatedFiles.forEach((filename) => {\n this.#logger.global.debug(`File ${filename} was re-written, should not delete it`);\n filesToDelete.delete(filename);\n });\n\n const deletedFiles = new Set(\n await Promise.all(\n [...filesToDelete].map(async (filename) => {\n const resolved = this.resolveGeneratedFile(filename);\n if (await GeneratorIO.exists(resolved)) {\n this.#logger.global.debug(`Deleting file ${filename}.`);\n await rm(resolved);\n }\n return filename;\n }),\n ),\n );\n\n return deletedFiles;\n }\n\n async createFileIndex(filenames: string[]): Promise<void> {\n await this.write(this.constructor.INDEX_FILENAME, filenames.join('\\n'));\n }\n\n async writeGeneratedFiles(files: readonly File[]): Promise<string[]> {\n await this.createFileIndex(files.map((file) => file.name));\n this.#logger.global.debug(`created index`);\n\n return Promise.all(\n files.map(async (file) => {\n const newFileContent = await file.text();\n let oldFileContent;\n try {\n oldFileContent = await this.read(this.resolveGeneratedFile(file.name));\n } catch (_e) {}\n\n if (newFileContent !== oldFileContent) {\n this.#logger.global.debug(`writing file ${file.name}`);\n await this.write(file.name, await file.text());\n } else {\n this.#logger.global.debug(`File ${file.name} stayed the same`);\n }\n return file.name;\n }),\n );\n }\n\n /**\n * Checks that a file exists (is visible)\n * @param path - the file path to check\n */\n // eslint-disable-next-line class-methods-use-this\n static async exists(path: string): Promise<boolean> {\n try {\n await access(path, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n }\n\n async loadPlugin(modulePath: string): Promise<PluginConstructor> {\n this.#logger.global.debug(`Loading plugin: ${modulePath}`);\n const module: PluginConstructorModule = await import(pathToFileURL(require.resolve(modulePath)).toString());\n const ctr: PluginConstructor = module.default;\n\n if (!Object.prototype.isPrototypeOf.call(Plugin, ctr)) {\n throw new GeneratorIOException(`Plugin '${modulePath}' is not an instance of a Plugin class`);\n }\n\n return ctr;\n }\n\n resolveGeneratedFile(filename: string): string {\n return resolve(this.#outputDir, filename);\n }\n\n async read(path: string): Promise<string> {\n this.#logger.global.debug(`Reading file: ${path}`);\n return readFile(path, 'utf8');\n }\n\n async write(filename: string, content: string): Promise<void> {\n const filePath = join(this.#outputDir, filename);\n this.#logger.global.debug(`Writing file ${filePath}.`);\n const dir = dirname(filePath);\n await mkdir(dir, { recursive: true });\n return writeFile(filePath, content, 'utf-8');\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,iBAAiB;AAC1B,SAAS,QAAQ,OAAO,UAAU,IAAI,iBAAiB;AACvD,SAAS,qBAAqB;AAC9B,SAAS,SAAS,YAAY,MAAM,eAAe;AACnD,SAAS,qBAAqB;AAC9B,OAAO,gBAAwC;AAE/C,OAAO,0BAA0B;AAEjC,MAAMA,WAAU,cAAc,YAAY,GAAG;AAM7C,MAAO,YAA0B;AAAA,EAC/B,OAAgB,iBAAiB;AAAA,EAExB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,WAAmB,QAAuB;AACpD,SAAK,MAAM,QAAQ,IAAI;AACvB,SAAK,aAAa,WAAW,SAAS,IAAI,YAAY,QAAQ,KAAK,KAAK,SAAS;AACjF,SAAK,UAAU;AAEf,WAAO,OAAO,MAAM,qBAAqB,KAAK,UAAU,EAAE;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,oBAA0C;AAC9C,UAAM,QAAQ,oBAAI,IAAY;AAC9B,QAAI;AACF,YAAM,oBAAoB,MAAM,KAAK,KAAK,KAAK,qBAAqB,KAAK,YAAY,cAAc,CAAC;AACpG,wBACG,MAAM,IAAI,EACV,OAAO,CAAC,MAAM,EAAE,MAAM,EACtB,QAAQ,CAAC,aAAa,MAAM,IAAI,QAAQ,CAAC;AAAA,IAC9C,SAAS,GAAG;AAEV,UAAI,EAAE,aAAa,SAAS,UAAU,KAAK,EAAE,SAAS,WAAW;AAC/D,cAAM;AAAA,MACR;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,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generator-cli",
3
- "version": "24.6.5",
3
+ "version": "24.7.0-alpha11",
4
4
  "description": "A Hilla tool to generate TypeScript code from the OpenAPI document",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -15,8 +15,9 @@
15
15
  "build:copy": "cd src && copyfiles **/*.d.ts ..",
16
16
  "lint": "eslint src test",
17
17
  "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",
18
+ "test": "vitest --run",
19
+ "test:coverage": "vitest --run --coverage",
20
+ "test:watch": "vitest",
20
21
  "typecheck": "tsc --noEmit"
21
22
  },
22
23
  "repository": {
@@ -45,29 +46,9 @@
45
46
  "tsgen": "bin/index.js"
46
47
  },
47
48
  "dependencies": {
48
- "@vaadin/hilla-generator-core": "24.6.5",
49
- "@vaadin/hilla-generator-utils": "24.6.5",
50
- "get-stdin": "^9.0.0",
51
- "meow": "^12.1.1"
52
- },
53
- "devDependencies": {
54
- "@types/chai": "^4.3.6",
55
- "@types/chai-as-promised": "^7.1.6",
56
- "@types/mocha": "^10.0.2",
57
- "@types/node": "^20.7.1",
58
- "@types/sinon": "^10.0.17",
59
- "@types/sinon-chai": "^3.2.10",
60
- "@vaadin/hilla-generator-core": "24.6.5",
61
- "c8": "^10.1.2",
62
- "chai": "^4.3.10",
63
- "chai-as-promised": "^7.1.1",
64
- "concurrently": "^8.2.1",
65
- "copyfiles": "^2.4.1",
66
- "mocha": "^10.8.2",
67
- "monocart-coverage-reports": "^2.11.5",
68
- "pino": "^8.21.0",
69
- "sinon": "^16.1.3",
70
- "sinon-chai": "^3.7.0",
71
- "type-fest": "^4.3.2"
49
+ "@vaadin/hilla-generator-core": "24.7.0-alpha11",
50
+ "@vaadin/hilla-generator-utils": "24.7.0-alpha11",
51
+ "get-stdin": "9.0.0",
52
+ "meow": "13.2.0"
72
53
  }
73
54
  }