@widget-js/cli 1.2.4 → 1.2.6

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/lib/index.js CHANGED
@@ -26,7 +26,7 @@ program.command("init").description("Initialize widget-js project").action(async
26
26
  var typeOption = new Option("-t, --type <type>").choices(["ftp", "oss"]);
27
27
  var fileOption = new Option("-f, --file <file>");
28
28
  program.command("release").description("\u901A\u8FC7FTP/OSS\u53D1\u5E03\u6587\u4EF6\uFF0C\u4EC5\u5185\u90E8\u4F7F\u7528").addOption(typeOption).addOption(fileOption).action(async (options, command) => {
29
- let release = await import("./release-NJG7IUNP.js");
29
+ let release = await import("./release-XUYU5WNC.js");
30
30
  await release.default(options);
31
31
  });
32
32
  program.parse(process.argv);
@@ -198,14 +198,14 @@ var release = async (options) => {
198
198
  updateWindowsApi: false,
199
199
  downloadLink: ""
200
200
  };
201
- let installerPath = path2.join(`./packaged/widgets-${version}-setup-win-x64.exe`);
201
+ let installerPath = path2.join(`./dist/widgets-${version}-setup-win-x64.exe`);
202
202
  if (!fs4.existsSync(installerPath)) {
203
- installerPath = path2.join(`./packaged/electron-${version}-setup-win-x64.exe`);
203
+ installerPath = path2.join(`./dist/electron-${version}-setup-win-x64.exe`);
204
204
  }
205
205
  if (!fs4.existsSync(installerPath)) {
206
- installerPath = path2.join(`./packaged/app-${version}-setup-win-x64.exe`);
206
+ installerPath = path2.join(`./dist/app-${version}-setup-win-x64.exe`);
207
207
  }
208
- const updateZipPath = path2.join(`./packaged/update.zip`);
208
+ const updateZipPath = path2.join(`./dist/update.zip`);
209
209
  console.log(chalk2.blue("\u538B\u7F29\u66F4\u65B0\u6587\u4EF6\u4E2D"));
210
210
  await update_zip_default("./release", updateZipPath);
211
211
  console.log(chalk2.blue("\u4E0A\u4F20installer.exe\u5230OSS"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widget-js/cli",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "main": "lib/index.js",
5
5
  "author": "Neo Fu",
6
6
  "license": "MIT",
@@ -34,12 +34,12 @@
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",
42
- "@widget-js/utils": "0.7.19"
42
+ "@widget-js/utils": "0.10.21"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/ali-oss": "^6.16.7",
@@ -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.10.19"
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",
@@ -73,6 +75,6 @@
73
75
  "widget:init": "node ./lib/index.js init",
74
76
  "widget:create": "npm run build && node ./lib/index.js create",
75
77
  "widget:local": "npm run build && node ./lib/index.js dependencies -t local",
76
- "pnpm:publish": "pnpm publish --no-git-checks"
78
+ "pnpm:publish": "npm run build && pnpm publish --no-git-checks"
77
79
  }
78
80
  }
@@ -45,14 +45,14 @@ const release = async (options: any) => {
45
45
  downloadLink: '',
46
46
  }
47
47
 
48
- let installerPath = path.join(`./packaged/widgets-${version}-setup-win-x64.exe`)
48
+ let installerPath = path.join(`./dist/widgets-${version}-setup-win-x64.exe`)
49
49
  if (!fs.existsSync(installerPath)) {
50
- installerPath = path.join(`./packaged/electron-${version}-setup-win-x64.exe`)
50
+ installerPath = path.join(`./dist/electron-${version}-setup-win-x64.exe`)
51
51
  }
52
52
  if (!fs.existsSync(installerPath)) {
53
- installerPath = path.join(`./packaged/app-${version}-setup-win-x64.exe`)
53
+ installerPath = path.join(`./dist/app-${version}-setup-win-x64.exe`)
54
54
  }
55
- const updateZipPath = path.join(`./packaged/update.zip`)
55
+ const updateZipPath = path.join(`./dist/update.zip`)
56
56
 
57
57
  console.log(chalk.blue('压缩更新文件中'))
58
58
  await zipDirectory('./release', updateZipPath)
@@ -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
+ <!-- TODO:这里编写组件页面-->
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