@sybz-components/utils 1.0.7 → 1.0.8

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/dist/base.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  require('vue');
4
4
  require('consola');
5
5
  require('es-toolkit');
6
- const format = require('./shared/utils.CQ_8FikI.cjs');
6
+ const format = require('./shared/utils.DgGGZO3M.cjs');
7
7
  require('element-plus');
8
8
  require('./is.cjs');
9
9
 
package/dist/base.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'vue';
2
2
  import 'consola';
3
3
  import 'es-toolkit';
4
- export { $ as $toast, c as clearStorage, a as clone, b as configureUtils, d as confirm, e as copy, f as debounce, g as delay, h as getStorage, i as getType, j as getUtilsBuildTime, k as getVariable, l as isEmpty, m as log, n as merge, o as mockValue, p as processWidth, r as random, s as setStorage, t as test, q as throttle, u as toLine, v as tryCatch, w as validate, x as validateForm, y as validateOnSubmit } from './shared/utils.DvUjmqr2.mjs';
4
+ export { $ as $toast, c as clearStorage, a as clone, b as configureUtils, d as confirm, e as copy, f as debounce, g as delay, h as getStorage, i as getType, j as getUtilsBuildTime, k as getVariable, l as isEmpty, m as log, n as merge, o as mockValue, p as processWidth, r as random, s as setStorage, t as test, q as throttle, u as toLine, v as tryCatch, w as validate, x as validateForm, y as validateOnSubmit } from './shared/utils.D9a8F_tn.mjs';
5
5
  import 'element-plus';
6
6
  import './is.mjs';
package/dist/format.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const format = require('./shared/utils.CQ_8FikI.cjs');
3
+ const format = require('./shared/utils.DgGGZO3M.cjs');
4
4
  require('./is.cjs');
5
5
  require('consola');
6
6
  require('vue');
package/dist/format.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { z as formatBytes, A as formatBytesConvert, B as formatDurationTime, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed } from './shared/utils.DvUjmqr2.mjs';
1
+ export { z as formatBytes, A as formatBytesConvert, B as formatDurationTime, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed } from './shared/utils.D9a8F_tn.mjs';
2
2
  import './is.mjs';
3
3
  import 'consola';
4
4
  import 'vue';
