From b13089f419adcb32ba9d758d5f2a01604a098c87 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Fri, 12 May 2023 15:53:29 +0800 Subject: [PATCH 1/5] fix: use `--build` for type-checking to be exaustive and less-fragile Fixes #267 Thanks @segevfiner for noticing this new feature! Currently there's still a small annoyance that `vue-tsc` would output an extra error message when there're type errors in `.vue` files https://github.com/vuejs/language-tools/issues/2622 But it works well if there's no error. I've already submitted a PR to address it https://github.com/vuejs/language-tools/pull/3176 --- template/base/_gitignore | 2 ++ template/config/typescript/package.json | 2 +- template/tsconfig/base/tsconfig.app.json | 1 + template/tsconfig/base/tsconfig.node.json | 1 + template/tsconfig/cypress-ct/package.json | 5 ----- template/tsconfig/vitest/package.json | 3 --- 6 files changed, 5 insertions(+), 9 deletions(-) delete mode 100644 template/tsconfig/cypress-ct/package.json diff --git a/template/base/_gitignore b/template/base/_gitignore index 38adffa6..8ee54e8d 100644 --- a/template/base/_gitignore +++ b/template/base/_gitignore @@ -26,3 +26,5 @@ coverage *.njsproj *.sln *.sw? + +*.tsbuildinfo diff --git a/template/config/typescript/package.json b/template/config/typescript/package.json index 69a087b3..e8b7bc1f 100644 --- a/template/config/typescript/package.json +++ b/template/config/typescript/package.json @@ -2,7 +2,7 @@ "scripts": { "build": "run-p type-check build-only", "build-only": "vite build", - "type-check": "vue-tsc --noEmit" + "type-check": "vue-tsc --build" }, "devDependencies": { "@types/node": "^18.16.3", diff --git a/template/tsconfig/base/tsconfig.app.json b/template/tsconfig/base/tsconfig.app.json index 3e5b621e..491e0939 100644 --- a/template/tsconfig/base/tsconfig.app.json +++ b/template/tsconfig/base/tsconfig.app.json @@ -4,6 +4,7 @@ "exclude": ["src/**/__tests__/*"], "compilerOptions": { "composite": true, + "noEmit": true, "baseUrl": ".", "paths": { "@/*": ["./src/*"] diff --git a/template/tsconfig/base/tsconfig.node.json b/template/tsconfig/base/tsconfig.node.json index a52f76f3..b0078fa7 100644 --- a/template/tsconfig/base/tsconfig.node.json +++ b/template/tsconfig/base/tsconfig.node.json @@ -3,6 +3,7 @@ "include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"], "compilerOptions": { "composite": true, + "noEmit": true, "module": "ESNext", "types": ["node"] } diff --git a/template/tsconfig/cypress-ct/package.json b/template/tsconfig/cypress-ct/package.json deleted file mode 100644 index ba3c34a4..00000000 --- a/template/tsconfig/cypress-ct/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "scripts": { - "type-check": "vue-tsc --noEmit -p tsconfig.cypress-ct.json --composite false" - } -} diff --git a/template/tsconfig/vitest/package.json b/template/tsconfig/vitest/package.json index c91681fa..0911662b 100644 --- a/template/tsconfig/vitest/package.json +++ b/template/tsconfig/vitest/package.json @@ -1,7 +1,4 @@ { - "scripts": { - "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false" - }, "devDependencies": { "@types/jsdom": "^21.1.1" } From 9eaeb65bccf20b045854543957f1c4fa8053705b Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Fri, 12 May 2023 20:36:30 +0800 Subject: [PATCH 2/5] fix: add `--force` to make it work consistently --- template/config/typescript/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/config/typescript/package.json b/template/config/typescript/package.json index e8b7bc1f..8766c603 100644 --- a/template/config/typescript/package.json +++ b/template/config/typescript/package.json @@ -2,7 +2,7 @@ "scripts": { "build": "run-p type-check build-only", "build-only": "vite build", - "type-check": "vue-tsc --build" + "type-check": "vue-tsc --build --force" }, "devDependencies": { "@types/node": "^18.16.3", From 57cc07679bfa8937d2927d3950167f7fc0363954 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 30 Nov 2023 15:32:24 +0800 Subject: [PATCH 3/5] fix: add missing `noEmit: true` in nightwatch tsconfigs --- template/tsconfig/nightwatch-ct/tsconfig.app.json | 1 + template/tsconfig/nightwatch/nightwatch/tsconfig.json | 1 + 2 files changed, 2 insertions(+) diff --git a/template/tsconfig/nightwatch-ct/tsconfig.app.json b/template/tsconfig/nightwatch-ct/tsconfig.app.json index 3e5b621e..491e0939 100644 --- a/template/tsconfig/nightwatch-ct/tsconfig.app.json +++ b/template/tsconfig/nightwatch-ct/tsconfig.app.json @@ -4,6 +4,7 @@ "exclude": ["src/**/__tests__/*"], "compilerOptions": { "composite": true, + "noEmit": true, "baseUrl": ".", "paths": { "@/*": ["./src/*"] diff --git a/template/tsconfig/nightwatch/nightwatch/tsconfig.json b/template/tsconfig/nightwatch/nightwatch/tsconfig.json index b4b031b9..ca4be1af 100644 --- a/template/tsconfig/nightwatch/nightwatch/tsconfig.json +++ b/template/tsconfig/nightwatch/nightwatch/tsconfig.json @@ -5,6 +5,7 @@ "module": "commonjs", "moduleResolution": "node", "composite": true, + "noEmit": true, "rootDir": "../", "lib": ["ESNext", "dom"], "types": ["nightwatch"] From 0a821272a299ba56bce07f3064a3e4bcdf18bcf1 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 30 Nov 2023 15:32:48 +0800 Subject: [PATCH 4/5] fix: add missing vite-plugin-nightwatch dependency --- pnpm-lock.yaml | 2 -- template/config/nightwatch/package.json | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 43906d16..3daff5cc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -206,8 +206,6 @@ importers: specifier: ^0.4.0 version: 0.4.0 - template/tsconfig/cypress-ct: {} - template/tsconfig/vitest: devDependencies: '@types/jsdom': diff --git a/template/config/nightwatch/package.json b/template/config/nightwatch/package.json index 4f281a77..5d871a78 100644 --- a/template/config/nightwatch/package.json +++ b/template/config/nightwatch/package.json @@ -9,6 +9,7 @@ "@types/nightwatch": "^2.3.28", "geckodriver": "^4.2.1", "chromedriver": "^119.0.0", - "ts-node": "^10.9.1" + "ts-node": "^10.9.1", + "vite-plugin-nightwatch": "^0.4.5" } } From f75fd9813a624b8e44b012608335721901aba00b Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 30 Nov 2023 15:34:24 +0800 Subject: [PATCH 5/5] chore: update lockfile --- pnpm-lock.yaml | 42 ++++-------------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9a6463e1..6a417f30 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -131,6 +131,9 @@ importers: ts-node: specifier: ^10.9.1 version: 10.9.1(@types/node@18.18.13)(typescript@5.2.2) + vite-plugin-nightwatch: + specifier: ^0.4.5 + version: 0.4.5(vue@3.3.9) template/config/nightwatch-ct: dependencies: @@ -239,29 +242,6 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/core@7.23.2: - resolution: {integrity: sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.22.13 - '@babel/generator': 7.23.0 - '@babel/helper-compilation-targets': 7.22.15 - '@babel/helper-module-transforms': 7.23.0(@babel/core@7.23.2) - '@babel/helpers': 7.23.2 - '@babel/parser': 7.23.3 - '@babel/template': 7.22.15 - '@babel/traverse': 7.23.2 - '@babel/types': 7.23.0 - convert-source-map: 2.0.0 - debug: 4.3.4(supports-color@8.1.1) - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - dev: true - /@babel/core@7.23.3: resolution: {integrity: sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew==} engines: {node: '>=6.9.0'} @@ -375,20 +355,6 @@ packages: '@babel/types': 7.23.0 dev: true - /@babel/helper-module-transforms@7.23.0(@babel/core@7.23.2): - resolution: {integrity: sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.23.2 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.22.15 - '@babel/helper-simple-access': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.20 - dev: true - /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.3): resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} engines: {node: '>=6.9.0'} @@ -1120,7 +1086,7 @@ packages: /@nightwatch/esbuild-utils@0.2.1: resolution: {integrity: sha512-OLvkmfYs0DxT3o0BKWi1dq+GTXAs6x0t2O6N5WaCab5d5mXb/Nc/zTXswZLpjXjn3kMjR1rZrIZ+xENWhhFlfQ==} dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.3 esbuild: 0.15.18 lodash.merge: 4.6.2 lodash.mergewith: 4.6.2