diff --git a/package.json b/package.json index 275f7d6320..49cb7ffbea 100644 --- a/package.json +++ b/package.json @@ -193,7 +193,7 @@ "@schematics/angular": "~17.3.0", "@stylistic/eslint-plugin-ts": "^1.5.4", "@swc-node/register": "^1.6.7", - "@swc/core": "1.5.7", + "@swc/core": "~1.5.24", "@types/estree": "^1.0.5", "@types/jest": "~29.5.2", "@types/node": "^20.0.0", diff --git a/packages/@ama-sdk/core/package.json b/packages/@ama-sdk/core/package.json index 4876ec615c..0842f8ef8c 100644 --- a/packages/@ama-sdk/core/package.json +++ b/packages/@ama-sdk/core/package.json @@ -72,7 +72,7 @@ "prepare:publish": "prepare-publish ./dist" }, "dependencies": { - "@swc/helpers": "^0.5.0", + "@swc/helpers": "~0.5.0", "tslib": "^2.6.2", "uuid": "^9.0.0" }, @@ -131,8 +131,8 @@ "@o3r/test-helpers": "workspace:^", "@schematics/angular": "~17.3.0", "@stylistic/eslint-plugin-ts": "^1.5.4", - "@swc/cli": "^0.3.0", - "@swc/core": "1.5.7", + "@swc/cli": "~0.3.0", + "@swc/core": "~1.5.24", "@types/jest": "~29.5.2", "@types/minimist": "^1.2.2", "@types/node": "^20.0.0", diff --git a/packages/@ama-sdk/schematics/package.json b/packages/@ama-sdk/schematics/package.json index f2a66d4840..215edb89c1 100644 --- a/packages/@ama-sdk/schematics/package.json +++ b/packages/@ama-sdk/schematics/package.json @@ -113,6 +113,19 @@ "type-fest": "^4.10.2", "typescript": "~5.4.2" }, + "generatorDependencies": { + "@swc/cli": "~0.3.0", + "@swc/core": "~1.5.24", + "@swc/helpers": "~0.5.0", + "@commitlint/cli": "^18.0.0", + "@commitlint/config-conventional": "^18.0.0", + "jest-junit": "~16.0.0", + "lint-staged": "^15.0.0", + "minimist": "^1.2.6", + "rimraf": "^5.0.1", + "typedoc": "~0.25.0", + "tsc-watch": "^6.0.4" + }, "openApiSupportedVersion": "~7.4.0", "engines": { "node": ">=18.0.0" diff --git a/packages/@ama-sdk/schematics/schematics/helpers/read-package.ts b/packages/@ama-sdk/schematics/schematics/helpers/read-package.ts index a5ebcfb902..4cab83ffff 100644 --- a/packages/@ama-sdk/schematics/schematics/helpers/read-package.ts +++ b/packages/@ama-sdk/schematics/schematics/helpers/read-package.ts @@ -3,7 +3,7 @@ import * as path from 'node:path'; import type { PackageJson } from 'type-fest'; /** Get generator package.json */ -export const readPackageJson = async (): Promise => { +export const readPackageJson = async }>(): Promise => { const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json'); return JSON.parse(await fs.readFile(packageJsonPath, {encoding: 'utf-8'})); diff --git a/packages/@ama-sdk/schematics/schematics/typescript/shell/index.ts b/packages/@ama-sdk/schematics/schematics/typescript/shell/index.ts index 054f48feb6..2a4742ce09 100644 --- a/packages/@ama-sdk/schematics/schematics/typescript/shell/index.ts +++ b/packages/@ama-sdk/schematics/schematics/typescript/shell/index.ts @@ -34,25 +34,36 @@ function ngGenerateTypescriptSDKFn(options: NgGenerateTypescriptSDKShellSchemati /* eslint-disable @typescript-eslint/naming-convention */ const versions = { 'tslib': amaSdkSchematicsPackageJson.dependencies!.tslib, + '@commitlint/cli': amaSdkSchematicsPackageJson.generatorDependencies['@commitlint/cli'], + '@commitlint/config-conventional': amaSdkSchematicsPackageJson.generatorDependencies['@commitlint/config-conventional'], + '@swc/helpers': amaSdkSchematicsPackageJson.generatorDependencies['@swc/helpers'], + '@swc/cli': amaSdkSchematicsPackageJson.generatorDependencies['@swc/cli'], + '@swc/core': amaSdkSchematicsPackageJson.generatorDependencies['@swc/core'], '@types/jest': amaSdkSchematicsPackageJson.devDependencies!['@types/jest'], '@types/node': amaSdkSchematicsPackageJson.devDependencies!['@types/node'], '@typescript-eslint/eslint-plugin': amaSdkSchematicsPackageJson.devDependencies!['@typescript-eslint/eslint-plugin'], '@typescript-eslint/parser': amaSdkSchematicsPackageJson.devDependencies!['@typescript-eslint/parser'], - 'eslint': amaSdkSchematicsPackageJson.devDependencies!.eslint, + '@openapitools/openapi-generator-cli': amaSdkSchematicsPackageJson.devDependencies!['@openapitools/openapi-generator-cli'], + '@stylistic/eslint-plugin-ts': amaSdkSchematicsPackageJson.devDependencies!['@stylistic/eslint-plugin-ts'], + 'commit-and-tag-version': amaSdkSchematicsPackageJson.devDependencies!['commit-and-tag-version'], + 'cpy-cli': amaSdkSchematicsPackageJson.devDependencies!['cpy-cli'], 'eslint-plugin-jest': amaSdkSchematicsPackageJson.devDependencies!['eslint-plugin-jest'], 'eslint-plugin-jsdoc': amaSdkSchematicsPackageJson.devDependencies!['eslint-plugin-jsdoc'], 'eslint-plugin-prefer-arrow': amaSdkSchematicsPackageJson.devDependencies!['eslint-plugin-prefer-arrow'], 'eslint-plugin-unicorn': amaSdkSchematicsPackageJson.devDependencies!['eslint-plugin-unicorn'], + 'eslint': amaSdkSchematicsPackageJson.devDependencies!.eslint, + 'globby': amaSdkSchematicsPackageJson.devDependencies!.globby, 'isomorphic-fetch': amaSdkSchematicsPackageJson.devDependencies!['isomorphic-fetch'], - 'cpy-cli': amaSdkSchematicsPackageJson.devDependencies!['cpy-cli'], 'jest': amaSdkSchematicsPackageJson.devDependencies!.jest, + 'rxjs': amaSdkSchematicsPackageJson.dependencies!.rxjs, 'ts-jest': amaSdkSchematicsPackageJson.devDependencies!['ts-jest'], - 'globby': amaSdkSchematicsPackageJson.devDependencies!.globby, 'typescript': amaSdkSchematicsPackageJson.devDependencies!.typescript, - '@openapitools/openapi-generator-cli': amaSdkSchematicsPackageJson.devDependencies!['@openapitools/openapi-generator-cli'], - '@stylistic/eslint-plugin-ts': amaSdkSchematicsPackageJson.devDependencies!['@stylistic/eslint-plugin-ts'], - 'rxjs': amaSdkSchematicsPackageJson.dependencies!.rxjs, - 'commit-and-tag-version': amaSdkSchematicsPackageJson.devDependencies!['commit-and-tag-version'] + 'jest-junit': amaSdkSchematicsPackageJson.generatorDependencies['jest-junit'], + 'lint-staged': amaSdkSchematicsPackageJson.generatorDependencies['lint-staged'], + 'minimist': amaSdkSchematicsPackageJson.generatorDependencies.minimist, + 'rimraf': amaSdkSchematicsPackageJson.generatorDependencies.rimraf, + 'tsc-watch': amaSdkSchematicsPackageJson.generatorDependencies['tsc-watch'], + 'typedoc': amaSdkSchematicsPackageJson.generatorDependencies.typedoc }; const openApiSupportedVersion = typeof amaSdkSchematicsPackageJson.openApiSupportedVersion === 'string' && amaSdkSchematicsPackageJson.openApiSupportedVersion.replace(/\^|~/, ''); diff --git a/packages/@ama-sdk/schematics/schematics/typescript/shell/templates/base/package.json.template b/packages/@ama-sdk/schematics/schematics/typescript/shell/templates/base/package.json.template index 9165333bcb..f2b8d03513 100644 --- a/packages/@ama-sdk/schematics/schematics/typescript/shell/templates/base/package.json.template +++ b/packages/@ama-sdk/schematics/schematics/typescript/shell/templates/base/package.json.template @@ -56,7 +56,7 @@ ] }, "dependencies": { - "@swc/helpers": "^0.5.0", + "@swc/helpers": "<%= versions['@swc/helpers'] %>", "tslib": "<%= versions['tslib'] %>" }, "peerDependenciesMeta": { @@ -73,9 +73,9 @@ "@angular-eslint/utils": "<%= angularEslintVersion %>", "@angular/compiler": "<%= angularVersion %>", "@angular/cli": "<%= angularVersion %>", - "@commitlint/cli": "^17.0.0", + "@commitlint/cli": "<%= versions['@commitlint/cli'] %>", "@schematics/angular": "<%= angularVersion %>", - "@commitlint/config-conventional": "^17.0.0", + "@commitlint/config-conventional": "<%= versions['@commitlint/config-conventional'] %>", "@ama-sdk/schematics": "<%= sdkCoreRange %>", "@ama-sdk/core": "<%= sdkCoreRange %>", "@o3r/eslint-config-otter": "<%= sdkCoreRange %>", @@ -83,8 +83,8 @@ "@o3r/schematics": "<%= sdkCoreRange %>", "@openapitools/openapi-generator-cli": "<%= versions['@openapitools/openapi-generator-cli'] %>", "@stylistic/eslint-plugin-ts": "<%= versions['@stylistic/eslint-plugin-ts'] %>", - "@swc/cli": "^0.1.57", - "@swc/core": "1.5.7", + "@swc/cli": "<%= versions['@swc/cli'] %>", + "@swc/core": "<%= versions['@swc/core'] %>", "@types/jest": "<%= versions['@types/jest'] %>", "@types/node": "<%= versions['@types/node'] %>", "@typescript-eslint/eslint-plugin": "<%= versions['@typescript-eslint/eslint-plugin'] %>", @@ -99,15 +99,15 @@ "globby": "<%= versions['globby'] %>", "isomorphic-fetch": "<%= versions['isomorphic-fetch'] %>", "jest": "<%= versions['jest'] %>", - "jest-junit": "~16.0.0", - "lint-staged": "^13.0.0", - "minimist": "^1.2.6", - "rimraf": "^5.0.1", + "jest-junit": "<%= versions['jest-junit'] %>", + "lint-staged": "<%= versions['lint-staged'] %>", + "minimist": "<%= versions['minimist'] %>", + "rimraf": "<%= versions['rimraf'] %>", "rxjs": "<%= versions['rxjs'] %>", "commit-and-tag-version": "<%= versions['commit-and-tag-version'] %>", "ts-jest": "<%= versions['ts-jest'] %>", - "typedoc": "~0.25.0", - "tsc-watch": "^6.0.0", + "typedoc": "<%= versions['typedoc'] %>", + "tsc-watch": "<%= versions['tsc-watch'] %>", "typescript": "<%= versions['typescript'] %>"<% if (specPackageName) { %>, "<%=specPackageName%>": "<%=specPackageVersion%>"<% } %> },<% if (exactO3rVersion) { %> diff --git a/packages/@ama-sdk/showcase-sdk/package.json b/packages/@ama-sdk/showcase-sdk/package.json index 70ee32b253..0c21a8214c 100644 --- a/packages/@ama-sdk/showcase-sdk/package.json +++ b/packages/@ama-sdk/showcase-sdk/package.json @@ -55,7 +55,7 @@ "tools:changelog": "commit-and-tag-version" }, "dependencies": { - "@swc/helpers": "^0.5.0", + "@swc/helpers": "~0.5.0", "tslib": "^2.6.2" }, "peerDependenciesMeta": { @@ -82,8 +82,8 @@ "@openapitools/openapi-generator-cli": "~2.13.0", "@schematics/angular": "~17.3.0", "@stylistic/eslint-plugin-ts": "^1.5.4", - "@swc/cli": "^0.3.0", - "@swc/core": "1.5.7", + "@swc/cli": "~0.3.0", + "@swc/core": "~1.5.24", "@types/jest": "~29.5.2", "@types/node": "^20.0.0", "@typescript-eslint/eslint-plugin": "^7.2.0", diff --git a/yarn.lock b/yarn.lock index ad3afa6fb9..345fd5fdcd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -129,9 +129,9 @@ __metadata: "@o3r/test-helpers": "workspace:^" "@schematics/angular": "npm:~17.3.0" "@stylistic/eslint-plugin-ts": "npm:^1.5.4" - "@swc/cli": "npm:^0.3.0" - "@swc/core": "npm:1.5.7" - "@swc/helpers": "npm:^0.5.0" + "@swc/cli": "npm:~0.3.0" + "@swc/core": "npm:~1.5.24" + "@swc/helpers": "npm:~0.5.0" "@types/jest": "npm:~29.5.2" "@types/minimist": "npm:^1.2.2" "@types/node": "npm:^20.0.0" @@ -356,9 +356,9 @@ __metadata: "@openapitools/openapi-generator-cli": "npm:~2.13.0" "@schematics/angular": "npm:~17.3.0" "@stylistic/eslint-plugin-ts": "npm:^1.5.4" - "@swc/cli": "npm:^0.3.0" - "@swc/core": "npm:1.5.7" - "@swc/helpers": "npm:^0.5.0" + "@swc/cli": "npm:~0.3.0" + "@swc/core": "npm:~1.5.24" + "@swc/helpers": "npm:~0.5.0" "@types/jest": "npm:~29.5.2" "@types/node": "npm:^20.0.0" "@typescript-eslint/eslint-plugin": "npm:^7.2.0" @@ -8096,7 +8096,7 @@ __metadata: "@schematics/angular": "npm:~17.3.0" "@stylistic/eslint-plugin-ts": "npm:^1.5.4" "@swc-node/register": "npm:^1.6.7" - "@swc/core": "npm:1.5.7" + "@swc/core": "npm:~1.5.24" "@types/estree": "npm:^1.0.5" "@types/jest": "npm:~29.5.2" "@types/node": "npm:^20.0.0" @@ -11504,7 +11504,7 @@ __metadata: languageName: node linkType: hard -"@swc/cli@npm:^0.3.0": +"@swc/cli@npm:~0.3.0": version: 0.3.12 resolution: "@swc/cli@npm:0.3.12" dependencies: @@ -11538,13 +11538,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.5.7": - version: 1.5.7 - resolution: "@swc/core-darwin-arm64@npm:1.5.7" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@swc/core-darwin-x64@npm:1.5.24": version: 1.5.24 resolution: "@swc/core-darwin-x64@npm:1.5.24" @@ -11552,13 +11545,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.5.7": - version: 1.5.7 - resolution: "@swc/core-darwin-x64@npm:1.5.7" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@swc/core-linux-arm-gnueabihf@npm:1.5.24": version: 1.5.24 resolution: "@swc/core-linux-arm-gnueabihf@npm:1.5.24" @@ -11566,13 +11552,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.5.7": - version: 1.5.7 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.5.7" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - "@swc/core-linux-arm64-gnu@npm:1.5.24": version: 1.5.24 resolution: "@swc/core-linux-arm64-gnu@npm:1.5.24" @@ -11580,13 +11559,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.5.7": - version: 1.5.7 - resolution: "@swc/core-linux-arm64-gnu@npm:1.5.7" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - "@swc/core-linux-arm64-musl@npm:1.5.24": version: 1.5.24 resolution: "@swc/core-linux-arm64-musl@npm:1.5.24" @@ -11594,13 +11566,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.5.7": - version: 1.5.7 - resolution: "@swc/core-linux-arm64-musl@npm:1.5.7" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - "@swc/core-linux-x64-gnu@npm:1.5.24": version: 1.5.24 resolution: "@swc/core-linux-x64-gnu@npm:1.5.24" @@ -11608,13 +11573,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.5.7": - version: 1.5.7 - resolution: "@swc/core-linux-x64-gnu@npm:1.5.7" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - "@swc/core-linux-x64-musl@npm:1.5.24": version: 1.5.24 resolution: "@swc/core-linux-x64-musl@npm:1.5.24" @@ -11622,13 +11580,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.5.7": - version: 1.5.7 - resolution: "@swc/core-linux-x64-musl@npm:1.5.7" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - "@swc/core-win32-arm64-msvc@npm:1.5.24": version: 1.5.24 resolution: "@swc/core-win32-arm64-msvc@npm:1.5.24" @@ -11636,13 +11587,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.5.7": - version: 1.5.7 - resolution: "@swc/core-win32-arm64-msvc@npm:1.5.7" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@swc/core-win32-ia32-msvc@npm:1.5.24": version: 1.5.24 resolution: "@swc/core-win32-ia32-msvc@npm:1.5.24" @@ -11650,13 +11594,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.5.7": - version: 1.5.7 - resolution: "@swc/core-win32-ia32-msvc@npm:1.5.7" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@swc/core-win32-x64-msvc@npm:1.5.24": version: 1.5.24 resolution: "@swc/core-win32-x64-msvc@npm:1.5.24" @@ -11664,60 +11601,7 @@ __metadata: languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.5.7": - version: 1.5.7 - resolution: "@swc/core-win32-x64-msvc@npm:1.5.7" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - -"@swc/core@npm:1.5.7": - version: 1.5.7 - resolution: "@swc/core@npm:1.5.7" - dependencies: - "@swc/core-darwin-arm64": "npm:1.5.7" - "@swc/core-darwin-x64": "npm:1.5.7" - "@swc/core-linux-arm-gnueabihf": "npm:1.5.7" - "@swc/core-linux-arm64-gnu": "npm:1.5.7" - "@swc/core-linux-arm64-musl": "npm:1.5.7" - "@swc/core-linux-x64-gnu": "npm:1.5.7" - "@swc/core-linux-x64-musl": "npm:1.5.7" - "@swc/core-win32-arm64-msvc": "npm:1.5.7" - "@swc/core-win32-ia32-msvc": "npm:1.5.7" - "@swc/core-win32-x64-msvc": "npm:1.5.7" - "@swc/counter": "npm:^0.1.2" - "@swc/types": "npm:0.1.7" - peerDependencies: - "@swc/helpers": ^0.5.0 - dependenciesMeta: - "@swc/core-darwin-arm64": - optional: true - "@swc/core-darwin-x64": - optional: true - "@swc/core-linux-arm-gnueabihf": - optional: true - "@swc/core-linux-arm64-gnu": - optional: true - "@swc/core-linux-arm64-musl": - optional: true - "@swc/core-linux-x64-gnu": - optional: true - "@swc/core-linux-x64-musl": - optional: true - "@swc/core-win32-arm64-msvc": - optional: true - "@swc/core-win32-ia32-msvc": - optional: true - "@swc/core-win32-x64-msvc": - optional: true - peerDependenciesMeta: - "@swc/helpers": - optional: true - checksum: 10/83e03908db40f2133c3624a83d4550336d7a56e64af7d42fd959c746b8da950a253f3c6d9eaa3467e10abeda024aa6b039a987adc839326f969e1d26625f14ef - languageName: node - linkType: hard - -"@swc/core@npm:^1.3.82": +"@swc/core@npm:^1.3.82, @swc/core@npm:~1.5.24": version: 1.5.24 resolution: "@swc/core@npm:1.5.24" dependencies: @@ -11763,14 +11647,14 @@ __metadata: languageName: node linkType: hard -"@swc/counter@npm:^0.1.2, @swc/counter@npm:^0.1.3": +"@swc/counter@npm:^0.1.3": version: 0.1.3 resolution: "@swc/counter@npm:0.1.3" checksum: 10/df8f9cfba9904d3d60f511664c70d23bb323b3a0803ec9890f60133954173047ba9bdeabce28cd70ba89ccd3fd6c71c7b0bd58be85f611e1ffbe5d5c18616598 languageName: node linkType: hard -"@swc/helpers@npm:^0.5.0": +"@swc/helpers@npm:~0.5.0": version: 0.5.11 resolution: "@swc/helpers@npm:0.5.11" dependencies: @@ -11779,7 +11663,7 @@ __metadata: languageName: node linkType: hard -"@swc/types@npm:0.1.7, @swc/types@npm:^0.1.7": +"@swc/types@npm:^0.1.7": version: 0.1.7 resolution: "@swc/types@npm:0.1.7" dependencies: