@widget-js/cli 1.2.5 → 1.2.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widget-js/cli",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "main": "lib/index.js",
5
5
  "author": "Neo Fu",
6
6
  "license": "MIT",
@@ -34,8 +34,8 @@
34
34
  "minimatch": "^9.0.3",
35
35
  "ora": "^6.2.0",
36
36
  "package-json": "^8.1.0",
37
- "semver": "^7.3.8",
38
37
  "prettier": "^2.8.8",
38
+ "semver": "^7.3.8",
39
39
  "shelljs": "^0.8.5",
40
40
  "ssh2-sftp-client": "^9.1.0",
41
41
  "ws": "^8.11.0",
@@ -60,9 +60,11 @@
60
60
  "tsup": "^6.5.0",
61
61
  "typescript": "^5.2.2",
62
62
  "vitest": "^0.34.6",
63
+ "vue-router": "^4.2.5",
63
64
  "webpack": "^5.75.0",
64
65
  "webpack-cli": "^5.0.0",
65
- "@widget-js/core": "0.11.12"
66
+ "@widget-js/vue3": "^0.11.20",
67
+ "@widget-js/core": "0.11.20"
66
68
  },
67
69
  "scripts": {
68
70
  "build": "rimraf ./lib/ && tsup-node src/index.ts --format esm",
@@ -1,32 +1,25 @@
1
1
  <template>
2
2
  <widget-edit-dialog :widget-params="widgetParams" :option="widgetConfigOption"
3
3
  :widget-data="widgetData"
4
- @confirm="onSaveClick()">
5
- <template v-slot:form>
6
- <!-- TODO 这里写自定义表单内容 -->
7
- </template>
4
+ @apply="save()"
5
+ @confirm="save({ closeWindow: true })">
8
6
  </widget-edit-dialog>
9
7
  </template>
10
8
 
11
9
  <script lang="ts" setup>
12
- import {useWidget, WidgetConfigOption,WidgetEditDialog} from "@widget-js/vue3";
13
- import {WidgetData, WidgetDataApi} from "@widget-js/core";
14
- import {reactive} from "vue";
10
+ import {useWidget, WidgetConfigOption, WidgetEditDialog} from "@widget-js/vue3";
11
+ import {WidgetData} from "@widget-js/core";
15
12
 
16
- const {widgetData, widgetParams} = useWidget(WidgetData)
13
+ const {widgetData, widgetParams, save} = useWidget(WidgetData)
17
14
 
18
15
  //修改成需要设置组件参数配置
19
- const widgetConfigOption = reactive(new WidgetConfigOption({
20
- custom: true,
21
- backgroundColor: true,
22
- borderRadius: true,
23
- preview: false
24
- }));
16
+ const widgetConfigOption = new WidgetConfigOption({
17
+ custom: true,
18
+ backgroundColor: true,
19
+ borderRadius: true,
20
+ preview: false
21
+ });
25
22
 
26
- const onSaveClick = async () => {
27
- await WidgetDataApi.save(widgetData);
28
- window.close();
29
- }
30
23
  </script>
31
24
 
32
25
  <style scoped>
@@ -12,7 +12,7 @@ const path = "/widget/<%= snakeCaseName %>";
12
12
  //配置页路由地址
13
13
  const configPagePath = <% if (configurable) { %>"/widget/config/<%= snakeCaseName %>"<% } else { %>undefined<% } %>;
14
14
  //组件关键词
15
- const <%= name %>WidgetDefine = new Widget({
15
+ const <%= name %>Widget = new Widget({
16
16
  name: name,
17
17
  title: title,
18
18
  description: description,
@@ -1,11 +1,12 @@
1
+ import type { RouteRecordRaw } from 'vue-router'
1
2
  import <%= name %>WidgetDefine from "./<%= name %>.widget";
2
3
 
3
4
  const path = <%= name %>WidgetDefine.path;
4
5
  const name = <%= name %>WidgetDefine.name;
5
6
  <% if (configurable) { %>
6
- const configPagePath = <%= name %>WidgetDefine.configPagePath;
7
+ const configPagePath = <%= name %>WidgetDefine.configPagePath!;
7
8
 
8
- const <%= name %>WidgetRoutes = [
9
+ const <%= name %>WidgetRoutes: RouteRecordRaw[] = [
9
10
  {
10
11
  path: path,
11
12
  name: `${name}`,
@@ -18,7 +19,7 @@ const <%= name %>WidgetRoutes = [
18
19
  }
19
20
  ]
20
21
  <% } else { %>
21
- const <%= name %>WidgetRoutes = [
22
+ const <%= name %>WidgetRoutes: RouteRecordRaw[] = [
22
23
  {
23
24
  path: path,
24
25
  name: `${name}`,
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <widget-wrapper>
3
- <!-- TODO:组件页面,这里编写组件业务逻辑-->
3
+ <span>Hello World!</span>
4
4
  </widget-wrapper>
5
5
  </template>
6
6
 
7
7
  <script lang="ts" setup>
8
8
  import {WidgetData} from "@widget-js/core";
9
- import {useWidget,WidgetWrapper} from "@widget-js/vue3";
9
+ import {useWidget} from "@widget-js/vue3";
10
10
 
11
11
  const {widgetData, widgetParams} = useWidget(WidgetData);
12
12
  </script>
@@ -1,6 +1,6 @@
1
+ import type { RouteRecordRaw } from 'vue-router'
1
2
  //FBI WANING! IMPORT PLACE, DONT DELETE THIS LINE
2
-
3
- const WidgetRouter = [
3
+ const WidgetRouter: RouteRecordRaw[] = [
4
4
  //FBI WANING! ROUTE PLACE, DONT DELETE THIS LINE
5
5
  ];
6
6
  export default WidgetRouter