@maxelms/create-plugin-cli 1.1.26 → 1.1.28

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.
Files changed (103) hide show
  1. package/package.json +1 -1
  2. package/templates/angular-micro-app/.eslintrc.js +3 -0
  3. package/templates/angular-micro-app/README.md +5 -0
  4. package/templates/angular-micro-app/examples/main.css +2 -0
  5. package/templates/angular-micro-app/examples/main.js +2 -0
  6. package/templates/angular-micro-app/examples/main.js.LICENSE.txt +52 -0
  7. package/templates/angular-micro-app/examples/playground.html +1 -0
  8. package/templates/angular-micro-app/examples/react-dom.production.min.js +2 -0
  9. package/templates/angular-micro-app/examples/react-dom.production.min.js.LICENSE.txt +8 -0
  10. package/templates/angular-micro-app/examples/react.production.min.js +2 -0
  11. package/templates/angular-micro-app/examples/react.production.min.js.LICENSE.txt +8 -0
  12. package/templates/angular-micro-app/examples/vue.runtime.global.js +9054 -0
  13. package/templates/angular-micro-app/examples/zone.umd.min.js +2 -0
  14. package/templates/angular-micro-app/examples/zone.umd.min.js.LICENSE.txt +29 -0
  15. package/templates/angular-micro-app/manifest.json.tpl +3 -0
  16. package/templates/angular-micro-app/package.json.tpl +40 -0
  17. package/templates/angular-micro-app/pnpm-lock.yaml +7998 -0
  18. package/templates/angular-micro-app/public/configuration.json +34 -0
  19. package/templates/angular-micro-app/public/index.html.tpl +15 -0
  20. package/templates/angular-micro-app/src/about.component.ts +42 -0
  21. package/templates/angular-micro-app/src/app-routing.module.ts +12 -0
  22. package/templates/angular-micro-app/src/app.component.css +22 -0
  23. package/templates/angular-micro-app/src/app.component.html +304 -0
  24. package/templates/angular-micro-app/src/app.component.ts +42 -0
  25. package/templates/angular-micro-app/src/app.module.ts +27 -0
  26. package/templates/angular-micro-app/src/contact.component.ts +42 -0
  27. package/templates/angular-micro-app/src/home.component.ts +42 -0
  28. package/templates/angular-micro-app/src/index.ts +54 -0
  29. package/templates/angular-micro-app/src/props.service.ts +18 -0
  30. package/templates/angular-micro-app/src/single-spa-props.ts +7 -0
  31. package/templates/angular-micro-app/tsconfig.json +25 -0
  32. package/templates/angular-micro-app/webpack.config.js +112 -0
  33. package/templates/angular-micro-button/.eslintrc.js +3 -0
  34. package/templates/angular-micro-button/README.md +5 -0
  35. package/templates/angular-micro-button/manifest.json.tpl +3 -0
  36. package/templates/angular-micro-button/package.json.tpl +39 -0
  37. package/templates/angular-micro-button/pnpm-lock.yaml +7977 -0
  38. package/templates/angular-micro-button/public/configuration.json +34 -0
  39. package/templates/angular-micro-button/public/index.html.tpl +15 -0
  40. package/templates/angular-micro-button/src/app.component.css +10 -0
  41. package/templates/angular-micro-button/src/app.component.html +2 -0
  42. package/templates/angular-micro-button/src/app.component.ts.tpl +38 -0
  43. package/templates/angular-micro-button/src/app.module.ts +27 -0
  44. package/templates/angular-micro-button/src/components/content.component.css +116 -0
  45. package/templates/angular-micro-button/src/components/content.component.html +3 -0
  46. package/templates/angular-micro-button/src/components/content.component.ts +16 -0
  47. package/templates/angular-micro-button/src/index.ts.tpl +107 -0
  48. package/templates/angular-micro-button/src/master-props.ts +7 -0
  49. package/templates/angular-micro-button/tsconfig.json +25 -0
  50. package/templates/angular-micro-button/webpack.config.js +112 -0
  51. package/templates/angular-micro-field/.eslintrc.js +3 -0
  52. package/templates/angular-micro-field/README.md +5 -0
  53. package/templates/angular-micro-field/examples/main.css +2 -0
  54. package/templates/angular-micro-field/examples/main.js +2 -0
  55. package/templates/angular-micro-field/examples/main.js.LICENSE.txt +52 -0
  56. package/templates/angular-micro-field/examples/playground.html +1 -0
  57. package/templates/angular-micro-field/examples/react-dom.production.min.js +2 -0
  58. package/templates/angular-micro-field/examples/react-dom.production.min.js.LICENSE.txt +8 -0
  59. package/templates/angular-micro-field/examples/react.production.min.js +2 -0
  60. package/templates/angular-micro-field/examples/react.production.min.js.LICENSE.txt +8 -0
  61. package/templates/angular-micro-field/examples/vue.runtime.global.js +9054 -0
  62. package/templates/angular-micro-field/examples/zone.umd.min.js +2 -0
  63. package/templates/angular-micro-field/examples/zone.umd.min.js.LICENSE.txt +29 -0
  64. package/templates/angular-micro-field/manifest.json.tpl +3 -0
  65. package/templates/angular-micro-field/package.json.tpl +39 -0
  66. package/templates/angular-micro-field/pnpm-lock.yaml +7977 -0
  67. package/templates/angular-micro-field/public/configuration.json +34 -0
  68. package/templates/angular-micro-field/public/index.html.tpl +15 -0
  69. package/templates/angular-micro-field/src/app.component.css +10 -0
  70. package/templates/angular-micro-field/src/app.component.html +8 -0
  71. package/templates/angular-micro-field/src/app.component.ts.tpl +60 -0
  72. package/templates/angular-micro-field/src/app.module.ts +14 -0
  73. package/templates/angular-micro-field/src/components/content.component.css +116 -0
  74. package/templates/angular-micro-field/src/components/content.component.html +10 -0
  75. package/templates/angular-micro-field/src/components/content.component.ts +21 -0
  76. package/templates/angular-micro-field/src/index.ts.tpl +101 -0
  77. package/templates/angular-micro-field/src/master-props.ts +7 -0
  78. package/templates/angular-micro-field/tsconfig.json +25 -0
  79. package/templates/angular-micro-field/webpack.config.js +112 -0
  80. package/templates/angular-micro-plugin/package.json.tpl +2 -2
  81. package/templates/react-micro-app/package.json.tpl +6 -0
  82. package/templates/react-micro-button/package.json.tpl +5 -0
  83. package/templates/react-micro-button/src/index.tsx +1 -0
  84. package/templates/react-micro-field/package.json.tpl +5 -0
  85. package/templates/react-micro-field-umi/package.json.tpl +5 -0
  86. package/templates/react-micro-plugin/package.json.tpl +5 -0
  87. package/templates/react-micro-plugin-umi/package.json.tpl +5 -0
  88. package/templates/vue-micro-button/src/main.js +1 -0
  89. package/templates/vue3-micro-button/package.json.tpl +1 -1
  90. package/templates/vue3-micro-button/src/App.vue.tpl +6 -1
  91. package/templates/vue3-micro-button/src/main.js +3 -3
  92. package/templates/vue3-micro-field/package.json.tpl +1 -1
  93. package/templates/vue3-micro-field/src/App.vue.tpl +6 -0
  94. package/templates/vue3-micro-field/src/main.js +3 -3
  95. package/templates/vue3-micro-plugin/package.json.tpl +1 -1
  96. package/templates/vue3-micro-plugin/src/App.vue.tpl +6 -0
  97. package/templates/vue3-micro-plugin/src/main.js +3 -3
  98. package/templates/vue3vite-micro-button/package.json.tpl +1 -1
  99. package/templates/vue3vite-micro-button/src/App.vue.tpl +6 -1
  100. package/templates/vue3vite-micro-button/src/main.ts +2 -2
  101. package/templates/vue3vite-micro-plugin/package.json.tpl +1 -1
  102. package/templates/vue3vite-micro-plugin/src/App.vue.tpl +6 -0
  103. package/templates/vue3vite-micro-plugin/src/main.ts +2 -2
