diff --git a/api-extractor.json b/api-extractor.json deleted file mode 100644 index f7dc09acd7..0000000000 --- a/api-extractor.json +++ /dev/null @@ -1,380 +0,0 @@ -/** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - /** - * Optionally specifies another JSON config file that this file extends from. This provides a way for - * standard settings to be shared across multiple projects. - * - * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains - * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be - * resolved using NodeJS require(). - * - * SUPPORTED TOKENS: none - * DEFAULT VALUE: "" - */ - // "extends": "./shared/api-extractor-base.json" - // "extends": "my-package/include/api-extractor-base.json" - - /** - * Determines the "" token that can be used with other config file settings. The project folder - * typically contains the tsconfig.json and package.json config files, but the path is user-defined. - * - * The path is resolved relative to the folder of the config file that contains the setting. - * - * The default value for "projectFolder" is the token "", which means the folder is determined by traversing - * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder - * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error - * will be reported. - * - * SUPPORTED TOKENS: - * DEFAULT VALUE: "" - */ - // "projectFolder": "..", - - /** - * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor - * analyzes the symbols exported by this module. - * - * The file extension must be ".d.ts" and not ".ts". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - */ - "mainEntryPointFilePath": "/lib/src/index.d.ts", - - /** - * A list of NPM package names whose exports should be treated as part of this package. - * - * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", - * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part - * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly - * imports library2. To avoid this, we can specify: - * - * "bundledPackages": [ "library2" ], - * - * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been - * local files for library1. - */ - "bundledPackages": [], - - /** - * Determines how the TypeScript compiler engine will be invoked by API Extractor. - */ - "compiler": { - /** - * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * Note: This setting will be ignored if "overrideTsconfig" is used. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/tsconfig.json" - */ - // "tsconfigFilePath": "/tsconfig.json", - /** - * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. - * The object must conform to the TypeScript tsconfig schema: - * - * http://json.schemastore.org/tsconfig - * - * If omitted, then the tsconfig.json file will be read from the "projectFolder". - * - * DEFAULT VALUE: no overrideTsconfig section - */ - // "overrideTsconfig": { - // . . . - // } - /** - * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended - * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when - * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses - * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. - * - * DEFAULT VALUE: false - */ - // "skipLibCheck": true, - }, - - /** - * Configures how the API report file (*.api.md) will be generated. - */ - "apiReport": { - /** - * (REQUIRED) Whether to generate an API report. - */ - "enabled": true, - - /** - * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce - * a full file path. - * - * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". - * - * SUPPORTED TOKENS: , - * DEFAULT VALUE: ".api.md" - */ - // "reportFileName": ".api.md", - - /** - * Specifies the folder where the API report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, - * e.g. for an API review. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/etc/" - */ - "reportFolder": "/etc/" - - /** - * Specifies the folder where the temporary report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * After the temporary file is written to disk, it is compared with the file in the "reportFolder". - * If they are different, a production build will fail. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/" - */ - // "reportTempFolder": "/temp/" - }, - - /** - * Configures how the doc model file (*.api.json) will be generated. - */ - "docModel": { - /** - * (REQUIRED) Whether to generate a doc model file. - */ - "enabled": true - - /** - * The output path for the doc model file. The file extension should be ".api.json". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/.api.json" - */ - // "apiJsonFilePath": "/temp/.api.json" - }, - - /** - * Configures how the .d.ts rollup file will be generated. - */ - "dtsRollup": { - /** - * (REQUIRED) Whether to generate the .d.ts rollup file. - */ - "enabled": true - - /** - * Specifies the output path for a .d.ts rollup file to be generated without any trimming. - * This file will include all declarations that are exported by the main entry point. - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/dist/.d.ts" - */ - // "untrimmedFilePath": "/dist/.d.ts", - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for an "alpha" release. - * This file will include only declarations that are marked as "@public", "@beta", or "@alpha". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "alphaTrimmedFilePath": "/dist/-alpha.d.ts", - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. - * This file will include only declarations that are marked as "@public" or "@beta". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "betaTrimmedFilePath": "/dist/-beta.d.ts", - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. - * This file will include only declarations that are marked as "@public". - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "publicTrimmedFilePath": "/dist/-public.d.ts", - - /** - * When a declaration is trimmed, by default it will be replaced by a code comment such as - * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the - * declaration completely. - * - * DEFAULT VALUE: false - */ - // "omitTrimmingComments": true - }, - - /** - * Configures how the tsdoc-metadata.json file will be generated. - */ - "tsdocMetadata": { - /** - * Whether to generate the tsdoc-metadata.json file. - * - * DEFAULT VALUE: true - */ - // "enabled": true, - /** - * Specifies where the TSDoc metadata file should be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", - * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup - * falls back to "tsdoc-metadata.json" in the package folder. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" - }, - - /** - * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files - * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. - * To use the OS's default newline kind, specify "os". - * - * DEFAULT VALUE: "crlf" - */ - // "newlineKind": "crlf", - - /** - * Configures how API Extractor reports error and warning messages produced during analysis. - * - * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. - */ - "messages": { - /** - * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing - * the input .d.ts files. - * - * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "compilerMessageReporting": { - /** - * Configures the default routing for messages that don't match an explicit rule in this table. - */ - "default": { - /** - * Specifies whether the message should be written to the the tool's output log. Note that - * the "addToApiReportFile" property may supersede this option. - * - * Possible values: "error", "warning", "none" - * - * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail - * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes - * the "--local" option), the warning is displayed but the build will not fail. - * - * DEFAULT VALUE: "warning" - */ - "logLevel": "warning" - - /** - * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), - * then the message will be written inside that file; otherwise, the message is instead logged according to - * the "logLevel" option. - * - * DEFAULT VALUE: false - */ - // "addToApiReportFile": false - } - - // "TS2551": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by API Extractor during its analysis. - * - * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" - * - * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings - */ - "extractorMessageReporting": { - // "default": { - // "logLevel": "warning" - // // "addToApiReportFile": false - // }, - "ae-forgotten-export": { - "logLevel": "warning", - "addToApiReportFile": true - } - - // "ae-extra-release-tag": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by the TSDoc parser when analyzing code comments. - * - * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "tsdocMessageReporting": { - "default": { - "logLevel": "warning" - // "addToApiReportFile": false - } - - // "tsdoc-link-tag-unescaped-text": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - } - } -} diff --git a/examples/univer-doc-ts/package.json b/examples/univer-doc-ts/package.json index 7e98c46060..7bbccd0ce1 100644 --- a/examples/univer-doc-ts/package.json +++ b/examples/univer-doc-ts/package.json @@ -15,6 +15,8 @@ "type": "module", "scripts": { "test": "vitest run", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild:demo": "node ./esbuild.config.mjs", "dev:demo": "node ./esbuild.config.mjs --watch" }, @@ -32,6 +34,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "esbuild-plugin-clean": "^1.0.1", "esbuild-plugin-copy": "^2.1.1", diff --git a/examples/univer-sheet-ts/package.json b/examples/univer-sheet-ts/package.json index 7142a1e7e5..a58610a2f8 100644 --- a/examples/univer-sheet-ts/package.json +++ b/examples/univer-sheet-ts/package.json @@ -12,6 +12,8 @@ "type": "module", "scripts": { "test": "vitest run", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild:demo": "node ./esbuild.config.mjs", "dev:demo": "node ./esbuild.config.mjs --watch" }, @@ -37,6 +39,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "esbuild-plugin-clean": "^1.0.1", "esbuild-plugin-copy": "^2.1.1", diff --git a/examples/univer-slide-ts/package.json b/examples/univer-slide-ts/package.json index 5ca56438e4..c6933d9808 100644 --- a/examples/univer-slide-ts/package.json +++ b/examples/univer-slide-ts/package.json @@ -12,6 +12,8 @@ "type": "module", "scripts": { "test": "vitest run", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild:demo": "node ./esbuild.config.mjs", "dev:demo": "node ./esbuild.config.mjs --watch" }, @@ -29,6 +31,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "esbuild-plugin-clean": "^1.0.1", "esbuild-plugin-copy": "^2.1.1", diff --git a/package.json b/package.json index 5cc9867195..db31aeffa8 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "type": "module", "scripts": { "test": "turbo test -- --passWithNoTests", + "coverage": "turbo coverage -- --passWithNoTests", "dev:sheet": "turbo dev:demo --filter ./examples/univer-sheet-ts", "dev:slide": "turbo dev:demo --filter ./examples/univer-slide-ts", "dev:doc": "turbo dev:demo --filter ./examples/univer-doc-ts", diff --git a/packages/base-docs/package.json b/packages/base-docs/package.json index e9acc2d3ec..68a66d2662 100644 --- a/packages/base-docs/package.json +++ b/packages/base-docs/package.json @@ -52,6 +52,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "less": "^4.2.0", "ts-node": "^10.9.1", "vitest": "^0.34.5" diff --git a/packages/base-formula-engine/package.json b/packages/base-formula-engine/package.json index 22e237fc62..6d263da3a7 100644 --- a/packages/base-formula-engine/package.json +++ b/packages/base-formula-engine/package.json @@ -35,6 +35,8 @@ "type": "module", "scripts": { "test": "vitest run", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild": "node ./esbuild.config.mjs" }, "dependencies": { @@ -47,6 +49,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "less": "^4.2.0", "ts-node": "^10.9.1", diff --git a/packages/base-numfmt-engine/package.json b/packages/base-numfmt-engine/package.json index 81eb756360..74b8b774ee 100644 --- a/packages/base-numfmt-engine/package.json +++ b/packages/base-numfmt-engine/package.json @@ -35,6 +35,8 @@ "type": "module", "scripts": { "test": "vitest run", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild": "node ./esbuild.config.mjs" }, "dependencies": { @@ -46,6 +48,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "less": "^4.2.0", "ts-node": "^10.9.1", diff --git a/packages/base-render/package.json b/packages/base-render/package.json index b1dd78f5a2..62e5df3bc4 100644 --- a/packages/base-render/package.json +++ b/packages/base-render/package.json @@ -39,6 +39,8 @@ "type": "module", "scripts": { "test": "vitest run", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild": "node ./esbuild.config.mjs" }, "dependencies": { @@ -53,6 +55,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "less": "^4.2.0", "ts-node": "^10.9.1", diff --git a/packages/base-sheets/package.json b/packages/base-sheets/package.json index 5cb3002682..b2a7dd5b44 100644 --- a/packages/base-sheets/package.json +++ b/packages/base-sheets/package.json @@ -38,7 +38,8 @@ "type": "module", "scripts": { "test": "vitest run", - "test:watch": "vitest watch", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild": "node ./esbuild.config.mjs" }, "dependencies": { @@ -53,7 +54,9 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", + "happy-dom": "^12.1.6", "less": "^4.2.0", "ts-node": "^10.9.1", "vitest": "^0.34.5" diff --git a/packages/base-sheets/vitest.config.ts b/packages/base-sheets/vitest.config.ts new file mode 100644 index 0000000000..6d6568cb95 --- /dev/null +++ b/packages/base-sheets/vitest.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + environment: 'happy-dom', + }, +}); diff --git a/packages/base-slides/package.json b/packages/base-slides/package.json index 8f1a4b5f3f..cb2248f918 100644 --- a/packages/base-slides/package.json +++ b/packages/base-slides/package.json @@ -49,6 +49,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "less": "^4.2.0", "ts-node": "^10.9.1", "vitest": "^0.34.5" diff --git a/packages/base-ui/package.json b/packages/base-ui/package.json index 2e4c757707..2ed6cd5ebd 100644 --- a/packages/base-ui/package.json +++ b/packages/base-ui/package.json @@ -37,6 +37,8 @@ "type": "module", "scripts": { "test": "vitest run", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild": "node ./esbuild.config.mjs", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build" @@ -64,6 +66,7 @@ "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react": "^4.0.4", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "happy-dom": "^12.1.6", "less": "^4.2.0", diff --git a/packages/common-plugin-data/package.json b/packages/common-plugin-data/package.json index eda9b7d20b..43089582a0 100644 --- a/packages/common-plugin-data/package.json +++ b/packages/common-plugin-data/package.json @@ -40,6 +40,7 @@ }, "devDependencies": { "@types/node": "^18.14.0", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "vitest": "^0.34.5" } diff --git a/packages/core/package.json b/packages/core/package.json index 7ffcf47c13..13034a08c8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -42,6 +42,8 @@ "type": "module", "scripts": { "test": "vitest run", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild": "node ./esbuild.config.mjs", "api": "node ./api.js", "tsc": "tsc", @@ -63,6 +65,7 @@ }, "devDependencies": { "@types/node": "^18.14.0", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "less": "^4.2.0", "ts-node": "^10.9.1", diff --git a/packages/sheets-plugin-filter/package.json b/packages/sheets-plugin-filter/package.json index e4247e35f2..ec91ef7e4f 100644 --- a/packages/sheets-plugin-filter/package.json +++ b/packages/sheets-plugin-filter/package.json @@ -48,6 +48,7 @@ "devDependencies": { "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "less": "4.2.0", "vitest": "^0.34.5" diff --git a/packages/sheets-plugin-find/package.json b/packages/sheets-plugin-find/package.json index c1cb2f541f..d8b8d12be8 100644 --- a/packages/sheets-plugin-find/package.json +++ b/packages/sheets-plugin-find/package.json @@ -35,6 +35,8 @@ "type": "module", "scripts": { "test": "vitest run", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild": "node ./esbuild.config.mjs" }, "dependencies": { @@ -52,6 +54,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "less": "^4.2.0", "ts-node": "^10.9.1", diff --git a/packages/sheets-plugin-formula/package.json b/packages/sheets-plugin-formula/package.json index 87a6d4bd4a..9d15b17207 100644 --- a/packages/sheets-plugin-formula/package.json +++ b/packages/sheets-plugin-formula/package.json @@ -52,6 +52,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "less": "^4.2.0", "ts-node": "^10.9.1", diff --git a/packages/sheets-plugin-image/package.json b/packages/sheets-plugin-image/package.json index cf229bbf3f..9607436e40 100644 --- a/packages/sheets-plugin-image/package.json +++ b/packages/sheets-plugin-image/package.json @@ -35,6 +35,8 @@ "type": "module", "scripts": { "test": "vitest run", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild": "node ./esbuild.config.mjs" }, "dependencies": { @@ -52,6 +54,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "less": "^4.2.0", "ts-node": "^10.9.1", diff --git a/packages/sheets-plugin-import-xlsx/package.json b/packages/sheets-plugin-import-xlsx/package.json index 102e5ca43a..bc3e83d913 100644 --- a/packages/sheets-plugin-import-xlsx/package.json +++ b/packages/sheets-plugin-import-xlsx/package.json @@ -53,6 +53,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "less": "^4.2.0", "ts-node": "^10.9.1", diff --git a/packages/sheets-plugin-numfmt/package.json b/packages/sheets-plugin-numfmt/package.json index 2d2d513d43..577d5a1d28 100644 --- a/packages/sheets-plugin-numfmt/package.json +++ b/packages/sheets-plugin-numfmt/package.json @@ -52,6 +52,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "less": "^4.2.0", "ts-node": "^10.9.1", "vitest": "^0.34.5" diff --git a/packages/sheets-plugin-operation/package.json b/packages/sheets-plugin-operation/package.json index 9aa449cc46..50fe4241d3 100644 --- a/packages/sheets-plugin-operation/package.json +++ b/packages/sheets-plugin-operation/package.json @@ -35,6 +35,8 @@ "type": "module", "scripts": { "test": "vitest run", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild": "node ./esbuild.config.mjs" }, "dependencies": { @@ -51,6 +53,7 @@ "devDependencies": { "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "less": "4.2.0", "vitest": "^0.34.5" diff --git a/packages/ui-plugin-docs/package.json b/packages/ui-plugin-docs/package.json index d43b73aa79..d54343b1bf 100644 --- a/packages/ui-plugin-docs/package.json +++ b/packages/ui-plugin-docs/package.json @@ -40,6 +40,7 @@ "@types/node": "^16.4.6", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "less": "^4.2.0", "ts-node": "^10.2.1", "vitest": "^0.34.5" diff --git a/packages/ui-plugin-sheets/package.json b/packages/ui-plugin-sheets/package.json index fcbf0202b3..28133e43ca 100644 --- a/packages/ui-plugin-sheets/package.json +++ b/packages/ui-plugin-sheets/package.json @@ -38,7 +38,8 @@ "type": "module", "scripts": { "test": "vitest run", - "test:watch": "vitest watch", + "test:watch": "vitest", + "coverage": "vitest run --coverage", "esbuild": "node ./esbuild.config.mjs" }, "dependencies": { @@ -57,6 +58,7 @@ "@types/node": "^18.14.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "esbuild": "^0.19.3", "happy-dom": "^12.1.6", "less": "^4.2.0", diff --git a/packages/ui-plugin-slides/package.json b/packages/ui-plugin-slides/package.json index f551a4ed53..531c4d0d4d 100644 --- a/packages/ui-plugin-slides/package.json +++ b/packages/ui-plugin-slides/package.json @@ -50,6 +50,7 @@ "@types/node": "^16.4.6", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", + "@vitest/coverage-v8": "^0.34.5", "less": "^4.2.0", "ts-node": "^10.9.1", "vitest": "^0.34.5" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a4ed06367f..3324830002 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -117,6 +117,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -202,6 +205,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -263,6 +269,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -330,6 +339,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) less: specifier: ^4.2.0 version: 4.2.0 @@ -364,6 +376,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -398,6 +413,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -441,6 +459,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -484,9 +505,15 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 + happy-dom: + specifier: ^12.1.6 + version: 12.1.6 less: specifier: ^4.2.0 version: 4.2.0 @@ -530,6 +557,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) less: specifier: ^4.2.0 version: 4.2.0 @@ -603,6 +633,9 @@ importers: '@vitejs/plugin-react': specifier: ^4.0.4 version: 4.0.4(vite@4.4.9) + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -631,6 +664,9 @@ importers: '@types/node': specifier: ^18.14.0 version: 18.14.0 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -662,6 +698,9 @@ importers: '@types/node': specifier: ^18.14.0 version: 18.14.0 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -705,6 +744,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -754,6 +796,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -806,6 +851,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -858,6 +906,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -913,6 +964,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -968,6 +1022,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) less: specifier: ^4.2.0 version: 4.2.0 @@ -1014,6 +1071,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -1060,6 +1120,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) less: specifier: ^4.2.0 version: 4.2.0 @@ -1112,6 +1175,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) esbuild: specifier: ^0.19.3 version: 0.19.3 @@ -1164,6 +1230,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@vitest/coverage-v8': + specifier: ^0.34.5 + version: 0.34.5(vitest@0.34.5) less: specifier: ^4.2.0 version: 4.2.0 @@ -5594,6 +5663,27 @@ packages: - supports-color dev: true + /@vitest/coverage-v8@0.34.5(vitest@0.34.5): + resolution: {integrity: sha512-97xjhRTSdmeeHCm2nNHhT3hLsMYkAhHXm/rwj6SZ3voka8xiCJrwgtfIjoZIFEL4OO0KezGmVuHWQXcMunULIA==} + peerDependencies: + vitest: '>=0.32.0 <1' + dependencies: + '@ampproject/remapping': 2.2.1 + '@bcoe/v8-coverage': 0.2.3 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.1.6 + magic-string: 0.30.3 + picocolors: 1.0.0 + std-env: 3.4.3 + test-exclude: 6.0.0 + v8-to-istanbul: 9.1.0 + vitest: 0.34.5(happy-dom@12.1.6)(less@4.2.0) + transitivePeerDependencies: + - supports-color + dev: true + /@vitest/expect@0.34.5: resolution: {integrity: sha512-/3RBIV9XEH+nRpRMqDJBufKIOQaYUH2X6bt0rKSCW0MfKhXFLYsR5ivHifeajRSTsln0FwJbitxLKHSQz/Xwkw==} dependencies: @@ -8751,6 +8841,17 @@ packages: supports-color: 7.2.0 dev: true + /istanbul-lib-source-maps@4.0.1: + resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} + engines: {node: '>=10'} + dependencies: + debug: 4.3.4 + istanbul-lib-coverage: 3.2.0 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + dev: true + /istanbul-reports@3.1.6: resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} engines: {node: '>=8'} diff --git a/turbo.json b/turbo.json index de3823c03d..94fcd83af7 100644 --- a/turbo.json +++ b/turbo.json @@ -3,6 +3,8 @@ "pipeline": { "test": { }, + "coverage": { + }, "esbuild": { }, "esbuild:demo": {