@es-plus/vue2 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,20 @@
1
1
  /**
2
- * Vue 2 兼容层 —— 通过 vue-demi 自动适配
2
+ * Vue 2 兼容层 —— 直接从 @vue/composition-api 导入
3
3
  *
4
- * vue-demi 在运行时自动判断环境:
5
- * - Vue 2.7+:从 vue 导出 Composition API(原生支持)
6
- * - Vue 2.6 + @vue/composition-api:从 @vue/composition-api 导出
7
- * - Vue 3:从 vue 导出
4
+ * @vue/composition-api 在不同环境下的行为:
5
+ * - Vue 2.7+:@vue/composition-api@1.7+ 的 postinstall 会自动 redirect 到 vue 原生 Composition API
6
+ * - Vue 2.6:提供完整的 Composition API polyfill
8
7
  *
9
- * 用户无需配置 webpack resolve.alias,开箱即用。
10
- * Vue 2.6 用户只需:
8
+ * 用户只需:
11
9
  * 1. npm install @vue/composition-api
12
- * 2. main.js 中 Vue.use(VueCompositionAPI)
10
+ * 2. main.js 中 Vue.use(VueCompositionAPI)(Vue 2.6 必须,Vue 2.7 可选)
11
+ *
12
+ * 不使用 vue-demi 的原因:
13
+ * vue-demi 在嵌套 node_modules 安装时(monorepo / npm workspace),其 postinstall
14
+ * 会解析到 @es-plus/vue2 的 devDependency vue@2.7 而非用户项目的 vue@2.6,
15
+ * 导致生成了错误的 lib 版本(尝试从 vue 导入 getCurrentInstance),
16
+ * 在 Vue 2.6 环境下产生 "export 'xxx' was not found in 'vue'" 错误。
13
17
  */
14
- export { Vue2 as Vue, ref, reactive, computed, watch, watchEffect, onMounted, onUnmounted, onBeforeUnmount, onBeforeMount, onUpdated, onActivated, onDeactivated, defineComponent, inject, provide, nextTick, getCurrentInstance, toRefs, toRef, unref, isRef, h, } from 'vue-demi';
15
- export type { PropType, Ref, ComputedRef, WatchSource } from 'vue-demi';
18
+ export { default as Vue, ref, reactive, computed, watch, watchEffect, onMounted, onUnmounted, onBeforeUnmount, onBeforeMount, onUpdated, onActivated, onDeactivated, defineComponent, inject, provide, nextTick, getCurrentInstance, toRefs, toRef, unref, isRef, h, } from '@vue/composition-api';
19
+ export type { PropType, Ref, ComputedRef, WatchSource } from '@vue/composition-api';
16
20
  //# sourceMappingURL=vue-compat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vue-compat.d.ts","sourceRoot":"","sources":["../src/vue-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,IAAI,IAAI,GAAG,EACX,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,aAAa,EACb,eAAe,EACf,MAAM,EACN,OAAO,EACP,QAAQ,EACR,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAK,EACL,CAAC,GACF,MAAM,UAAU,CAAA;AAEjB,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"vue-compat.d.ts","sourceRoot":"","sources":["../src/vue-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,OAAO,IAAI,GAAG,EACd,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,aAAa,EACb,eAAe,EACf,MAAM,EACN,OAAO,EACP,QAAQ,EACR,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAK,EACL,CAAC,GACF,MAAM,sBAAsB,CAAA;AAE7B,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA"}
