@shell-shock/core 0.17.8 → 0.17.11
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 +36 -1
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.cts +2 -77
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +2 -76
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +35 -1
- package/dist/api.mjs.map +1 -1
- package/dist/components/command-validation-logic.cjs +291 -1
- package/dist/components/command-validation-logic.cjs.map +1 -0
- package/dist/components/command-validation-logic.d.cts +1 -3
- package/dist/components/command-validation-logic.d.cts.map +1 -1
- package/dist/components/command-validation-logic.d.mts +1 -3
- package/dist/components/command-validation-logic.d.mts.map +1 -1
- package/dist/components/command-validation-logic.mjs +288 -1
- package/dist/components/command-validation-logic.mjs.map +1 -1
- package/dist/components/docs.cjs +265 -1
- package/dist/components/docs.cjs.map +1 -0
- package/dist/components/docs.d.cts +4 -5
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +4 -5
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +256 -1
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/exec-builtin.cjs +429 -15
- package/dist/components/exec-builtin.cjs.map +1 -0
- package/dist/components/exec-builtin.d.cts +1 -2
- package/dist/components/exec-builtin.d.cts.map +1 -1
- package/dist/components/exec-builtin.d.mts +1 -2
- package/dist/components/exec-builtin.d.mts.map +1 -1
- package/dist/components/exec-builtin.mjs +424 -15
- package/dist/components/exec-builtin.mjs.map +1 -1
- package/dist/components/helpers.cjs +119 -1
- package/dist/components/helpers.cjs.map +1 -0
- package/dist/components/helpers.d.cts +6 -8
- package/dist/components/helpers.d.cts.map +1 -1
- package/dist/components/helpers.d.mts +6 -8
- package/dist/components/helpers.d.mts.map +1 -1
- package/dist/components/helpers.mjs +111 -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 +959 -5
- package/dist/components/options-parser-logic.cjs.map +1 -0
- package/dist/components/options-parser-logic.d.cts +8 -9
- package/dist/components/options-parser-logic.d.cts.map +1 -1
- package/dist/components/options-parser-logic.d.mts +8 -9
- package/dist/components/options-parser-logic.d.mts.map +1 -1
- package/dist/components/options-parser-logic.mjs +944 -5
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/state-builtin.cjs +630 -8
- package/dist/components/state-builtin.cjs.map +1 -0
- package/dist/components/state-builtin.d.cts +4 -5
- package/dist/components/state-builtin.d.cts.map +1 -1
- package/dist/components/state-builtin.d.mts +4 -5
- package/dist/components/state-builtin.d.mts.map +1 -1
- package/dist/components/state-builtin.mjs +622 -8
- package/dist/components/state-builtin.mjs.map +1 -1
- package/dist/components/usage.cjs +116 -1
- package/dist/components/usage.cjs.map +1 -0
- package/dist/components/usage.d.cts +1 -2
- package/dist/components/usage.d.cts.map +1 -1
- package/dist/components/usage.d.mts +1 -2
- package/dist/components/usage.d.mts.map +1 -1
- package/dist/components/usage.mjs +113 -1
- package/dist/components/usage.mjs.map +1 -1
- package/dist/components/utils-builtin.cjs +839 -33
- package/dist/components/utils-builtin.cjs.map +1 -0
- package/dist/components/utils-builtin.d.cts +7 -8
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts +7 -8
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +828 -33
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/config.cjs +65 -1
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +29 -8
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +29 -8
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +62 -1
- package/dist/config.mjs.map +1 -1
- package/dist/contexts/command.cjs +26 -1
- package/dist/contexts/command.cjs.map +1 -0
- package/dist/contexts/command.d.cts.map +1 -1
- package/dist/contexts/command.d.mts.map +1 -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.cjs.map +1 -0
- package/dist/contexts/options.d.cts.map +1 -1
- package/dist/contexts/options.d.mts.map +1 -1
- package/dist/contexts/options.mjs +57 -1
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/engine.cjs +138 -0
- package/dist/engine.cjs.map +1 -0
- package/dist/engine.d.cts +79 -0
- package/dist/engine.d.cts.map +1 -0
- package/dist/engine.d.mts +79 -0
- package/dist/engine.d.mts.map +1 -0
- package/dist/engine.mjs +136 -0
- package/dist/engine.mjs.map +1 -0
- package/dist/helpers/automd.cjs +70 -1
- package/dist/helpers/automd.cjs.map +1 -0
- package/dist/helpers/automd.mjs +69 -1
- package/dist/helpers/automd.mjs.map +1 -1
- package/dist/helpers/docs-helpers.cjs +23 -1
- package/dist/helpers/docs-helpers.cjs.map +1 -0
- package/dist/helpers/docs-helpers.mjs +22 -1
- package/dist/helpers/docs-helpers.mjs.map +1 -1
- package/dist/helpers/get-framework.cjs +24 -0
- package/dist/helpers/get-framework.cjs.map +1 -0
- package/dist/helpers/get-framework.mjs +24 -0
- package/dist/helpers/get-framework.mjs.map +1 -0
- package/dist/helpers/paths.cjs +137 -1
- package/dist/helpers/paths.cjs.map +1 -0
- package/dist/helpers/paths.mjs +133 -1
- package/dist/helpers/paths.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +113 -1
- package/dist/helpers/persistence.cjs.map +1 -0
- 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.cjs.map +1 -0
- 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.cjs.map +1 -0
- 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.cjs.map +1 -0
- package/dist/helpers/validations.mjs +69 -1
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +123 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +80 -5
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +80 -5
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +119 -1
- package/dist/index.mjs.map +1 -0
- package/dist/package.cjs +12 -0
- package/dist/package.cjs.map +1 -0
- package/dist/package.mjs +6 -0
- package/dist/package.mjs.map +1 -0
- package/dist/plugin-utils/compute-bin.cjs +48 -1
- package/dist/plugin-utils/compute-bin.cjs.map +1 -0
- package/dist/plugin-utils/compute-bin.d.cts +2 -2
- package/dist/plugin-utils/compute-bin.d.cts.map +1 -1
- package/dist/plugin-utils/compute-bin.d.mts +2 -2
- package/dist/plugin-utils/compute-bin.d.mts.map +1 -1
- package/dist/plugin-utils/compute-bin.mjs +47 -1
- package/dist/plugin-utils/compute-bin.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +224 -1
- package/dist/plugin-utils/context-helpers.cjs.map +1 -0
- package/dist/plugin-utils/context-helpers.d.cts +4 -4
- package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/context-helpers.d.mts +4 -4
- package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/context-helpers.mjs +214 -1
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/deepkit.cjs +70 -1
- package/dist/plugin-utils/deepkit.cjs.map +1 -0
- package/dist/plugin-utils/deepkit.d.cts +5 -5
- package/dist/plugin-utils/deepkit.d.cts.map +1 -1
- package/dist/plugin-utils/deepkit.d.mts +5 -5
- package/dist/plugin-utils/deepkit.d.mts.map +1 -1
- package/dist/plugin-utils/deepkit.mjs +68 -1
- package/dist/plugin-utils/deepkit.mjs.map +1 -1
- package/dist/plugin-utils/description-helpers.cjs +112 -2
- package/dist/plugin-utils/description-helpers.cjs.map +1 -0
- package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
- 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 +118 -1
- package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
- package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
- package/dist/plugin-utils/get-command-tree.d.mts.map +1 -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.d.cts +2 -2
- package/dist/plugin-utils/index.d.mts +2 -2
- package/dist/plugin-utils/index.mjs +10 -1
- package/dist/plugin-utils/reflect.cjs +52 -1
- package/dist/plugin-utils/reflect.cjs.map +1 -0
- package/dist/plugin-utils/reflect.d.cts.map +1 -1
- package/dist/plugin-utils/reflect.d.mts.map +1 -1
- package/dist/plugin-utils/reflect.mjs +50 -1
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.cjs +65 -1
- package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
- package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -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 +222 -1
- package/dist/plugin-utils/type-checks.cjs.map +1 -0
- package/dist/plugin-utils/type-checks.d.cts +5 -5
- package/dist/plugin-utils/type-checks.d.cts.map +1 -1
- package/dist/plugin-utils/type-checks.d.mts +5 -5
- package/dist/plugin-utils/type-checks.d.mts.map +1 -1
- package/dist/plugin-utils/type-checks.mjs +217 -1
- package/dist/plugin-utils/type-checks.mjs.map +1 -1
- package/dist/plugin.cjs +495 -4
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +488 -4
- package/dist/plugin.mjs.map +1 -1
- package/dist/resolver/helpers.cjs +182 -1
- package/dist/resolver/helpers.cjs.map +1 -0
- package/dist/resolver/helpers.mjs +178 -1
- package/dist/resolver/helpers.mjs.map +1 -1
- package/dist/resolver/resolve.cjs +479 -1
- package/dist/resolver/resolve.cjs.map +1 -0
- package/dist/resolver/resolve.mjs +478 -1
- package/dist/resolver/resolve.mjs.map +1 -1
- package/dist/types/command.cjs +402 -1
- package/dist/types/command.cjs.map +1 -0
- package/dist/types/command.d.cts +61 -119
- package/dist/types/command.d.cts.map +1 -1
- package/dist/types/command.d.mts +61 -119
- package/dist/types/command.d.mts.map +1 -1
- package/dist/types/command.mjs +367 -1
- package/dist/types/command.mjs.map +1 -1
- package/dist/types/config.cjs +175 -1
- package/dist/types/config.cjs.map +1 -0
- package/dist/types/config.d.cts +19 -12
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +19 -12
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs +163 -1
- package/dist/types/config.mjs.map +1 -1
- package/dist/types/context.cjs +45 -1
- package/dist/types/context.cjs.map +1 -0
- package/dist/types/context.d.cts +3 -2
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +3 -2
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/context.mjs +40 -1
- package/dist/types/context.mjs.map +1 -1
- package/dist/types/env.cjs +53 -1
- package/dist/types/env.cjs.map +1 -0
- package/dist/types/env.d.cts +1 -1
- package/dist/types/env.d.cts.map +1 -1
- package/dist/types/env.d.mts +1 -1
- package/dist/types/env.d.mts.map +1 -1
- package/dist/types/env.mjs +50 -1
- package/dist/types/env.mjs.map +1 -1
- package/dist/types/index.cjs +53 -1
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +6 -1
- package/dist/types/options.cjs +13 -1
- package/dist/types/options.cjs.map +1 -0
- package/dist/types/options.d.cts.map +1 -1
- package/dist/types/options.d.mts.map +1 -1
- package/dist/types/options.mjs +10 -1
- package/dist/types/options.mjs.map +1 -1
- package/package.json +43 -34
- package/dist/resolver/deepkit.cjs +0 -1
- package/dist/resolver/deepkit.mjs +0 -2
- package/dist/resolver/deepkit.mjs.map +0 -1
- package/dist/resolver/module.cjs +0 -1
- package/dist/resolver/module.mjs +0 -2
- package/dist/resolver/module.mjs.map +0 -1
package/dist/helpers/automd.mjs
CHANGED
|
@@ -1,2 +1,70 @@
|
|
|
1
|
-
import{getAppTitle
|
|
1
|
+
import { getAppTitle } from "../plugin-utils/context-helpers.mjs";
|
|
2
|
+
import { CommandDocs } from "../components/docs.mjs";
|
|
3
|
+
import "../plugin-utils/index.mjs";
|
|
4
|
+
import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
|
|
5
|
+
import { For, Show, code } from "@alloy-js/core";
|
|
6
|
+
import { renderString } from "@powerlines/plugin-alloy/render";
|
|
7
|
+
import { Heading } from "@alloy-js/markdown";
|
|
8
|
+
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
9
|
+
import { defineGenerator } from "automd";
|
|
10
|
+
|
|
11
|
+
//#region src/helpers/automd.tsx
|
|
12
|
+
function __assignType(fn, args) {
|
|
13
|
+
fn.__type = args;
|
|
14
|
+
return fn;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* AutoMD generator to generate CLI command documentation
|
|
18
|
+
*
|
|
19
|
+
* @see https://automd.unjs.io/
|
|
20
|
+
*
|
|
21
|
+
* @param context - The generator context.
|
|
22
|
+
* @returns The generated documentation content.
|
|
23
|
+
*/
|
|
24
|
+
const commands = __assignType((context) => defineGenerator({
|
|
25
|
+
name: "commands",
|
|
26
|
+
async generate() {
|
|
27
|
+
return { contents: renderString(context, [
|
|
28
|
+
createComponent(Heading, {
|
|
29
|
+
level: 2,
|
|
30
|
+
children: "Commands"
|
|
31
|
+
}),
|
|
32
|
+
createComponent(Spacing, {}),
|
|
33
|
+
memo(() => code`The following commands are available in the ${getAppTitle(context, true)} command-line interface application:`),
|
|
34
|
+
createComponent(Spacing, {}),
|
|
35
|
+
createComponent(For, {
|
|
36
|
+
get each() {
|
|
37
|
+
return Object.values(context.commands);
|
|
38
|
+
},
|
|
39
|
+
doubleHardline: true,
|
|
40
|
+
get children() {
|
|
41
|
+
return __assignType((child) => createComponent(Show, {
|
|
42
|
+
get when() {
|
|
43
|
+
return !child.virtual;
|
|
44
|
+
},
|
|
45
|
+
get children() {
|
|
46
|
+
return createComponent(CommandDocs, {
|
|
47
|
+
command: child,
|
|
48
|
+
levelOffset: 2
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}), [
|
|
52
|
+
"child",
|
|
53
|
+
"",
|
|
54
|
+
"P\"2!\"/\""
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
}),
|
|
58
|
+
createComponent(Spacing, {})
|
|
59
|
+
]) };
|
|
60
|
+
}
|
|
61
|
+
}), [
|
|
62
|
+
"Context",
|
|
63
|
+
"context",
|
|
64
|
+
"",
|
|
65
|
+
"P\"w!2\"\"/#"
|
|
66
|
+
]);
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { commands };
|
|
2
70
|
//# sourceMappingURL=automd.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automd.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"automd.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
let _stryke_path_join = require("@stryke/path/join");
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/docs-helpers.ts
|
|
4
|
+
/**
|
|
5
|
+
* Gets the output path for the generated documentation.
|
|
6
|
+
*
|
|
7
|
+
* @param context - The Shell Shock context.
|
|
8
|
+
* @returns The output path for the generated documentation.
|
|
9
|
+
*/
|
|
10
|
+
function getDocsOutputPath(context) {
|
|
11
|
+
return (0, _stryke_path_join.joinPaths)(context.config.root, "docs", "generated");
|
|
12
|
+
}
|
|
13
|
+
getDocsOutputPath.__type = [
|
|
14
|
+
"Context",
|
|
15
|
+
"context",
|
|
16
|
+
"getDocsOutputPath",
|
|
17
|
+
"Gets the output path for the generated documentation.",
|
|
18
|
+
"P\"w!2\"&/#?$"
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
exports.getDocsOutputPath = getDocsOutputPath;
|
|
23
|
+
//# sourceMappingURL=docs-helpers.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-helpers.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
import{joinPaths
|
|
1
|
+
import { joinPaths } from "@stryke/path/join";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/docs-helpers.ts
|
|
4
|
+
/**
|
|
5
|
+
* Gets the output path for the generated documentation.
|
|
6
|
+
*
|
|
7
|
+
* @param context - The Shell Shock context.
|
|
8
|
+
* @returns The output path for the generated documentation.
|
|
9
|
+
*/
|
|
10
|
+
function getDocsOutputPath(context) {
|
|
11
|
+
return joinPaths(context.config.root, "docs", "generated");
|
|
12
|
+
}
|
|
13
|
+
getDocsOutputPath.__type = [
|
|
14
|
+
"Context",
|
|
15
|
+
"context",
|
|
16
|
+
"getDocsOutputPath",
|
|
17
|
+
"Gets the output path for the generated documentation.",
|
|
18
|
+
"P\"w!2\"&/#?$"
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { getDocsOutputPath };
|
|
2
23
|
//# sourceMappingURL=docs-helpers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-helpers.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"docs-helpers.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const require_package = require('../package.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/get-framework.ts
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves the framework information for Shell Shock.
|
|
6
|
+
*
|
|
7
|
+
* @returns An object containing the name, version, and organization ID of the Shell Shock framework.
|
|
8
|
+
*/
|
|
9
|
+
function getFramework() {
|
|
10
|
+
return {
|
|
11
|
+
name: "shell-shock",
|
|
12
|
+
version: require_package.version,
|
|
13
|
+
orgId: "storm-software"
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
getFramework.__type = [
|
|
17
|
+
"getFramework",
|
|
18
|
+
"Retrieves the framework information for Shell Shock.",
|
|
19
|
+
"P!/!?\""
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.getFramework = getFramework;
|
|
24
|
+
//# sourceMappingURL=get-framework.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-framework.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { version } from "../package.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/get-framework.ts
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves the framework information for Shell Shock.
|
|
6
|
+
*
|
|
7
|
+
* @returns An object containing the name, version, and organization ID of the Shell Shock framework.
|
|
8
|
+
*/
|
|
9
|
+
function getFramework() {
|
|
10
|
+
return {
|
|
11
|
+
name: "shell-shock",
|
|
12
|
+
version,
|
|
13
|
+
orgId: "storm-software"
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
getFramework.__type = [
|
|
17
|
+
"getFramework",
|
|
18
|
+
"Retrieves the framework information for Shell Shock.",
|
|
19
|
+
"P!/!?\""
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { getFramework };
|
|
24
|
+
//# sourceMappingURL=get-framework.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-framework.mjs","names":[],"sources":[],"mappings":""}
|
package/dist/helpers/paths.cjs
CHANGED
|
@@ -1 +1,137 @@
|
|
|
1
|
-
|
|
1
|
+
const require_context_helpers = require('../plugin-utils/context-helpers.cjs');
|
|
2
|
+
let _stryke_path_append = require("@stryke/path/append");
|
|
3
|
+
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
4
|
+
let _stryke_path_replace = require("@stryke/path/replace");
|
|
5
|
+
let _stryke_path_resolve_parent_path = require("@stryke/path/resolve-parent-path");
|
|
6
|
+
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
7
|
+
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
8
|
+
let powerlines_utils = require("powerlines/utils");
|
|
9
|
+
let _stryke_fs_list_files = require("@stryke/fs/list-files");
|
|
10
|
+
let _stryke_path_common = require("@stryke/path/common");
|
|
11
|
+
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
12
|
+
let node_fs = require("node:fs");
|
|
13
|
+
|
|
14
|
+
//#region src/helpers/paths.ts
|
|
15
|
+
function __assignType(fn, args) {
|
|
16
|
+
fn.__type = args;
|
|
17
|
+
return fn;
|
|
18
|
+
}
|
|
19
|
+
function resolveCommandId(context, file) {
|
|
20
|
+
return (0, _stryke_path_replace.replacePath)((0, _stryke_path_file_path_fns.findFilePath)(file), context.commandsPath).split("/").filter(__assignType((p) => Boolean(p) && !require_context_helpers.isDynamicPathSegment(p), [
|
|
21
|
+
"p",
|
|
22
|
+
"",
|
|
23
|
+
"P\"2!\"/\""
|
|
24
|
+
])).join("/").replaceAll(/^\/+/g, "").replaceAll(/\/+$/g, "").replaceAll("/", "-");
|
|
25
|
+
}
|
|
26
|
+
resolveCommandId.__type = [
|
|
27
|
+
"Context",
|
|
28
|
+
"context",
|
|
29
|
+
"file",
|
|
30
|
+
"resolveCommandId",
|
|
31
|
+
"P\"w!2\"&2#&/$"
|
|
32
|
+
];
|
|
33
|
+
/**
|
|
34
|
+
* Finds the command name from the given file path.
|
|
35
|
+
*
|
|
36
|
+
* @param file - The file path to extract the command name from.
|
|
37
|
+
* @returns The command name.
|
|
38
|
+
*/
|
|
39
|
+
function resolveCommandName(file) {
|
|
40
|
+
let path = (0, _stryke_path_file_path_fns.findFilePath)(file);
|
|
41
|
+
let name = (0, _stryke_path_file_path_fns.findFolderName)(file, { requireExtension: true });
|
|
42
|
+
while (require_context_helpers.isDynamicPathSegment(name)) {
|
|
43
|
+
path = (0, _stryke_path_resolve_parent_path.resolveParentPath)(path);
|
|
44
|
+
name = (0, _stryke_path_file_path_fns.findFolderName)(path, { requireExtension: true });
|
|
45
|
+
}
|
|
46
|
+
return name;
|
|
47
|
+
}
|
|
48
|
+
resolveCommandName.__type = [
|
|
49
|
+
"file",
|
|
50
|
+
"resolveCommandName",
|
|
51
|
+
"Finds the command name from the given file path.",
|
|
52
|
+
"P&2!\"/\"?#"
|
|
53
|
+
];
|
|
54
|
+
function resolveCommandPath(context, file) {
|
|
55
|
+
return (0, _stryke_path_replace.replacePath)((0, _stryke_path_file_path_fns.findFilePath)(file), context.commandsPath).replaceAll(/^\/+/g, "").replaceAll(/\/+$/g, "").split("/").filter(__assignType((path) => path && !require_context_helpers.isPathSegmentGroup(path), [
|
|
56
|
+
"path",
|
|
57
|
+
"",
|
|
58
|
+
"P\"2!\"/\""
|
|
59
|
+
])).join("/");
|
|
60
|
+
}
|
|
61
|
+
resolveCommandPath.__type = [
|
|
62
|
+
"Context",
|
|
63
|
+
"context",
|
|
64
|
+
"file",
|
|
65
|
+
"resolveCommandPath",
|
|
66
|
+
"P\"w!2\"&2#&/$"
|
|
67
|
+
];
|
|
68
|
+
function resolveCommandDynamicPathSegments(context, file) {
|
|
69
|
+
return (0, _stryke_path_replace.replacePath)((0, _stryke_path_file_path_fns.findFilePath)(file), context.commandsPath).split("/").filter(__assignType((path) => Boolean(path) && require_context_helpers.isDynamicPathSegment(path), [
|
|
70
|
+
"path",
|
|
71
|
+
"",
|
|
72
|
+
"P\"2!\"/\""
|
|
73
|
+
])).map(__assignType((path) => require_context_helpers.getDynamicPathSegmentName(path), [
|
|
74
|
+
"path",
|
|
75
|
+
"",
|
|
76
|
+
"P\"2!\"/\""
|
|
77
|
+
]));
|
|
78
|
+
}
|
|
79
|
+
resolveCommandDynamicPathSegments.__type = [
|
|
80
|
+
"Context",
|
|
81
|
+
"context",
|
|
82
|
+
"file",
|
|
83
|
+
"resolveCommandDynamicPathSegments",
|
|
84
|
+
"P\"w!2\"&2#&F/$"
|
|
85
|
+
];
|
|
86
|
+
async function findCommandsRoot(context) {
|
|
87
|
+
let paths = [];
|
|
88
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(context.config.input)) paths = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)(context.config.input, context.config.root), context.config.cwd));
|
|
89
|
+
else if ((0, powerlines_utils.isFileReference)(context.config.input)) paths = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)(context.config.input.file, context.config.root), context.config.cwd));
|
|
90
|
+
else if (Array.isArray(context.config.input) && context.config.input.length > 0) paths = (await Promise.all(context.config.input.map(__assignType(async (input) => (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)((0, _stryke_type_checks_is_set_string.isSetString)(input) ? input : input.file, context.config.root), context.config.cwd)), [
|
|
91
|
+
"input",
|
|
92
|
+
"",
|
|
93
|
+
"P\"2!\"/\""
|
|
94
|
+
])))).flat();
|
|
95
|
+
else if ((0, _stryke_type_checks_is_set_object.isSetObject)(context.config.input)) paths = (await Promise.all(Object.values(context.config.input).map(__assignType(async (input) => Array.isArray(input) ? (await Promise.all(input.map(__assignType(async (i) => (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)((0, _stryke_type_checks_is_set_string.isSetString)(i) ? i : i.file, context.config.root), context.config.cwd)), [
|
|
96
|
+
"i",
|
|
97
|
+
"",
|
|
98
|
+
"P\"2!\"/\""
|
|
99
|
+
])))).flat() : (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)((0, _stryke_type_checks_is_set_string.isSetString)(input) ? input : input.file, context.config.root), context.config.cwd)), [
|
|
100
|
+
"input",
|
|
101
|
+
"",
|
|
102
|
+
"P\"2!\"/\""
|
|
103
|
+
])))).flat();
|
|
104
|
+
if (paths.length > 0) return (0, _stryke_path_common.commonPath)(paths.map(__assignType((p) => (0, _stryke_path_file_path_fns.findFilePath)(p), [
|
|
105
|
+
"p",
|
|
106
|
+
"",
|
|
107
|
+
"P\"2!\"/\""
|
|
108
|
+
])));
|
|
109
|
+
let commandsPath = (0, _stryke_path_join_paths.joinPaths)(context.config.root, "src/commands");
|
|
110
|
+
if (!(0, node_fs.existsSync)(commandsPath)) {
|
|
111
|
+
commandsPath = (0, _stryke_path_join_paths.joinPaths)(context.config.root, "commands");
|
|
112
|
+
if (!(0, node_fs.existsSync)(commandsPath)) {
|
|
113
|
+
commandsPath = (0, _stryke_path_join_paths.joinPaths)(context.config.root, "src");
|
|
114
|
+
if (!(0, node_fs.existsSync)(commandsPath)) commandsPath = context.config.root;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
paths = (await Promise.all([(0, _stryke_fs_list_files.listFiles)((0, _stryke_path_join_paths.joinPaths)((0, _stryke_path_append.appendPath)(commandsPath, context.config.cwd), "**/command.ts")), (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_join_paths.joinPaths)((0, _stryke_path_append.appendPath)(commandsPath, context.config.cwd), "**/command.tsx"))])).flat();
|
|
118
|
+
if (paths.length > 0) return (0, _stryke_path_common.commonPath)(paths.map(__assignType((p) => (0, _stryke_path_file_path_fns.findFilePath)(p), [
|
|
119
|
+
"p",
|
|
120
|
+
"",
|
|
121
|
+
"P\"2!\"/\""
|
|
122
|
+
])));
|
|
123
|
+
return (0, _stryke_path_append.appendPath)(commandsPath, context.config.cwd);
|
|
124
|
+
}
|
|
125
|
+
findCommandsRoot.__type = [
|
|
126
|
+
"Context",
|
|
127
|
+
"context",
|
|
128
|
+
"findCommandsRoot",
|
|
129
|
+
"P\"w!2\"&`/#"
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
//#endregion
|
|
133
|
+
exports.findCommandsRoot = findCommandsRoot;
|
|
134
|
+
exports.resolveCommandId = resolveCommandId;
|
|
135
|
+
exports.resolveCommandName = resolveCommandName;
|
|
136
|
+
exports.resolveCommandPath = resolveCommandPath;
|
|
137
|
+
//# sourceMappingURL=paths.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.cjs","names":[],"sources":[],"mappings":""}
|
package/dist/helpers/paths.mjs
CHANGED
|
@@ -1,2 +1,134 @@
|
|
|
1
|
-
import{getDynamicPathSegmentName
|
|
1
|
+
import { getDynamicPathSegmentName, isDynamicPathSegment, isPathSegmentGroup } from "../plugin-utils/context-helpers.mjs";
|
|
2
|
+
import { appendPath } from "@stryke/path/append";
|
|
3
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
4
|
+
import { replacePath } from "@stryke/path/replace";
|
|
5
|
+
import { resolveParentPath } from "@stryke/path/resolve-parent-path";
|
|
6
|
+
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
7
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
8
|
+
import { isFileReference } from "powerlines/utils";
|
|
9
|
+
import { listFiles } from "@stryke/fs/list-files";
|
|
10
|
+
import { commonPath } from "@stryke/path/common";
|
|
11
|
+
import { findFilePath, findFolderName } from "@stryke/path/file-path-fns";
|
|
12
|
+
import { existsSync } from "node:fs";
|
|
13
|
+
|
|
14
|
+
//#region src/helpers/paths.ts
|
|
15
|
+
function __assignType(fn, args) {
|
|
16
|
+
fn.__type = args;
|
|
17
|
+
return fn;
|
|
18
|
+
}
|
|
19
|
+
function resolveCommandId(context, file) {
|
|
20
|
+
return replacePath(findFilePath(file), context.commandsPath).split("/").filter(__assignType((p) => Boolean(p) && !isDynamicPathSegment(p), [
|
|
21
|
+
"p",
|
|
22
|
+
"",
|
|
23
|
+
"P\"2!\"/\""
|
|
24
|
+
])).join("/").replaceAll(/^\/+/g, "").replaceAll(/\/+$/g, "").replaceAll("/", "-");
|
|
25
|
+
}
|
|
26
|
+
resolveCommandId.__type = [
|
|
27
|
+
"Context",
|
|
28
|
+
"context",
|
|
29
|
+
"file",
|
|
30
|
+
"resolveCommandId",
|
|
31
|
+
"P\"w!2\"&2#&/$"
|
|
32
|
+
];
|
|
33
|
+
/**
|
|
34
|
+
* Finds the command name from the given file path.
|
|
35
|
+
*
|
|
36
|
+
* @param file - The file path to extract the command name from.
|
|
37
|
+
* @returns The command name.
|
|
38
|
+
*/
|
|
39
|
+
function resolveCommandName(file) {
|
|
40
|
+
let path = findFilePath(file);
|
|
41
|
+
let name = findFolderName(file, { requireExtension: true });
|
|
42
|
+
while (isDynamicPathSegment(name)) {
|
|
43
|
+
path = resolveParentPath(path);
|
|
44
|
+
name = findFolderName(path, { requireExtension: true });
|
|
45
|
+
}
|
|
46
|
+
return name;
|
|
47
|
+
}
|
|
48
|
+
resolveCommandName.__type = [
|
|
49
|
+
"file",
|
|
50
|
+
"resolveCommandName",
|
|
51
|
+
"Finds the command name from the given file path.",
|
|
52
|
+
"P&2!\"/\"?#"
|
|
53
|
+
];
|
|
54
|
+
function resolveCommandPath(context, file) {
|
|
55
|
+
return replacePath(findFilePath(file), context.commandsPath).replaceAll(/^\/+/g, "").replaceAll(/\/+$/g, "").split("/").filter(__assignType((path) => path && !isPathSegmentGroup(path), [
|
|
56
|
+
"path",
|
|
57
|
+
"",
|
|
58
|
+
"P\"2!\"/\""
|
|
59
|
+
])).join("/");
|
|
60
|
+
}
|
|
61
|
+
resolveCommandPath.__type = [
|
|
62
|
+
"Context",
|
|
63
|
+
"context",
|
|
64
|
+
"file",
|
|
65
|
+
"resolveCommandPath",
|
|
66
|
+
"P\"w!2\"&2#&/$"
|
|
67
|
+
];
|
|
68
|
+
function resolveCommandDynamicPathSegments(context, file) {
|
|
69
|
+
return replacePath(findFilePath(file), context.commandsPath).split("/").filter(__assignType((path) => Boolean(path) && isDynamicPathSegment(path), [
|
|
70
|
+
"path",
|
|
71
|
+
"",
|
|
72
|
+
"P\"2!\"/\""
|
|
73
|
+
])).map(__assignType((path) => getDynamicPathSegmentName(path), [
|
|
74
|
+
"path",
|
|
75
|
+
"",
|
|
76
|
+
"P\"2!\"/\""
|
|
77
|
+
]));
|
|
78
|
+
}
|
|
79
|
+
resolveCommandDynamicPathSegments.__type = [
|
|
80
|
+
"Context",
|
|
81
|
+
"context",
|
|
82
|
+
"file",
|
|
83
|
+
"resolveCommandDynamicPathSegments",
|
|
84
|
+
"P\"w!2\"&2#&F/$"
|
|
85
|
+
];
|
|
86
|
+
async function findCommandsRoot(context) {
|
|
87
|
+
let paths = [];
|
|
88
|
+
if (isSetString(context.config.input)) paths = await listFiles(appendPath(appendPath(context.config.input, context.config.root), context.config.cwd));
|
|
89
|
+
else if (isFileReference(context.config.input)) paths = await listFiles(appendPath(appendPath(context.config.input.file, context.config.root), context.config.cwd));
|
|
90
|
+
else if (Array.isArray(context.config.input) && context.config.input.length > 0) paths = (await Promise.all(context.config.input.map(__assignType(async (input) => listFiles(appendPath(appendPath(isSetString(input) ? input : input.file, context.config.root), context.config.cwd)), [
|
|
91
|
+
"input",
|
|
92
|
+
"",
|
|
93
|
+
"P\"2!\"/\""
|
|
94
|
+
])))).flat();
|
|
95
|
+
else if (isSetObject(context.config.input)) paths = (await Promise.all(Object.values(context.config.input).map(__assignType(async (input) => Array.isArray(input) ? (await Promise.all(input.map(__assignType(async (i) => listFiles(appendPath(appendPath(isSetString(i) ? i : i.file, context.config.root), context.config.cwd)), [
|
|
96
|
+
"i",
|
|
97
|
+
"",
|
|
98
|
+
"P\"2!\"/\""
|
|
99
|
+
])))).flat() : listFiles(appendPath(appendPath(isSetString(input) ? input : input.file, context.config.root), context.config.cwd)), [
|
|
100
|
+
"input",
|
|
101
|
+
"",
|
|
102
|
+
"P\"2!\"/\""
|
|
103
|
+
])))).flat();
|
|
104
|
+
if (paths.length > 0) return commonPath(paths.map(__assignType((p) => findFilePath(p), [
|
|
105
|
+
"p",
|
|
106
|
+
"",
|
|
107
|
+
"P\"2!\"/\""
|
|
108
|
+
])));
|
|
109
|
+
let commandsPath = joinPaths(context.config.root, "src/commands");
|
|
110
|
+
if (!existsSync(commandsPath)) {
|
|
111
|
+
commandsPath = joinPaths(context.config.root, "commands");
|
|
112
|
+
if (!existsSync(commandsPath)) {
|
|
113
|
+
commandsPath = joinPaths(context.config.root, "src");
|
|
114
|
+
if (!existsSync(commandsPath)) commandsPath = context.config.root;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
paths = (await Promise.all([listFiles(joinPaths(appendPath(commandsPath, context.config.cwd), "**/command.ts")), listFiles(joinPaths(appendPath(commandsPath, context.config.cwd), "**/command.tsx"))])).flat();
|
|
118
|
+
if (paths.length > 0) return commonPath(paths.map(__assignType((p) => findFilePath(p), [
|
|
119
|
+
"p",
|
|
120
|
+
"",
|
|
121
|
+
"P\"2!\"/\""
|
|
122
|
+
])));
|
|
123
|
+
return appendPath(commandsPath, context.config.cwd);
|
|
124
|
+
}
|
|
125
|
+
findCommandsRoot.__type = [
|
|
126
|
+
"Context",
|
|
127
|
+
"context",
|
|
128
|
+
"findCommandsRoot",
|
|
129
|
+
"P\"w!2\"&`/#"
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
//#endregion
|
|
133
|
+
export { findCommandsRoot, resolveCommandId, resolveCommandName, resolveCommandPath };
|
|
2
134
|
//# sourceMappingURL=paths.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"paths.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1,113 @@
|
|
|
1
|
-
|
|
1
|
+
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
2
|
+
let _powerlines_plugin_env_helpers = require("@powerlines/plugin-env/helpers");
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/persistence.ts
|
|
5
|
+
function __assignType(fn, args) {
|
|
6
|
+
fn.__type = args;
|
|
7
|
+
return fn;
|
|
8
|
+
}
|
|
9
|
+
function serialize(command) {
|
|
10
|
+
return {
|
|
11
|
+
...command,
|
|
12
|
+
parent: command.parent?.name ? command.parent.name : null,
|
|
13
|
+
children: Object.fromEntries(Object.entries(command.children || {}).map(__assignType(([name, child]) => [name, serialize(child)], [
|
|
14
|
+
"param0",
|
|
15
|
+
"",
|
|
16
|
+
"P\"2!\"/\""
|
|
17
|
+
])))
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
serialize.__type = [
|
|
21
|
+
"CommandTree",
|
|
22
|
+
"command",
|
|
23
|
+
"SerializedCommandTree",
|
|
24
|
+
"serialize",
|
|
25
|
+
"P\"w!2\"\"w#/$"
|
|
26
|
+
];
|
|
27
|
+
function deserialize(command, parent = null) {
|
|
28
|
+
const result = {
|
|
29
|
+
...command,
|
|
30
|
+
parent: parent ?? null,
|
|
31
|
+
children: {}
|
|
32
|
+
};
|
|
33
|
+
result.children = Object.fromEntries(Object.entries(command.children || {}).map(__assignType(([name, child]) => [name, deserialize(child, result)], [
|
|
34
|
+
"param0",
|
|
35
|
+
"",
|
|
36
|
+
"P\"2!\"/\""
|
|
37
|
+
])));
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
deserialize.__type = [
|
|
41
|
+
"SerializedCommandTree",
|
|
42
|
+
"command",
|
|
43
|
+
"CommandTree",
|
|
44
|
+
"parent",
|
|
45
|
+
() => null,
|
|
46
|
+
"deserialize",
|
|
47
|
+
"P\"w!2\"P\"w#,J2$>%\"w#/&"
|
|
48
|
+
];
|
|
49
|
+
/**
|
|
50
|
+
* Gets the file path for persisting CLI command reflections.
|
|
51
|
+
*
|
|
52
|
+
* @param context - The Shell Shock context.
|
|
53
|
+
* @returns The file path for persisting CLI command reflections.
|
|
54
|
+
*/
|
|
55
|
+
function getCommandsPersistencePath(context) {
|
|
56
|
+
return (0, _stryke_path_join_paths.joinPaths)(context.dataPath, "reflections", "commands.json");
|
|
57
|
+
}
|
|
58
|
+
getCommandsPersistencePath.__type = [
|
|
59
|
+
"Context",
|
|
60
|
+
"context",
|
|
61
|
+
"getCommandsPersistencePath",
|
|
62
|
+
"Gets the file path for persisting CLI command reflections.",
|
|
63
|
+
"P\"w!2\"&/#?$"
|
|
64
|
+
];
|
|
65
|
+
/**
|
|
66
|
+
* Reads the persisted CLI command reflections from the file system and populates the context's commands.
|
|
67
|
+
*
|
|
68
|
+
* @param context - The Shell Shock context.
|
|
69
|
+
* @throws Will throw an error if the reflections file is empty or cannot be read.
|
|
70
|
+
*/
|
|
71
|
+
async function readCommandsPersistence(context) {
|
|
72
|
+
const reflections = await context.fs.read(getCommandsPersistencePath(context));
|
|
73
|
+
if (!reflections || !reflections.length) throw new Error(`CLI Command reflection file ${getCommandsPersistencePath(context)} is empty`);
|
|
74
|
+
context.commands = Object.fromEntries(Object.entries(JSON.parse(reflections) ?? {}).map(__assignType(([name, command]) => [name, deserialize(command)], [
|
|
75
|
+
"param0",
|
|
76
|
+
"",
|
|
77
|
+
"P\"2!\"/\""
|
|
78
|
+
])));
|
|
79
|
+
}
|
|
80
|
+
readCommandsPersistence.__type = [
|
|
81
|
+
"Context",
|
|
82
|
+
"context",
|
|
83
|
+
"readCommandsPersistence",
|
|
84
|
+
"Reads the persisted CLI command reflections from the file system and populates the context's commands.",
|
|
85
|
+
"P\"w!2\"\"/#?$"
|
|
86
|
+
];
|
|
87
|
+
/**
|
|
88
|
+
* Writes the current CLI command reflections from the context to the file system for persistence.
|
|
89
|
+
*
|
|
90
|
+
* @param context - The Shell Shock context.
|
|
91
|
+
* @returns A promise that resolves when the reflections have been successfully written to the file system.
|
|
92
|
+
* @throws Will throw an error if there is an issue writing the reflections to the file system.
|
|
93
|
+
*/
|
|
94
|
+
async function writeCommandsPersistence(context) {
|
|
95
|
+
const filePath = getCommandsPersistencePath(context);
|
|
96
|
+
await (0, _powerlines_plugin_env_helpers.writeEnv)(context);
|
|
97
|
+
await context.fs.write(filePath, JSON.stringify(Object.fromEntries(Object.entries(context.commands).map(__assignType(([name, command]) => [name, serialize(command)], [
|
|
98
|
+
"param0",
|
|
99
|
+
"",
|
|
100
|
+
"P\"2!\"/\""
|
|
101
|
+
]))), null, context.config.mode === "production" ? 0 : 2));
|
|
102
|
+
}
|
|
103
|
+
writeCommandsPersistence.__type = [
|
|
104
|
+
"Context",
|
|
105
|
+
"context",
|
|
106
|
+
"writeCommandsPersistence",
|
|
107
|
+
"Writes the current CLI command reflections from the context to the file system for persistence.",
|
|
108
|
+
"P\"w!2\"\"/#?$"
|
|
109
|
+
];
|
|
110
|
+
|
|
111
|
+
//#endregion
|
|
112
|
+
exports.writeCommandsPersistence = writeCommandsPersistence;
|
|
113
|
+
//# sourceMappingURL=persistence.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistence.cjs","names":[],"sources":[],"mappings":""}
|