diff --git a/package-lock.json b/package-lock.json index c750a48c..d1faaefe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,6 +42,7 @@ "@ladle/react": "^5.0.3", "@testing-library/react": "16.3.2", "@testing-library/user-event": "14.6.1", + "@tsconfig/recommended": "^1.0.13", "@types/chai": "^5.0.0", "@types/chai-dom": "^1.11.3", "@types/glob": "9.0.0", @@ -71,7 +72,7 @@ "sinon": "^22.0.0", "sinon-chai": "^4.0.0", "ts-node": "^10.9.1", - "typescript": "5.9.3" + "typescript": "6.0.3" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", @@ -5147,6 +5148,13 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, + "node_modules/@tsconfig/recommended": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@tsconfig/recommended/-/recommended-1.0.13.tgz", + "integrity": "sha512-sySRuBfMKyKO/j2ZAhR8kSembhjuPEV4Ra3AHtmWLq51+iGaudr45crPSzNC5b7/Ctrh9dfUpBuTlYrH6rM58Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/aria-query": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", @@ -13427,9 +13435,9 @@ } }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -13831,6 +13839,22 @@ } } }, + "node_modules/vite-tsconfig-paths/node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/vite/node_modules/fdir": { "version": "6.4.4", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", diff --git a/package.json b/package.json index 3f3337db..7afb5d2e 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "24.3.0", "description": "React components for Cucumber", "type": "module", - "main": "dist/src/index.js", - "types": "dist/src/index.d.ts", + "main": "dist/index.js", + "types": "dist/index.d.ts", "files": [ "dist" ], @@ -16,7 +16,7 @@ "license": "MIT", "scripts": { "prepare": "node generate-fixtures.cjs", - "compile": "tsc --project tsconfig.build.json && cpy 'src/**/*.scss' 'dist/src'", + "compile": "tsc --project tsconfig.build.json && cpy 'src/**/*.scss' 'dist'", "test": "mocha 'src/**/*.spec.*'", "start": "ladle serve", "build": "ladle build", @@ -63,6 +63,7 @@ "@ladle/react": "^5.0.3", "@testing-library/react": "16.3.2", "@testing-library/user-event": "14.6.1", + "@tsconfig/recommended": "^1.0.13", "@types/chai": "^5.0.0", "@types/chai-dom": "^1.11.3", "@types/glob": "9.0.0", @@ -92,7 +93,7 @@ "sinon": "^22.0.0", "sinon-chai": "^4.0.0", "ts-node": "^10.9.1", - "typescript": "5.9.3" + "typescript": "6.0.3" }, "overrides": { "uuid": "14.0.0" diff --git a/src/hooks/useResultStatistics.ts b/src/hooks/useResultStatistics.ts index 4ecdfaf4..8f3b7ea4 100644 --- a/src/hooks/useResultStatistics.ts +++ b/src/hooks/useResultStatistics.ts @@ -15,8 +15,8 @@ export function useResultStatistics(): { .filter(([, value]) => { return value > 0 }) - .map(([key]) => key) - .sort(statusComparator) as TestStepResultStatus[] + .map(([key]) => key as TestStepResultStatus) + .sort(statusComparator) const totalScenarioCount = [...Object.values(scenarioCountByStatus)].reduce( (prev, curr) => prev + curr, diff --git a/tsconfig.build.json b/tsconfig.build.json index f80b71e1..b8e20396 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,15 +1,9 @@ { "extends": "./tsconfig.json", - "compilerOptions": { - "composite": true, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "inlineSources": true, - "rootDir": ".", - "outDir": "dist", - "noEmit": false - }, "include": ["src"], - "exclude": ["src/**/*.spec.*", "src/**/*.stories.*"] + "exclude": ["src/**/*.spec.*", "src/**/*.stories.*"], + "compilerOptions": { + "rootDir": "src", + "outDir": "dist" + } } diff --git a/tsconfig.json b/tsconfig.json index 70cbbadb..c09d9a27 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,23 +1,21 @@ { + "extends": "./node_modules/@tsconfig/recommended/tsconfig.json", + "include": ["src", "test"], "compilerOptions": { - "baseUrl": ".", + "lib": ["es2024", "dom"], + "target": "es2024", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "types": ["mocha", "chai", "chai-dom", "sinon-chai"], "declaration": true, - "sourceMap": true, - "allowJs": false, - "resolveJsonModule": true, - "esModuleInterop": true, + "inlineSourceMap": true, + "inlineSources": true, + "jsx": "react-jsx", + "experimentalDecorators": true, "noImplicitAny": true, - "downlevelIteration": true, "skipLibCheck": true, - "strictNullChecks": true, - "experimentalDecorators": true, - "module": "NodeNext", - "lib": ["ES2022", "dom"], - "target": "ES2022", - "moduleResolution": "nodenext", - "allowSyntheticDefaultImports": true, - "noEmit": true, - "jsx": "react-jsx" + "strict": false, + "strictNullChecks": true }, "ts-node": { "files": true