@sybz-components/utils 1.0.7 → 1.0.9
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 +1 -1
- package/dist/base.mjs +1 -1
- package/dist/format.cjs +1 -1
- package/dist/format.mjs +1 -1
- package/dist/gitCommitLog.cjs +9 -2
- package/dist/gitCommitLog.d.cts +2 -2
- package/dist/gitCommitLog.d.mts +2 -2
- package/dist/gitCommitLog.d.ts +2 -2
- package/dist/gitCommitLog.mjs +9 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{utils.DvUjmqr2.mjs → utils.Co6HoBFm.mjs} +1 -1
- package/dist/shared/{utils.CQ_8FikI.cjs → utils.Y29JLBLz.cjs} +1 -1
- package/dist/vite.d.cts +6 -3
- package/dist/vite.d.mts +6 -3
- package/dist/vite.d.ts +6 -3
- package/package.json +1 -1
package/dist/base.cjs
CHANGED
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.
|
|
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.Co6HoBFm.mjs';
|
|
5
5
|
import 'element-plus';
|
|
6
6
|
import './is.mjs';
|
package/dist/format.cjs
CHANGED
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.
|
|
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.Co6HoBFm.mjs';
|
|
2
2
|
import './is.mjs';
|
|
3
3
|
import 'consola';
|
|
4
4
|
import 'vue';
|
package/dist/gitCommitLog.cjs
CHANGED
|
@@ -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
|
-
|
|
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 ??
|
|
142
|
+
children: createClientCode(info, defaultLimit, options.autoPrint ?? true, options.expanded ?? false),
|
|
136
143
|
injectTo: "head-prepend"
|
|
137
144
|
}
|
|
138
145
|
];
|
package/dist/gitCommitLog.d.cts
CHANGED
|
@@ -33,7 +33,7 @@ interface GitCommitLogOptions {
|
|
|
33
33
|
maxCommits?: number;
|
|
34
34
|
/** 调用 b() 时默认展示的提交数量,默认 10。 */
|
|
35
35
|
defaultLimit?: number;
|
|
36
|
-
/** 页面加载后自动打印;传数字时同时指定打印条数,默认
|
|
36
|
+
/** 页面加载后自动打印;传数字时同时指定打印条数,默认 true。 */
|
|
37
37
|
autoPrint?: boolean | number;
|
|
38
38
|
/** 打印后是否默认展开控制台分组,默认 false。 */
|
|
39
39
|
expanded?: boolean;
|
|
@@ -46,7 +46,7 @@ declare global {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* 为 Vite 项目注册 Git
|
|
49
|
+
* 为 Vite 项目注册 Git 提交记录调试工具。页面加载后默认打印,也可调用 `b()` 再次查看。
|
|
50
50
|
*/
|
|
51
51
|
declare const gitCommitLog: (options?: GitCommitLogOptions) => Plugin;
|
|
52
52
|
|
package/dist/gitCommitLog.d.mts
CHANGED
|
@@ -33,7 +33,7 @@ interface GitCommitLogOptions {
|
|
|
33
33
|
maxCommits?: number;
|
|
34
34
|
/** 调用 b() 时默认展示的提交数量,默认 10。 */
|
|
35
35
|
defaultLimit?: number;
|
|
36
|
-
/** 页面加载后自动打印;传数字时同时指定打印条数,默认
|
|
36
|
+
/** 页面加载后自动打印;传数字时同时指定打印条数,默认 true。 */
|
|
37
37
|
autoPrint?: boolean | number;
|
|
38
38
|
/** 打印后是否默认展开控制台分组,默认 false。 */
|
|
39
39
|
expanded?: boolean;
|
|
@@ -46,7 +46,7 @@ declare global {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* 为 Vite 项目注册 Git
|
|
49
|
+
* 为 Vite 项目注册 Git 提交记录调试工具。页面加载后默认打印,也可调用 `b()` 再次查看。
|
|
50
50
|
*/
|
|
51
51
|
declare const gitCommitLog: (options?: GitCommitLogOptions) => Plugin;
|
|
52
52
|
|
package/dist/gitCommitLog.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ interface GitCommitLogOptions {
|
|
|
33
33
|
maxCommits?: number;
|
|
34
34
|
/** 调用 b() 时默认展示的提交数量,默认 10。 */
|
|
35
35
|
defaultLimit?: number;
|
|
36
|
-
/** 页面加载后自动打印;传数字时同时指定打印条数,默认
|
|
36
|
+
/** 页面加载后自动打印;传数字时同时指定打印条数,默认 true。 */
|
|
37
37
|
autoPrint?: boolean | number;
|
|
38
38
|
/** 打印后是否默认展开控制台分组,默认 false。 */
|
|
39
39
|
expanded?: boolean;
|
|
@@ -46,7 +46,7 @@ declare global {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* 为 Vite 项目注册 Git
|
|
49
|
+
* 为 Vite 项目注册 Git 提交记录调试工具。页面加载后默认打印,也可调用 `b()` 再次查看。
|
|
50
50
|
*/
|
|
51
51
|
declare const gitCommitLog: (options?: GitCommitLogOptions) => Plugin;
|
|
52
52
|
|
package/dist/gitCommitLog.mjs
CHANGED
|
@@ -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
|
-
|
|
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 ??
|
|
140
|
+
children: createClientCode(info, defaultLimit, options.autoPrint ?? true, options.expanded ?? false),
|
|
134
141
|
injectTo: "head-prepend"
|
|
135
142
|
}
|
|
136
143
|
];
|
package/dist/index.cjs
CHANGED
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.
|
|
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.Co6HoBFm.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-
|
|
1067
|
+
return "2026-08-24 16:51:35";
|
|
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-
|
|
1069
|
+
return "2026-08-24 16:51:35";
|
|
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 {
|
|
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
|
-
/**
|
|
22
|
-
|
|
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 {
|
|
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
|
-
/**
|
|
22
|
-
|
|
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 {
|
|
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
|
-
/**
|
|
22
|
-
|
|
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 };
|