@powerlines/plugin-automd 0.1.222 → 0.1.224

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.
Files changed (94) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +0 -2
  2. package/dist/index.cjs +5 -5
  3. package/dist/index.d.cts +2 -1
  4. package/dist/index.d.mts +1 -1
  5. package/dist/index.mjs +7 -7
  6. package/dist/types/plugin.d.cts +3 -3
  7. package/dist/types/plugin.d.mts +3 -3
  8. package/package.json +3 -3
  9. package/dist/_virtual/rolldown_runtime.mjs +0 -32
  10. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +0 -78
  11. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +0 -77
  12. package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.cjs +0 -5032
  13. package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs +0 -5031
  14. package/dist/node_modules/.pnpm/automd@0.4.2_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/shared/automd.CjwUz8DJ.cjs +0 -593
  15. package/dist/node_modules/.pnpm/automd@0.4.2_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/shared/automd.CjwUz8DJ.mjs +0 -590
  16. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.cjs +0 -23
  17. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs +0 -22
  18. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.cjs +0 -405
  19. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs +0 -404
  20. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +0 -46
  21. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +0 -45
  22. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.cjs +0 -204
  23. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs +0 -202
  24. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +0 -1013
  25. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +0 -1007
  26. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.cjs +0 -128
  27. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs +0 -123
  28. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.cjs +0 -41464
  29. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs +0 -41461
  30. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.cjs +0 -4387
  31. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs +0 -4384
  32. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.cjs +0 -26
  33. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs +0 -26
  34. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.cjs +0 -370
  35. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs +0 -367
  36. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +0 -939
  37. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +0 -939
  38. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.cjs +0 -67
  39. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs +0 -64
  40. package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.cjs +0 -1292
  41. package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.mjs +0 -1284
  42. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -179
  43. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -179
  44. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +0 -20
  45. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +0 -18
  46. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +0 -3975
  47. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +0 -3961
  48. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.cjs +0 -16
  49. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +0 -14
  50. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.cjs +0 -36
  51. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs +0 -33
  52. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.cjs +0 -227
  53. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs +0 -225
  54. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +0 -139
  55. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -133
  56. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +0 -77
  57. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +0 -76
  58. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.cjs +0 -72
  59. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs +0 -69
  60. package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.cjs +0 -181
  61. package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs +0 -178
  62. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.cjs +0 -12337
  63. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs +0 -12337
  64. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.cjs +0 -19
  65. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs +0 -18
  66. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.cjs +0 -71
  67. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs +0 -71
  68. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.cjs +0 -110
  69. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs +0 -100
  70. package/dist/packages/powerlines/src/internal/helpers/hooks.d.mts +0 -49
  71. package/dist/packages/powerlines/src/types/api.d.mts +0 -104
  72. package/dist/packages/powerlines/src/types/babel.d.mts +0 -2
  73. package/dist/packages/powerlines/src/types/build.d.mts +0 -185
  74. package/dist/packages/powerlines/src/types/commands.d.mts +0 -9
  75. package/dist/packages/powerlines/src/types/config.d.mts +0 -425
  76. package/dist/packages/powerlines/src/types/context.d.mts +0 -514
  77. package/dist/packages/powerlines/src/types/fs.d.mts +0 -486
  78. package/dist/packages/powerlines/src/types/hooks.d.mts +0 -32
  79. package/dist/packages/powerlines/src/types/plugin.d.mts +0 -205
  80. package/dist/packages/powerlines/src/types/resolved.d.mts +0 -93
  81. package/dist/packages/powerlines/src/types/tsconfig.d.mts +0 -69
  82. package/dist/packages/powerlines/src/types/unplugin.d.mts +0 -23
  83. package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
  84. package/dist/powerlines/src/types/api.d.cts +0 -104
  85. package/dist/powerlines/src/types/build.d.cts +0 -185
  86. package/dist/powerlines/src/types/commands.d.cts +0 -8
  87. package/dist/powerlines/src/types/config.d.cts +0 -424
  88. package/dist/powerlines/src/types/context.d.cts +0 -514
  89. package/dist/powerlines/src/types/fs.d.cts +0 -486
  90. package/dist/powerlines/src/types/hooks.d.cts +0 -32
  91. package/dist/powerlines/src/types/plugin.d.cts +0 -205
  92. package/dist/powerlines/src/types/resolved.d.cts +0 -93
  93. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  94. package/dist/powerlines/src/types/unplugin.d.cts +0 -22
