@vaadin/hilla-generator-utils 24.6.4 → 24.7.0-alpha10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/hilla-generator-utils",
3
- "version": "24.6.4",
3
+ "version": "24.7.0-alpha10",
4
4
  "description": "A set of utils for developing Hilla generator plugins",
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
  "exports": {
@@ -57,25 +58,8 @@
57
58
  "access": "public"
58
59
  },
59
60
  "dependencies": {
60
- "pino": "^8.15.1",
61
- "pino-pretty": "^10.2.0",
62
- "typescript": "5.7.2"
63
- },
64
- "devDependencies": {
65
- "@types/chai": "^4.3.6",
66
- "@types/mocha": "^10.0.2",
67
- "@types/node": "^20.7.1",
68
- "@types/sinon": "^10.0.17",
69
- "@types/sinon-chai": "^3.2.10",
70
- "c8": "^10.1.2",
71
- "chai": "^4.3.10",
72
- "chai-like": "^1.1.1",
73
- "concurrently": "^8.2.1",
74
- "copyfiles": "^2.4.1",
75
- "mocha": "^10.8.2",
76
- "monocart-coverage-reports": "^2.11.5",
77
- "sinon": "^16.1.3",
78
- "sinon-chai": "^3.7.0",
79
- "type-fest": "^4.3.2"
61
+ "pino": "9.6.0",
62
+ "pino-pretty": "10.3.1",
63
+ "typescript": "5.7.3"
80
64
  }
81
65
  }
@@ -17,7 +17,7 @@ function snapshotMatcher(chai, utils) {
17
17
  let snapshot;
18
18
  try {
19
19
  snapshot = await readFile(snapshotPath, "utf8");
20
- } catch (e) {
20
+ } catch {
21
21
  throw new Error(
22
22
  `Snapshot does not exist yet: ${snapshotURL.toString()}.
23
23
  Consider running tests with --update flag.`
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/testing/snapshotMatcher.ts"],
4
- "sourcesContent": ["import { readFile, writeFile } from 'node:fs/promises';\nimport { fileURLToPath } from 'node:url';\n\nconst argv = process.argv.slice(2);\nconst shouldUpdate = argv.includes('-u') || argv.includes('--update');\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace Chai {\n interface Assertion {\n toMatchSnapshot(snapshotName: string, importMetaUrl: string): Promise<void>;\n }\n }\n}\n\nexport default function snapshotMatcher(chai: Chai.ChaiStatic, utils: Chai.ChaiUtils): void {\n utils.addMethod(\n chai.Assertion.prototype,\n 'toMatchSnapshot',\n // eslint-disable-next-line prefer-arrow-callback\n async function toMatchSnapshot(this: object, snapshotName: string, importMetaUrl: string): Promise<void> {\n const obj = utils.flag(this, 'object');\n const snapshotURL = new URL(`./fixtures/${snapshotName}`, importMetaUrl);\n const snapshotPath = fileURLToPath(snapshotURL);\n\n if (shouldUpdate) {\n await writeFile(snapshotPath, obj, 'utf8');\n } else {\n let snapshot;\n try {\n snapshot = await readFile(snapshotPath, 'utf8');\n } catch (e) {\n throw new Error(\n `Snapshot does not exist yet: ${snapshotURL.toString()}.\\nConsider running tests with --update flag.`,\n );\n }\n\n chai.assert.equal(obj, snapshot);\n }\n },\n );\n}\n"],
5
- "mappings": "AAAA,SAAS,UAAU,iBAAiB;AACpC,SAAS,qBAAqB;AAE9B,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,MAAM,eAAe,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,UAAU;AAWrD,SAAR,gBAAiC,MAAuB,OAA6B;AAC1F,QAAM;AAAA,IACJ,KAAK,UAAU;AAAA,IACf;AAAA;AAAA,IAEA,eAAe,gBAA8B,cAAsB,eAAsC;AACvG,YAAM,MAAM,MAAM,KAAK,MAAM,QAAQ;AACrC,YAAM,cAAc,IAAI,IAAI,cAAc,YAAY,IAAI,aAAa;AACvE,YAAM,eAAe,cAAc,WAAW;AAE9C,UAAI,cAAc;AAChB,cAAM,UAAU,cAAc,KAAK,MAAM;AAAA,MAC3C,OAAO;AACL,YAAI;AACJ,YAAI;AACF,qBAAW,MAAM,SAAS,cAAc,MAAM;AAAA,QAChD,SAAS,GAAG;AACV,gBAAM,IAAI;AAAA,YACR,gCAAgC,YAAY,SAAS,CAAC;AAAA;AAAA,UACxD;AAAA,QACF;AAEA,aAAK,OAAO,MAAM,KAAK,QAAQ;AAAA,MACjC;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { readFile, writeFile } from 'node:fs/promises';\nimport { fileURLToPath } from 'node:url';\n\nconst argv = process.argv.slice(2);\nconst shouldUpdate = argv.includes('-u') || argv.includes('--update');\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace Chai {\n interface Assertion {\n toMatchSnapshot(snapshotName: string, importMetaUrl: string): Promise<void>;\n }\n }\n}\n\nexport default function snapshotMatcher(chai: Chai.ChaiStatic, utils: Chai.ChaiUtils): void {\n utils.addMethod(\n chai.Assertion.prototype,\n 'toMatchSnapshot',\n // eslint-disable-next-line prefer-arrow-callback\n async function toMatchSnapshot(this: object, snapshotName: string, importMetaUrl: string): Promise<void> {\n const obj = utils.flag(this, 'object');\n const snapshotURL = new URL(`./fixtures/${snapshotName}`, importMetaUrl);\n const snapshotPath = fileURLToPath(snapshotURL);\n\n if (shouldUpdate) {\n await writeFile(snapshotPath, obj, 'utf8');\n } else {\n let snapshot;\n try {\n snapshot = await readFile(snapshotPath, 'utf8');\n } catch {\n throw new Error(\n `Snapshot does not exist yet: ${snapshotURL.toString()}.\\nConsider running tests with --update flag.`,\n );\n }\n\n chai.assert.equal(obj, snapshot);\n }\n },\n );\n}\n"],
5
+ "mappings": "AAAA,SAAS,UAAU,iBAAiB;AACpC,SAAS,qBAAqB;AAE9B,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,MAAM,eAAe,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,UAAU;AAWrD,SAAR,gBAAiC,MAAuB,OAA6B;AAC1F,QAAM;AAAA,IACJ,KAAK,UAAU;AAAA,IACf;AAAA;AAAA,IAEA,eAAe,gBAA8B,cAAsB,eAAsC;AACvG,YAAM,MAAM,MAAM,KAAK,MAAM,QAAQ;AACrC,YAAM,cAAc,IAAI,IAAI,cAAc,YAAY,IAAI,aAAa;AACvE,YAAM,eAAe,cAAc,WAAW;AAE9C,UAAI,cAAc;AAChB,cAAM,UAAU,cAAc,KAAK,MAAM;AAAA,MAC3C,OAAO;AACL,YAAI;AACJ,YAAI;AACF,qBAAW,MAAM,SAAS,cAAc,MAAM;AAAA,QAChD,QAAQ;AACN,gBAAM,IAAI;AAAA,YACR,gCAAgC,YAAY,SAAS,CAAC;AAAA;AAAA,UACxD;AAAA,QACF;AAEA,aAAK,OAAO,MAAM,KAAK,QAAQ;AAAA,MACjC;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }