@stacksjs/utils 0.70.257 → 0.70.259
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/bytes.js +1 -55
- package/dist/clean.js +1 -13
- package/dist/colors.js +1 -100
- package/dist/config.js +1 -23
- package/dist/debounce.js +1 -77
- package/dist/detect.js +8 -65
- package/dist/equal.js +1 -27
- package/dist/errors.js +1 -44
- package/dist/export-size.js +1 -1
- package/dist/find.js +1 -64
- package/dist/git.js +1 -11
- package/dist/glob.js +1 -1
- package/dist/hash.js +1 -36
- package/dist/helpers.js +4 -114
- package/dist/index.js +1 -23
- package/dist/macroable.js +1 -121
- package/dist/markdown.js +2 -92
- package/dist/merge.js +1 -51
- package/dist/observer.js +1 -78
- package/dist/pipeline.js +1 -37
- package/dist/safe-json.js +1 -33
- package/dist/size.js +3 -66
- package/dist/utils.js +1 -6
- package/dist/versions.js +1 -23
- package/package.json +21 -14
package/dist/bytes.js
CHANGED
|
@@ -1,55 +1 @@
|
|
|
1
|
-
const DECIMAL_UNITS
|
|
2
|
-
export function formatBytes(bytes, options = {}) {
|
|
3
|
-
const {
|
|
4
|
-
precision = 1,
|
|
5
|
-
binary = !1,
|
|
6
|
-
space = !0,
|
|
7
|
-
locale = "en-US",
|
|
8
|
-
minimumFractionDigits = 0,
|
|
9
|
-
maximumFractionDigits = precision
|
|
10
|
-
} = options;
|
|
11
|
-
if (!Number.isFinite(bytes))
|
|
12
|
-
throw TypeError(`Expected a finite number, got ${typeof bytes}: ${bytes}`);
|
|
13
|
-
const isNegative = bytes < 0, prefix = isNegative ? "-" : "";
|
|
14
|
-
if (isNegative)
|
|
15
|
-
bytes = -bytes;
|
|
16
|
-
if (bytes < 1) {
|
|
17
|
-
const numberString = bytes.toLocaleString(locale, {
|
|
18
|
-
minimumFractionDigits,
|
|
19
|
-
maximumFractionDigits
|
|
20
|
-
});
|
|
21
|
-
return `${prefix}${numberString}${space ? " " : ""}B`;
|
|
22
|
-
}
|
|
23
|
-
const base = binary ? 1024 : 1000, units = binary ? BINARY_UNITS : DECIMAL_UNITS, exponent = Math.min(Math.floor(Math.log(bytes) / Math.log(base)), units.length - 1), numberString = (bytes / base ** exponent).toLocaleString(locale, {
|
|
24
|
-
minimumFractionDigits,
|
|
25
|
-
maximumFractionDigits
|
|
26
|
-
}), unit = units[exponent];
|
|
27
|
-
return `${prefix}${numberString}${space ? " " : ""}${unit}`;
|
|
28
|
-
}
|
|
29
|
-
export function parseBytes(input) {
|
|
30
|
-
const match = input.match(/^(-?[\d.]+)\s*([A-Za-z]+)?$/);
|
|
31
|
-
if (!match)
|
|
32
|
-
throw Error(`Invalid byte string: ${input}`);
|
|
33
|
-
const [, numberStr, unit = "B"] = match;
|
|
34
|
-
if (numberStr === void 0)
|
|
35
|
-
throw Error(`Invalid byte string: ${input}`);
|
|
36
|
-
const number = Number.parseFloat(numberStr);
|
|
37
|
-
if (!Number.isFinite(number))
|
|
38
|
-
throw Error(`Invalid number in byte string: ${numberStr}`);
|
|
39
|
-
const normalizedUnit = unit.toUpperCase(), isBinary = normalizedUnit.endsWith("IB"), base = isBinary ? 1024 : 1000;
|
|
40
|
-
let exponent = 0;
|
|
41
|
-
const units = isBinary ? BINARY_UNITS : DECIMAL_UNITS;
|
|
42
|
-
for (let i = 0;i < units.length; i++)
|
|
43
|
-
if (units[i]?.toUpperCase() === normalizedUnit) {
|
|
44
|
-
exponent = i;
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
return number * base ** exponent;
|
|
48
|
-
}
|
|
49
|
-
export function compareBytes(a, b) {
|
|
50
|
-
const bytesA = typeof a === "string" ? parseBytes(a) : a, bytesB = typeof b === "string" ? parseBytes(b) : b;
|
|
51
|
-
return bytesA - bytesB;
|
|
52
|
-
}
|
|
53
|
-
export const prettyBytes = formatBytes, readableSize = formatBytes;
|
|
54
|
-
|
|
55
|
-
export { formatBytes as default };
|
|
1
|
+
const DECIMAL_UNITS=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],BINARY_UNITS=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];export function formatBytes(bytes,options={}){const{precision=1,binary=!1,space=!0,locale="en-US",minimumFractionDigits=0,maximumFractionDigits=precision}=options;if(!Number.isFinite(bytes))throw TypeError(`Expected a finite number, got ${typeof bytes}: ${bytes}`);const isNegative=bytes<0,prefix=isNegative?"-":"";if(isNegative)bytes=-bytes;if(bytes<1){const numberString=bytes.toLocaleString(locale,{minimumFractionDigits,maximumFractionDigits});return`${prefix}${numberString}${space?" ":""}B`}const base=binary?1024:1000,units=binary?BINARY_UNITS:DECIMAL_UNITS,exponent=Math.min(Math.floor(Math.log(bytes)/Math.log(base)),units.length-1),numberString=(bytes/base**exponent).toLocaleString(locale,{minimumFractionDigits,maximumFractionDigits}),unit=units[exponent];return`${prefix}${numberString}${space?" ":""}${unit}`}export function parseBytes(input){const match=input.match(/^(-?[\d.]+)\s*([A-Za-z]+)?$/);if(!match)throw Error(`Invalid byte string: ${input}`);const[,numberStr,unit="B"]=match;if(numberStr===void 0)throw Error(`Invalid byte string: ${input}`);const number=Number.parseFloat(numberStr);if(!Number.isFinite(number))throw Error(`Invalid number in byte string: ${numberStr}`);const normalizedUnit=unit.toUpperCase(),isBinary=normalizedUnit.endsWith("IB"),base=isBinary?1024:1000;let exponent=0;const units=isBinary?BINARY_UNITS:DECIMAL_UNITS;for(let i=0;i<units.length;i++)if(units[i]?.toUpperCase()===normalizedUnit){exponent=i;break}return number*base**exponent}export function compareBytes(a,b){const bytesA=typeof a==="string"?parseBytes(a):a,bytesB=typeof b==="string"?parseBytes(b):b;return bytesA-bytesB}export const prettyBytes=formatBytes,readableSize=formatBytes;export{formatBytes as default};
|
package/dist/clean.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export async function cleanProject() {
|
|
3
|
-
await Bun.$`rm -rf ${p.projectPath("bun.lock")}`;
|
|
4
|
-
await Bun.$`rm -rf ${p.projectPath("yarn.lock")}`;
|
|
5
|
-
await Bun.$`rm -rf ${p.projectPath("node_modules/")}`;
|
|
6
|
-
await Bun.$`rm -rf ${p.frameworkPath("dist")}`;
|
|
7
|
-
await Bun.$`rm -rf ${p.frameworkPath("node_modules")}`;
|
|
8
|
-
await Bun.$`rm -rf ${p.frameworkPath("**/dist")}`;
|
|
9
|
-
await Bun.$`rm -rf ${p.frameworkPath("**/node_modules")}`;
|
|
10
|
-
await Bun.$`rm -rf ${p.frameworkCloudPath("cdk.out/")}`;
|
|
11
|
-
await Bun.$`rm -rf ${p.frameworkCloudPath("cdk.context.json")}`;
|
|
12
|
-
await Bun.$`rm -rf ${p.cloudPath("dist.zip")}`;
|
|
13
|
-
}
|
|
1
|
+
import{path as p}from"@stacksjs/path";export async function cleanProject(){await Bun.$`rm -rf ${p.projectPath("bun.lock")}`;await Bun.$`rm -rf ${p.projectPath("yarn.lock")}`;await Bun.$`rm -rf ${p.projectPath("node_modules/")}`;await Bun.$`rm -rf ${p.frameworkPath("dist")}`;await Bun.$`rm -rf ${p.frameworkPath("node_modules")}`;await Bun.$`rm -rf ${p.frameworkPath("**/dist")}`;await Bun.$`rm -rf ${p.frameworkPath("**/node_modules")}`;await Bun.$`rm -rf ${p.frameworkCloudPath("cdk.out/")}`;await Bun.$`rm -rf ${p.frameworkCloudPath("cdk.context.json")}`;await Bun.$`rm -rf ${p.cloudPath("dist.zip")}`}
|
package/dist/colors.js
CHANGED
|
@@ -1,100 +1 @@
|
|
|
1
|
-
const isColorSupported
|
|
2
|
-
reset: isColorSupported ? "\x1B[0m" : "",
|
|
3
|
-
black: isColorSupported ? "\x1B[30m" : "",
|
|
4
|
-
red: isColorSupported ? "\x1B[31m" : "",
|
|
5
|
-
green: isColorSupported ? "\x1B[32m" : "",
|
|
6
|
-
yellow: isColorSupported ? "\x1B[33m" : "",
|
|
7
|
-
blue: isColorSupported ? "\x1B[34m" : "",
|
|
8
|
-
magenta: isColorSupported ? "\x1B[35m" : "",
|
|
9
|
-
cyan: isColorSupported ? "\x1B[36m" : "",
|
|
10
|
-
white: isColorSupported ? "\x1B[37m" : "",
|
|
11
|
-
gray: isColorSupported ? "\x1B[90m" : "",
|
|
12
|
-
grey: isColorSupported ? "\x1B[90m" : "",
|
|
13
|
-
lightRed: isColorSupported ? "\x1B[91m" : "",
|
|
14
|
-
lightGreen: isColorSupported ? "\x1B[92m" : "",
|
|
15
|
-
lightYellow: isColorSupported ? "\x1B[93m" : "",
|
|
16
|
-
lightBlue: isColorSupported ? "\x1B[94m" : "",
|
|
17
|
-
lightMagenta: isColorSupported ? "\x1B[95m" : "",
|
|
18
|
-
lightCyan: isColorSupported ? "\x1B[96m" : "",
|
|
19
|
-
lightGray: isColorSupported ? "\x1B[37m" : "",
|
|
20
|
-
lightGrey: isColorSupported ? "\x1B[37m" : "",
|
|
21
|
-
bgBlack: isColorSupported ? "\x1B[40m" : "",
|
|
22
|
-
bgRed: isColorSupported ? "\x1B[41m" : "",
|
|
23
|
-
bgGreen: isColorSupported ? "\x1B[42m" : "",
|
|
24
|
-
bgYellow: isColorSupported ? "\x1B[43m" : "",
|
|
25
|
-
bgBlue: isColorSupported ? "\x1B[44m" : "",
|
|
26
|
-
bgMagenta: isColorSupported ? "\x1B[45m" : "",
|
|
27
|
-
bgCyan: isColorSupported ? "\x1B[46m" : "",
|
|
28
|
-
bgWhite: isColorSupported ? "\x1B[47m" : "",
|
|
29
|
-
bgLightRed: isColorSupported ? "\x1B[101m" : "",
|
|
30
|
-
bgLightGreen: isColorSupported ? "\x1B[102m" : "",
|
|
31
|
-
bgLightYellow: isColorSupported ? "\x1B[103m" : "",
|
|
32
|
-
bgLightBlue: isColorSupported ? "\x1B[104m" : "",
|
|
33
|
-
bgLightMagenta: isColorSupported ? "\x1B[105m" : "",
|
|
34
|
-
bgLightCyan: isColorSupported ? "\x1B[106m" : "",
|
|
35
|
-
bold: isColorSupported ? "\x1B[1m" : "",
|
|
36
|
-
dim: isColorSupported ? "\x1B[2m" : "",
|
|
37
|
-
italic: isColorSupported ? "\x1B[3m" : "",
|
|
38
|
-
underline: isColorSupported ? "\x1B[4m" : "",
|
|
39
|
-
inverse: isColorSupported ? "\x1B[7m" : "",
|
|
40
|
-
hidden: isColorSupported ? "\x1B[8m" : "",
|
|
41
|
-
strikethrough: isColorSupported ? "\x1B[9m" : ""
|
|
42
|
-
};
|
|
43
|
-
function createColorFn(code, endCode = colors.reset) {
|
|
44
|
-
return (text) => {
|
|
45
|
-
if (!isColorSupported)
|
|
46
|
-
return String(text);
|
|
47
|
-
return `${code}${text}${endCode}`;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
export const black = createColorFn(colors.black), red = createColorFn(colors.red), green = createColorFn(colors.green), yellow = createColorFn(colors.yellow), blue = createColorFn(colors.blue), magenta = createColorFn(colors.magenta), cyan = createColorFn(colors.cyan), white = createColorFn(colors.white), gray = createColorFn(colors.gray), grey = gray, lightRed = createColorFn(colors.lightRed), lightGreen = createColorFn(colors.lightGreen), lightYellow = createColorFn(colors.lightYellow), lightBlue = createColorFn(colors.lightBlue), lightMagenta = createColorFn(colors.lightMagenta), lightCyan = createColorFn(colors.lightCyan), lightGray = createColorFn(colors.lightGray), lightGrey = lightGray, bgBlack = createColorFn(colors.bgBlack), bgRed = createColorFn(colors.bgRed), bgGreen = createColorFn(colors.bgGreen), bgYellow = createColorFn(colors.bgYellow), bgBlue = createColorFn(colors.bgBlue), bgMagenta = createColorFn(colors.bgMagenta), bgCyan = createColorFn(colors.bgCyan), bgWhite = createColorFn(colors.bgWhite), bgLightRed = createColorFn(colors.bgLightRed), bgLightGreen = createColorFn(colors.bgLightGreen), bgLightYellow = createColorFn(colors.bgLightYellow), bgLightBlue = createColorFn(colors.bgLightBlue), bgLightMagenta = createColorFn(colors.bgLightMagenta), bgLightCyan = createColorFn(colors.bgLightCyan), bold = createColorFn(colors.bold), dim = createColorFn(colors.dim), italic = createColorFn(colors.italic), underline = createColorFn(colors.underline), inverse = createColorFn(colors.inverse), hidden = createColorFn(colors.hidden), strikethrough = createColorFn(colors.strikethrough), reset = createColorFn(colors.reset, "");
|
|
51
|
-
export function stripColors(text) {
|
|
52
|
-
return text.replace(/\x1B\[\d+m/g, "");
|
|
53
|
-
}
|
|
54
|
-
export function supportsColor() {
|
|
55
|
-
return !!isColorSupported;
|
|
56
|
-
}
|
|
57
|
-
export default {
|
|
58
|
-
black,
|
|
59
|
-
red,
|
|
60
|
-
green,
|
|
61
|
-
yellow,
|
|
62
|
-
blue,
|
|
63
|
-
magenta,
|
|
64
|
-
cyan,
|
|
65
|
-
white,
|
|
66
|
-
gray,
|
|
67
|
-
grey,
|
|
68
|
-
lightRed,
|
|
69
|
-
lightGreen,
|
|
70
|
-
lightYellow,
|
|
71
|
-
lightBlue,
|
|
72
|
-
lightMagenta,
|
|
73
|
-
lightCyan,
|
|
74
|
-
lightGray,
|
|
75
|
-
lightGrey,
|
|
76
|
-
bgBlack,
|
|
77
|
-
bgRed,
|
|
78
|
-
bgGreen,
|
|
79
|
-
bgYellow,
|
|
80
|
-
bgBlue,
|
|
81
|
-
bgMagenta,
|
|
82
|
-
bgCyan,
|
|
83
|
-
bgWhite,
|
|
84
|
-
bgLightRed,
|
|
85
|
-
bgLightGreen,
|
|
86
|
-
bgLightYellow,
|
|
87
|
-
bgLightBlue,
|
|
88
|
-
bgLightMagenta,
|
|
89
|
-
bgLightCyan,
|
|
90
|
-
bold,
|
|
91
|
-
dim,
|
|
92
|
-
italic,
|
|
93
|
-
underline,
|
|
94
|
-
inverse,
|
|
95
|
-
hidden,
|
|
96
|
-
strikethrough,
|
|
97
|
-
reset,
|
|
98
|
-
stripColors,
|
|
99
|
-
supportsColor
|
|
100
|
-
};
|
|
1
|
+
const isColorSupported=!process.env.NO_COLOR&&(process.env.FORCE_COLOR||process.stdout?.isTTY),colors={reset:isColorSupported?"\x1B[0m":"",black:isColorSupported?"\x1B[30m":"",red:isColorSupported?"\x1B[31m":"",green:isColorSupported?"\x1B[32m":"",yellow:isColorSupported?"\x1B[33m":"",blue:isColorSupported?"\x1B[34m":"",magenta:isColorSupported?"\x1B[35m":"",cyan:isColorSupported?"\x1B[36m":"",white:isColorSupported?"\x1B[37m":"",gray:isColorSupported?"\x1B[90m":"",grey:isColorSupported?"\x1B[90m":"",lightRed:isColorSupported?"\x1B[91m":"",lightGreen:isColorSupported?"\x1B[92m":"",lightYellow:isColorSupported?"\x1B[93m":"",lightBlue:isColorSupported?"\x1B[94m":"",lightMagenta:isColorSupported?"\x1B[95m":"",lightCyan:isColorSupported?"\x1B[96m":"",lightGray:isColorSupported?"\x1B[37m":"",lightGrey:isColorSupported?"\x1B[37m":"",bgBlack:isColorSupported?"\x1B[40m":"",bgRed:isColorSupported?"\x1B[41m":"",bgGreen:isColorSupported?"\x1B[42m":"",bgYellow:isColorSupported?"\x1B[43m":"",bgBlue:isColorSupported?"\x1B[44m":"",bgMagenta:isColorSupported?"\x1B[45m":"",bgCyan:isColorSupported?"\x1B[46m":"",bgWhite:isColorSupported?"\x1B[47m":"",bgLightRed:isColorSupported?"\x1B[101m":"",bgLightGreen:isColorSupported?"\x1B[102m":"",bgLightYellow:isColorSupported?"\x1B[103m":"",bgLightBlue:isColorSupported?"\x1B[104m":"",bgLightMagenta:isColorSupported?"\x1B[105m":"",bgLightCyan:isColorSupported?"\x1B[106m":"",bold:isColorSupported?"\x1B[1m":"",dim:isColorSupported?"\x1B[2m":"",italic:isColorSupported?"\x1B[3m":"",underline:isColorSupported?"\x1B[4m":"",inverse:isColorSupported?"\x1B[7m":"",hidden:isColorSupported?"\x1B[8m":"",strikethrough:isColorSupported?"\x1B[9m":""};function createColorFn(code,endCode=colors.reset){return(text)=>{if(!isColorSupported)return String(text);return`${code}${text}${endCode}`}}export const black=createColorFn(colors.black),red=createColorFn(colors.red),green=createColorFn(colors.green),yellow=createColorFn(colors.yellow),blue=createColorFn(colors.blue),magenta=createColorFn(colors.magenta),cyan=createColorFn(colors.cyan),white=createColorFn(colors.white),gray=createColorFn(colors.gray),grey=gray,lightRed=createColorFn(colors.lightRed),lightGreen=createColorFn(colors.lightGreen),lightYellow=createColorFn(colors.lightYellow),lightBlue=createColorFn(colors.lightBlue),lightMagenta=createColorFn(colors.lightMagenta),lightCyan=createColorFn(colors.lightCyan),lightGray=createColorFn(colors.lightGray),lightGrey=lightGray,bgBlack=createColorFn(colors.bgBlack),bgRed=createColorFn(colors.bgRed),bgGreen=createColorFn(colors.bgGreen),bgYellow=createColorFn(colors.bgYellow),bgBlue=createColorFn(colors.bgBlue),bgMagenta=createColorFn(colors.bgMagenta),bgCyan=createColorFn(colors.bgCyan),bgWhite=createColorFn(colors.bgWhite),bgLightRed=createColorFn(colors.bgLightRed),bgLightGreen=createColorFn(colors.bgLightGreen),bgLightYellow=createColorFn(colors.bgLightYellow),bgLightBlue=createColorFn(colors.bgLightBlue),bgLightMagenta=createColorFn(colors.bgLightMagenta),bgLightCyan=createColorFn(colors.bgLightCyan),bold=createColorFn(colors.bold),dim=createColorFn(colors.dim),italic=createColorFn(colors.italic),underline=createColorFn(colors.underline),inverse=createColorFn(colors.inverse),hidden=createColorFn(colors.hidden),strikethrough=createColorFn(colors.strikethrough),reset=createColorFn(colors.reset,"");export function stripColors(text){return text.replace(/\x1B\[\d+m/g,"")}export function supportsColor(){return!!isColorSupported}export default {black,red,green,yellow,blue,magenta,cyan,white,gray,grey,lightRed,lightGreen,lightYellow,lightBlue,lightMagenta,lightCyan,lightGray,lightGrey,bgBlack,bgRed,bgGreen,bgYellow,bgBlue,bgMagenta,bgCyan,bgWhite,bgLightRed,bgLightGreen,bgLightYellow,bgLightBlue,bgLightMagenta,bgLightCyan,bold,dim,italic,underline,inverse,hidden,strikethrough,reset,stripColors,supportsColor};
|
package/dist/config.js
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
defineApp,
|
|
3
|
-
defineCache,
|
|
4
|
-
defineCdn,
|
|
5
|
-
defineChat,
|
|
6
|
-
defineCli,
|
|
7
|
-
defineDatabase,
|
|
8
|
-
defineDependencies,
|
|
9
|
-
defineDns,
|
|
10
|
-
defineEmail,
|
|
11
|
-
defineEmailConfig,
|
|
12
|
-
defineGit,
|
|
13
|
-
defineHashing,
|
|
14
|
-
defineLibrary,
|
|
15
|
-
defineNotification,
|
|
16
|
-
definePayment,
|
|
17
|
-
defineQueue,
|
|
18
|
-
defineSearchEngine,
|
|
19
|
-
defineServices,
|
|
20
|
-
defineSms,
|
|
21
|
-
defineFilesystems,
|
|
22
|
-
defineUi
|
|
23
|
-
} from "@stacksjs/config";
|
|
1
|
+
export{defineApp,defineCache,defineCdn,defineChat,defineCli,defineDatabase,defineDependencies,defineDns,defineEmail,defineEmailConfig,defineGit,defineHashing,defineLibrary,defineNotification,definePayment,defineQueue,defineSearchEngine,defineServices,defineSms,defineFilesystems,defineUi}from"@stacksjs/config";
|
package/dist/debounce.js
CHANGED
|
@@ -1,77 +1 @@
|
|
|
1
|
-
export function debounce(fn, wait = 0,
|
|
2
|
-
const { leading = !1, trailing = !0 } = options;
|
|
3
|
-
let timeout = null, lastArgs = null, lastThis = null, result;
|
|
4
|
-
const invokeFunc = () => {
|
|
5
|
-
if (lastArgs) {
|
|
6
|
-
result = fn.apply(lastThis, lastArgs);
|
|
7
|
-
lastArgs = null;
|
|
8
|
-
lastThis = null;
|
|
9
|
-
}
|
|
10
|
-
return result;
|
|
11
|
-
}, cancel = () => {
|
|
12
|
-
if (timeout) {
|
|
13
|
-
clearTimeout(timeout);
|
|
14
|
-
timeout = null;
|
|
15
|
-
}
|
|
16
|
-
lastArgs = null;
|
|
17
|
-
lastThis = null;
|
|
18
|
-
}, flush = () => {
|
|
19
|
-
if (timeout) {
|
|
20
|
-
clearTimeout(timeout);
|
|
21
|
-
timeout = null;
|
|
22
|
-
return invokeFunc();
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
25
|
-
}, debounced = function(...args) {
|
|
26
|
-
lastArgs = args;
|
|
27
|
-
lastThis = this;
|
|
28
|
-
const shouldCallNow = leading && !timeout;
|
|
29
|
-
if (timeout)
|
|
30
|
-
clearTimeout(timeout);
|
|
31
|
-
timeout = setTimeout(() => {
|
|
32
|
-
timeout = null;
|
|
33
|
-
if (trailing && lastArgs)
|
|
34
|
-
invokeFunc();
|
|
35
|
-
}, wait);
|
|
36
|
-
if (shouldCallNow)
|
|
37
|
-
return invokeFunc();
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
debounced.cancel = cancel;
|
|
41
|
-
debounced.flush = flush;
|
|
42
|
-
return debounced;
|
|
43
|
-
}
|
|
44
|
-
export function throttle(fn, wait = 0) {
|
|
45
|
-
let timeout = null, lastRun = 0, lastArgs = null, lastThis = null;
|
|
46
|
-
const invokeFunc = () => {
|
|
47
|
-
if (lastArgs) {
|
|
48
|
-
fn.apply(lastThis, lastArgs);
|
|
49
|
-
lastArgs = null;
|
|
50
|
-
lastThis = null;
|
|
51
|
-
lastRun = Date.now();
|
|
52
|
-
}
|
|
53
|
-
}, cancel = () => {
|
|
54
|
-
if (timeout) {
|
|
55
|
-
clearTimeout(timeout);
|
|
56
|
-
timeout = null;
|
|
57
|
-
}
|
|
58
|
-
lastArgs = null;
|
|
59
|
-
lastThis = null;
|
|
60
|
-
}, throttled = function(...args) {
|
|
61
|
-
lastArgs = args;
|
|
62
|
-
lastThis = this;
|
|
63
|
-
const timeSinceLastRun = Date.now() - lastRun;
|
|
64
|
-
if (timeSinceLastRun >= wait)
|
|
65
|
-
invokeFunc();
|
|
66
|
-
else if (!timeout)
|
|
67
|
-
timeout = setTimeout(() => {
|
|
68
|
-
timeout = null;
|
|
69
|
-
invokeFunc();
|
|
70
|
-
}, wait - timeSinceLastRun);
|
|
71
|
-
};
|
|
72
|
-
throttled.cancel = cancel;
|
|
73
|
-
return throttled;
|
|
74
|
-
}
|
|
75
|
-
export function delay(ms) {
|
|
76
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
77
|
-
}
|
|
1
|
+
export function debounce(fn,wait=0,options={}){const{leading=!1,trailing=!0}=options;let timeout=null,lastArgs=null,lastThis=null,result;const invokeFunc=()=>{if(lastArgs){result=fn.apply(lastThis,lastArgs);lastArgs=null;lastThis=null}return result},cancel=()=>{if(timeout){clearTimeout(timeout);timeout=null}lastArgs=null;lastThis=null},flush=()=>{if(timeout){clearTimeout(timeout);timeout=null;return invokeFunc()}return result},debounced=function(...args){lastArgs=args;lastThis=this;const shouldCallNow=leading&&!timeout;if(timeout)clearTimeout(timeout);timeout=setTimeout(()=>{timeout=null;if(trailing&&lastArgs)invokeFunc()},wait);if(shouldCallNow)return invokeFunc();return result};debounced.cancel=cancel;debounced.flush=flush;return debounced}export function throttle(fn,wait=0){let timeout=null,lastRun=0,lastArgs=null,lastThis=null;const invokeFunc=()=>{if(lastArgs){fn.apply(lastThis,lastArgs);lastArgs=null;lastThis=null;lastRun=Date.now()}},cancel=()=>{if(timeout){clearTimeout(timeout);timeout=null}lastArgs=null;lastThis=null},throttled=function(...args){lastArgs=args;lastThis=this;const timeSinceLastRun=Date.now()-lastRun;if(timeSinceLastRun>=wait)invokeFunc();else if(!timeout)timeout=setTimeout(()=>{timeout=null;invokeFunc()},wait-timeSinceLastRun)};throttled.cancel=cancel;return throttled}export function delay(ms){return new Promise((resolve)=>setTimeout(resolve,ms))}
|
package/dist/detect.js
CHANGED
|
@@ -1,65 +1,8 @@
|
|
|
1
|
-
export function detectIndent(text)
|
|
2
|
-
|
|
3
|
-
`)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
indents.push(match[1]);
|
|
10
|
-
}
|
|
11
|
-
if (indents.length === 0)
|
|
12
|
-
return { amount: 0, type: null, indent: "" };
|
|
13
|
-
const indentCounts = new Map;
|
|
14
|
-
for (const indent of indents)
|
|
15
|
-
indentCounts.set(indent, (indentCounts.get(indent) || 0) + 1);
|
|
16
|
-
let mostCommon = "", maxCount = 0;
|
|
17
|
-
for (const [indent, count] of indentCounts)
|
|
18
|
-
if (count > maxCount) {
|
|
19
|
-
maxCount = count;
|
|
20
|
-
mostCommon = indent;
|
|
21
|
-
}
|
|
22
|
-
if (mostCommon.includes("\t"))
|
|
23
|
-
return {
|
|
24
|
-
amount: mostCommon.length,
|
|
25
|
-
type: "tab",
|
|
26
|
-
indent: mostCommon
|
|
27
|
-
};
|
|
28
|
-
return {
|
|
29
|
-
amount: mostCommon.length,
|
|
30
|
-
type: "space",
|
|
31
|
-
indent: mostCommon
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export function detectNewline(text) {
|
|
35
|
-
if (!text)
|
|
36
|
-
return null;
|
|
37
|
-
if (text.includes(`\r
|
|
38
|
-
`))
|
|
39
|
-
return `\r
|
|
40
|
-
`;
|
|
41
|
-
if (text.includes(`
|
|
42
|
-
`))
|
|
43
|
-
return `
|
|
44
|
-
`;
|
|
45
|
-
if (text.includes("\r"))
|
|
46
|
-
return "\r";
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
export function detectNewlineGraceful(text, fallback = `
|
|
50
|
-
`) {
|
|
51
|
-
return detectNewline(text) || fallback;
|
|
52
|
-
}
|
|
53
|
-
export function normalizeNewlines(text, newline = `
|
|
54
|
-
`) {
|
|
55
|
-
return text.replace(/\r\n|\r|\n/g, newline);
|
|
56
|
-
}
|
|
57
|
-
export function countNewlines(text) {
|
|
58
|
-
const crlf = (text.match(/\r\n/g) || []).length, cr = (text.match(/\r(?!\n)/g) || []).length, lf = (text.match(/(?<!\r)\n/g) || []).length;
|
|
59
|
-
return {
|
|
60
|
-
crlf,
|
|
61
|
-
lf,
|
|
62
|
-
cr,
|
|
63
|
-
total: crlf + lf + cr
|
|
64
|
-
};
|
|
65
|
-
}
|
|
1
|
+
export function detectIndent(text){const lines=text.split(`
|
|
2
|
+
`),indents=[];for(const line of lines){if(!line.trim())continue;const match=line.match(/^(\s+)/);if(match&&match[1]!==void 0)indents.push(match[1])}if(indents.length===0)return{amount:0,type:null,indent:""};const indentCounts=new Map;for(const indent of indents)indentCounts.set(indent,(indentCounts.get(indent)||0)+1);let mostCommon="",maxCount=0;for(const[indent,count]of indentCounts)if(count>maxCount){maxCount=count;mostCommon=indent}if(mostCommon.includes("\t"))return{amount:mostCommon.length,type:"tab",indent:mostCommon};return{amount:mostCommon.length,type:"space",indent:mostCommon}}export function detectNewline(text){if(!text)return null;if(text.includes(`\r
|
|
3
|
+
`))return`\r
|
|
4
|
+
`;if(text.includes(`
|
|
5
|
+
`))return`
|
|
6
|
+
`;if(text.includes("\r"))return"\r";return null}export function detectNewlineGraceful(text,fallback=`
|
|
7
|
+
`){return detectNewline(text)||fallback}export function normalizeNewlines(text,newline=`
|
|
8
|
+
`){return text.replace(/\r\n|\r|\n/g,newline)}export function countNewlines(text){const crlf=(text.match(/\r\n/g)||[]).length,cr=(text.match(/\r(?!\n)/g)||[]).length,lf=(text.match(/(?<!\r)\n/g)||[]).length;return{crlf,lf,cr,total:crlf+lf+cr}}
|
package/dist/equal.js
CHANGED
|
@@ -1,27 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export function isDeepEqual(value1, value2, seen = new WeakMap) {
|
|
3
|
-
if (value1 === value2)
|
|
4
|
-
return !0;
|
|
5
|
-
if (typeof value1 === "number" && typeof value2 === "number" && Number.isNaN(value1) && Number.isNaN(value2))
|
|
6
|
-
return !0;
|
|
7
|
-
const type1 = getTypeName(value1), type2 = getTypeName(value2);
|
|
8
|
-
if (type1 !== type2)
|
|
9
|
-
return !1;
|
|
10
|
-
if (value1 && typeof value1 === "object") {
|
|
11
|
-
if (seen.get(value1) === value2)
|
|
12
|
-
return !0;
|
|
13
|
-
seen.set(value1, value2);
|
|
14
|
-
}
|
|
15
|
-
if (type1 === "array") {
|
|
16
|
-
if (value1.length !== value2.length)
|
|
17
|
-
return !1;
|
|
18
|
-
return value1.every((item, i) => isDeepEqual(item, value2[i], seen));
|
|
19
|
-
}
|
|
20
|
-
if (type1 === "object") {
|
|
21
|
-
const keyArr = Object.keys(value1);
|
|
22
|
-
if (keyArr.length !== Object.keys(value2).length)
|
|
23
|
-
return !1;
|
|
24
|
-
return keyArr.every((key) => isDeepEqual(value1[key], value2[key], seen));
|
|
25
|
-
}
|
|
26
|
-
return Object.is(value1, value2);
|
|
27
|
-
}
|
|
1
|
+
import{getTypeName}from"@stacksjs/types";export function isDeepEqual(value1,value2,seen=new WeakMap){if(value1===value2)return!0;if(typeof value1==="number"&&typeof value2==="number"&&Number.isNaN(value1)&&Number.isNaN(value2))return!0;const type1=getTypeName(value1),type2=getTypeName(value2);if(type1!==type2)return!1;if(value1&&typeof value1==="object"){if(seen.get(value1)===value2)return!0;seen.set(value1,value2)}if(type1==="array"){if(value1.length!==value2.length)return!1;return value1.every((item,i)=>isDeepEqual(item,value2[i],seen))}if(type1==="object"){const keyArr=Object.keys(value1);if(keyArr.length!==Object.keys(value2).length)return!1;return keyArr.every((key)=>isDeepEqual(value1[key],value2[key],seen))}return Object.is(value1,value2)}
|
package/dist/errors.js
CHANGED
|
@@ -1,44 +1 @@
|
|
|
1
|
-
export function getErrorMessage(e) {
|
|
2
|
-
if (e instanceof Error)
|
|
3
|
-
return e.message;
|
|
4
|
-
if (typeof e === "string")
|
|
5
|
-
return e;
|
|
6
|
-
if (typeof e === "number" || typeof e === "boolean")
|
|
7
|
-
return String(e);
|
|
8
|
-
if (e && typeof e === "object" && "message" in e && typeof e.message === "string")
|
|
9
|
-
return e.message;
|
|
10
|
-
if (e == null)
|
|
11
|
-
return "Unknown error";
|
|
12
|
-
try {
|
|
13
|
-
return String(e);
|
|
14
|
-
} catch {
|
|
15
|
-
return "Unknown error";
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export function getErrorStack(e) {
|
|
19
|
-
if (e instanceof Error)
|
|
20
|
-
return e.stack;
|
|
21
|
-
if (e && typeof e === "object" && "stack" in e && typeof e.stack === "string")
|
|
22
|
-
return e.stack;
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
export function getErrorCode(e) {
|
|
26
|
-
if (e && typeof e === "object" && "code" in e && typeof e.code === "string")
|
|
27
|
-
return e.code;
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
export function getErrorStatusCode(e) {
|
|
31
|
-
if (!e || typeof e !== "object")
|
|
32
|
-
return;
|
|
33
|
-
const obj = e;
|
|
34
|
-
if (typeof obj.statusCode === "number" && Number.isFinite(obj.statusCode))
|
|
35
|
-
return obj.statusCode;
|
|
36
|
-
if (typeof obj.status === "number" && Number.isFinite(obj.status))
|
|
37
|
-
return obj.status;
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
export function toError(e) {
|
|
41
|
-
if (e instanceof Error)
|
|
42
|
-
return e;
|
|
43
|
-
return Error(getErrorMessage(e), { cause: e });
|
|
44
|
-
}
|
|
1
|
+
export function getErrorMessage(e){if(e instanceof Error)return e.message;if(typeof e==="string")return e;if(typeof e==="number"||typeof e==="boolean")return String(e);if(e&&typeof e==="object"&&"message"in e&&typeof e.message==="string")return e.message;if(e==null)return"Unknown error";try{return String(e)}catch{return"Unknown error"}}export function getErrorStack(e){if(e instanceof Error)return e.stack;if(e&&typeof e==="object"&&"stack"in e&&typeof e.stack==="string")return e.stack;return}export function getErrorCode(e){if(e&&typeof e==="object"&&"code"in e&&typeof e.code==="string")return e.code;return}export function getErrorStatusCode(e){if(!e||typeof e!=="object")return;const obj=e;if(typeof obj.statusCode==="number"&&Number.isFinite(obj.statusCode))return obj.statusCode;if(typeof obj.status==="number"&&Number.isFinite(obj.status))return obj.status;return}export function toError(e){if(e instanceof Error)return e;return Error(getErrorMessage(e),{cause:e})}
|
package/dist/export-size.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{getExportsSize}from"./size";
|
package/dist/find.js
CHANGED
|
@@ -1,64 +1 @@
|
|
|
1
|
-
import fs from
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { italic } from "@stacksjs/cli";
|
|
5
|
-
import { log } from "@stacksjs/logging";
|
|
6
|
-
const targetFileName = "buddy", alwaysExcludePatterns = [
|
|
7
|
-
"node_modules",
|
|
8
|
-
"dist",
|
|
9
|
-
"vendor",
|
|
10
|
-
"storage/framework",
|
|
11
|
-
/.*out.*/,
|
|
12
|
-
/.*\/\..*/
|
|
13
|
-
], homeOnlyExcludePatterns = [
|
|
14
|
-
`${os.homedir()}/Documents`,
|
|
15
|
-
`${os.homedir()}/Pictures`,
|
|
16
|
-
`${os.homedir()}/Library`,
|
|
17
|
-
`${os.homedir()}/.Trash`
|
|
18
|
-
], MAX_CONCURRENT_FS_READS = 32;
|
|
19
|
-
let activeFsReads = 0;
|
|
20
|
-
const fsReadQueue = [];
|
|
21
|
-
async function withFsReadSlot(operation) {
|
|
22
|
-
if (activeFsReads >= MAX_CONCURRENT_FS_READS)
|
|
23
|
-
await new Promise((resolve) => fsReadQueue.push(resolve));
|
|
24
|
-
activeFsReads++;
|
|
25
|
-
try {
|
|
26
|
-
return await operation();
|
|
27
|
-
} finally {
|
|
28
|
-
activeFsReads--;
|
|
29
|
-
fsReadQueue.shift()?.();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export async function findStacksProjects(dir, options) {
|
|
33
|
-
const dirWasExplicit = !!dir;
|
|
34
|
-
dir = dir || os.homedir();
|
|
35
|
-
const excludePatterns = dirWasExplicit ? alwaysExcludePatterns : [...alwaysExcludePatterns, ...homeOnlyExcludePatterns];
|
|
36
|
-
if (!options?.quiet) {
|
|
37
|
-
log.info(`Searching for Stacks projects in: ${italic(dir)}`);
|
|
38
|
-
log.info("This may take a few moments...");
|
|
39
|
-
console.log("");
|
|
40
|
-
console.log(italic(" Please note, while Stacks is searching for projects on your machine,"));
|
|
41
|
-
console.log(italic(" you may be asked for permissions to scan certain directories."));
|
|
42
|
-
console.log("");
|
|
43
|
-
log.debug(`Excluding directories: ${excludePatterns.join(", ")}`);
|
|
44
|
-
}
|
|
45
|
-
const foundProjects = await searchDirectory(dir, excludePatterns);
|
|
46
|
-
if (!foundProjects)
|
|
47
|
-
throw Error("No Stacks projects found");
|
|
48
|
-
return foundProjects;
|
|
49
|
-
}
|
|
50
|
-
async function searchDirectory(directory, excludePatterns) {
|
|
51
|
-
if (excludePatterns.some((pattern) => typeof pattern === "string" ? directory.includes(pattern) : pattern.test(directory)))
|
|
52
|
-
return [];
|
|
53
|
-
let items;
|
|
54
|
-
try {
|
|
55
|
-
items = await withFsReadSlot(() => fs.readdir(directory, { withFileTypes: !0 }));
|
|
56
|
-
} catch (error) {
|
|
57
|
-
console.error(`Error reading directory ${directory}:`, error);
|
|
58
|
-
return [];
|
|
59
|
-
}
|
|
60
|
-
const buddyFileFound = items.some((item) => item.isFile() && item.name === targetFileName), storageDirFound = items.some((item) => item.isDirectory() && item.name === "storage") && await withFsReadSlot(() => fs.access(path.join(directory, "storage/framework/core/buddy"))).then(() => !0).catch(() => !1), children = items.filter((item) => item.isDirectory() && item.name !== "storage").map((item) => searchDirectory(path.join(directory, item.name), excludePatterns)), nested = (await Promise.all(children)).flat();
|
|
61
|
-
if (buddyFileFound && storageDirFound)
|
|
62
|
-
nested.push(directory);
|
|
63
|
-
return nested;
|
|
64
|
-
}
|
|
1
|
+
import fs from"node:fs/promises";import os from"node:os";import path from"node:path";import{italic}from"@stacksjs/cli";import{log}from"@stacksjs/logging";const targetFileName="buddy",alwaysExcludePatterns=["node_modules","dist","vendor","storage/framework",/.*out.*/,/.*\/\..*/],homeOnlyExcludePatterns=[`${os.homedir()}/Documents`,`${os.homedir()}/Pictures`,`${os.homedir()}/Library`,`${os.homedir()}/.Trash`],MAX_CONCURRENT_FS_READS=32;let activeFsReads=0;const fsReadQueue=[];async function withFsReadSlot(operation){if(activeFsReads>=MAX_CONCURRENT_FS_READS)await new Promise((resolve)=>fsReadQueue.push(resolve));activeFsReads++;try{return await operation()}finally{activeFsReads--;fsReadQueue.shift()?.()}}export async function findStacksProjects(dir,options){const dirWasExplicit=!!dir;dir=dir||os.homedir();const excludePatterns=dirWasExplicit?alwaysExcludePatterns:[...alwaysExcludePatterns,...homeOnlyExcludePatterns];if(!options?.quiet){log.info(`Searching for Stacks projects in: ${italic(dir)}`);log.info("This may take a few moments...");console.log("");console.log(italic(" Please note, while Stacks is searching for projects on your machine,"));console.log(italic(" you may be asked for permissions to scan certain directories."));console.log("");log.debug(`Excluding directories: ${excludePatterns.join(", ")}`)}const foundProjects=await searchDirectory(dir,excludePatterns);if(!foundProjects)throw Error("No Stacks projects found");return foundProjects}async function searchDirectory(directory,excludePatterns){if(excludePatterns.some((pattern)=>typeof pattern==="string"?directory.includes(pattern):pattern.test(directory)))return[];let items;try{items=await withFsReadSlot(()=>fs.readdir(directory,{withFileTypes:!0}))}catch(error){console.error(`Error reading directory ${directory}:`,error);return[]}const buddyFileFound=items.some((item)=>item.isFile()&&item.name===targetFileName),storageDirFound=items.some((item)=>item.isDirectory()&&item.name==="storage")&&await withFsReadSlot(()=>fs.access(path.join(directory,"storage/framework/core/buddy"))).then(()=>!0).catch(()=>!1),children=items.filter((item)=>item.isDirectory()&&item.name!=="storage").map((item)=>searchDirectory(path.join(directory,item.name),excludePatterns)),nested=(await Promise.all(children)).flat();if(buddyFileFound&&storageDirFound)nested.push(directory);return nested}
|
package/dist/git.js
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { handleError } from "@stacksjs/error-handling";
|
|
3
|
-
export function isGitClean() {
|
|
4
|
-
try {
|
|
5
|
-
execSync("git diff-index --quiet HEAD --");
|
|
6
|
-
return !0;
|
|
7
|
-
} catch (error) {
|
|
8
|
-
handleError(error);
|
|
9
|
-
return !1;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
import{execSync}from"node:child_process";import{handleError}from"@stacksjs/error-handling";export function isGitClean(){try{execSync("git diff-index --quiet HEAD --");return!0}catch(error){handleError(error);return!1}}
|
package/dist/glob.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{glob}from"@stacksjs/storage";
|
package/dist/hash.js
CHANGED
|
@@ -1,36 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { log } from "@stacksjs/logging";
|
|
3
|
-
import { path } from "@stacksjs/path";
|
|
4
|
-
import { hashPaths } from "@stacksjs/storage";
|
|
5
|
-
export function originRequestFunctionHash() {
|
|
6
|
-
try {
|
|
7
|
-
return hashPaths(path.cloudPath("src/edge"));
|
|
8
|
-
} catch (error) {
|
|
9
|
-
log.error("Are we in a Docker container? Failed to hash paths. Error below:");
|
|
10
|
-
log.error(error);
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export function websiteSourceHash() {
|
|
15
|
-
const docsSrc = [
|
|
16
|
-
path.projectPath("docs"),
|
|
17
|
-
path.frameworkPath("docs/dist")
|
|
18
|
-
], websiteSrc = [
|
|
19
|
-
path.projectPath("resources/views"),
|
|
20
|
-
path.projectPath("resources/assets"),
|
|
21
|
-
path.projectPath("resources/lang"),
|
|
22
|
-
path.projectPath("resources/functions"),
|
|
23
|
-
path.projectPath("resources/components"),
|
|
24
|
-
path.projectPath("resources/modules"),
|
|
25
|
-
path.projectPath("resources/stores"),
|
|
26
|
-
path.frameworkPath("views/web")
|
|
27
|
-
];
|
|
28
|
-
return config.app.docMode === !0 ? hashPaths(docsSrc) : hashPaths(websiteSrc);
|
|
29
|
-
}
|
|
30
|
-
export function docsSourceHash() {
|
|
31
|
-
const docsSrc = [
|
|
32
|
-
path.projectPath("docs"),
|
|
33
|
-
path.frameworkPath("docs/dist")
|
|
34
|
-
];
|
|
35
|
-
return hashPaths(docsSrc);
|
|
36
|
-
}
|
|
1
|
+
import{config}from"@stacksjs/config";import{log}from"@stacksjs/logging";import{path}from"@stacksjs/path";import{hashPaths}from"@stacksjs/storage";export function originRequestFunctionHash(){try{return hashPaths(path.cloudPath("src/edge"))}catch(error){log.error("Are we in a Docker container? Failed to hash paths. Error below:");log.error(error);return}}export function websiteSourceHash(){const docsSrc=[path.projectPath("docs"),path.frameworkPath("docs/dist")],websiteSrc=[path.projectPath("resources/views"),path.projectPath("resources/assets"),path.projectPath("resources/lang"),path.projectPath("resources/functions"),path.projectPath("resources/components"),path.projectPath("resources/modules"),path.projectPath("resources/stores"),path.frameworkPath("views/web")];return config.app.docMode===!0?hashPaths(docsSrc):hashPaths(websiteSrc)}export function docsSourceHash(){const docsSrc=[path.projectPath("docs"),path.frameworkPath("docs/dist")];return hashPaths(docsSrc)}
|