From 11ce7ef8f743af81b066a8747117f8e5254c9c3f Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Fri, 20 Sep 2024 13:25:37 -0700 Subject: [PATCH] fix: type errors in build --- .../input/c-select-many-to-many.vue | 5 +--- src/coalesce-vue-vuetify3/package-lock.json | 8 +++--- src/coalesce-vue-vuetify3/package.json | 4 +-- .../tsconfig.build-types.json | 27 ++++++++++--------- .../tsconfig.build-utils.json | 1 + src/coalesce-vue-vuetify3/tsconfig.json | 3 ++- .../tsconfig.test-types.json | 8 ------ 7 files changed, 24 insertions(+), 32 deletions(-) delete mode 100644 src/coalesce-vue-vuetify3/tsconfig.test-types.json diff --git a/src/coalesce-vue-vuetify2/src/components/input/c-select-many-to-many.vue b/src/coalesce-vue-vuetify2/src/components/input/c-select-many-to-many.vue index 88172bd50..7e2c7154d 100644 --- a/src/coalesce-vue-vuetify2/src/components/input/c-select-many-to-many.vue +++ b/src/coalesce-vue-vuetify2/src/components/input/c-select-many-to-many.vue @@ -301,11 +301,8 @@ export default defineComponent({ // We need to mark the item as removed, but allow `emitInput` to handle // actually updating the collection bound to the input. - // @ts-expect-error internal state vm._isRemoved = true; - // @ts-ignore internal state - if (vm.$parent) { - // @ts-expect-error internal state + if (vm.$parent instanceof ViewModel) { (vm.$parent.$removedItems ??= []).push(vm); } } diff --git a/src/coalesce-vue-vuetify3/package-lock.json b/src/coalesce-vue-vuetify3/package-lock.json index 0594ea43c..d1030ed25 100644 --- a/src/coalesce-vue-vuetify3/package-lock.json +++ b/src/coalesce-vue-vuetify3/package-lock.json @@ -26,7 +26,7 @@ "eslint-plugin-vue": "^9.27.0", "jsdom": "^24.1.1", "sass": "^1.69.7", - "typescript": "5.3.3", + "typescript": "5.6.2", "unplugin-vue-components": "^0.27.4", "vite": "^5.3.4", "vitest": "^2.0.3", @@ -5157,9 +5157,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/src/coalesce-vue-vuetify3/package.json b/src/coalesce-vue-vuetify3/package.json index 7dcf938d2..ac59a798a 100644 --- a/src/coalesce-vue-vuetify3/package.json +++ b/src/coalesce-vue-vuetify3/package.json @@ -28,7 +28,7 @@ "dist" ], "scripts": { - "build": "npm run build-local-deps && vite build && vue-tsc -p ./tsconfig.build-types.json && vue-tsc -p ./tsconfig.test-types.json && npm run buildts", + "build": "npm run build-local-deps && vite build && vue-tsc --noEmit && vue-tsc -p ./tsconfig.build-types.json && npm run buildts", "buildts": "tsc -p ./tsconfig.build-utils.json", "build-local-deps": "cd ../coalesce-vue && npm ci && npm run build", "test": "vitest", @@ -61,7 +61,7 @@ "eslint-plugin-vue": "^9.27.0", "jsdom": "^24.1.1", "sass": "^1.69.7", - "typescript": "5.3.3", + "typescript": "5.6.2", "unplugin-vue-components": "^0.27.4", "vite": "^5.3.4", "vitest": "^2.0.3", diff --git a/src/coalesce-vue-vuetify3/tsconfig.build-types.json b/src/coalesce-vue-vuetify3/tsconfig.build-types.json index 6bb117611..7a91f7d99 100644 --- a/src/coalesce-vue-vuetify3/tsconfig.build-types.json +++ b/src/coalesce-vue-vuetify3/tsconfig.build-types.json @@ -4,21 +4,22 @@ "outDir": "./dist", "declaration": true, "emitDeclarationOnly": true, + + // Type checking is done according to tsconfig.json, + // which is configured to be able to use coalesce-vue internal types. + + // However, we must emit the types using the build copy of coalesce-vue + // so that typescript doesn't also emit types for coalesce-vue. + // We have to turn off typechecking to do this because + // the @internal types in coalesce-vue aren't available there. + "noCheck": true, + "rootDir": "./src", "paths": { - "coalesce-vue": ["coalesce-vue"], - "coalesce-vue/*": ["coalesce-vue/*"], - "coalesce-vue/lib/*": ["coalesce-vue/lib/*"] + "coalesce-vue": ["../coalesce-vue/lib"], + "coalesce-vue/*": ["../coalesce-vue/lib/*"], + "coalesce-vue/lib/*": ["../coalesce-vue/lib/*"] } }, - "include": ["src/index.ts"], - "exclude": [ - "node_modules", - "../coalesce-vue", - "coalesce-vue", - "coalesce-vue/**/*", - "../coalesce-vue/src", - "../coalesce-vue/src/*", - "../coalesce-vue/**/*" - ] + "include": ["src/index.ts"] } diff --git a/src/coalesce-vue-vuetify3/tsconfig.build-utils.json b/src/coalesce-vue-vuetify3/tsconfig.build-utils.json index 98225a783..8e36edbe1 100644 --- a/src/coalesce-vue-vuetify3/tsconfig.build-utils.json +++ b/src/coalesce-vue-vuetify3/tsconfig.build-utils.json @@ -4,6 +4,7 @@ "target": "ESNext", "outDir": "./dist", "declaration": true, + "skipLibCheck": true, "moduleResolution": "NodeNext" }, "include": ["src/build.ts"], diff --git a/src/coalesce-vue-vuetify3/tsconfig.json b/src/coalesce-vue-vuetify3/tsconfig.json index 83e2c8059..37e6386fd 100644 --- a/src/coalesce-vue-vuetify3/tsconfig.json +++ b/src/coalesce-vue-vuetify3/tsconfig.json @@ -20,7 +20,8 @@ "coalesce-vue/*": ["../coalesce-vue/src/*"], "coalesce-vue/lib/*": ["../coalesce-vue/src/*"], "vue": ["node_modules/vue"], - "vue/*": ["node_modules/vue/*"] + "vue/*": ["node_modules/vue/*"], + "vue-router": ["node_modules/vue-router"] }, "lib": ["esnext", "dom", "dom.iterable", "scripthost"], "types": ["node", "vue-router", "vuetify", "vitest/globals"] diff --git a/src/coalesce-vue-vuetify3/tsconfig.test-types.json b/src/coalesce-vue-vuetify3/tsconfig.test-types.json deleted file mode 100644 index b7b879816..000000000 --- a/src/coalesce-vue-vuetify3/tsconfig.test-types.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "noEmit": true, - "emitDeclarationOnly": false - }, - "include": ["src/**/*.spec.ts", "src/**/*.spec.vue", "src/**/*.spec.tsx"] -}