package/package.json CHANGED
@@ -1,87 +1,82 @@
1
- {
2
- "name": "@es-plus/vue2",
3
- "version": "1.0.2",
4
- "description": "es-plus for Vue 2 + Element UI: configuration-driven enterprise components, sharing the same JSON config schema as @es-plus/vue3 (Vue 3 + Element Plus)",
5
- "main": "./dist/es-plus-vue2.umd.cjs",
6
- "module": "./dist/es-plus-vue2.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/es-plus-vue2.js",
11
- "require": "./dist/es-plus-vue2.umd.cjs",
12
- "types": "./dist/index.d.ts"
13
- },
14
- "./dist/style.css": "./dist/style.css"
15
- },
16
- "files": [
17
- "dist",
18
- "README.md"
19
- ],
20
- "sideEffects": [
21
- "**/*.css"
22
- ],
23
- "scripts": {
24
- "typecheck": "tsc --noEmit -p tsconfig.build.json",
25
- "build": "vite build",
26
- "prepublishOnly": "npm run typecheck && npm run build",
27
- "pretest": "vite build",
28
- "test": "vitest run",
29
- "test:watch": "vitest"
30
- },
31
- "keywords": [
32
- "vue2",
33
- "vue",
34
- "element-ui",
35
- "component-library",
36
- "form",
37
- "table",
38
- "dialog",
39
- "es-plus",
40
- "typescript",
41
- "enterprise",
42
- "config-driven",
43
- "crud",
44
- "json-schema"
45
- ],
46
- "author": "liujiaao <303363554@qq.com>",
47
- "license": "MIT",
48
- "repository": {
49
- "type": "git",
50
- "url": "https://github.com/liujiaao/es-plus.git",
51
- "directory": "packages/vue2"
52
- },
53
- "homepage": "https://liujiaao.github.io/es-plus/",
54
- "bugs": {
55
- "url": "https://github.com/liujiaao/es-plus/issues"
56
- },
57
- "publishConfig": {
58
- "access": "public",
59
- "registry": "https://registry.npmjs.org/"
60
- },
61
- "peerDependencies": {
62
- "@vue/composition-api": "^1.7.0",
63
- "element-ui": "^2.15.0",
64
- "vue": "^2.6.14"
65
- },
66
- "peerDependenciesMeta": {
67
- "@vue/composition-api": {
68
- "optional": true
69
- }
70
- },
71
- "dependencies": {
72
- "@es-plus/core": "^1.0.0",
73
- "vue-demi": "^0.14.10"
74
- },
75
- "devDependencies": {
76
- "@types/node": "^20.0.0",
77
- "@vitejs/plugin-vue2": "^2.3.0",
78
- "element-ui": "^2.15.14",
79
- "sass": "^1.70.0",
80
- "typescript": "^5.3.0",
81
- "vite": "^5.0.0",
82
- "vite-plugin-dts": "^3.7.0",
83
- "vitest": "^1.2.0",
84
- "vue": "^2.7.16",
85
- "vue-template-compiler": "^2.7.16"
86
- }
87
- }
1
+ {
2
+ "name": "@es-plus/vue2",
3
+ "version": "1.0.3",
4
+ "description": "es-plus for Vue 2 + Element UI: configuration-driven enterprise components, sharing the same JSON config schema as @es-plus/vue3 (Vue 3 + Element Plus)",
5
+ "main": "./dist/es-plus-vue2.umd.cjs",
6
+ "module": "./dist/es-plus-vue2.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/es-plus-vue2.js",
11
+ "require": "./dist/es-plus-vue2.umd.cjs",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./dist/style.css": "./dist/style.css"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md"
19
+ ],
20
+ "sideEffects": [
21
+ "**/*.css"
22
+ ],
23
+ "scripts": {
24
+ "typecheck": "tsc --noEmit -p tsconfig.build.json",
25
+ "build": "vite build",
26
+ "prepublishOnly": "npm run typecheck && npm run build",
27
+ "pretest": "vite build",
28
+ "test": "vitest run",
29
+ "test:watch": "vitest"
30
+ },
31
+ "keywords": [
32
+ "vue2",
33
+ "vue",
34
+ "element-ui",
35
+ "component-library",
36
+ "form",
37
+ "table",
38
+ "dialog",
39
+ "es-plus",
40
+ "typescript",
41
+ "enterprise",
42
+ "config-driven",
43
+ "crud",
44
+ "json-schema"
45
+ ],
46
+ "author": "liujiaao <303363554@qq.com>",
47
+ "license": "MIT",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/liujiaao/es-plus.git",
51
+ "directory": "packages/vue2"
52
+ },
53
+ "homepage": "https://liujiaao.github.io/es-plus/",
54
+ "bugs": {
55
+ "url": "https://github.com/liujiaao/es-plus/issues"
56
+ },
57
+ "publishConfig": {
58
+ "access": "public",
59
+ "registry": "https://registry.npmjs.org/"
60
+ },
61
+ "peerDependencies": {
62
+ "@vue/composition-api": "^1.7.0",
63
+ "element-ui": "^2.15.0",
64
+ "vue": "^2.6.14"
65
+ },
66
+ "dependencies": {
67
+ "@es-plus/core": "^1.0.0"
68
+ },
69
+ "devDependencies": {
70
+ "@types/node": "^20.0.0",
71
+ "@vue/composition-api": "^1.7.2",
72
+ "@vitejs/plugin-vue2": "^2.3.0",
73
+ "element-ui": "^2.15.14",
74
+ "sass": "^1.70.0",
75
+ "typescript": "^5.3.0",
76
+ "vite": "^5.0.0",
77
+ "vite-plugin-dts": "^3.7.0",
78
+ "vitest": "^1.2.0",
79
+ "vue": "^2.7.16",
80
+ "vue-template-compiler": "^2.7.16"
81
+ }
82
+ }