diff --git a/.eslintrc.js b/.eslintrc.js index eb17d0c7e9a..c2f5aa18a75 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -100,7 +100,7 @@ const config = { }, }, { - files: ['vitest.config.*', '**/*.test.*'], + files: ['vitest.config.*', '**/*.test.*', '**/test.*'], rules: { 'node/no-extraneous-import': 'off', 'node/no-extraneous-require': 'off', diff --git a/.prettierignore b/.prettierignore index f52530fc56b..44808ed1ca2 100644 --- a/.prettierignore +++ b/.prettierignore @@ -22,7 +22,6 @@ lerna.json packages/*/dist/ packages/cspell-bundled-dicts/cspell-default.config.js test-fixtures/** -tsconfig*.json **/cspell-bad.json .yarn .pnp.cjs diff --git a/integration-tests/package.json b/integration-tests/package.json index 4ad942b025d..509d804ab6f 100644 --- a/integration-tests/package.json +++ b/integration-tests/package.json @@ -12,7 +12,6 @@ }, "scripts": { "build": "tsc -p .", - "build-dev": "tsc -p tsconfig.dev.json", "clean": "pnpm run clean-dist && pnpm run clean-repos", "clean-dist": "shx rm -rf dist .tsbuildinfo", "clean-repos": "shx rm -rf repositories/temp temp", @@ -37,7 +36,6 @@ "devDependencies": { "@cspell/cspell-bundled-dicts": "workspace:*", "@cspell/dict-de-de": "^3.0.2", - "@types/node": "^18.14.2", "@types/shelljs": "^0.8.11", "cspell": "workspace:*", "jest": "^29.4.3" diff --git a/integration-tests/tsconfig.dev.json b/integration-tests/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/integration-tests/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/integration-tests/tsconfig.json b/integration-tests/tsconfig.json index d07a2550d2f..93ae3006ed4 100644 --- a/integration-tests/tsconfig.json +++ b/integration-tests/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-bundled-dicts/package.json b/packages/cspell-bundled-dicts/package.json index b7997628485..9dcbaf11935 100644 --- a/packages/cspell-bundled-dicts/package.json +++ b/packages/cspell-bundled-dicts/package.json @@ -19,7 +19,6 @@ }, "scripts": { "build": "tsc -p .", - "build-dev": "tsc -p tsconfig.dev.json", "build-dict": "cspell-tools-cli compile compatibility-words.txt", "clean": "echo clean", "clean-build": "pnpm run clean && pnpm run build", diff --git a/packages/cspell-bundled-dicts/tsconfig.dev.json b/packages/cspell-bundled-dicts/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-bundled-dicts/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-code-snippets/package.json b/packages/cspell-code-snippets/package.json index e27dcea9288..abea9c1ab1c 100644 --- a/packages/cspell-code-snippets/package.json +++ b/packages/cspell-code-snippets/package.json @@ -7,7 +7,6 @@ "scripts": { "clean": "shx rm -rf dist coverage .tsbuildinfo", "build": "tsc -p .", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "coverage": "jest --coverage", "test-watch": "jest --watch", diff --git a/packages/cspell-code-snippets/tsconfig.dev.json b/packages/cspell-code-snippets/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-code-snippets/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-code-snippets/tsconfig.json b/packages/cspell-code-snippets/tsconfig.json index d11ecf39ed1..0bc16c37091 100644 --- a/packages/cspell-code-snippets/tsconfig.json +++ b/packages/cspell-code-snippets/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-config-lib/package.json b/packages/cspell-config-lib/package.json index adb8099c1c7..90a250808bb 100644 --- a/packages/cspell-config-lib/package.json +++ b/packages/cspell-config-lib/package.json @@ -24,7 +24,6 @@ ], "scripts": { "build": "tsc -p .", - "build-dev": "tsc -p tsconfig.dev.json", "watch": "tsc -p . -w", "clean": "shx rm -rf dist coverage .tsbuildinfo", "clean-build": "pnpm run clean && pnpm run build", @@ -49,7 +48,6 @@ "yaml": "^1.10.2" }, "devDependencies": { - "@types/node": "^18.14.2", "jest": "^29.4.3" } } diff --git a/packages/cspell-config-lib/tsconfig.dev.json b/packages/cspell-config-lib/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-config-lib/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-config-lib/tsconfig.json b/packages/cspell-config-lib/tsconfig.json index b97fe8fae52..5100eaee9f0 100644 --- a/packages/cspell-config-lib/tsconfig.json +++ b/packages/cspell-config-lib/tsconfig.json @@ -4,8 +4,5 @@ "skipLibCheck": false, "outDir": "dist" }, - "include": [ - "src/**/*.ts", - "src/**/*.test.ts" - ] + "include": ["src/**/*.ts", "src/**/*.test.ts"] } diff --git a/packages/cspell-dictionary/package.json b/packages/cspell-dictionary/package.json index 9cc691229b7..ad1e3cc87d2 100644 --- a/packages/cspell-dictionary/package.json +++ b/packages/cspell-dictionary/package.json @@ -14,7 +14,6 @@ ], "scripts": { "build": "tsc -p .", - "build-dev": "tsc -p tsconfig.dev.json", "watch": "tsc -p . -w", "clean": "shx rm -rf dist temp coverage .tsbuildinfo", "clean-build": "pnpm run clean && pnpm run build", diff --git a/packages/cspell-dictionary/tsconfig.dev.json b/packages/cspell-dictionary/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-dictionary/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-dynamic-loader/package.json b/packages/cspell-dynamic-loader/package.json index bd00a76ba1e..8c6f4975a4c 100644 --- a/packages/cspell-dynamic-loader/package.json +++ b/packages/cspell-dynamic-loader/package.json @@ -14,7 +14,6 @@ "scripts": { "clean": "shx rm -rf dist coverage .tsbuildinfo", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "jest" diff --git a/packages/cspell-dynamic-loader/tsconfig.dev.json b/packages/cspell-dynamic-loader/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-dynamic-loader/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-dynamic-loader/tsconfig.json b/packages/cspell-dynamic-loader/tsconfig.json index bcb329ed662..cc4a60f1179 100644 --- a/packages/cspell-dynamic-loader/tsconfig.json +++ b/packages/cspell-dynamic-loader/tsconfig.json @@ -3,8 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src/**/*.ts", - "src/**/*.test.ts" - ] + "include": ["src/**/*.ts", "src/**/*.test.ts"] } diff --git a/packages/cspell-eslint-plugin/package.json b/packages/cspell-eslint-plugin/package.json index 46edca0f14f..fbcad9d064c 100644 --- a/packages/cspell-eslint-plugin/package.json +++ b/packages/cspell-eslint-plugin/package.json @@ -56,7 +56,6 @@ "devDependencies": { "@types/eslint": "^8.21.1", "@types/estree": "^1.0.0", - "@types/node": "^18.14.2", "@typescript-eslint/parser": "^5.54.0", "@typescript-eslint/types": "^5.54.0", "@typescript-eslint/typescript-estree": "^5.54.0", diff --git a/packages/cspell-eslint-plugin/src/common/tsconfig.json b/packages/cspell-eslint-plugin/src/common/tsconfig.json index 95b46d5ebd2..3af0b7e88f3 100644 --- a/packages/cspell-eslint-plugin/src/common/tsconfig.json +++ b/packages/cspell-eslint-plugin/src/common/tsconfig.json @@ -1,11 +1,9 @@ { - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "tsBuildInfoFile":"../../dist/common/compile.tsbuildInfo", - "rootDir": ".", - "outDir": "../../dist/common" - }, - "include": [ - "." - ] + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "tsBuildInfoFile": "../../dist/common/compile.tsbuildInfo", + "rootDir": ".", + "outDir": "../../dist/common" + }, + "include": ["."] } diff --git a/packages/cspell-eslint-plugin/src/plugin/tsconfig.json b/packages/cspell-eslint-plugin/src/plugin/tsconfig.json index e4aed76d28c..78d90e6fdb1 100644 --- a/packages/cspell-eslint-plugin/src/plugin/tsconfig.json +++ b/packages/cspell-eslint-plugin/src/plugin/tsconfig.json @@ -1,13 +1,11 @@ { - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "tsBuildInfoFile":"../../dist/plugin/compile.tsbuildInfo", - "rootDir": ".", - "outDir": "../../dist/plugin" - }, - "include": [ - "." - ], + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "tsBuildInfoFile": "../../dist/plugin/compile.tsbuildInfo", + "rootDir": ".", + "outDir": "../../dist/plugin" + }, + "include": ["."], "references": [ { "path": "../_auto_generated_/tsconfig.json" }, { "path": "../common/tsconfig.json" }, diff --git a/packages/cspell-eslint-plugin/src/worker/tsconfig.json b/packages/cspell-eslint-plugin/src/worker/tsconfig.json index 1055f3ee8d3..c11238ec851 100644 --- a/packages/cspell-eslint-plugin/src/worker/tsconfig.json +++ b/packages/cspell-eslint-plugin/src/worker/tsconfig.json @@ -1,17 +1,13 @@ { - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "tsBuildInfoFile":"../../dist/worker/compile.tsbuildInfo", + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "tsBuildInfoFile": "../../dist/worker/compile.tsbuildInfo", "target": "ES2020", "module": "ES2020", "moduleResolution": "node16", - "rootDir": ".", - "outDir": "../../dist/worker" - }, - "include": [ - "." - ], - "references": [ - { "path": "../common/tsconfig.json" } - ] + "rootDir": ".", + "outDir": "../../dist/worker" + }, + "include": ["."], + "references": [{ "path": "../common/tsconfig.json" }] } diff --git a/packages/cspell-eslint-plugin/tsconfig.base.json b/packages/cspell-eslint-plugin/tsconfig.base.json index bd6e281d334..ff8f7083e4e 100644 --- a/packages/cspell-eslint-plugin/tsconfig.base.json +++ b/packages/cspell-eslint-plugin/tsconfig.base.json @@ -32,12 +32,7 @@ // "noPropertyAccessFromIndexSignature": true, "pretty": true, - "types": [ - "node" - ] + "types": ["node"] }, - "exclude": [ - "dist", - "node_modules" - ] + "exclude": ["dist", "node_modules"] } diff --git a/packages/cspell-eslint-plugin/tsconfig.json b/packages/cspell-eslint-plugin/tsconfig.json index 5e1a3c5f66d..7986a07caaf 100644 --- a/packages/cspell-eslint-plugin/tsconfig.json +++ b/packages/cspell-eslint-plugin/tsconfig.json @@ -1,13 +1,13 @@ { "extends": "./tsconfig.base.json", - "compilerOptions": { - "tsBuildInfoFile":"./dist/compile.tsbuildInfo" - }, + "compilerOptions": { + "tsBuildInfoFile": "./dist/compile.tsbuildInfo" + }, "files": [], - "references": [ - { "path": "./src/_auto_generated_/tsconfig.json" }, - { "path": "./src/worker/tsconfig.json" }, - { "path": "./src/common/tsconfig.json" }, - { "path": "./src/plugin/tsconfig.json" } - ] + "references": [ + { "path": "./src/_auto_generated_/tsconfig.json" }, + { "path": "./src/worker/tsconfig.json" }, + { "path": "./src/common/tsconfig.json" }, + { "path": "./src/plugin/tsconfig.json" } + ] } diff --git a/packages/cspell-gitignore/package.json b/packages/cspell-gitignore/package.json index 93c284dabe2..4f602864ead 100644 --- a/packages/cspell-gitignore/package.json +++ b/packages/cspell-gitignore/package.json @@ -29,7 +29,6 @@ ], "scripts": { "build": "tsc -p .", - "build-dev": "tsc -p tsconfig.dev.json", "watch": "tsc -p . -w", "clean": "shx rm -rf dist coverage .tsbuildinfo", "clean-build": "pnpm run clean && pnpm run build", @@ -53,7 +52,5 @@ "cspell-glob": "workspace:*", "find-up": "^5.0.0" }, - "devDependencies": { - "@types/node": "^18.14.2" - } + "devDependencies": {} } diff --git a/packages/cspell-gitignore/tsconfig.dev.json b/packages/cspell-gitignore/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-gitignore/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-gitignore/tsconfig.json b/packages/cspell-gitignore/tsconfig.json index 22bd0dc69d9..84a19a505d1 100644 --- a/packages/cspell-gitignore/tsconfig.json +++ b/packages/cspell-gitignore/tsconfig.json @@ -5,8 +5,5 @@ "skipLibCheck": true, "outDir": "dist" }, - "include": [ - "src/**/*.ts", - "src/**/*.test.ts" - ] + "include": ["src/**/*.ts", "src/**/*.test.ts"] } diff --git a/packages/cspell-glob/package.json b/packages/cspell-glob/package.json index 6687f2929a5..7732bec51b4 100644 --- a/packages/cspell-glob/package.json +++ b/packages/cspell-glob/package.json @@ -24,7 +24,6 @@ ], "scripts": { "build": "tsc -p .", - "build-dev": "tsc -p tsconfig.dev.json", "watch": "tsc -p . -w", "clean": "shx rm -rf dist coverage .tsbuildinfo", "clean-build": "pnpm run clean && pnpm run build", @@ -47,7 +46,6 @@ }, "devDependencies": { "@types/micromatch": "^4.0.2", - "@types/node": "^18.14.2", "jest": "^29.4.3" } } diff --git a/packages/cspell-glob/tsconfig.dev.json b/packages/cspell-glob/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-glob/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-glob/tsconfig.json b/packages/cspell-glob/tsconfig.json index bcb329ed662..cc4a60f1179 100644 --- a/packages/cspell-glob/tsconfig.json +++ b/packages/cspell-glob/tsconfig.json @@ -3,8 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src/**/*.ts", - "src/**/*.test.ts" - ] + "include": ["src/**/*.ts", "src/**/*.test.ts"] } diff --git a/packages/cspell-grammar/package.json b/packages/cspell-grammar/package.json index d38eb5bfc9f..a34452975f5 100644 --- a/packages/cspell-grammar/package.json +++ b/packages/cspell-grammar/package.json @@ -46,7 +46,6 @@ ], "scripts": { "build": "tsc -p .", - "build-dev": "tsc -p tsconfig.dev.json", "watch": "tsc -p . -w", "clean": "shx rm -rf dist coverage .tsbuildinfo", "clean-build": "pnpm run clean && pnpm run build", @@ -65,7 +64,6 @@ "node": ">=14" }, "devDependencies": { - "@types/node": "^18.14.2", "jest": "^29.4.3" }, "dependencies": { diff --git a/packages/cspell-grammar/tsconfig.dev.json b/packages/cspell-grammar/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-grammar/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-grammar/tsconfig.json b/packages/cspell-grammar/tsconfig.json index bcb329ed662..cc4a60f1179 100644 --- a/packages/cspell-grammar/tsconfig.json +++ b/packages/cspell-grammar/tsconfig.json @@ -3,8 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src/**/*.ts", - "src/**/*.test.ts" - ] + "include": ["src/**/*.ts", "src/**/*.test.ts"] } diff --git a/packages/cspell-io/package.json b/packages/cspell-io/package.json index 248d63a774f..62cf529ddf1 100644 --- a/packages/cspell-io/package.json +++ b/packages/cspell-io/package.json @@ -2,8 +2,16 @@ "name": "cspell-io", "version": "6.27.0", "description": "A library of useful I/O functions used across various cspell tools.", - "main": "dist/index.js", - "typings": "dist/index.d.ts", + "type": "commonjs", + "module": "dist/esm/index.mjs", + "main": "dist/cjs/index.js", + "typings": "dist/cjs/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.mjs", + "require": "./dist/cjs/index.js" + } + }, "files": [ "dist", "!**/*.tsbuildInfo", @@ -13,14 +21,17 @@ "!**/*.map" ], "scripts": { - "build": "tsc -p .", - "build-dev": "tsc -p tsconfig.dev.json", - "watch": "tsc -p . -w", + "build": "tsc -b . && ts2mjs dist/esm", + "build:esm": "tsc -p tsconfig.esm.json", + "build:watch": "tsc -b . -w", + "watch": "pnpm build:watch", "clean": "shx rm -rf dist temp coverage .tsbuildinfo", "clean-build": "pnpm run clean && pnpm run build", - "coverage": "jest --coverage", - "test-watch": "jest --watch", - "test": "jest" + "coverage": "pnpm coverage:vitest && pnpm coverage:fix", + "coverage:vitest": "vitest run --coverage", + "coverage:fix": "nyc report --temp-dir \"$(pwd)/coverage\" --reporter lcov --report-dir \"$(pwd)/coverage\" --cwd ../..", + "test-watch": "vitest", + "test": "vitest run" }, "repository": { "type": "git", @@ -39,7 +50,6 @@ "node": ">=14" }, "devDependencies": { - "@types/node": "^18.14.2", "@types/node-fetch": "^2.6.2", "jest": "^29.4.3", "lorem-ipsum": "^2.0.8" diff --git a/packages/cspell-io/src/CSpellIO.ts b/packages/cspell-io/src/CSpellIO.ts index 7a27c76f45e..72fcfcd68a7 100644 --- a/packages/cspell-io/src/CSpellIO.ts +++ b/packages/cspell-io/src/CSpellIO.ts @@ -1,6 +1,6 @@ -import type { Stats } from './models'; -import type { BufferEncoding } from './models/BufferEncoding'; -import type { TextFileResource } from './models/FileResource'; +import type { BufferEncoding } from './models/BufferEncoding.js'; +import type { TextFileResource } from './models/FileResource.js'; +import type { Stats } from './models/index.js'; export type UrlOrFilename = string | URL; diff --git a/packages/cspell-io/src/CSpellIONode.test.ts b/packages/cspell-io/src/CSpellIONode.test.ts index 36ae0ccde0f..530061ae0ca 100644 --- a/packages/cspell-io/src/CSpellIONode.test.ts +++ b/packages/cspell-io/src/CSpellIONode.test.ts @@ -1,8 +1,9 @@ import { promises as fs } from 'fs'; +import { describe, expect, test } from 'vitest'; -import { CSpellIONode } from './CSpellIONode'; -import { toURL } from './node/file/util'; -import { makePathToFile, pathToSample as ps, pathToTemp } from './test/helper'; +import { CSpellIONode } from './CSpellIONode.js'; +import { toURL } from './node/file/util.js'; +import { makePathToFile, pathToSample as ps, pathToTemp } from './test/test.helper.js'; const sc = expect.stringContaining; const oc = expect.objectContaining; diff --git a/packages/cspell-io/src/CSpellIONode.ts b/packages/cspell-io/src/CSpellIONode.ts index e9e7f8ae053..1566134718f 100644 --- a/packages/cspell-io/src/CSpellIONode.ts +++ b/packages/cspell-io/src/CSpellIONode.ts @@ -1,19 +1,19 @@ import { isServiceResponseSuccess, ServiceBus } from '@cspell/cspell-service-bus'; -import { compareStats } from './common/stat'; -import type { CSpellIO } from './CSpellIO'; -import { ErrorNotImplemented } from './errors/ErrorNotImplemented'; -import { registerHandlers } from './handlers/node/file'; -import type { TextFileResource } from './models/FileResource'; -import type { Stats } from './models/Stats'; -import { toURL, urlBasename, urlDirname } from './node/file/util'; +import { compareStats } from './common/stat.js'; +import type { CSpellIO } from './CSpellIO.js'; +import { ErrorNotImplemented } from './errors/ErrorNotImplemented.js'; +import { registerHandlers } from './handlers/node/file.js'; +import type { TextFileResource } from './models/FileResource.js'; +import type { Stats } from './models/Stats.js'; +import { toURL, urlBasename, urlDirname } from './node/file/util.js'; import { RequestFsReadFile, RequestFsReadFileSync, RequestFsStat, RequestFsStatSync, RequestFsWriteFile, -} from './requests'; +} from './requests/index.js'; let defaultCSpellIONode: CSpellIO | undefined = undefined; diff --git a/packages/cspell-io/src/CSpellIOWeb.ts b/packages/cspell-io/src/CSpellIOWeb.ts index ef78b8f68b3..acd754f5228 100644 --- a/packages/cspell-io/src/CSpellIOWeb.ts +++ b/packages/cspell-io/src/CSpellIOWeb.ts @@ -1,8 +1,8 @@ -import { compareStats } from './common/stat'; -import type { CSpellIO } from './CSpellIO'; -import { ErrorNotImplemented } from './errors/ErrorNotImplemented'; -import type { TextFileResource } from './models/FileResource'; -import type { Stats } from './models/Stats'; +import { compareStats } from './common/stat.js'; +import type { CSpellIO } from './CSpellIO.js'; +import { ErrorNotImplemented } from './errors/ErrorNotImplemented.js'; +import type { TextFileResource } from './models/FileResource.js'; +import type { Stats } from './models/Stats.js'; export class CSpellIOWeb implements CSpellIO { readFile(_uriOrFilename: string | URL): Promise { diff --git a/packages/cspell-io/src/__snapshots__/index.test.ts.snap b/packages/cspell-io/src/__snapshots__/index.test.ts.snap index 3f50507e790..bc3eaf9eae7 100644 --- a/packages/cspell-io/src/__snapshots__/index.test.ts.snap +++ b/packages/cspell-io/src/__snapshots__/index.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`index api 1`] = ` +exports[`index > api 1`] = ` [ "CSpellIONode => function", "asyncIterableToArray => function", diff --git a/packages/cspell-io/src/async/asyncIterable.test.ts b/packages/cspell-io/src/async/asyncIterable.test.ts index 5dd12b6261a..30022593429 100644 --- a/packages/cspell-io/src/async/asyncIterable.test.ts +++ b/packages/cspell-io/src/async/asyncIterable.test.ts @@ -1,4 +1,6 @@ -import { toArray } from './asyncIterable'; +import { describe, expect, test } from 'vitest'; + +import { toArray } from './asyncIterable.js'; describe('asyncIterable', () => { test('toArray', async () => { diff --git a/packages/cspell-io/src/common/BufferEncoding.ts b/packages/cspell-io/src/common/BufferEncoding.ts index d72cc76ec29..1b302f38476 100644 --- a/packages/cspell-io/src/common/BufferEncoding.ts +++ b/packages/cspell-io/src/common/BufferEncoding.ts @@ -1,4 +1,4 @@ -import type { BufferEncoding } from '../models/BufferEncoding'; -export type { BufferEncoding } from '../models/BufferEncoding'; +import type { BufferEncoding } from '../models/BufferEncoding.js'; +export type { BufferEncoding } from '../models/BufferEncoding.js'; export type BufferEncodingExt = BufferEncoding | 'utf16be'; diff --git a/packages/cspell-io/src/common/encode-decode.test.ts b/packages/cspell-io/src/common/encode-decode.test.ts index aa92df7ccf3..d2b735d37a9 100644 --- a/packages/cspell-io/src/common/encode-decode.test.ts +++ b/packages/cspell-io/src/common/encode-decode.test.ts @@ -1,4 +1,6 @@ -import { decode, encodeString, swapBytes, swapBytesInPlace } from './encode-decode'; +import { describe, expect, test } from 'vitest'; + +import { decode, encodeString, swapBytes, swapBytesInPlace } from './encode-decode.js'; const samples = ['This is a bit of text']; diff --git a/packages/cspell-io/src/common/encode-decode.ts b/packages/cspell-io/src/common/encode-decode.ts index 0e4695c3c37..5d3cffc8a9d 100644 --- a/packages/cspell-io/src/common/encode-decode.ts +++ b/packages/cspell-io/src/common/encode-decode.ts @@ -1,4 +1,4 @@ -import type { BufferEncodingExt } from './BufferEncoding'; +import type { BufferEncodingExt } from './BufferEncoding.js'; const BOM_BE = 0xfeff; const BOM_LE = 0xfffe; diff --git a/packages/cspell-io/src/common/stat.test.ts b/packages/cspell-io/src/common/stat.test.ts index b6b25369b2a..2bfba892cbf 100644 --- a/packages/cspell-io/src/common/stat.test.ts +++ b/packages/cspell-io/src/common/stat.test.ts @@ -1,4 +1,6 @@ -import { compareStats } from './stat'; +import { describe, expect, test } from 'vitest'; + +import { compareStats } from './stat.js'; describe('stat', () => { const stats = { diff --git a/packages/cspell-io/src/common/stat.ts b/packages/cspell-io/src/common/stat.ts index 826addebb0b..20fdb4f24dc 100644 --- a/packages/cspell-io/src/common/stat.ts +++ b/packages/cspell-io/src/common/stat.ts @@ -1,4 +1,4 @@ -import type { Stats } from '../models/Stats'; +import type { Stats } from '../models/Stats.js'; /** * Compare two Stats to see if they have the same value. diff --git a/packages/cspell-io/src/common/transformers.test.ts b/packages/cspell-io/src/common/transformers.test.ts index 80e84c7a5a4..91ab973da8c 100644 --- a/packages/cspell-io/src/common/transformers.test.ts +++ b/packages/cspell-io/src/common/transformers.test.ts @@ -1,5 +1,7 @@ -import { encodeUtf16BE, encodeUtf16LE } from './encode-decode'; -import { createDecoderTransformer, encoderTransformer } from './transformers'; +import { describe, expect, test } from 'vitest'; + +import { encodeUtf16BE, encodeUtf16LE } from './encode-decode.js'; +import { createDecoderTransformer, encoderTransformer } from './transformers.js'; const eBE = encodeUtf16BE; const eLE = encodeUtf16LE; diff --git a/packages/cspell-io/src/common/transformers.ts b/packages/cspell-io/src/common/transformers.ts index eec1430b21a..ba9dd43f8b3 100644 --- a/packages/cspell-io/src/common/transformers.ts +++ b/packages/cspell-io/src/common/transformers.ts @@ -1,5 +1,5 @@ -import type { BufferEncodingExt } from './BufferEncoding'; -import { calcEncodingFromBom, decode, decodeUtf16BE, decodeUtf16LE, encodeString } from './encode-decode'; +import type { BufferEncodingExt } from './BufferEncoding.js'; +import { calcEncodingFromBom, decode, decodeUtf16BE, decodeUtf16LE, encodeString } from './encode-decode.js'; export function createDecoderTransformer( encoding?: BufferEncodingExt diff --git a/packages/cspell-io/src/errors/index.ts b/packages/cspell-io/src/errors/index.ts index 497447d3bf9..8020e48e5fc 100644 --- a/packages/cspell-io/src/errors/index.ts +++ b/packages/cspell-io/src/errors/index.ts @@ -1,2 +1,2 @@ -export { toError } from './error'; -export { ErrorNotImplemented } from './ErrorNotImplemented'; +export { toError } from './error.js'; +export { ErrorNotImplemented } from './ErrorNotImplemented.js'; diff --git a/packages/cspell-io/src/file/file.ts b/packages/cspell-io/src/file/file.ts index 25de8a65e51..b616073f075 100644 --- a/packages/cspell-io/src/file/file.ts +++ b/packages/cspell-io/src/file/file.ts @@ -1,13 +1,13 @@ -import { getDefaultCSpellIO } from '../CSpellIONode'; -import { toError } from '../errors'; -import type { Stats } from '../models'; -import type { BufferEncoding } from '../models/BufferEncoding'; +import { getDefaultCSpellIO } from '../CSpellIONode.js'; +import { toError } from '../errors/index.js'; +import type { BufferEncoding } from '../models/BufferEncoding.js'; +import type { Stats } from '../models/index.js'; import type { getStat as GetStatFn, getStatSync as GetStatSyncFn, readFile as ReadFileFn, readFileSync as ReadFileSyncFn, -} from '../node/file'; +} from '../node/file/index.js'; export const readFile: typeof ReadFileFn = function ( filename: string | URL, diff --git a/packages/cspell-io/src/file/index.ts b/packages/cspell-io/src/file/index.ts index adbc7b1854f..de939bf5e5e 100644 --- a/packages/cspell-io/src/file/index.ts +++ b/packages/cspell-io/src/file/index.ts @@ -1,2 +1,2 @@ -export { writeToFile, writeToFileIterable, writeToFileIterable as writeToFileIterableP } from './../node/file'; -export { getStat, getStatSync, readFile, readFileSync } from './file'; +export { writeToFile, writeToFileIterable, writeToFileIterable as writeToFileIterableP } from './../node/file/index.js'; +export { getStat, getStatSync, readFile, readFileSync } from './file.js'; diff --git a/packages/cspell-io/src/handlers/node/file.ts b/packages/cspell-io/src/handlers/node/file.ts index 07df29f105e..a53f5f19de4 100644 --- a/packages/cspell-io/src/handlers/node/file.ts +++ b/packages/cspell-io/src/handlers/node/file.ts @@ -11,11 +11,11 @@ import type { URL } from 'url'; import { fileURLToPath } from 'url'; import { gunzipSync, gzipSync } from 'zlib'; -import { decode } from '../../common/encode-decode'; -import { toError } from '../../errors'; -import { decodeDataUrl } from '../../node/dataUrl'; -import { fetchURL } from '../../node/file/fetch'; -import { getStatHttp } from '../../node/file/stat'; +import { decode } from '../../common/encode-decode.js'; +import { toError } from '../../errors/index.js'; +import { decodeDataUrl } from '../../node/dataUrl.js'; +import { fetchURL } from '../../node/file/fetch.js'; +import { getStatHttp } from '../../node/file/stat.js'; import { RequestFsReadBinaryFile, RequestFsReadBinaryFileSync, @@ -25,7 +25,7 @@ import { RequestFsStatSync, RequestFsWriteFile, RequestZlibInflate, -} from '../../requests'; +} from '../../requests/index.js'; const isGzFileRegExp = /\.gz($|[?#])/; diff --git a/packages/cspell-io/src/index.test.ts b/packages/cspell-io/src/index.test.ts index 9ad6d19c75f..a59791d8a0c 100644 --- a/packages/cspell-io/src/index.test.ts +++ b/packages/cspell-io/src/index.test.ts @@ -1,4 +1,6 @@ -import * as index from './index'; +import { describe, expect, test } from 'vitest'; + +import * as index from './index.js'; describe('index', () => { test('exports', () => { diff --git a/packages/cspell-io/src/index.ts b/packages/cspell-io/src/index.ts index 7e6383137dc..58a54051f09 100644 --- a/packages/cspell-io/src/index.ts +++ b/packages/cspell-io/src/index.ts @@ -1,6 +1,6 @@ -export { toArray as asyncIterableToArray } from './async/asyncIterable'; -export type { CSpellIO } from './CSpellIO'; -export { CSpellIONode, getDefaultCSpellIO } from './CSpellIONode'; +export { toArray as asyncIterableToArray } from './async/asyncIterable.js'; +export type { CSpellIO } from './CSpellIO.js'; +export { CSpellIONode, getDefaultCSpellIO } from './CSpellIONode.js'; export { getStat, getStatSync, @@ -9,6 +9,6 @@ export { writeToFile, writeToFileIterable, writeToFileIterableP, -} from './file'; -export type { Stats } from './models/Stats'; -export { encodeDataUrl, toDataUrl } from './node/dataUrl'; +} from './file/index.js'; +export type { Stats } from './models/Stats.js'; +export { encodeDataUrl, toDataUrl } from './node/dataUrl.js'; diff --git a/packages/cspell-io/src/models/index.ts b/packages/cspell-io/src/models/index.ts index 06b17a036fd..87177d64c4f 100644 --- a/packages/cspell-io/src/models/index.ts +++ b/packages/cspell-io/src/models/index.ts @@ -1 +1 @@ -export type { Stats } from './Stats'; +export type { Stats } from './Stats.js'; diff --git a/packages/cspell-io/src/node/dataUrl.test.ts b/packages/cspell-io/src/node/dataUrl.test.ts index 6c6f7a96b65..1b69a0648f2 100644 --- a/packages/cspell-io/src/node/dataUrl.test.ts +++ b/packages/cspell-io/src/node/dataUrl.test.ts @@ -1,5 +1,7 @@ -import { pathToSample } from '../test/helper'; -import { decodeDataUrl, encodeDataUrl, encodeDataUrlFromFile, guessMimeType, toDataUrl } from './dataUrl'; +import { describe, expect, test } from 'vitest'; + +import { pathToSample } from '../test/test.helper.js'; +import { decodeDataUrl, encodeDataUrl, encodeDataUrlFromFile, guessMimeType, toDataUrl } from './dataUrl.js'; const sc = expect.stringContaining; diff --git a/packages/cspell-io/src/node/dataUrl.ts b/packages/cspell-io/src/node/dataUrl.ts index a623c358d6a..dadeb8f3ce6 100644 --- a/packages/cspell-io/src/node/dataUrl.ts +++ b/packages/cspell-io/src/node/dataUrl.ts @@ -1,7 +1,7 @@ import { promises as fs } from 'fs'; import * as fsPath from 'path'; -import { toURL } from './file/util'; +import { toURL } from './file/util.js'; /** * Generates a string of the following format: diff --git a/packages/cspell-io/src/node/file/FetchError.test.ts b/packages/cspell-io/src/node/file/FetchError.test.ts index 82da59606c7..1b01b2826d1 100644 --- a/packages/cspell-io/src/node/file/FetchError.test.ts +++ b/packages/cspell-io/src/node/file/FetchError.test.ts @@ -1,5 +1,7 @@ -import { FetchUrlError } from './FetchError'; -import { toURL } from './util'; +import { describe, expect, test } from 'vitest'; + +import { FetchUrlError } from './FetchError.js'; +import { toURL } from './util.js'; const oc = expect.objectContaining; diff --git a/packages/cspell-io/src/node/file/__snapshots__/fileReader.test.ts.snap b/packages/cspell-io/src/node/file/__snapshots__/fileReader.test.ts.snap index 635c102a7c8..088488ec66a 100644 --- a/packages/cspell-io/src/node/file/__snapshots__/fileReader.test.ts.snap +++ b/packages/cspell-io/src/node/file/__snapshots__/fileReader.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Validate the fileReader reading async files samples/cities.txt 1`] = ` +exports[`Validate the fileReader > reading async files 'samples/cities.txt' 1`] = ` "New York New Amsterdam Las Angles @@ -12,7 +12,7 @@ Paris " `; -exports[`Validate the fileReader reading async files samples/cities.txt.gz 1`] = ` +exports[`Validate the fileReader > reading async files 'samples/cities.txt.gz' 1`] = ` " # cspell-tools: keep-case no-split @@ -35,7 +35,7 @@ San Francisco " `; -exports[`Validate the fileReader reading async files samples/cities.utf16be.txt 1`] = ` +exports[`Validate the fileReader > reading async files 'samples/cities.utf16be.txt' 1`] = ` "New York New Amsterdam Las Angles @@ -47,7 +47,7 @@ Paris " `; -exports[`Validate the fileReader reading async files samples/cities.utf16le.txt 1`] = ` +exports[`Validate the fileReader > reading async files 'samples/cities.utf16le.txt' 1`] = ` "New York New Amsterdam Las Angles diff --git a/packages/cspell-io/src/node/file/fetch.test.ts b/packages/cspell-io/src/node/file/fetch.test.ts index cdcac8fa99d..4afd09ee0e3 100644 --- a/packages/cspell-io/src/node/file/fetch.test.ts +++ b/packages/cspell-io/src/node/file/fetch.test.ts @@ -1,4 +1,6 @@ -import { fetch, fetchHead } from './fetch'; +import { describe, expect, test } from 'vitest'; + +import { fetch, fetchHead } from './fetch.js'; describe('fetch', () => { test('fetch url', async () => { diff --git a/packages/cspell-io/src/node/file/fetch.ts b/packages/cspell-io/src/node/file/fetch.ts index 919c0459ec7..f00d64baee2 100644 --- a/packages/cspell-io/src/node/file/fetch.ts +++ b/packages/cspell-io/src/node/file/fetch.ts @@ -1,7 +1,7 @@ import type { Headers } from 'node-fetch'; import nodeFetch from 'node-fetch'; -import { FetchUrlError } from './FetchError'; +import { FetchUrlError } from './FetchError.js'; export const fetch = nodeFetch; diff --git a/packages/cspell-io/src/node/file/fileReader.test.ts b/packages/cspell-io/src/node/file/fileReader.test.ts index 7116051fcf0..6db974cde26 100644 --- a/packages/cspell-io/src/node/file/fileReader.test.ts +++ b/packages/cspell-io/src/node/file/fileReader.test.ts @@ -1,38 +1,51 @@ import { promises as fs } from 'fs'; +import { afterEach, describe, expect, test, vi } from 'vitest'; -import { pathToRoot } from '../../test/helper'; -import * as fReader from './fileReader'; -import { isUrlLike, toURL } from './util'; +import { pathToRoot } from '../../test/test.helper.js'; +import * as fReader from './fileReader.js'; +import { isUrlLike, toURL } from './util.js'; const oc = expect.objectContaining; -describe('Validate the fileReader', () => { - jest.setTimeout(10000); +const timeout = 10000; +describe('Validate the fileReader', () => { afterEach(() => { - jest.resetAllMocks(); + vi.resetAllMocks(); }); - test('tests reading a file', async () => { - const expected = await fs.readFile(__filename, 'utf8'); - const result = await fReader.readFile(__filename, 'utf8'); - expect(result).toBe(expected); - }); + test( + 'tests reading a file', + async () => { + const expected = await fs.readFile(__filename, 'utf8'); + const result = await fReader.readFile(__filename, 'utf8'); + expect(result).toBe(expected); + }, + { timeout } + ); - test('missing file', async () => { - const result = fReader.readFile(__filename + '.missing.file', 'utf8'); - await expect(result).rejects.toEqual(oc({ code: 'ENOENT' })); - }); + test( + 'missing file', + async () => { + const result = fReader.readFile(__filename + '.missing.file', 'utf8'); + await expect(result).rejects.toEqual(oc({ code: 'ENOENT' })); + }, + { timeout } + ); test.each` file | contains ${'samples/cities.txt'} | ${'San Francisco'} ${'samples/cities.txt.gz'} | ${'San Francisco'} - `('reading sync files $file', ({ file, contains }) => { - const filename = pathToRoot(file); - const content = fReader.readFileSync(filename); - expect(content).toContain(contains); - }); + `( + 'reading sync files $file', + ({ file, contains }) => { + const filename = pathToRoot(file); + const content = fReader.readFileSync(filename); + expect(content).toContain(contains); + }, + { timeout } + ); test.each` file | contains @@ -40,12 +53,16 @@ describe('Validate the fileReader', () => { ${'samples/cities.txt.gz'} | ${'San Francisco'} ${'samples/cities.utf16be.txt'} | ${'San Francisco'} ${'samples/cities.utf16le.txt'} | ${'San Francisco'} - `('reading async files $file', async ({ file, contains }) => { - const filename = pathToRoot(file); - const content = await fReader.readFile(filename); - expect(content).toContain(contains); - expect(content).toMatchSnapshot(); - }); + `( + 'reading async files $file', + async ({ file, contains }) => { + const filename = pathToRoot(file); + const content = await fReader.readFile(filename); + expect(content).toContain(contains); + expect(content).toMatchSnapshot(); + }, + { timeout } + ); test.each` file | contains @@ -53,20 +70,28 @@ describe('Validate the fileReader', () => { ${'samples/cities.txt.gz'} | ${'San Francisco'} ${'https://github.com/streetsidesoftware/cspell/raw/main/packages/cspell-io/samples/cities.txt'} | ${'San Francisco'} ${'https://github.com/streetsidesoftware/cspell/raw/main/packages/cspell-io/samples/cities.txt.gz'} | ${'San Francisco'} - `('reading URLs files $file', async ({ file, contains }) => { - const filename = isUrlLike(file) ? file : pathToRoot(file); - const url = toURL(filename); - const content = await fReader.readFile(url); - expect(content).toContain(contains); - }); + `( + 'reading URLs files $file', + async ({ file, contains }) => { + const filename = isUrlLike(file) ? file : pathToRoot(file); + const url = toURL(filename); + const content = await fReader.readFile(url); + expect(content).toContain(contains); + }, + { timeout } + ); test.each` file | expected ${'http://streetsidesoftware.com/not-found.txt'} | ${oc({ code: 'ENOENT' })} ${'ftp://www.streetsidesoftware.nl'} | ${new Error('Unsupported network protocol')} ${'https://github.com/Jason3S/checkio'} | ${oc({ code: 'ENOENT', message: 'URL not found.' })} - `('error reading URLs $file', async ({ file, expected }) => { - const url = toURL(file); - await expect(fReader.readFile(url)).rejects.toEqual(expected); - }); + `( + 'error reading URLs $file', + async ({ file, expected }) => { + const url = toURL(file); + await expect(fReader.readFile(url)).rejects.toEqual(expected); + }, + { timeout } + ); }); diff --git a/packages/cspell-io/src/node/file/fileReader.ts b/packages/cspell-io/src/node/file/fileReader.ts index db50dd0d080..53fdcf54727 100644 --- a/packages/cspell-io/src/node/file/fileReader.ts +++ b/packages/cspell-io/src/node/file/fileReader.ts @@ -6,12 +6,12 @@ import { fileURLToPath } from 'url'; import { promisify } from 'util'; import * as zlib from 'zlib'; -import { decode } from '../../common/encode-decode'; -import { createDecoderTransformer } from '../../common/transformers'; -import type { BufferEncoding } from '../../models/BufferEncoding'; -import { fetch } from './fetch'; -import { FetchUrlError } from './FetchError'; -import { isFileURL, isSupportedURL, isZipped, toURL } from './util'; +import { decode } from '../../common/encode-decode.js'; +import { createDecoderTransformer } from '../../common/transformers.js'; +import type { BufferEncoding } from '../../models/BufferEncoding.js'; +import { fetch } from './fetch.js'; +import { FetchUrlError } from './FetchError.js'; +import { isFileURL, isSupportedURL, isZipped, toURL } from './util.js'; const defaultEncoding: BufferEncoding = 'utf8'; diff --git a/packages/cspell-io/src/node/file/fileWriter.test.ts b/packages/cspell-io/src/node/file/fileWriter.test.ts index 03ec6ca0d8a..27672d6a38b 100644 --- a/packages/cspell-io/src/node/file/fileWriter.test.ts +++ b/packages/cspell-io/src/node/file/fileWriter.test.ts @@ -1,8 +1,9 @@ import { loremIpsum } from 'lorem-ipsum'; +import { describe, expect, test } from 'vitest'; -import { makePathToFile, pathToTemp } from '../../test/helper'; -import { readFile } from './fileReader'; -import * as fileWriter from './fileWriter'; +import { makePathToFile, pathToTemp } from '../../test/test.helper.js'; +import { readFile } from './fileReader.js'; +import * as fileWriter from './fileWriter.js'; describe('Validate the writer', () => { test.each` diff --git a/packages/cspell-io/src/node/file/fileWriter.ts b/packages/cspell-io/src/node/file/fileWriter.ts index 50d4a11a973..e902c9ee70b 100644 --- a/packages/cspell-io/src/node/file/fileWriter.ts +++ b/packages/cspell-io/src/node/file/fileWriter.ts @@ -3,8 +3,8 @@ import * as Stream from 'stream'; import { promisify } from 'util'; import * as zlib from 'zlib'; -import type { BufferEncoding, BufferEncodingExt } from '../../common/BufferEncoding'; -import { encoderTransformer } from '../../common/transformers'; +import type { BufferEncoding, BufferEncodingExt } from '../../common/BufferEncoding.js'; +import { encoderTransformer } from '../../common/transformers.js'; const pipeline = promisify(Stream.pipeline); diff --git a/packages/cspell-io/src/node/file/index.ts b/packages/cspell-io/src/node/file/index.ts index 2d5ace6d935..a686e54d2e2 100644 --- a/packages/cspell-io/src/node/file/index.ts +++ b/packages/cspell-io/src/node/file/index.ts @@ -1,3 +1,3 @@ -export { readFile, readFileSync } from './fileReader'; -export { writeToFile, writeToFileIterable } from './fileWriter'; -export { getStat, getStatSync } from './stat'; +export { readFile, readFileSync } from './fileReader.js'; +export { writeToFile, writeToFileIterable } from './fileWriter.js'; +export { getStat, getStatSync } from './stat.js'; diff --git a/packages/cspell-io/src/node/file/stat.test.ts b/packages/cspell-io/src/node/file/stat.test.ts index 5a9eed287b1..da002f80e2c 100644 --- a/packages/cspell-io/src/node/file/stat.test.ts +++ b/packages/cspell-io/src/node/file/stat.test.ts @@ -1,6 +1,7 @@ import { join } from 'path'; +import { describe, expect, test } from 'vitest'; -import { getStat, getStatSync } from './stat'; +import { getStat, getStatSync } from './stat.js'; const oc = expect.objectContaining; const sc = expect.stringContaining; diff --git a/packages/cspell-io/src/node/file/stat.ts b/packages/cspell-io/src/node/file/stat.ts index 4831d657da3..f77977b7e6b 100644 --- a/packages/cspell-io/src/node/file/stat.ts +++ b/packages/cspell-io/src/node/file/stat.ts @@ -1,9 +1,9 @@ import { promises as fs, statSync } from 'fs'; import { format } from 'util'; -import type { Stats } from '../../models/Stats'; -import { fetchHead } from './fetch'; -import { isFileURL, isUrlLike, toURL } from './util'; +import type { Stats } from '../../models/Stats.js'; +import { fetchHead } from './fetch.js'; +import { isFileURL, isUrlLike, toURL } from './util.js'; export async function getStat(filenameOrUri: string): Promise { if (isUrlLike(filenameOrUri)) { diff --git a/packages/cspell-io/src/node/file/util.test.ts b/packages/cspell-io/src/node/file/util.test.ts index c98d78c2ec1..93a5e17c1df 100644 --- a/packages/cspell-io/src/node/file/util.test.ts +++ b/packages/cspell-io/src/node/file/util.test.ts @@ -1,6 +1,7 @@ import * as path from 'path'; +import { describe, expect, test } from 'vitest'; -import { basename, isUrlLike, toURL, urlBasename, urlDirname } from './util'; +import { basename, isUrlLike, toURL, urlBasename, urlDirname } from './util.js'; const root = path.join(__dirname, '../..'); const oc = expect.objectContaining; diff --git a/packages/cspell-io/src/requests/RequestFsReadBinaryFile.ts b/packages/cspell-io/src/requests/RequestFsReadBinaryFile.ts index d15bab9ef82..ca0cef729af 100644 --- a/packages/cspell-io/src/requests/RequestFsReadBinaryFile.ts +++ b/packages/cspell-io/src/requests/RequestFsReadBinaryFile.ts @@ -1,7 +1,7 @@ import type { ServiceRequestFactoryRequestType } from '@cspell/cspell-service-bus'; import { requestFactory } from '@cspell/cspell-service-bus'; -import type { BinaryFileResource } from '../models/FileResource'; +import type { BinaryFileResource } from '../models/FileResource.js'; const RequestType = 'fs:readBinaryFile' as const; interface RequestParams { diff --git a/packages/cspell-io/src/requests/RequestFsReadFile.ts b/packages/cspell-io/src/requests/RequestFsReadFile.ts index 9afe66df2f4..34cb677fcde 100644 --- a/packages/cspell-io/src/requests/RequestFsReadFile.ts +++ b/packages/cspell-io/src/requests/RequestFsReadFile.ts @@ -1,7 +1,7 @@ import type { ServiceRequestFactoryRequestType } from '@cspell/cspell-service-bus'; import { requestFactory } from '@cspell/cspell-service-bus'; -import type { TextFileResource } from '../models/FileResource'; +import type { TextFileResource } from '../models/FileResource.js'; const RequestType = 'fs:readFile' as const; interface RequestParams { diff --git a/packages/cspell-io/src/requests/RequestFsReadFileSync.ts b/packages/cspell-io/src/requests/RequestFsReadFileSync.ts index 65e82d20bc4..8afadad0ac4 100644 --- a/packages/cspell-io/src/requests/RequestFsReadFileSync.ts +++ b/packages/cspell-io/src/requests/RequestFsReadFileSync.ts @@ -1,7 +1,7 @@ import type { ServiceRequestFactoryRequestType } from '@cspell/cspell-service-bus'; import { requestFactory } from '@cspell/cspell-service-bus'; -import type { TextFileResource } from '../models/FileResource'; +import type { TextFileResource } from '../models/FileResource.js'; const RequestType = 'fs:readFileSync' as const; interface RequestParams { diff --git a/packages/cspell-io/src/requests/RequestFsStat.ts b/packages/cspell-io/src/requests/RequestFsStat.ts index f01642c6b34..aae9a673707 100644 --- a/packages/cspell-io/src/requests/RequestFsStat.ts +++ b/packages/cspell-io/src/requests/RequestFsStat.ts @@ -1,7 +1,7 @@ import type { ServiceRequestFactoryRequestType } from '@cspell/cspell-service-bus'; import { requestFactory } from '@cspell/cspell-service-bus'; -import type { Stats } from '../models'; +import type { Stats } from '../models/index.js'; const RequestTypeStat = 'fs:stat' as const; interface RequestStatParams { diff --git a/packages/cspell-io/src/requests/index.ts b/packages/cspell-io/src/requests/index.ts index ad0d4794844..f655e56a891 100644 --- a/packages/cspell-io/src/requests/index.ts +++ b/packages/cspell-io/src/requests/index.ts @@ -1,6 +1,6 @@ -export { RequestFsReadBinaryFile, RequestFsReadBinaryFileSync } from './RequestFsReadBinaryFile'; -export { RequestFsReadFile } from './RequestFsReadFile'; -export { RequestFsReadFileSync } from './RequestFsReadFileSync'; -export { RequestFsStat, RequestFsStatSync } from './RequestFsStat'; -export { RequestFsWriteFile } from './RequestFsWriteFile'; -export { RequestZlibInflate } from './RequestZlibInflate'; +export { RequestFsReadBinaryFile, RequestFsReadBinaryFileSync } from './RequestFsReadBinaryFile.js'; +export { RequestFsReadFile } from './RequestFsReadFile.js'; +export { RequestFsReadFileSync } from './RequestFsReadFileSync.js'; +export { RequestFsStat, RequestFsStatSync } from './RequestFsStat.js'; +export { RequestFsWriteFile } from './RequestFsWriteFile.js'; +export { RequestZlibInflate } from './RequestZlibInflate.js'; diff --git a/packages/cspell-io/src/test/helper.ts b/packages/cspell-io/src/test/test.helper.ts similarity index 97% rename from packages/cspell-io/src/test/helper.ts rename to packages/cspell-io/src/test/test.helper.ts index bd8420fa830..85eca7a8c9a 100644 --- a/packages/cspell-io/src/test/helper.ts +++ b/packages/cspell-io/src/test/test.helper.ts @@ -1,5 +1,6 @@ import { mkdir } from 'fs/promises'; import * as path from 'path'; +import { expect } from 'vitest'; const mkdirp = async (p: string) => { await mkdir(p, { recursive: true }); diff --git a/packages/cspell-io/tsconfig.cjs.json b/packages/cspell-io/tsconfig.cjs.json new file mode 100644 index 00000000000..ade2b8401ca --- /dev/null +++ b/packages/cspell-io/tsconfig.cjs.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.cjs.json", + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "dist/compile.cjs.tsbuildInfo", + "module": "CommonJS", + "moduleResolution": "node16", + "rootDir": "src", + "outDir": "dist/cjs", + "types": ["node"] + }, + "include": ["src"] +} diff --git a/packages/cspell-io/tsconfig.dev.json b/packages/cspell-io/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-io/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-io/tsconfig.esm.json b/packages/cspell-io/tsconfig.esm.json new file mode 100644 index 00000000000..2ab479e2ca9 --- /dev/null +++ b/packages/cspell-io/tsconfig.esm.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.esm.json", + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "dist/compile.esm.tsbuildInfo", + "module": "ES2020", + "moduleResolution": "node16", + "rootDir": "src", + "outDir": "dist/esm", + "sourceMap": false, + "types": ["node"] + }, + "include": ["src"] +} diff --git a/packages/cspell-io/tsconfig.json b/packages/cspell-io/tsconfig.json index 7e700314645..e9c5539d270 100644 --- a/packages/cspell-io/tsconfig.json +++ b/packages/cspell-io/tsconfig.json @@ -1,8 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "strictFunctionTypes": true - }, - "include": ["src"] + "files": [], + "references": [{ "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] } diff --git a/packages/cspell-json-reporter/package.json b/packages/cspell-json-reporter/package.json index ce0d8fec8d6..aee545beae4 100644 --- a/packages/cspell-json-reporter/package.json +++ b/packages/cspell-json-reporter/package.json @@ -28,7 +28,6 @@ "scripts": { "clean": "shx rm -rf dist temp coverage .tsbuildinfo", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "watch": "tsc --watch -p .", diff --git a/packages/cspell-json-reporter/tsconfig.dev.json b/packages/cspell-json-reporter/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-json-reporter/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-json-reporter/tsconfig.json b/packages/cspell-json-reporter/tsconfig.json index bcb329ed662..cc4a60f1179 100644 --- a/packages/cspell-json-reporter/tsconfig.json +++ b/packages/cspell-json-reporter/tsconfig.json @@ -3,8 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src/**/*.ts", - "src/**/*.test.ts" - ] + "include": ["src/**/*.ts", "src/**/*.test.ts"] } diff --git a/packages/cspell-lib/package.json b/packages/cspell-lib/package.json index 092ee7fb134..703f8dc30f1 100644 --- a/packages/cspell-lib/package.json +++ b/packages/cspell-lib/package.json @@ -16,7 +16,6 @@ "scripts": { "clean": "shx rm -rf dist temp coverage .tsbuildinfo", "build": "pnpm run compile && pnpm run build-api", - "build-dev": "tsc -p tsconfig.dev.json", "build-api": "rollup -c api/rollup.config.mjs", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", @@ -85,7 +84,6 @@ "@cspell/dict-python": "^4.0.1", "@types/configstore": "^5.0.1", "@types/jest": "^29.4.0", - "@types/node": "^18.14.2", "cspell-dict-nl-nl": "^1.1.2", "expect": "^29.4.3", "jest": "^29.4.3", diff --git a/packages/cspell-lib/tsconfig.dev.json b/packages/cspell-lib/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-lib/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-lib/tsconfig.json b/packages/cspell-lib/tsconfig.json index 068cb7eea1b..f5d2c869c4a 100644 --- a/packages/cspell-lib/tsconfig.json +++ b/packages/cspell-lib/tsconfig.json @@ -6,8 +6,5 @@ "strictFunctionTypes": false, "outDir": "dist" }, - "include": [ - "src/**/*.ts", - "src/**/*.test.ts" - ] + "include": ["src/**/*.ts", "src/**/*.test.ts"] } diff --git a/packages/cspell-pipe/package.json b/packages/cspell-pipe/package.json index c25be34be44..b9cf8508011 100644 --- a/packages/cspell-pipe/package.json +++ b/packages/cspell-pipe/package.json @@ -102,10 +102,9 @@ "!**/*.map" ], "scripts": { - "build": "pnpm build:esm && pnpm build:cjs", + "build": "tsc -b . && ts2mjs dist/esm", "build:cjs": "tsc -p tsconfig.cjs.json", "build:esm": "tsc -p tsconfig.esm.json && ts2mjs dist/esm", - "build-dev": "tsc -p tsconfig.dev.json", "watch": "tsc -p . -w", "clean": "shx rm -rf dist coverage .tsbuildinfo", "clean-build": "pnpm run clean && pnpm run build", @@ -126,7 +125,6 @@ "node": ">=14" }, "devDependencies": { - "@types/node": "^18.14.2", "globby": "^13.1.3" } } diff --git a/packages/cspell-pipe/tsconfig.cjs.json b/packages/cspell-pipe/tsconfig.cjs.json index ac2ec59d4fd..34c676568d5 100644 --- a/packages/cspell-pipe/tsconfig.cjs.json +++ b/packages/cspell-pipe/tsconfig.cjs.json @@ -2,10 +2,13 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "../../tsconfig.cjs.json", "compilerOptions": { - "target": "ES2020", + "composite": true, + "tsBuildInfoFile": "dist/compile.cjs.tsbuildInfo", "module": "CommonJS", "moduleResolution": "node16", - "outDir": "dist/cjs" + "rootDir": "src", + "outDir": "dist/cjs", + "types": ["node"] }, "include": ["src"] } diff --git a/packages/cspell-pipe/tsconfig.dev.json b/packages/cspell-pipe/tsconfig.dev.json deleted file mode 100644 index e05104969bb..00000000000 --- a/packages/cspell-pipe/tsconfig.dev.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-pipe/tsconfig.esm.json b/packages/cspell-pipe/tsconfig.esm.json index 9e441943092..394455ddf52 100644 --- a/packages/cspell-pipe/tsconfig.esm.json +++ b/packages/cspell-pipe/tsconfig.esm.json @@ -2,15 +2,14 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "../../tsconfig.esm.json", "compilerOptions": { - "skipLibCheck": true, - "moduleResolution": "Node16", - "lib": ["es2020", "DOM"], + "composite": true, + "tsBuildInfoFile": "dist/compile.esm.tsbuildInfo", "module": "ES2020", - "target": "es2020", + "moduleResolution": "node16", + "rootDir": "src", "outDir": "dist/esm", + "sourceMap": false, "types": ["node"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-pipe/tsconfig.json b/packages/cspell-pipe/tsconfig.json index bfcfc35325b..e9c5539d270 100644 --- a/packages/cspell-pipe/tsconfig.json +++ b/packages/cspell-pipe/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "./tsconfig.esm.json" + "files": [], + "references": [{ "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] } diff --git a/packages/cspell-service-bus/package.json b/packages/cspell-service-bus/package.json index 7c4bf5c8622..c44553f0e35 100644 --- a/packages/cspell-service-bus/package.json +++ b/packages/cspell-service-bus/package.json @@ -31,11 +31,11 @@ "!**/*.map" ], "scripts": { - "build": "pnpm run clean && pnpm run build:cjs && pnpm run build:esm", + "build": "tsc -b . && ts2mjs dist/esm", "build:cjs": "tsc -p tsconfig.cjs.json", "build:esm": "tsc -p tsconfig.esm.json && ts2mjs dist/esm", "build:clean": "pnpm run clean && pnpm run build", - "watch": "tsc -p . -w", + "watch": "tsc -b . -w", "clean": "shx rm -rf dist coverage .tsbuildinfo", "clean-build": "pnpm build:clean", "coverage": "pnpm coverage:vitest && pnpm coverage:fix", @@ -54,7 +54,5 @@ "engines": { "node": ">=14" }, - "devDependencies": { - "@types/node": "^18.14.2" - } + "devDependencies": {} } diff --git a/packages/cspell-service-bus/tsconfig.cjs.json b/packages/cspell-service-bus/tsconfig.cjs.json index 487942b46ec..70859d4a19d 100644 --- a/packages/cspell-service-bus/tsconfig.cjs.json +++ b/packages/cspell-service-bus/tsconfig.cjs.json @@ -1,10 +1,11 @@ { "extends": "../../tsconfig.cjs.json", "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "dist/compile.cjs.tsbuildInfo", + "rootDir": "src", "outDir": "dist/cjs", "types": ["node"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-service-bus/tsconfig.dev.json b/packages/cspell-service-bus/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-service-bus/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-service-bus/tsconfig.esm.json b/packages/cspell-service-bus/tsconfig.esm.json index 4bff16100b8..3e7a07fa810 100644 --- a/packages/cspell-service-bus/tsconfig.esm.json +++ b/packages/cspell-service-bus/tsconfig.esm.json @@ -1,10 +1,11 @@ { "extends": "../../tsconfig.esm.json", "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "dist/compile.esm.tsbuildInfo", + "rootDir": "src", "outDir": "dist/esm", "types": ["node"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-service-bus/tsconfig.json b/packages/cspell-service-bus/tsconfig.json index 12c6bfaa584..e9c5539d270 100644 --- a/packages/cspell-service-bus/tsconfig.json +++ b/packages/cspell-service-bus/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.cjs.json" + "files": [], + "references": [{ "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] } diff --git a/packages/cspell-strong-weak-map/tsconfig.cjs.json b/packages/cspell-strong-weak-map/tsconfig.cjs.json index 9dae75a83b0..f6680995b7a 100644 --- a/packages/cspell-strong-weak-map/tsconfig.cjs.json +++ b/packages/cspell-strong-weak-map/tsconfig.cjs.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.cjs.json", "compilerOptions": { "composite": true, - "tsBuildInfoFile":"dist/compile.cjs.tsbuildInfo", + "tsBuildInfoFile": "dist/compile.cjs.tsbuildInfo", "module": "CommonJS", "moduleResolution": "node16", "rootDir": "src", @@ -10,7 +10,5 @@ "types": ["node"], "lib": ["ES2020", "ES2021.WeakRef"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-strong-weak-map/tsconfig.esm.json b/packages/cspell-strong-weak-map/tsconfig.esm.json index d081dbb9eb6..6110b1660a7 100644 --- a/packages/cspell-strong-weak-map/tsconfig.esm.json +++ b/packages/cspell-strong-weak-map/tsconfig.esm.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.esm.json", "compilerOptions": { "composite": true, - "tsBuildInfoFile":"dist/compile.esm.tsbuildInfo", + "tsBuildInfoFile": "dist/compile.esm.tsbuildInfo", "module": "ES2020", "moduleResolution": "node16", "rootDir": "src", @@ -11,7 +11,5 @@ "types": ["node"], "lib": ["ES2020", "ES2021.WeakRef"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-strong-weak-map/tsconfig.json b/packages/cspell-strong-weak-map/tsconfig.json index 2df329ce6f4..e9c5539d270 100644 --- a/packages/cspell-strong-weak-map/tsconfig.json +++ b/packages/cspell-strong-weak-map/tsconfig.json @@ -1,4 +1,4 @@ { "files": [], - "references": [ { "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] + "references": [{ "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] } diff --git a/packages/cspell-tools/package.json b/packages/cspell-tools/package.json index 4941200b15a..c8bac55692d 100644 --- a/packages/cspell-tools/package.json +++ b/packages/cspell-tools/package.json @@ -11,7 +11,6 @@ }, "scripts": { "build": "pnpm run build-schema && pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "build-schema": "ts-json-schema-generator --no-top-ref --path src/config/config.ts --type RunConfig --validation-keywords deprecated -o ./cspell-tools.config.schema.json", "compile": "tsc -p .", "watch": "tsc -p . -w", @@ -63,7 +62,6 @@ "devDependencies": { "@types/glob": "^8.1.0", "@types/jest": "^29.4.0", - "@types/node": "^18.14.2", "@types/shelljs": "^0.8.11", "jest": "^29.4.3", "lorem-ipsum": "^2.0.8", diff --git a/packages/cspell-tools/tsconfig.dev.json b/packages/cspell-tools/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell-tools/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/cspell-tools/tsconfig.json b/packages/cspell-tools/tsconfig.json index 1b66bb53331..7353ba94805 100644 --- a/packages/cspell-tools/tsconfig.json +++ b/packages/cspell-tools/tsconfig.json @@ -4,7 +4,5 @@ "exactOptionalPropertyTypes": false, // make this true "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-trie-lib/package.json b/packages/cspell-trie-lib/package.json index 03b432cecab..892dcd8e10f 100644 --- a/packages/cspell-trie-lib/package.json +++ b/packages/cspell-trie-lib/package.json @@ -57,7 +57,6 @@ }, "devDependencies": { "@cspell/dict-en_us": "^3.0.0", - "@cspell/dict-es-es": "^2.2.4", - "@types/node": "^18.14.2" + "@cspell/dict-es-es": "^2.2.4" } } diff --git a/packages/cspell-trie-lib/tsconfig.cjs.json b/packages/cspell-trie-lib/tsconfig.cjs.json index 0aae99dd95c..ade2b8401ca 100644 --- a/packages/cspell-trie-lib/tsconfig.cjs.json +++ b/packages/cspell-trie-lib/tsconfig.cjs.json @@ -2,14 +2,12 @@ "extends": "../../tsconfig.cjs.json", "compilerOptions": { "composite": true, - "tsBuildInfoFile":"dist/compile.cjs.tsbuildInfo", + "tsBuildInfoFile": "dist/compile.cjs.tsbuildInfo", "module": "CommonJS", "moduleResolution": "node16", "rootDir": "src", "outDir": "dist/cjs", "types": ["node"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-trie-lib/tsconfig.esm.json b/packages/cspell-trie-lib/tsconfig.esm.json index 1013e4c2d09..2ab479e2ca9 100644 --- a/packages/cspell-trie-lib/tsconfig.esm.json +++ b/packages/cspell-trie-lib/tsconfig.esm.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.esm.json", "compilerOptions": { "composite": true, - "tsBuildInfoFile":"dist/compile.esm.tsbuildInfo", + "tsBuildInfoFile": "dist/compile.esm.tsbuildInfo", "module": "ES2020", "moduleResolution": "node16", "rootDir": "src", @@ -10,7 +10,5 @@ "sourceMap": false, "types": ["node"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-trie-lib/tsconfig.json b/packages/cspell-trie-lib/tsconfig.json index 2df329ce6f4..e9c5539d270 100644 --- a/packages/cspell-trie-lib/tsconfig.json +++ b/packages/cspell-trie-lib/tsconfig.json @@ -1,4 +1,4 @@ { "files": [], - "references": [ { "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] + "references": [{ "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] } diff --git a/packages/cspell-trie/package.json b/packages/cspell-trie/package.json index 8aa8bd160f3..8f9e46330e0 100644 --- a/packages/cspell-trie/package.json +++ b/packages/cspell-trie/package.json @@ -18,7 +18,6 @@ "scripts": { "clean": "shx rm -rf dist temp coverage", "build": "tsc -p .", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "coverage": "pnpm coverage:vitest && pnpm coverage:fix", "coverage:vitest": "vitest run --coverage", @@ -49,7 +48,5 @@ "engines": { "node": ">=14" }, - "devDependencies": { - "@types/node": "^18.14.2" - } + "devDependencies": {} } diff --git a/packages/cspell-trie/tsconfig.json b/packages/cspell-trie/tsconfig.json index a1d17907f41..5bf244f54ef 100644 --- a/packages/cspell-trie/tsconfig.json +++ b/packages/cspell-trie/tsconfig.json @@ -2,11 +2,9 @@ "extends": "../../tsconfig.esm.json", "compilerOptions": { "composite": true, - "tsBuildInfoFile":"dist/compile.esm.tsbuildInfo", + "tsBuildInfoFile": "dist/compile.esm.tsbuildInfo", "rootDir": "src", "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-types/tsconfig.cjs.json b/packages/cspell-types/tsconfig.cjs.json index 0aae99dd95c..ade2b8401ca 100644 --- a/packages/cspell-types/tsconfig.cjs.json +++ b/packages/cspell-types/tsconfig.cjs.json @@ -2,14 +2,12 @@ "extends": "../../tsconfig.cjs.json", "compilerOptions": { "composite": true, - "tsBuildInfoFile":"dist/compile.cjs.tsbuildInfo", + "tsBuildInfoFile": "dist/compile.cjs.tsbuildInfo", "module": "CommonJS", "moduleResolution": "node16", "rootDir": "src", "outDir": "dist/cjs", "types": ["node"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-types/tsconfig.esm.json b/packages/cspell-types/tsconfig.esm.json index 1013e4c2d09..2ab479e2ca9 100644 --- a/packages/cspell-types/tsconfig.esm.json +++ b/packages/cspell-types/tsconfig.esm.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.esm.json", "compilerOptions": { "composite": true, - "tsBuildInfoFile":"dist/compile.esm.tsbuildInfo", + "tsBuildInfoFile": "dist/compile.esm.tsbuildInfo", "module": "ES2020", "moduleResolution": "node16", "rootDir": "src", @@ -10,7 +10,5 @@ "sourceMap": false, "types": ["node"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/cspell-types/tsconfig.json b/packages/cspell-types/tsconfig.json index 2df329ce6f4..e9c5539d270 100644 --- a/packages/cspell-types/tsconfig.json +++ b/packages/cspell-types/tsconfig.json @@ -1,4 +1,4 @@ { "files": [], - "references": [ { "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] + "references": [{ "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] } diff --git a/packages/cspell/package.json b/packages/cspell/package.json index bdab96cf3dd..922265ac9a8 100644 --- a/packages/cspell/package.json +++ b/packages/cspell/package.json @@ -39,7 +39,6 @@ "clean": "shx rm -rf dist coverage .tsbuildinfo", "build": "pnpm run compile && pnpm run build-api", "build-api": "rollup -c rollup.config.mjs", - "build-dev": "tsc -p tsconfig.dev.json", "build:readme": "pnpm build:readme:help", "build:readme:help": "pnpm build:readme:help:lint && pnpm build:readme:help:trace && inject-markdown README.md && prettier -w README.md", "build:readme:help:lint": "./bin.js lint --help > static/help-lint.txt", diff --git a/packages/cspell/tsconfig.dev.json b/packages/cspell/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/cspell/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/dynamic-import/src/cjs/tsconfig.json b/packages/dynamic-import/src/cjs/tsconfig.json index ca6e7aa24f5..9057f64d737 100644 --- a/packages/dynamic-import/src/cjs/tsconfig.json +++ b/packages/dynamic-import/src/cjs/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "../../tsconfig.base.json", "compilerOptions": { - "tsBuildInfoFile":"../../dist/compile.cjs.tsbuildInfo", + "tsBuildInfoFile": "../../dist/compile.cjs.tsbuildInfo", "composite": true, "incremental": true, "skipLibCheck": true, @@ -13,10 +13,6 @@ "outDir": "../../dist/cjs", "types": ["node"] }, - "include": [ - "." - ], - "references": [ - { "path": "../esm/tsconfig.json" } - ] + "include": ["."], + "references": [{ "path": "../esm/tsconfig.json" }] } diff --git a/packages/dynamic-import/src/esm/tsconfig.json b/packages/dynamic-import/src/esm/tsconfig.json index d361bf568f1..8968e81ed12 100644 --- a/packages/dynamic-import/src/esm/tsconfig.json +++ b/packages/dynamic-import/src/esm/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "../../tsconfig.base.json", "compilerOptions": { - "tsBuildInfoFile":"../../dist/compile.esm.tsbuildInfo", + "tsBuildInfoFile": "../../dist/compile.esm.tsbuildInfo", "composite": true, "incremental": true, "skipLibCheck": true, @@ -14,7 +14,5 @@ "outDir": "../../dist/esm", "types": ["node"] }, - "include": [ - "." - ] + "include": ["."] } diff --git a/packages/dynamic-import/src/test/tsconfig.json b/packages/dynamic-import/src/test/tsconfig.json index 803ebb09fc1..247df79472a 100644 --- a/packages/dynamic-import/src/test/tsconfig.json +++ b/packages/dynamic-import/src/test/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "../../tsconfig.base.json", "compilerOptions": { - "tsBuildInfoFile":"../../dist/compile.test.tsbuildInfo", + "tsBuildInfoFile": "../../dist/compile.test.tsbuildInfo", "composite": true, "incremental": true, "skipLibCheck": true, @@ -14,10 +14,6 @@ "outDir": "../../dist/esm", "types": ["node"] }, - "include": [ - "." - ], - "references": [ - { "path": "../cjs/tsconfig.json" } - ] + "include": ["."], + "references": [{ "path": "../cjs/tsconfig.json" }] } diff --git a/packages/dynamic-import/tsconfig.json b/packages/dynamic-import/tsconfig.json index 9276a99e15f..203219512e6 100644 --- a/packages/dynamic-import/tsconfig.json +++ b/packages/dynamic-import/tsconfig.json @@ -1,14 +1,14 @@ { "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { - "tsBuildInfoFile":"./dist/compile.tsbuildInfo", + "tsBuildInfoFile": "./dist/compile.tsbuildInfo", "incremental": true, "composite": true }, "files": [], - "references": [ - { "path": "./src/cjs/tsconfig.json" }, - { "path": "./src/test/tsconfig.json" }, - { "path": "./src/esm/tsconfig.json" } - ] + "references": [ + { "path": "./src/cjs/tsconfig.json" }, + { "path": "./src/test/tsconfig.json" }, + { "path": "./src/esm/tsconfig.json" } + ] } diff --git a/packages/hunspell-reader/package.json b/packages/hunspell-reader/package.json index 891fe933325..53882aa24cd 100644 --- a/packages/hunspell-reader/package.json +++ b/packages/hunspell-reader/package.json @@ -18,7 +18,6 @@ "smoke-test": "../bin.js words ./dictionaries/nl -n 100", "test": "pnpm run test-unit", "build": "tsc -p .", - "build-dev": "tsc -p tsconfig.dev.json", "lint": "prettier -w \"**/*.{md,yaml,yml,json,ts}\"", "clean": "shx rm -rf dist coverage .tsbuildinfo", "coverage": "jest --coverage", @@ -39,7 +38,6 @@ "homepage": "https://github.com/streetsidesoftware/cspell/tree/main/packages/hunspell-reader#readme", "devDependencies": { "@types/jest": "^29.4.0", - "@types/node": "^18.14.2", "jest": "^29.4.3", "ts-jest": "^29.0.5", "typescript": "^4.9.5" diff --git a/packages/hunspell-reader/tsconfig.dev.json b/packages/hunspell-reader/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/packages/hunspell-reader/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/packages/hunspell-reader/tsconfig.json b/packages/hunspell-reader/tsconfig.json index 37e050a727f..7464b277cdc 100644 --- a/packages/hunspell-reader/tsconfig.json +++ b/packages/hunspell-reader/tsconfig.json @@ -5,7 +5,5 @@ "noImplicitAny": true, "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bf07d8c6253..1b0d6d1d296 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -100,7 +100,6 @@ importers: '@cspell/cspell-types': workspace:* '@cspell/dict-de-de': ^3.0.2 '@octokit/rest': ^19.0.7 - '@types/node': ^18.14.2 '@types/shelljs': ^0.8.11 chalk: ^4.1.2 commander: ^10.0.0 @@ -122,10 +121,9 @@ importers: devDependencies: '@cspell/cspell-bundled-dicts': link:../packages/cspell-bundled-dicts '@cspell/dict-de-de': 3.0.2 - '@types/node': 18.14.2 '@types/shelljs': 0.8.11 cspell: link:../packages/cspell - jest: 29.4.3_@types+node@18.14.2 + jest: 29.4.3 packages/Samples: specifiers: @@ -304,7 +302,6 @@ importers: packages/cspell-config-lib: specifiers: '@cspell/cspell-types': workspace:* - '@types/node': ^18.14.2 comment-json: ^4.2.3 jest: ^29.4.3 vscode-uri: ^3.0.7 @@ -315,8 +312,7 @@ importers: vscode-uri: 3.0.7 yaml: 1.10.2 devDependencies: - '@types/node': 18.14.2 - jest: 29.4.3_@types+node@18.14.2 + jest: 29.4.3 packages/cspell-dictionary: specifiers: @@ -358,7 +354,6 @@ importers: specifiers: '@types/eslint': ^8.21.1 '@types/estree': ^1.0.0 - '@types/node': ^18.14.2 '@typescript-eslint/parser': ^5.54.0 '@typescript-eslint/types': ^5.54.0 '@typescript-eslint/typescript-estree': ^5.54.0 @@ -376,7 +371,6 @@ importers: devDependencies: '@types/eslint': 8.21.1 '@types/estree': 1.0.0 - '@types/node': 18.14.2 '@typescript-eslint/parser': 5.54.0_ycpbpc6yetojsgtrx3mwntkhsu '@typescript-eslint/types': 5.54.0 '@typescript-eslint/typescript-estree': 5.54.0_typescript@4.9.5 @@ -387,45 +381,37 @@ importers: packages/cspell-gitignore: specifiers: - '@types/node': ^18.14.2 cspell-glob: workspace:* find-up: ^5.0.0 dependencies: cspell-glob: link:../cspell-glob find-up: 5.0.0 - devDependencies: - '@types/node': 18.14.2 packages/cspell-glob: specifiers: '@types/micromatch': ^4.0.2 - '@types/node': ^18.14.2 jest: ^29.4.3 micromatch: ^4.0.5 dependencies: micromatch: 4.0.5 devDependencies: '@types/micromatch': 4.0.2 - '@types/node': 18.14.2 - jest: 29.4.3_@types+node@18.14.2 + jest: 29.4.3 packages/cspell-grammar: specifiers: '@cspell/cspell-pipe': workspace:* '@cspell/cspell-types': workspace:* - '@types/node': ^18.14.2 jest: ^29.4.3 dependencies: '@cspell/cspell-pipe': link:../cspell-pipe '@cspell/cspell-types': link:../cspell-types devDependencies: - '@types/node': 18.14.2 - jest: 29.4.3_@types+node@18.14.2 + jest: 29.4.3 packages/cspell-io: specifiers: '@cspell/cspell-service-bus': workspace:* - '@types/node': ^18.14.2 '@types/node-fetch': ^2.6.2 jest: ^29.4.3 lorem-ipsum: ^2.0.8 @@ -434,9 +420,8 @@ importers: '@cspell/cspell-service-bus': link:../cspell-service-bus node-fetch: 2.6.9 devDependencies: - '@types/node': 18.14.2 '@types/node-fetch': 2.6.2 - jest: 29.4.3_@types+node@18.14.2 + jest: 29.4.3 lorem-ipsum: 2.0.8 packages/cspell-json-reporter: @@ -461,7 +446,6 @@ importers: '@cspell/strong-weak-map': workspace:* '@types/configstore': ^5.0.1 '@types/jest': ^29.4.0 - '@types/node': ^18.14.2 clear-module: ^4.1.2 comment-json: ^4.2.3 configstore: ^5.0.1 @@ -519,10 +503,9 @@ importers: '@cspell/dict-python': 4.0.1 '@types/configstore': 5.0.1 '@types/jest': 29.4.0 - '@types/node': 18.14.2 cspell-dict-nl-nl: 1.1.2 expect: 29.4.3 - jest: 29.4.3_@types+node@18.14.2 + jest: 29.4.3 lorem-ipsum: 2.0.8 rollup: 3.17.3 rollup-plugin-dts: 5.2.0_5h3uv6h5hdci4akcbsseut5pjq @@ -530,17 +513,12 @@ importers: packages/cspell-pipe: specifiers: - '@types/node': ^18.14.2 globby: ^13.1.3 devDependencies: - '@types/node': 18.14.2 globby: 13.1.3 packages/cspell-service-bus: - specifiers: - '@types/node': ^18.14.2 - devDependencies: - '@types/node': 18.14.2 + specifiers: {} packages/cspell-strong-weak-map: specifiers: {} @@ -550,7 +528,6 @@ importers: '@cspell/cspell-pipe': workspace:* '@types/glob': ^8.1.0 '@types/jest': ^29.4.0 - '@types/node': ^18.14.2 '@types/shelljs': ^0.8.11 commander: ^10.0.0 cosmiconfig: ^8.1.0 @@ -573,16 +550,14 @@ importers: devDependencies: '@types/glob': 8.1.0 '@types/jest': 29.4.0 - '@types/node': 18.14.2 '@types/shelljs': 0.8.11 - jest: 29.4.3_@types+node@18.14.2 + jest: 29.4.3 lorem-ipsum: 2.0.8 shelljs: 0.8.5 ts-json-schema-generator: 1.2.0 packages/cspell-trie: specifiers: - '@types/node': ^18.14.2 commander: ^10.0.0 cspell-trie-lib: workspace:* gensequence: ^5.0.2 @@ -590,8 +565,6 @@ importers: commander: 10.0.0 cspell-trie-lib: link:../cspell-trie-lib gensequence: 5.0.2 - devDependencies: - '@types/node': 18.14.2 packages/cspell-trie-lib: specifiers: @@ -599,7 +572,6 @@ importers: '@cspell/cspell-types': workspace:* '@cspell/dict-en_us': ^3.0.0 '@cspell/dict-es-es': ^2.2.4 - '@types/node': ^18.14.2 gensequence: ^5.0.2 dependencies: '@cspell/cspell-pipe': link:../cspell-pipe @@ -608,7 +580,6 @@ importers: devDependencies: '@cspell/dict-en_us': 3.0.0 '@cspell/dict-es-es': 2.2.4 - '@types/node': 18.14.2 packages/cspell-types: specifiers: @@ -631,7 +602,6 @@ importers: '@cspell/cspell-pipe': workspace:^ '@cspell/cspell-types': workspace:^ '@types/jest': ^29.4.0 - '@types/node': ^18.14.2 commander: ^10.0.0 gensequence: ^5.0.2 iconv-lite: ^0.6.3 @@ -646,8 +616,7 @@ importers: iconv-lite: 0.6.3 devDependencies: '@types/jest': 29.4.0 - '@types/node': 18.14.2 - jest: 29.4.3_@types+node@18.14.2 + jest: 29.4.3 ts-jest: 29.0.5_kv2fdk7yz6jlbcjfldgcwh5vp4 typescript: 4.9.5 diff --git a/rfc/rfc-0001 suggestions/tsconfig.json b/rfc/rfc-0001 suggestions/tsconfig.json index bcb329ed662..cc4a60f1179 100644 --- a/rfc/rfc-0001 suggestions/tsconfig.json +++ b/rfc/rfc-0001 suggestions/tsconfig.json @@ -3,8 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src/**/*.ts", - "src/**/*.test.ts" - ] + "include": ["src/**/*.ts", "src/**/*.test.ts"] } diff --git a/test-packages/cspell-eslint-plugin/test-cspell-eslint-plugin/tsconfig.dev.json b/test-packages/cspell-eslint-plugin/test-cspell-eslint-plugin/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-eslint-plugin/test-cspell-eslint-plugin/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-eslint-plugin/test-cspell-eslint-plugin/tsconfig.json b/test-packages/cspell-eslint-plugin/test-cspell-eslint-plugin/tsconfig.json index 41b26af8340..e5f78fa12aa 100644 --- a/test-packages/cspell-eslint-plugin/test-cspell-eslint-plugin/tsconfig.json +++ b/test-packages/cspell-eslint-plugin/test-cspell-eslint-plugin/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "fixtures" - ] + "include": ["fixtures"] } diff --git a/test-packages/cspell-glob/test-cspell-glob/package.json b/test-packages/cspell-glob/test-cspell-glob/package.json index eb7e98913f4..d6f2af640de 100644 --- a/test-packages/cspell-glob/test-cspell-glob/package.json +++ b/test-packages/cspell-glob/test-cspell-glob/package.json @@ -6,7 +6,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "node dist" diff --git a/test-packages/cspell-glob/test-cspell-glob/tsconfig.dev.json b/test-packages/cspell-glob/test-cspell-glob/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-glob/test-cspell-glob/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-glob/test-cspell-glob/tsconfig.json b/test-packages/cspell-glob/test-cspell-glob/tsconfig.json index ea66af6b8f4..cdf04e74d88 100644 --- a/test-packages/cspell-glob/test-cspell-glob/tsconfig.json +++ b/test-packages/cspell-glob/test-cspell-glob/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-io/test-cspell-io/bin.cjs b/test-packages/cspell-io/test-cspell-io/bin.cjs new file mode 100755 index 00000000000..32d52e34ce4 --- /dev/null +++ b/test-packages/cspell-io/test-cspell-io/bin.cjs @@ -0,0 +1,12 @@ +#!/usr/bin/env node + +const assert = require('assert'); +const { run } = require('./dist/cjs/index'); + +async function main() { + assert(typeof run === 'function'); + assert(await run(__filename)); + console.log('done.'); +} + +main(); diff --git a/test-packages/cspell-io/test-cspell-io/bin.mjs b/test-packages/cspell-io/test-cspell-io/bin.mjs new file mode 100755 index 00000000000..2b9e2e12a8e --- /dev/null +++ b/test-packages/cspell-io/test-cspell-io/bin.mjs @@ -0,0 +1,12 @@ +#!/usr/bin/env node + +import assert from 'assert'; +import { run } from './dist/esm/index.mjs'; + +async function main() { + assert(typeof run === 'function'); + assert(await run(import.meta.url)); + console.log('done.'); +} + +main(); diff --git a/test-packages/cspell-io/test-cspell-io/bin.rollup.cjs b/test-packages/cspell-io/test-cspell-io/bin.rollup.cjs new file mode 100755 index 00000000000..6519719c012 --- /dev/null +++ b/test-packages/cspell-io/test-cspell-io/bin.rollup.cjs @@ -0,0 +1,12 @@ +#!/usr/bin/env node + +const assert = require('assert'); +const { run } = require('./dist/rollup/cjs/index.cjs'); + +async function main() { + assert(typeof run === 'function'); + assert(await run(__filename)); + console.log('done.'); +} + +main(); diff --git a/test-packages/cspell-io/test-cspell-io/bin.rollup.mjs b/test-packages/cspell-io/test-cspell-io/bin.rollup.mjs new file mode 100755 index 00000000000..b3c9134630b --- /dev/null +++ b/test-packages/cspell-io/test-cspell-io/bin.rollup.mjs @@ -0,0 +1,12 @@ +#!/usr/bin/env node + +import assert from 'assert'; +import { run } from './dist/rollup/esm/index.mjs'; + +async function main() { + assert(typeof run === 'function'); + assert(await run(import.meta.url)); + console.log('done.'); +} + +main(); diff --git a/test-packages/cspell-io/test-cspell-io/package.json b/test-packages/cspell-io/test-cspell-io/package.json index dd1bb4524bd..d481468afbf 100644 --- a/test-packages/cspell-io/test-cspell-io/package.json +++ b/test-packages/cspell-io/test-cspell-io/package.json @@ -3,13 +3,23 @@ "version": "6.27.0", "description": "Pure testing package for cspell-io. Its purpose is to verify cspell-io dependencies.", "private": true, + "bin": { + "test-cjs": "./bin.cjs", + "test-mjs": "./bin.mjs", + "test-rollup-cjs": "./bin.rollup.cjs", + "test-rollup-mjs": "./bin.rollup.mjs" + }, + "type": "commonjs", "scripts": { - "clean": "shx rm -rf dist .tsbuildinfo", - "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", + "clean": "shx rm -rf dist .rollup.cache", + "build": "pnpm build:ts && pnpm build:rollup", + "build:rollup": "rollup -c rollup.config.mjs", + "build:ts": "pnpm run compile && ts2mjs dist/esm", "clean-build": "pnpm run clean && pnpm run build", - "compile": "tsc -p .", - "test": "node dist" + "compile": "tsc -b .", + "test": "pnpm test:unit && pnpm test:smoke", + "test:smoke": "node ./bin.mjs && node ./bin.cjs && node ./bin.rollup.mjs && node ./bin.rollup.cjs", + "test:unit": "vitest run" }, "author": "", "license": "MIT", diff --git a/test-packages/cspell-io/test-cspell-io/rollup.config.mjs b/test-packages/cspell-io/test-cspell-io/rollup.config.mjs new file mode 100644 index 00000000000..69387aba403 --- /dev/null +++ b/test-packages/cspell-io/test-cspell-io/rollup.config.mjs @@ -0,0 +1,68 @@ +/* eslint-disable node/no-extraneous-import */ +import rollupPluginNodeResolve from '@rollup/plugin-node-resolve'; +import rollupPluginTypescript from '@rollup/plugin-typescript'; +import rollupPluginJson from '@rollup/plugin-json'; +import rollupPluginCommonjs from '@rollup/plugin-commonjs'; +// import { readFileSync } from 'fs'; + +// const pkg = JSON.parse(readFileSync('./package.json', 'utf-8')); + +/** @type {import('rollup').RollupOptions} */ +const common = { + input: 'src/index.ts', + + output: { + sourcemap: true, + }, + + // external: ['@cspell/cspell-pipe', '@cspell/cspell-pipe/sync'], + + treeshake: { + annotations: true, + moduleSideEffects: [], + propertyReadSideEffects: false, + unknownGlobalSideEffects: false, + }, +}; + +/** + * Get new instances of all the common plugins. + */ +function getPlugins(tsconfig = 'tsconfig.esm.json') { + return [ + rollupPluginTypescript({ + tsconfig, + }), + rollupPluginNodeResolve({ + mainFields: ['module', 'exports', 'es', 'es6', 'esm', 'main'], + extensions: ['.ts', '.js', '.mjs', '.mts', '.node', '.json'], + preferBuiltins: true, + }), + rollupPluginCommonjs({ + transformMixedEsModules: true, + }), + rollupPluginJson(), + // rollupPluginTerser({ + // ecma: 2018, + // warnings: true, + // compress: { drop_console: false }, + // format: { comments: false }, + // sourceMap: true, + // }), + ]; +} + +/** @type {import('rollup').RollupOptions[]} */ +const configs = [ + { + ...common, + external: [], + output: [ + { ...common.output, file: './dist/rollup/cjs/index.cjs', format: 'cjs' }, + { ...common.output, file: './dist/rollup/esm/index.mjs', format: 'es' }, + // { ...common.output, file: pkg.browser, format: 'umd', name: 'test-cspell-pipe-rollup' }, + ], + plugins: getPlugins(), + }, +]; +export default configs; diff --git a/test-packages/cspell-io/test-cspell-io/src/index.test.cts b/test-packages/cspell-io/test-cspell-io/src/index.test.cts new file mode 100644 index 00000000000..7e36ccdb5a9 --- /dev/null +++ b/test-packages/cspell-io/test-cspell-io/src/index.test.cts @@ -0,0 +1,9 @@ +import { describe, expect, test } from 'vitest'; + +import { run } from './index.js'; + +describe('index', () => { + test('run', async () => { + expect(await run(__filename)).toEqual(expect.stringContaining('this bit of text')); + }); +}); diff --git a/test-packages/cspell-io/test-cspell-io/src/index.ts b/test-packages/cspell-io/test-cspell-io/src/index.ts index 648b6307809..90b557f0752 100644 --- a/test-packages/cspell-io/test-cspell-io/src/index.ts +++ b/test-packages/cspell-io/test-cspell-io/src/index.ts @@ -1,13 +1,9 @@ -import { assert } from 'console'; -import * as io from 'cspell-io'; +import { readFile } from 'cspell-io'; -console.log('start'); +export function run(file: string) { + return read(file); +} -/** - * The main goal here is to make sure it compiles. The unit tests are validation that it compiled as expected. - */ -const functions = [io.readFile, io.writeToFile]; - -functions.forEach((fn) => assert(typeof fn === 'function', "typeof %o === 'function'", fn)); - -console.log('done'); +export function read(name: string): Promise { + return readFile(name); +} diff --git a/test-packages/cspell-io/test-cspell-io/tsconfig.cjs.json b/test-packages/cspell-io/test-cspell-io/tsconfig.cjs.json new file mode 100644 index 00000000000..c4a699e4ed7 --- /dev/null +++ b/test-packages/cspell-io/test-cspell-io/tsconfig.cjs.json @@ -0,0 +1,13 @@ +{ + "extends": "../../../tsconfig.cjs.json", + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "dist/compile.cjs.tsbuildInfo", + "module": "CommonJS", + "moduleResolution": "node16", + "rootDir": "src", + "outDir": "dist/cjs", + "types": ["node"] + }, + "include": ["src"] +} diff --git a/test-packages/cspell-io/test-cspell-io/tsconfig.dev.json b/test-packages/cspell-io/test-cspell-io/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-io/test-cspell-io/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-io/test-cspell-io/tsconfig.esm.json b/test-packages/cspell-io/test-cspell-io/tsconfig.esm.json new file mode 100644 index 00000000000..d1832ac1e38 --- /dev/null +++ b/test-packages/cspell-io/test-cspell-io/tsconfig.esm.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../tsconfig.esm.json", + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "dist/compile.esm.tsbuildInfo", + "module": "ES2020", + "moduleResolution": "node16", + "rootDir": "src", + "outDir": "dist/esm", + "sourceMap": false, + "types": ["node"] + }, + "include": ["src"] +} diff --git a/test-packages/cspell-io/test-cspell-io/tsconfig.json b/test-packages/cspell-io/test-cspell-io/tsconfig.json index ea66af6b8f4..e9c5539d270 100644 --- a/test-packages/cspell-io/test-cspell-io/tsconfig.json +++ b/test-packages/cspell-io/test-cspell-io/tsconfig.json @@ -1,9 +1,4 @@ { - "extends": "../../../tsconfig.json", - "compilerOptions": { - "outDir": "dist" - }, - "include": [ - "src" - ] + "files": [], + "references": [{ "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] } diff --git a/test-packages/cspell-io/test-cspell-io/xtsconfig.json b/test-packages/cspell-io/test-cspell-io/xtsconfig.json new file mode 100644 index 00000000000..cdf04e74d88 --- /dev/null +++ b/test-packages/cspell-io/test-cspell-io/xtsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "dist" + }, + "include": ["src"] +} diff --git a/test-packages/cspell-lib/test-cspell-lib-esm/tsconfig.json b/test-packages/cspell-lib/test-cspell-lib-esm/tsconfig.json index a9d9e8969a6..c1be12d6b38 100644 --- a/test-packages/cspell-lib/test-cspell-lib-esm/tsconfig.json +++ b/test-packages/cspell-lib/test-cspell-lib-esm/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-lib/test-cspell-lib-rollup/plugin/tsconfig.json b/test-packages/cspell-lib/test-cspell-lib-rollup/plugin/tsconfig.json index 8b1dd36346f..820a931c2d8 100644 --- a/test-packages/cspell-lib/test-cspell-lib-rollup/plugin/tsconfig.json +++ b/test-packages/cspell-lib/test-cspell-lib-rollup/plugin/tsconfig.json @@ -4,7 +4,5 @@ "outDir": "dist", "allowJs": true }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-lib/test-cspell-lib-rollup/tsconfig.json b/test-packages/cspell-lib/test-cspell-lib-rollup/tsconfig.json index 58604489b14..86731d26473 100644 --- a/test-packages/cspell-lib/test-cspell-lib-rollup/tsconfig.json +++ b/test-packages/cspell-lib/test-cspell-lib-rollup/tsconfig.json @@ -4,7 +4,5 @@ "outDir": "dist", "allowJs": true }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-lib/test-cspell-lib-webpack/tsconfig.dev.json b/test-packages/cspell-lib/test-cspell-lib-webpack/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-lib/test-cspell-lib-webpack/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-lib/test-cspell-lib-webpack/tsconfig.json b/test-packages/cspell-lib/test-cspell-lib-webpack/tsconfig.json index ea66af6b8f4..cdf04e74d88 100644 --- a/test-packages/cspell-lib/test-cspell-lib-webpack/tsconfig.json +++ b/test-packages/cspell-lib/test-cspell-lib-webpack/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-lib/test-cspell-lib/package.json b/test-packages/cspell-lib/test-cspell-lib/package.json index b00f11a1897..09fee48f735 100644 --- a/test-packages/cspell-lib/test-cspell-lib/package.json +++ b/test-packages/cspell-lib/test-cspell-lib/package.json @@ -8,7 +8,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "node bin.js" diff --git a/test-packages/cspell-lib/test-cspell-lib/tsconfig.dev.json b/test-packages/cspell-lib/test-cspell-lib/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-lib/test-cspell-lib/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-lib/test-cspell-lib/tsconfig.json b/test-packages/cspell-lib/test-cspell-lib/tsconfig.json index ea66af6b8f4..cdf04e74d88 100644 --- a/test-packages/cspell-lib/test-cspell-lib/tsconfig.json +++ b/test-packages/cspell-lib/test-cspell-lib/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-pipe/test-cspell-pipe-esm/package.json b/test-packages/cspell-pipe/test-cspell-pipe-esm/package.json index 3e1409d7cff..8c7fdb442ed 100644 --- a/test-packages/cspell-pipe/test-cspell-pipe-esm/package.json +++ b/test-packages/cspell-pipe/test-cspell-pipe-esm/package.json @@ -8,7 +8,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "pnpm test:unit && pnpm test:smoke", diff --git a/test-packages/cspell-pipe/test-cspell-pipe-esm/tsconfig.dev.json b/test-packages/cspell-pipe/test-cspell-pipe-esm/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-pipe/test-cspell-pipe-esm/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-pipe/test-cspell-pipe-esm/tsconfig.json b/test-packages/cspell-pipe/test-cspell-pipe-esm/tsconfig.json index a9d9e8969a6..c1be12d6b38 100644 --- a/test-packages/cspell-pipe/test-cspell-pipe-esm/tsconfig.json +++ b/test-packages/cspell-pipe/test-cspell-pipe-esm/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-pipe/test-cspell-pipe-rollup/package.json b/test-packages/cspell-pipe/test-cspell-pipe-rollup/package.json index 621c307097b..dc2f4ef96ac 100644 --- a/test-packages/cspell-pipe/test-cspell-pipe-rollup/package.json +++ b/test-packages/cspell-pipe/test-cspell-pipe-rollup/package.json @@ -14,7 +14,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "rollup -c rollup.config.mjs", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "pnpm test:unit && pnpm test:smoke", diff --git a/test-packages/cspell-pipe/test-cspell-pipe-rollup/tsconfig.dev.json b/test-packages/cspell-pipe/test-cspell-pipe-rollup/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-pipe/test-cspell-pipe-rollup/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-pipe/test-cspell-pipe-rollup/tsconfig.json b/test-packages/cspell-pipe/test-cspell-pipe-rollup/tsconfig.json index a9d9e8969a6..c1be12d6b38 100644 --- a/test-packages/cspell-pipe/test-cspell-pipe-rollup/tsconfig.json +++ b/test-packages/cspell-pipe/test-cspell-pipe-rollup/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-pipe/test-cspell-pipe/package.json b/test-packages/cspell-pipe/test-cspell-pipe/package.json index daa7ceb90e2..f54e6b21441 100644 --- a/test-packages/cspell-pipe/test-cspell-pipe/package.json +++ b/test-packages/cspell-pipe/test-cspell-pipe/package.json @@ -10,7 +10,6 @@ "build": "pnpm build:node10 && pnpm build:cjs", "build:node10": "tsc -p .", "build:cjs": "tsc -p tsconfig.cjs.json", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "test": "pnpm test:unit && pnpm test:smoke", "test:smoke": "node ./bin.cjs", diff --git a/test-packages/cspell-pipe/test-cspell-pipe/tsconfig.cjs.json b/test-packages/cspell-pipe/test-cspell-pipe/tsconfig.cjs.json index 1b344ea06e8..b101c3a180e 100644 --- a/test-packages/cspell-pipe/test-cspell-pipe/tsconfig.cjs.json +++ b/test-packages/cspell-pipe/test-cspell-pipe/tsconfig.cjs.json @@ -5,7 +5,5 @@ "moduleResolution": "node16", "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-pipe/test-cspell-pipe/tsconfig.dev.json b/test-packages/cspell-pipe/test-cspell-pipe/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-pipe/test-cspell-pipe/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-pipe/test-cspell-pipe/tsconfig.json b/test-packages/cspell-pipe/test-cspell-pipe/tsconfig.json index ea66af6b8f4..cdf04e74d88 100644 --- a/test-packages/cspell-pipe/test-cspell-pipe/tsconfig.json +++ b/test-packages/cspell-pipe/test-cspell-pipe/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-service-bus/test-cspell-service-bus-esm/package.json b/test-packages/cspell-service-bus/test-cspell-service-bus-esm/package.json index 2635d936159..d80720a750c 100644 --- a/test-packages/cspell-service-bus/test-cspell-service-bus-esm/package.json +++ b/test-packages/cspell-service-bus/test-cspell-service-bus-esm/package.json @@ -8,7 +8,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "pnpm test:unit && pnpm test:smoke", diff --git a/test-packages/cspell-service-bus/test-cspell-service-bus-esm/tsconfig.dev.json b/test-packages/cspell-service-bus/test-cspell-service-bus-esm/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-service-bus/test-cspell-service-bus-esm/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-service-bus/test-cspell-service-bus-esm/tsconfig.json b/test-packages/cspell-service-bus/test-cspell-service-bus-esm/tsconfig.json index 4687a28b5d3..ea31d526568 100644 --- a/test-packages/cspell-service-bus/test-cspell-service-bus-esm/tsconfig.json +++ b/test-packages/cspell-service-bus/test-cspell-service-bus-esm/tsconfig.json @@ -4,7 +4,5 @@ "moduleResolution": "Node16", "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-service-bus/test-cspell-service-bus-rollup/package.json b/test-packages/cspell-service-bus/test-cspell-service-bus-rollup/package.json index 6ddd87f7964..e2717aef3f7 100644 --- a/test-packages/cspell-service-bus/test-cspell-service-bus-rollup/package.json +++ b/test-packages/cspell-service-bus/test-cspell-service-bus-rollup/package.json @@ -14,7 +14,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "rollup -c rollup.config.mjs", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "pnpm test:unit && pnpm test:smoke", diff --git a/test-packages/cspell-service-bus/test-cspell-service-bus-rollup/tsconfig.dev.json b/test-packages/cspell-service-bus/test-cspell-service-bus-rollup/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-service-bus/test-cspell-service-bus-rollup/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-service-bus/test-cspell-service-bus-rollup/tsconfig.json b/test-packages/cspell-service-bus/test-cspell-service-bus-rollup/tsconfig.json index a9d9e8969a6..c1be12d6b38 100644 --- a/test-packages/cspell-service-bus/test-cspell-service-bus-rollup/tsconfig.json +++ b/test-packages/cspell-service-bus/test-cspell-service-bus-rollup/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-service-bus/test-cspell-service-bus/package.json b/test-packages/cspell-service-bus/test-cspell-service-bus/package.json index 575031422a8..9155a1f1294 100644 --- a/test-packages/cspell-service-bus/test-cspell-service-bus/package.json +++ b/test-packages/cspell-service-bus/test-cspell-service-bus/package.json @@ -8,7 +8,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "pnpm test:unit && pnpm test:smoke", diff --git a/test-packages/cspell-service-bus/test-cspell-service-bus/tsconfig.dev.json b/test-packages/cspell-service-bus/test-cspell-service-bus/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-service-bus/test-cspell-service-bus/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-service-bus/test-cspell-service-bus/tsconfig.json b/test-packages/cspell-service-bus/test-cspell-service-bus/tsconfig.json index ea66af6b8f4..cdf04e74d88 100644 --- a/test-packages/cspell-service-bus/test-cspell-service-bus/tsconfig.json +++ b/test-packages/cspell-service-bus/test-cspell-service-bus/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-strong-weak-map/test-cspell-strong-weak-map/tsconfig.cjs.json b/test-packages/cspell-strong-weak-map/test-cspell-strong-weak-map/tsconfig.cjs.json index 919a5126326..c4a699e4ed7 100644 --- a/test-packages/cspell-strong-weak-map/test-cspell-strong-weak-map/tsconfig.cjs.json +++ b/test-packages/cspell-strong-weak-map/test-cspell-strong-weak-map/tsconfig.cjs.json @@ -2,14 +2,12 @@ "extends": "../../../tsconfig.cjs.json", "compilerOptions": { "composite": true, - "tsBuildInfoFile":"dist/compile.cjs.tsbuildInfo", + "tsBuildInfoFile": "dist/compile.cjs.tsbuildInfo", "module": "CommonJS", "moduleResolution": "node16", "rootDir": "src", "outDir": "dist/cjs", "types": ["node"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-strong-weak-map/test-cspell-strong-weak-map/tsconfig.esm.json b/test-packages/cspell-strong-weak-map/test-cspell-strong-weak-map/tsconfig.esm.json index d864e03bb7e..d1832ac1e38 100644 --- a/test-packages/cspell-strong-weak-map/test-cspell-strong-weak-map/tsconfig.esm.json +++ b/test-packages/cspell-strong-weak-map/test-cspell-strong-weak-map/tsconfig.esm.json @@ -2,7 +2,7 @@ "extends": "../../../tsconfig.esm.json", "compilerOptions": { "composite": true, - "tsBuildInfoFile":"dist/compile.esm.tsbuildInfo", + "tsBuildInfoFile": "dist/compile.esm.tsbuildInfo", "module": "ES2020", "moduleResolution": "node16", "rootDir": "src", @@ -10,7 +10,5 @@ "sourceMap": false, "types": ["node"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-strong-weak-map/test-cspell-strong-weak-map/tsconfig.json b/test-packages/cspell-strong-weak-map/test-cspell-strong-weak-map/tsconfig.json index 2df329ce6f4..e9c5539d270 100644 --- a/test-packages/cspell-strong-weak-map/test-cspell-strong-weak-map/tsconfig.json +++ b/test-packages/cspell-strong-weak-map/test-cspell-strong-weak-map/tsconfig.json @@ -1,4 +1,4 @@ { "files": [], - "references": [ { "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] + "references": [{ "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] } diff --git a/test-packages/cspell-tools/test-cspell-tools/package.json b/test-packages/cspell-tools/test-cspell-tools/package.json index 5b6ecca7d16..b2fbb55b694 100644 --- a/test-packages/cspell-tools/test-cspell-tools/package.json +++ b/test-packages/cspell-tools/test-cspell-tools/package.json @@ -10,7 +10,6 @@ "clean-build": "pnpm run clean && pnpm run build", "build-dictionaries": "cspell-tools-cli compile --no-compress -o dict src/php.txt src/companies.txt src/node.txt", "compile": "tsc -p .", - "compile-dev": "tsc -p tsconfig.dev.json", "test-dist": "node dist", "test-cspell": "cspell -c cspell.json \"src/*\"", "test": "pnpm run test-dist && pnpm run test-cspell" diff --git a/test-packages/cspell-tools/test-cspell-tools/tsconfig.dev.json b/test-packages/cspell-tools/test-cspell-tools/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-tools/test-cspell-tools/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-trie-lib/test-cspell-trie-lib/tsconfig.cjs.json b/test-packages/cspell-trie-lib/test-cspell-trie-lib/tsconfig.cjs.json index 919a5126326..c4a699e4ed7 100644 --- a/test-packages/cspell-trie-lib/test-cspell-trie-lib/tsconfig.cjs.json +++ b/test-packages/cspell-trie-lib/test-cspell-trie-lib/tsconfig.cjs.json @@ -2,14 +2,12 @@ "extends": "../../../tsconfig.cjs.json", "compilerOptions": { "composite": true, - "tsBuildInfoFile":"dist/compile.cjs.tsbuildInfo", + "tsBuildInfoFile": "dist/compile.cjs.tsbuildInfo", "module": "CommonJS", "moduleResolution": "node16", "rootDir": "src", "outDir": "dist/cjs", "types": ["node"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-trie-lib/test-cspell-trie-lib/tsconfig.esm.json b/test-packages/cspell-trie-lib/test-cspell-trie-lib/tsconfig.esm.json index d864e03bb7e..d1832ac1e38 100644 --- a/test-packages/cspell-trie-lib/test-cspell-trie-lib/tsconfig.esm.json +++ b/test-packages/cspell-trie-lib/test-cspell-trie-lib/tsconfig.esm.json @@ -2,7 +2,7 @@ "extends": "../../../tsconfig.esm.json", "compilerOptions": { "composite": true, - "tsBuildInfoFile":"dist/compile.esm.tsbuildInfo", + "tsBuildInfoFile": "dist/compile.esm.tsbuildInfo", "module": "ES2020", "moduleResolution": "node16", "rootDir": "src", @@ -10,7 +10,5 @@ "sourceMap": false, "types": ["node"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-trie-lib/test-cspell-trie-lib/tsconfig.json b/test-packages/cspell-trie-lib/test-cspell-trie-lib/tsconfig.json index 2df329ce6f4..e9c5539d270 100644 --- a/test-packages/cspell-trie-lib/test-cspell-trie-lib/tsconfig.json +++ b/test-packages/cspell-trie-lib/test-cspell-trie-lib/tsconfig.json @@ -1,4 +1,4 @@ { "files": [], - "references": [ { "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] + "references": [{ "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }] } diff --git a/test-packages/cspell-types/test-cspell-types-cjs/package.json b/test-packages/cspell-types/test-cspell-types-cjs/package.json index 1dd3b87b1d8..2b3ac344ecd 100644 --- a/test-packages/cspell-types/test-cspell-types-cjs/package.json +++ b/test-packages/cspell-types/test-cspell-types-cjs/package.json @@ -8,7 +8,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "pnpm test:unit && pnpm test:smoke", diff --git a/test-packages/cspell-types/test-cspell-types-cjs/tsconfig.dev.json b/test-packages/cspell-types/test-cspell-types-cjs/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-types/test-cspell-types-cjs/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-types/test-cspell-types-cjs/tsconfig.json b/test-packages/cspell-types/test-cspell-types-cjs/tsconfig.json index 1b344ea06e8..b101c3a180e 100644 --- a/test-packages/cspell-types/test-cspell-types-cjs/tsconfig.json +++ b/test-packages/cspell-types/test-cspell-types-cjs/tsconfig.json @@ -5,7 +5,5 @@ "moduleResolution": "node16", "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-types/test-cspell-types-esm/package.json b/test-packages/cspell-types/test-cspell-types-esm/package.json index e04301eceb0..4bd1395f476 100644 --- a/test-packages/cspell-types/test-cspell-types-esm/package.json +++ b/test-packages/cspell-types/test-cspell-types-esm/package.json @@ -8,7 +8,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "pnpm test:unit && pnpm test:smoke", diff --git a/test-packages/cspell-types/test-cspell-types-esm/tsconfig.dev.json b/test-packages/cspell-types/test-cspell-types-esm/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-types/test-cspell-types-esm/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-types/test-cspell-types-esm/tsconfig.json b/test-packages/cspell-types/test-cspell-types-esm/tsconfig.json index feef75cc854..31fa720388d 100644 --- a/test-packages/cspell-types/test-cspell-types-esm/tsconfig.json +++ b/test-packages/cspell-types/test-cspell-types-esm/tsconfig.json @@ -6,7 +6,5 @@ "skipLibCheck": true, "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell-types/test-cspell-types-rollup/tsconfig.dev.json b/test-packages/cspell-types/test-cspell-types-rollup/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell-types/test-cspell-types-rollup/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell-types/test-cspell-types-rollup/tsconfig.json b/test-packages/cspell-types/test-cspell-types-rollup/tsconfig.json index a9d9e8969a6..c1be12d6b38 100644 --- a/test-packages/cspell-types/test-cspell-types-rollup/tsconfig.json +++ b/test-packages/cspell-types/test-cspell-types-rollup/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/cspell/test-cspell-cli/tsconfig.dev.json b/test-packages/cspell/test-cspell-cli/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell/test-cspell-cli/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell/test-cspell/package.json b/test-packages/cspell/test-cspell/package.json index 87679efa728..473ea262230 100644 --- a/test-packages/cspell/test-cspell/package.json +++ b/test-packages/cspell/test-cspell/package.json @@ -6,7 +6,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "node dist" diff --git a/test-packages/cspell/test-cspell/tsconfig.dev.json b/test-packages/cspell/test-cspell/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/cspell/test-cspell/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/cspell/test-cspell/tsconfig.json b/test-packages/cspell/test-cspell/tsconfig.json index ea66af6b8f4..cdf04e74d88 100644 --- a/test-packages/cspell/test-cspell/tsconfig.json +++ b/test-packages/cspell/test-cspell/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/dynamic-import/test-dynamic-import-cjs/package.json b/test-packages/dynamic-import/test-dynamic-import-cjs/package.json index 40c9b7b0695..11e22ab9027 100644 --- a/test-packages/dynamic-import/test-dynamic-import-cjs/package.json +++ b/test-packages/dynamic-import/test-dynamic-import-cjs/package.json @@ -8,7 +8,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "pnpm test:unit && pnpm test:smoke", diff --git a/test-packages/dynamic-import/test-dynamic-import-cjs/tsconfig.dev.json b/test-packages/dynamic-import/test-dynamic-import-cjs/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/dynamic-import/test-dynamic-import-cjs/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/dynamic-import/test-dynamic-import-cjs/tsconfig.json b/test-packages/dynamic-import/test-dynamic-import-cjs/tsconfig.json index 6e2ad6f3287..82d79f5c88e 100644 --- a/test-packages/dynamic-import/test-dynamic-import-cjs/tsconfig.json +++ b/test-packages/dynamic-import/test-dynamic-import-cjs/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/dynamic-import/test-dynamic-import-esm/package.json b/test-packages/dynamic-import/test-dynamic-import-esm/package.json index 7131c1d4a29..98a9011fc98 100644 --- a/test-packages/dynamic-import/test-dynamic-import-esm/package.json +++ b/test-packages/dynamic-import/test-dynamic-import-esm/package.json @@ -8,7 +8,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "pnpm test:unit && pnpm test:smoke", diff --git a/test-packages/dynamic-import/test-dynamic-import-esm/tsconfig.dev.json b/test-packages/dynamic-import/test-dynamic-import-esm/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/dynamic-import/test-dynamic-import-esm/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/dynamic-import/test-dynamic-import-esm/tsconfig.json b/test-packages/dynamic-import/test-dynamic-import-esm/tsconfig.json index a9d9e8969a6..c1be12d6b38 100644 --- a/test-packages/dynamic-import/test-dynamic-import-esm/tsconfig.json +++ b/test-packages/dynamic-import/test-dynamic-import-esm/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/dynamic-import/test-dynamic-import-rollup/package.json b/test-packages/dynamic-import/test-dynamic-import-rollup/package.json index 708e3b2ab61..4dcaf333264 100644 --- a/test-packages/dynamic-import/test-dynamic-import-rollup/package.json +++ b/test-packages/dynamic-import/test-dynamic-import-rollup/package.json @@ -14,7 +14,6 @@ "scripts": { "clean": "shx rm -rf dist .tsbuildinfo", "build": "rollup -c rollup.config.mjs", - "build-dev": "tsc -p tsconfig.dev.json", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "pnpm test:unit && pnpm test:smoke", diff --git a/test-packages/dynamic-import/test-dynamic-import-rollup/tsconfig.dev.json b/test-packages/dynamic-import/test-dynamic-import-rollup/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/dynamic-import/test-dynamic-import-rollup/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/dynamic-import/test-dynamic-import-rollup/tsconfig.json b/test-packages/dynamic-import/test-dynamic-import-rollup/tsconfig.json index a9d9e8969a6..c1be12d6b38 100644 --- a/test-packages/dynamic-import/test-dynamic-import-rollup/tsconfig.json +++ b/test-packages/dynamic-import/test-dynamic-import-rollup/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/test-packages/examples/example-cspell-lib-single-doc/package.json b/test-packages/examples/example-cspell-lib-single-doc/package.json index 0de1c028201..36603e205b6 100644 --- a/test-packages/examples/example-cspell-lib-single-doc/package.json +++ b/test-packages/examples/example-cspell-lib-single-doc/package.json @@ -5,10 +5,9 @@ "private": true, "bin": "bin.js", "scripts": { - "clean": "shx rm -rf dist .tsbuildinfo", + "clean": "shx rm -rf dist", "build": "pnpm run compile", - "build-dev": "tsc -p tsconfig.dev.json", - "watch": "tsc -p tsconfig.dev.json --watch", + "watch": "tsc -p --watch", "clean-build": "pnpm run clean && pnpm run build", "compile": "tsc -p .", "test": "node bin src/index.ts" diff --git a/test-packages/examples/example-cspell-lib-single-doc/tsconfig.dev.json b/test-packages/examples/example-cspell-lib-single-doc/tsconfig.dev.json deleted file mode 100644 index 9bc0084662d..00000000000 --- a/test-packages/examples/example-cspell-lib-single-doc/tsconfig.dev.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo" - } -} diff --git a/test-packages/examples/example-cspell-lib-single-doc/tsconfig.json b/test-packages/examples/example-cspell-lib-single-doc/tsconfig.json index ea66af6b8f4..cdf04e74d88 100644 --- a/test-packages/examples/example-cspell-lib-single-doc/tsconfig.json +++ b/test-packages/examples/example-cspell-lib-single-doc/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "dist" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/tsconfig.esm.json b/tsconfig.esm.json index a442a09aab3..471f771e541 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -6,7 +6,5 @@ "module": "ES2020", "moduleResolution": "node16" }, - "include": [ - "src" - ] + "include": ["src"] }