g-ui-web 1.4.40 → 1.4.41

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.
@@ -88,6 +88,8 @@ var init = WebAssembly.compile(E()).then(WebAssembly.instantiate).then(({ export
88
88
  });
89
89
 
90
90
  // packages/plugins/component-usage.ts
91
+ var import_fs = require("fs");
92
+ var import_path = require("path");
91
93
  function componentUsagePlugin(options = {}) {
92
94
  const { libraryName = "", reportUrl = "", extraData = {}, enableInDev = false } = options;
93
95
  const importStats = {
@@ -199,15 +201,11 @@ function componentUsagePlugin(options = {}) {
199
201
  topComponents: [...importStats.componentCount.entries()].sort((a, b) => b[1] - a[1]).slice(0, 20).map(([name, count]) => ({ name, count })),
200
202
  ...extraData
201
203
  };
202
- console.log("\n\u{1F4CA} \u7EC4\u4EF6\u5F15\u7528\u7EDF\u8BA1:");
203
- console.log(` \u7EC4\u4EF6\u5E93: ${libraryName}`);
204
- console.log(` \u603B\u5F15\u7528\u6B21\u6570: ${reportData.summary.totalImports}`);
205
- console.log(` \u4F7F\u7528\u7684\u7EC4\u4EF6\u6570: ${reportData.summary.uniqueComponents}`);
206
- console.log(` \u6D89\u53CA\u6587\u4EF6\u6570: ${reportData.summary.filesWithImports}`);
207
- console.log("\n Top 10 \u7EC4\u4EF6:");
208
- reportData.topComponents.slice(0, 10).forEach((item, index) => {
209
- console.log(` ${index + 1}. ${item.name}: ${item.count} \u6B21`);
210
- });
204
+ const outputPath = (0, import_path.resolve)(process.cwd(), "component-usage-report.json");
205
+ (0, import_fs.mkdirSync)((0, import_path.dirname)(outputPath), { recursive: true });
206
+ (0, import_fs.writeFileSync)(outputPath, JSON.stringify(reportData, null, 2), "utf-8");
207
+ console.log(`
208
+ \u{1F4CA} \u7EC4\u4EF6\u5F15\u7528\u7EDF\u8BA1\u62A5\u544A\u5DF2\u751F\u6210: ${outputPath}`);
211
209
  if (reportUrl) {
212
210
  try {
213
211
  const response = await fetch(reportUrl, {
@@ -62,6 +62,8 @@ var init = WebAssembly.compile(E()).then(WebAssembly.instantiate).then(({ export
62
62
  });
63
63
 
64
64
  // packages/plugins/component-usage.ts
65
+ import { writeFileSync, mkdirSync } from "fs";
66
+ import { resolve, dirname } from "path";
65
67
  function componentUsagePlugin(options = {}) {
66
68
  const { libraryName = "", reportUrl = "", extraData = {}, enableInDev = false } = options;
67
69
  const importStats = {
@@ -173,15 +175,11 @@ function componentUsagePlugin(options = {}) {
173
175
  topComponents: [...importStats.componentCount.entries()].sort((a, b) => b[1] - a[1]).slice(0, 20).map(([name, count]) => ({ name, count })),
174
176
  ...extraData
175
177
  };
176
- console.log("\n\u{1F4CA} \u7EC4\u4EF6\u5F15\u7528\u7EDF\u8BA1:");
177
- console.log(` \u7EC4\u4EF6\u5E93: ${libraryName}`);
178
- console.log(` \u603B\u5F15\u7528\u6B21\u6570: ${reportData.summary.totalImports}`);
179
- console.log(` \u4F7F\u7528\u7684\u7EC4\u4EF6\u6570: ${reportData.summary.uniqueComponents}`);
180
- console.log(` \u6D89\u53CA\u6587\u4EF6\u6570: ${reportData.summary.filesWithImports}`);
181
- console.log("\n Top 10 \u7EC4\u4EF6:");
182
- reportData.topComponents.slice(0, 10).forEach((item, index) => {
183
- console.log(` ${index + 1}. ${item.name}: ${item.count} \u6B21`);
184
- });
178
+ const outputPath = resolve(process.cwd(), "component-usage-report.json");
179
+ mkdirSync(dirname(outputPath), { recursive: true });
180
+ writeFileSync(outputPath, JSON.stringify(reportData, null, 2), "utf-8");
181
+ console.log(`
182
+ \u{1F4CA} \u7EC4\u4EF6\u5F15\u7528\u7EDF\u8BA1\u62A5\u544A\u5DF2\u751F\u6210: ${outputPath}`);
185
183
  if (reportUrl) {
186
184
  try {
187
185
  const response = await fetch(reportUrl, {
@@ -187,7 +187,7 @@ declare function __VLS_template(): {
187
187
  contentRef: Ref<HTMLElement | undefined>;
188
188
  triggeringElementRef: Ref<any>;
189
189
  referenceElementRef: Ref<any>;
190
- }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("command" | "click" | "visible-change")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, {
190
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("click" | "visible-change" | "command")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, {
191
191
  readonly disabled: boolean;
192
192
  readonly maxHeight: string | number;
193
193
  readonly size: string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "g-ui-web",
3
3
  "private": false,
4
4
  "description": "可视化组件库",
5
- "version": "1.4.40",
5
+ "version": "1.4.41",
6
6
  "author": "wyu",
7
7
  "license": "MIT",
8
8
  "type": "module",