@shell-shock/nx 0.0.43 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +1 -1
- package/dist/base/base-executor.d.mts +2 -0
- package/dist/base/base-executor.d.ts +2 -0
- package/dist/{base-executor-B_1n4Nst.js → base/base-executor.js} +5 -41
- package/dist/{src/base-executor-Tb7NcSc4.mjs → base/base-executor.mjs} +3 -3
- package/dist/base/base-executor.mjs.map +1 -0
- package/dist/base/base-executor.schema.d.js +0 -0
- package/dist/{src/executors/lint/executor.d.ts → base/base-executor.schema.d.mts} +33 -24
- package/dist/base/base-executor.schema.d.mts.map +1 -0
- package/dist/{src/executors/lint/schema.d.ts → base/base-executor.schema.d.ts} +26 -13
- package/dist/base/base-executor.schema.d.ts.map +1 -0
- package/dist/{src/base → base}/base-executor.schema.json +40 -2
- package/dist/base/base-executor.untyped.d.mts +2 -0
- package/dist/base/base-executor.untyped.d.ts +2 -0
- package/dist/{src/index.js → base/base-executor.untyped.js} +3 -4
- package/dist/{src/index.mjs → base/base-executor.untyped.mjs} +2 -3
- package/dist/base/base-executor.untyped.mjs.map +1 -0
- package/dist/base/index.d.mts +2 -0
- package/dist/base/index.d.ts +2 -0
- package/dist/base/index.js +5 -0
- package/dist/base/index.mjs +4 -0
- package/dist/base-executor-CE7_IgHr.d.mts +29 -0
- package/dist/base-executor-CE7_IgHr.d.mts.map +1 -0
- package/dist/{src/base-executor-5IKYZdSK.d.mts → base-executor-CPOK8Lba.d.mts} +34 -2
- package/dist/base-executor-CPOK8Lba.d.mts.map +1 -0
- package/dist/base-executor-Co2z43MK.d.ts +29 -0
- package/dist/base-executor-Co2z43MK.d.ts.map +1 -0
- package/dist/{base-executor-Tb7NcSc4.mjs → base-executor-DojAZA0w.mjs} +2 -2
- package/dist/base-executor-DojAZA0w.mjs.map +1 -0
- package/dist/{base-executor-5IKYZdSK.d.mts → base-executor-ICVyKAxY.d.ts} +34 -2
- package/dist/base-executor-ICVyKAxY.d.ts.map +1 -0
- package/dist/{src/base-executor-B_1n4Nst.js → base-executor-KUL9jD5R.js} +1 -1
- package/dist/base-executor.untyped-D4R6pki2.d.ts +7 -0
- package/dist/base-executor.untyped-D4R6pki2.d.ts.map +1 -0
- package/dist/base-executor.untyped-hmlG6oyC.d.mts +7 -0
- package/dist/base-executor.untyped-hmlG6oyC.d.mts.map +1 -0
- package/dist/chunk-BE-pF4vm.js +34 -0
- package/dist/executors/build/executor.d.mts +34 -2
- package/dist/executors/build/executor.d.mts.map +1 -1
- package/dist/executors/build/executor.d.ts +34 -2
- package/dist/executors/build/executor.d.ts.map +1 -1
- package/dist/executors/build/executor.js +1 -1
- package/dist/executors/build/executor.mjs +1 -1
- package/dist/executors/build/executor.mjs.map +1 -1
- package/dist/executors/build/schema.d.js +0 -0
- package/dist/{src/executors/build/executor.d.mts → executors/build/schema.d.mts} +35 -12
- package/dist/executors/build/schema.d.mts.map +1 -0
- package/dist/executors/build/schema.d.ts +160 -141
- package/dist/executors/build/schema.d.ts.map +1 -0
- package/dist/executors/build/schema.json +40 -2
- package/dist/executors/build/untyped.d.mts +7 -0
- package/dist/executors/build/untyped.d.mts.map +1 -0
- package/dist/executors/build/untyped.d.ts +6 -0
- package/dist/executors/build/untyped.d.ts.map +1 -0
- package/dist/executors/build/untyped.js +17 -0
- package/dist/executors/build/untyped.mjs +17 -0
- package/dist/executors/build/untyped.mjs.map +1 -0
- package/dist/executors/clean/executor.d.mts +34 -2
- package/dist/executors/clean/executor.d.mts.map +1 -1
- package/dist/executors/clean/executor.d.ts +34 -2
- package/dist/executors/clean/executor.d.ts.map +1 -1
- package/dist/executors/clean/executor.js +1 -1
- package/dist/executors/clean/executor.mjs +1 -1
- package/dist/executors/clean/executor.mjs.map +1 -1
- package/dist/executors/clean/schema.d.js +0 -0
- package/dist/{src/executors/clean/executor.d.mts → executors/clean/schema.d.mts} +35 -12
- package/dist/executors/clean/schema.d.mts.map +1 -0
- package/dist/executors/clean/schema.d.ts +160 -141
- package/dist/executors/clean/schema.d.ts.map +1 -0
- package/dist/executors/clean/schema.json +40 -2
- package/dist/executors/clean/untyped.d.mts +7 -0
- package/dist/executors/clean/untyped.d.mts.map +1 -0
- package/dist/executors/clean/untyped.d.ts +6 -0
- package/dist/executors/clean/untyped.d.ts.map +1 -0
- package/dist/executors/clean/untyped.js +17 -0
- package/dist/executors/clean/untyped.mjs +17 -0
- package/dist/executors/clean/untyped.mjs.map +1 -0
- package/dist/executors/docs/executor.d.mts +34 -2
- package/dist/executors/docs/executor.d.mts.map +1 -1
- package/dist/executors/docs/executor.d.ts +34 -2
- package/dist/executors/docs/executor.d.ts.map +1 -1
- package/dist/executors/docs/executor.js +1 -1
- package/dist/executors/docs/executor.mjs +1 -1
- package/dist/executors/docs/executor.mjs.map +1 -1
- package/dist/executors/docs/schema.d.js +0 -0
- package/dist/{src/executors/docs/executor.d.mts → executors/docs/schema.d.mts} +35 -12
- package/dist/executors/docs/schema.d.mts.map +1 -0
- package/dist/executors/docs/schema.d.ts +160 -141
- package/dist/executors/docs/schema.d.ts.map +1 -0
- package/dist/executors/docs/schema.json +40 -2
- package/dist/executors/docs/untyped.d.mts +7 -0
- package/dist/executors/docs/untyped.d.mts.map +1 -0
- package/dist/executors/docs/untyped.d.ts +6 -0
- package/dist/executors/docs/untyped.d.ts.map +1 -0
- package/dist/executors/docs/untyped.js +17 -0
- package/dist/executors/docs/untyped.mjs +17 -0
- package/dist/executors/docs/untyped.mjs.map +1 -0
- package/dist/executors/lint/executor.d.mts +34 -2
- package/dist/executors/lint/executor.d.mts.map +1 -1
- package/dist/executors/lint/executor.d.ts +34 -2
- package/dist/executors/lint/executor.d.ts.map +1 -1
- package/dist/executors/lint/executor.js +1 -1
- package/dist/executors/lint/executor.mjs +1 -1
- package/dist/executors/lint/executor.mjs.map +1 -1
- package/dist/executors/lint/schema.d.js +0 -0
- package/dist/{src/executors/lint/executor.d.mts → executors/lint/schema.d.mts} +35 -12
- package/dist/executors/lint/schema.d.mts.map +1 -0
- package/dist/executors/lint/schema.d.ts +160 -141
- package/dist/executors/lint/schema.d.ts.map +1 -0
- package/dist/executors/lint/schema.json +40 -2
- package/dist/executors/lint/untyped.d.mts +7 -0
- package/dist/executors/lint/untyped.d.mts.map +1 -0
- package/dist/executors/lint/untyped.d.ts +6 -0
- package/dist/executors/lint/untyped.d.ts.map +1 -0
- package/dist/executors/lint/untyped.js +17 -0
- package/dist/executors/lint/untyped.mjs +17 -0
- package/dist/executors/lint/untyped.mjs.map +1 -0
- package/dist/executors/prepare/executor.d.mts +34 -2
- package/dist/executors/prepare/executor.d.mts.map +1 -1
- package/dist/executors/prepare/executor.d.ts +34 -2
- package/dist/executors/prepare/executor.d.ts.map +1 -1
- package/dist/executors/prepare/executor.js +1 -1
- package/dist/executors/prepare/executor.mjs +1 -1
- package/dist/executors/prepare/executor.mjs.map +1 -1
- package/dist/executors/prepare/schema.d.js +0 -0
- package/dist/{src/executors/prepare/executor.d.mts → executors/prepare/schema.d.mts} +35 -12
- package/dist/executors/prepare/schema.d.mts.map +1 -0
- package/dist/executors/prepare/schema.d.ts +160 -141
- package/dist/executors/prepare/schema.d.ts.map +1 -0
- package/dist/executors/prepare/schema.json +40 -2
- package/dist/executors/prepare/untyped.d.mts +7 -0
- package/dist/executors/prepare/untyped.d.mts.map +1 -0
- package/dist/executors/prepare/untyped.d.ts +6 -0
- package/dist/executors/prepare/untyped.d.ts.map +1 -0
- package/dist/executors/prepare/untyped.js +18 -0
- package/dist/executors/prepare/untyped.mjs +17 -0
- package/dist/executors/prepare/untyped.mjs.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/index.d.mts +1 -1
- package/dist/plugin/index.d.mts.map +1 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +3 -3
- package/dist/plugin/index.mjs +1 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/docs/api/base-executor.schema.md +31 -1
- package/docs/api/build/schema.md +31 -1
- package/docs/api/clean/schema.md +31 -1
- package/docs/api/docs/schema.md +31 -1
- package/docs/api/lint/schema.md +31 -1
- package/docs/api/prepare/schema.md +31 -1
- package/executors.json +10 -10
- package/package.json +45 -57
- package/dist/base-executor-5IKYZdSK.d.mts.map +0 -1
- package/dist/base-executor-D8wAP52R.d.ts +0 -143
- package/dist/base-executor-D8wAP52R.d.ts.map +0 -1
- package/dist/base-executor-Tb7NcSc4.mjs.map +0 -1
- package/dist/src/base/base-executor.schema.d.ts +0 -128
- package/dist/src/base-executor-5IKYZdSK.d.mts.map +0 -1
- package/dist/src/base-executor-D8wAP52R.d.ts +0 -143
- package/dist/src/base-executor-D8wAP52R.d.ts.map +0 -1
- package/dist/src/base-executor-Tb7NcSc4.mjs.map +0 -1
- package/dist/src/executors/build/executor.d.mts.map +0 -1
- package/dist/src/executors/build/executor.d.ts +0 -140
- package/dist/src/executors/build/executor.d.ts.map +0 -1
- package/dist/src/executors/build/executor.js +0 -19
- package/dist/src/executors/build/executor.mjs +0 -17
- package/dist/src/executors/build/executor.mjs.map +0 -1
- package/dist/src/executors/build/schema.d.ts +0 -144
- package/dist/src/executors/build/schema.json +0 -163
- package/dist/src/executors/clean/executor.d.mts.map +0 -1
- package/dist/src/executors/clean/executor.d.ts +0 -140
- package/dist/src/executors/clean/executor.d.ts.map +0 -1
- package/dist/src/executors/clean/executor.js +0 -14
- package/dist/src/executors/clean/executor.mjs +0 -13
- package/dist/src/executors/clean/executor.mjs.map +0 -1
- package/dist/src/executors/clean/schema.d.ts +0 -144
- package/dist/src/executors/clean/schema.json +0 -163
- package/dist/src/executors/docs/executor.d.mts.map +0 -1
- package/dist/src/executors/docs/executor.d.ts +0 -140
- package/dist/src/executors/docs/executor.d.ts.map +0 -1
- package/dist/src/executors/docs/executor.js +0 -15
- package/dist/src/executors/docs/executor.mjs +0 -13
- package/dist/src/executors/docs/executor.mjs.map +0 -1
- package/dist/src/executors/docs/schema.d.ts +0 -144
- package/dist/src/executors/docs/schema.json +0 -163
- package/dist/src/executors/lint/executor.d.mts.map +0 -1
- package/dist/src/executors/lint/executor.d.ts.map +0 -1
- package/dist/src/executors/lint/executor.js +0 -15
- package/dist/src/executors/lint/executor.mjs +0 -13
- package/dist/src/executors/lint/executor.mjs.map +0 -1
- package/dist/src/executors/lint/schema.json +0 -163
- package/dist/src/executors/prepare/executor.d.mts.map +0 -1
- package/dist/src/executors/prepare/executor.d.ts +0 -140
- package/dist/src/executors/prepare/executor.d.ts.map +0 -1
- package/dist/src/executors/prepare/executor.js +0 -19
- package/dist/src/executors/prepare/executor.mjs +0 -17
- package/dist/src/executors/prepare/executor.mjs.map +0 -1
- package/dist/src/executors/prepare/schema.d.ts +0 -144
- package/dist/src/executors/prepare/schema.json +0 -163
- package/dist/src/index.d.mts +0 -2
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.mjs.map +0 -1
- package/dist/src/plugin/index.d.mts +0 -8
- package/dist/src/plugin/index.d.mts.map +0 -1
- package/dist/src/plugin/index.d.ts +0 -8
- package/dist/src/plugin/index.d.ts.map +0 -1
- package/dist/src/plugin/index.js +0 -9
- package/dist/src/plugin/index.mjs +0 -8
- package/dist/src/plugin/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Shell Shock - Nx
|
|
4
4
|
|
|
5
|
+
## [0.0.46](https://github.com/storm-software/shell-shock/releases/tag/nx%400.0.46) (03/19/2026)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **nx:** Upgrade `powerlines` and resolving plugin bundling issue ([fa638c6](https://github.com/storm-software/shell-shock/commit/fa638c6))
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- **plugin-banner:** Added the `banner` build-in generator plugin ([ccf8599](https://github.com/storm-software/shell-shock/commit/ccf8599))
|
|
14
|
+
|
|
15
|
+
### Updated Dependencies
|
|
16
|
+
|
|
17
|
+
- Updated **core** to **v0.13.2**
|
|
18
|
+
|
|
19
|
+
## [0.0.45](https://github.com/storm-software/shell-shock/releases/tag/nx%400.0.45) (03/17/2026)
|
|
20
|
+
|
|
21
|
+
### Miscellaneous
|
|
22
|
+
|
|
23
|
+
- **monorepo:** Update workspace packages' dependencies ([c939e7e](https://github.com/storm-software/shell-shock/commit/c939e7e))
|
|
24
|
+
|
|
25
|
+
### Updated Dependencies
|
|
26
|
+
|
|
27
|
+
- Updated **core** to **v0.13.1**
|
|
28
|
+
|
|
5
29
|
## [0.0.44](https://github.com/storm-software/shell-shock/releases/tag/nx%400.0.44) (03/16/2026)
|
|
6
30
|
|
|
7
31
|
### Updated Dependencies
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the ⚡<b>Shell Shock</b> monorepo. The Shell Shock pack
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://stormsoftware.com/projects/shell-shock/) [](http://commitizen.github.io/cz-cli/)  
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -1,35 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_chunk = require('../chunk-BE-pF4vm.js');
|
|
28
3
|
let _storm_software_config_tools_logger = require("@storm-software/config-tools/logger");
|
|
29
4
|
let _storm_software_workspace_tools_base_base_executor = require("@storm-software/workspace-tools/base/base-executor");
|
|
30
5
|
let _stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
|
|
31
6
|
let defu = require("defu");
|
|
32
|
-
defu = __toESM(defu);
|
|
7
|
+
defu = require_chunk.__toESM(defu);
|
|
33
8
|
let jiti = require("jiti");
|
|
34
9
|
|
|
35
10
|
//#region src/base/base-executor.ts
|
|
@@ -58,7 +33,7 @@ function withExecutor(command, executorFn) {
|
|
|
58
33
|
description: projectConfig.metadata?.description,
|
|
59
34
|
projectType: projectConfig.projectType,
|
|
60
35
|
mode: options.mode,
|
|
61
|
-
output: {
|
|
36
|
+
output: { path: options.outputPath }
|
|
62
37
|
}, options));
|
|
63
38
|
try {
|
|
64
39
|
return await Promise.resolve(executorFn((0, defu.default)({
|
|
@@ -90,15 +65,4 @@ ${error.stack}` : "Unknown error"}`);
|
|
|
90
65
|
}
|
|
91
66
|
|
|
92
67
|
//#endregion
|
|
93
|
-
|
|
94
|
-
enumerable: true,
|
|
95
|
-
get: function () {
|
|
96
|
-
return __toESM;
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
Object.defineProperty(exports, 'withExecutor', {
|
|
100
|
-
enumerable: true,
|
|
101
|
-
get: function () {
|
|
102
|
-
return withExecutor;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
68
|
+
exports.withExecutor = withExecutor;
|
|
@@ -30,7 +30,7 @@ function withExecutor(command, executorFn) {
|
|
|
30
30
|
description: projectConfig.metadata?.description,
|
|
31
31
|
projectType: projectConfig.projectType,
|
|
32
32
|
mode: options.mode,
|
|
33
|
-
output: {
|
|
33
|
+
output: { path: options.outputPath }
|
|
34
34
|
}, options));
|
|
35
35
|
try {
|
|
36
36
|
return await Promise.resolve(executorFn(defu({
|
|
@@ -62,5 +62,5 @@ ${error.stack}` : "Unknown error"}`);
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
//#endregion
|
|
65
|
-
export { withExecutor
|
|
66
|
-
//# sourceMappingURL=base-executor
|
|
65
|
+
export { withExecutor };
|
|
66
|
+
//# sourceMappingURL=base-executor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-executor.mjs","names":[],"sources":["../../src/base/base-executor.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ExecutorContext, PromiseExecutor } from \"@nx/devkit\";\nimport type { ShellShockAPI, UserConfig } from \"@shell-shock/core\";\nimport { writeError } from \"@storm-software/config-tools/logger\";\nimport type { StormWorkspaceConfig } from \"@storm-software/config/types\";\nimport { withRunExecutor } from \"@storm-software/workspace-tools/base/base-executor\";\nimport type { BaseExecutorResult } from \"@storm-software/workspace-tools/types\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport defu from \"defu\";\nimport { createJiti } from \"jiti\";\nimport type { InlineConfig, PowerlinesCommand } from \"powerlines\";\nimport type { BaseExecutorSchema } from \"./base-executor.schema\";\n\nexport type ShellShockExecutorContext<\n TCommand extends PowerlinesCommand = PowerlinesCommand,\n TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema\n> = ExecutorContext & {\n projectName: string;\n command: TCommand;\n options: TExecutorSchema;\n inlineConfig: InlineConfig;\n workspaceConfig: StormWorkspaceConfig;\n};\n\n/**\n * A utility function to create a Shell Shock executor that can be used with the `withRunExecutor` function.\n *\n * @remarks\n * This function is designed to simplify the creation of Shell Shock executors by providing a consistent interface and error handling.\n *\n * @param command - The command that the executor will handle (e.g., \"new\", \"prepare\", \"build\", etc.).\n * @param executorFn - The function that will be executed when the command is run.\n * @returns A Promise that resolves to the result of the executor function.\n */\nexport function withExecutor<\n TCommand extends PowerlinesCommand = PowerlinesCommand,\n TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema\n>(\n command: TCommand,\n executorFn: (\n context: ShellShockExecutorContext<TCommand, TExecutorSchema>,\n api: ShellShockAPI\n ) =>\n | Promise<BaseExecutorResult | null | undefined>\n | BaseExecutorResult\n | null\n | undefined\n): PromiseExecutor<TExecutorSchema> {\n return withRunExecutor(\n `Shell Shock ${command} command executor`,\n async (\n options: TExecutorSchema,\n context: ExecutorContext,\n workspaceConfig: StormWorkspaceConfig\n ): Promise<BaseExecutorResult | null | undefined> => {\n if (!context.projectName) {\n throw new Error(\n \"The executor requires `projectName` on the context object.\"\n );\n }\n\n if (\n !context.projectName ||\n !context.projectsConfigurations?.projects ||\n !context.projectsConfigurations.projects[context.projectName] ||\n !context.projectsConfigurations.projects[context.projectName]?.root\n ) {\n throw new Error(\n \"The executor requires `projectsConfigurations` on the context object.\"\n );\n }\n\n const projectConfig =\n context.projectsConfigurations.projects[context.projectName]!;\n\n const jiti = createJiti(context.root, { cache: false });\n const { createShellShock } = await jiti.import<{\n createShellShock: typeof import(\"@shell-shock/core\").createShellShock;\n }>(\"@shell-shock/core\");\n\n const api = await createShellShock(\n defu(\n {\n name: projectConfig.name,\n root: projectConfig.root,\n sourceRoot: projectConfig.sourceRoot,\n tsconfig: options.tsconfig,\n logLevel: options.logLevel,\n description: projectConfig.metadata?.description,\n projectType: projectConfig.projectType,\n mode: options.mode,\n output: {\n path: options.outputPath\n }\n },\n options\n ) as Partial<UserConfig>\n );\n\n try {\n return await Promise.resolve(\n executorFn(\n defu(\n {\n projectName: context.projectName,\n options,\n workspaceConfig,\n inlineConfig: {\n command,\n configFile: options.configFile\n },\n command\n },\n context\n ),\n api\n )\n );\n } catch (error) {\n writeError(\n `An error occurred while executing the Shell Shock ${\n command\n } command executor: ${\n isError(error)\n ? `${error.message}\n\n${error.stack}`\n : \"Unknown error\"\n }`\n );\n\n return { success: false };\n } finally {\n await api.finalize();\n }\n },\n {\n skipReadingConfig: false,\n hooks: {\n applyDefaultOptions: (options: Partial<TExecutorSchema>) => {\n options.outputPath ??= \"dist/{projectRoot}\";\n options.configFile ??= \"{projectRoot}/shell-shock.config.ts\";\n\n return options as TExecutorSchema;\n }\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmDA,SAAgB,aAId,SACA,YAQkC;AAClC,QAAO,gBACL,eAAe,QAAQ,oBACvB,OACE,SACA,SACA,oBACmD;AACnD,MAAI,CAAC,QAAQ,YACX,OAAM,IAAI,MACR,6DACD;AAGH,MACE,CAAC,QAAQ,eACT,CAAC,QAAQ,wBAAwB,YACjC,CAAC,QAAQ,uBAAuB,SAAS,QAAQ,gBACjD,CAAC,QAAQ,uBAAuB,SAAS,QAAQ,cAAc,KAE/D,OAAM,IAAI,MACR,wEACD;EAGH,MAAM,gBACJ,QAAQ,uBAAuB,SAAS,QAAQ;EAGlD,MAAM,EAAE,qBAAqB,MADhB,WAAW,QAAQ,MAAM,EAAE,OAAO,OAAO,CAAC,CACf,OAErC,oBAAoB;EAEvB,MAAM,MAAM,MAAM,iBAChB,KACE;GACE,MAAM,cAAc;GACpB,MAAM,cAAc;GACpB,YAAY,cAAc;GAC1B,UAAU,QAAQ;GAClB,UAAU,QAAQ;GAClB,aAAa,cAAc,UAAU;GACrC,aAAa,cAAc;GAC3B,MAAM,QAAQ;GACd,QAAQ,EACN,MAAM,QAAQ,YACf;GACF,EACD,QACD,CACF;AAED,MAAI;AACF,UAAO,MAAM,QAAQ,QACnB,WACE,KACE;IACE,aAAa,QAAQ;IACrB;IACA;IACA,cAAc;KACZ;KACA,YAAY,QAAQ;KACrB;IACD;IACD,EACD,QACD,EACD,IACD,CACF;WACM,OAAO;AACd,cACE,qDACE,QACD,qBACC,QAAQ,MAAM,GACV,GAAG,MAAM,QAAQ;;EAE/B,MAAM,UACQ,kBAEP;AAED,UAAO,EAAE,SAAS,OAAO;YACjB;AACR,SAAM,IAAI,UAAU;;IAGxB;EACE,mBAAmB;EACnB,OAAO,EACL,sBAAsB,YAAsC;AAC1D,WAAQ,eAAe;AACvB,WAAQ,eAAe;AAEvB,UAAO;KAEV;EACF,CACF"}
|
|
File without changes
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import { PromiseExecutor } from "@nx/devkit";
|
|
3
|
-
import { BaseExecutorResult } from "@storm-software/workspace-tools/types";
|
|
4
|
-
import { ShellShockAPI } from "@shell-shock/core";
|
|
5
|
-
|
|
6
|
-
//#region src/executors/lint/schema.d.ts
|
|
1
|
+
//#region src/base/base-executor.schema.d.ts
|
|
7
2
|
// Generated by powerlines
|
|
8
3
|
// Do not edit this file directly
|
|
9
|
-
interface
|
|
4
|
+
interface BaseExecutorSchema {
|
|
10
5
|
/**
|
|
11
6
|
* Powerlines Configuration File
|
|
12
7
|
*
|
|
13
|
-
* The path to the Powerlines configuration file
|
|
8
|
+
* The path to the Powerlines configuration file. Alias for `configFile`.
|
|
9
|
+
*
|
|
10
|
+
* @default "{projectRoot}/powerlines.config.ts"
|
|
11
|
+
*
|
|
12
|
+
* @format path
|
|
13
|
+
*/
|
|
14
|
+
config?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Powerlines Configuration File
|
|
17
|
+
*
|
|
18
|
+
* The path to the Powerlines configuration file. Alias for `config`.
|
|
14
19
|
*
|
|
15
20
|
* @default "{projectRoot}/powerlines.config.ts"
|
|
16
21
|
*
|
|
@@ -45,6 +50,15 @@ interface LintExecutorSchema {
|
|
|
45
50
|
* @format path
|
|
46
51
|
*/
|
|
47
52
|
outputPath?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Copy Path
|
|
55
|
+
*
|
|
56
|
+
* A directory path to copy the build artifacts into
|
|
57
|
+
*
|
|
58
|
+
*
|
|
59
|
+
* @oneOf [object Object],[object Object]
|
|
60
|
+
*/
|
|
61
|
+
copyPath?: any;
|
|
48
62
|
/**
|
|
49
63
|
* Sourcemap
|
|
50
64
|
*
|
|
@@ -117,24 +131,19 @@ interface LintExecutorSchema {
|
|
|
117
131
|
*/
|
|
118
132
|
define?: Record<string, string>;
|
|
119
133
|
/**
|
|
120
|
-
*
|
|
134
|
+
* Assets
|
|
121
135
|
*
|
|
122
|
-
*
|
|
136
|
+
* The `assets` values
|
|
123
137
|
*
|
|
124
138
|
*/
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
skipCache?: boolean;
|
|
139
|
+
assets?: Array<{
|
|
140
|
+
input?: string;
|
|
141
|
+
output?: string;
|
|
142
|
+
glob: string;
|
|
143
|
+
ignore?: string[];
|
|
144
|
+
dot?: boolean;
|
|
145
|
+
}>;
|
|
133
146
|
}
|
|
134
147
|
//#endregion
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
declare const executor: PromiseExecutor<LintExecutorSchema>;
|
|
138
|
-
//#endregion
|
|
139
|
-
export { executor as default, executorFn };
|
|
140
|
-
//# sourceMappingURL=executor.d.ts.map
|
|
148
|
+
export { BaseExecutorSchema };
|
|
149
|
+
//# sourceMappingURL=base-executor.schema.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-executor.schema.d.mts","names":["BaseExecutorSchema","Array","Record","config","configFile","input","tsconfig","outputPath","copyPath","sourceMap","format","platform","external","noExternal","skipNodeModulesBundle","mode","logLevel","define","assets","output","glob","ignore","dot"],"sources":["../../src/base/base-executor.schema.d.ts"],"mappings":";;;UAIiBA,kBAAAA;;;;;;;;;;EAUhBG,MAAAA;;;;;;;;;;EAWAC,UAAAA;;;;;;;;;EAUAC,KAAAA,GAAQJ,KAAAA;;;;;;;;;;EAWRK,QAAAA;;;;;;;;;EAUAC,UAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,SAAAA;;;;;;;;EASAC,MAAAA,GAAST,KAAAA;;;;;;;;;;EAWTU,QAAAA;;;;;;;EAQAC,QAAAA,GAAWX,KAAAA;;;;;;;EAQXY,UAAAA,GAAaZ,KAAAA;;;;;;;EAQba,qBAAAA;;;;;;;;;EAUAC,IAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,MAAAA,GAASf,MAAAA;;;;;;;EAQTgB,MAAAA,GAASjB,KAAAA;IAAQI,KAAAA;IAAgBc,MAAAA;IAAiBC,IAAAA;IAAcC,MAAAA;IAAmBC,GAAAA;EAAAA;AAAAA"}
|
|
@@ -2,11 +2,22 @@
|
|
|
2
2
|
// Generated by powerlines
|
|
3
3
|
// Do not edit this file directly
|
|
4
4
|
|
|
5
|
-
export interface
|
|
5
|
+
export interface BaseExecutorSchema {
|
|
6
6
|
/**
|
|
7
7
|
* Powerlines Configuration File
|
|
8
8
|
*
|
|
9
|
-
* The path to the Powerlines configuration file
|
|
9
|
+
* The path to the Powerlines configuration file. Alias for `configFile`.
|
|
10
|
+
*
|
|
11
|
+
* @default "{projectRoot}/powerlines.config.ts"
|
|
12
|
+
*
|
|
13
|
+
* @format path
|
|
14
|
+
*/
|
|
15
|
+
config?: string,
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Powerlines Configuration File
|
|
19
|
+
*
|
|
20
|
+
* The path to the Powerlines configuration file. Alias for `config`.
|
|
10
21
|
*
|
|
11
22
|
* @default "{projectRoot}/powerlines.config.ts"
|
|
12
23
|
*
|
|
@@ -45,6 +56,16 @@ export interface LintExecutorSchema {
|
|
|
45
56
|
*/
|
|
46
57
|
outputPath?: string,
|
|
47
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Copy Path
|
|
61
|
+
*
|
|
62
|
+
* A directory path to copy the build artifacts into
|
|
63
|
+
*
|
|
64
|
+
*
|
|
65
|
+
* @oneOf [object Object],[object Object]
|
|
66
|
+
*/
|
|
67
|
+
copyPath?: any,
|
|
68
|
+
|
|
48
69
|
/**
|
|
49
70
|
* Sourcemap
|
|
50
71
|
*
|
|
@@ -126,19 +147,11 @@ export interface LintExecutorSchema {
|
|
|
126
147
|
define?: Record<string, string>,
|
|
127
148
|
|
|
128
149
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* Automatically install dependencies during prepare stage
|
|
132
|
-
*
|
|
133
|
-
*/
|
|
134
|
-
autoInstall?: boolean,
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Skip Cache
|
|
150
|
+
* Assets
|
|
138
151
|
*
|
|
139
|
-
*
|
|
152
|
+
* The `assets` values
|
|
140
153
|
*
|
|
141
154
|
*/
|
|
142
|
-
|
|
155
|
+
assets?: Array<{ input?: string; output?: string; glob: string; ignore?: string[]; dot?: boolean; }>,
|
|
143
156
|
}
|
|
144
157
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-executor.schema.d.ts","names":["BaseExecutorSchema","Array","Record","config","configFile","input","tsconfig","outputPath","copyPath","sourceMap","format","platform","external","noExternal","skipNodeModulesBundle","mode","logLevel","define","assets","output","glob","ignore","dot"],"sources":["../../src/base/base-executor.schema.d.ts"],"mappings":";;;UAIiBA,kBAAAA;;;;;;;;;;EAUhBG,MAAAA;;;;;;;;;;EAWAC,UAAAA;;;;;;;;;EAUAC,KAAAA,GAAQJ,KAAAA;;;;;;;;;;EAWRK,QAAAA;;;;;;;;;EAUAC,UAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,SAAAA;;;;;;;;EASAC,MAAAA,GAAST,KAAAA;;;;;;;;;;EAWTU,QAAAA;;;;;;;EAQAC,QAAAA,GAAWX,KAAAA;;;;;;;EAQXY,UAAAA,GAAaZ,KAAAA;;;;;;;EAQba,qBAAAA;;;;;;;;;EAUAC,IAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,MAAAA,GAASf,MAAAA;;;;;;;EAQTgB,MAAAA,GAASjB,KAAAA;IAAQI,KAAAA;IAAgBc,MAAAA;IAAiBC,IAAAA;IAAcC,MAAAA;IAAmBC,GAAAA;EAAAA;AAAAA"}
|
|
@@ -4,11 +4,19 @@
|
|
|
4
4
|
"description": "A shared/base schema type definition for Shell Shock executors",
|
|
5
5
|
"required": [],
|
|
6
6
|
"properties": {
|
|
7
|
+
"config": {
|
|
8
|
+
"title": "Powerlines Configuration File",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"format": "path",
|
|
11
|
+
"description": "The path to the Powerlines configuration file. Alias for `configFile`.",
|
|
12
|
+
"id": "#config",
|
|
13
|
+
"default": "{projectRoot}/powerlines.config.ts"
|
|
14
|
+
},
|
|
7
15
|
"configFile": {
|
|
8
16
|
"title": "Powerlines Configuration File",
|
|
9
17
|
"type": "string",
|
|
10
18
|
"format": "path",
|
|
11
|
-
"description": "The path to the Powerlines configuration file",
|
|
19
|
+
"description": "The path to the Powerlines configuration file. Alias for `config`.",
|
|
12
20
|
"id": "#configFile",
|
|
13
21
|
"default": "{projectRoot}/powerlines.config.ts"
|
|
14
22
|
},
|
|
@@ -37,6 +45,25 @@
|
|
|
37
45
|
"description": "The path to the output directory for the build artifacts",
|
|
38
46
|
"id": "#outputPath"
|
|
39
47
|
},
|
|
48
|
+
"copyPath": {
|
|
49
|
+
"title": "Copy Path",
|
|
50
|
+
"description": "A directory path to copy the build artifacts into",
|
|
51
|
+
"oneOf": [
|
|
52
|
+
{
|
|
53
|
+
"type": "string",
|
|
54
|
+
"format": "path"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"enum": [
|
|
59
|
+
false
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"id": "#copyPath",
|
|
64
|
+
"type": "any",
|
|
65
|
+
"default": {}
|
|
66
|
+
},
|
|
40
67
|
"sourceMap": {
|
|
41
68
|
"title": "Sourcemap",
|
|
42
69
|
"type": "boolean",
|
|
@@ -133,12 +160,22 @@
|
|
|
133
160
|
"description": "The `define` values",
|
|
134
161
|
"id": "#define",
|
|
135
162
|
"default": {}
|
|
163
|
+
},
|
|
164
|
+
"assets": {
|
|
165
|
+
"title": "Assets",
|
|
166
|
+
"type": "any",
|
|
167
|
+
"tsType": "Array<{ input?: string; output?: string; glob: string; ignore?: string[]; dot?: boolean; }>",
|
|
168
|
+
"description": "The `assets` values",
|
|
169
|
+
"id": "#assets",
|
|
170
|
+
"default": {}
|
|
136
171
|
}
|
|
137
172
|
},
|
|
138
173
|
"type": "object",
|
|
139
174
|
"default": {
|
|
175
|
+
"config": "{projectRoot}/powerlines.config.ts",
|
|
140
176
|
"configFile": "{projectRoot}/powerlines.config.ts",
|
|
141
177
|
"tsconfig": "{projectRoot}/tsconfig.json",
|
|
178
|
+
"copyPath": {},
|
|
142
179
|
"format": [
|
|
143
180
|
"cjs",
|
|
144
181
|
"esm"
|
|
@@ -146,6 +183,7 @@
|
|
|
146
183
|
"platform": "neutral",
|
|
147
184
|
"external": [],
|
|
148
185
|
"noExternal": [],
|
|
149
|
-
"define": {}
|
|
186
|
+
"define": {},
|
|
187
|
+
"assets": {}
|
|
150
188
|
}
|
|
151
189
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const require_base_executor = require('./base-executor-B_1n4Nst.js');
|
|
1
|
+
const require_chunk = require('../chunk-BE-pF4vm.js');
|
|
3
2
|
let _powerlines_nx_base_base_executor_untyped = require("@powerlines/nx/base/base-executor.untyped");
|
|
4
|
-
_powerlines_nx_base_base_executor_untyped =
|
|
3
|
+
_powerlines_nx_base_base_executor_untyped = require_chunk.__toESM(_powerlines_nx_base_base_executor_untyped);
|
|
5
4
|
let untyped = require("untyped");
|
|
6
5
|
|
|
7
6
|
//#region src/base/base-executor.untyped.ts
|
|
@@ -16,4 +15,4 @@ var base_executor_untyped_default = (0, untyped.defineUntypedSchema)({
|
|
|
16
15
|
});
|
|
17
16
|
|
|
18
17
|
//#endregion
|
|
19
|
-
exports
|
|
18
|
+
module.exports = base_executor_untyped_default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { t as withExecutor } from "./base-executor-Tb7NcSc4.mjs";
|
|
2
1
|
import baseExecutorSchema from "@powerlines/nx/base/base-executor.untyped";
|
|
3
2
|
import { defineUntypedSchema } from "untyped";
|
|
4
3
|
|
|
@@ -14,5 +13,5 @@ var base_executor_untyped_default = defineUntypedSchema({
|
|
|
14
13
|
});
|
|
15
14
|
|
|
16
15
|
//#endregion
|
|
17
|
-
export {
|
|
18
|
-
//# sourceMappingURL=
|
|
16
|
+
export { base_executor_untyped_default as default };
|
|
17
|
+
//# sourceMappingURL=base-executor.untyped.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-executor.untyped.mjs","names":[],"sources":["../../src/base/base-executor.untyped.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport baseExecutorSchema from \"@powerlines/nx/base/base-executor.untyped\";\nimport { defineUntypedSchema } from \"untyped\";\n\nexport default defineUntypedSchema({\n ...baseExecutorSchema,\n $schema: {\n id: \"BaseExecutorSchema\",\n title: \"Base Executor\",\n description:\n \"A shared/base schema type definition for Shell Shock executors\",\n required: []\n }\n});\n"],"mappings":";;;;AAqBA,oCAAe,oBAAoB;CACjC,GAAG;CACH,SAAS;EACP,IAAI;EACJ,OAAO;EACP,aACE;EACF,UAAU,EAAE;EACb;CACF,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseExecutorSchema } from "./base/base-executor.schema.mjs";
|
|
2
|
+
import { ExecutorContext, PromiseExecutor } from "@nx/devkit";
|
|
3
|
+
import { ShellShockAPI } from "@shell-shock/core";
|
|
4
|
+
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
5
|
+
import { BaseExecutorResult } from "@storm-software/workspace-tools/types";
|
|
6
|
+
import { InlineConfig, PowerlinesCommand } from "powerlines";
|
|
7
|
+
|
|
8
|
+
//#region src/base/base-executor.d.ts
|
|
9
|
+
type ShellShockExecutorContext<TCommand extends PowerlinesCommand = PowerlinesCommand, TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema> = ExecutorContext & {
|
|
10
|
+
projectName: string;
|
|
11
|
+
command: TCommand;
|
|
12
|
+
options: TExecutorSchema;
|
|
13
|
+
inlineConfig: InlineConfig;
|
|
14
|
+
workspaceConfig: StormWorkspaceConfig;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A utility function to create a Shell Shock executor that can be used with the `withRunExecutor` function.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* This function is designed to simplify the creation of Shell Shock executors by providing a consistent interface and error handling.
|
|
21
|
+
*
|
|
22
|
+
* @param command - The command that the executor will handle (e.g., "new", "prepare", "build", etc.).
|
|
23
|
+
* @param executorFn - The function that will be executed when the command is run.
|
|
24
|
+
* @returns A Promise that resolves to the result of the executor function.
|
|
25
|
+
*/
|
|
26
|
+
declare function withExecutor<TCommand extends PowerlinesCommand = PowerlinesCommand, TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema>(command: TCommand, executorFn: (context: ShellShockExecutorContext<TCommand, TExecutorSchema>, api: ShellShockAPI) => Promise<BaseExecutorResult | null | undefined> | BaseExecutorResult | null | undefined): PromiseExecutor<TExecutorSchema>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { withExecutor as n, ShellShockExecutorContext as t };
|
|
29
|
+
//# sourceMappingURL=base-executor-CE7_IgHr.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-executor-CE7_IgHr.d.mts","names":[],"sources":["../src/base/base-executor.ts"],"mappings":";;;;;;;;KA8BY,yBAAA,kBACO,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,IAC3C,eAAA;EACF,WAAA;EACA,OAAA,EAAS,QAAA;EACT,OAAA,EAAS,eAAA;EACT,YAAA,EAAc,YAAA;EACd,eAAA,EAAiB,oBAAA;AAAA;;;;;;;;;;;iBAaH,YAAA,kBACG,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,CAAA,CAE7C,OAAA,EAAS,QAAA,EACT,UAAA,GACE,OAAA,EAAS,yBAAA,CAA0B,QAAA,EAAU,eAAA,GAC7C,GAAA,EAAK,aAAA,KAEH,OAAA,CAAQ,kBAAA,uBACR,kBAAA,sBAGH,eAAA,CAAgB,eAAA"}
|
|
@@ -11,7 +11,17 @@ interface BaseExecutorSchema {
|
|
|
11
11
|
/**
|
|
12
12
|
* Powerlines Configuration File
|
|
13
13
|
*
|
|
14
|
-
* The path to the Powerlines configuration file
|
|
14
|
+
* The path to the Powerlines configuration file. Alias for `configFile`.
|
|
15
|
+
*
|
|
16
|
+
* @default "{projectRoot}/powerlines.config.ts"
|
|
17
|
+
*
|
|
18
|
+
* @format path
|
|
19
|
+
*/
|
|
20
|
+
config?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Powerlines Configuration File
|
|
23
|
+
*
|
|
24
|
+
* The path to the Powerlines configuration file. Alias for `config`.
|
|
15
25
|
*
|
|
16
26
|
* @default "{projectRoot}/powerlines.config.ts"
|
|
17
27
|
*
|
|
@@ -46,6 +56,15 @@ interface BaseExecutorSchema {
|
|
|
46
56
|
* @format path
|
|
47
57
|
*/
|
|
48
58
|
outputPath?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Copy Path
|
|
61
|
+
*
|
|
62
|
+
* A directory path to copy the build artifacts into
|
|
63
|
+
*
|
|
64
|
+
*
|
|
65
|
+
* @oneOf [object Object],[object Object]
|
|
66
|
+
*/
|
|
67
|
+
copyPath?: any;
|
|
49
68
|
/**
|
|
50
69
|
* Sourcemap
|
|
51
70
|
*
|
|
@@ -117,6 +136,19 @@ interface BaseExecutorSchema {
|
|
|
117
136
|
*
|
|
118
137
|
*/
|
|
119
138
|
define?: Record<string, string>;
|
|
139
|
+
/**
|
|
140
|
+
* Assets
|
|
141
|
+
*
|
|
142
|
+
* The `assets` values
|
|
143
|
+
*
|
|
144
|
+
*/
|
|
145
|
+
assets?: Array<{
|
|
146
|
+
input?: string;
|
|
147
|
+
output?: string;
|
|
148
|
+
glob: string;
|
|
149
|
+
ignore?: string[];
|
|
150
|
+
dot?: boolean;
|
|
151
|
+
}>;
|
|
120
152
|
}
|
|
121
153
|
//#endregion
|
|
122
154
|
//#region src/base/base-executor.d.ts
|
|
@@ -140,4 +172,4 @@ type ShellShockExecutorContext<TCommand extends PowerlinesCommand = PowerlinesCo
|
|
|
140
172
|
declare function withExecutor<TCommand extends PowerlinesCommand = PowerlinesCommand, TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema>(command: TCommand, executorFn: (context: ShellShockExecutorContext<TCommand, TExecutorSchema>, api: ShellShockAPI) => Promise<BaseExecutorResult | null | undefined> | BaseExecutorResult | null | undefined): PromiseExecutor<TExecutorSchema>;
|
|
141
173
|
//#endregion
|
|
142
174
|
export { withExecutor as n, ShellShockExecutorContext as t };
|
|
143
|
-
//# sourceMappingURL=base-executor-
|
|
175
|
+
//# sourceMappingURL=base-executor-CPOK8Lba.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-executor-CPOK8Lba.d.mts","names":["BaseExecutorSchema","Array","Record","config","configFile","input","tsconfig","outputPath","copyPath","sourceMap","format","platform","external","noExternal","skipNodeModulesBundle","mode","logLevel","define","assets","output","glob","ignore","dot"],"sources":["../src/base/base-executor.schema.d.ts","../src/base/base-executor.ts"],"mappings":";;;;;;;;;UAIiBA,kBAAAA;;;AAAjB;;;;;;;EAUCG,MAAAA;;;;;;;;;;EAWAC,UAAAA;;;;;;;;;EAUAC,KAAAA,GAAQJ,KAAAA;;;;;;;;;;EAWRK,QAAAA;;;AChBD;;;;;;ED0BCC,UAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,SAAAA;;;;;;;ACvBD;EDgCCC,MAAAA,GAAST,KAAAA;;;;;;;;;;EAWTU,QAAAA;;;;;;;EAQAC,QAAAA,GAAWX,KAAAA;;;;;;;EAQXY,UAAAA,GAAaZ,KAAAA;;;;;;;EAQba,qBAAAA;;;;;;;;;EAUAC,IAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,MAAAA,GAASf,MAAAA;;;;;;;EAQTgB,MAAAA,GAASjB,KAAAA;IAAQI,KAAAA;IAAgBc,MAAAA;IAAiBC,IAAAA;IAAcC,MAAAA;IAAmBC,GAAAA;EAAAA;AAAAA;;;KC5HxE,yBAAA,kBACO,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,IAC3C,eAAA;EACF,WAAA;EACA,OAAA,EAAS,QAAA;EACT,OAAA,EAAS,eAAA;EACT,YAAA,EAAc,YAAA;EACd,eAAA,EAAiB,oBAAA;AAAA;;;;;;;;;;;iBAaH,YAAA,kBACG,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,CAAA,CAE7C,OAAA,EAAS,QAAA,EACT,UAAA,GACE,OAAA,EAAS,yBAAA,CAA0B,QAAA,EAAU,eAAA,GAC7C,GAAA,EAAK,aAAA,KAEH,OAAA,CAAQ,kBAAA,uBACR,kBAAA,sBAGH,eAAA,CAAgB,eAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseExecutorSchema } from "./base/base-executor.schema.js";
|
|
2
|
+
import { ExecutorContext, PromiseExecutor } from "@nx/devkit";
|
|
3
|
+
import { ShellShockAPI } from "@shell-shock/core";
|
|
4
|
+
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
5
|
+
import { BaseExecutorResult } from "@storm-software/workspace-tools/types";
|
|
6
|
+
import { InlineConfig, PowerlinesCommand } from "powerlines";
|
|
7
|
+
|
|
8
|
+
//#region src/base/base-executor.d.ts
|
|
9
|
+
type ShellShockExecutorContext<TCommand extends PowerlinesCommand = PowerlinesCommand, TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema> = ExecutorContext & {
|
|
10
|
+
projectName: string;
|
|
11
|
+
command: TCommand;
|
|
12
|
+
options: TExecutorSchema;
|
|
13
|
+
inlineConfig: InlineConfig;
|
|
14
|
+
workspaceConfig: StormWorkspaceConfig;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A utility function to create a Shell Shock executor that can be used with the `withRunExecutor` function.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* This function is designed to simplify the creation of Shell Shock executors by providing a consistent interface and error handling.
|
|
21
|
+
*
|
|
22
|
+
* @param command - The command that the executor will handle (e.g., "new", "prepare", "build", etc.).
|
|
23
|
+
* @param executorFn - The function that will be executed when the command is run.
|
|
24
|
+
* @returns A Promise that resolves to the result of the executor function.
|
|
25
|
+
*/
|
|
26
|
+
declare function withExecutor<TCommand extends PowerlinesCommand = PowerlinesCommand, TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema>(command: TCommand, executorFn: (context: ShellShockExecutorContext<TCommand, TExecutorSchema>, api: ShellShockAPI) => Promise<BaseExecutorResult | null | undefined> | BaseExecutorResult | null | undefined): PromiseExecutor<TExecutorSchema>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { withExecutor as n, ShellShockExecutorContext as t };
|
|
29
|
+
//# sourceMappingURL=base-executor-Co2z43MK.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-executor-Co2z43MK.d.ts","names":[],"sources":["../src/base/base-executor.ts"],"mappings":";;;;;;;;KA8BY,yBAAA,kBACO,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,IAC3C,eAAA;EACF,WAAA;EACA,OAAA,EAAS,QAAA;EACT,OAAA,EAAS,eAAA;EACT,YAAA,EAAc,YAAA;EACd,eAAA,EAAiB,oBAAA;AAAA;;;;;;;;;;;iBAaH,YAAA,kBACG,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,CAAA,CAE7C,OAAA,EAAS,QAAA,EACT,UAAA,GACE,OAAA,EAAS,yBAAA,CAA0B,QAAA,EAAU,eAAA,GAC7C,GAAA,EAAK,aAAA,KAEH,OAAA,CAAQ,kBAAA,uBACR,kBAAA,sBAGH,eAAA,CAAgB,eAAA"}
|
|
@@ -30,7 +30,7 @@ function withExecutor(command, executorFn) {
|
|
|
30
30
|
description: projectConfig.metadata?.description,
|
|
31
31
|
projectType: projectConfig.projectType,
|
|
32
32
|
mode: options.mode,
|
|
33
|
-
output: {
|
|
33
|
+
output: { path: options.outputPath }
|
|
34
34
|
}, options));
|
|
35
35
|
try {
|
|
36
36
|
return await Promise.resolve(executorFn(defu({
|
|
@@ -63,4 +63,4 @@ ${error.stack}` : "Unknown error"}`);
|
|
|
63
63
|
|
|
64
64
|
//#endregion
|
|
65
65
|
export { withExecutor as t };
|
|
66
|
-
//# sourceMappingURL=base-executor-
|
|
66
|
+
//# sourceMappingURL=base-executor-DojAZA0w.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-executor-DojAZA0w.mjs","names":[],"sources":["../src/base/base-executor.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ExecutorContext, PromiseExecutor } from \"@nx/devkit\";\nimport type { ShellShockAPI, UserConfig } from \"@shell-shock/core\";\nimport { writeError } from \"@storm-software/config-tools/logger\";\nimport type { StormWorkspaceConfig } from \"@storm-software/config/types\";\nimport { withRunExecutor } from \"@storm-software/workspace-tools/base/base-executor\";\nimport type { BaseExecutorResult } from \"@storm-software/workspace-tools/types\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport defu from \"defu\";\nimport { createJiti } from \"jiti\";\nimport type { InlineConfig, PowerlinesCommand } from \"powerlines\";\nimport type { BaseExecutorSchema } from \"./base-executor.schema\";\n\nexport type ShellShockExecutorContext<\n TCommand extends PowerlinesCommand = PowerlinesCommand,\n TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema\n> = ExecutorContext & {\n projectName: string;\n command: TCommand;\n options: TExecutorSchema;\n inlineConfig: InlineConfig;\n workspaceConfig: StormWorkspaceConfig;\n};\n\n/**\n * A utility function to create a Shell Shock executor that can be used with the `withRunExecutor` function.\n *\n * @remarks\n * This function is designed to simplify the creation of Shell Shock executors by providing a consistent interface and error handling.\n *\n * @param command - The command that the executor will handle (e.g., \"new\", \"prepare\", \"build\", etc.).\n * @param executorFn - The function that will be executed when the command is run.\n * @returns A Promise that resolves to the result of the executor function.\n */\nexport function withExecutor<\n TCommand extends PowerlinesCommand = PowerlinesCommand,\n TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema\n>(\n command: TCommand,\n executorFn: (\n context: ShellShockExecutorContext<TCommand, TExecutorSchema>,\n api: ShellShockAPI\n ) =>\n | Promise<BaseExecutorResult | null | undefined>\n | BaseExecutorResult\n | null\n | undefined\n): PromiseExecutor<TExecutorSchema> {\n return withRunExecutor(\n `Shell Shock ${command} command executor`,\n async (\n options: TExecutorSchema,\n context: ExecutorContext,\n workspaceConfig: StormWorkspaceConfig\n ): Promise<BaseExecutorResult | null | undefined> => {\n if (!context.projectName) {\n throw new Error(\n \"The executor requires `projectName` on the context object.\"\n );\n }\n\n if (\n !context.projectName ||\n !context.projectsConfigurations?.projects ||\n !context.projectsConfigurations.projects[context.projectName] ||\n !context.projectsConfigurations.projects[context.projectName]?.root\n ) {\n throw new Error(\n \"The executor requires `projectsConfigurations` on the context object.\"\n );\n }\n\n const projectConfig =\n context.projectsConfigurations.projects[context.projectName]!;\n\n const jiti = createJiti(context.root, { cache: false });\n const { createShellShock } = await jiti.import<{\n createShellShock: typeof import(\"@shell-shock/core\").createShellShock;\n }>(\"@shell-shock/core\");\n\n const api = await createShellShock(\n defu(\n {\n name: projectConfig.name,\n root: projectConfig.root,\n sourceRoot: projectConfig.sourceRoot,\n tsconfig: options.tsconfig,\n logLevel: options.logLevel,\n description: projectConfig.metadata?.description,\n projectType: projectConfig.projectType,\n mode: options.mode,\n output: {\n path: options.outputPath\n }\n },\n options\n ) as Partial<UserConfig>\n );\n\n try {\n return await Promise.resolve(\n executorFn(\n defu(\n {\n projectName: context.projectName,\n options,\n workspaceConfig,\n inlineConfig: {\n command,\n configFile: options.configFile\n },\n command\n },\n context\n ),\n api\n )\n );\n } catch (error) {\n writeError(\n `An error occurred while executing the Shell Shock ${\n command\n } command executor: ${\n isError(error)\n ? `${error.message}\n\n${error.stack}`\n : \"Unknown error\"\n }`\n );\n\n return { success: false };\n } finally {\n await api.finalize();\n }\n },\n {\n skipReadingConfig: false,\n hooks: {\n applyDefaultOptions: (options: Partial<TExecutorSchema>) => {\n options.outputPath ??= \"dist/{projectRoot}\";\n options.configFile ??= \"{projectRoot}/shell-shock.config.ts\";\n\n return options as TExecutorSchema;\n }\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmDA,SAAgB,aAId,SACA,YAQkC;AAClC,QAAO,gBACL,eAAe,QAAQ,oBACvB,OACE,SACA,SACA,oBACmD;AACnD,MAAI,CAAC,QAAQ,YACX,OAAM,IAAI,MACR,6DACD;AAGH,MACE,CAAC,QAAQ,eACT,CAAC,QAAQ,wBAAwB,YACjC,CAAC,QAAQ,uBAAuB,SAAS,QAAQ,gBACjD,CAAC,QAAQ,uBAAuB,SAAS,QAAQ,cAAc,KAE/D,OAAM,IAAI,MACR,wEACD;EAGH,MAAM,gBACJ,QAAQ,uBAAuB,SAAS,QAAQ;EAGlD,MAAM,EAAE,qBAAqB,MADhB,WAAW,QAAQ,MAAM,EAAE,OAAO,OAAO,CAAC,CACf,OAErC,oBAAoB;EAEvB,MAAM,MAAM,MAAM,iBAChB,KACE;GACE,MAAM,cAAc;GACpB,MAAM,cAAc;GACpB,YAAY,cAAc;GAC1B,UAAU,QAAQ;GAClB,UAAU,QAAQ;GAClB,aAAa,cAAc,UAAU;GACrC,aAAa,cAAc;GAC3B,MAAM,QAAQ;GACd,QAAQ,EACN,MAAM,QAAQ,YACf;GACF,EACD,QACD,CACF;AAED,MAAI;AACF,UAAO,MAAM,QAAQ,QACnB,WACE,KACE;IACE,aAAa,QAAQ;IACrB;IACA;IACA,cAAc;KACZ;KACA,YAAY,QAAQ;KACrB;IACD;IACD,EACD,QACD,EACD,IACD,CACF;WACM,OAAO;AACd,cACE,qDACE,QACD,qBACC,QAAQ,MAAM,GACV,GAAG,MAAM,QAAQ;;EAE/B,MAAM,UACQ,kBAEP;AAED,UAAO,EAAE,SAAS,OAAO;YACjB;AACR,SAAM,IAAI,UAAU;;IAGxB;EACE,mBAAmB;EACnB,OAAO,EACL,sBAAsB,YAAsC;AAC1D,WAAQ,eAAe;AACvB,WAAQ,eAAe;AAEvB,UAAO;KAEV;EACF,CACF"}
|