@vaadin/hilla-generator-plugin-push 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/PushProcessor.js CHANGED
@@ -80,7 +80,7 @@ class PushProcessor {
80
80
  * @param declaration -
81
81
  */
82
82
  #replacePromiseType(declaration) {
83
- const promiseType = declaration.type.typeArguments[0];
83
+ const [promiseType] = declaration.type.typeArguments;
84
84
  const promiseArray = ts.isUnionTypeNode(promiseType) ? promiseType.types[0] : promiseType;
85
85
  return ts.factory.createTypeReferenceNode(this.#subscriptionId(), promiseArray.typeArguments);
86
86
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["src/PushProcessor.ts"],
4
- "sourcesContent": ["import createSourceFile from '@vaadin/hilla-generator-utils/createSourceFile.js';\nimport DependencyManager from '@vaadin/hilla-generator-utils/dependencies/DependencyManager.js';\nimport PathManager from '@vaadin/hilla-generator-utils/dependencies/PathManager.js';\nimport memoize from '@vaadin/hilla-generator-utils/memoize.js';\nimport ts from 'typescript';\n\nconst initParameterTypeName = 'EndpointRequestInit';\n\nexport type EndpointOperations = {\n methodsToPatch: string[];\n removeInitImport: boolean;\n};\n\nexport class PushProcessor {\n readonly #dependencies = new DependencyManager(new PathManager({ extension: '.js' }));\n readonly #operations: EndpointOperations;\n readonly #source: ts.SourceFile;\n readonly #subscriptionId: () => ts.Identifier;\n\n constructor(source: ts.SourceFile, operations: EndpointOperations) {\n this.#operations = operations;\n this.#source = source;\n\n const { imports, paths } = this.#dependencies;\n\n this.#dependencies.imports.fromCode(source);\n this.#subscriptionId = memoize(() =>\n imports.named.add(paths.createBareModulePath('@vaadin/hilla-frontend', false), 'Subscription'),\n );\n }\n\n process(): ts.SourceFile {\n const otherStatements = this.#source.statements\n .filter((statement) => !ts.isImportDeclaration(statement))\n .map((statement) => {\n if (ts.isFunctionDeclaration(statement)) {\n const functionName = statement.name?.text;\n\n // Checks if the method is in the list of methods to patch\n if (functionName && this.#operations.methodsToPatch.includes(functionName)) {\n return this.#updateFunction(statement);\n }\n }\n\n return statement;\n });\n\n let importStatements = this.#dependencies.imports.toCode();\n\n if (this.#operations.removeInitImport) {\n const importHillaFrontend = importStatements.find(\n (statement) =>\n ts.isImportDeclaration(statement) &&\n (statement.moduleSpecifier as ts.StringLiteral).text === '@vaadin/hilla-frontend',\n );\n\n if (importHillaFrontend) {\n const updatedImportStatement = PushProcessor.#removeInitImport(importHillaFrontend as ts.ImportDeclaration);\n\n if (updatedImportStatement) {\n importStatements = importStatements.map((statement) => {\n if (statement === importHillaFrontend) {\n return updatedImportStatement;\n }\n\n return statement;\n });\n }\n }\n }\n\n const updatedStatements: readonly ts.Statement[] = [...importStatements, ...otherStatements];\n\n return createSourceFile(updatedStatements, this.#source.fileName);\n }\n\n static #doesInitParameterExist(parameters: ts.NodeArray<ts.ParameterDeclaration>): boolean {\n const last = parameters[parameters.length - 1];\n const lastType = last.type as ts.TypeReferenceNode;\n const lastTypeName = lastType.typeName as ts.Identifier;\n\n return lastTypeName.text === initParameterTypeName;\n }\n\n static #removeInitImport(importStatement: ts.ImportDeclaration): ts.Statement | undefined {\n const namedImports = importStatement.importClause?.namedBindings;\n if (namedImports && ts.isNamedImports(namedImports)) {\n const updatedElements = namedImports.elements.filter((element) => element.name.text !== 'EndpointRequestInit');\n\n const updatedImportClause = ts.factory.updateImportClause(\n importStatement.importClause,\n false, // FIXME: could be true, but it is false for regular endpoint calls, so sticking to that for now\n undefined,\n ts.factory.createNamedImports(updatedElements),\n );\n\n return ts.factory.updateImportDeclaration(\n importStatement,\n undefined,\n updatedImportClause,\n importStatement.moduleSpecifier,\n undefined,\n );\n }\n\n return undefined;\n }\n\n /**\n * Replace returned `Promise<Array<T>>` by the `Subscription<T>` type\n * @param declaration -\n */\n #replacePromiseType(declaration: ts.FunctionDeclaration) {\n const promiseType = (declaration.type as ts.TypeReferenceNode).typeArguments![0];\n const promiseArray = (ts.isUnionTypeNode(promiseType) ? promiseType.types[0] : promiseType) as ts.TypeReferenceNode;\n\n return ts.factory.createTypeReferenceNode(this.#subscriptionId(), promiseArray.typeArguments);\n }\n\n #updateFunction(declaration: ts.FunctionDeclaration): ts.FunctionDeclaration {\n const { parameters } = declaration;\n const doesInitParameterExist = PushProcessor.#doesInitParameterExist(parameters);\n\n return ts.factory.createFunctionDeclaration(\n undefined, // no async\n declaration.asteriskToken,\n declaration.name,\n declaration.typeParameters,\n // Remove the `init` parameter\n doesInitParameterExist ? parameters.slice(0, -1) : parameters,\n this.#replacePromiseType(declaration),\n PushProcessor.#updateFunctionBody(declaration, doesInitParameterExist),\n );\n }\n\n static #updateFunctionBody(declaration: ts.FunctionDeclaration, doesInitParameterExist: boolean): ts.Block {\n const returnStatement = declaration.body!.statements[0] as ts.ReturnStatement;\n const { arguments: args, expression, typeArguments } = returnStatement.expression! as ts.CallExpression;\n const call = expression as ts.PropertyAccessExpression;\n\n return ts.factory.createBlock([\n ts.factory.createReturnStatement(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(\n call.expression,\n // `subscribe` instead of `call`\n ts.factory.createIdentifier('subscribe'),\n ),\n typeArguments,\n // remove the `init` parameter\n doesInitParameterExist ? args.slice(0, -1) : args,\n ),\n ),\n ]);\n }\n}\n"],
5
- "mappings": "AAAA,OAAO,sBAAsB;AAC7B,OAAO,uBAAuB;AAC9B,OAAO,iBAAiB;AACxB,OAAO,aAAa;AACpB,OAAO,QAAQ;AAEf,MAAM,wBAAwB;AAOvB,MAAM,cAAc;AAAA,EAChB,gBAAgB,IAAI,kBAAkB,IAAI,YAAY,EAAE,WAAW,MAAM,CAAC,CAAC;AAAA,EAC3E;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAuB,YAAgC;AACjE,SAAK,cAAc;AACnB,SAAK,UAAU;AAEf,UAAM,EAAE,SAAS,MAAM,IAAI,KAAK;AAEhC,SAAK,cAAc,QAAQ,SAAS,MAAM;AAC1C,S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ACT,GAAG,QAAQ;AAAA,UACT,GAAG,QAAQ;AAAA,YACT,KAAK;AAAA;AAAA,YAEL,GAAG,QAAQ,iBAAiB,WAAW;AAAA,UACzC;AAAA,UACA;AAAA;AAAA,UAEA,yBAAyB,KAAK,MAAM,GAAG,EAAE,IAAI;AAAA,QAC/C;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
4
+ "sourcesContent": ["import createSourceFile from '@vaadin/hilla-generator-utils/createSourceFile.js';\nimport DependencyManager from '@vaadin/hilla-generator-utils/dependencies/DependencyManager.js';\nimport PathManager from '@vaadin/hilla-generator-utils/dependencies/PathManager.js';\nimport memoize from '@vaadin/hilla-generator-utils/memoize.js';\nimport ts from 'typescript';\n\nconst initParameterTypeName = 'EndpointRequestInit';\n\nexport type EndpointOperations = {\n methodsToPatch: string[];\n removeInitImport: boolean;\n};\n\nexport class PushProcessor {\n readonly #dependencies = new DependencyManager(new PathManager({ extension: '.js' }));\n readonly #operations: EndpointOperations;\n readonly #source: ts.SourceFile;\n readonly #subscriptionId: () => ts.Identifier;\n\n constructor(source: ts.SourceFile, operations: EndpointOperations) {\n this.#operations = operations;\n this.#source = source;\n\n const { imports, paths } = this.#dependencies;\n\n this.#dependencies.imports.fromCode(source);\n this.#subscriptionId = memoize(() =>\n imports.named.add(paths.createBareModulePath('@vaadin/hilla-frontend', false), 'Subscription'),\n );\n }\n\n process(): ts.SourceFile {\n const otherStatements = this.#source.statements\n .filter((statement) => !ts.isImportDeclaration(statement))\n .map((statement) => {\n if (ts.isFunctionDeclaration(statement)) {\n const functionName = statement.name?.text;\n\n // Checks if the method is in the list of methods to patch\n if (functionName && this.#operations.methodsToPatch.includes(functionName)) {\n return this.#updateFunction(statement);\n }\n }\n\n return statement;\n });\n\n let importStatements = this.#dependencies.imports.toCode();\n\n if (this.#operations.removeInitImport) {\n const importHillaFrontend = importStatements.find(\n (statement) =>\n ts.isImportDeclaration(statement) &&\n (statement.moduleSpecifier as ts.StringLiteral).text === '@vaadin/hilla-frontend',\n );\n\n if (importHillaFrontend) {\n const updatedImportStatement = PushProcessor.#removeInitImport(importHillaFrontend as ts.ImportDeclaration);\n\n if (updatedImportStatement) {\n importStatements = importStatements.map((statement) => {\n if (statement === importHillaFrontend) {\n return updatedImportStatement;\n }\n\n return statement;\n });\n }\n }\n }\n\n const updatedStatements: readonly ts.Statement[] = [...importStatements, ...otherStatements];\n\n return createSourceFile(updatedStatements, this.#source.fileName);\n }\n\n static #doesInitParameterExist(parameters: ts.NodeArray<ts.ParameterDeclaration>): boolean {\n const last = parameters[parameters.length - 1];\n const lastType = last.type as ts.TypeReferenceNode;\n const lastTypeName = lastType.typeName as ts.Identifier;\n\n return lastTypeName.text === initParameterTypeName;\n }\n\n static #removeInitImport(importStatement: ts.ImportDeclaration): ts.Statement | undefined {\n const namedImports = importStatement.importClause?.namedBindings;\n if (namedImports && ts.isNamedImports(namedImports)) {\n const updatedElements = namedImports.elements.filter((element) => element.name.text !== 'EndpointRequestInit');\n\n const updatedImportClause = ts.factory.updateImportClause(\n importStatement.importClause,\n false, // FIXME: could be true, but it is false for regular endpoint calls, so sticking to that for now\n undefined,\n ts.factory.createNamedImports(updatedElements),\n );\n\n return ts.factory.updateImportDeclaration(\n importStatement,\n undefined,\n updatedImportClause,\n importStatement.moduleSpecifier,\n undefined,\n );\n }\n\n return undefined;\n }\n\n /**\n * Replace returned `Promise<Array<T>>` by the `Subscription<T>` type\n * @param declaration -\n */\n #replacePromiseType(declaration: ts.FunctionDeclaration) {\n const [promiseType] = (declaration.type as ts.TypeReferenceNode).typeArguments!;\n const promiseArray = (ts.isUnionTypeNode(promiseType) ? promiseType.types[0] : promiseType) as ts.TypeReferenceNode;\n\n return ts.factory.createTypeReferenceNode(this.#subscriptionId(), promiseArray.typeArguments);\n }\n\n #updateFunction(declaration: ts.FunctionDeclaration): ts.FunctionDeclaration {\n const { parameters } = declaration;\n const doesInitParameterExist = PushProcessor.#doesInitParameterExist(parameters);\n\n return ts.factory.createFunctionDeclaration(\n undefined, // no async\n declaration.asteriskToken,\n declaration.name,\n declaration.typeParameters,\n // Remove the `init` parameter\n doesInitParameterExist ? parameters.slice(0, -1) : parameters,\n this.#replacePromiseType(declaration),\n PushProcessor.#updateFunctionBody(declaration, doesInitParameterExist),\n );\n }\n\n static #updateFunctionBody(declaration: ts.FunctionDeclaration, doesInitParameterExist: boolean): ts.Block {\n const returnStatement = declaration.body!.statements[0] as ts.ReturnStatement;\n const { arguments: args, expression, typeArguments } = returnStatement.expression! as ts.CallExpression;\n const call = expression as ts.PropertyAccessExpression;\n\n return ts.factory.createBlock([\n ts.factory.createReturnStatement(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(\n call.expression,\n // `subscribe` instead of `call`\n ts.factory.createIdentifier('subscribe'),\n ),\n typeArguments,\n // remove the `init` parameter\n doesInitParameterExist ? args.slice(0, -1) : args,\n ),\n ),\n ]);\n }\n}\n"],
5
+ "mappings": "AAAA,OAAO,sBAAsB;AAC7B,OAAO,uBAAuB;AAC9B,OAAO,iBAAiB;AACxB,OAAO,aAAa;AACpB,OAAO,QAAQ;AAEf,MAAM,wBAAwB;AAOvB,MAAM,cAAc;AAAA,EAChB,gBAAgB,IAAI,kBAAkB,IAAI,YAAY,EAAE,WAAW,MAAM,CAAC,CAAC;AAAA,EAC3E;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAuB,YAAgC;AACjE,SAAK,cAAc;AACnB,SAAK,UAAU;AAEf,UAAM,EAAE,SAAS,MAAM,IAAI,KAAK;AAEhC,SAAK,cAAc,QAAQ,SAAS,MAAM;AAC1C,SAAK,kBAAkB;AAAA,MAAQ,MAC7B,QAAQ,MAAM,IAAI,MAAM,qBAAqB,0BAA0B,KAAK,GAAG,cAAc;AAAA,IAC/F;AAAA,EACF;AAAA,EAEA,UAAyB;AACvB,UAAM,kBAAkB,KAAK,QAAQ,WAClC,OAAO,CAAC,cAAc,CAAC,GAAG,oBAAoB,SAAS,CAAC,EACxD,I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ACF;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/hilla-generator-plugin-push",
3
- "version": "24.6.4",
3
+ "version": "24.7.0-alpha10",
4
4
  "description": "A Hilla TypeScript Generator plugin to add push support",
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": "mocha test/**/*.spec.ts --config ../../../.mocharc.cjs",
19
- "test:update": "npm run test -- --update",
20
- "test:coverage": "c8 --experimental-monocart -c ../../../.c8rc.json npm 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,30 +52,11 @@
51
52
  "access": "public"
52
53
  },
53
54
  "dependencies": {
54
- "@vaadin/hilla-generator-core": "24.6.4",
55
- "@vaadin/hilla-generator-plugin-client": "24.6.4",
56
- "@vaadin/hilla-generator-utils": "24.6.4",
57
- "fast-deep-equal": "^3.1.3",
58
- "openapi-types": "^12.1.3",
59
- "typescript": "5.7.2"
60
- },
61
- "devDependencies": {
62
- "@types/chai": "^4.3.6",
63
- "@types/mocha": "^10.0.2",
64
- "@types/node": "^20.7.1",
65
- "@types/sinon": "^10.0.17",
66
- "@types/sinon-chai": "^3.2.10",
67
- "@vaadin/hilla-generator-core": "24.6.4",
68
- "@vaadin/hilla-generator-plugin-client": "24.6.4",
69
- "c8": "^10.1.2",
70
- "chai": "^4.3.10",
71
- "concurrently": "^8.2.1",
72
- "copyfiles": "^2.4.1",
73
- "mocha": "^10.8.2",
74
- "monocart-coverage-reports": "^2.11.5",
75
- "pino": "^8.21.0",
76
- "sinon": "^16.1.3",
77
- "sinon-chai": "^3.7.0",
78
- "type-fest": "^4.3.2"
55
+ "@vaadin/hilla-generator-core": "24.7.0-alpha10",
56
+ "@vaadin/hilla-generator-plugin-client": "24.7.0-alpha10",
57
+ "@vaadin/hilla-generator-utils": "24.7.0-alpha10",
58
+ "fast-deep-equal": "3.1.3",
59
+ "openapi-types": "12.1.3",
60
+ "typescript": "5.7.3"
79
61
  }
80
62
  }