@@ -1,139 +0,0 @@
1
-
2
- //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
3
- const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
4
- function normalizeWindowsPath(input = "") {
5
- if (!input) return input;
6
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
7
- }
8
- const _UNC_REGEX = /^[/\\]{2}/;
9
- const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
10
- const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
11
- const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
12
- const normalize = function(path) {
13
- if (path.length === 0) return ".";
14
- path = normalizeWindowsPath(path);
15
- const isUNCPath = path.match(_UNC_REGEX);
16
- const isPathAbsolute = isAbsolute(path);
17
- const trailingSeparator = path[path.length - 1] === "/";
18
- path = normalizeString(path, !isPathAbsolute);
19
- if (path.length === 0) {
20
- if (isPathAbsolute) return "/";
21
- return trailingSeparator ? "./" : ".";
22
- }
23
- if (trailingSeparator) path += "/";
24
- if (_DRIVE_LETTER_RE.test(path)) path += "/";
25
- if (isUNCPath) {
26
- if (!isPathAbsolute) return `//./${path}`;
27
- return `//${path}`;
28
- }
29
- return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
30
- };
31
- const join = function(...segments) {
32
- let path = "";
33
- for (const seg of segments) {
34
- if (!seg) continue;
35
- if (path.length > 0) {
36
- const pathTrailing = path[path.length - 1] === "/";
37
- const segLeading = seg[0] === "/";
38
- if (pathTrailing && segLeading) path += seg.slice(1);
39
- else path += pathTrailing || segLeading ? seg : `/${seg}`;
40
- } else path += seg;
41
- }
42
- return normalize(path);
43
- };
44
- function cwd() {
45
- if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
46
- return "/";
47
- }
48
- const resolve = function(...arguments_) {
49
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
50
- let resolvedPath = "";
51
- let resolvedAbsolute = false;
52
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
53
- const path = index >= 0 ? arguments_[index] : cwd();
54
- if (!path || path.length === 0) continue;
55
- resolvedPath = `${path}/${resolvedPath}`;
56
- resolvedAbsolute = isAbsolute(path);
57
- }
58
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
59
- if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
60
- return resolvedPath.length > 0 ? resolvedPath : ".";
61
- };
62
- function normalizeString(path, allowAboveRoot) {
63
- let res = "";
64
- let lastSegmentLength = 0;
65
- let lastSlash = -1;
66
- let dots = 0;
67
- let char = null;
68
- for (let index = 0; index <= path.length; ++index) {
69
- if (index < path.length) char = path[index];
70
- else if (char === "/") break;
71
- else char = "/";
72
- if (char === "/") {
73
- if (lastSlash === index - 1 || dots === 1);
74
- else if (dots === 2) {
75
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
76
- if (res.length > 2) {
77
- const lastSlashIndex = res.lastIndexOf("/");
78
- if (lastSlashIndex === -1) {
79
- res = "";
80
- lastSegmentLength = 0;
81
- } else {
82
- res = res.slice(0, lastSlashIndex);
83
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
84
- }
85
- lastSlash = index;
86
- dots = 0;
87
- continue;
88
- } else if (res.length > 0) {
89
- res = "";
90
- lastSegmentLength = 0;
91
- lastSlash = index;
92
- dots = 0;
93
- continue;
94
- }
95
- }
96
- if (allowAboveRoot) {
97
- res += res.length > 0 ? "/.." : "..";
98
- lastSegmentLength = 2;
99
- }
100
- } else {
101
- if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
102
- else res = path.slice(lastSlash + 1, index);
103
- lastSegmentLength = index - lastSlash - 1;
104
- }
105
- lastSlash = index;
106
- dots = 0;
107
- } else if (char === "." && dots !== -1) ++dots;
108
- else dots = -1;
109
- }
110
- return res;
111
- }
112
- const isAbsolute = function(p) {
113
- return _IS_ABSOLUTE_RE.test(p);
114
- };
115
- const extname = function(p) {
116
- if (p === "..") return "";
117
- const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
118
- return match && match[1] || "";
119
- };
120
- const basename = function(p, extension) {
121
- const segments = normalizeWindowsPath(p).split("/");
122
- let lastSegment = "";
123
- for (let i = segments.length - 1; i >= 0; i--) {
124
- const val = segments[i];
125
- if (val) {
126
- lastSegment = val;
127
- break;
128
- }
129
- }
130
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
131
- };
132
-
133
- //#endregion
134
- exports.basename = basename;
135
- exports.extname = extname;
136
- exports.isAbsolute = isAbsolute;
137
- exports.join = join;
138
- exports.normalize = normalize;
139
- exports.resolve = resolve;
@@ -1,133 +0,0 @@
1
- //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
2
- const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
3
- function normalizeWindowsPath(input = "") {
4
- if (!input) return input;
5
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
6
- }
7
- const _UNC_REGEX = /^[/\\]{2}/;
8
- const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
9
- const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
10
- const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
11
- const normalize = function(path) {
12
- if (path.length === 0) return ".";
13
- path = normalizeWindowsPath(path);
14
- const isUNCPath = path.match(_UNC_REGEX);
15
- const isPathAbsolute = isAbsolute(path);
16
- const trailingSeparator = path[path.length - 1] === "/";
17
- path = normalizeString(path, !isPathAbsolute);
18
- if (path.length === 0) {
19
- if (isPathAbsolute) return "/";
20
- return trailingSeparator ? "./" : ".";
21
- }
22
- if (trailingSeparator) path += "/";
23
- if (_DRIVE_LETTER_RE.test(path)) path += "/";
24
- if (isUNCPath) {
25
- if (!isPathAbsolute) return `//./${path}`;
26
- return `//${path}`;
27
- }
28
- return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
29
- };
30
- const join = function(...segments) {
31
- let path = "";
32
- for (const seg of segments) {
33
- if (!seg) continue;
34
- if (path.length > 0) {
35
- const pathTrailing = path[path.length - 1] === "/";
36
- const segLeading = seg[0] === "/";
37
- if (pathTrailing && segLeading) path += seg.slice(1);
38
- else path += pathTrailing || segLeading ? seg : `/${seg}`;
39
- } else path += seg;
40
- }
41
- return normalize(path);
42
- };
43
- function cwd() {
44
- if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
45
- return "/";
46
- }
47
- const resolve = function(...arguments_) {
48
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
49
- let resolvedPath = "";
50
- let resolvedAbsolute = false;
51
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
52
- const path = index >= 0 ? arguments_[index] : cwd();
53
- if (!path || path.length === 0) continue;
54
- resolvedPath = `${path}/${resolvedPath}`;
55
- resolvedAbsolute = isAbsolute(path);
56
- }
57
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
58
- if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
59
- return resolvedPath.length > 0 ? resolvedPath : ".";
60
- };
61
- function normalizeString(path, allowAboveRoot) {
62
- let res = "";
63
- let lastSegmentLength = 0;
64
- let lastSlash = -1;
65
- let dots = 0;
66
- let char = null;
67
- for (let index = 0; index <= path.length; ++index) {
68
- if (index < path.length) char = path[index];
69
- else if (char === "/") break;
70
- else char = "/";
71
- if (char === "/") {
72
- if (lastSlash === index - 1 || dots === 1);
73
- else if (dots === 2) {
74
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
75
- if (res.length > 2) {
76
- const lastSlashIndex = res.lastIndexOf("/");
77
- if (lastSlashIndex === -1) {
78
- res = "";
79
- lastSegmentLength = 0;
80
- } else {
81
- res = res.slice(0, lastSlashIndex);
82
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
83
- }
84
- lastSlash = index;
85
- dots = 0;
86
- continue;
87
- } else if (res.length > 0) {
88
- res = "";
89
- lastSegmentLength = 0;
90
- lastSlash = index;
91
- dots = 0;
92
- continue;
93
- }
94
- }
95
- if (allowAboveRoot) {
96
- res += res.length > 0 ? "/.." : "..";
97
- lastSegmentLength = 2;
98
- }
99
- } else {
100
- if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
101
- else res = path.slice(lastSlash + 1, index);
102
- lastSegmentLength = index - lastSlash - 1;
103
- }
104
- lastSlash = index;
105
- dots = 0;
106
- } else if (char === "." && dots !== -1) ++dots;
107
- else dots = -1;
108
- }
109
- return res;
110
- }
111
- const isAbsolute = function(p) {
112
- return _IS_ABSOLUTE_RE.test(p);
113
- };
114
- const extname = function(p) {
115
- if (p === "..") return "";
116
- const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
117
- return match && match[1] || "";
118
- };
119
- const basename = function(p, extension) {
120
- const segments = normalizeWindowsPath(p).split("/");
121
- let lastSegment = "";
122
- for (let i = segments.length - 1; i >= 0; i--) {
123
- const val = segments[i];
124
- if (val) {
125
- lastSegment = val;
126
- break;
127
- }
128
- }
129
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
130
- };
131
-
132
- //#endregion
133
- export { basename, extname, isAbsolute, join, normalize, resolve };
@@ -1,77 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
2
- const require_pathe_M_eThtNZ = require('../../../../pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs');
3
- const require_confbox_DnMsyigM = require('../../../../confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.cjs');
4
- const require_index = require('../../../../exsolve@1.0.8/node_modules/exsolve/dist/index.cjs');
5
- let node_fs = require("node:fs");
6
- let node_url = require("node:url");
7
- let node_fs_promises = require("node:fs/promises");
8
-
9
- //#region ../../node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs
10
- const defaultFindOptions = {
11
- startingFrom: ".",
12
- rootPattern: /^node_modules$/,
13
- reverse: false,
14
- test: (filePath) => {
15
- try {
16
- if ((0, node_fs.statSync)(filePath).isFile()) return true;
17
- } catch {}
18
- }
19
- };
20
- async function findFile(filename, _options = {}) {
21
- const filenames = Array.isArray(filename) ? filename : [filename];
22
- const options = {
23
- ...defaultFindOptions,
24
- ..._options
25
- };
26
- const basePath = require_pathe_M_eThtNZ.resolve(options.startingFrom);
27
- const leadingSlash = basePath[0] === "/";
28
- const segments = basePath.split("/").filter(Boolean);
29
- if (filenames.includes(segments.at(-1)) && await options.test(basePath)) return basePath;
30
- if (leadingSlash) segments[0] = "/" + segments[0];
31
- let root = segments.findIndex((r) => r.match(options.rootPattern));
32
- if (root === -1) root = 0;
33
- if (options.reverse) for (let index = root + 1; index <= segments.length; index++) for (const filename2 of filenames) {
34
- const filePath = require_pathe_M_eThtNZ.join(...segments.slice(0, index), filename2);
35
- if (await options.test(filePath)) return filePath;
36
- }
37
- else for (let index = segments.length; index > root; index--) for (const filename2 of filenames) {
38
- const filePath = require_pathe_M_eThtNZ.join(...segments.slice(0, index), filename2);
39
- if (await options.test(filePath)) return filePath;
40
- }
41
- throw new Error(`Cannot find matching ${filename} in ${options.startingFrom} or parent directories`);
42
- }
43
- function findNearestFile(filename, options = {}) {
44
- return findFile(filename, options);
45
- }
46
- function _resolvePath(id, opts = {}) {
47
- if (id instanceof URL || id.startsWith("file://")) return require_pathe_M_eThtNZ.normalize((0, node_url.fileURLToPath)(id));
48
- if (require_pathe_M_eThtNZ.isAbsolute(id)) return require_pathe_M_eThtNZ.normalize(id);
49
- return require_index.resolveModulePath(id, {
50
- ...opts,
51
- from: opts.from || opts.parent || opts.url
52
- });
53
- }
54
- const FileCache = /* @__PURE__ */ new Map();
55
- async function readPackageJSON(id, options = {}) {
56
- const resolvedPath = await resolvePackageJSON(id, options);
57
- const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
58
- if (options.cache && cache.has(resolvedPath)) return cache.get(resolvedPath);
59
- const blob = await node_fs.promises.readFile(resolvedPath, "utf8");
60
- let parsed;
61
- try {
62
- parsed = require_confbox_DnMsyigM.x(blob);
63
- } catch {
64
- parsed = require_confbox_DnMsyigM.h(blob);
65
- }
66
- cache.set(resolvedPath, parsed);
67
- return parsed;
68
- }
69
- async function resolvePackageJSON(id = process.cwd(), options = {}) {
70
- return findNearestFile("package.json", {
71
- ...options,
72
- startingFrom: _resolvePath(id, options)
73
- });
74
- }
75
-
76
- //#endregion
77
- exports.readPackageJSON = readPackageJSON;
@@ -1,76 +0,0 @@
1
- import { isAbsolute, join, normalize, resolve } from "../../../../pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs";
2
- import { h, x } from "../../../../confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs";
3
- import { resolveModulePath } from "../../../../exsolve@1.0.8/node_modules/exsolve/dist/index.mjs";
4
- import { promises, statSync } from "node:fs";
5
- import { fileURLToPath } from "node:url";
6
- import { readFile } from "node:fs/promises";
7
-
8
- //#region ../../node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs
9
- const defaultFindOptions = {
10
- startingFrom: ".",
11
- rootPattern: /^node_modules$/,
12
- reverse: false,
13
- test: (filePath) => {
14
- try {
15
- if (statSync(filePath).isFile()) return true;
16
- } catch {}
17
- }
18
- };
19
- async function findFile(filename, _options = {}) {
20
- const filenames = Array.isArray(filename) ? filename : [filename];
21
- const options = {
22
- ...defaultFindOptions,
23
- ..._options
24
- };
25
- const basePath = resolve(options.startingFrom);
26
- const leadingSlash = basePath[0] === "/";
27
- const segments = basePath.split("/").filter(Boolean);
28
- if (filenames.includes(segments.at(-1)) && await options.test(basePath)) return basePath;
29
- if (leadingSlash) segments[0] = "/" + segments[0];
30
- let root = segments.findIndex((r) => r.match(options.rootPattern));
31
- if (root === -1) root = 0;
32
- if (options.reverse) for (let index = root + 1; index <= segments.length; index++) for (const filename2 of filenames) {
33
- const filePath = join(...segments.slice(0, index), filename2);
34
- if (await options.test(filePath)) return filePath;
35
- }
36
- else for (let index = segments.length; index > root; index--) for (const filename2 of filenames) {
37
- const filePath = join(...segments.slice(0, index), filename2);
38
- if (await options.test(filePath)) return filePath;
39
- }
40
- throw new Error(`Cannot find matching ${filename} in ${options.startingFrom} or parent directories`);
41
- }
42
- function findNearestFile(filename, options = {}) {
43
- return findFile(filename, options);
44
- }
45
- function _resolvePath(id, opts = {}) {
46
- if (id instanceof URL || id.startsWith("file://")) return normalize(fileURLToPath(id));
47
- if (isAbsolute(id)) return normalize(id);
48
- return resolveModulePath(id, {
49
- ...opts,
50
- from: opts.from || opts.parent || opts.url
51
- });
52
- }
53
- const FileCache = /* @__PURE__ */ new Map();
54
- async function readPackageJSON(id, options = {}) {
55
- const resolvedPath = await resolvePackageJSON(id, options);
56
- const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
57
- if (options.cache && cache.has(resolvedPath)) return cache.get(resolvedPath);
58
- const blob = await promises.readFile(resolvedPath, "utf8");
59
- let parsed;
60
- try {
61
- parsed = x(blob);
62
- } catch {
63
- parsed = h(blob);
64
- }
65
- cache.set(resolvedPath, parsed);
66
- return parsed;
67
- }
68
- async function resolvePackageJSON(id = process.cwd(), options = {}) {
69
- return findNearestFile("package.json", {
70
- ...options,
71
- startingFrom: _resolvePath(id, options)
72
- });
73
- }
74
-
75
- //#endregion
76
- export { readPackageJSON };
@@ -1,72 +0,0 @@
1
-
2
- //#region ../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs
3
- const NUMBER_CHAR_RE = /\d/;
4
- const STR_SPLITTERS = [
5
- "-",
6
- "_",
7
- "/",
8
- "."
9
- ];
10
- function isUppercase(char = "") {
11
- if (NUMBER_CHAR_RE.test(char)) return;
12
- return char !== char.toLowerCase();
13
- }
14
- function splitByCase(str, separators) {
15
- const splitters = separators ?? STR_SPLITTERS;
16
- const parts = [];
17
- if (!str || typeof str !== "string") return parts;
18
- let buff = "";
19
- let previousUpper;
20
- let previousSplitter;
21
- for (const char of str) {
22
- const isSplitter = splitters.includes(char);
23
- if (isSplitter === true) {
24
- parts.push(buff);
25
- buff = "";
26
- previousUpper = void 0;
27
- continue;
28
- }
29
- const isUpper = isUppercase(char);
30
- if (previousSplitter === false) {
31
- if (previousUpper === false && isUpper === true) {
32
- parts.push(buff);
33
- buff = char;
34
- previousUpper = isUpper;
35
- continue;
36
- }
37
- if (previousUpper === true && isUpper === false && buff.length > 1) {
38
- const lastChar = buff.at(-1);
39
- parts.push(buff.slice(0, Math.max(0, buff.length - 1)));
40
- buff = lastChar + char;
41
- previousUpper = isUpper;
42
- continue;
43
- }
44
- }
45
- buff += char;
46
- previousUpper = isUpper;
47
- previousSplitter = isSplitter;
48
- }
49
- parts.push(buff);
50
- return parts;
51
- }
52
- function upperFirst(str) {
53
- return str ? str[0].toUpperCase() + str.slice(1) : "";
54
- }
55
- function lowerFirst(str) {
56
- return str ? str[0].toLowerCase() + str.slice(1) : "";
57
- }
58
- function pascalCase(str, opts) {
59
- return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => upperFirst(opts?.normalize ? p.toLowerCase() : p)).join("") : "";
60
- }
61
- function camelCase(str, opts) {
62
- return lowerFirst(pascalCase(str || "", opts));
63
- }
64
- const titleCaseExceptions = /^(a|an|and|as|at|but|by|for|if|in|is|nor|of|on|or|the|to|with)$/i;
65
- function titleCase(str, opts) {
66
- return (Array.isArray(str) ? str : splitByCase(str)).filter(Boolean).map((p) => titleCaseExceptions.test(p) ? p.toLowerCase() : upperFirst(opts?.normalize ? p.toLowerCase() : p)).join(" ");
67
- }
68
-
69
- //#endregion
70
- exports.camelCase = camelCase;
71
- exports.pascalCase = pascalCase;
72
- exports.titleCase = titleCase;
@@ -1,69 +0,0 @@
1
- //#region ../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs
2
- const NUMBER_CHAR_RE = /\d/;
3
- const STR_SPLITTERS = [
4
- "-",
5
- "_",
6
- "/",
7
- "."
8
- ];
9
- function isUppercase(char = "") {
10
- if (NUMBER_CHAR_RE.test(char)) return;
11
- return char !== char.toLowerCase();
12
- }
13
- function splitByCase(str, separators) {
14
- const splitters = separators ?? STR_SPLITTERS;
15
- const parts = [];
16
- if (!str || typeof str !== "string") return parts;
17
- let buff = "";
18
- let previousUpper;
19
- let previousSplitter;
20
- for (const char of str) {
21
- const isSplitter = splitters.includes(char);
22
- if (isSplitter === true) {
23
- parts.push(buff);
24
- buff = "";
25
- previousUpper = void 0;
26
- continue;
27
- }
28
- const isUpper = isUppercase(char);
29
- if (previousSplitter === false) {
30
- if (previousUpper === false && isUpper === true) {
31
- parts.push(buff);
32
- buff = char;
33
- previousUpper = isUpper;
34
- continue;
35
- }
36
- if (previousUpper === true && isUpper === false && buff.length > 1) {
37
- const lastChar = buff.at(-1);
38
- parts.push(buff.slice(0, Math.max(0, buff.length - 1)));
39
- buff = lastChar + char;
40
- previousUpper = isUpper;
41
- continue;
42
- }
43
- }
44
- buff += char;
45
- previousUpper = isUpper;
46
- previousSplitter = isSplitter;
47
- }
48
- parts.push(buff);
49
- return parts;
50
- }
51
- function upperFirst(str) {
52
- return str ? str[0].toUpperCase() + str.slice(1) : "";
53
- }
54
- function lowerFirst(str) {
55
- return str ? str[0].toLowerCase() + str.slice(1) : "";
56
- }
57
- function pascalCase(str, opts) {
58
- return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => upperFirst(opts?.normalize ? p.toLowerCase() : p)).join("") : "";
59
- }
60
- function camelCase(str, opts) {
61
- return lowerFirst(pascalCase(str || "", opts));
62
- }
63
- const titleCaseExceptions = /^(a|an|and|as|at|but|by|for|if|in|is|nor|of|on|or|the|to|with)$/i;
64
- function titleCase(str, opts) {
65
- return (Array.isArray(str) ? str : splitByCase(str)).filter(Boolean).map((p) => titleCaseExceptions.test(p) ? p.toLowerCase() : upperFirst(opts?.normalize ? p.toLowerCase() : p)).join(" ");
66
- }
67
-
68
- //#endregion
69
- export { camelCase, pascalCase, titleCase };