diff --git a/commitlint.config.js b/commitlint.config.js index a2c1d2f00..3c50b3ec9 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -7,7 +7,7 @@ module.exports = { extends: ['@commitlint/config-conventional'], rules: { 'type-enum': [2, 'always', [...rules['type-enum'][2], 'api', 'release']], - 'scope-enum': [2, 'always', ['connector', 'console', 'core', 'demo-app', 'test', 'phrases', 'schemas', 'shared', 'ui', 'deps', 'connector-core', 'cli']], + 'scope-enum': [2, 'always', ['connector', 'console', 'core', 'demo-app', 'test', 'phrases', 'schemas', 'shared', 'ui', 'deps','cli', 'toolkit']], // Slightly increase the tolerance to allow the appending PR number ...(isCi && { 'header-max-length': [2, 'always', 110] }) }, diff --git a/packages/cli/package.json b/packages/cli/package.json index 6bb988750..d830fbb20 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -33,7 +33,7 @@ "lint:report": "pnpm lint --format json --output-file report.json", "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", "test": "pnpm build:test && pnpm test:only", - "test:ci": "pnpm run test:only", + "test:ci": "pnpm test:only", "prepack": "pnpm build" }, "engines": { diff --git a/packages/core/package.json b/packages/core/package.json index 3f855ead7..904cf90fb 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -21,7 +21,7 @@ "start": "NODE_ENV=production node build/index.js", "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", "test": "pnpm build:test && pnpm test:only", - "test:ci": "pnpm run test:only --coverage --silent", + "test:ci": "pnpm test:only --coverage --silent", "test:report": "codecov -F core" }, "dependencies": { diff --git a/packages/schemas/package.json b/packages/schemas/package.json index 43a95206d..972193a33 100644 --- a/packages/schemas/package.json +++ b/packages/schemas/package.json @@ -27,7 +27,7 @@ "prepack": "pnpm build", "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", "test": "pnpm build:test && pnpm test:only", - "test:ci": "pnpm run test:only" + "test:ci": "pnpm test:only" }, "engines": { "node": "^16.13.0 || ^18.12.0" diff --git a/packages/shared/package.json b/packages/shared/package.json index 8749e9208..d1ad5168b 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -29,7 +29,7 @@ "prepack": "pnpm build", "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", "test": "pnpm build:test && pnpm test:only", - "test:ci": "pnpm run test:only" + "test:ci": "pnpm test:only" }, "devDependencies": { "@silverhand/eslint-config": "1.3.0", diff --git a/packages/toolkit/connector-kit/package.json b/packages/toolkit/connector-kit/package.json index f76be8e25..72171a1e4 100644 --- a/packages/toolkit/connector-kit/package.json +++ b/packages/toolkit/connector-kit/package.json @@ -22,8 +22,8 @@ "scripts": { "precommit": "lint-staged", "dev": "tsc --watch --preserveWatchOutput --incremental", - "build:test": "pnpm build", "build": "rm -rf lib/ && rollup -c && tsc", + "build:test": "pnpm build", "lint": "eslint --ext .ts src", "lint:report": "pnpm lint --format json --output-file report.json", "prepack": "pnpm build" diff --git a/packages/toolkit/core-kit/jest.config.js b/packages/toolkit/core-kit/jest.config.js new file mode 100644 index 000000000..567c4ad15 --- /dev/null +++ b/packages/toolkit/core-kit/jest.config.js @@ -0,0 +1,12 @@ +/** @type {import('jest').Config} */ +const config = { + coveragePathIgnorePatterns: ['/node_modules/', '/src/__mocks__/'], + coverageReporters: ['text-summary', 'lcov'], + setupFilesAfterEnv: ['jest-matcher-specific-error'], + roots: ['./lib'], + moduleNameMapper: { + '^(chalk|inquirer)$': '/../../shared/lib/esm/module-proxy.js', + }, +}; + +export default config; diff --git a/packages/toolkit/core-kit/jest.config.ts b/packages/toolkit/core-kit/jest.config.ts deleted file mode 100644 index 2a644a24e..000000000 --- a/packages/toolkit/core-kit/jest.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Config } from '@jest/types'; - -const config: Config.InitialOptions = { - preset: 'ts-jest', - moduleNameMapper: { - '^(\\.{1,2}/.*)\\.js$': '$1', - }, - collectCoverageFrom: ['src/**/*.ts'], - coverageReporters: ['lcov', 'text-summary'], - setupFilesAfterEnv: ['jest-matcher-specific-error'], -}; - -export default config; diff --git a/packages/toolkit/core-kit/package.json b/packages/toolkit/core-kit/package.json index bfdea7463..55d2cd655 100644 --- a/packages/toolkit/core-kit/package.json +++ b/packages/toolkit/core-kit/package.json @@ -25,13 +25,15 @@ "precommit": "lint-staged", "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput --incremental", "build": "rm -rf lib/ && rollup -c && tsc -p tsconfig.build.json", - "build:test": "pnpm build", + "build:test": "pnpm build -p tsconfig.test.json --sourcemap", "lint": "eslint --ext .ts src", "lint:report": "pnpm lint --format json --output-file report.json", "prepack": "pnpm build", "stylelint": "stylelint \"scss/**/*.scss\"", - "test": "jest", - "test:coverage": "jest --silent --coverage" + "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", + "test": "pnpm build:test && pnpm test:only", + "test:ci": "pnpm test:only", + "test:coverage": "pnpm test:only --silent --coverage" }, "engines": { "node": "^16.13.0 || ^18.12.0" @@ -63,7 +65,6 @@ "prettier": "^2.7.1", "rollup": "^3.6.0", "stylelint": "^14.9.1", - "ts-jest": "^29.0.1", "tslib": "^2.4.1", "typescript": "^4.9.4" }, diff --git a/packages/toolkit/core-kit/tsconfig.json b/packages/toolkit/core-kit/tsconfig.json index a3439e9fa..b0968ab59 100644 --- a/packages/toolkit/core-kit/tsconfig.json +++ b/packages/toolkit/core-kit/tsconfig.json @@ -6,5 +6,5 @@ "moduleResolution": "nodenext", "module": "esnext" }, - "include": ["src", "declaration", "jest.config.ts"] + "include": ["src", "declaration"] } diff --git a/packages/toolkit/core-kit/tsconfig.test.json b/packages/toolkit/core-kit/tsconfig.test.json new file mode 100644 index 000000000..55de18c33 --- /dev/null +++ b/packages/toolkit/core-kit/tsconfig.test.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "isolatedModules": false, + "allowJs": true + }, + "include": ["src"] +} diff --git a/packages/toolkit/language-kit/jest.config.js b/packages/toolkit/language-kit/jest.config.js new file mode 100644 index 000000000..2a6f21ab3 --- /dev/null +++ b/packages/toolkit/language-kit/jest.config.js @@ -0,0 +1,11 @@ +/** @type {import('jest').Config} */ +const config = { + coveragePathIgnorePatterns: ['/node_modules/', '/src/__mocks__/'], + coverageReporters: ['text-summary', 'lcov'], + roots: ['./lib'], + moduleNameMapper: { + '^(chalk|inquirer)$': '/../../shared/lib/esm/module-proxy.js', + }, +}; + +export default config; diff --git a/packages/toolkit/language-kit/jest.config.ts b/packages/toolkit/language-kit/jest.config.ts deleted file mode 100644 index 8a0c2eca4..000000000 --- a/packages/toolkit/language-kit/jest.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Config } from '@jest/types'; - -const config: Config.InitialOptions = { - preset: 'ts-jest', - moduleNameMapper: { - '^(\\.{1,2}/.*)\\.js$': '$1', - }, - collectCoverageFrom: ['src/**/*.ts'], - coverageReporters: ['lcov', 'text-summary'], -}; - -export default config; diff --git a/packages/toolkit/language-kit/package.json b/packages/toolkit/language-kit/package.json index be7cf1bc5..d8e8f4933 100644 --- a/packages/toolkit/language-kit/package.json +++ b/packages/toolkit/language-kit/package.json @@ -22,12 +22,14 @@ "scripts": { "precommit": "lint-staged", "build": "rm -rf lib/ && rollup -c && tsc -p tsconfig.build.json", - "build:test": "pnpm build", + "build:test": "pnpm build -p tsconfig.test.json --sourcemap", "lint": "eslint --ext .ts src", "lint:report": "pnpm lint --format json --output-file report.json", "prepack": "pnpm build", - "test": "jest", - "test:coverage": "jest --silent --coverage" + "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", + "test": "pnpm build:test && pnpm test:only", + "test:ci": "pnpm test:only", + "test:coverage": "pnpm test:only --silent --coverage" }, "engines": { "node": "^16.13.0 || ^18.12.0" @@ -47,7 +49,6 @@ "lint-staged": "^13.0.0", "prettier": "^2.7.1", "rollup": "^3.6.0", - "ts-jest": "^29.0.1", "tslib": "^2.4.1", "typescript": "^4.9.4" }, diff --git a/packages/toolkit/language-kit/tsconfig.json b/packages/toolkit/language-kit/tsconfig.json index f01468a1d..2fbe31acc 100644 --- a/packages/toolkit/language-kit/tsconfig.json +++ b/packages/toolkit/language-kit/tsconfig.json @@ -5,6 +5,5 @@ "baseUrl": ".", "moduleResolution": "nodenext", "module": "esnext" - }, - "include": ["src", "jest.config.ts"] + } } diff --git a/packages/toolkit/language-kit/tsconfig.test.json b/packages/toolkit/language-kit/tsconfig.test.json new file mode 100644 index 000000000..55de18c33 --- /dev/null +++ b/packages/toolkit/language-kit/tsconfig.test.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "isolatedModules": false, + "allowJs": true + }, + "include": ["src"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5d16acb0a..ae0c67b79 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -704,7 +704,6 @@ importers: prettier: ^2.7.1 rollup: ^3.6.0 stylelint: ^14.9.1 - ts-jest: ^29.0.1 tslib: ^2.4.1 typescript: ^4.9.4 zod: ^3.20.2 @@ -733,7 +732,6 @@ importers: prettier: 2.7.1 rollup: 3.7.4 stylelint: 14.9.1 - ts-jest: 29.0.3_a67wnu7kur6t3xg6vztzc6sc5i tslib: 2.4.1 typescript: 4.9.4 @@ -750,7 +748,6 @@ importers: lint-staged: ^13.0.0 prettier: ^2.7.1 rollup: ^3.6.0 - ts-jest: ^29.0.1 tslib: ^2.4.1 typescript: ^4.9.4 zod: ^3.20.2 @@ -768,7 +765,6 @@ importers: lint-staged: 13.0.0 prettier: 2.7.1 rollup: 3.7.4 - ts-jest: 29.0.3_a67wnu7kur6t3xg6vztzc6sc5i tslib: 2.4.1 typescript: 4.9.4 @@ -14429,40 +14425,6 @@ packages: resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} dev: true - /ts-jest/29.0.3_a67wnu7kur6t3xg6vztzc6sc5i: - resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - '@babel/core': '>=7.0.0-beta.0 <8' - '@jest/types': ^29.0.0 - babel-jest: ^29.0.0 - esbuild: '*' - jest: ^29.0.0 || ^29.1.2 - typescript: '>=4.3' - peerDependenciesMeta: - '@babel/core': - optional: true - '@jest/types': - optional: true - babel-jest: - optional: true - esbuild: - optional: true - dependencies: - '@jest/types': 29.3.1 - bs-logger: 0.2.6 - fast-json-stable-stringify: 2.1.0 - jest: 29.3.1_@types+node@16.11.12 - jest-util: 29.3.1 - json5: 2.2.1 - lodash.memoize: 4.1.2 - make-error: 1.3.6 - semver: 7.3.8 - typescript: 4.9.4 - yargs-parser: 21.1.1 - dev: true - /ts-jest/29.0.3_h5yo4o4jl7fzim4gycvvdmdsqu: resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}