@@ -14,7 +14,7 @@ const vms = {}
14
14
 
15
15
  const render = (props) => {
16
16
  const { containerId } = props || {}
17
- createApp(App, {
17
+ vms[containerId] = createApp(App, {
18
18
  masterProps: props || {}
19
19
  }).mount(containerId ? `#${containerId} #root` : '#root');
20
20
  }
@@ -25,8 +25,8 @@ if (poweredByMaxelms) {
25
25
  render(props)
26
26
  },
27
27
  update(props) {
28
- if (vms[props.containerId]) {
29
- vms[props.containerId].masterProps = props
28
+ if (vms[props.containerId] && vms[props.containerId].updateMasterProps) {
29
+ vms[props.containerId].updateMasterProps(props);
30
30
  }
31
31
  },
32
32
  unmount(props) {
@@ -9,7 +9,7 @@
9
9
  "lint": "vue-cli-service lint"
10
10
  },
11
11
  "dependencies": {
12
- "@maxelms/create-pulgin-api": "1.0.0",
12
+ "@maxelms/create-pulgin-api": "^1.0.0",
13
13
  "core-js": "3.6.5",
14
14
  "element-ui": "2.15.6",
15
15
  "vue": "3.0.0",
@@ -38,6 +38,12 @@ export default {
38
38
  }
39
39
  },
40
40
  computed: {
41
+ updateMasterProps(newProps) {
42
+ // 更新本地数据,这会触发响应式更新
43
+ this.localMasterProps = { ...newProps };
44
+ // 同时触发事件通知父组件
45
+ this.$emit('update:masterProps', newProps);
46
+ },
41
47
  /** value、onChange 是属性组件作为表单受控组件的必要属性 */
42
48
  value () {
43
49
  return this.masterProps?.value?.value || "欢迎使用 Maxelms 属性组件"
@@ -14,7 +14,7 @@ const vms = {}
14
14
 
15
15
  const render = (props) => {
16
16
  const { containerId } = props || {}
17
- createApp(App, {
17
+ vms[containerId] = createApp(App, {
18
18
  masterProps: props || {}
19
19
  }).mount(containerId ? `#${containerId} #root` : '#root');
20
20
  }
@@ -25,8 +25,8 @@ if (poweredByMaxelms) {
25
25
  render(props)
26
26
  },
27
27
  update(props) {
28
- if (vms[props.containerId]) {
29
- vms[props.containerId].masterProps = props
28
+ if (vms[props.containerId] && vms[props.containerId].updateMasterProps) {
29
+ vms[props.containerId].updateMasterProps(props);
30
30
  }
31
31
  },
32
32
  unmount(props) {
@@ -9,7 +9,7 @@
9
9
  "lint": "vue-cli-service lint"
10
10
  },
11
11
  "dependencies": {
12
- "@maxelms/create-pulgin-api": "1.0.0",
12
+ "@maxelms/create-pulgin-api": "^1.0.0",
13
13
  "core-js": "3.6.5",
14
14
  "element-ui": "2.15.6",
15
15
  "vue": "3.0.0",
@@ -31,6 +31,12 @@ export default {
31
31
 
32
32
  },
33
33
  computed: {
34
+ updateMasterProps(newProps) {
35
+ // 更新本地数据,这会触发响应式更新
36
+ this.localMasterProps = { ...newProps };
37
+ // 同时触发事件通知父组件
38
+ this.$emit('update:masterProps', newProps);
39
+ },
34
40
  /** 是否禁用 */
35
41
  disabled () {
36
42
  return this.masterProps?.configurations?.propName3
@@ -14,7 +14,7 @@ const vms = {}
14
14
 
15
15
  const render = (props) => {
16
16
  const { containerId } = props || {}
17
- createApp(App, {
17
+ vms[containerId] = createApp(App, {
18
18
  masterProps: props || {}
19
19
  }).mount(containerId ? `#${containerId} #root` : '#root');
20
20
  }
@@ -25,8 +25,8 @@ if (poweredByMaxelms) {
25
25
  render(props)
26
26
  },
27
27
  update(props) {
28
- if (vms[props.containerId]) {
29
- vms[props.containerId].masterProps = props
28
+ if (vms[props.containerId] && vms[props.containerId].updateMasterProps) {
29
+ vms[props.containerId].updateMasterProps(props);
30
30
  }
31
31
  },
32
32
  unmount(props) {
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@esbuild/darwin-arm64": "0.24.0",
19
- "@maxelms/create-pulgin-api": "1.0.0",
19
+ "@maxelms/create-pulgin-api": "^1.0.0",
20
20
  "@rollup/rollup-darwin-arm64": "4.28.1",
21
21
  "pinia": "2.2.6",
22
22
  "vue": "3.5.13",
@@ -22,7 +22,12 @@ export default {
22
22
 
23
23
  },
24
24
  methods: {
25
-
25
+ updateMasterProps(newProps) {
26
+ // 更新本地数据,这会触发响应式更新
27
+ this.localMasterProps = { ...newProps };
28
+ // 同时触发事件通知父组件
29
+ this.$emit('update:masterProps', newProps);
30
+ },
26
31
  },
27
32
  created() {
28
33
 
@@ -15,8 +15,8 @@ if (poweredByMaxelms && registerPlugin) {
15
15
  render(props)
16
16
  },
17
17
  update(props) {
18
- if (vms[props.containerId]) {
19
- vms[props.containerId].masterProps = props
18
+ if (vms[props.containerId] && vms[props.containerId].updateMasterProps) {
19
+ vms[props.containerId].updateMasterProps(props);
20
20
  }
21
21
  },
22
22
  unmount(props) {
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@esbuild/darwin-arm64": "0.24.0",
19
- "@maxelms/create-pulgin-api": "1.0.0",
19
+ "@maxelms/create-pulgin-api": "^1.0.0",
20
20
  "@rollup/rollup-darwin-arm64": "4.28.1",
21
21
  "pinia": "2.2.6",
22
22
  "vue": "3.5.13",
@@ -21,6 +21,12 @@ export default {
21
21
 
22
22
  },
23
23
  computed: {
24
+ updateMasterProps(newProps) {
25
+ // 更新本地数据,这会触发响应式更新
26
+ this.localMasterProps = { ...newProps };
27
+ // 同时触发事件通知父组件
28
+ this.$emit('update:masterProps', newProps);
29
+ },
24
30
  /** 是否禁用 */
25
31
  disabled () {
26
32
  return this.$root?.masterProps?.configurations?.propName3
@@ -15,8 +15,8 @@ if (poweredByMaxelms && registerPlugin) {
15
15
  render(props)
16
16
  },
17
17
  update(props) {
18
- if (vms[props.containerId]) {
19
- vms[props.containerId].masterProps = props
18
+ if (vms[props.containerId] && vms[props.containerId].updateMasterProps) {
19
+ vms[props.containerId].updateMasterProps(props);
20
20
  }
21
21
  },
22
22
  unmount(props) {