@widget-js/cli 24.1.1-beta.10 → 24.1.1-beta.16

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.
@@ -178,14 +178,14 @@ async function createWidget() {
178
178
  const routeStr = `...${name}WidgetRoutes,`;
179
179
  if (!routeContent.includes(importRouteStr)) {
180
180
  routeContent = routeContent.replaceAll(
181
- "//FBI WANING! IMPORT PLACE",
181
+ "// FBI WANING! IMPORT PLACE",
182
182
  `${importRouteStr}
183
183
  //FBI WANING! IMPORT PLACE`
184
184
  );
185
185
  }
186
186
  if (!routeContent.includes(routeStr)) {
187
- routeContent = routeContent.replaceAll("//FBI WANING! ROUTE PLACE", `${routeStr}
188
- //FBI WANING! ROUTE PLACE`);
187
+ routeContent = routeContent.replaceAll("// FBI WANING! ROUTE PLACE", `${routeStr}
188
+ // FBI WANING! ROUTE PLACE`);
189
189
  }
190
190
  fs.writeFileSync(routeFile, routeContent);
191
191
  const gitAdd = `git add ${widgetDir}`;
package/lib/index.js CHANGED
@@ -11,7 +11,7 @@ var cliPackage = JSON.parse(fs.readFileSync(packageJsonPath).toString());
11
11
  console.log(gradient.pastel.multiline(figlet.textSync("widget-cli", { horizontalLayout: "full" })));
12
12
  program.version(`@widget-js/cli ${cliPackage.version}`).usage("<command> [options]");
13
13
  program.command("create").description("Create new widget").action(async () => {
14
- const createWidget = await import("./createWidget-4LQ6PVEM.js");
14
+ const createWidget = await import("./createWidget-EBGZI7JV.js");
15
15
  await createWidget.default();
16
16
  });
17
17
  var dependenciesOption = new Option("-t, --type <type>").choices(["remote", "local"]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@widget-js/cli",
3
3
  "type": "module",
4
- "version": "24.1.1-beta.10",
4
+ "version": "24.1.1-beta.16",
5
5
  "private": false,
6
6
  "author": "Neo Fu",
7
7
  "license": "MIT",
@@ -76,7 +76,7 @@
76
76
  },
77
77
  "scripts": {
78
78
  "build": "rimraf ./lib/ && tsup-node src/index.ts --format esm",
79
- "watch": "tsup src/index.ts --format esm --watch",
79
+ "watch": "tsup-node src/index.ts --format esm --watch",
80
80
  "build:run": "npm run build && npm run widget",
81
81
  "widget": "node ./lib/index.js",
82
82
  "widget:ftp": "node ./lib/index.js release -t ftp",
@@ -88,6 +88,7 @@
88
88
  "pnpm:publish": "pnpm publish --no-git-checks",
89
89
  "remote": "widget dependencies -t remote && pnpm install",
90
90
  "local": "widget dependencies -t local && pnpm install",
91
+ "link": "pnpm link . -g",
91
92
  "lint": "eslint .",
92
93
  "lint:fix": "eslint . --fix"
93
94
  }
@@ -212,12 +212,12 @@ export default async function createWidget() {
212
212
  const routeStr = `...${name}WidgetRoutes,`
213
213
  if (!routeContent.includes(importRouteStr)) {
214
214
  routeContent = routeContent.replaceAll(
215
- '//FBI WANING! IMPORT PLACE',
215
+ '// FBI WANING! IMPORT PLACE',
216
216
  `${importRouteStr}\n//FBI WANING! IMPORT PLACE`,
217
217
  )
218
218
  }
219
219
  if (!routeContent.includes(routeStr)) {
220
- routeContent = routeContent.replaceAll('//FBI WANING! ROUTE PLACE', `${routeStr}\n //FBI WANING! ROUTE PLACE`)
220
+ routeContent = routeContent.replaceAll('// FBI WANING! ROUTE PLACE', `${routeStr}\n // FBI WANING! ROUTE PLACE`)
221
221
  }
222
222
 
223
223
  fs.writeFileSync(routeFile, routeContent)
@@ -1,16 +1,12 @@
1
1
  <template>
2
- <widget-edit-dialog :widget-params="widgetParams" :option="widgetConfigOption"
3
- v-model="widgetData"
4
- @apply="save()"
5
- @confirm="save({ closeWindow: true })">
2
+ <widget-edit-dialog :widget-params="widgetParams" :option="widgetConfigOption">
6
3
  </widget-edit-dialog>
7
4
  </template>
8
5
 
9
6
  <script lang="ts" setup>
10
7
  import {useWidget, WidgetConfigOption} from "@widget-js/vue3";
11
- import {WidgetData} from "@widget-js/core";
12
8
 
13
- const {widgetData, widgetParams, save} = useWidget(WidgetData)
9
+ const {widgetParams } = useWidget()
14
10
 
15
11
  //修改成需要设置组件参数配置
16
12
  const widgetConfigOption = new WidgetConfigOption({
@@ -5,6 +5,7 @@ name: "<%= widgetName %>",
5
5
  title: {"zh-CN": "<%= title %>"},
6
6
  description: {"zh-CN": ""},
7
7
  keywords: [WidgetKeyword.RECOMMEND],
8
+ categories: [],
8
9
  lang: "zh-CN",
9
10
  width: <%= width %>,
10
11
  height: <%= height %>,
@@ -14,7 +15,7 @@ minHeight: <%= minHeight %>,
14
15
  maxHeight: <%= maxHeight %>,
15
16
  previewImage: "修改为组件预览图地址",
16
17
  path: "/widget/<%= snakeCaseName %>",
17
- configPagePath: <% if (configurable) { %>"/widget/config/<%= snakeCaseName %>"<% } else { %>undefined<% } %>
18
+ configPagePath: <% if (configurable) { %>"/widget/config/<%= snakeCaseName %>?width=600&height=500&frame=true&transparent=false"<% } else { %>undefined<% } %>
18
19
  })
19
20
 
20
21
  export default <%= name %>Widget;
@@ -4,7 +4,7 @@ import <%= name %>Widget from "./<%= name %>.widget";
4
4
  const path = <%= name %>Widget.path;
5
5
  const name = <%= name %>Widget.name;
6
6
  <% if (configurable) { %>
7
- const configPagePath = <%= name %>Widget.configPagePath!;
7
+ const configPagePath = <%= name %>Widget.configPagePath!.split('?')[0];
8
8
 
9
9
  const <%= name %>WidgetRoutes: RouteRecordRaw[] = [
10
10
  {