From a346cbc9416f5d9238f43eab00fed882d383ca20 Mon Sep 17 00:00:00 2001 From: "yilun.sun" Date: Tue, 5 Mar 2024 16:04:50 +0800 Subject: [PATCH 1/5] fix: remove PHP doc node to TypeScript type transpiler code - use transpiler import from `@rightcapital/phpdoc-parser` --- README.md | 4 +- pnpm-lock.yaml | 18 +-- .../helpers/extended-php-doc-transpiler.ts | 17 +++ src/php-parser/helpers/php-doc-helpers.ts | 12 +- src/transpiler/base-type-transpiler.ts | 18 --- .../php-doc-to-typescript-type-transpiler.ts | 139 ------------------ 6 files changed, 25 insertions(+), 183 deletions(-) create mode 100644 src/php-parser/helpers/extended-php-doc-transpiler.ts delete mode 100644 src/transpiler/base-type-transpiler.ts delete mode 100644 src/transpiler/php-doc-to-typescript-type-transpiler.ts diff --git a/README.md b/README.md index bc9f36d..e19fce6 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ This NPM package is focusing on providing to following abilities: -- A TypeScript/JavaScript wrapper for calling nicki's PHP-Parser -- Sort of auto generated type definitions to annotate the AST (represented as JSON) from nicki's PHP-Parser cli +- A TypeScript/JavaScript wrapper for calling nikic's PHP-Parser +- Sort of auto generated type definitions to annotate the AST (represented as JSON) from nikic's PHP-Parser cli - Some util/helper functions to easily retrieving proper PHP AST node with correct type annotation # Installation diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 671bf09..2ef91d6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,7 +7,7 @@ settings: dependencies: '@rightcapital/phpdoc-parser': specifier: 0.3.40 - version: 0.3.40 + version: link:../phpdoc-parser lodash: specifier: 4.17.21 version: 4.17.21 @@ -675,15 +675,6 @@ packages: - supports-color dev: true - /@rightcapital/phpdoc-parser@0.3.40: - resolution: {integrity: sha512-O1TtX+ulK/yr9yajpAoPKqxxRqOdta4MHe8J6qpujvEzGA9tNdH6uoRcfyf/S8FHJyfhAbVjfYbOrOLYhPFESQ==} - engines: {node: '>=16.x', pnpm: '>=8.x'} - requiresBuild: true - dependencies: - '@types/node': 20.11.16 - lodash: 4.17.21 - dev: false - /@rightcapital/prettier-config@6.0.14(prettier@3.2.4): resolution: {integrity: sha512-Mr/NcYCLNCHC4MHMVmLoD6bNNtUWHyFE8ROXie6CNuo69Y9WgLgMDdcMGTMRRxujkTVTrI6a3RS5x6h5SKvurw==} engines: {node: '>=16.0.0'} @@ -721,12 +712,6 @@ packages: resolution: {integrity: sha512-PLwiVvTBg59tGFL/8VpcGvqOu3L4OuveNvPi0EYbWchRdEVP++yRUXJPFl+CApKEq13017/4Nf7aQ5lTtHUNsA==} dev: true - /@types/node@20.11.16: - resolution: {integrity: sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==} - dependencies: - undici-types: 5.26.5 - dev: false - /@types/node@20.11.20: resolution: {integrity: sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==} dependencies: @@ -3631,6 +3616,7 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true /universalify@2.0.1: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} diff --git a/src/php-parser/helpers/extended-php-doc-transpiler.ts b/src/php-parser/helpers/extended-php-doc-transpiler.ts new file mode 100644 index 0000000..fffaf4e --- /dev/null +++ b/src/php-parser/helpers/extended-php-doc-transpiler.ts @@ -0,0 +1,17 @@ +import { + type NameNodePathResolver, + PhpDocTypeNodeToTypescriptTypeNodeTranspiler, +} from '@rightcapital/phpdoc-parser/dist/phpdoc-parser/transpiler/php-doc-to-typescript-type-transpiler'; + +export class ExtendedTranspiler extends PhpDocTypeNodeToTypescriptTypeNodeTranspiler { + constructor(public resolver: NameNodePathResolver) { + super( + (nodeParts: string[]) => + resolver.call(this, nodeParts) as { + path: string; + name: string; + isTypeOnly: boolean; + }, + ); + } +} diff --git a/src/php-parser/helpers/php-doc-helpers.ts b/src/php-parser/helpers/php-doc-helpers.ts index 4ff0d59..903da55 100644 --- a/src/php-parser/helpers/php-doc-helpers.ts +++ b/src/php-parser/helpers/php-doc-helpers.ts @@ -9,6 +9,7 @@ import { TypeParser, type VarTagValueNode, } from '@rightcapital/phpdoc-parser'; +import type { NameNodePathResolver } from '@rightcapital/phpdoc-parser/dist/phpdoc-parser/transpiler/php-doc-to-typescript-type-transpiler'; import { EmitHint, type ImportDeclaration, @@ -19,13 +20,10 @@ import { createPrinter, createSourceFile, } from 'typescript'; +import { ExtendedTranspiler } from './extended-php-doc-transpiler'; import { FilePathHelpers } from './file-path-helpers'; import type { IUses } from './node-retriever-helpers'; import { TypeGenerationHelpers } from './type-generation-helpers'; -import { - type NameNodePathResolver, - PhpDocToTypescriptTypeTranspiler, -} from '../../transpiler/php-doc-to-typescript-type-transpiler'; export interface ITypeGenerationPackage { tsTypeNode: TypeNode; @@ -77,7 +75,7 @@ export class PhpDocHelpers { fileRelativePath: string, uses: IUses, ): ITypeGenerationPackage { - const nameNodePathResolver: NameNodePathResolver = ( + const nameNodePathResolver: NameNodePathResolver = ( nodeParts: string[], ) => { const targetTypeFilePath = FilePathHelpers.getFilePathFromNameNodeParts( @@ -107,9 +105,7 @@ export class PhpDocHelpers { isTypeOnly: true, }; }; - const transpiler = new PhpDocToTypescriptTypeTranspiler( - nameNodePathResolver, - ); + const transpiler = new ExtendedTranspiler(nameNodePathResolver); transpiler.beforeTranspile(); const tsTypeNode = transpiler.transpile(typeNode); diff --git a/src/transpiler/base-type-transpiler.ts b/src/transpiler/base-type-transpiler.ts deleted file mode 100644 index 162ccb9..0000000 --- a/src/transpiler/base-type-transpiler.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { ImportDeclaration, TypeNode } from 'typescript'; - -export abstract class BaseTypeTranspiler { - constructor(public nameNodePathResolver: NameNodePathResolver) {} - - public abstract transpile(typeNode: SourceTypeNode): TypeNode; - - public beforeTranspile() { - // Reset importDeclarations - this.importDeclarations = []; - } - - public getImportDeclarations() { - return this.importDeclarations; - } - - protected importDeclarations: ImportDeclaration[]; -} diff --git a/src/transpiler/php-doc-to-typescript-type-transpiler.ts b/src/transpiler/php-doc-to-typescript-type-transpiler.ts deleted file mode 100644 index 2c9314f..0000000 --- a/src/transpiler/php-doc-to-typescript-type-transpiler.ts +++ /dev/null @@ -1,139 +0,0 @@ -import type { TypeNode as PhpTypeNode } from '@rightcapital/phpdoc-parser'; -import { SyntaxKind, type TypeNode, factory } from 'typescript'; -import { BaseTypeTranspiler } from './base-type-transpiler'; - -export type NameNodePathResolver = (nodeParts: string[]) => { - path: string; - name: string; - isTypeOnly: boolean; -}; - -export class PhpDocToTypescriptTypeTranspiler extends BaseTypeTranspiler< - PhpTypeNode, - NameNodePathResolver -> { - public override transpile(sourceTypeNode: PhpTypeNode): TypeNode { - // type_a | type_b | type_c - if (sourceTypeNode.isUnionTypeNode()) { - return factory.createUnionTypeNode( - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - sourceTypeNode.types.map(this.transpile.bind(this)), - ); - } - - // type[] - if (sourceTypeNode.isArrayTypeNode()) { - return factory.createArrayTypeNode(this.transpile(sourceTypeNode.type)); - } - - // case 1: array, non-empty-array, list, non-empty-list - // case 2: array, non-empty-array; - if (sourceTypeNode.isGenericTypeNode()) { - if ( - ['array', 'non-empty-array', 'list', 'non-empty-list'].includes( - sourceTypeNode.type.name, - ) - ) { - if (sourceTypeNode.genericTypes.length === 1) { - // turn into regular Array like Type[] - return factory.createArrayTypeNode( - this.transpile(sourceTypeNode.genericTypes[0]), - ); - } - if (sourceTypeNode.genericTypes.length === 2) { - // Record - factory.createTypeReferenceNode(factory.createIdentifier('Record'), [ - this.transpile(sourceTypeNode.genericTypes[0]), - this.transpile(sourceTypeNode.genericTypes[1]), - ]); - } - } - throw Error('Not yet supported Generic type so far'); - } - - if (sourceTypeNode.isIdentifierTypeNode()) { - // Ref: the Basic type defined here - // https://phpstan.org/writing-php-code/phpdoc-types#basic-types - if (['bool', 'boolean', 'true', 'fales'].includes(sourceTypeNode.name)) { - return factory.createKeywordTypeNode(SyntaxKind.BooleanKeyword); - } - - if (['int', 'integer', 'float', 'double'].includes(sourceTypeNode.name)) { - return factory.createKeywordTypeNode(SyntaxKind.NumberKeyword); - } - - if (sourceTypeNode.name === 'string') { - return factory.createKeywordTypeNode(SyntaxKind.StringKeyword); - } - - if (sourceTypeNode.name === 'array-key') { - // array-key equals (string | int) - return factory.createUnionTypeNode([ - factory.createKeywordTypeNode(SyntaxKind.StringKeyword), - factory.createKeywordTypeNode(SyntaxKind.NumberKeyword), - ]); - } - - if (sourceTypeNode.name === 'scalar') { - // scalar is equals (float|integer|string|boolean) - // https://github.com/phpDocumentor/phpDocumentor/issues/694 - return factory.createUnionTypeNode([ - factory.createKeywordTypeNode(SyntaxKind.StringKeyword), - factory.createKeywordTypeNode(SyntaxKind.NumberKeyword), - factory.createKeywordTypeNode(SyntaxKind.BooleanKeyword), - ]); - } - - if (sourceTypeNode.name === 'mixed') { - // PHP mixed to TS any - factory.createKeywordTypeNode(SyntaxKind.AnyKeyword); - } - - if (sourceTypeNode.name === 'void') { - return factory.createToken(SyntaxKind.VoidKeyword); - } - - if (sourceTypeNode.name === 'null') { - return factory.createLiteralTypeNode(factory.createNull()); - } - - // Possibly Class Node - // Expr - // Node\Arg - // \Ast\Node\Arg - // the Name starts with uppercase character or '\' - if (/^[A-Z\\]/.test(sourceTypeNode.name)) { - const nameNodeParts = sourceTypeNode.name.split('\\'); - - const tsImportPathAndName = this.nameNodePathResolver(nameNodeParts); - - this.importDeclarations.push( - factory.createImportDeclaration( - undefined, - factory.createImportClause( - tsImportPathAndName.isTypeOnly, - undefined, - factory.createNamedImports([ - factory.createImportSpecifier( - false, - undefined, - factory.createIdentifier(tsImportPathAndName.name), - ), - ]), - ), - factory.createStringLiteral(tsImportPathAndName.path), - undefined, - ), - ); - - return factory.createTypeReferenceNode( - factory.createIdentifier(tsImportPathAndName.name), - undefined, - ); - } - } - - // return any type as a fallback - return factory.createKeywordTypeNode(SyntaxKind.AnyKeyword); - } -} From 1f19a027f7df1ee2db54b0d9dde58d42b0cfd1b4 Mon Sep 17 00:00:00 2001 From: "yilun.sun" Date: Mon, 18 Mar 2024 10:36:21 +0800 Subject: [PATCH 2/5] chore(deps): update dependencies --- package.json | 4 +- pnpm-lock.yaml | 307 +++++++--------------- src/php-parser/helpers/php-doc-helpers.ts | 12 +- 3 files changed, 102 insertions(+), 221 deletions(-) diff --git a/package.json b/package.json index aa1103e..af37ead 100644 --- a/package.json +++ b/package.json @@ -35,11 +35,11 @@ "author": "RightCapital Ecosystem team ", "license": "MIT", "dependencies": { - "@rightcapital/phpdoc-parser": "0.3.40", + "@rightcapital/phpdoc-parser": "0.4.1", "lodash": "4.17.21", "mustache": "4.2.0", "prettier": "3.2.4", - "typescript": "5.3.3" + "typescript": "5.4.2" }, "devDependencies": { "@commitlint/cli": "18.6.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2ef91d6..2b5a8b0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@rightcapital/phpdoc-parser': - specifier: 0.3.40 - version: link:../phpdoc-parser + specifier: 0.4.1 + version: 0.4.1 lodash: specifier: 4.17.21 version: 4.17.21 @@ -18,25 +18,25 @@ dependencies: specifier: 3.2.4 version: 3.2.4 typescript: - specifier: 5.3.3 - version: 5.3.3 + specifier: 5.4.2 + version: 5.4.2 devDependencies: '@commitlint/cli': specifier: 18.6.1 - version: 18.6.1(@types/node@20.11.20)(typescript@5.3.3) + version: 18.6.1(@types/node@20.11.20)(typescript@5.4.2) '@commitlint/config-conventional': specifier: 18.6.2 version: 18.6.2 '@commitlint/cz-commitlint': specifier: 18.6.1 - version: 18.6.1(@types/node@20.11.20)(commitizen@4.3.0)(inquirer@8.2.6)(typescript@5.3.3) + version: 18.6.1(@types/node@20.11.20)(commitizen@4.3.0)(inquirer@8.2.6)(typescript@5.4.2) '@rightcapital/eslint-config-javascript': specifier: 19.0.2 version: 19.0.2(@typescript-eslint/parser@6.20.0)(eslint@8.57.0) '@rightcapital/eslint-config-typescript': specifier: 19.0.2 - version: 19.0.2(eslint@8.57.0)(typescript@5.3.3) + version: 19.0.2(eslint@8.57.0)(typescript@5.4.2) '@rightcapital/prettier-config': specifier: 6.0.14 version: 6.0.14(prettier@3.2.4) @@ -51,7 +51,7 @@ devDependencies: version: 20.11.20 beachball: specifier: 2.40.0 - version: 2.40.0(typescript@5.3.3) + version: 2.40.0(typescript@5.4.2) husky: specifier: 9.0.11 version: 9.0.11 @@ -88,14 +88,14 @@ packages: js-tokens: 4.0.0 dev: true - /@commitlint/cli@18.6.1(@types/node@20.11.20)(typescript@5.3.3): + /@commitlint/cli@18.6.1(@types/node@20.11.20)(typescript@5.4.2): resolution: {integrity: sha512-5IDE0a+lWGdkOvKH892HHAZgbAjcj1mT5QrfA/SVbLJV/BbBMGyKN0W5mhgjekPJJwEQdVNvhl9PwUacY58Usw==} engines: {node: '>=v18'} hasBin: true dependencies: '@commitlint/format': 18.6.1 '@commitlint/lint': 18.6.1 - '@commitlint/load': 18.6.1(@types/node@20.11.20)(typescript@5.3.3) + '@commitlint/load': 18.6.1(@types/node@20.11.20)(typescript@5.4.2) '@commitlint/read': 18.6.1 '@commitlint/types': 18.6.1 execa: 5.1.1 @@ -134,7 +134,7 @@ packages: dev: true optional: true - /@commitlint/cz-commitlint@18.6.1(@types/node@20.11.20)(commitizen@4.3.0)(inquirer@8.2.6)(typescript@5.3.3): + /@commitlint/cz-commitlint@18.6.1(@types/node@20.11.20)(commitizen@4.3.0)(inquirer@8.2.6)(typescript@5.4.2): resolution: {integrity: sha512-ctU/Nti6GMr1p7jWDwN6wveFg73ma1EagcQHz0bL0kd4MWA+7FG1cs5pZX5Bql1YTEqDy3YS6ou8EclUVCfzIg==} engines: {node: '>=v18'} peerDependencies: @@ -142,10 +142,10 @@ packages: inquirer: ^8.0.0 dependencies: '@commitlint/ensure': 18.6.1 - '@commitlint/load': 18.6.1(@types/node@20.11.20)(typescript@5.3.3) + '@commitlint/load': 18.6.1(@types/node@20.11.20)(typescript@5.4.2) '@commitlint/types': 18.6.1 chalk: 4.1.2 - commitizen: 4.3.0(@types/node@20.11.20)(typescript@5.3.3) + commitizen: 4.3.0(@types/node@20.11.20)(typescript@5.4.2) inquirer: 8.2.6 lodash.isplainobject: 4.0.6 word-wrap: 1.2.5 @@ -204,7 +204,7 @@ packages: '@commitlint/types': 18.6.1 dev: true - /@commitlint/load@18.6.1(@types/node@20.11.20)(typescript@5.3.3): + /@commitlint/load@18.6.1(@types/node@20.11.20)(typescript@5.4.2): resolution: {integrity: sha512-p26x8734tSXUHoAw0ERIiHyW4RaI4Bj99D8YgUlVV9SedLf8hlWAfyIFhHRIhfPngLlCe0QYOdRKYFt8gy56TA==} engines: {node: '>=v18'} dependencies: @@ -213,8 +213,8 @@ packages: '@commitlint/resolve-extends': 18.6.1 '@commitlint/types': 18.6.1 chalk: 4.1.2 - cosmiconfig: 8.3.6(typescript@5.3.3) - cosmiconfig-typescript-loader: 5.0.0(@types/node@20.11.20)(cosmiconfig@8.3.6)(typescript@5.3.3) + cosmiconfig: 8.3.6(typescript@5.4.2) + cosmiconfig-typescript-loader: 5.0.0(@types/node@20.11.20)(cosmiconfig@8.3.6)(typescript@5.4.2) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 @@ -224,18 +224,18 @@ packages: - typescript dev: true - /@commitlint/load@19.2.0(@types/node@20.11.20)(typescript@5.3.3): - resolution: {integrity: sha512-XvxxLJTKqZojCxaBQ7u92qQLFMMZc4+p9qrIq/9kJDy8DOrEa7P1yx7Tjdc2u2JxIalqT4KOGraVgCE7eCYJyQ==} + /@commitlint/load@19.0.3(@types/node@20.11.20)(typescript@5.4.2): + resolution: {integrity: sha512-18Tk/ZcDFRKIoKfEcl7kC+bYkEQ055iyKmGsYDoYWpKf6FUvBrP9bIWapuy/MB+kYiltmP9ITiUx6UXtqC9IRw==} engines: {node: '>=v18'} requiresBuild: true dependencies: '@commitlint/config-validator': 19.0.3 '@commitlint/execute-rule': 19.0.0 - '@commitlint/resolve-extends': 19.1.0 + '@commitlint/resolve-extends': 19.0.3 '@commitlint/types': 19.0.3 chalk: 5.3.0 - cosmiconfig: 9.0.0(typescript@5.3.3) - cosmiconfig-typescript-loader: 5.0.0(@types/node@20.11.20)(cosmiconfig@9.0.0)(typescript@5.3.3) + cosmiconfig: 8.3.6(typescript@5.4.2) + cosmiconfig-typescript-loader: 5.0.0(@types/node@20.11.20)(cosmiconfig@8.3.6)(typescript@5.4.2) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 @@ -281,8 +281,8 @@ packages: resolve-global: 1.0.0 dev: true - /@commitlint/resolve-extends@19.1.0: - resolution: {integrity: sha512-z2riI+8G3CET5CPgXJPlzftH+RiWYLMYv4C9tSLdLXdr6pBNimSKukYP9MS27ejmscqCTVA4almdLh0ODD2KYg==} + /@commitlint/resolve-extends@19.0.3: + resolution: {integrity: sha512-18BKmta8OC8+Ub+Q3QGM9l27VjQaXobloVXOrMvu8CpEwJYv62vC/t7Ka5kJnsW0tU9q1eMqJFZ/nN9T/cOaIA==} engines: {node: '>=v18'} requiresBuild: true dependencies: @@ -655,7 +655,7 @@ packages: - supports-color dev: true - /@rightcapital/eslint-config-typescript@19.0.2(eslint@8.57.0)(typescript@5.3.3): + /@rightcapital/eslint-config-typescript@19.0.2(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-MHIEoNmwO6zDO47GctEVggFjGZLg21hyw7ZqGM0sFi5Ec4acWA/QmyZaWrg2//P1bhsvItUTdbYJNZC1m1kmAA==} engines: {node: '>=16.0.0'} peerDependencies: @@ -664,17 +664,27 @@ packages: dependencies: '@rightcapital/eslint-config-base': 19.0.2(@typescript-eslint/parser@6.20.0)(eslint@8.57.0) '@rushstack/eslint-patch': 1.7.2 - '@typescript-eslint/eslint-plugin': 6.20.0(@typescript-eslint/parser@6.20.0)(eslint@8.57.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.20.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.20.0(@typescript-eslint/parser@6.20.0)(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/parser': 6.20.0(eslint@8.57.0)(typescript@5.4.2) eslint: 8.57.0 eslint-config-prettier: 9.1.0(eslint@8.57.0) - typescript: 5.3.3 + typescript: 5.4.2 transitivePeerDependencies: - eslint-import-resolver-node - eslint-import-resolver-webpack - supports-color dev: true + /@rightcapital/phpdoc-parser@0.4.1: + resolution: {integrity: sha512-wB9DvQ1gTcTgh3jtIp/G0pGySgiWww23IIXRvt8i34skS/Bd05b2puxDoEyXD2FIAiqUoeNl61TsQBVIKE3PJQ==} + engines: {node: '>=16.x', pnpm: '>=8.x'} + requiresBuild: true + dependencies: + '@types/node': 20.11.25 + lodash: 4.17.21 + typescript: 5.4.2 + dev: false + /@rightcapital/prettier-config@6.0.14(prettier@3.2.4): resolution: {integrity: sha512-Mr/NcYCLNCHC4MHMVmLoD6bNNtUWHyFE8ROXie6CNuo69Y9WgLgMDdcMGTMRRxujkTVTrI6a3RS5x6h5SKvurw==} engines: {node: '>=16.0.0'} @@ -718,6 +728,12 @@ packages: undici-types: 5.26.5 dev: true + /@types/node@20.11.25: + resolution: {integrity: sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==} + dependencies: + undici-types: 5.26.5 + dev: false + /@types/normalize-package-data@2.4.4: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} dev: true @@ -726,7 +742,7 @@ packages: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} dev: true - /@typescript-eslint/eslint-plugin@6.20.0(@typescript-eslint/parser@6.20.0)(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/eslint-plugin@6.20.0(@typescript-eslint/parser@6.20.0)(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-fTwGQUnjhoYHeSF6m5pWNkzmDDdsKELYrOBxhjMrofPqCkoC2k3B2wvGHFxa1CTIqkEn88nlW1HVMztjo2K8Hg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -738,10 +754,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.20.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.20.0(eslint@8.57.0)(typescript@5.4.2) '@typescript-eslint/scope-manager': 6.20.0 - '@typescript-eslint/type-utils': 6.20.0(eslint@8.57.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.20.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/type-utils': 6.20.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/utils': 6.20.0(eslint@8.57.0)(typescript@5.4.2) '@typescript-eslint/visitor-keys': 6.20.0 debug: 4.3.4 eslint: 8.57.0 @@ -749,13 +765,13 @@ packages: ignore: 5.3.1 natural-compare: 1.4.0 semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.3.0(typescript@5.4.2) + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@6.20.0(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/parser@6.20.0(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-bYerPDF/H5v6V76MdMYhjwmwgMA+jlPVqjSDq2cRqMi8bP5sR3Z+RLOiOMad3nsnmDVmn2gAFCyNgh/dIrfP/w==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -767,11 +783,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 6.20.0 '@typescript-eslint/types': 6.20.0 - '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.4.2) '@typescript-eslint/visitor-keys': 6.20.0 debug: 4.3.4 eslint: 8.57.0 - typescript: 5.3.3 + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true @@ -784,7 +800,7 @@ packages: '@typescript-eslint/visitor-keys': 6.20.0 dev: true - /@typescript-eslint/type-utils@6.20.0(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/type-utils@6.20.0(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-qnSobiJQb1F5JjN0YDRPHruQTrX7ICsmltXhkV536mp4idGAYrIyr47zF/JmkJtEcAVnIz4gUYJ7gOZa6SmN4g==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -794,12 +810,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.20.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.4.2) + '@typescript-eslint/utils': 6.20.0(eslint@8.57.0)(typescript@5.4.2) debug: 4.3.4 eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.3.0(typescript@5.4.2) + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true @@ -809,7 +825,7 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.20.0(typescript@5.3.3): + /@typescript-eslint/typescript-estree@6.20.0(typescript@5.4.2): resolution: {integrity: sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -825,13 +841,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.3.0(typescript@5.4.2) + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@6.20.0(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/utils@6.20.0(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-/EKuw+kRu2vAqCoDwDCBtDRU6CTKbUmwwI7SH7AashZ+W+7o8eiyy6V2cdOqN49KsTcASWsC5QeghYuRDTyOOg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -842,7 +858,7 @@ packages: '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 6.20.0 '@typescript-eslint/types': 6.20.0 - '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.4.2) eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: @@ -992,12 +1008,12 @@ packages: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} dev: true - /beachball@2.40.0(typescript@5.3.3): + /beachball@2.40.0(typescript@5.4.2): resolution: {integrity: sha512-VmgsL5lMs2tqFEUp/LbKjBEEVU9xzy6wu7fOyrTpJopbNHmL18SS2vAQgQTXmjQ6+5kkXON7jTAngiRwnsbHcw==} engines: {node: '>=14.0.0'} hasBin: true dependencies: - cosmiconfig: 8.3.6(typescript@5.3.3) + cosmiconfig: 8.3.6(typescript@5.4.2) execa: 5.1.1 fs-extra: 11.2.0 lodash: 4.17.21 @@ -1163,13 +1179,13 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true - /commitizen@4.3.0(@types/node@20.11.20)(typescript@5.3.3): + /commitizen@4.3.0(@types/node@20.11.20)(typescript@5.4.2): resolution: {integrity: sha512-H0iNtClNEhT0fotHvGV3E9tDejDeS04sN1veIebsKYGMuGscFaswRoYJKmT3eW85eIJAs0F28bG2+a/9wCOfPw==} engines: {node: '>= 12'} hasBin: true dependencies: cachedir: 2.3.0 - cz-conventional-changelog: 3.3.0(@types/node@20.11.20)(typescript@5.3.3) + cz-conventional-changelog: 3.3.0(@types/node@20.11.20)(typescript@5.4.2) dedent: 0.7.0 detect-indent: 6.1.0 find-node-modules: 2.1.3 @@ -1231,7 +1247,7 @@ packages: split2: 4.2.0 dev: true - /cosmiconfig-typescript-loader@5.0.0(@types/node@20.11.20)(cosmiconfig@8.3.6)(typescript@5.3.3): + /cosmiconfig-typescript-loader@5.0.0(@types/node@20.11.20)(cosmiconfig@8.3.6)(typescript@5.4.2): resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==} engines: {node: '>=v16'} peerDependencies: @@ -1240,27 +1256,12 @@ packages: typescript: '>=4' dependencies: '@types/node': 20.11.20 - cosmiconfig: 8.3.6(typescript@5.3.3) + cosmiconfig: 8.3.6(typescript@5.4.2) jiti: 1.21.0 - typescript: 5.3.3 + typescript: 5.4.2 dev: true - /cosmiconfig-typescript-loader@5.0.0(@types/node@20.11.20)(cosmiconfig@9.0.0)(typescript@5.3.3): - resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==} - engines: {node: '>=v16'} - peerDependencies: - '@types/node': '*' - cosmiconfig: '>=8.2' - typescript: '>=4' - dependencies: - '@types/node': 20.11.20 - cosmiconfig: 9.0.0(typescript@5.3.3) - jiti: 1.21.0 - typescript: 5.3.3 - dev: true - optional: true - - /cosmiconfig@8.3.6(typescript@5.3.3): + /cosmiconfig@8.3.6(typescript@5.4.2): resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} engines: {node: '>=14'} peerDependencies: @@ -1273,27 +1274,9 @@ packages: js-yaml: 4.1.0 parse-json: 5.2.0 path-type: 4.0.0 - typescript: 5.3.3 + typescript: 5.4.2 dev: true - /cosmiconfig@9.0.0(typescript@5.3.3): - resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} - engines: {node: '>=14'} - requiresBuild: true - peerDependencies: - typescript: '>=4.9.5' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - env-paths: 2.2.1 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - parse-json: 5.2.0 - typescript: 5.3.3 - dev: true - optional: true - /cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -1303,18 +1286,18 @@ packages: which: 2.0.2 dev: true - /cz-conventional-changelog@3.3.0(@types/node@20.11.20)(typescript@5.3.3): + /cz-conventional-changelog@3.3.0(@types/node@20.11.20)(typescript@5.4.2): resolution: {integrity: sha512-U466fIzU5U22eES5lTNiNbZ+d8dfcHcssH4o7QsdWaCcRs/feIPCxKYSWkYBNs5mny7MvEfwpTLWjvbm94hecw==} engines: {node: '>= 10'} dependencies: chalk: 2.4.2 - commitizen: 4.3.0(@types/node@20.11.20)(typescript@5.3.3) + commitizen: 4.3.0(@types/node@20.11.20)(typescript@5.4.2) conventional-commit-types: 3.0.0 lodash.map: 4.6.0 longest: 2.0.1 word-wrap: 1.2.5 optionalDependencies: - '@commitlint/load': 19.2.0(@types/node@20.11.20)(typescript@5.3.3) + '@commitlint/load': 19.0.3(@types/node@20.11.20)(typescript@5.4.2) transitivePeerDependencies: - '@types/node' - typescript @@ -1325,33 +1308,6 @@ packages: engines: {node: '>=8'} dev: true - /data-view-buffer@1.0.1: - resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-data-view: 1.0.1 - dev: true - - /data-view-byte-length@1.0.1: - resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-data-view: 1.0.1 - dev: true - - /data-view-byte-offset@1.0.0: - resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-data-view: 1.0.1 - dev: true - /debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -1455,21 +1411,14 @@ packages: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true - /enhanced-resolve@5.16.0: - resolution: {integrity: sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==} + /enhanced-resolve@5.15.1: + resolution: {integrity: sha512-3d3JRbwsCLJsYgvb6NuWEG44jjPSOMuS73L/6+7BZuoKm3W+qXnSoIYVHi8dG7Qcg4inAY4jbzkZ7MnskePeDg==} engines: {node: '>=10.13.0'} dependencies: graceful-fs: 4.2.11 tapable: 2.2.1 dev: true - /env-paths@2.2.1: - resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} - engines: {node: '>=6'} - requiresBuild: true - dev: true - optional: true - /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: @@ -1512,67 +1461,15 @@ packages: regexp.prototype.flags: 1.5.2 safe-array-concat: 1.1.2 safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.9 - string.prototype.trimend: 1.0.8 - string.prototype.trimstart: 1.0.7 - typed-array-buffer: 1.0.2 - typed-array-byte-length: 1.0.1 - typed-array-byte-offset: 1.0.2 - typed-array-length: 1.0.5 - unbox-primitive: 1.0.2 - which-typed-array: 1.1.15 - dev: true - - /es-abstract@1.23.1: - resolution: {integrity: sha512-r+YVn6hTqQb+P5kK0u3KeDqrmhHKm+OhU/Mw4jSL4eQtOxXmp75fXIUUb3sUqFZOlb/YtW5JRaIfEC3UyjYUZQ==} - engines: {node: '>= 0.4'} - dependencies: - array-buffer-byte-length: 1.0.1 - arraybuffer.prototype.slice: 1.0.3 - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - data-view-buffer: 1.0.1 - data-view-byte-length: 1.0.1 - data-view-byte-offset: 1.0.0 - es-define-property: 1.0.0 - es-errors: 1.3.0 - es-object-atoms: 1.0.0 - es-set-tostringtag: 2.0.3 - es-to-primitive: 1.2.1 - function.prototype.name: 1.1.6 - get-intrinsic: 1.2.4 - get-symbol-description: 1.0.2 - globalthis: 1.0.3 - gopd: 1.0.1 - has-property-descriptors: 1.0.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - internal-slot: 1.0.7 - is-array-buffer: 3.0.4 - is-callable: 1.2.7 - is-data-view: 1.0.1 - is-negative-zero: 2.0.3 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.3 - is-string: 1.0.7 - is-typed-array: 1.1.13 - is-weakref: 1.0.2 - object-inspect: 1.13.1 - object-keys: 1.1.1 - object.assign: 4.1.5 - regexp.prototype.flags: 1.5.2 - safe-array-concat: 1.1.2 - safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.9 - string.prototype.trimend: 1.0.8 + string.prototype.trim: 1.2.8 + string.prototype.trimend: 1.0.7 string.prototype.trimstart: 1.0.7 typed-array-buffer: 1.0.2 typed-array-byte-length: 1.0.1 typed-array-byte-offset: 1.0.2 typed-array-length: 1.0.5 unbox-primitive: 1.0.2 - which-typed-array: 1.1.15 + which-typed-array: 1.1.14 dev: true /es-define-property@1.0.0: @@ -1587,13 +1484,6 @@ packages: engines: {node: '>= 0.4'} dev: true - /es-object-atoms@1.0.0: - resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} - engines: {node: '>= 0.4'} - dependencies: - es-errors: 1.3.0 - dev: true - /es-set-tostringtag@2.0.3: resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} engines: {node: '>= 0.4'} @@ -1700,7 +1590,7 @@ packages: eslint-plugin-import: '*' dependencies: debug: 4.3.4 - enhanced-resolve: 5.16.0 + enhanced-resolve: 5.15.1 eslint: 8.57.0 eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.20.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-import: /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.20.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) @@ -1736,7 +1626,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.20.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.20.0(eslint@8.57.0)(typescript@5.4.2) debug: 3.2.7 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 @@ -2436,13 +2326,6 @@ packages: hasown: 2.0.2 dev: true - /is-data-view@1.0.1: - resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} - engines: {node: '>= 0.4'} - dependencies: - is-typed-array: 1.1.13 - dev: true - /is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} @@ -2555,7 +2438,7 @@ packages: resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} engines: {node: '>= 0.4'} dependencies: - which-typed-array: 1.1.15 + which-typed-array: 1.1.14 dev: true /is-unicode-supported@0.1.0: @@ -3373,22 +3256,21 @@ packages: strip-ansi: 6.0.1 dev: true - /string.prototype.trim@1.2.9: - resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} + /string.prototype.trim@1.2.8: + resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.23.1 - es-object-atoms: 1.0.0 + es-abstract: 1.22.5 dev: true - /string.prototype.trimend@1.0.8: - resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} + /string.prototype.trimend@1.0.7: + resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-object-atoms: 1.0.0 + es-abstract: 1.22.5 dev: true /string.prototype.trimstart@1.0.7: @@ -3500,13 +3382,13 @@ packages: engines: {node: '>=8'} dev: true - /ts-api-utils@1.3.0(typescript@5.3.3): + /ts-api-utils@1.3.0(typescript@5.4.2): resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.3.3 + typescript: 5.4.2 dev: true /tslib@2.6.2: @@ -3600,8 +3482,8 @@ packages: possible-typed-array-names: 1.0.0 dev: true - /typescript@5.3.3: - resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + /typescript@5.4.2: + resolution: {integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==} engines: {node: '>=14.17'} hasBin: true @@ -3616,7 +3498,6 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - dev: true /universalify@2.0.1: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} @@ -3661,8 +3542,8 @@ packages: is-symbol: 1.0.4 dev: true - /which-typed-array@1.1.15: - resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} + /which-typed-array@1.1.14: + resolution: {integrity: sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==} engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.7 diff --git a/src/php-parser/helpers/php-doc-helpers.ts b/src/php-parser/helpers/php-doc-helpers.ts index 903da55..6efcfe5 100644 --- a/src/php-parser/helpers/php-doc-helpers.ts +++ b/src/php-parser/helpers/php-doc-helpers.ts @@ -8,8 +8,9 @@ import { TokenIterator, TypeParser, type VarTagValueNode, + type NameNodePathResolver, + renderTsNodeToString, } from '@rightcapital/phpdoc-parser'; -import type { NameNodePathResolver } from '@rightcapital/phpdoc-parser/dist/phpdoc-parser/transpiler/php-doc-to-typescript-type-transpiler'; import { EmitHint, type ImportDeclaration, @@ -108,16 +109,15 @@ export class PhpDocHelpers { const transpiler = new ExtendedTranspiler(nameNodePathResolver); transpiler.beforeTranspile(); - const tsTypeNode = transpiler.transpile(typeNode); + const transpiledTypeNode = transpiler.transpile(typeNode); const importDeclarations = transpiler.getImportDeclarations(); const outputTsTypeGeneratedString = - PhpDocHelpers.renderTsNodeToString(tsTypeNode); + renderTsNodeToString(transpiledTypeNode); const importDeclarationGeneratedStrings = importDeclarations.map( - (importDeclaration) => - PhpDocHelpers.renderTsNodeToString(importDeclaration), + (importDeclaration) => renderTsNodeToString(importDeclaration), ); return { - tsTypeNode, + tsTypeNode: transpiledTypeNode, importDeclarations, outputTsTypeGeneratedString, importDeclarationGeneratedStrings, From 98ce696f36a1c38125ef0552a205ee85d13bdc2e Mon Sep 17 00:00:00 2001 From: "yilun.sun" Date: Mon, 18 Mar 2024 10:36:34 +0800 Subject: [PATCH 3/5] fix: remove the no longer used `renderTsNodeToString` --- src/php-parser/helpers/php-doc-helpers.ts | 26 +---------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/php-parser/helpers/php-doc-helpers.ts b/src/php-parser/helpers/php-doc-helpers.ts index 6efcfe5..c1bc0be 100644 --- a/src/php-parser/helpers/php-doc-helpers.ts +++ b/src/php-parser/helpers/php-doc-helpers.ts @@ -11,16 +11,7 @@ import { type NameNodePathResolver, renderTsNodeToString, } from '@rightcapital/phpdoc-parser'; -import { - EmitHint, - type ImportDeclaration, - NewLineKind, - ScriptKind, - ScriptTarget, - type TypeNode, - createPrinter, - createSourceFile, -} from 'typescript'; +import type { ImportDeclaration, TypeNode } from 'typescript'; import { ExtendedTranspiler } from './extended-php-doc-transpiler'; import { FilePathHelpers } from './file-path-helpers'; import type { IUses } from './node-retriever-helpers'; @@ -134,19 +125,4 @@ export class PhpDocHelpers { } return varTagValueNode; } - - private static renderTsNodeToString( - tsNode: TypeNode | ImportDeclaration, - ): string { - const printer = createPrinter({ newLine: NewLineKind.LineFeed }); - - const resultFile = createSourceFile( - 'virtual-file-for-generation.ts', - '', - ScriptTarget.Latest, - /* setParentNodes */ false, - ScriptKind.TS, - ); - return printer.printNode(EmitHint.Unspecified, tsNode, resultFile); - } } From adb572ecff62cca24712ec85303bb36287fd1c95 Mon Sep 17 00:00:00 2001 From: "yilun.sun" Date: Mon, 18 Mar 2024 11:07:27 +0800 Subject: [PATCH 4/5] fix: change return value property name --- src/php-parser/helpers/php-doc-helpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/php-parser/helpers/php-doc-helpers.ts b/src/php-parser/helpers/php-doc-helpers.ts index c1bc0be..d45704b 100644 --- a/src/php-parser/helpers/php-doc-helpers.ts +++ b/src/php-parser/helpers/php-doc-helpers.ts @@ -18,7 +18,7 @@ import type { IUses } from './node-retriever-helpers'; import { TypeGenerationHelpers } from './type-generation-helpers'; export interface ITypeGenerationPackage { - tsTypeNode: TypeNode; + transpiledTypeNode: TypeNode; importDeclarations: ImportDeclaration[]; outputTsTypeGeneratedString: string; importDeclarationGeneratedStrings: string[]; @@ -108,7 +108,7 @@ export class PhpDocHelpers { (importDeclaration) => renderTsNodeToString(importDeclaration), ); return { - tsTypeNode: transpiledTypeNode, + transpiledTypeNode, importDeclarations, outputTsTypeGeneratedString, importDeclarationGeneratedStrings, From a9aa94cf178bf178d7eafea5abb536885018307f Mon Sep 17 00:00:00 2001 From: "yilun.sun" Date: Mon, 18 Mar 2024 13:03:36 +0800 Subject: [PATCH 5/5] fix: remove the unnecessary "dist" part from the import paths --- src/php-parser/helpers/extended-php-doc-transpiler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/php-parser/helpers/extended-php-doc-transpiler.ts b/src/php-parser/helpers/extended-php-doc-transpiler.ts index fffaf4e..b19482b 100644 --- a/src/php-parser/helpers/extended-php-doc-transpiler.ts +++ b/src/php-parser/helpers/extended-php-doc-transpiler.ts @@ -1,7 +1,7 @@ import { type NameNodePathResolver, PhpDocTypeNodeToTypescriptTypeNodeTranspiler, -} from '@rightcapital/phpdoc-parser/dist/phpdoc-parser/transpiler/php-doc-to-typescript-type-transpiler'; +} from '@rightcapital/phpdoc-parser'; export class ExtendedTranspiler extends PhpDocTypeNodeToTypescriptTypeNodeTranspiler { constructor(public resolver: NameNodePathResolver) {