@jadeja/ts 1.0.0-alpha.0 → 1.0.0-alpha.2
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/CHANGELOG.md +21 -0
- package/README.md +1 -1
- package/dist/{src/configs → configs}/oxfmt/base.d.ts +2 -2
- package/dist/{src/configs → configs}/oxfmt/base.d.ts.map +1 -1
- package/dist/{oxfmt.js → configs/oxfmt/base.js} +2 -9
- package/dist/configs/oxfmt/base.js.map +1 -0
- package/dist/{src/configs → configs}/oxfmt/lib.d.ts +2 -2
- package/dist/{src/configs → configs}/oxfmt/lib.d.ts.map +1 -1
- package/dist/configs/oxfmt/lib.js +7 -0
- package/dist/configs/oxfmt/lib.js.map +1 -0
- package/dist/{src/configs → configs}/oxfmt/next.d.ts +2 -2
- package/dist/{src/configs → configs}/oxfmt/next.d.ts.map +1 -1
- package/dist/configs/oxfmt/next.js +14 -0
- package/dist/configs/oxfmt/next.js.map +1 -0
- package/dist/{src/configs → configs}/oxlint/base.d.ts +8 -3
- package/dist/configs/oxlint/base.d.ts.map +1 -0
- package/dist/{oxlint.js → configs/oxlint/base.js} +10 -72
- package/dist/configs/oxlint/base.js.map +1 -0
- package/dist/{src/configs → configs}/oxlint/lib.d.ts +32 -27
- package/dist/configs/oxlint/lib.d.ts.map +1 -0
- package/dist/configs/oxlint/lib.js +7 -0
- package/dist/configs/oxlint/lib.js.map +1 -0
- package/dist/{src/configs → configs}/oxlint/next.d.ts +7 -3
- package/dist/configs/oxlint/next.d.ts.map +1 -0
- package/dist/configs/oxlint/next.js +70 -0
- package/dist/configs/oxlint/next.js.map +1 -0
- package/dist/configs/vite/base.d.ts +4 -0
- package/dist/configs/vite/base.d.ts.map +1 -0
- package/dist/configs/vite/base.js +18 -0
- package/dist/configs/vite/base.js.map +1 -0
- package/dist/configs/vite/lib.d.ts +18 -0
- package/dist/configs/vite/lib.d.ts.map +1 -0
- package/dist/configs/vite/lib.js +38 -0
- package/dist/configs/vite/lib.js.map +1 -0
- package/dist/lib/debounce.js +10 -0
- package/dist/lib/debounce.js.map +1 -0
- package/dist/lib/logger.js +15 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/{src/lib → lib}/operations.d.ts +3 -3
- package/dist/{src/lib → lib}/operations.d.ts.map +1 -1
- package/dist/lib/operations.js +21 -0
- package/dist/lib/operations.js.map +1 -0
- package/dist/lib/singleton.d.ts +12 -0
- package/dist/lib/singleton.d.ts.map +1 -0
- package/dist/lib/singleton.js +25 -0
- package/dist/lib/singleton.js.map +1 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +6 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +13 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +14 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/node_modules/.pnpm/glob@13.0.6/node_modules/glob/dist/esm/index.min.js +3105 -0
- package/dist/node_modules/.pnpm/glob@13.0.6/node_modules/glob/dist/esm/index.min.js.map +1 -0
- package/dist/{src/plugins → plugins}/vite/copy-folders.d.ts.map +1 -1
- package/dist/plugins/vite/copy-folders.js +22 -0
- package/dist/plugins/vite/copy-folders.js.map +1 -0
- package/dist/plugins/vite/remove-folders.d.ts +14 -0
- package/dist/plugins/vite/remove-folders.d.ts.map +1 -0
- package/dist/plugins/vite/remove-folders.js +18 -0
- package/dist/plugins/vite/remove-folders.js.map +1 -0
- package/dist/types/util.d.ts +33 -0
- package/dist/types/util.d.ts.map +1 -0
- package/package.json +31 -43
- package/dist/lib.js +0 -36
- package/dist/lib.js.map +0 -1
- package/dist/oxfmt.js.map +0 -1
- package/dist/oxlint.js.map +0 -1
- package/dist/src/configs/oxfmt/index.d.ts +0 -4
- package/dist/src/configs/oxfmt/index.d.ts.map +0 -1
- package/dist/src/configs/oxfmt/types.d.ts +0 -2
- package/dist/src/configs/oxfmt/types.d.ts.map +0 -1
- package/dist/src/configs/oxlint/base.d.ts.map +0 -1
- package/dist/src/configs/oxlint/index.d.ts +0 -4
- package/dist/src/configs/oxlint/index.d.ts.map +0 -1
- package/dist/src/configs/oxlint/lib.d.ts.map +0 -1
- package/dist/src/configs/oxlint/next.d.ts.map +0 -1
- package/dist/src/configs/oxlint/types.d.ts +0 -2
- package/dist/src/configs/oxlint/types.d.ts.map +0 -1
- package/dist/src/lib/index.d.ts +0 -5
- package/dist/src/lib/index.d.ts.map +0 -1
- package/dist/src/lib/types.d.ts.map +0 -1
- package/dist/src/lib/utils.d.ts +0 -8
- package/dist/src/lib/utils.d.ts.map +0 -1
- package/dist/src/plugins/vite/index.d.ts +0 -2
- package/dist/src/plugins/vite/index.d.ts.map +0 -1
- package/dist/src/types/index.d.ts +0 -2
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/types/shared.d.ts +0 -34
- package/dist/src/types/shared.d.ts.map +0 -1
- package/dist/vite-plugins.js +0 -22
- package/dist/vite-plugins.js.map +0 -1
- /package/dist/{src/configs → configs}/ts/base.json +0 -0
- /package/dist/{src/configs → configs}/ts/lib.json +0 -0
- /package/dist/{src/configs → configs}/ts/next.json +0 -0
- /package/dist/{src/lib → lib}/debounce.d.ts +0 -0
- /package/dist/{src/lib → lib}/debounce.d.ts.map +0 -0
- /package/dist/{src/lib → lib}/logger.d.ts +0 -0
- /package/dist/{src/lib → lib}/logger.d.ts.map +0 -0
- /package/dist/{src/lib → lib}/types.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/vite/copy-folders.d.ts +0 -0
- /package/dist/{types.js → types/util.js} +0 -0
package/package.json
CHANGED
|
@@ -1,66 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jadeja/ts",
|
|
3
3
|
"description": "an opinionated TypeScript toolkit",
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
|
-
"./configs/oxfmt": {
|
|
8
|
-
"types": "./dist/src/configs/oxfmt/index.d.ts",
|
|
9
|
-
"import": "./dist/oxfmt.js",
|
|
10
|
-
"default": "./dist/oxfmt.js",
|
|
11
|
-
"require": "./dist/oxfmt.js"
|
|
12
|
-
},
|
|
13
|
-
"./configs/oxfmt/types": {
|
|
14
|
-
"types": "./dist/src/configs/oxfmt/types.d.ts"
|
|
15
|
-
},
|
|
16
|
-
"./configs/oxlint": {
|
|
17
|
-
"types": "./dist/src/configs/oxlint/index.d.ts",
|
|
18
|
-
"import": "./dist/oxlint.js",
|
|
19
|
-
"default": "./dist/oxlint.js",
|
|
20
|
-
"require": "./dist/oxlint.js"
|
|
21
|
-
},
|
|
22
|
-
"./configs/oxlint/types": {
|
|
23
|
-
"types": "./dist/src/configs/oxlint/types.d.ts"
|
|
24
|
-
},
|
|
25
7
|
"./configs/ts/*": {
|
|
26
|
-
"import": "./dist/
|
|
27
|
-
"default": "./dist/
|
|
28
|
-
"require": "./dist/src/configs/ts/*.json"
|
|
8
|
+
"import": "./dist/configs/ts/*.json",
|
|
9
|
+
"default": "./dist/configs/ts/*.json"
|
|
29
10
|
},
|
|
30
|
-
"./
|
|
31
|
-
"types": "./dist/
|
|
32
|
-
"import": "./dist/
|
|
33
|
-
"default": "./dist/
|
|
34
|
-
"require": "./dist/lib.js"
|
|
11
|
+
"./configs/*": {
|
|
12
|
+
"types": "./dist/configs/*.d.ts",
|
|
13
|
+
"import": "./dist/configs/*.js",
|
|
14
|
+
"default": "./dist/configs/*.js"
|
|
35
15
|
},
|
|
36
|
-
"./
|
|
37
|
-
"types": "./dist/
|
|
38
|
-
"import": "./dist/
|
|
39
|
-
"default": "./dist/
|
|
40
|
-
"require": "./dist/vite-plugins.js"
|
|
16
|
+
"./lib/*": {
|
|
17
|
+
"types": "./dist/lib/*.d.ts",
|
|
18
|
+
"import": "./dist/lib/*.js",
|
|
19
|
+
"default": "./dist/lib/*.js"
|
|
41
20
|
},
|
|
42
|
-
"./
|
|
43
|
-
"types": "./dist/
|
|
21
|
+
"./plugins/*": {
|
|
22
|
+
"types": "./dist/plugins/*.d.ts",
|
|
23
|
+
"import": "./dist/plugins/*.js",
|
|
24
|
+
"default": "./dist/plugins/*.js"
|
|
25
|
+
},
|
|
26
|
+
"./types/*": {
|
|
27
|
+
"types": "./dist/types/*.d.ts",
|
|
28
|
+
"import": "./dist/types/*.d.ts",
|
|
29
|
+
"default": "./dist/types/*.d.ts"
|
|
44
30
|
}
|
|
45
31
|
},
|
|
46
32
|
"devDependencies": {
|
|
47
33
|
"@types/node": "^24.6.2",
|
|
34
|
+
"glob": "^13.0.6",
|
|
48
35
|
"husky": "^9.1.7",
|
|
49
|
-
"lint-staged": "^17.0.
|
|
36
|
+
"lint-staged": "^17.0.7",
|
|
50
37
|
"oxfmt": "^0.48.0",
|
|
51
|
-
"oxlint": "^1.
|
|
38
|
+
"oxlint": "^1.65.0",
|
|
52
39
|
"oxlint-tsgolint": "^0.22.1",
|
|
53
40
|
"typescript": "^6.0.3",
|
|
54
|
-
"unplugin-dts": "^1.0.
|
|
55
|
-
"vite": "^8.0.
|
|
41
|
+
"unplugin-dts": "^1.0.2",
|
|
42
|
+
"vite": "^8.0.16"
|
|
56
43
|
},
|
|
57
44
|
"peerDependencies": {
|
|
58
|
-
"
|
|
59
|
-
"
|
|
45
|
+
"oxfmt": "^0.48.0",
|
|
46
|
+
"oxlint": "^1.65.0",
|
|
47
|
+
"oxlint-tsgolint": "^0.22.1"
|
|
60
48
|
},
|
|
61
49
|
"keywords": [
|
|
62
50
|
"ts",
|
|
63
|
-
"
|
|
51
|
+
"toolkit",
|
|
64
52
|
"typescript",
|
|
65
53
|
"configs",
|
|
66
54
|
"oxfmt",
|
|
@@ -113,7 +101,7 @@
|
|
|
113
101
|
"scripts": {
|
|
114
102
|
"check": "tsc && oxfmt --check --disable-nested-config && oxlint --disable-nested-config",
|
|
115
103
|
"fix": "oxlint --fix --disable-nested-config && oxfmt --disable-nested-config",
|
|
116
|
-
"build": "vite build",
|
|
117
|
-
"publish-it": "pnpm publish --tag alpha --access public --no-git-checks"
|
|
104
|
+
"build": "pnpm check && vite build",
|
|
105
|
+
"publish-it": "pnpm build && pnpm publish --tag alpha --access public --no-git-checks"
|
|
118
106
|
}
|
|
119
107
|
}
|
package/dist/lib.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//#region src/lib/logger.ts
|
|
2
|
-
var e = (e) => {
|
|
3
|
-
let t;
|
|
4
|
-
throw t = e instanceof Error ? e.message : typeof e == "string" ? e : String(e), Error(t);
|
|
5
|
-
}, { log: t } = console, n = (e = "-", n = 50) => {
|
|
6
|
-
t(e.repeat(n));
|
|
7
|
-
}, r = (e) => {
|
|
8
|
-
t(`\n${e}\n`);
|
|
9
|
-
}, { warn: i } = console, a = (e) => {
|
|
10
|
-
i(`\n${e}\n`);
|
|
11
|
-
}, o = (e) => typeof e == "string", s = (e) => typeof e == "number", c = (e) => typeof e == "function", l = (e) => Array.isArray(e), u = (e) => !!e && typeof e == "object" && !l(e), d = (t, n) => {
|
|
12
|
-
if (!u(t)) return e("target must be an object");
|
|
13
|
-
if (!u(n)) return e("source must be an object");
|
|
14
|
-
for (let e in n) e in t && u(t[e]) && u(n[e]) ? d(t[e], n[e]) : t[e] = n[e];
|
|
15
|
-
return t;
|
|
16
|
-
}, f = (n) => {
|
|
17
|
-
try {
|
|
18
|
-
if (u(n)) return { ...structuredClone(n) };
|
|
19
|
-
if (l(n)) return [...structuredClone(n)];
|
|
20
|
-
} catch (n) {
|
|
21
|
-
t("Any part of the input data is not serializable."), e(n);
|
|
22
|
-
}
|
|
23
|
-
return n;
|
|
24
|
-
}, p = (e) => new RegExp(e), m, h = (e, t = 1e3) => {
|
|
25
|
-
clearTimeout(m), m = setTimeout(() => {
|
|
26
|
-
e(), clearTimeout(m);
|
|
27
|
-
}, t);
|
|
28
|
-
}, g = async (e = 250) => new Promise((t) => {
|
|
29
|
-
setTimeout(() => {
|
|
30
|
-
t();
|
|
31
|
-
}, e);
|
|
32
|
-
});
|
|
33
|
-
//#endregion
|
|
34
|
-
export { h as debounce, f as deepCopy, d as deepMergeObj, p as freshRegex, l as isArr, c as isFn, s as isNum, u as isObj, o as isStr, t as log, n as logDivider, r as logNewLine, g as sleep, e as throwError, i as warn, a as warnNewLine };
|
|
35
|
-
|
|
36
|
-
//# sourceMappingURL=lib.js.map
|
package/dist/lib.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","names":[],"sources":["../src/lib/logger.ts","../src/lib/types.ts","../src/lib/operations.ts","../src/lib/debounce.ts","../src/lib/utils.ts"],"sourcesContent":["/**\n * throws an error with the provided message.\n *\n * @param err - The error message to throw.\n */\nexport const throwError = <T>(err: T) => {\n //\n let errMsg: string;\n\n if (err instanceof Error) {\n errMsg = err.message;\n } else if (typeof err === \"string\") {\n errMsg = err;\n } else {\n errMsg = String(err);\n }\n\n throw new Error(errMsg);\n};\n\n/* ============================================================================================= */\n\n/**\n * logs a message to the console.\n *\n * @param msg - The message to log.\n */\nexport const { log } = console;\n\n/* ============================================================================================= */\n\n/**\n * logs a divider line to the console.\n *\n * @param divider - The character to use for the divider (default is \"-\").\n * @param count - The number of times to repeat the divider character (default is 50).\n */\nexport const logDivider = (divider = \"-\", count = 50) => {\n log(divider.repeat(count));\n};\n\n/* ============================================================================================= */\n\n/**\n * logs a new line with an optional message to the console.\n *\n * @param msg - The message to include in the new line (optional).\n */\nexport const logNewLine = <T>(msg?: T) => {\n log(`\\n${msg}\\n`);\n};\n\n/* ============================================================================================= */\n\n/**\n * logs a warning message to the console.\n *\n * @param msg - The warning message to log.\n */\nexport const { warn } = console;\n\n/* ============================================================================================= */\n\n/**\n * logs a new line with an optional warning message to the console.\n *\n * @param msg - The warning message to include in the new line (optional).\n */\nexport const warnNewLine = <T>(msg?: T) => {\n warn(`\\n${msg}\\n`);\n};\n","/**\n * checks if the provided data is a string.\n *\n * @param arg - The data to check.\n *\n * @returns `true` if the data is a string, otherwise `false`.\n */\nexport const isStr = <T>(arg: T) => typeof arg === \"string\";\n\n/* ============================================================================================= */\n\n/**\n * checks if the provided data is a number.\n *\n * @param arg - The data to check.\n *\n * @returns `true` if the data is a number, otherwise `false`.\n */\nexport const isNum = <T>(arg: T) => typeof arg === \"number\";\n\n/* ============================================================================================= */\n\n/**\n * checks if the provided data is a function.\n *\n * @param arg - The data to check.\n *\n * @returns `true` if the data is a function, otherwise `false`.\n */\nexport const isFn = <T>(arg: T) => typeof arg === \"function\";\n\n/* ============================================================================================= */\n\n/**\n * checks if the provided data is an array.\n *\n * @param arg - The data to check.\n *\n * @returns `true` if the data is an array, otherwise `false`.\n */\nexport const isArr = <T>(arg: T) => Array.isArray(arg);\n\n/* ============================================================================================= */\n\n/**\n * checks if the provided data is an object (not an array, or null).\n *\n * @param arg - The data to check.\n *\n * @returns `true` if the data is an object, otherwise `false`.\n */\nexport const isObj = <T>(arg: T) => Boolean(arg) && typeof arg === \"object\" && !isArr(arg);\n","import { log, throwError } from \"./logger.ts\";\nimport { isArr, isObj } from \"./types.ts\";\n\n/* ============================================================================================= */\n\n/**\n * recursively merges the properties of the source object into the target object.\n *\n * @param target - The target object to merge into. Must be an object.\n * @param source - The source object to merge from. Must be an object.\n *\n * @returns `source` object deep (nested) merge into `target` object.\n *\n * @throws If either `target` or `source` is not an object.\n */\nexport const deepMergeObj = <T, U>(target: T, source: U) => {\n //\n if (!isObj(target)) {\n return throwError(\"target must be an object\");\n }\n if (!isObj(source)) {\n return throwError(\"source must be an object\");\n }\n\n for (const key in source) {\n // oxlint-disable typescript/no-unsafe-member-access\n if (key in (target as never) && isObj((target as never)[key]) && isObj(source[key])) {\n // oxlint-disable typescript/no-unsafe-member-access\n deepMergeObj<typeof target, typeof source>((target as never)[key], (source as never)[key]);\n } else {\n // oxlint-disable typescript/no-unsafe-member-access, typescript/no-explicit-any\n (target as any)[key] = source[key];\n }\n }\n\n return target as T & U;\n};\n\n/* ============================================================================================= */\n\n/**\n * creates a deep copy of the given data using `structuredClone`.\n *\n * If the input is not an object or array, the original data is returned.\n *\n * @param data - The data to be copied. Can be an object or array.\n *\n * @returns A deep copy of the input data.\n *\n * @throws If any part of the input data is not serializable.\n */\nexport const deepCopy = <T>(data: T): T => {\n //\n try {\n //\n if (isObj(data)) {\n return { ...structuredClone(data) };\n } else if (isArr(data)) {\n return [...structuredClone(data)] as T;\n }\n //\n } catch (error) {\n log(\"Any part of the input data is not serializable.\");\n throwError(error);\n }\n\n return data;\n};\n\n/* ============================================================================================= */\n\n/**\n * returns a fresh RegExp instance cloned from the provided input. This ensures the internal\n * `lastIndex` state is reset to `0`, making the regex safe to reuse with stateful flags like `g` or\n * `y` across multiple operations (e.g. `test`, `replace`, `exec`), particularly in long-lived\n * runtimes such as HMR or shared modules.\n *\n * The returned RegExp preserves: - pattern source - flags (g, i, m, s, u, y, d, etc.)\n *\n * @example\n * -fresh(LCH_COLOR_FORMAT_PATTERN).test(rawColor);\n * -text.replace(fresh(LCH_COLOR_FORMAT_PATTERN), transformer);\n *\n * @param regex - The RegExp instance to clone.\n *\n * @returns A new RegExp instance with identical pattern and flags.\n */\n// reset lastIndex via new instance\nexport const freshRegex = (regex: RegExp) => new RegExp(regex);\n","// global variable for this module instance\nlet timer: ReturnType<typeof setTimeout>;\n\n/**\n * prevent duplicate function call in specified time period\n *\n * @param fn - an anonymous function to delay execution\n * @param delay - delay for provided function execution (default `1000` in milliseconds)\n */\nconst debounce = (fn: () => void, delay = 1000) => {\n //\n clearTimeout(timer);\n\n timer = setTimeout(() => {\n fn();\n clearTimeout(timer);\n }, delay);\n};\n\n/* ============================================================================================= */\n\nexport default debounce;\n","export { default as debounce } from \"./debounce.ts\";\n\n/**\n * put the app to sleep for defined time for artificial delay to improve the UX\n *\n * @param time - time for artificial delay (default `250)\n */\n// oxlint-disable eslint/require-await\nexport const sleep = async (time = 250): Promise<void> =>\n new Promise<void>((resolve) => {\n setTimeout(() => {\n resolve();\n }, time);\n });\n"],"mappings":";AAKA,IAAa,KAAiB,MAAW;CAEvC,IAAI;CAUJ,MARA,AAKE,IALE,aAAe,QACR,EAAI,UACJ,OAAO,KAAQ,WACf,IAEA,OAAO,EAAI,EAGZ,MAAM,EAAO;GAUZ,EAAE,WAAQ,SAUV,KAAc,IAAU,KAAK,IAAQ,OAAO;CACvD,EAAI,EAAQ,OAAO,EAAM,CAAC;GAUf,KAAiB,MAAY;CACxC,EAAI,KAAK,EAAI,IAAI;GAUN,EAAE,YAAS,SASX,KAAkB,MAAY;CACzC,EAAK,KAAK,EAAI,IAAI;GC9DP,KAAY,MAAW,OAAO,KAAQ,UAWtC,KAAY,MAAW,OAAO,KAAQ,UAWtC,KAAW,MAAW,OAAO,KAAQ,YAWrC,KAAY,MAAW,MAAM,QAAQ,EAAI,EAWzC,KAAY,MAAW,EAAQ,KAAQ,OAAO,KAAQ,YAAY,CAAC,EAAM,EAAI,ECpC7E,KAAsB,GAAW,MAAc;CAE1D,IAAI,CAAC,EAAM,EAAO,EAChB,OAAO,EAAW,2BAA2B;CAE/C,IAAI,CAAC,EAAM,EAAO,EAChB,OAAO,EAAW,2BAA2B;CAG/C,KAAK,IAAM,KAAO,GAEhB,AAAI,KAAQ,KAAoB,EAAO,EAAiB,GAAK,IAAI,EAAM,EAAO,GAAK,GAEjF,EAA4C,EAAiB,IAAO,EAAiB,GAAK,GAG1F,EAAgB,KAAO,EAAO;CAIlC,OAAO;GAgBI,KAAe,MAAe;CAEzC,IAAI;EAEF,IAAI,EAAM,EAAK,EACb,OAAO,EAAE,GAAG,gBAAgB,EAAK,EAAE;EAC9B,IAAI,EAAM,EAAK,EACpB,OAAO,CAAC,GAAG,gBAAgB,EAAK,CAAC;UAG5B,GAAO;EAEd,AADA,EAAI,kDAAkD,EACtD,EAAW,EAAM;;CAGnB,OAAO;GAsBI,KAAc,MAAkB,IAAI,OAAO,EAAM,ECvF1D,GAQE,KAAY,GAAgB,IAAQ,QAAS;CAIjD,AAFA,aAAa,EAAM,EAEnB,IAAQ,iBAAiB;EAEvB,AADA,GAAI,EACJ,aAAa,EAAM;IAClB,EAAM;GCRE,IAAQ,OAAO,IAAO,QACjC,IAAI,SAAe,MAAY;CAC7B,iBAAiB;EACf,GAAS;IACR,EAAK;EACR"}
|
package/dist/oxfmt.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oxfmt.js","names":[],"sources":["../src/configs/oxfmt/base.ts","../src/configs/oxfmt/lib.ts","../src/configs/oxfmt/next.ts"],"sourcesContent":["import type { OxfmtConfig } from \"./types.ts\";\n\n/* ============================================================================================= */\n\nconst base = {\n arrowParens: \"always\",\n bracketSpacing: true,\n endOfLine: \"lf\",\n ignorePatterns: [],\n insertFinalNewline: true,\n jsdoc: {\n addDefaultToDescription: true,\n bracketSpacing: true,\n capitalizeDescriptions: false,\n commentLineStrategy: \"multiline\",\n descriptionTag: false,\n descriptionWithDot: false,\n keepUnparsableExampleIndent: true,\n lineWrappingStyle: \"greedy\",\n preferCodeFences: true,\n separateReturnsFromParam: true,\n separateTagGroups: true,\n },\n objectWrap: \"preserve\",\n printWidth: 100,\n proseWrap: \"always\",\n quoteProps: \"as-needed\",\n semi: true,\n singleQuote: false,\n sortImports: {\n groups: [\n [\"default-builtin\", \"named-builtin\"],\n \"wildcard-external\",\n [\"default-external\", \"named-external\"],\n [\"default-internal\", \"named-internal\"],\n [\"default-parent\", \"named-parent\"],\n [\"default-sibling\", \"named-sibling\"],\n [\"default-index\", \"named-index\"],\n \"unknown\",\n \"type-external\",\n \"type-internal\",\n \"type-parent\",\n \"type-sibling\",\n ],\n ignoreCase: true,\n internalPattern: [\"@/\"],\n newlinesBetween: true,\n order: \"asc\",\n partitionByComment: true,\n partitionByNewline: false,\n sortSideEffects: false,\n },\n sortPackageJson: false,\n tabWidth: 2,\n trailingComma: \"all\",\n useTabs: false,\n} satisfies OxfmtConfig;\n\n/* ============================================================================================= */\n\nexport default base;\n","import base from \"./base.ts\";\n\nimport type { OxfmtConfig } from \"./types.ts\";\n\n/* ============================================================================================= */\n\nconst lib = { ...base } satisfies OxfmtConfig;\n\n/* ============================================================================================= */\n\nexport default lib;\n","import base from \"./base.ts\";\n\nimport type { OxfmtConfig } from \"./types.ts\";\n\n/* ============================================================================================= */\n\nconst next = {\n ...base,\n bracketSameLine: false,\n embeddedLanguageFormatting: \"auto\",\n htmlWhitespaceSensitivity: \"css\",\n jsxSingleQuote: false,\n singleAttributePerLine: false,\n} satisfies OxfmtConfig;\n\n/* ============================================================================================= */\n\nexport default next;\n"],"mappings":";AAIA,IAAM,IAAO;CACX,aAAa;CACb,gBAAgB;CAChB,WAAW;CACX,gBAAgB,EAAE;CAClB,oBAAoB;CACpB,OAAO;EACL,yBAAyB;EACzB,gBAAgB;EAChB,wBAAwB;EACxB,qBAAqB;EACrB,gBAAgB;EAChB,oBAAoB;EACpB,6BAA6B;EAC7B,mBAAmB;EACnB,kBAAkB;EAClB,0BAA0B;EAC1B,mBAAmB;EACpB;CACD,YAAY;CACZ,YAAY;CACZ,WAAW;CACX,YAAY;CACZ,MAAM;CACN,aAAa;CACb,aAAa;EACX,QAAQ;GACN,CAAC,mBAAmB,gBAAgB;GACpC;GACA,CAAC,oBAAoB,iBAAiB;GACtC,CAAC,oBAAoB,iBAAiB;GACtC,CAAC,kBAAkB,eAAe;GAClC,CAAC,mBAAmB,gBAAgB;GACpC,CAAC,iBAAiB,cAAc;GAChC;GACA;GACA;GACA;GACA;GACD;EACD,YAAY;EACZ,iBAAiB,CAAC,KAAK;EACvB,iBAAiB;EACjB,OAAO;EACP,oBAAoB;EACpB,oBAAoB;EACpB,iBAAiB;EAClB;CACD,iBAAiB;CACjB,UAAU;CACV,eAAe;CACf,SAAS;CACV,EClDK,IAAM,EAAE,GAAG,GAAM,ECAjB,IAAO;CACX,GAAG;CACH,iBAAiB;CACjB,4BAA4B;CAC5B,2BAA2B;CAC3B,gBAAgB;CAChB,wBAAwB;CACzB"}
|
package/dist/oxlint.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.js","names":[],"sources":["../src/configs/oxlint/base.ts","../src/configs/oxlint/lib.ts","../src/configs/oxlint/next.ts"],"sourcesContent":["import type { OxlintConfig } from \"./types.ts\";\n\n/* ============================================================================================= */\n\nconst base = {\n categories: {\n correctness: \"error\",\n nursery: \"warn\",\n pedantic: \"error\",\n perf: \"error\",\n restriction: \"error\",\n style: \"error\",\n suspicious: \"error\",\n },\n env: {\n builtin: true,\n node: true,\n },\n options: {\n denyWarnings: false,\n reportUnusedDisableDirectives: \"error\",\n respectEslintDisableDirectives: false,\n typeAware: true,\n typeCheck: false,\n },\n plugins: [\"eslint\", \"import\", \"jsdoc\", \"node\", \"oxc\", \"promise\", \"typescript\", \"unicorn\"],\n rules: {\n \"capitalized-comments\": [\n \"error\",\n \"never\",\n {\n block: {\n ignorePattern: \"/\\\\/\\\\*\\\\s*=+\\\\s*[\\\\r\\\\n]+(?:[\\\\s\\\\S]*?)[\\\\r\\\\n]+\\\\s*=+\\\\s*\\\\*\\\\//m\",\n },\n ignorePattern: \"^([A-Z]{2,}|[A-Z][A-Z0-9_-]*)(\\\\b|:)\",\n },\n ],\n \"eslint/class-methods-use-this\": \"off\",\n \"eslint/complexity\": [\"error\", { max: 30 }],\n \"eslint/id-length\": [\n \"error\",\n {\n checkGeneric: false,\n exceptions: [\"a\", \"b\", \"i\", \"j\", \"K\", \"T\", \"U\", \"x\"],\n },\n ],\n \"eslint/init-declarations\": \"off\",\n \"eslint/max-lines-per-function\": [\n \"error\",\n { max: 120, skipBlankLines: true, skipComments: true },\n ],\n \"eslint/max-params\": [\"error\", { max: 4 }],\n \"eslint/max-statements\": [\"error\", { max: 40 }],\n \"eslint/no-await-in-loop\": \"off\",\n \"eslint/no-continue\": \"off\",\n \"eslint/no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"eslint/no-magic-numbers\": \"off\",\n \"eslint/no-plusplus\": \"off\",\n \"eslint/no-ternary\": \"off\",\n \"eslint/no-underscore-dangle\": [\"error\", { allow: [] }],\n \"eslint/no-use-before-define\": \"off\",\n \"eslint/no-warning-comments\": \"off\",\n \"eslint/require-unicode-regexp\": \"off\",\n \"eslint/sort-imports\": \"off\",\n \"eslint/sort-keys\": \"off\",\n \"import/exports-last\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/max-dependencies\": [\"error\", { max: 30 }],\n \"import/no-default-export\": \"off\",\n \"import/no-named-default\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"jsdoc/require-param-type\": \"off\",\n \"jsdoc/require-returns\": \"off\",\n \"jsdoc/require-returns-type\": \"off\",\n \"no-unused-vars\": [\n \"error\",\n {\n args: \"all\",\n argsIgnorePattern: \"^_\",\n caughtErrors: \"all\",\n caughtErrorsIgnorePattern: \"^_\",\n destructuredArrayIgnorePattern: \"^_\",\n },\n ],\n \"oxc/no-async-await\": \"off\",\n \"oxc/no-optional-chaining\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"promise/avoid-new\": \"off\",\n \"typescript/explicit-function-return-type\": \"off\",\n \"typescript/explicit-module-boundary-types\": \"off\",\n \"typescript/no-inferrable-types\": \"off\",\n \"typescript/no-unnecessary-condition\": \"off\",\n \"typescript/no-unnecessary-type-parameters\": \"off\",\n \"typescript/no-unsafe-type-assertion\": \"off\",\n \"typescript/no-useless-default-assignment\": \"off\",\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"typescript/restrict-template-expressions\": \"off\",\n \"typescript/strict-boolean-expressions\": \"off\",\n \"unicorn/no-null\": \"off\",\n \"unicorn/no-lonely-if\": \"off\",\n \"unicorn/switch-case-braces\": \"off\",\n },\n} satisfies OxlintConfig;\n\n/* ============================================================================================= */\n\nexport default base;\n","import base from \"./base.ts\";\n\nimport type { OxlintConfig } from \"./types.ts\";\n\n/* ============================================================================================= */\n\nconst eslintIdLength = base.rules[\"eslint/id-length\"];\neslintIdLength[1].exceptions = [...eslintIdLength[1].exceptions, \"h\", \"m\", \"p\", \"w\", \"y\", \"z\"];\n\nconst lib = {\n ...base,\n rules: {\n ...base.rules,\n \"eslint/id-length\": eslintIdLength,\n },\n} satisfies OxlintConfig;\n\n/* ============================================================================================= */\n\nexport default lib;\n","import base from \"./base.ts\";\n\nimport type { OxlintConfig } from \"./types.ts\";\n\n/* ============================================================================================= */\n\nconst next = {\n ...base,\n env: {\n ...base.env,\n browser: true,\n },\n jsPlugins: [\n {\n name: \"react-hooks-js\",\n specifier: \"eslint-plugin-react-hooks\",\n },\n ],\n plugins: [...base.plugins, \"jsx-a11y\", \"nextjs\", \"react\", \"react-perf\"],\n rules: {\n ...base.rules,\n \"eslint/no-undefined\": \"off\",\n \"import/no-unassigned-import\": [\"error\", { allow: [\"**/*.css\"] }],\n \"react/forbid-component-props\": [\"error\", { forbid: [\"style\"] }],\n \"react/jsx-filename-extension\": [\"error\", { extensions: [\"jsx\", \"tsx\"] }],\n \"react/jsx-pascal-case\": [\"error\", { allowAllCaps: true }],\n \"react/jsx-props-no-spreading\": \"off\",\n \"react/jsx-max-depth\": [\"error\", { max: 6 }],\n \"react/no-multi-comp\": [\"error\", { ignoreStateless: true }],\n \"react/only-export-components\": [\n \"error\",\n {\n allowExportNames: [\n \"dynamicParams\",\n \"generateMetadata\",\n \"generateStaticParams\",\n \"metadata\",\n \"variants\",\n ],\n },\n ],\n \"react/react-in-jsx-scope\": \"off\",\n \"react-hooks-js/error-boundaries\": \"error\",\n \"react-hooks-js/config\": \"error\",\n \"react-hooks-js/globals\": \"error\",\n \"react-hooks-js/immutability\": \"error\",\n \"react-hooks-js/incompatible-library\": \"error\",\n \"react-hooks-js/preserve-manual-memoization\": \"error\",\n \"react-hooks-js/purity\": \"error\",\n \"react-hooks-js/refs\": \"error\",\n \"react-hooks-js/set-state-in-effect\": \"error\",\n \"react-hooks-js/set-state-in-render\": \"error\",\n \"react-hooks-js/static-components\": \"error\",\n \"react-hooks-js/unsupported-syntax\": \"error\",\n \"react-hooks-js/use-memo\": \"error\",\n \"react-perf/jsx-no-jsx-as-prop\": \"off\",\n \"react-perf/jsx-no-new-array-as-prop\": \"off\",\n \"react-perf/jsx-no-new-function-as-prop\": \"off\",\n \"react-perf/jsx-no-new-object-as-prop\": \"off\",\n },\n} satisfies OxlintConfig;\n\n/* ============================================================================================= */\n\nexport default next;\n"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/configs/oxfmt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/configs/oxfmt/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/configs/oxlint/base.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmGc,CAAC;AAIzB,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/configs/oxlint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../../src/configs/oxlint/lib.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMe,CAAC;AAIzB,eAAe,GAAG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../../src/configs/oxlint/next.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDc,CAAC;AAIzB,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/configs/oxlint/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC"}
|
package/dist/src/lib/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { throwError, log, logDivider, logNewLine, warn, warnNewLine } from './logger.ts';
|
|
2
|
-
export { deepCopy, deepMergeObj, freshRegex } from './operations.ts';
|
|
3
|
-
export { isArr, isFn, isNum, isObj, isStr } from './types.ts';
|
|
4
|
-
export { debounce, sleep } from './utils.ts';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,KAAK,CAAC,sBAA4B,CAAC;AAI5D;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,KAAK,CAAC,sBAA4B,CAAC;AAI5D;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,KAAK,CAAC,wBAA8B,CAAC;AAI7D;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,KAAK,CAAC,qBAAuB,CAAC;AAIvD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,KAAK,CAAC,YAA2D,CAAC"}
|
package/dist/src/lib/utils.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { default as debounce } from './debounce.ts';
|
|
2
|
-
/**
|
|
3
|
-
* put the app to sleep for defined time for artificial delay to improve the UX
|
|
4
|
-
*
|
|
5
|
-
* @param time - time for artificial delay (default `250)
|
|
6
|
-
*/
|
|
7
|
-
export declare const sleep: (time?: number) => Promise<void>;
|
|
8
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;GAIG;AAEH,eAAO,MAAM,KAAK,GAAU,aAAU,KAAG,OAAO,CAAC,IAAI,CAKjD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/vite/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,gBAAgB,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* recursive object where each key maps to a nested object or a final value.
|
|
3
|
-
*/
|
|
4
|
-
export interface NestedObject<T> {
|
|
5
|
-
/**
|
|
6
|
-
* dynamic key for a nested branch or leaf value.
|
|
7
|
-
*/
|
|
8
|
-
[key: string]: NestedObject<T> | T;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* primitive data types
|
|
12
|
-
*/
|
|
13
|
-
export type Primitive = string | number | boolean | bigint | symbol | null | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* widen any type to primitive
|
|
16
|
-
*/
|
|
17
|
-
export type WidenPrimitive<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends bigint ? bigint : T extends symbol ? symbol : T;
|
|
18
|
-
/**
|
|
19
|
-
* enhance auto-complete
|
|
20
|
-
*
|
|
21
|
-
* TODO: fina a better and correct way
|
|
22
|
-
*/
|
|
23
|
-
export type PrimitiveWithAutocomplete<T> = T extends string ? T | (string & {}) : T extends number ? T | (number & {}) : T extends boolean ? T : T extends bigint ? T | (bigint & {}) : T extends symbol ? T | (symbol & {}) : T;
|
|
24
|
-
/**
|
|
25
|
-
* extend the narrow types
|
|
26
|
-
*
|
|
27
|
-
* TODO: find a better and correct way
|
|
28
|
-
*/
|
|
29
|
-
export type Extend<T> = T extends (...args: any[]) => any ? T : T extends (infer U)[] ? Extend<U>[] : T extends object ? {
|
|
30
|
-
-readonly [K in keyof T]?: Extend<T[K]>;
|
|
31
|
-
} & {
|
|
32
|
-
[key: string]: Extend<WidenPrimitive<T[keyof T]>> | Primitive;
|
|
33
|
-
} : PrimitiveWithAutocomplete<T>;
|
|
34
|
-
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/types/shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAC5C,MAAM,GACN,CAAC,SAAS,MAAM,GACd,MAAM,GACN,CAAC,SAAS,OAAO,GACf,OAAO,GACP,CAAC,SAAS,MAAM,GACd,MAAM,GACN,CAAC,SAAS,MAAM,GACd,MAAM,GACN,CAAC,CAAC;AAEd;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAGrD,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GACnB,CAAC,SAAS,MAAM,GAGZ,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GACnB,CAAC,SAAS,OAAO,GACf,CAAC,GACD,CAAC,SAAS,MAAM,GAGZ,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GACnB,CAAC,SAAS,MAAM,GAGZ,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GACnB,CAAC,CAAC;AACd;;;;GAIG;AAEH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GACrD,CAAC,GACD,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GACnB,MAAM,CAAC,CAAC,CAAC,EAAE,GACX,CAAC,SAAS,MAAM,GACd;IACE,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACxC,GAAG;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CAC/D,GACD,yBAAyB,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/vite-plugins.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { copyFileSync as e, existsSync as t, mkdirSync as n, readdirSync as r } from "node:fs";
|
|
2
|
-
import { join as i, resolve as a } from "node:path";
|
|
3
|
-
//#region src/plugins/vite/copy-folders.ts
|
|
4
|
-
var o = (e, t) => ({
|
|
5
|
-
name: "vite-plugin-copy-folders",
|
|
6
|
-
apply: "build",
|
|
7
|
-
enforce: "post",
|
|
8
|
-
closeBundle() {
|
|
9
|
-
for (let n of t) s(a(e, n.src), a(e, n.dest));
|
|
10
|
-
}
|
|
11
|
-
}), s = (a, o) => {
|
|
12
|
-
t(o) || n(o, { recursive: !0 });
|
|
13
|
-
let c = r(a, { withFileTypes: !0 });
|
|
14
|
-
for (let t of c) {
|
|
15
|
-
let n = i(a, t.name), r = i(o, t.name);
|
|
16
|
-
t.isDirectory() ? s(n, r) : e(n, r);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
//#endregion
|
|
20
|
-
export { o as copyFolders };
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=vite-plugins.js.map
|
package/dist/vite-plugins.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugins.js","names":[],"sources":["../src/plugins/vite/copy-folders.ts"],"sourcesContent":["import { existsSync, mkdirSync, readdirSync, copyFileSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\n\n/* ============================================================================================= */\n\n/**\n * copies entire folders and its contents to a destination folders (post build)\n *\n * @param dirname - `import.meta.dirname`\n * @param folders - an array of folder object containing `src` and `dest` property\n */\nconst vitePluginCopyFolders = (dirname: string, folders: { src: string; dest: string }[]) => ({\n name: \"vite-plugin-copy-folders\",\n apply: \"build\",\n enforce: \"post\",\n\n closeBundle() {\n for (const folder of folders) {\n copyFolderSync(resolve(dirname, folder.src), resolve(dirname, folder.dest));\n }\n },\n});\n\n/* ============================================================================================= */\n\n/**\n * copies an entire folder and its contents to a destination folder\n *\n * If the destination directory does not exist, it will be created automatically.\n *\n * @param src - The source directory path.\n * @param dest - The destination directory path.\n */\nconst copyFolderSync = (src: string, dest: string) => {\n //\n if (!existsSync(dest)) {\n mkdirSync(dest, { recursive: true });\n }\n\n const entries = readdirSync(src, { withFileTypes: true });\n\n for (const entry of entries) {\n const srcPath = join(src, entry.name);\n const destPath = join(dest, entry.name);\n\n if (entry.isDirectory()) {\n copyFolderSync(srcPath, destPath);\n } else {\n copyFileSync(srcPath, destPath);\n }\n }\n};\n\n/* ============================================================================================= */\n\nexport default vitePluginCopyFolders;\n"],"mappings":";;;AAWA,IAAM,KAAyB,GAAiB,OAA8C;CAC5F,MAAM;CACN,OAAO;CACP,SAAS;CAET,cAAc;EACZ,KAAK,IAAM,KAAU,GACnB,EAAe,EAAQ,GAAS,EAAO,IAAI,EAAE,EAAQ,GAAS,EAAO,KAAK,CAAC;;CAGhF,GAYK,KAAkB,GAAa,MAAiB;CAEpD,AAAK,EAAW,EAAK,IACnB,EAAU,GAAM,EAAE,WAAW,IAAM,CAAC;CAGtC,IAAM,IAAU,EAAY,GAAK,EAAE,eAAe,IAAM,CAAC;CAEzD,KAAK,IAAM,KAAS,GAAS;EAC3B,IAAM,IAAU,EAAK,GAAK,EAAM,KAAK,EAC/B,IAAW,EAAK,GAAM,EAAM,KAAK;EAEvC,AAAI,EAAM,aAAa,GACrB,EAAe,GAAS,EAAS,GAEjC,EAAa,GAAS,EAAS"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|