From 45fc808275bf5173f354ff8938728169c7a2fb7c Mon Sep 17 00:00:00 2001 From: AlCalzone Date: Fri, 5 Jul 2024 13:48:44 +0200 Subject: [PATCH] chore: set up root tsconfig as "solution", avoid compilation for lints and tests (#6748) --- .github/workflows/test-and-release.yml | 47 +---------------- .vscode/launch.json | 52 ++++++------------- ava.config.cjs | 3 ++ docs/api/CCs/Meter.md | 24 +++++++-- docs/api/driver.md | 1 + package.json | 8 +-- packages/cc/package.json | 9 ++-- packages/cc/tsconfig.build.json | 4 +- packages/cc/tsconfig.json | 25 +-------- packages/config/package.json | 7 +-- packages/config/tsconfig.build.json | 4 +- packages/config/tsconfig.json | 13 +---- packages/core/package.json | 6 ++- packages/core/tsconfig.build.json | 4 +- packages/core/tsconfig.json | 7 +-- packages/eslint-plugin/package.json | 2 + packages/eslint-plugin/tsconfig.build.json | 4 +- packages/eslint-plugin/tsconfig.json | 7 +-- packages/flash/package.json | 1 + packages/flash/tsconfig.build.json | 4 +- packages/flash/tsconfig.json | 11 +--- packages/host/package.json | 5 +- packages/host/tsconfig.build.json | 4 +- packages/host/tsconfig.json | 13 +---- packages/maintenance/package.json | 2 +- packages/maintenance/src/generateTypedDocs.ts | 2 +- packages/maintenance/src/tsAPITools.ts | 5 +- packages/maintenance/tsconfig.build.json | 4 +- packages/maintenance/tsconfig.json | 10 +--- packages/nvmedit/package.json | 5 +- packages/nvmedit/tsconfig.build.json | 4 +- packages/nvmedit/tsconfig.json | 10 +--- packages/serial/package.json | 6 ++- packages/serial/tsconfig.build.json | 4 +- packages/serial/tsconfig.json | 13 +---- packages/shared/package.json | 5 +- packages/shared/tsconfig.build.json | 4 +- packages/shared/tsconfig.json | 3 +- packages/testing/package.json | 11 +++- packages/testing/tsconfig.build.json | 4 +- packages/testing/tsconfig.json | 16 +----- packages/transformers/package.json | 1 + packages/transformers/src/index.ts | 1 + packages/transformers/tsconfig.build.json | 4 +- packages/transformers/tsconfig.json | 3 +- packages/zwave-js/package.json | 15 ++++-- packages/zwave-js/tsconfig.build.json | 4 +- packages/zwave-js/tsconfig.json | 34 +----------- test/{debug.js => decodeMessage.ts} | 23 ++++---- test/run.ts | 1 - test/tsconfig.json | 4 ++ tsconfig.base.json | 26 ++++++++++ tsconfig.docs.json | 8 +++ tsconfig.eslint.json | 3 +- tsconfig.json | 41 ++++++--------- turbo.json | 14 +++-- yarn.lock | 1 + 57 files changed, 236 insertions(+), 320 deletions(-) rename test/{debug.js => decodeMessage.ts} (88%) create mode 100644 test/tsconfig.json create mode 100644 tsconfig.base.json create mode 100644 tsconfig.docs.json diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index 5df2b688f6d3..4f9e43af1f03 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -47,9 +47,7 @@ jobs: githubToken: ${{ secrets.GITHUB_TOKEN }} - name: Compile TypeScript code - run: | - # yarn clean $TURBO_FLAGS - yarn build $TURBO_FLAGS + run: yarn build $TURBO_FLAGS - name: Save Turbo Cache between jobs uses: ./.github/actions/build-cache-upload @@ -118,8 +116,6 @@ jobs: # =================== lint: - needs: [build] - runs-on: ubuntu-latest strategy: matrix: @@ -129,20 +125,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Restore Turbo Cache from previous jobs - uses: ./.github/actions/build-cache-download - - name: Prepare testing environment uses: ./.github/actions/prepare-env with: node-version: ${{ matrix.node-version }} githubToken: ${{ secrets.GITHUB_TOKEN }} - # For linting to succeed, we need to build the eslint plugin first. - # Thanks to caching from the previous job, this should be almost a no-op - - name: Compile TypeScript code - run: yarn build $TURBO_FLAGS - - name: Run linters run: yarn run lint $TURBO_FLAGS @@ -179,8 +167,6 @@ jobs: # =================== lint-zwave: - needs: [build] - runs-on: ubuntu-latest strategy: matrix: @@ -190,9 +176,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Restore Turbo Cache from previous jobs - uses: ./.github/actions/build-cache-download - - name: Prepare testing environment uses: ./.github/actions/prepare-env with: @@ -205,8 +188,6 @@ jobs: # =================== # Runs unit tests on all supported node versions and OSes unit-tests: - needs: [build] - runs-on: ${{ matrix.os }} strategy: matrix: @@ -217,20 +198,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Restore Turbo Cache from previous jobs - uses: ./.github/actions/build-cache-download - - name: Prepare testing environment uses: ./.github/actions/prepare-env with: node-version: ${{ matrix.node-version }} githubToken: ${{ secrets.GITHUB_TOKEN }} - # For the partial tests to succeed, we need to build the packages first. - # Thanks to caching from the previous job, this should be almost a no-op - - name: Compile TypeScript code - run: yarn build $TURBO_FLAGS - # For pull requests, only run tests for changed files - name: Run component tests (changes) if: github.event_name == 'pull_request' @@ -300,8 +273,6 @@ jobs: github.ref == 'refs/heads/master' && github.event_name == 'push' - needs: [build] - runs-on: ubuntu-latest strategy: @@ -312,18 +283,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Restore Turbo Cache from previous jobs - uses: ./.github/actions/build-cache-download - - name: Prepare testing environment uses: ./.github/actions/prepare-env with: node-version: ${{ matrix.node-version }} githubToken: ${{ secrets.GITHUB_TOKEN }} - - name: Compile TypeScript code - run: yarn build $TURBO_FLAGS - - name: Update CC table # (maybe) uses: actions/github-script@v7 with: @@ -343,8 +308,6 @@ jobs: github.ref == 'refs/heads/master' && github.event_name == 'push' - needs: [build] - runs-on: ubuntu-latest strategy: @@ -355,18 +318,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Restore Turbo Cache from previous jobs - uses: ./.github/actions/build-cache-download - - name: Prepare testing environment uses: ./.github/actions/prepare-env with: node-version: ${{ matrix.node-version }} githubToken: ${{ secrets.GITHUB_TOKEN }} - - name: Compile TypeScript code - run: yarn build $TURBO_FLAGS - - name: Update overview uses: actions/github-script@v7 with: @@ -386,7 +343,7 @@ jobs: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - needs: [lint, lint-zwave, unit-tests, test-packages] + needs: [build, lint, lint-zwave, unit-tests, test-packages] runs-on: ubuntu-latest strategy: diff --git a/.vscode/launch.json b/.vscode/launch.json index 48081c376744..765a6c261416 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -27,13 +27,13 @@ "type": "node", "request": "launch", "name": "Debug locally", - "port": 9229, "runtimeExecutable": "yarn", "runtimeArgs": [ "node", "--async-stack-traces", "-r", "./maintenance/esbuild-register.js", + "--conditions=@@dev", "${workspaceFolder}/test/run.ts" ], "env": { @@ -43,35 +43,32 @@ }, "console": "integratedTerminal", "skipFiles": ["/**"], - "sourceMaps": true, - "preLaunchTask": "npm: build" + "sourceMaps": true + // "preLaunchTask": "npm: build" }, { "type": "node", "request": "launch", - "name": "Test network mock", - "port": 9229, + "name": "Generate typed docs", "runtimeExecutable": "yarn", "runtimeArgs": [ "node", "--async-stack-traces", + "--inspect-brk=9229", "-r", "./maintenance/esbuild-register.js", - "${workspaceFolder}/test/mock.ts" + "${workspaceFolder}/packages/maintenance/src/generateTypedDocs.ts" ], - "env": { - "NO_CACHE": "true" - }, "console": "integratedTerminal", "skipFiles": ["/**"], "sourceMaps": true, + // This needs the compiled sources (I think) "preLaunchTask": "npm: build" }, { "type": "node", "request": "launch", - "name": "Generate typed docs", - "port": 9229, + "name": "Decode message", "runtimeExecutable": "yarn", "runtimeArgs": [ "node", @@ -79,28 +76,13 @@ "--inspect-brk=9229", "-r", "./maintenance/esbuild-register.js", - "${workspaceFolder}/packages/maintenance/src/generateTypedDocs.ts" + "--conditions=@@dev", + "${workspaceFolder}/test/decodeMessage.ts" ], "console": "integratedTerminal", "skipFiles": ["/**"], "sourceMaps": true - }, - { - "type": "node", - "request": "launch", - "name": "Decode message", - "port": 9229, - "runtimeExecutable": "yarn", - "runtimeArgs": [ - "node", - "--async-stack-traces", - "--inspect-brk=9229", - "${workspaceFolder}/test/debug.js" - ], - "console": "integratedTerminal", - "skipFiles": ["/**"], - "sourceMaps": true, - "preLaunchTask": "npm: build" + // "preLaunchTask": "npm: build" }, { "type": "node", @@ -114,34 +96,32 @@ "--inspect=9229", "-r", "./maintenance/esbuild-register.js", + "--conditions=@@dev", "${workspaceFolder}/packages/config/maintenance/importConfig.ts", "-dm -s zwa" ], - "console": "integratedTerminal", - "disableOptimisticBPs": true + "console": "integratedTerminal" }, { "type": "node", "request": "launch", "name": "Run Zniffer", - "port": 9229, "runtimeExecutable": "yarn", "runtimeArgs": [ "node", "--async-stack-traces", "-r", "./maintenance/esbuild-register.js", + "--conditions=@@dev", "${workspaceFolder}/test/run_zniffer.ts" ], "env": { "NODE_ENV": "development" - // "NO_CACHE": "true" - // "LOGLEVEL": "info" }, "console": "integratedTerminal", "skipFiles": ["/**"], - "sourceMaps": true, - "preLaunchTask": "npm: build" + "sourceMaps": true + // "preLaunchTask": "npm: build" } ] } diff --git a/ava.config.cjs b/ava.config.cjs index 0727d0477341..af9cdd9cae43 100644 --- a/ava.config.cjs +++ b/ava.config.cjs @@ -3,4 +3,7 @@ module.exports = { extensions: ["ts"], files: ["test/**", "**/*.test.ts", "!build/**"], require: [path.join(__dirname, "./maintenance/esbuild-register.js")], + nodeArguments: [ + "--conditions=@@dev", + ], }; diff --git a/docs/api/CCs/Meter.md b/docs/api/CCs/Meter.md index 3609f3bfa67d..eeb70caf0433 100644 --- a/docs/api/CCs/Meter.md +++ b/docs/api/CCs/Meter.md @@ -7,13 +7,21 @@ ### `get` ```ts -async get(options?: MeterCCGetOptions): Promise<{ rateType: RateType; value: number; previousValue: MaybeNotKnown; deltaTime: MaybeUnknown; type: number; scale: MeterScale; } | undefined>; +async get(options?: MeterCCGetOptions): Promise<{ rateType: RateType; value: number; previousValue: MaybeNotKnown; deltaTime: MaybeUnknown; type: number; scale: import("/home/dominic/Repositories/node-zwave-js/packages/core/build/index").MeterScale; } | undefined>; +``` + +### `sendReport` + +```ts +async sendReport( + options: MeterCCReportOptions, +): Promise; ``` ### `getAll` ```ts -async getAll(): Promise<{ rateType: RateType; value: number; previousValue: MaybeNotKnown; deltaTime: MaybeUnknown; type: number; scale: MeterScale; }[]>; +async getAll(accumulatedOnly: boolean = false): Promise<{ rateType: RateType; value: number; previousValue: MaybeNotKnown; deltaTime: MaybeUnknown; type: number; scale: import("/home/dominic/Repositories/node-zwave-js/packages/core/build/index").MeterScale; }[]>; ``` ### `getSupported` @@ -22,6 +30,14 @@ async getAll(): Promise<{ rateType: RateType; value: number; previousValue: Mayb async getSupported(): Promise | undefined>; ``` +### `sendSupportedReport` + +```ts +async sendSupportedReport( + options: MeterCCSupportedReportOptions, +): Promise; +``` + ### `reset` ```ts @@ -50,7 +66,7 @@ async reset( - **secret:** false - **value type:** `"boolean"` -### `resetSingle(meterType: number)` +### `resetSingle(meterType: number, rateType: RateType, scale: number)` ```ts { @@ -61,7 +77,7 @@ async reset( } ``` -- **label:** `Reset (${string})` +- **label:** `Reset (${string})` | `Reset (Consumption, ${string})` | `Reset (Production, ${string})` - **min. CC version:** 1 - **readable:** false - **writeable:** true diff --git a/docs/api/driver.md b/docs/api/driver.md index ae4ccb3af389..fe0e010cbbb7 100644 --- a/docs/api/driver.md +++ b/docs/api/driver.md @@ -907,6 +907,7 @@ interface ZWaveOptions extends ZWaveHostOptions { */ watchdog?: boolean; }; + preferences: { /** * The preferred scales to use when querying sensors. The key is either: diff --git a/package.json b/package.json index 264a6214c612..e57ce080cbc0 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "colors": "1.4.0" }, "scripts": { - "ts": "node -r source-map-support/register -r ./maintenance/esbuild-register.js", + "ts": "node -r source-map-support/register -r ./maintenance/esbuild-register.js --conditions=@@dev", "w": "yarn ts maintenance/watch.ts", "foreach": "yarn workspaces foreach -pvi --exclude @zwave-js/repo", "clean": "yarn turbo run clean", @@ -122,7 +122,7 @@ "commit": "git-cz", "release": "release-script", "release:all": "release-script --publish-all", - "postinstall": "ts-patch install -s && yarn node maintenance/patch-tsserver.js", + "postinstall": "ts-patch install -s && yarn node maintenance/patch-tsserver.js && yarn turbo run bootstrap", "prepare": "husky && ts-patch install -s", "config": "yarn ts packages/config/maintenance/importConfig.ts", "docs": "docsify serve docs", @@ -137,8 +137,8 @@ "extract-api": "FORCE_COLOR=1 yarn turbo run extract-api", "accept-api": "yarn extract-api -- --local", "monopack": "yarn exec monopack", - "check-references": "workspaces-to-typescript-project-references --check && workspaces-to-typescript-project-references --check --tsconfigPath tsconfig.build.json", - "sync-references": "workspaces-to-typescript-project-references && workspaces-to-typescript-project-references --tsconfigPath tsconfig.build.json && yarn fmt > /dev/null" + "check-references": "workspaces-to-typescript-project-references --check --tsconfigPath tsconfig.build.json", + "sync-references": "workspaces-to-typescript-project-references --tsconfigPath tsconfig.build.json && yarn fmt > /dev/null" }, "readme": "README.md", "config": { diff --git a/packages/cc/package.json b/packages/cc/package.json index 0942f38852a1..00b61cc6cd93 100644 --- a/packages/cc/package.json +++ b/packages/cc/package.json @@ -6,23 +6,26 @@ "publishConfig": { "access": "public" }, - "main": "build/index.js", - "types": "build/index.d.ts", + "type": "commonjs", "exports": { ".": { + "@@dev": "./src/index.ts", "types": "./build/index.d.ts", "default": "./build/index.js" }, "./safe": { + "@@dev": "./src/index_safe.ts", "types": "./build/index_safe.d.ts", "default": "./build/index_safe.js" }, "./cc": { + "@@dev": "./src/cc/index.ts", "types": "./build/cc/index.d.ts", "default": "./build/cc/index.js" }, "./package.json": "./package.json", "./*": { + "@@dev": "./src/cc/*.ts", "types": "./build/cc/*.d.ts", "default": "./build/cc/*.js" } @@ -55,7 +58,7 @@ "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", "extract-api": "yarn api-extractor run", - "ts": "node -r esbuild-register", + "ts": "node -r esbuild-register --conditions=@@dev", "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix", "test:ts": "ava", diff --git a/packages/cc/tsconfig.build.json b/packages/cc/tsconfig.build.json index 4d698f2f82c8..b438c45d7e9b 100644 --- a/packages/cc/tsconfig.build.json +++ b/packages/cc/tsconfig.build.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build" + "outDir": "build", + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [ { diff --git a/packages/cc/tsconfig.json b/packages/cc/tsconfig.json index 44e8e8bf5e8d..f79366a401b6 100644 --- a/packages/cc/tsconfig.json +++ b/packages/cc/tsconfig.json @@ -1,6 +1,6 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "plugins": [ { @@ -8,29 +8,6 @@ } ] }, - "references": [ - { - "path": "../core" - }, - { - "path": "../host" - }, - { - "path": "../serial" - }, - { - "path": "../shared" - }, - { - "path": "../maintenance" - }, - { - "path": "../testing" - }, - { - "path": "../transformers" - } - ], "include": ["maintenance/**/*.ts", "src/**/*.ts"], "exclude": ["build/**", "node_modules/**"] } diff --git a/packages/config/package.json b/packages/config/package.json index 6dc091113707..81036cea9613 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -5,14 +5,15 @@ "publishConfig": { "access": "public" }, - "main": "build/index.js", - "types": "build/index.d.ts", + "type": "commonjs", "exports": { ".": { + "@@dev": "./src/index.ts", "types": "./build/index.d.ts", "default": "./build/index.js" }, "./safe": { + "@@dev": "./src/index_safe.ts", "types": "./build/index_safe.d.ts", "default": "./build/index_safe.js" }, @@ -48,7 +49,7 @@ "clean": "del-cli build/ \"*.tsbuildinfo\"", "extract-api": "yarn api-extractor run", "lint:zwave": "yarn ts maintenance/lintConfigFiles.ts && eslint --cache --cache-location .eslintcache/config --ext .json \"config/devices/**/*.json\"", - "ts": "node -r esbuild-register", + "ts": "node -r esbuild-register --conditions=@@dev", "lint:ts": "eslint --cache --cache-location .eslintcache/ts --ext .ts \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix", "test:ts": "ava", diff --git a/packages/config/tsconfig.build.json b/packages/config/tsconfig.build.json index 90eff4956d8e..4bc6c0f40de6 100644 --- a/packages/config/tsconfig.build.json +++ b/packages/config/tsconfig.build.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build" + "outDir": "build", + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [ { diff --git a/packages/config/tsconfig.json b/packages/config/tsconfig.json index 8ae8d366ce1b..b169baaf1788 100644 --- a/packages/config/tsconfig.json +++ b/packages/config/tsconfig.json @@ -1,18 +1,7 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": {}, - "references": [ - { - "path": "../core" - }, - { - "path": "../shared" - }, - { - "path": "../maintenance" - } - ], "include": ["maintenance/**/*.ts", "src/**/*.ts"], "exclude": ["build/**", "node_modules/**"] } diff --git a/packages/core/package.json b/packages/core/package.json index 430903dfae84..c405c076f118 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -6,18 +6,20 @@ "publishConfig": { "access": "public" }, - "main": "build/index.js", - "types": "build/index.d.ts", + "type": "commonjs", "exports": { ".": { + "@@dev": "./src/index.ts", "types": "./build/index.d.ts", "default": "./build/index.js" }, "./safe": { + "@@dev": "./src/index_safe.ts", "types": "./build/index_safe.d.ts", "default": "./build/index_safe.js" }, "./test": { + "@@dev": "./src/index_test.ts", "types": "./build/index_test.d.ts", "default": "./build/index_test.js" }, diff --git a/packages/core/tsconfig.build.json b/packages/core/tsconfig.build.json index a5b5b690ddee..7a15e1866cd6 100644 --- a/packages/core/tsconfig.build.json +++ b/packages/core/tsconfig.build.json @@ -5,7 +5,9 @@ "rootDir": "src", "outDir": "build", // Some @internal members need to be accessed from other modules in this monorepo - "stripInternal": false + "stripInternal": false, + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [ { diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 87a067b0d8fd..3d1e2856a002 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,12 +1,7 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": {}, - "references": [ - { - "path": "../shared" - } - ], "include": ["src/**/*.ts"], "exclude": ["build/**", "node_modules/**"] } diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 01b5425741bb..6fbd1e0dd7bd 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -29,6 +29,7 @@ }, "scripts": { "build": "tsc -b tsconfig.build.json --pretty", + "bootstrap": "yarn build", "clean": "del-cli build/ \"*.tsbuildinfo\"", "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix" @@ -37,6 +38,7 @@ "@types/eslint": "^8.56.7", "@typescript-eslint/utils": "^7.5.0", "@zwave-js/core": "workspace:*", + "eslint": "^8.57.0", "typescript": "5.4.4" } } diff --git a/packages/eslint-plugin/tsconfig.build.json b/packages/eslint-plugin/tsconfig.build.json index e54d3c136fac..1524267bb3f3 100644 --- a/packages/eslint-plugin/tsconfig.build.json +++ b/packages/eslint-plugin/tsconfig.build.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build" + "outDir": "build", + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [ { diff --git a/packages/eslint-plugin/tsconfig.json b/packages/eslint-plugin/tsconfig.json index 009cf5cd263f..e9081d133026 100644 --- a/packages/eslint-plugin/tsconfig.json +++ b/packages/eslint-plugin/tsconfig.json @@ -1,14 +1,9 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "types": ["node", "@typescript-eslint/utils"] }, - "references": [ - { - "path": "../core" - } - ], "include": [ "src/**/*.ts" ], diff --git a/packages/flash/package.json b/packages/flash/package.json index e58432e06ebd..e674e74a794d 100644 --- a/packages/flash/package.json +++ b/packages/flash/package.json @@ -7,6 +7,7 @@ "access": "public" }, "main": "build/cli.js", + "type": "commonjs", "files": [ "bin/", "build/**/*.{js,d.ts,map}" diff --git a/packages/flash/tsconfig.build.json b/packages/flash/tsconfig.build.json index 488e4f43b9db..ccea14ed3a05 100644 --- a/packages/flash/tsconfig.build.json +++ b/packages/flash/tsconfig.build.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build" + "outDir": "build", + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [ { diff --git a/packages/flash/tsconfig.json b/packages/flash/tsconfig.json index faa154a196e1..1c030019be5e 100644 --- a/packages/flash/tsconfig.json +++ b/packages/flash/tsconfig.json @@ -1,15 +1,6 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", - "compilerOptions": {}, - "references": [ - { - "path": "../core" - }, - { - "path": "../zwave-js" - } - ], + "extends": "../../tsconfig.base.json", "include": ["src/**/*.ts"], "exclude": ["build/**", "node_modules/**"] } diff --git a/packages/host/package.json b/packages/host/package.json index bc46c2a731db..8930e18438e0 100644 --- a/packages/host/package.json +++ b/packages/host/package.json @@ -6,14 +6,15 @@ "publishConfig": { "access": "public" }, - "main": "build/index.js", - "types": "build/index.d.ts", + "type": "commonjs", "exports": { ".": { + "@@dev": "./src/index.ts", "types": "./build/index.d.ts", "default": "./build/index.js" }, "./safe": { + "@@dev": "./src/index_safe.ts", "types": "./build/index_safe.d.ts", "default": "./build/index_safe.js" }, diff --git a/packages/host/tsconfig.build.json b/packages/host/tsconfig.build.json index df946e2f694e..5ddf97f9f1c7 100644 --- a/packages/host/tsconfig.build.json +++ b/packages/host/tsconfig.build.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build" + "outDir": "build", + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [ { diff --git a/packages/host/tsconfig.json b/packages/host/tsconfig.json index cac086a9dfce..3d1e2856a002 100644 --- a/packages/host/tsconfig.json +++ b/packages/host/tsconfig.json @@ -1,18 +1,7 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": {}, - "references": [ - { - "path": "../config" - }, - { - "path": "../core" - }, - { - "path": "../shared" - } - ], "include": ["src/**/*.ts"], "exclude": ["build/**", "node_modules/**"] } diff --git a/packages/maintenance/package.json b/packages/maintenance/package.json index 8355c8eac311..65432f986189 100644 --- a/packages/maintenance/package.json +++ b/packages/maintenance/package.json @@ -29,7 +29,7 @@ "node": ">= 18" }, "scripts": { - "ts": "node -r esbuild-register", + "ts": "node -r esbuild-register --conditions=@@dev", "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", diff --git a/packages/maintenance/src/generateTypedDocs.ts b/packages/maintenance/src/generateTypedDocs.ts index e0d9a7786833..f3ab85138f67 100644 --- a/packages/maintenance/src/generateTypedDocs.ts +++ b/packages/maintenance/src/generateTypedDocs.ts @@ -31,7 +31,7 @@ import { formatWithDprint } from "./dprint"; import { getCommandClassFromClassDeclaration, projectRoot, - tsConfigFilePath, + tsConfigFilePathForDocs as tsConfigFilePath, } from "./tsAPITools"; export function findSourceNode( diff --git a/packages/maintenance/src/tsAPITools.ts b/packages/maintenance/src/tsAPITools.ts index af163d2d7b5e..eb2d161d1113 100644 --- a/packages/maintenance/src/tsAPITools.ts +++ b/packages/maintenance/src/tsAPITools.ts @@ -9,7 +9,10 @@ export const repoRoot = path.normalize( ); /** Used for ts-morph */ -export const tsConfigFilePath = path.join(repoRoot, "tsconfig.json"); +export const tsConfigFilePathForDocs = path.join( + repoRoot, + "tsconfig.docs.json", +); export function loadTSConfig( packageName: string = "", diff --git a/packages/maintenance/tsconfig.build.json b/packages/maintenance/tsconfig.build.json index a909f28631df..0060030da691 100644 --- a/packages/maintenance/tsconfig.build.json +++ b/packages/maintenance/tsconfig.build.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build" + "outDir": "build", + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [ { diff --git a/packages/maintenance/tsconfig.json b/packages/maintenance/tsconfig.json index 433a40a06c77..4f1682ccce15 100644 --- a/packages/maintenance/tsconfig.json +++ b/packages/maintenance/tsconfig.json @@ -1,18 +1,10 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "newLine": "lf", "resolveJsonModule": true }, - "references": [ - { - "path": "../core" - }, - { - "path": "../shared" - } - ], "include": ["src/**/*.ts", "src/**/*.json"], "exclude": ["build/**", "node_modules/**"] } diff --git a/packages/nvmedit/package.json b/packages/nvmedit/package.json index ff7840c6f19e..5b7098c76f84 100644 --- a/packages/nvmedit/package.json +++ b/packages/nvmedit/package.json @@ -6,14 +6,15 @@ "publishConfig": { "access": "public" }, - "main": "build/index.js", - "types": "build/index.d.ts", + "type": "commonjs", "exports": { ".": { + "@@dev": "./src/index.ts", "types": "./build/index.d.ts", "default": "./build/index.js" }, "./safe": { + "@@dev": "./src/index_safe.ts", "types": "./build/index_safe.d.ts", "default": "./build/index_safe.js" }, diff --git a/packages/nvmedit/tsconfig.build.json b/packages/nvmedit/tsconfig.build.json index a909f28631df..0060030da691 100644 --- a/packages/nvmedit/tsconfig.build.json +++ b/packages/nvmedit/tsconfig.build.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build" + "outDir": "build", + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [ { diff --git a/packages/nvmedit/tsconfig.json b/packages/nvmedit/tsconfig.json index 0dedb919abdb..3d1e2856a002 100644 --- a/packages/nvmedit/tsconfig.json +++ b/packages/nvmedit/tsconfig.json @@ -1,15 +1,7 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": {}, - "references": [ - { - "path": "../core" - }, - { - "path": "../shared" - } - ], "include": ["src/**/*.ts"], "exclude": ["build/**", "node_modules/**"] } diff --git a/packages/serial/package.json b/packages/serial/package.json index 85365175939d..4a704013213f 100644 --- a/packages/serial/package.json +++ b/packages/serial/package.json @@ -5,18 +5,20 @@ "publishConfig": { "access": "public" }, - "main": "build/index.js", - "types": "build/index.d.ts", + "type": "commonjs", "exports": { ".": { + "@@dev": "./src/index.ts", "types": "./build/index.d.ts", "default": "./build/index.js" }, "./safe": { + "@@dev": "./src/index_safe.ts", "types": "./build/index_safe.d.ts", "default": "./build/index_safe.js" }, "./mock": { + "@@dev": "./src/index_mock.ts", "types": "./build/index_mock.d.ts", "default": "./build/index_mock.js" }, diff --git a/packages/serial/tsconfig.build.json b/packages/serial/tsconfig.build.json index c4884656c2c8..57ae7c3b43ef 100644 --- a/packages/serial/tsconfig.build.json +++ b/packages/serial/tsconfig.build.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build" + "outDir": "build", + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [ { diff --git a/packages/serial/tsconfig.json b/packages/serial/tsconfig.json index 8eea8d2f0953..3d1e2856a002 100644 --- a/packages/serial/tsconfig.json +++ b/packages/serial/tsconfig.json @@ -1,18 +1,7 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": {}, - "references": [ - { - "path": "../core" - }, - { - "path": "../host" - }, - { - "path": "../shared" - } - ], "include": ["src/**/*.ts"], "exclude": ["build/**", "node_modules/**"] } diff --git a/packages/shared/package.json b/packages/shared/package.json index cdb313404b48..333a4eb4e042 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -6,14 +6,15 @@ "publishConfig": { "access": "public" }, - "main": "build/index.js", - "types": "build/index.d.ts", + "type": "commonjs", "exports": { ".": { + "@@dev": "./src/index.ts", "types": "./build/index.d.ts", "default": "./build/index.js" }, "./safe": { + "@@dev": "./src/index_safe.ts", "types": "./build/index_safe.d.ts", "default": "./build/index_safe.js" }, diff --git a/packages/shared/tsconfig.build.json b/packages/shared/tsconfig.build.json index 8549f5112315..9a7a326cc6e3 100644 --- a/packages/shared/tsconfig.build.json +++ b/packages/shared/tsconfig.build.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build" + "outDir": "build", + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [], "include": ["src/**/*.ts"], diff --git a/packages/shared/tsconfig.json b/packages/shared/tsconfig.json index e769ef20ecc0..3d1e2856a002 100644 --- a/packages/shared/tsconfig.json +++ b/packages/shared/tsconfig.json @@ -1,8 +1,7 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": {}, - "references": [], "include": ["src/**/*.ts"], "exclude": ["build/**", "node_modules/**"] } diff --git a/packages/testing/package.json b/packages/testing/package.json index 6569719115e1..614b8440ce83 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -6,8 +6,15 @@ "publishConfig": { "access": "public" }, - "main": "build/index.js", - "types": "build/index.d.ts", + "type": "commonjs", + "exports": { + ".": { + "@@dev": "./src/index.ts", + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, "files": [ "build/**/*.{js,d.ts,map}" ], diff --git a/packages/testing/tsconfig.build.json b/packages/testing/tsconfig.build.json index 41713a5fcc14..137d01b61051 100644 --- a/packages/testing/tsconfig.build.json +++ b/packages/testing/tsconfig.build.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build" + "outDir": "build", + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [ { diff --git a/packages/testing/tsconfig.json b/packages/testing/tsconfig.json index 85436b49c432..3d1e2856a002 100644 --- a/packages/testing/tsconfig.json +++ b/packages/testing/tsconfig.json @@ -1,21 +1,7 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": {}, - "references": [ - { - "path": "../core" - }, - { - "path": "../host" - }, - { - "path": "../serial" - }, - { - "path": "../shared" - } - ], "include": ["src/**/*.ts"], "exclude": ["build/**", "node_modules/**"] } diff --git a/packages/transformers/package.json b/packages/transformers/package.json index 251ff86c953b..15a9e8f246b5 100644 --- a/packages/transformers/package.json +++ b/packages/transformers/package.json @@ -31,6 +31,7 @@ "scripts": { "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", + "bootstrap": "yarn build", "pretest": "del-cli \"test/fixtures/*.js\" && tsc -p tsconfig.test.json && cpy \"test/build/test/fixtures/*.js\" test/fixtures && del-cli test/build", "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix", diff --git a/packages/transformers/src/index.ts b/packages/transformers/src/index.ts index eb3a0e41b0ff..ed92683fc321 100644 --- a/packages/transformers/src/index.ts +++ b/packages/transformers/src/index.ts @@ -62,6 +62,7 @@ export function validateArgs(options?: ValidateArgsOptions): PropertyDecorator { return (target: unknown, property: string | number | symbol) => { // this is a no-op that gets replaced during the build process using the transformer below if (process.env.NODE_ENV === "test") return; + if (process.execArgv.includes("--conditions=@@dev")) return; // Throw an error at runtime when this didn't get transformed throw new Error( "validateArgs is a compile-time decorator and must be compiled with a transformer", diff --git a/packages/transformers/tsconfig.build.json b/packages/transformers/tsconfig.build.json index 8549f5112315..9a7a326cc6e3 100644 --- a/packages/transformers/tsconfig.build.json +++ b/packages/transformers/tsconfig.build.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build" + "outDir": "build", + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [], "include": ["src/**/*.ts"], diff --git a/packages/transformers/tsconfig.json b/packages/transformers/tsconfig.json index 2b018d70c5c2..363dd79a39f3 100644 --- a/packages/transformers/tsconfig.json +++ b/packages/transformers/tsconfig.json @@ -1,6 +1,6 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "newLine": "lf", "experimentalDecorators": true, @@ -8,7 +8,6 @@ "@zwave-js/transformers": ["./src"] } }, - "references": [], "include": ["src/**/*.ts", "test/**/*.ts"], "exclude": ["build/**", "node_modules/**"] } diff --git a/packages/zwave-js/package.json b/packages/zwave-js/package.json index b2ed083e0f08..6992233f26e1 100644 --- a/packages/zwave-js/package.json +++ b/packages/zwave-js/package.json @@ -3,46 +3,55 @@ "version": "13.0.0-beta.0", "description": "Z-Wave driver written entirely in JavaScript/TypeScript", "keywords": [], - "main": "build/index.js", - "types": "build/index.d.ts", + "type": "commonjs", "exports": { ".": { + "@@dev": "./src/index.ts", "types": "./build/index.d.ts", "default": "./build/index.js" }, "./safe": { + "@@dev": "./src/index_safe.ts", "types": "./build/index_safe.d.ts", "default": "./build/index_safe.js" }, "./Controller": { + "@@dev": "./src/Controller.ts", "types": "./build/Controller.d.ts", "default": "./build/Controller.js" }, "./Driver": { + "@@dev": "./src/Driver.ts", "types": "./build/Driver.d.ts", "default": "./build/Driver.js" }, "./Error": { + "@@dev": "./src/Error.ts", "types": "./build/Error.d.ts", "default": "./build/Error.js" }, "./Node": { + "@@dev": "./src/Node.ts", "types": "./build/Node.d.ts", "default": "./build/Node.js" }, "./Testing": { + "@@dev": "./src/Testing.ts", "types": "./build/Testing.d.ts", "default": "./build/Testing.js" }, "./Utils": { + "@@dev": "./src/Utils.ts", "types": "./build/Utils.d.ts", "default": "./build/Utils.js" }, "./Values": { + "@@dev": "./src/Values.ts", "types": "./build/Values.d.ts", "default": "./build/Values.js" }, "./Zniffer": { + "@@dev": "./src/Zniffer.ts", "types": "./build/Zniffer.d.ts", "default": "./build/Zniffer.js" }, @@ -75,7 +84,7 @@ "node": ">= 18" }, "scripts": { - "ts": "node -r esbuild-register", + "ts": "node -r esbuild-register --conditions=@@dev", "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", "extract-api": "yarn api-extractor run", diff --git a/packages/zwave-js/tsconfig.build.json b/packages/zwave-js/tsconfig.build.json index 9a7923899198..39f4caf40cdc 100644 --- a/packages/zwave-js/tsconfig.build.json +++ b/packages/zwave-js/tsconfig.build.json @@ -8,7 +8,9 @@ "src/lib/@types", "node_modules/@types", "../../node_modules/@types" - ] + ], + // Do not use the @@dev export for compiling + "customConditions": [] }, "references": [ { diff --git a/packages/zwave-js/tsconfig.json b/packages/zwave-js/tsconfig.json index 55517958c793..468d1b6152aa 100644 --- a/packages/zwave-js/tsconfig.json +++ b/packages/zwave-js/tsconfig.json @@ -1,6 +1,6 @@ // tsconfig for IntelliSense - active in all files in the current package { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "plugins": [ { @@ -13,38 +13,6 @@ "../../node_modules/@types" ] }, - "references": [ - { - "path": "../cc" - }, - { - "path": "../config" - }, - { - "path": "../core" - }, - { - "path": "../host" - }, - { - "path": "../nvmedit" - }, - { - "path": "../serial" - }, - { - "path": "../shared" - }, - { - "path": "../testing" - }, - { - "path": "../maintenance" - }, - { - "path": "../transformers" - } - ], "include": ["src/**/*.ts"], "exclude": ["build/**", "node_modules/**"] } diff --git a/test/debug.js b/test/decodeMessage.ts similarity index 88% rename from test/debug.js rename to test/decodeMessage.ts index 00922f9eff19..90942ac69462 100644 --- a/test/debug.js +++ b/test/decodeMessage.ts @@ -1,17 +1,17 @@ // @ts-check -require("reflect-metadata"); -require("zwave-js"); -const { Message } = require("@zwave-js/serial"); -const { +import "reflect-metadata"; +import "zwave-js"; +import { isCommandClassContainer } from "@zwave-js/cc"; +import { ConfigManager } from "@zwave-js/config"; +import { + SPANState, + SecurityClass, + SecurityManager2, generateAuthKey, generateEncryptionKey, - SecurityManager2, - SecurityClass, - SPANState, -} = require("@zwave-js/core"); -const { isCommandClassContainer } = require("@zwave-js/cc"); -const { ConfigManager } = require("@zwave-js/config"); +} from "@zwave-js/core"; +import { Message } from "@zwave-js/serial"; (async () => { const configManager = new ConfigManager(); @@ -53,8 +53,7 @@ const { ConfigManager } = require("@zwave-js/config"); }); console.log(Message.getMessageLength(data)); - /** @type {any} */ - const host = { + const host: any = { getSafeCCVersion: () => 1, getSupportedCCVersion: () => 1, configManager, diff --git a/test/run.ts b/test/run.ts index 8976f4b2921a..551207409ae6 100644 --- a/test/run.ts +++ b/test/run.ts @@ -29,7 +29,6 @@ const driver = new Driver(port, { // testingHooks: { // skipNodeInterview: true, // }, - enableSoftReset: false, securityKeys: { S0_Legacy: Buffer.from("0102030405060708090a0b0c0d0e0f10", "hex"), S2_Unauthenticated: Buffer.from( diff --git a/test/tsconfig.json b/test/tsconfig.json new file mode 100644 index 000000000000..217a20995603 --- /dev/null +++ b/test/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../tsconfig.base.json", + "include": ["*.ts"] +} diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 000000000000..ff16bb6db3bb --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,26 @@ +// Shared tsconfig to be inherited by all other tsconfigs in this repo +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "composite": true, + "incremental": true, + "declaration": true, + "declarationMap": true, + + "noEmitOnError": true, + "removeComments": false, + "experimentalDecorators": true, + "emitDecoratorMetadata": false, + "sourceMap": true, + "inlineSourceMap": false, + "stripInternal": true, + + "pretty": true, + "types": ["node"], + "noErrorTruncation": true, + + // Look up source files instead of type definitions while developing + // From: https://colinhacks.com/essays/live-types-typescript-monorepo + "customConditions": ["@@dev"] + } +} diff --git a/tsconfig.docs.json b/tsconfig.docs.json new file mode 100644 index 000000000000..e14e3fd8c033 --- /dev/null +++ b/tsconfig.docs.json @@ -0,0 +1,8 @@ +// Custom tsconfig for documentation generation +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "customConditions": [] + }, + "include": ["packages/**/src/**/*.ts"] +} diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index 343ab38b178b..c3348d742aa8 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -1,5 +1,6 @@ +// Custom tsconfig for eslint { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "include": ["**/*.ts"], "exclude": ["**/build/**", "**/node_modules/**"] } diff --git a/tsconfig.json b/tsconfig.json index e031d7fc7be9..0e3d909b14ba 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,28 +1,21 @@ +// This is a "solution" tsconfig with references to all "entrypoints" in the monorepo +// to power IntelliSense without having to open a specific package first { - "extends": "@tsconfig/node18/tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { - "composite": true, - "incremental": true, - "declaration": true, - "declarationMap": true, - - "noEmitOnError": true, - "removeComments": false, - "experimentalDecorators": true, - "emitDecoratorMetadata": false, - "sourceMap": true, - "inlineSourceMap": false, - "stripInternal": true, - - "pretty": true, - "types": ["node"], - "noErrorTruncation": true + "noEmit": true }, - "include": [ - "packages/**/src/**/*.ts", - "packages/**/maintenance/**/*.ts", - "maintenance/**/*.ts", - "test/**/*.ts" - ], - "exclude": ["**/build/**", "node_modules/**", "packages/**/node_modules"] + "files": [], + "include": [], + "references": [ + { + "path": "./packages/eslint-plugin" + }, + { + "path": "./packages/flash" + }, + { + "path": "./packages/zwave-js" + } + ] } diff --git a/turbo.json b/turbo.json index 7329cc2ba7af..a4c65770b885 100644 --- a/turbo.json +++ b/turbo.json @@ -5,6 +5,11 @@ "cache": false }, + "bootstrap": { + // Dummy task to enable running all bootstrap tasks + "cache": false // TypeScript does the caching + }, + "codegen": { // Dummy task to enable running all codegen tasks }, @@ -40,7 +45,7 @@ // Specific linting tasks: ESLint "lint:ts": { - "dependsOn": ["//#build:turbo"], + "dependsOn": ["bootstrap"], "inputs": [ // https://github.com/vercel/turborepo/issues/1407 ":!:build/", @@ -52,7 +57,7 @@ ] }, "lint:ts:fix": { - "dependsOn": ["//#build:turbo"], + "dependsOn": ["bootstrap"], "inputs": [ // https://github.com/vercel/turborepo/issues/1407 ":!:build/", @@ -66,8 +71,8 @@ }, "lint:zwave": { + "dependsOn": ["bootstrap"] // Dummy task to enable running all lint:zwave tasks - "dependsOn": ["//#build:turbo"] }, "@zwave-js/config#lint:zwave": { "inputs": ["**/*.ts", "config/**/*.json"] @@ -81,7 +86,7 @@ }, "test:ts": { - "dependsOn": ["//#build:turbo"], + // "dependsOn": ["//#build:turbo"], "inputs": ["src/**/*.ts", "ava.config.cjs", "../../ava.config.cjs"] // TODO: consider snapshot files } @@ -91,6 +96,7 @@ "yarn.lock", // Build fresh when TS related stuff changes "tsconfig.json", + "tsconfig.base.json", "tsconfig.build.json" ] } diff --git a/yarn.lock b/yarn.lock index 6a1e5beacc2d..ec21b875bb89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1975,6 +1975,7 @@ __metadata: "@types/eslint": "npm:^8.56.7" "@typescript-eslint/utils": "npm:^7.5.0" "@zwave-js/core": "workspace:*" + eslint: "npm:^8.57.0" typescript: "npm:5.4.4" languageName: unknown linkType: soft