@vaadin/hilla-generator-plugin-client 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/index.js +1 -1
- package/index.js.map +2 -2
- package/package.json +8 -25
package/index.js
CHANGED
|
@@ -12,7 +12,7 @@ class ClientPlugin extends Plugin {
|
|
|
12
12
|
const dir = path?.startsWith("file:") ? fileURLToPath(path) : path;
|
|
13
13
|
try {
|
|
14
14
|
return !!(dir && await open(`${dir}/${ClientPlugin.CUSTOM_CLIENT_FILE_NAME}.ts`, "r"));
|
|
15
|
-
} catch
|
|
15
|
+
} catch {
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
18
|
}
|
package/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { open } from 'fs/promises';\nimport { fileURLToPath } from 'url';\nimport Plugin from '@vaadin/hilla-generator-core/Plugin.js';\nimport type SharedStorage from '@vaadin/hilla-generator-core/SharedStorage.js';\nimport ClientProcessor from './ClientProcessor.js';\n\nexport default class ClientPlugin extends Plugin {\n static readonly CLIENT_FILE_NAME = 'connect-client.default';\n static readonly CUSTOM_CLIENT_FILE_NAME = '../connect-client';\n\n static async getClientFileName(path?: string): Promise<string> {\n return (await ClientPlugin.#checkForCustomClientFile(path))\n ? ClientPlugin.CUSTOM_CLIENT_FILE_NAME\n : ClientPlugin.CLIENT_FILE_NAME;\n }\n\n static async #checkForCustomClientFile(path?: string): Promise<boolean> {\n const dir = path?.startsWith('file:') ? fileURLToPath(path) : path;\n\n try {\n return !!(dir && (await open(`${dir}/${ClientPlugin.CUSTOM_CLIENT_FILE_NAME}.ts`, 'r')));\n } catch
|
|
5
|
-
"mappings": "AAAA,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAC9B,OAAO,YAAY;AAEnB,OAAO,qBAAqB;AAE5B,MAAO,qBAAmC,OAAO;AAAA,EAC/C,OAAgB,mBAAmB;AAAA,EACnC,OAAgB,0BAA0B;AAAA,EAE1C,aAAa,kBAAkB,MAAgC;AAC7D,WAAQ,MAAM,aAAa,0BAA0B,IAAI,IACrD,aAAa,0BACb,aAAa;AAAA,EACnB;AAAA,EAEA,aAAa,0BAA0B,MAAiC;AACtE,UAAM,MAAM,MAAM,WAAW,OAAO,IAAI,cAAc,IAAI,IAAI;AAE9D,QAAI;AACF,aAAO,CAAC,EAAE,OAAQ,MAAM,KAAK,GAAG,GAAG,IAAI,aAAa,uBAAuB,OAAO,GAAG;AAAA,IACvF,
|
|
4
|
+
"sourcesContent": ["import { open } from 'fs/promises';\nimport { fileURLToPath } from 'url';\nimport Plugin from '@vaadin/hilla-generator-core/Plugin.js';\nimport type SharedStorage from '@vaadin/hilla-generator-core/SharedStorage.js';\nimport ClientProcessor from './ClientProcessor.js';\n\nexport default class ClientPlugin extends Plugin {\n static readonly CLIENT_FILE_NAME = 'connect-client.default';\n static readonly CUSTOM_CLIENT_FILE_NAME = '../connect-client';\n\n static async getClientFileName(path?: string): Promise<string> {\n return (await ClientPlugin.#checkForCustomClientFile(path))\n ? ClientPlugin.CUSTOM_CLIENT_FILE_NAME\n : ClientPlugin.CLIENT_FILE_NAME;\n }\n\n static async #checkForCustomClientFile(path?: string): Promise<boolean> {\n const dir = path?.startsWith('file:') ? fileURLToPath(path) : path;\n\n try {\n return !!(dir && (await open(`${dir}/${ClientPlugin.CUSTOM_CLIENT_FILE_NAME}.ts`, 'r')));\n } catch {\n return false;\n }\n }\n\n declare ['constructor']: typeof ClientPlugin;\n\n override get path(): string {\n return import.meta.url;\n }\n\n override async execute({ outputDir, sources }: SharedStorage): Promise<void> {\n // the client file is created only if a custom client file is not found\n if (!(outputDir && (await ClientPlugin.#checkForCustomClientFile(outputDir)))) {\n const clientFile = new ClientProcessor(this.constructor.CLIENT_FILE_NAME, this).process();\n sources.push(clientFile);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAC9B,OAAO,YAAY;AAEnB,OAAO,qBAAqB;AAE5B,MAAO,qBAAmC,OAAO;AAAA,EAC/C,OAAgB,mBAAmB;AAAA,EACnC,OAAgB,0BAA0B;AAAA,EAE1C,aAAa,kBAAkB,MAAgC;AAC7D,WAAQ,MAAM,aAAa,0BAA0B,IAAI,IACrD,aAAa,0BACb,aAAa;AAAA,EACnB;AAAA,EAEA,aAAa,0BAA0B,MAAiC;AACtE,UAAM,MAAM,MAAM,WAAW,OAAO,IAAI,cAAc,IAAI,IAAI;AAE9D,QAAI;AACF,aAAO,CAAC,EAAE,OAAQ,MAAM,KAAK,GAAG,GAAG,IAAI,aAAa,uBAAuB,OAAO,GAAG;AAAA,IACvF,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AAAA,EAIA,IAAa,OAAe;AAC1B,WAAO,YAAY;AAAA,EACrB;AAAA,EAEA,MAAe,QAAQ,EAAE,WAAW,QAAQ,GAAiC;AAE3E,QAAI,EAAE,aAAc,MAAM,aAAa,0BAA0B,SAAS,IAAK;AAC7E,YAAM,aAAa,IAAI,gBAAgB,KAAK,YAAY,kBAAkB,IAAI,EAAE,QAAQ;AACxF,cAAQ,KAAK,UAAU;AAAA,IACzB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/hilla-generator-plugin-client",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.7.0-alpha10",
|
|
4
4
|
"description": "A Hilla TypeScript Generator plugin to generate default client implementation",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -15,9 +15,10 @@
|
|
|
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": "
|
|
19
|
-
"test:
|
|
20
|
-
"test:
|
|
18
|
+
"test": "vitest --run",
|
|
19
|
+
"test:coverage": "vitest --run --coverage",
|
|
20
|
+
"test:update": "vitest --run --update",
|
|
21
|
+
"test:watch": "vitest",
|
|
21
22
|
"typecheck": "tsc --noEmit"
|
|
22
23
|
},
|
|
23
24
|
"exports": {
|
|
@@ -51,26 +52,8 @@
|
|
|
51
52
|
"access": "public"
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
|
-
"@vaadin/hilla-generator-core": "24.
|
|
55
|
-
"@vaadin/hilla-generator-utils": "24.
|
|
56
|
-
"typescript": "5.7.
|
|
57
|
-
},
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"@types/chai": "^4.3.6",
|
|
60
|
-
"@types/mocha": "^10.0.2",
|
|
61
|
-
"@types/node": "^20.7.1",
|
|
62
|
-
"@types/sinon": "^10.0.17",
|
|
63
|
-
"@types/sinon-chai": "^3.2.10",
|
|
64
|
-
"@vaadin/hilla-generator-core": "24.6.4",
|
|
65
|
-
"c8": "^10.1.2",
|
|
66
|
-
"chai": "^4.3.10",
|
|
67
|
-
"concurrently": "^8.2.1",
|
|
68
|
-
"copyfiles": "^2.4.1",
|
|
69
|
-
"mocha": "^10.8.2",
|
|
70
|
-
"monocart-coverage-reports": "^2.11.5",
|
|
71
|
-
"pino": "^8.21.0",
|
|
72
|
-
"sinon": "^16.1.3",
|
|
73
|
-
"sinon-chai": "^3.7.0",
|
|
74
|
-
"type-fest": "^4.3.2"
|
|
55
|
+
"@vaadin/hilla-generator-core": "24.7.0-alpha10",
|
|
56
|
+
"@vaadin/hilla-generator-utils": "24.7.0-alpha10",
|
|
57
|
+
"typescript": "5.7.3"
|
|
75
58
|
}
|
|
76
59
|
}
|