Skip to content

Commit

Permalink
feat: upgrade Volar to 2 (#336)
Browse files Browse the repository at this point in the history
* wip: update

* feat: upgrade volar to 2

* feat: watch
  • Loading branch information
qmhc authored Jul 17, 2024
1 parent bd1b52a commit 7a5fe9a
Show file tree
Hide file tree
Showing 19 changed files with 1,043 additions and 1,129 deletions.
4 changes: 2 additions & 2 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"
. "$(dirname "$0")/husky.sh"
. "$(dirname "$0")/../common.sh"

npx --no-install commitlint --edit "$1"
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"
. "$(dirname "$0")/husky.sh"
. "$(dirname "$0")/../common.sh"

[ -n "$CI" ] && exit 0

Expand Down
4 changes: 2 additions & 2 deletions examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.2.1",
"tslib": "^2.6.2",
"typescript": "5.4.3",
"vite": "^5.2.6"
"typescript": "5.5.3",
"vite": "^5.3.4"
}
}
4 changes: 2 additions & 2 deletions examples/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"svelte": "^4.2.12",
"svelte-check": "^3.6.8",
"tslib": "^2.6.2",
"typescript": "5.4.3",
"vite": "^5.2.6"
"typescript": "5.5.3",
"vite": "^5.3.4"
}
}
4 changes: 2 additions & 2 deletions examples/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"types": "dist/ts-test.d.ts",
"devDependencies": {
"tslib": "^2.6.2",
"typescript": "5.4.3",
"vite": "^5.2.6"
"typescript": "5.5.3",
"vite": "^5.3.4"
}
}
3 changes: 3 additions & 0 deletions examples/ts/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ export interface TestBase {
name: string
}

/**
* Comment
*/
export interface Component {
name: string,
type: string
Expand Down
2 changes: 1 addition & 1 deletion examples/ts/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default defineConfig({
// aliasesExclude: [/^@components/],
staticImport: true,
// insertTypesEntry: true,
rollupTypes: true,
// rollupTypes: true,
declarationOnly: true
})
]
Expand Down
3 changes: 2 additions & 1 deletion examples/vue/components/Setup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ defineProps({
}
})
const count = defineModel('count', { type: Number, default: 0 })
// Must specify the generic type for defineModel to infer correct type
const count = defineModel<number>('count', { default: 0 })
const emit = defineEmits(['on-add'])
Expand Down
2 changes: 1 addition & 1 deletion examples/vue/components/TypeProps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<script setup lang="ts">
export type Props = {
color: 'blue' | 'red' | 'purple',
color: 'blue' | 'red' | 'purple' | 'yellow',
array?: { foo: number }[]
}
Expand Down
4 changes: 2 additions & 2 deletions examples/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"tslib": "^2.6.2",
"typescript": "5.4.3",
"vite": "^5.2.6"
"typescript": "5.5.3",
"vite": "^5.3.4"
}
}
1 change: 1 addition & 0 deletions examples/vue/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default defineConfig({
]
},
build: {
// watch: {},
lib: {
entry: [resolve(__dirname, 'src/index.ts'), resolve(__dirname, 'src/main.ts')],
name: 'Test',
Expand Down
41 changes: 21 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,44 +58,45 @@
"volar"
],
"dependencies": {
"@microsoft/api-extractor": "7.43.0",
"@microsoft/api-extractor": "7.47.2",
"@rollup/pluginutils": "^5.1.0",
"@vue/language-core": "^1.8.27",
"debug": "^4.3.4",
"@volar/typescript": "^2.3.4",
"@vue/language-core": "2.0.19",
"debug": "^4.3.5",
"kolorist": "^1.8.0",
"magic-string": "^0.30.8",
"vue-tsc": "^1.8.27"
"magic-string": "^0.30.10",
"vue-tsc": "2.0.19"
},
"devDependencies": {
"@commitlint/cli": "^19.2.1",
"@commitlint/cli": "^19.3.0",
"@types/debug": "^4.1.12",
"@types/minimist": "^1.2.5",
"@types/node": "^20.11.30",
"@types/node": "^20.14.11",
"@types/prompts": "^2.4.9",
"@types/semver": "^7.5.8",
"@vexip-ui/commitlint-config": "^0.4.0",
"@vexip-ui/eslint-config": "^0.12.0",
"@vexip-ui/commitlint-config": "^0.5.0",
"@vexip-ui/eslint-config": "^0.12.1",
"@vexip-ui/prettier-config": "^0.2.0",
"@vue/eslint-config-standard": "^8.0.1",
"@vue/eslint-config-typescript": "^13.0.0",
"conventional-changelog-cli": "^4.1.0",
"conventional-changelog-cli": "^5.0.0",
"eslint": "^8.57.0",
"execa": "^8.0.1",
"husky": "^9.0.11",
"husky": "^9.1.0",
"is-ci": "^3.0.1",
"lint-staged": "^15.2.2",
"lint-staged": "^15.2.7",
"minimist": "^1.2.8",
"pinst": "^3.0.0",
"prettier": "^3.2.5",
"prettier": "^3.3.3",
"pretty-quick": "^4.0.0",
"prompts": "^2.4.2",
"rimraf": "^5.0.5",
"semver": "^7.6.0",
"tsx": "^4.7.1",
"typescript": "5.4.3",
"rimraf": "^6.0.1",
"semver": "^7.6.3",
"tsx": "^4.16.2",
"typescript": "5.5.3",
"unbuild": "^2.0.0",
"vite": "^5.2.6",
"vitest": "^1.4.0"
"vite": "^5.3.4",
"vitest": "^2.0.3"
},
"peerDependencies": {
"typescript": "*",
Expand All @@ -108,7 +109,7 @@
},
"pnpm": {
"patchedDependencies": {
"@microsoft/api-extractor@7.43.0": "patches/@microsoft__api-extractor@7.43.0.patch"
"@microsoft/api-extractor@7.47.2": "patches/@microsoft__api-extractor@7.47.2.patch"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
diff --git a/lib/api/Extractor.js b/lib/api/Extractor.js
index c57e4abc8f5497a9b0260cd9e3eacc1233a252c5..9442a3c9cbf21f5925bb5b78f6cab049361ed0ca 100644
index d125dff6b2741441e2f38c43704abd86b1209e8d..3cfbd58755d910dc2181eacc235adf148ce7e088 100644
--- a/lib/api/Extractor.js
+++ b/lib/api/Extractor.js
@@ -259,7 +259,7 @@ class Extractor {
});
@@ -281,7 +281,7 @@ class Extractor {
return apiReportChanged;
}
static _checkCompilerCompatibility(extractorConfig, messageRouter) {
- messageRouter.logInfo(ConsoleMessageId_1.ConsoleMessageId.Preamble, `Analysis will use the bundled TypeScript version ${ts.version}`);
+ // messageRouter.logInfo(ConsoleMessageId_1.ConsoleMessageId.Preamble, `Analysis will use the bundled TypeScript version ${ts.version}`);
try {
const typescriptPath = resolve.sync('typescript', {
basedir: extractorConfig.projectFolder,
@@ -274,8 +274,8 @@ class Extractor {
@@ -296,8 +296,8 @@ class Extractor {
const theirMajor = semver.major(packageJson.version);
const theirMinor = semver.minor(packageJson.version);
if (theirMajor > ourMajor || (theirMajor === ourMajor && theirMinor > ourMinor)) {
Expand Down
Loading

0 comments on commit 7a5fe9a

Please sign in to comment.