@shell-shock/core 0.17.8 → 0.17.10
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/_virtual/_rolldown/runtime.cjs +29 -1
- package/dist/api.cjs +148 -1
- package/dist/api.d.cts +6 -6
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +6 -6
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +145 -1
- package/dist/api.mjs.map +1 -1
- package/dist/components/command-validation-logic.cjs +292 -1
- package/dist/components/command-validation-logic.mjs +289 -1
- package/dist/components/command-validation-logic.mjs.map +1 -1
- package/dist/components/docs.cjs +265 -1
- package/dist/components/docs.mjs +256 -1
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/exec-builtin.cjs +429 -13
- package/dist/components/exec-builtin.mjs +425 -13
- package/dist/components/exec-builtin.mjs.map +1 -1
- package/dist/components/helpers.cjs +120 -1
- package/dist/components/helpers.mjs +112 -1
- package/dist/components/helpers.mjs.map +1 -1
- package/dist/components/index.cjs +58 -1
- package/dist/components/index.mjs +10 -1
- package/dist/components/options-parser-logic.cjs +960 -5
- package/dist/components/options-parser-logic.d.cts +1 -1
- package/dist/components/options-parser-logic.mjs +945 -5
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/state-builtin.cjs +629 -8
- package/dist/components/state-builtin.mjs +622 -8
- package/dist/components/state-builtin.mjs.map +1 -1
- package/dist/components/usage.cjs +117 -1
- package/dist/components/usage.mjs +114 -1
- package/dist/components/usage.mjs.map +1 -1
- package/dist/components/utils-builtin.cjs +838 -33
- package/dist/components/utils-builtin.mjs +828 -33
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/config.cjs +31 -1
- package/dist/config.mjs +29 -1
- package/dist/config.mjs.map +1 -1
- package/dist/contexts/command.cjs +26 -1
- package/dist/contexts/command.mjs +23 -1
- package/dist/contexts/command.mjs.map +1 -1
- package/dist/contexts/index.cjs +9 -1
- package/dist/contexts/index.mjs +4 -1
- package/dist/contexts/options.cjs +63 -1
- package/dist/contexts/options.mjs +58 -1
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/helpers/automd.cjs +71 -1
- package/dist/helpers/automd.mjs +70 -1
- package/dist/helpers/automd.mjs.map +1 -1
- package/dist/helpers/docs-helpers.cjs +23 -1
- package/dist/helpers/docs-helpers.mjs +22 -1
- package/dist/helpers/docs-helpers.mjs.map +1 -1
- package/dist/helpers/paths.cjs +137 -1
- package/dist/helpers/paths.mjs +133 -1
- package/dist/helpers/paths.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +115 -1
- package/dist/helpers/persistence.mjs +112 -1
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/update-package-json.cjs +65 -1
- package/dist/helpers/update-package-json.mjs +63 -1
- package/dist/helpers/update-package-json.mjs.map +1 -1
- package/dist/helpers/utilities.cjs +95 -1
- package/dist/helpers/utilities.mjs +93 -1
- package/dist/helpers/utilities.mjs.map +1 -1
- package/dist/helpers/validations.cjs +71 -1
- package/dist/helpers/validations.mjs +71 -1
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +53 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +7 -1
- package/dist/plugin-utils/compute-bin.cjs +50 -1
- package/dist/plugin-utils/compute-bin.mjs +49 -1
- package/dist/plugin-utils/compute-bin.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +231 -1
- package/dist/plugin-utils/context-helpers.mjs +221 -1
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/deepkit.cjs +71 -1
- package/dist/plugin-utils/deepkit.mjs +69 -1
- package/dist/plugin-utils/deepkit.mjs.map +1 -1
- package/dist/plugin-utils/description-helpers.cjs +111 -2
- package/dist/plugin-utils/description-helpers.mjs +107 -2
- package/dist/plugin-utils/description-helpers.mjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.cjs +117 -1
- package/dist/plugin-utils/get-command-tree.mjs +114 -1
- package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +39 -1
- package/dist/plugin-utils/index.mjs +10 -1
- package/dist/plugin-utils/reflect.cjs +52 -1
- package/dist/plugin-utils/reflect.mjs +52 -1
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.cjs +64 -1
- package/dist/plugin-utils/traverse-command-tree.mjs +62 -1
- package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/type-checks.cjs +93 -1
- package/dist/plugin-utils/type-checks.mjs +88 -1
- package/dist/plugin-utils/type-checks.mjs.map +1 -1
- package/dist/plugin.cjs +471 -4
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +465 -4
- package/dist/plugin.mjs.map +1 -1
- package/dist/resolver/deepkit.cjs +135 -1
- package/dist/resolver/deepkit.mjs +134 -1
- package/dist/resolver/deepkit.mjs.map +1 -1
- package/dist/resolver/helpers.cjs +173 -1
- package/dist/resolver/helpers.mjs +168 -1
- package/dist/resolver/helpers.mjs.map +1 -1
- package/dist/resolver/module.cjs +145 -1
- package/dist/resolver/module.mjs +144 -1
- package/dist/resolver/module.mjs.map +1 -1
- package/dist/resolver/resolve.cjs +222 -1
- package/dist/resolver/resolve.mjs +221 -1
- package/dist/resolver/resolve.mjs.map +1 -1
- package/dist/types/command.cjs +441 -1
- package/dist/types/command.d.cts +1 -1
- package/dist/types/command.d.mts +2 -2
- package/dist/types/command.mjs +405 -1
- package/dist/types/command.mjs.map +1 -1
- package/dist/types/config.cjs +134 -1
- package/dist/types/config.d.cts +10 -8
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +10 -8
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs +127 -1
- package/dist/types/config.mjs.map +1 -1
- package/dist/types/context.cjs +37 -1
- package/dist/types/context.mjs +34 -1
- package/dist/types/context.mjs.map +1 -1
- package/dist/types/env.cjs +52 -1
- package/dist/types/env.d.cts +1 -1
- package/dist/types/env.d.mts +1 -1
- package/dist/types/env.mjs +50 -1
- package/dist/types/env.mjs.map +1 -1
- package/dist/types/index.cjs +50 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +6 -1
- package/dist/types/options.cjs +12 -1
- package/dist/types/options.mjs +10 -1
- package/package.json +22 -21
|
@@ -1,4 +1,53 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
|
+
let defu = require("defu");
|
|
5
|
+
defu = require_runtime.__toESM(defu);
|
|
6
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
7
|
+
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
8
|
+
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
9
|
+
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
10
|
+
let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
|
|
11
|
+
let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
12
|
+
|
|
13
|
+
//#region src/components/utils-builtin.tsx
|
|
14
|
+
const __ΩOmit = [
|
|
15
|
+
"T",
|
|
16
|
+
"K",
|
|
17
|
+
() => __ΩPick,
|
|
18
|
+
() => __ΩExclude,
|
|
19
|
+
"Omit",
|
|
20
|
+
"b!b\"e!!e!!ge!\"o$#o##w%y"
|
|
21
|
+
];
|
|
22
|
+
const __ΩPick = [
|
|
23
|
+
"T",
|
|
24
|
+
"K",
|
|
25
|
+
"Pick",
|
|
26
|
+
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
27
|
+
];
|
|
28
|
+
const __ΩExclude = [
|
|
29
|
+
"T",
|
|
30
|
+
"U",
|
|
31
|
+
"Exclude",
|
|
32
|
+
"l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
|
|
33
|
+
];
|
|
34
|
+
const __ΩUtilsBuiltinProps = [
|
|
35
|
+
() => __ΩOmit,
|
|
36
|
+
"id",
|
|
37
|
+
"description",
|
|
38
|
+
"UtilsBuiltinProps",
|
|
39
|
+
"P!P.\".#Jo!#Mw$y"
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Generates the `findSuggestions` function for suggesting corrections for potentially misspelled options or commands.
|
|
43
|
+
*/
|
|
44
|
+
function FindSuggestionsDeclaration() {
|
|
45
|
+
const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
|
|
46
|
+
return [
|
|
47
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
48
|
+
"const": true,
|
|
49
|
+
name: "deburred",
|
|
50
|
+
initializer: _alloy_js_core.code` {
|
|
2
51
|
"\\xc0": "A", "\\xc1": "A", "\\xc2": "A", "\\xc3": "A", "\\xc4": "A", "\\xc5": "A",
|
|
3
52
|
"\\xe0": "a", "\\xe1": "a", "\\xe2": "a", "\\xe3": "a", "\\xe4": "a", "\\xe5": "a",
|
|
4
53
|
"\\xc7": "C", "\\xe7": "c",
|
|
@@ -51,7 +100,51 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
51
100
|
"\\u0132": "IJ", "\\u0133": "ij",
|
|
52
101
|
"\\u0152": "Oe", "\\u0153": "oe",
|
|
53
102
|
"\\u0149": "n", "\\u017f": "s"
|
|
54
|
-
} as Record<string, string>; `
|
|
103
|
+
} as Record<string, string>; `
|
|
104
|
+
}),
|
|
105
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
106
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
107
|
+
heading: "A utility function that takes an input string and a list of possible matches, and returns a list of suggested matches based on the Levenshtein distance between the input and the possible matches.",
|
|
108
|
+
get children() {
|
|
109
|
+
return [
|
|
110
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: "This function is intended to be used to suggest corrections for potentially misspelled options or commands." }),
|
|
111
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
112
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocInternal, {}),
|
|
113
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
114
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
115
|
+
name: "input",
|
|
116
|
+
children: "The input string to check for potential matches."
|
|
117
|
+
}),
|
|
118
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
119
|
+
name: "options",
|
|
120
|
+
children: "A list of possible matches to compare against the input."
|
|
121
|
+
}),
|
|
122
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: "A list of suggested matches based on the Levenshtein distance." })
|
|
123
|
+
];
|
|
124
|
+
}
|
|
125
|
+
}),
|
|
126
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
127
|
+
"export": true,
|
|
128
|
+
name: "findSuggestions",
|
|
129
|
+
parameters: [{
|
|
130
|
+
name: "input",
|
|
131
|
+
type: "string"
|
|
132
|
+
}, {
|
|
133
|
+
name: "options",
|
|
134
|
+
type: "string[]"
|
|
135
|
+
}],
|
|
136
|
+
returnType: "string[]",
|
|
137
|
+
get children() {
|
|
138
|
+
return [
|
|
139
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
140
|
+
"const": true,
|
|
141
|
+
name: "normalizedInput",
|
|
142
|
+
get initializer() {
|
|
143
|
+
return _alloy_js_core.code`String(input ?? "")${context.config.isCaseSensitive ? "" : ".toLowerCase()"}.trim().replaceAll(/[\\s\\-_\\.]+/gu, " ").replace(/[\\\\xc0-\\\\xd6\\\\xd8-\\\\xf6\\\\xf8-\\\\xff\\\\u0100-\\\\u017f]/g, key => deburred[key]).replace(/[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]/g, ""); `;
|
|
144
|
+
}
|
|
145
|
+
}),
|
|
146
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
147
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
|
|
55
148
|
if (!normalizedInput || options.length === 0) {
|
|
56
149
|
return [];
|
|
57
150
|
}
|
|
@@ -60,7 +153,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
60
153
|
const results: Array<{ option: string; distance: number }> = [];
|
|
61
154
|
|
|
62
155
|
for (const option of options) {
|
|
63
|
-
const normalizedOption = String(option ?? "")${
|
|
156
|
+
const normalizedOption = String(option ?? "")${context.config.isCaseSensitive ? "" : ".toLowerCase()"}.trim().replaceAll(/[\\s\\-_\\.]+/gu, " ").replace(/[\\\\xc0-\\\\xd6\\\\xd8-\\\\xf6\\\\xf8-\\\\xff\\\\u0100-\\\\u017f]/g, key => deburred[key]).replace(/[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]/g, "");
|
|
64
157
|
|
|
65
158
|
if (!normalizedOption) {
|
|
66
159
|
continue;
|
|
@@ -137,7 +230,41 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
137
230
|
}
|
|
138
231
|
|
|
139
232
|
return results.sort((a, b) => a.distance - b.distance).map(r => r.option);
|
|
140
|
-
`)
|
|
233
|
+
`)
|
|
234
|
+
];
|
|
235
|
+
}
|
|
236
|
+
})
|
|
237
|
+
];
|
|
238
|
+
}
|
|
239
|
+
FindSuggestionsDeclaration.__type = [
|
|
240
|
+
"FindSuggestionsDeclaration",
|
|
241
|
+
"Generates the `findSuggestions` function for suggesting corrections for potentially misspelled options or commands.",
|
|
242
|
+
"P\"/!?\""
|
|
243
|
+
];
|
|
244
|
+
/**
|
|
245
|
+
* Generates utilities for detecting terminal size and whether the process is running in the foreground, which can be used to determine how to render output (e.g., whether to use a progress bar or spinner).
|
|
246
|
+
*/
|
|
247
|
+
function TerminalSizeDeclaration() {
|
|
248
|
+
return [
|
|
249
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
250
|
+
"export": true,
|
|
251
|
+
"const": true,
|
|
252
|
+
name: "DEFAULT_TERMINAL_COLUMNS",
|
|
253
|
+
doc: "Default number of terminal columns",
|
|
254
|
+
initializer: _alloy_js_core.code`80`
|
|
255
|
+
}),
|
|
256
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
257
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
258
|
+
"export": true,
|
|
259
|
+
"const": true,
|
|
260
|
+
name: "DEFAULT_TERMINAL_ROWS",
|
|
261
|
+
doc: "Default number of terminal rows",
|
|
262
|
+
initializer: _alloy_js_core.code`24`
|
|
263
|
+
}),
|
|
264
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
265
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
266
|
+
name: "isForegroundProcess",
|
|
267
|
+
children: _alloy_js_core.code`if (isLinux) {
|
|
141
268
|
return true;
|
|
142
269
|
}
|
|
143
270
|
|
|
@@ -164,14 +291,24 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
164
291
|
return processGroupId === foregroundProcessGroupId;
|
|
165
292
|
} catch {
|
|
166
293
|
return false;
|
|
167
|
-
} `
|
|
294
|
+
} `
|
|
295
|
+
}),
|
|
296
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
297
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
298
|
+
name: "tput",
|
|
299
|
+
children: _alloy_js_core.code`try {
|
|
168
300
|
const columns = execSync(["tput", "cols"], { env: { TERM: 'dumb', ...process.env } });
|
|
169
301
|
const rows = execSync(["tput", "lines"], { env: { TERM: 'dumb', ...process.env } });
|
|
170
302
|
|
|
171
303
|
if (columns && rows) {
|
|
172
304
|
return { columns: Number.parseInt(columns.toString().trim(), 10), rows: Number.parseInt(rows.toString().trim(), 10) };
|
|
173
305
|
}
|
|
174
|
-
} catch {} `
|
|
306
|
+
} catch {} `
|
|
307
|
+
}),
|
|
308
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
309
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
310
|
+
name: "devTty",
|
|
311
|
+
children: _alloy_js_core.code`try {
|
|
175
312
|
const writeStream = new WriteStream(
|
|
176
313
|
openSync(
|
|
177
314
|
"/dev/tty",
|
|
@@ -180,21 +317,160 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
180
317
|
).getWindowSize();
|
|
181
318
|
|
|
182
319
|
return { columns: writeStream[0], rows: writeStream[1] };
|
|
183
|
-
} catch {} `
|
|
320
|
+
} catch {} `
|
|
321
|
+
}),
|
|
322
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
323
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
324
|
+
heading: "A utility function that attempts to determine the size of the terminal (number of columns and rows) using various methods, and falls back to default values if it cannot be determined. This can be used to adjust output formatting based on the available terminal size.",
|
|
325
|
+
get children() {
|
|
326
|
+
return [
|
|
327
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: "The function first checks if the process is running in a TTY environment and if the stdout or stderr streams provide column and row information. If not, it attempts to use platform-specific methods (like reading from /proc/self/stat on Linux, using tput on Unix-like systems, or checking /dev/tty) to determine the terminal size. If all else fails, it returns default values." }),
|
|
328
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
329
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: "An object containing the number of columns and rows of the terminal." })
|
|
330
|
+
];
|
|
331
|
+
}
|
|
332
|
+
}),
|
|
333
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
334
|
+
"export": true,
|
|
335
|
+
name: "getTerminalSize",
|
|
336
|
+
returnType: "{ columns: number; rows: number; }",
|
|
337
|
+
get children() {
|
|
338
|
+
return [
|
|
339
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
340
|
+
condition: _alloy_js_core.code`process.stdout?.columns && process.stdout?.rows`,
|
|
341
|
+
children: _alloy_js_core.code`return { columns: process.stdout.columns, rows: process.stdout.rows }; `
|
|
342
|
+
}),
|
|
343
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
344
|
+
condition: _alloy_js_core.code`process.stderr?.columns && process.stderr?.rows`,
|
|
345
|
+
children: _alloy_js_core.code`return { columns: process.stderr.columns, rows: process.stderr.rows };`
|
|
346
|
+
}),
|
|
347
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
348
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
349
|
+
condition: _alloy_js_core.code`isWindows`,
|
|
350
|
+
children: _alloy_js_core.code`return tput() ?? {
|
|
184
351
|
columns: DEFAULT_TERMINAL_COLUMNS,
|
|
185
352
|
rows: DEFAULT_TERMINAL_ROWS,
|
|
186
|
-
}; `
|
|
353
|
+
}; `
|
|
354
|
+
}),
|
|
355
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
356
|
+
condition: _alloy_js_core.code`isMacOS`,
|
|
357
|
+
children: _alloy_js_core.code`return devTty() ?? tput() ?? {
|
|
187
358
|
columns: DEFAULT_TERMINAL_COLUMNS,
|
|
188
359
|
rows: DEFAULT_TERMINAL_ROWS,
|
|
189
|
-
}; `
|
|
360
|
+
}; `
|
|
361
|
+
}),
|
|
362
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
363
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
364
|
+
"let": true,
|
|
365
|
+
name: "result",
|
|
366
|
+
initializer: _alloy_js_core.code`devTty() ?? tput(); `
|
|
367
|
+
}),
|
|
368
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
369
|
+
condition: _alloy_js_core.code`!result && isForegroundProcess()`,
|
|
370
|
+
children: _alloy_js_core.code`try {
|
|
190
371
|
const size = execSync(["resize", "-u"]).match(/\\d+/g);
|
|
191
372
|
if (size.length === 2) {
|
|
192
373
|
result = { columns: Number.parseInt(size[0], 10), rows: Number.parseInt(size[1], 10) };
|
|
193
374
|
}
|
|
194
|
-
} catch {} `
|
|
375
|
+
} catch {} `
|
|
376
|
+
}),
|
|
377
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
378
|
+
_alloy_js_core.code`return result ?? {
|
|
195
379
|
columns: DEFAULT_TERMINAL_COLUMNS,
|
|
196
380
|
rows: DEFAULT_TERMINAL_ROWS,
|
|
197
|
-
}; `
|
|
381
|
+
}; `
|
|
382
|
+
];
|
|
383
|
+
}
|
|
384
|
+
})
|
|
385
|
+
];
|
|
386
|
+
}
|
|
387
|
+
TerminalSizeDeclaration.__type = [
|
|
388
|
+
"TerminalSizeDeclaration",
|
|
389
|
+
"Generates utilities for detecting terminal size and whether the process is running in the foreground, which can be used to determine how to render output (e.g., whether to use a progress bar or spinner).",
|
|
390
|
+
"P\"/!?\""
|
|
391
|
+
];
|
|
392
|
+
/**
|
|
393
|
+
* Generates utilities for detecting terminal color support.
|
|
394
|
+
*/
|
|
395
|
+
function EnvSupportUtilities() {
|
|
396
|
+
return [
|
|
397
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
398
|
+
"export": true,
|
|
399
|
+
"const": true,
|
|
400
|
+
name: "isTTY",
|
|
401
|
+
doc: "Detect if stdout.TTY is available",
|
|
402
|
+
initializer: _alloy_js_core.code`Boolean(process.stdout && process.stdout.isTTY);`
|
|
403
|
+
}),
|
|
404
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
405
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
406
|
+
"export": true,
|
|
407
|
+
"const": true,
|
|
408
|
+
name: "isMinimal",
|
|
409
|
+
doc: "Detect if the current environment is minimal (CI, non-TTY, etc.)",
|
|
410
|
+
initializer: _alloy_js_core.code` env.MINIMAL || isCI || isTest || !isTTY; `
|
|
411
|
+
}),
|
|
412
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
413
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
414
|
+
"export": true,
|
|
415
|
+
"const": true,
|
|
416
|
+
name: "isInteractive",
|
|
417
|
+
doc: "Detect if the current environment is interactive",
|
|
418
|
+
initializer: _alloy_js_core.code` !isMinimal && process.stdin?.isTTY && env.TERM !== "dumb" && !hasFlag(["no-interactive", "non-interactive", "no-interact"]); `
|
|
419
|
+
})
|
|
420
|
+
];
|
|
421
|
+
}
|
|
422
|
+
EnvSupportUtilities.__type = [
|
|
423
|
+
"EnvSupportUtilities",
|
|
424
|
+
"Generates utilities for detecting terminal color support.",
|
|
425
|
+
"P\"/!?\""
|
|
426
|
+
];
|
|
427
|
+
/**
|
|
428
|
+
* Generates utilities for detecting terminal color support.
|
|
429
|
+
*/
|
|
430
|
+
function ColorSupportUtilities() {
|
|
431
|
+
return [
|
|
432
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
|
|
433
|
+
"export": true,
|
|
434
|
+
name: "GetColorSupportLevelOptions",
|
|
435
|
+
doc: "Options for the getColorSupportLevel function",
|
|
436
|
+
get children() {
|
|
437
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
438
|
+
name: "ignoreFlags",
|
|
439
|
+
type: "boolean",
|
|
440
|
+
doc: "Indicates if the function should skip checking command-line flags for color support"
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
}),
|
|
444
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
445
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
446
|
+
heading: "Checks if a specific flag is present in the command-line arguments.",
|
|
447
|
+
get children() {
|
|
448
|
+
return [
|
|
449
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: "https://github.com/sindresorhus/has-flag/blob/main/index.js" }),
|
|
450
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
451
|
+
name: "flag",
|
|
452
|
+
children: "The flag to check for, e.g., \"color\", \"no-color\"."
|
|
453
|
+
}),
|
|
454
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
455
|
+
name: "argv",
|
|
456
|
+
children: "The command-line arguments to check against. Defaults to global Deno args or process args."
|
|
457
|
+
}),
|
|
458
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: "True if the flag is present, false otherwise." })
|
|
459
|
+
];
|
|
460
|
+
}
|
|
461
|
+
}),
|
|
462
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
463
|
+
"export": true,
|
|
464
|
+
name: "getColorSupportLevel",
|
|
465
|
+
parameters: [{
|
|
466
|
+
name: "stream",
|
|
467
|
+
type: "NodeJS.WriteStream & { fd: 1 | 2; }"
|
|
468
|
+
}, {
|
|
469
|
+
name: "options",
|
|
470
|
+
type: "GetColorSupportLevelOptions",
|
|
471
|
+
default: "{ ignoreFlags: false }"
|
|
472
|
+
}],
|
|
473
|
+
children: _alloy_js_core.code`const { ignoreFlags } = options;
|
|
198
474
|
|
|
199
475
|
let forceColor: number | undefined;
|
|
200
476
|
if (env.FORCE_COLOR !== undefined) {
|
|
@@ -303,10 +579,34 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
303
579
|
has16m: level >= 3,
|
|
304
580
|
};
|
|
305
581
|
|
|
306
|
-
`
|
|
582
|
+
`
|
|
583
|
+
}),
|
|
584
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
585
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
586
|
+
"export": true,
|
|
587
|
+
"const": true,
|
|
588
|
+
name: "colorSupportLevels",
|
|
589
|
+
doc: "Detect the terminal color support level in the current environment",
|
|
590
|
+
initializer: _alloy_js_core.code` {
|
|
307
591
|
stdout: getColorSupportLevel(process.stdout),
|
|
308
592
|
stderr: getColorSupportLevel(process.stderr),
|
|
309
|
-
}; `
|
|
593
|
+
}; `
|
|
594
|
+
}),
|
|
595
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
596
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
597
|
+
"export": true,
|
|
598
|
+
"const": true,
|
|
599
|
+
name: "isColorSupported",
|
|
600
|
+
doc: "Detect if terminal color is supported in the current environment",
|
|
601
|
+
initializer: _alloy_js_core.code` Boolean(colorSupportLevels.stdout); `
|
|
602
|
+
}),
|
|
603
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
604
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
605
|
+
"export": true,
|
|
606
|
+
"const": true,
|
|
607
|
+
name: "isUnicodeSupported",
|
|
608
|
+
doc: "Detect if Unicode characters are supported in the current environment",
|
|
609
|
+
initializer: _alloy_js_core.code` !isWindows
|
|
310
610
|
? env.TERM !== "linux"
|
|
311
611
|
: Boolean(env.WT_SESSION) ||
|
|
312
612
|
Boolean(env.TERMINUS_SUBLIME) ||
|
|
@@ -317,7 +617,28 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
317
617
|
env.TERM === "alacritty" ||
|
|
318
618
|
env.TERM === "rxvt-unicode" ||
|
|
319
619
|
env.TERM === "rxvt-unicode-256color" ||
|
|
320
|
-
env.TERMINAL_EMULATOR === "JetBrains-JediTerm"; `
|
|
620
|
+
env.TERMINAL_EMULATOR === "JetBrains-JediTerm"; `
|
|
621
|
+
})
|
|
622
|
+
];
|
|
623
|
+
}
|
|
624
|
+
ColorSupportUtilities.__type = [
|
|
625
|
+
"ColorSupportUtilities",
|
|
626
|
+
"Generates utilities for detecting terminal color support.",
|
|
627
|
+
"P\"/!?\""
|
|
628
|
+
];
|
|
629
|
+
/**
|
|
630
|
+
* Generates utilities for detecting terminal color support.
|
|
631
|
+
*/
|
|
632
|
+
function HyperlinkSupportUtilities() {
|
|
633
|
+
return [
|
|
634
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
635
|
+
name: "parseVersion",
|
|
636
|
+
parameters: [{
|
|
637
|
+
name: "version",
|
|
638
|
+
type: "string",
|
|
639
|
+
default: "\"\""
|
|
640
|
+
}],
|
|
641
|
+
children: _alloy_js_core.code`if (/^\d{3,4}$/.test(version)) {
|
|
321
642
|
const match = /(\d{1,2})(\d{2})/.exec(version) ?? [];
|
|
322
643
|
|
|
323
644
|
return {
|
|
@@ -335,7 +656,20 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
335
656
|
major: versionParts[0],
|
|
336
657
|
minor: versionParts[1],
|
|
337
658
|
patch: versionParts[2]
|
|
338
|
-
}; `
|
|
659
|
+
}; `
|
|
660
|
+
}),
|
|
661
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
662
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
663
|
+
heading: "Check if the current environment/terminal supports hyperlinks in the terminal.",
|
|
664
|
+
get children() {
|
|
665
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: "True if the current environment/terminal supports hyperlinks." });
|
|
666
|
+
}
|
|
667
|
+
}),
|
|
668
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
669
|
+
"export": true,
|
|
670
|
+
name: "isHyperlinkSupported",
|
|
671
|
+
returnType: "boolean",
|
|
672
|
+
children: _alloy_js_core.code`if (Boolean(env.FORCE_HYPERLINK)) {
|
|
339
673
|
return true;
|
|
340
674
|
}
|
|
341
675
|
|
|
@@ -396,7 +730,126 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
396
730
|
return true;
|
|
397
731
|
}
|
|
398
732
|
|
|
399
|
-
return false; `
|
|
733
|
+
return false; `
|
|
734
|
+
})
|
|
735
|
+
];
|
|
736
|
+
}
|
|
737
|
+
HyperlinkSupportUtilities.__type = [
|
|
738
|
+
"HyperlinkSupportUtilities",
|
|
739
|
+
"Generates utilities for detecting terminal color support.",
|
|
740
|
+
"P\"/!?\""
|
|
741
|
+
];
|
|
742
|
+
/**
|
|
743
|
+
* Generates the `resolveModule` function declaration, which is a utility for resolving file paths across different platforms.
|
|
744
|
+
*/
|
|
745
|
+
function ResolveModuleFunctionDeclaration() {
|
|
746
|
+
const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
|
|
747
|
+
return [
|
|
748
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
749
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
|
|
750
|
+
name: "ResolveModuleOptions",
|
|
751
|
+
doc: "Options for the `resolve` handler function.",
|
|
752
|
+
get children() {
|
|
753
|
+
return [
|
|
754
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
755
|
+
name: "parentURL",
|
|
756
|
+
optional: true,
|
|
757
|
+
type: "string",
|
|
758
|
+
doc: "The parent URL to use for resolving paths."
|
|
759
|
+
}),
|
|
760
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
761
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
762
|
+
name: "conditions",
|
|
763
|
+
optional: true,
|
|
764
|
+
type: "string[]",
|
|
765
|
+
doc: "The conditions to use for resolving paths."
|
|
766
|
+
}),
|
|
767
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
768
|
+
];
|
|
769
|
+
}
|
|
770
|
+
}),
|
|
771
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
772
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
|
|
773
|
+
name: "PackageConfig",
|
|
774
|
+
doc: "Parsed package.json configuration for module resolution.",
|
|
775
|
+
get children() {
|
|
776
|
+
return [
|
|
777
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
778
|
+
name: "pjsonPath",
|
|
779
|
+
type: "string",
|
|
780
|
+
doc: "The path to the package.json file."
|
|
781
|
+
}),
|
|
782
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
783
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
784
|
+
name: "exists",
|
|
785
|
+
type: "boolean",
|
|
786
|
+
doc: "Whether the package.json file exists."
|
|
787
|
+
}),
|
|
788
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
789
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
790
|
+
name: "main",
|
|
791
|
+
optional: true,
|
|
792
|
+
type: "string",
|
|
793
|
+
doc: "The main entry point of the package."
|
|
794
|
+
}),
|
|
795
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
796
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
797
|
+
name: "name",
|
|
798
|
+
optional: true,
|
|
799
|
+
type: "string",
|
|
800
|
+
doc: "The name of the package."
|
|
801
|
+
}),
|
|
802
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
803
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
804
|
+
name: "type",
|
|
805
|
+
optional: true,
|
|
806
|
+
type: `"commonjs" | "module" | "none"`,
|
|
807
|
+
doc: "The module type of the package."
|
|
808
|
+
}),
|
|
809
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
810
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
811
|
+
name: "exports",
|
|
812
|
+
optional: true,
|
|
813
|
+
type: "Record<string, unknown>",
|
|
814
|
+
doc: "The exports map of the package."
|
|
815
|
+
}),
|
|
816
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
817
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
818
|
+
name: "imports",
|
|
819
|
+
optional: true,
|
|
820
|
+
type: "Record<string, unknown>",
|
|
821
|
+
doc: "The imports map of the package."
|
|
822
|
+
})
|
|
823
|
+
];
|
|
824
|
+
}
|
|
825
|
+
}),
|
|
826
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
827
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
828
|
+
"const": true,
|
|
829
|
+
name: "DEFAULT_CONDITIONS_SET",
|
|
830
|
+
initializer: _alloy_js_core.code`new Set(["node", "import"]);`
|
|
831
|
+
}),
|
|
832
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
833
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
834
|
+
"const": true,
|
|
835
|
+
name: "DEFAULT_EXTENSIONS",
|
|
836
|
+
initializer: _alloy_js_core.code`[".mjs", ".cjs", ".js", ".json", ".node"];`
|
|
837
|
+
}),
|
|
838
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
839
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
840
|
+
"const": true,
|
|
841
|
+
name: "invalidPackageNameRegEx",
|
|
842
|
+
initializer: _alloy_js_core.code`/^\\.|\\/|%/;`
|
|
843
|
+
}),
|
|
844
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
845
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
846
|
+
name: "readPackageConfig",
|
|
847
|
+
parameters: [{
|
|
848
|
+
name: "jsonPath",
|
|
849
|
+
type: "string"
|
|
850
|
+
}],
|
|
851
|
+
returnType: "PackageConfig",
|
|
852
|
+
children: _alloy_js_core.code`const result: PackageConfig = {
|
|
400
853
|
pjsonPath: jsonPath,
|
|
401
854
|
exists: false,
|
|
402
855
|
main: undefined,
|
|
@@ -441,7 +894,17 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
441
894
|
result.type = parsed.type;
|
|
442
895
|
}
|
|
443
896
|
|
|
444
|
-
return result;`
|
|
897
|
+
return result;`
|
|
898
|
+
}),
|
|
899
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
900
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
901
|
+
name: "getPackageScopeConfig",
|
|
902
|
+
parameters: [{
|
|
903
|
+
name: "resolved",
|
|
904
|
+
type: "URL | string"
|
|
905
|
+
}],
|
|
906
|
+
returnType: "PackageConfig",
|
|
907
|
+
children: _alloy_js_core.code`let packageJSONUrl = new URL("package.json", resolved);
|
|
445
908
|
|
|
446
909
|
while (true) {
|
|
447
910
|
const packageJSONPath = packageJSONUrl.pathname;
|
|
@@ -466,7 +929,17 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
466
929
|
pjsonPath: fileURLToPath(packageJSONUrl),
|
|
467
930
|
exists: false,
|
|
468
931
|
type: "none"
|
|
469
|
-
};`
|
|
932
|
+
};`
|
|
933
|
+
}),
|
|
934
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
935
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
936
|
+
name: "isConditionalExportsMainSugar",
|
|
937
|
+
parameters: [{
|
|
938
|
+
name: "exports",
|
|
939
|
+
type: "unknown"
|
|
940
|
+
}],
|
|
941
|
+
returnType: "boolean",
|
|
942
|
+
children: _alloy_js_core.code`if (typeof exports === "string" || Array.isArray(exports)) {
|
|
470
943
|
return true;
|
|
471
944
|
}
|
|
472
945
|
if (typeof exports !== "object" || exports === null) {
|
|
@@ -488,7 +961,47 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
488
961
|
}
|
|
489
962
|
}
|
|
490
963
|
|
|
491
|
-
return isConditionalSugar;`
|
|
964
|
+
return isConditionalSugar;`
|
|
965
|
+
}),
|
|
966
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
967
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
968
|
+
name: "resolvePackageTarget",
|
|
969
|
+
parameters: [
|
|
970
|
+
{
|
|
971
|
+
name: "packageJsonUrl",
|
|
972
|
+
type: "URL"
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
name: "target",
|
|
976
|
+
type: "unknown"
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
name: "subpath",
|
|
980
|
+
type: "string"
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
name: "packageSubpath",
|
|
984
|
+
type: "string"
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
name: "base",
|
|
988
|
+
type: "URL"
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
name: "pattern",
|
|
992
|
+
type: "boolean"
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
name: "internal",
|
|
996
|
+
type: "boolean"
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
name: "conditions",
|
|
1000
|
+
type: "Set<string>"
|
|
1001
|
+
}
|
|
1002
|
+
],
|
|
1003
|
+
returnType: "URL | null | undefined",
|
|
1004
|
+
children: _alloy_js_core.code`if (typeof target === "string") {
|
|
492
1005
|
if (!target.startsWith("./")) {
|
|
493
1006
|
if (internal && !target.startsWith("../") && !target.startsWith("/")) {
|
|
494
1007
|
let isURL = false;
|
|
@@ -585,7 +1098,35 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
585
1098
|
return null;
|
|
586
1099
|
}
|
|
587
1100
|
|
|
588
|
-
return null;`
|
|
1101
|
+
return null;`
|
|
1102
|
+
}),
|
|
1103
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1104
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
1105
|
+
name: "packageExportsResolve",
|
|
1106
|
+
parameters: [
|
|
1107
|
+
{
|
|
1108
|
+
name: "packageJsonUrl",
|
|
1109
|
+
type: "URL"
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
name: "packageSubpath",
|
|
1113
|
+
type: "string"
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
name: "packageConfig",
|
|
1117
|
+
type: "PackageConfig"
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
name: "base",
|
|
1121
|
+
type: "URL"
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
name: "conditions",
|
|
1125
|
+
type: "Set<string>"
|
|
1126
|
+
}
|
|
1127
|
+
],
|
|
1128
|
+
returnType: "URL | null | undefined",
|
|
1129
|
+
children: _alloy_js_core.code`let exports = packageConfig.exports;
|
|
589
1130
|
if (isConditionalExportsMainSugar(exports)) {
|
|
590
1131
|
exports = { ".": exports } as Record<string, unknown>;
|
|
591
1132
|
}
|
|
@@ -659,7 +1200,20 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
659
1200
|
\`Package subpath '\${packageSubpath}' is not defined by "exports" in \${fileURLToPath(packageJsonUrl)}\`
|
|
660
1201
|
);
|
|
661
1202
|
(err as any).code = "ERR_PACKAGE_PATH_NOT_EXPORTED";
|
|
662
|
-
throw err;`
|
|
1203
|
+
throw err;`
|
|
1204
|
+
}),
|
|
1205
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1206
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
1207
|
+
name: "patternKeyCompare",
|
|
1208
|
+
parameters: [{
|
|
1209
|
+
name: "a",
|
|
1210
|
+
type: "string"
|
|
1211
|
+
}, {
|
|
1212
|
+
name: "b",
|
|
1213
|
+
type: "string"
|
|
1214
|
+
}],
|
|
1215
|
+
returnType: "number",
|
|
1216
|
+
children: _alloy_js_core.code`const aPatternIndex = a.indexOf("*");
|
|
663
1217
|
const bPatternIndex = b.indexOf("*");
|
|
664
1218
|
const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
|
|
665
1219
|
const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
|
|
@@ -669,7 +1223,20 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
669
1223
|
if (bPatternIndex === -1) return -1;
|
|
670
1224
|
if (a.length > b.length) return -1;
|
|
671
1225
|
if (b.length > a.length) return 1;
|
|
672
|
-
return 0;`
|
|
1226
|
+
return 0;`
|
|
1227
|
+
}),
|
|
1228
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1229
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
1230
|
+
name: "legacyMainResolve",
|
|
1231
|
+
parameters: [{
|
|
1232
|
+
name: "packageJsonUrl",
|
|
1233
|
+
type: "URL"
|
|
1234
|
+
}, {
|
|
1235
|
+
name: "packageConfig",
|
|
1236
|
+
type: "PackageConfig"
|
|
1237
|
+
}],
|
|
1238
|
+
returnType: "URL | undefined",
|
|
1239
|
+
children: _alloy_js_core.code`let guess: URL | undefined;
|
|
673
1240
|
const tries: string[] = [];
|
|
674
1241
|
|
|
675
1242
|
if (packageConfig.main !== undefined) {
|
|
@@ -697,7 +1264,20 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
697
1264
|
guess = undefined;
|
|
698
1265
|
}
|
|
699
1266
|
|
|
700
|
-
return undefined;`
|
|
1267
|
+
return undefined;`
|
|
1268
|
+
}),
|
|
1269
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1270
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
1271
|
+
name: "parsePackageName",
|
|
1272
|
+
parameters: [{
|
|
1273
|
+
name: "specifier",
|
|
1274
|
+
type: "string"
|
|
1275
|
+
}, {
|
|
1276
|
+
name: "base",
|
|
1277
|
+
type: "URL"
|
|
1278
|
+
}],
|
|
1279
|
+
returnType: "{ packageName: string; packageSubpath: string; isScoped: boolean }",
|
|
1280
|
+
children: _alloy_js_core.code`let separatorIndex = specifier.indexOf("/");
|
|
701
1281
|
let validPackageName = true;
|
|
702
1282
|
let isScoped = false;
|
|
703
1283
|
|
|
@@ -730,7 +1310,27 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
730
1310
|
? ""
|
|
731
1311
|
: specifier.slice(separatorIndex));
|
|
732
1312
|
|
|
733
|
-
return { packageName, packageSubpath, isScoped };`
|
|
1313
|
+
return { packageName, packageSubpath, isScoped };`
|
|
1314
|
+
}),
|
|
1315
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1316
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
1317
|
+
name: "packageResolve",
|
|
1318
|
+
parameters: [
|
|
1319
|
+
{
|
|
1320
|
+
name: "specifier",
|
|
1321
|
+
type: "string"
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
name: "base",
|
|
1325
|
+
type: "URL"
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
name: "conditions",
|
|
1329
|
+
type: "Set<string>"
|
|
1330
|
+
}
|
|
1331
|
+
],
|
|
1332
|
+
returnType: "URL",
|
|
1333
|
+
children: _alloy_js_core.code`if (builtinModules.includes(specifier)) {
|
|
734
1334
|
return new URL("node:" + specifier);
|
|
735
1335
|
}
|
|
736
1336
|
|
|
@@ -804,7 +1404,20 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
804
1404
|
const err = new Error(\`Cannot find package \\\`\${packageName}\\\`\`);
|
|
805
1405
|
(err as any).code = "ERR_MODULE_NOT_FOUND";
|
|
806
1406
|
|
|
807
|
-
throw err;`
|
|
1407
|
+
throw err;`
|
|
1408
|
+
}),
|
|
1409
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1410
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
1411
|
+
name: "finalizeResolution",
|
|
1412
|
+
parameters: [{
|
|
1413
|
+
name: "resolved",
|
|
1414
|
+
type: "URL"
|
|
1415
|
+
}, {
|
|
1416
|
+
name: "base",
|
|
1417
|
+
type: "URL"
|
|
1418
|
+
}],
|
|
1419
|
+
returnType: "URL",
|
|
1420
|
+
children: _alloy_js_core.code`if (/%2f|%5c/i.test(resolved.pathname)) {
|
|
808
1421
|
const err = new Error(
|
|
809
1422
|
\`Invalid module \\\`\${resolved.pathname}\\\` must not include encoded "/" or "\\\\" characters imported from \${fileURLToPath(base)}\`
|
|
810
1423
|
);
|
|
@@ -842,7 +1455,27 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
842
1455
|
realUrl.search = search;
|
|
843
1456
|
realUrl.hash = hash;
|
|
844
1457
|
|
|
845
|
-
return realUrl;`
|
|
1458
|
+
return realUrl;`
|
|
1459
|
+
}),
|
|
1460
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1461
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
1462
|
+
name: "moduleResolve",
|
|
1463
|
+
parameters: [
|
|
1464
|
+
{
|
|
1465
|
+
name: "specifier",
|
|
1466
|
+
type: "string"
|
|
1467
|
+
},
|
|
1468
|
+
{
|
|
1469
|
+
name: "base",
|
|
1470
|
+
type: "URL"
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
name: "conditions",
|
|
1474
|
+
type: "Set<string>"
|
|
1475
|
+
}
|
|
1476
|
+
],
|
|
1477
|
+
returnType: "URL",
|
|
1478
|
+
children: _alloy_js_core.code`let resolved: URL | undefined;
|
|
846
1479
|
|
|
847
1480
|
if (
|
|
848
1481
|
specifier[0] === "/" ||
|
|
@@ -931,7 +1564,27 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
931
1564
|
return resolved;
|
|
932
1565
|
}
|
|
933
1566
|
|
|
934
|
-
return finalizeResolution(resolved, base);`
|
|
1567
|
+
return finalizeResolution(resolved, base);`
|
|
1568
|
+
}),
|
|
1569
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1570
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
1571
|
+
name: "tryModuleResolve",
|
|
1572
|
+
parameters: [
|
|
1573
|
+
{
|
|
1574
|
+
name: "id",
|
|
1575
|
+
type: "string"
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
name: "url",
|
|
1579
|
+
type: "URL"
|
|
1580
|
+
},
|
|
1581
|
+
{
|
|
1582
|
+
name: "conditions",
|
|
1583
|
+
type: "Set<string>"
|
|
1584
|
+
}
|
|
1585
|
+
],
|
|
1586
|
+
returnType: "URL | undefined",
|
|
1587
|
+
children: _alloy_js_core.code`try {
|
|
935
1588
|
return moduleResolve(id, url, conditions);
|
|
936
1589
|
} catch (error: any) {
|
|
937
1590
|
if (
|
|
@@ -945,13 +1598,46 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
945
1598
|
) {
|
|
946
1599
|
throw error;
|
|
947
1600
|
}
|
|
948
|
-
}`
|
|
1601
|
+
}`
|
|
1602
|
+
}),
|
|
1603
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1604
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1605
|
+
heading: "A function to resolve module specifiers to URLs.",
|
|
1606
|
+
get children() {
|
|
1607
|
+
return [
|
|
1608
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1609
|
+
name: "specifier",
|
|
1610
|
+
children: `The module specifier to resolve.`
|
|
1611
|
+
}),
|
|
1612
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1613
|
+
name: "options",
|
|
1614
|
+
children: `The options for resolving the module. Defaults to an empty object.`
|
|
1615
|
+
}),
|
|
1616
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `The result of the resolve operation.` })
|
|
1617
|
+
];
|
|
1618
|
+
}
|
|
1619
|
+
}),
|
|
1620
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
1621
|
+
async: true,
|
|
1622
|
+
"export": true,
|
|
1623
|
+
name: "resolveModule",
|
|
1624
|
+
parameters: [{
|
|
1625
|
+
name: "specifier",
|
|
1626
|
+
type: "string"
|
|
1627
|
+
}, {
|
|
1628
|
+
name: "options",
|
|
1629
|
+
type: "ResolveModuleOptions",
|
|
1630
|
+
default: "{} as ResolveModuleOptions"
|
|
1631
|
+
}],
|
|
1632
|
+
returnType: "Promise<string>",
|
|
1633
|
+
get children() {
|
|
1634
|
+
return _alloy_js_core.code`const parentURL = options.parentURL ? new URL(options.parentURL) : undefined;
|
|
949
1635
|
const conditionsSet = options.conditions?.length
|
|
950
1636
|
? new Set(options.conditions)
|
|
951
1637
|
: DEFAULT_CONDITIONS_SET;
|
|
952
1638
|
|
|
953
|
-
// Handle protocol-prefixed specifiers (node:, data:, http:, https:, ${
|
|
954
|
-
if (/^(?:node|data|https?|${
|
|
1639
|
+
// Handle protocol-prefixed specifiers (node:, data:, http:, https:, ${context.config.framework}:)
|
|
1640
|
+
if (/^(?:node|data|https?|${context.config.framework}):/.test(specifier)) {
|
|
955
1641
|
return specifier;
|
|
956
1642
|
}
|
|
957
1643
|
|
|
@@ -979,12 +1665,12 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
979
1665
|
|
|
980
1666
|
const roots = [parentURL ?? pathToFileURL(join(process.cwd(), "_"))];
|
|
981
1667
|
|
|
982
|
-
const projectRootURL = pathToFileURL("${
|
|
1668
|
+
const projectRootURL = pathToFileURL("${context.config.root}");
|
|
983
1669
|
if (!roots.some(root => root.href === projectRootURL.href)) {
|
|
984
1670
|
roots.push(projectRootURL);
|
|
985
1671
|
}
|
|
986
1672
|
|
|
987
|
-
const workspaceRootURL = pathToFileURL("${
|
|
1673
|
+
const workspaceRootURL = pathToFileURL("${context.config.cwd}");
|
|
988
1674
|
if (!roots.some(root => root.href === workspaceRootURL.href)) {
|
|
989
1675
|
roots.push(workspaceRootURL);
|
|
990
1676
|
}
|
|
@@ -1042,4 +1728,123 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
1042
1728
|
}
|
|
1043
1729
|
|
|
1044
1730
|
return pathToFileURL(fileURLToPath(resolved)).href;
|
|
1045
|
-
|
|
1731
|
+
`;
|
|
1732
|
+
}
|
|
1733
|
+
})
|
|
1734
|
+
];
|
|
1735
|
+
}
|
|
1736
|
+
ResolveModuleFunctionDeclaration.__type = [
|
|
1737
|
+
"ResolveModuleFunctionDeclaration",
|
|
1738
|
+
"Generates the `resolveModule` function declaration, which is a utility for resolving file paths across different platforms.",
|
|
1739
|
+
"P\"/!?\""
|
|
1740
|
+
];
|
|
1741
|
+
/**
|
|
1742
|
+
* A built-in utilities module for Shell Shock.
|
|
1743
|
+
*/
|
|
1744
|
+
function UtilsBuiltin(props) {
|
|
1745
|
+
const [{ children }, rest] = (0, _alloy_js_core.splitProps)(props, ["children"]);
|
|
1746
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
|
|
1747
|
+
id: "utils",
|
|
1748
|
+
description: "A collection of helper utilities that ease command-line application development."
|
|
1749
|
+
}, rest, {
|
|
1750
|
+
get imports() {
|
|
1751
|
+
return (0, defu.default)(rest.imports ?? {}, {
|
|
1752
|
+
"node:os": "os",
|
|
1753
|
+
"node:process": "process",
|
|
1754
|
+
"node:path": [
|
|
1755
|
+
"join",
|
|
1756
|
+
"sep",
|
|
1757
|
+
"isAbsolute"
|
|
1758
|
+
],
|
|
1759
|
+
"node:fs": [
|
|
1760
|
+
{
|
|
1761
|
+
name: "constants",
|
|
1762
|
+
alias: "fsConstants"
|
|
1763
|
+
},
|
|
1764
|
+
"openSync",
|
|
1765
|
+
"closeSync",
|
|
1766
|
+
"read",
|
|
1767
|
+
"readFileSync",
|
|
1768
|
+
"statSync",
|
|
1769
|
+
"realpathSync"
|
|
1770
|
+
],
|
|
1771
|
+
"node:tty": ["WriteStream"],
|
|
1772
|
+
"node:url": ["fileURLToPath", "pathToFileURL"],
|
|
1773
|
+
"node:module": ["builtinModules"]
|
|
1774
|
+
});
|
|
1775
|
+
},
|
|
1776
|
+
get builtinImports() {
|
|
1777
|
+
return (0, defu.default)(rest.builtinImports ?? {}, {
|
|
1778
|
+
env: [
|
|
1779
|
+
"env",
|
|
1780
|
+
"isCI",
|
|
1781
|
+
"isTest",
|
|
1782
|
+
"isWindows",
|
|
1783
|
+
"isLinux",
|
|
1784
|
+
"isMacOS"
|
|
1785
|
+
],
|
|
1786
|
+
exec: ["execSync"],
|
|
1787
|
+
state: ["hasFlag"]
|
|
1788
|
+
});
|
|
1789
|
+
},
|
|
1790
|
+
get children() {
|
|
1791
|
+
return [
|
|
1792
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1793
|
+
heading: "A utility function to pause execution for a specified duration, which can be used in prompt interactions to create delays or timeouts. The function returns a promise that resolves after the specified duration in milliseconds, allowing it to be used with async/await syntax for easier handling of asynchronous prompt logic.",
|
|
1794
|
+
get children() {
|
|
1795
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1796
|
+
name: "durationMs",
|
|
1797
|
+
children: `The duration to sleep in milliseconds.`
|
|
1798
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `A promise that resolves after the specified duration, allowing for asynchronous delays in prompt interactions.` })];
|
|
1799
|
+
}
|
|
1800
|
+
}),
|
|
1801
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
1802
|
+
"export": true,
|
|
1803
|
+
name: "sleep",
|
|
1804
|
+
parameters: [{
|
|
1805
|
+
name: "durationMs",
|
|
1806
|
+
type: "number"
|
|
1807
|
+
}],
|
|
1808
|
+
returnType: "Promise<void>",
|
|
1809
|
+
children: _alloy_js_core.code`return new Promise((resolve) => setTimeout(resolve, durationMs)); `
|
|
1810
|
+
}),
|
|
1811
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1812
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(TerminalSizeDeclaration, {}),
|
|
1813
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1814
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(EnvSupportUtilities, {}),
|
|
1815
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1816
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(HyperlinkSupportUtilities, {}),
|
|
1817
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1818
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(ColorSupportUtilities, {}),
|
|
1819
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1820
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(ResolveModuleFunctionDeclaration, {}),
|
|
1821
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1822
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(FindSuggestionsDeclaration, {}),
|
|
1823
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1824
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
1825
|
+
get when() {
|
|
1826
|
+
return Boolean(children);
|
|
1827
|
+
},
|
|
1828
|
+
children
|
|
1829
|
+
})
|
|
1830
|
+
];
|
|
1831
|
+
}
|
|
1832
|
+
}));
|
|
1833
|
+
}
|
|
1834
|
+
UtilsBuiltin.__type = [
|
|
1835
|
+
() => __ΩUtilsBuiltinProps,
|
|
1836
|
+
"props",
|
|
1837
|
+
"UtilsBuiltin",
|
|
1838
|
+
"A built-in utilities module for Shell Shock.",
|
|
1839
|
+
"Pn!2\"\"/#?$"
|
|
1840
|
+
];
|
|
1841
|
+
|
|
1842
|
+
//#endregion
|
|
1843
|
+
exports.ColorSupportUtilities = ColorSupportUtilities;
|
|
1844
|
+
exports.EnvSupportUtilities = EnvSupportUtilities;
|
|
1845
|
+
exports.FindSuggestionsDeclaration = FindSuggestionsDeclaration;
|
|
1846
|
+
exports.HyperlinkSupportUtilities = HyperlinkSupportUtilities;
|
|
1847
|
+
exports.ResolveModuleFunctionDeclaration = ResolveModuleFunctionDeclaration;
|
|
1848
|
+
exports.TerminalSizeDeclaration = TerminalSizeDeclaration;
|
|
1849
|
+
exports.UtilsBuiltin = UtilsBuiltin;
|
|
1850
|
+
exports.__ΩUtilsBuiltinProps = __ΩUtilsBuiltinProps;
|