@vaadin/hilla-generator-utils 24.5.0-beta4 → 24.5.0-beta6

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.5.0-beta4",
3
+ "version": "24.5.0-beta6",
4
4
  "description": "A set of utils for developing Hilla generator plugins",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -9,7 +9,7 @@ function snapshotMatcher(chai, utils) {
9
9
  // eslint-disable-next-line prefer-arrow-callback
10
10
  async function toMatchSnapshot(snapshotName, importMetaUrl) {
11
11
  const obj = utils.flag(this, "object");
12
- const snapshotURL = new URL(`./fixtures/${snapshotName}.snap.ts`, importMetaUrl);
12
+ const snapshotURL = new URL(`./fixtures/${snapshotName}`, importMetaUrl);
13
13
  const snapshotPath = fileURLToPath(snapshotURL);
14
14
  if (shouldUpdate) {
15
15
  await writeFile(snapshotPath, obj, "utf8");
@@ -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}.snap.ts`, 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,YAAY,aAAa;AAC/E,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 (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;",
6
6
  "names": []
7
7
  }