diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml
index 8e98011..9b60f55 100644
--- a/.github/workflows/doc.yml
+++ b/.github/workflows/doc.yml
@@ -1,8 +1,8 @@
name: 发布文档到github pages
on:
push:
- branches:
- - master
+ paths:
+ - '**/docs/**'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
diff --git a/.npmrc b/.npmrc
index a3b75e6..f147229 100644
--- a/.npmrc
+++ b/.npmrc
@@ -1,2 +1,3 @@
registry=https://registry.npmmirror.com/
strict-peer-dependencies=false
+ignore-workspace-root-check=true
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 07782d6..7f1ee0d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,56 @@
+# [1.2.0](https://github.com/agileago/vue3-oop/compare/v1.1.2...v1.2.0) (2025-06-05)
+
+
+### Bug Fixes
+
+* correct provides handling in provideService function ([edf85eb](https://github.com/agileago/vue3-oop/commit/edf85eb2df1bc5d32e138d5af16c61d4943e0e9a))
+
+
+
+## [1.1.2](https://github.com/agileago/vue3-oop/compare/v1.1.1...v1.1.2) (2025-05-20)
+
+
+### Features
+
+* add If component for conditional rendering ([5f8bd91](https://github.com/agileago/vue3-oop/commit/5f8bd9143aec10e7c00e568fe127fc960b73ba50))
+
+
+
+## [1.1.1](https://github.com/agileago/vue3-oop/compare/v1.1.0...v1.1.1) (2025-05-13)
+
+
+### Performance Improvements
+
+* 提高性能 ([180a8b3](https://github.com/agileago/vue3-oop/commit/180a8b3ba8819684852ef4a21c85a138c667a2d8))
+
+
+
+# [1.1.0](https://github.com/agileago/vue3-oop/compare/v1.0.21...v1.1.0) (2025-05-12)
+
+
+### Bug Fixes
+
+* watch不生效 ([2669347](https://github.com/agileago/vue3-oop/commit/266934753d9732216cf0c0967ffaf8865eb1b2c6))
+
+
+
+## [1.0.21](https://github.com/agileago/vue3-oop/compare/v1.0.19...v1.0.21) (2025-04-04)
+
+
+
+## [1.0.19](https://github.com/agileago/vue3-oop/compare/v1.0.18...v1.0.19) (2025-04-02)
+
+
+
+## [1.0.18](https://github.com/agileago/vue3-oop/compare/v1.0.17...v1.0.18) (2025-04-02)
+
+
+### Bug Fixes
+
+* 打包到dist ([df5554e](https://github.com/agileago/vue3-oop/commit/df5554e9f143280b3929a05e21a9ebf5d3e5dc39))
+
+
+
## [1.0.17](https://github.com/agileago/vue3-oop/compare/v1.0.16...v1.0.17) (2025-04-02)
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..e013878
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2025 vue3-oop
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts
index 33d0de0..b143508 100644
--- a/docs/.vitepress/config.mts
+++ b/docs/.vitepress/config.mts
@@ -9,6 +9,26 @@ export default defineConfig({
lineNumbers: false,
},
themeConfig: {
+ search: {
+ provider: 'local',
+ options: {
+ translations: {
+ button: {
+ buttonText: '搜索文档',
+ buttonAriaLabel: '搜索文档'
+ },
+ modal: {
+ noResultsText: '无法找到相关结果',
+ resetButtonTitle: '清除查询条件',
+ footer: {
+ selectText: '选择',
+ navigateText: '切换',
+ closeText: '关闭'
+ }
+ }
+ }
+ }
+ },
nav: [
{ text: '指南', link: '/guide/', activeMatch: '/guide/' },
{
diff --git a/docs/index.md b/docs/index.md
index dda82aa..230cdda 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -14,7 +14,7 @@ features:
- title: 类组件
details: 功能与类型融为一体,无需多次声明类型,独立的属性类型声明,各种HOC组合轻而易举
- title: 自动的依赖注入
- details: 基于动态解析的 injection-js 依赖注入,让使用服务丝般顺滑
+ details: 基于动态解析的 injection-js 依赖注入,让使用服务丝般柔滑
- title: vue3无ref编程
details: 无需关注ref及其value,正常声明变量,编程体验更自然
----
\ No newline at end of file
+---
diff --git a/eslint.config.js b/eslint.config.js
index c5db451..5822159 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -23,5 +23,8 @@ export default defineConfig({
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
+ 'require-await': 'warn',
+ '@typescript-eslint/no-useless-constructor': 'warn',
+ '@typescript-eslint/no-unsafe-function-type': 'warn',
},
})
diff --git a/package.json b/package.json
index 9c9d57f..294c266 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "vue3-oop",
- "version": "1.0.17",
+ "version": "1.2.0",
"packageManager": "pnpm@9.1.1",
"engines": {
"pnpm": ">=9.0"
@@ -47,17 +47,20 @@
"access": "public"
},
"scripts": {
- "build": "tsup src/index.ts --format esm,cjs --out-dir=lib --dts --clean",
- "dev": "tsup src/index.ts --format esm --out-dir=lib --watch --dts",
+ "build": "tsup src/index.ts --format esm,cjs --out-dir=dist --dts --clean",
+ "dev": "tsup src/index.ts --format esm --out-dir=dist --watch --dts",
"typecheck": "tsc --noEmit",
"lint": "eslint --fix .",
"format": "prettier --write .",
- "release": "pnpm build && vr release",
+ "release": "vr release",
+ "prepublishOnly": "pnpm build",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs",
- "test": "vitest",
- "postinstall": "simple-git-hooks"
+ "test:dev": "vitest --coverage",
+ "test": "vitest run --coverage",
+ "prepare": "simple-git-hooks",
+ "demo:dev": "pnpm -C playground dev"
},
"commitlint": {
"extends": [
@@ -89,7 +92,12 @@
"tsup": "^8.4.0",
"typescript": "^5.8.2",
"vitepress": "^1.4.1",
- "vue": "^3.5.13"
+ "vue": "^3.5.13",
+ "vitest": "^3.1.1",
+ "jsdom": "^25.0.1",
+ "@vue3-oop/plugin-vue-jsx": "^1.4.6",
+ "@vue/test-utils": "^2.4.6",
+ "@vitest/coverage-istanbul": "^3.1.1"
},
"peerDependencies": {
"injection-js": "*",
diff --git a/playground/global.d.ts b/playground/global.d.ts
new file mode 100644
index 0000000..11f02fe
--- /dev/null
+++ b/playground/global.d.ts
@@ -0,0 +1 @@
+///