@@ -86,7 +86,14 @@ const createClientCode = (info, defaultLimit, autoPrint, expanded) => `
86
86
  window.b = (limit = ${defaultLimit}) => {
87
87
  const commits = info.commits.slice(0, normalizeLimit(limit));
88
88
  const latestCommit = commits[0] || info.commits[0] || {};
89
- console.${expanded ? "group" : "groupCollapsed"}('[build git info]');
89
+ const summary = [
90
+ '[build git info]',
91
+ formatDateTime(info.buildTime) || '-',
92
+ latestCommit.shortHash || '-',
93
+ latestCommit.authorName || '-',
94
+ latestCommit.message || '-',
95
+ ].join(' \xB7 ');
96
+ console.${expanded ? "group" : "groupCollapsed"}(summary);
90
97
  console.table({
91
98
  authorName: latestCommit.authorName || '-',
92
99
  buildTime: formatDateTime(info.buildTime),
@@ -132,7 +139,7 @@ const gitCommitLog = (options = {}) => {
132
139
  return [
133
140
  {
134
141
  tag: "script",
135
- children: createClientCode(info, defaultLimit, options.autoPrint ?? false, options.expanded ?? false),
142
+ children: createClientCode(info, defaultLimit, options.autoPrint ?? true, options.expanded ?? true),
136
143
  injectTo: "head-prepend"
137
144
  }
138
145
  ];
@@ -33,9 +33,9 @@ interface GitCommitLogOptions {
33
33
  maxCommits?: number;
34
34
  /** 调用 b() 时默认展示的提交数量,默认 10。 */
35
35
  defaultLimit?: number;
36
- /** 页面加载后自动打印;传数字时同时指定打印条数,默认 false。 */
36
+ /** 页面加载后自动打印;传数字时同时指定打印条数,默认 true。 */
37
37
  autoPrint?: boolean | number;
38
- /** 打印后是否默认展开控制台分组,默认 false。 */
38
+ /** 打印后是否默认展开控制台分组,默认 true。 */
39
39
  expanded?: boolean;
40
40
  }
41
41
  declare global {
@@ -46,7 +46,7 @@ declare global {
46
46
  }
47
47
  }
48
48
  /**
49
- * 为 Vite 项目注册 Git 提交记录调试工具。页面加载后可在控制台调用 `b()` 查看。
49
+ * 为 Vite 项目注册 Git 提交记录调试工具。页面加载后默认打印,也可调用 `b()` 再次查看。
50
50
  */
51
51
  declare const gitCommitLog: (options?: GitCommitLogOptions) => Plugin;
52
52
 
@@ -33,9 +33,9 @@ interface GitCommitLogOptions {
33
33
  maxCommits?: number;
34
34
  /** 调用 b() 时默认展示的提交数量,默认 10。 */
35
35
  defaultLimit?: number;
36
- /** 页面加载后自动打印;传数字时同时指定打印条数,默认 false。 */
36
+ /** 页面加载后自动打印;传数字时同时指定打印条数,默认 true。 */
37
37
  autoPrint?: boolean | number;
38
- /** 打印后是否默认展开控制台分组,默认 false。 */
38
+ /** 打印后是否默认展开控制台分组,默认 true。 */
39
39
  expanded?: boolean;
40
40
  }
41
41
  declare global {
@@ -46,7 +46,7 @@ declare global {
46
46
  }
47
47
  }
48
48
  /**
49
- * 为 Vite 项目注册 Git 提交记录调试工具。页面加载后可在控制台调用 `b()` 查看。
49
+ * 为 Vite 项目注册 Git 提交记录调试工具。页面加载后默认打印,也可调用 `b()` 再次查看。
50
50
  */
51
51
  declare const gitCommitLog: (options?: GitCommitLogOptions) => Plugin;
52
52
 
@@ -33,9 +33,9 @@ interface GitCommitLogOptions {
33
33
  maxCommits?: number;
34
34
  /** 调用 b() 时默认展示的提交数量,默认 10。 */
35
35
  defaultLimit?: number;
36
- /** 页面加载后自动打印;传数字时同时指定打印条数,默认 false。 */
36
+ /** 页面加载后自动打印;传数字时同时指定打印条数,默认 true。 */
37
37
  autoPrint?: boolean | number;
38
- /** 打印后是否默认展开控制台分组,默认 false。 */
38
+ /** 打印后是否默认展开控制台分组,默认 true。 */
39
39
  expanded?: boolean;
40
40
  }
41
41
  declare global {
@@ -46,7 +46,7 @@ declare global {
46
46
  }
47
47
  }
48
48
  /**
49
- * 为 Vite 项目注册 Git 提交记录调试工具。页面加载后可在控制台调用 `b()` 查看。
49
+ * 为 Vite 项目注册 Git 提交记录调试工具。页面加载后默认打印,也可调用 `b()` 再次查看。
50
50
  */
51
51
  declare const gitCommitLog: (options?: GitCommitLogOptions) => Plugin;
52
52
 
@@ -84,7 +84,14 @@ const createClientCode = (info, defaultLimit, autoPrint, expanded) => `
84
84
  window.b = (limit = ${defaultLimit}) => {
85
85
  const commits = info.commits.slice(0, normalizeLimit(limit));
86
86
  const latestCommit = commits[0] || info.commits[0] || {};
87
- console.${expanded ? "group" : "groupCollapsed"}('[build git info]');
87
+ const summary = [
88
+ '[build git info]',
89
+ formatDateTime(info.buildTime) || '-',
90
+ latestCommit.shortHash || '-',
91
+ latestCommit.authorName || '-',
92
+ latestCommit.message || '-',
93
+ ].join(' \xB7 ');
94
+ console.${expanded ? "group" : "groupCollapsed"}(summary);
88
95
  console.table({
89
96
  authorName: latestCommit.authorName || '-',
90
97
  buildTime: formatDateTime(info.buildTime),
@@ -130,7 +137,7 @@ const gitCommitLog = (options = {}) => {
130
137
  return [
131
138
  {
132
139
  tag: "script",
133
- children: createClientCode(info, defaultLimit, options.autoPrint ?? false, options.expanded ?? false),
140
+ children: createClientCode(info, defaultLimit, options.autoPrint ?? true, options.expanded ?? true),
134
141
  injectTo: "head-prepend"
135
142
  }
136
143
  ];
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const format = require('./shared/utils.CQ_8FikI.cjs');
3
+ const format = require('./shared/utils.DgGGZO3M.cjs');
4
4
  const is = require('./is.cjs');
5
5
  require('vue');
6
6
  require('consola');
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { $ as $toast, c as clearStorage, a as clone, b as configureUtils, d as confirm, e as copy, f as debounce, g as delay, z as formatBytes, A as formatBytesConvert, B as formatDurationTime, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed, h as getStorage, i as getType, j as getUtilsBuildTime, k as getVariable, l as isEmpty, m as log, n as merge, o as mockValue, p as processWidth, r as random, s as setStorage, t as test, q as throttle, u as toLine, v as tryCatch, w as validate, x as validateForm, y as validateOnSubmit } from './shared/utils.DvUjmqr2.mjs';
1
+ export { $ as $toast, c as clearStorage, a as clone, b as configureUtils, d as confirm, e as copy, f as debounce, g as delay, z as formatBytes, A as formatBytesConvert, B as formatDurationTime, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed, h as getStorage, i as getType, j as getUtilsBuildTime, k as getVariable, l as isEmpty, m as log, n as merge, o as mockValue, p as processWidth, r as random, s as setStorage, t as test, q as throttle, u as toLine, v as tryCatch, w as validate, x as validateForm, y as validateOnSubmit } from './shared/utils.D9a8F_tn.mjs';
2
2
  export { isArray, isBoolean, isComponent, isDate, isEmptyObject, isFunction, isIOS, isMap, isNumber, isObject, isPlainObject, isPromise, isRegExp, isSVGElement, isSet, isString, isStringNumber, isSymbol, isUrl, objectToString, toRawType, toTypeString } from './is.mjs';
3
3
  import 'vue';
4
4
  import 'consola';
@@ -1064,7 +1064,7 @@ function getVariable(propertyName, fallback = "") {
1064
1064
  const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
1065
1065
  function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
1066
1066
  {
1067
- return "2026-08-18 17:59:46";
1067
+ return "2026-08-24 10:43:21";
1068
1068
  }
1069
1069
  }
1070
1070
  function test() {
@@ -1066,7 +1066,7 @@ function getVariable(propertyName, fallback = "") {
1066
1066
  const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
1067
1067
  function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
1068
1068
  {
1069
- return "2026-08-18 17:59:46";
1069
+ return "2026-08-24 10:43:21";
1070
1070
  }
1071
1071
  }
1072
1072
  function test() {
package/dist/vite.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CodeInspectorPluginOptions } from 'code-inspector-plugin';
2
- import { Plugin } from 'vite';
2
+ import { PluginOption } from 'vite';
3
3
  import { GitCommitLogOptions } from './gitCommitLog.cjs';
4
4
 
5
5
  declare global {
@@ -18,8 +18,11 @@ interface SybzVitePluginsOptions {
18
18
  metaName?: string;
19
19
  };
20
20
  }
21
- /** 创建 sybz 项目的 Vite 插件预设,默认包含代码定位和 Git 提交信息。 */
22
- declare const sybzVitePlugins: (options?: SybzVitePluginsOptions) => Plugin[];
21
+ /**
22
+ * 创建 sybz 项目的 Vite 插件预设,默认包含代码定位、Git 提交信息和打包时间。
23
+ * Vite 会自动扁平化插件数组,推荐直接写入 plugins,无需展开运算符。
24
+ */
25
+ declare const sybzVitePlugins: (options?: SybzVitePluginsOptions) => PluginOption;
23
26
 
24
27
  export { sybzVitePlugins };
25
28
  export type { SybzCodeInspectorOptions, SybzVitePluginsOptions };
package/dist/vite.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CodeInspectorPluginOptions } from 'code-inspector-plugin';
2
- import { Plugin } from 'vite';
2
+ import { PluginOption } from 'vite';
3
3
  import { GitCommitLogOptions } from './gitCommitLog.mjs';
4
4
 
5
5
  declare global {
@@ -18,8 +18,11 @@ interface SybzVitePluginsOptions {
18
18
  metaName?: string;
19
19
  };
20
20
  }
21
- /** 创建 sybz 项目的 Vite 插件预设,默认包含代码定位和 Git 提交信息。 */
22
- declare const sybzVitePlugins: (options?: SybzVitePluginsOptions) => Plugin[];
21
+ /**
22
+ * 创建 sybz 项目的 Vite 插件预设,默认包含代码定位、Git 提交信息和打包时间。
23
+ * Vite 会自动扁平化插件数组,推荐直接写入 plugins,无需展开运算符。
24
+ */
25
+ declare const sybzVitePlugins: (options?: SybzVitePluginsOptions) => PluginOption;
23
26
 
24
27
  export { sybzVitePlugins };
25
28
  export type { SybzCodeInspectorOptions, SybzVitePluginsOptions };
package/dist/vite.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CodeInspectorPluginOptions } from 'code-inspector-plugin';
2
- import { Plugin } from 'vite';
2
+ import { PluginOption } from 'vite';
3
3
  import { GitCommitLogOptions } from './gitCommitLog.js';
4
4
 
5
5
  declare global {
@@ -18,8 +18,11 @@ interface SybzVitePluginsOptions {
18
18
  metaName?: string;
19
19
  };
20
20
  }
21
- /** 创建 sybz 项目的 Vite 插件预设,默认包含代码定位和 Git 提交信息。 */
22
- declare const sybzVitePlugins: (options?: SybzVitePluginsOptions) => Plugin[];
21
+ /**
22
+ * 创建 sybz 项目的 Vite 插件预设,默认包含代码定位、Git 提交信息和打包时间。
23
+ * Vite 会自动扁平化插件数组,推荐直接写入 plugins,无需展开运算符。
24
+ */
25
+ declare const sybzVitePlugins: (options?: SybzVitePluginsOptions) => PluginOption;
23
26
 
24
27
  export { sybzVitePlugins };
25
28
  export type { SybzCodeInspectorOptions, SybzVitePluginsOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sybz-components/utils",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "utils of sybz-components",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",