@powerlines/nx 0.11.268 → 0.11.270
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/README.md +29 -31
- package/dist/src/base/base-executor.d.mts +1 -1
- package/dist/src/base/base-executor.d.ts +1 -1
- package/dist/src/base/base-executor.js +78 -3
- package/dist/src/base/base-executor.mjs +75 -3
- package/dist/src/base/base-executor.mjs.map +1 -0
- package/dist/src/base/base-executor.schema.d.mts +117 -2
- package/dist/src/base/base-executor.schema.d.mts.map +1 -0
- package/dist/src/base/base-executor.schema.d.ts +117 -2
- package/dist/src/base/base-executor.schema.d.ts.map +1 -0
- package/dist/src/base/base-executor.untyped.d.mts +1 -1
- package/dist/src/base/base-executor.untyped.d.ts +1 -1
- package/dist/src/base/base-executor.untyped.js +135 -2
- package/dist/src/base/base-executor.untyped.mjs +135 -2
- package/dist/src/base/base-executor.untyped.mjs.map +1 -0
- package/dist/src/base/index.d.mts +1 -3
- package/dist/src/base/index.d.ts +1 -1
- package/dist/src/base/index.js +4 -5
- package/dist/src/base/index.mjs +2 -4
- package/dist/src/base-executor-Bj63x9OE.d.ts +28 -0
- package/dist/src/base-executor-Bj63x9OE.d.ts.map +1 -0
- package/dist/src/base-executor-D6POztG2.d.mts +28 -0
- package/dist/src/base-executor-D6POztG2.d.mts.map +1 -0
- package/dist/src/base-executor.untyped-D4R6pki2.d.ts +7 -0
- package/dist/src/base-executor.untyped-D4R6pki2.d.ts.map +1 -0
- package/dist/src/base-executor.untyped-hmlG6oyC.d.mts +7 -0
- package/dist/src/base-executor.untyped-hmlG6oyC.d.mts.map +1 -0
- package/dist/src/chunk-BE-pF4vm.js +34 -0
- package/dist/src/{constants-BvODbBl8.d.ts → constants-CbG11Mby.d.ts} +1 -1
- package/dist/src/constants-CbG11Mby.d.ts.map +1 -0
- package/dist/src/{constants-ByputsG8.d.mts → constants-VDvVnoLC.d.mts} +1 -1
- package/dist/src/constants-VDvVnoLC.d.mts.map +1 -0
- package/dist/src/executors/build/executor.d.mts +2 -16
- package/dist/src/executors/build/executor.d.mts.map +1 -1
- package/dist/src/executors/build/executor.d.ts +2 -16
- package/dist/src/executors/build/executor.d.ts.map +1 -1
- package/dist/src/executors/build/executor.js +6 -7
- package/dist/src/executors/build/executor.mjs +4 -6
- package/dist/src/executors/build/executor.mjs.map +1 -1
- package/dist/src/executors/build/untyped.d.mts +2 -2
- package/dist/src/executors/build/untyped.d.mts.map +1 -1
- package/dist/src/executors/build/untyped.d.ts +2 -2
- package/dist/src/executors/build/untyped.d.ts.map +1 -1
- package/dist/src/executors/build/untyped.js +3 -4
- package/dist/src/executors/build/untyped.mjs +1 -2
- package/dist/src/executors/build/untyped.mjs.map +1 -1
- package/dist/src/executors/clean/executor.d.mts +2 -13
- package/dist/src/executors/clean/executor.d.mts.map +1 -1
- package/dist/src/executors/clean/executor.d.ts +2 -13
- package/dist/src/executors/clean/executor.d.ts.map +1 -1
- package/dist/src/executors/clean/executor.js +4 -6
- package/dist/src/executors/clean/executor.mjs +2 -4
- package/dist/src/executors/clean/executor.mjs.map +1 -1
- package/dist/src/executors/clean/untyped.d.mts +2 -2
- package/dist/src/executors/clean/untyped.d.mts.map +1 -1
- package/dist/src/executors/clean/untyped.d.ts +2 -2
- package/dist/src/executors/clean/untyped.d.ts.map +1 -1
- package/dist/src/executors/clean/untyped.js +3 -3
- package/dist/src/executors/clean/untyped.mjs +1 -1
- package/dist/src/executors/docs/executor.d.mts +2 -15
- package/dist/src/executors/docs/executor.d.mts.map +1 -1
- package/dist/src/executors/docs/executor.d.ts +2 -15
- package/dist/src/executors/docs/executor.d.ts.map +1 -1
- package/dist/src/executors/docs/executor.js +4 -6
- package/dist/src/executors/docs/executor.mjs +2 -4
- package/dist/src/executors/docs/executor.mjs.map +1 -1
- package/dist/src/executors/docs/untyped.d.mts +2 -2
- package/dist/src/executors/docs/untyped.d.mts.map +1 -1
- package/dist/src/executors/docs/untyped.d.ts +2 -2
- package/dist/src/executors/docs/untyped.d.ts.map +1 -1
- package/dist/src/executors/docs/untyped.js +3 -4
- package/dist/src/executors/docs/untyped.mjs +1 -2
- package/dist/src/executors/docs/untyped.mjs.map +1 -1
- package/dist/src/executors/lint/executor.d.mts +2 -15
- package/dist/src/executors/lint/executor.d.mts.map +1 -1
- package/dist/src/executors/lint/executor.d.ts +2 -15
- package/dist/src/executors/lint/executor.d.ts.map +1 -1
- package/dist/src/executors/lint/executor.js +4 -6
- package/dist/src/executors/lint/executor.mjs +2 -4
- package/dist/src/executors/lint/executor.mjs.map +1 -1
- package/dist/src/executors/lint/untyped.d.mts +2 -2
- package/dist/src/executors/lint/untyped.d.mts.map +1 -1
- package/dist/src/executors/lint/untyped.d.ts +2 -2
- package/dist/src/executors/lint/untyped.d.ts.map +1 -1
- package/dist/src/executors/lint/untyped.js +3 -4
- package/dist/src/executors/lint/untyped.mjs +1 -2
- package/dist/src/executors/lint/untyped.mjs.map +1 -1
- package/dist/src/executors/prepare/executor.d.mts +2 -15
- package/dist/src/executors/prepare/executor.d.mts.map +1 -1
- package/dist/src/executors/prepare/executor.d.ts +2 -15
- package/dist/src/executors/prepare/executor.d.ts.map +1 -1
- package/dist/src/executors/prepare/executor.js +6 -7
- package/dist/src/executors/prepare/executor.mjs +4 -6
- package/dist/src/executors/prepare/executor.mjs.map +1 -1
- package/dist/src/executors/prepare/untyped.d.mts +2 -2
- package/dist/src/executors/prepare/untyped.d.mts.map +1 -1
- package/dist/src/executors/prepare/untyped.d.ts +2 -2
- package/dist/src/executors/prepare/untyped.d.ts.map +1 -1
- package/dist/src/executors/prepare/untyped.js +26 -3
- package/dist/src/executors/prepare/untyped.mjs +26 -3
- package/dist/src/executors/prepare/untyped.mjs.map +1 -0
- package/dist/src/generators/sync/generator.d.mts.map +1 -1
- package/dist/src/generators/sync/generator.d.ts.map +1 -1
- package/dist/src/generators/sync/generator.js +5 -6
- package/dist/src/generators/sync/generator.mjs +1 -2
- package/dist/src/generators/sync/generator.mjs.map +1 -1
- package/dist/src/generators/sync/untyped.d.mts +2 -2
- package/dist/src/generators/sync/untyped.d.mts.map +1 -1
- package/dist/src/generators/sync/untyped.d.ts +2 -2
- package/dist/src/generators/sync/untyped.d.ts.map +1 -1
- package/dist/src/generators/sync/untyped.js +1 -1
- package/dist/src/helpers/constants.d.mts +1 -1
- package/dist/src/helpers/constants.d.ts +1 -1
- package/dist/src/helpers/constants.js +34 -2
- package/dist/src/helpers/constants.mjs +33 -2
- package/dist/src/helpers/constants.mjs.map +1 -0
- package/dist/src/helpers/index.d.mts +2 -3
- package/dist/src/helpers/index.d.ts +2 -2
- package/dist/src/helpers/index.js +7 -8
- package/dist/src/helpers/index.mjs +2 -4
- package/dist/src/helpers/plugin-utilities.d.mts +1 -1
- package/dist/src/helpers/plugin-utilities.d.ts +1 -1
- package/dist/src/helpers/plugin-utilities.js +274 -5
- package/dist/src/helpers/plugin-utilities.mjs +270 -3
- package/dist/src/helpers/plugin-utilities.mjs.map +1 -0
- package/dist/src/index.d.mts +4 -7
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.js +11 -12
- package/dist/src/index.mjs +5 -7
- package/dist/src/plugin/index.d.mts +1 -1
- package/dist/src/plugin/index.d.mts.map +1 -1
- package/dist/src/plugin/index.d.ts +1 -1
- package/dist/src/plugin/index.d.ts.map +1 -1
- package/dist/src/plugin/index.js +3 -3
- package/dist/src/plugin/index.mjs +1 -2
- package/dist/src/plugin/index.mjs.map +1 -1
- package/dist/src/{plugin-DIj3oU64.d.mts → plugin-B_ZGdX7U.d.mts} +1 -1
- package/dist/src/plugin-B_ZGdX7U.d.mts.map +1 -0
- package/dist/src/{plugin-DN475itb.d.ts → plugin-DpyutMl2.d.ts} +1 -1
- package/dist/src/plugin-DpyutMl2.d.ts.map +1 -0
- package/dist/src/{plugin-utilities-Bz3Muyag.d.mts → plugin-utilities-Cg-Ccp4C.d.mts} +2 -3
- package/dist/src/plugin-utilities-Cg-Ccp4C.d.mts.map +1 -0
- package/dist/src/{plugin-utilities-CeMy-9YQ.d.ts → plugin-utilities-CmfuC3TZ.d.ts} +2 -3
- package/dist/src/plugin-utilities-CmfuC3TZ.d.ts.map +1 -0
- package/dist/src/types/index.d.mts +1 -1
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/types/plugin.d.mts +1 -1
- package/dist/src/types/plugin.d.ts +1 -1
- package/package.json +4 -4
- package/dist/src/base-B7jekb-W.js +0 -0
- package/dist/src/base-BRSa-clf.mjs +0 -1
- package/dist/src/base-executor-BY0qdmfF.js +0 -4881
- package/dist/src/base-executor-CC8rBACl.mjs +0 -4863
- package/dist/src/base-executor-CC8rBACl.mjs.map +0 -1
- package/dist/src/base-executor-CWToCKgJ.d.ts +0 -2195
- package/dist/src/base-executor-CWToCKgJ.d.ts.map +0 -1
- package/dist/src/base-executor-Cc27ehGx.js +0 -4881
- package/dist/src/base-executor-PhChSWwR.mjs +0 -4863
- package/dist/src/base-executor-PhChSWwR.mjs.map +0 -1
- package/dist/src/base-executor-xsZuLKpp.d.mts +0 -2197
- package/dist/src/base-executor-xsZuLKpp.d.mts.map +0 -1
- package/dist/src/base-executor.schema-BaaDD_VU.d.ts +0 -130
- package/dist/src/base-executor.schema-BaaDD_VU.d.ts.map +0 -1
- package/dist/src/base-executor.schema-CYPLsYvI.d.mts +0 -130
- package/dist/src/base-executor.schema-CYPLsYvI.d.mts.map +0 -1
- package/dist/src/base-executor.untyped-B24q82iI.d.ts +0 -7
- package/dist/src/base-executor.untyped-B24q82iI.d.ts.map +0 -1
- package/dist/src/base-executor.untyped-C1pQETnQ.mjs +0 -136
- package/dist/src/base-executor.untyped-C1pQETnQ.mjs.map +0 -1
- package/dist/src/base-executor.untyped-Cz1Zw_02.js +0 -141
- package/dist/src/base-executor.untyped-DBccuF6E.d.ts +0 -7
- package/dist/src/base-executor.untyped-DBccuF6E.d.ts.map +0 -1
- package/dist/src/base-executor.untyped-imww7Gm9.d.mts +0 -7
- package/dist/src/base-executor.untyped-imww7Gm9.d.mts.map +0 -1
- package/dist/src/config-CGQhS8tm.js +0 -239
- package/dist/src/config-LoR-NIJg.mjs +0 -147
- package/dist/src/config-LoR-NIJg.mjs.map +0 -1
- package/dist/src/constants-BvODbBl8.d.ts.map +0 -1
- package/dist/src/constants-ByputsG8.d.mts.map +0 -1
- package/dist/src/constants-CKuImMYn.js +0 -39
- package/dist/src/constants-DzvoYj5w.mjs +0 -34
- package/dist/src/constants-DzvoYj5w.mjs.map +0 -1
- package/dist/src/helpers-B78f0Oey.js +0 -0
- package/dist/src/helpers-j01T2doK.mjs +0 -1
- package/dist/src/index-7rWKHdox.d.mts +0 -1
- package/dist/src/index-CB5PSF-Q.d.ts +0 -1
- package/dist/src/index-CDDzqahH.d.ts +0 -1
- package/dist/src/index-CsuikFeJ.d.mts +0 -1
- package/dist/src/index-LhFpnU-f.d.mts +0 -1
- package/dist/src/index-g0mugXoV.d.ts +0 -1
- package/dist/src/plugin-BnaFlFmT.js +0 -0
- package/dist/src/plugin-DIj3oU64.d.mts.map +0 -1
- package/dist/src/plugin-DN475itb.d.ts.map +0 -1
- package/dist/src/plugin-DRjpXVSI.mjs +0 -1
- package/dist/src/plugin-utilities-ByTgFCEW.js +0 -287
- package/dist/src/plugin-utilities-Bz3Muyag.d.mts.map +0 -1
- package/dist/src/plugin-utilities-CeMy-9YQ.d.ts.map +0 -1
- package/dist/src/plugin-utilities-DamtoOxO.mjs +0 -270
- package/dist/src/plugin-utilities-DamtoOxO.mjs.map +0 -1
- package/dist/src/untyped-BzuygGwJ.mjs +0 -27
- package/dist/src/untyped-BzuygGwJ.mjs.map +0 -1
- package/dist/src/untyped-CB-jtwm-.js +0 -32
package/README.md
CHANGED
|
@@ -52,37 +52,35 @@ A package containing tools for managing a Storm workspace. It includes various
|
|
|
52
52
|
|
|
53
53
|
## Table of Contents
|
|
54
54
|
|
|
55
|
-
- [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- [
|
|
59
|
-
- [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
- [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
- [Contributing](#contributing)
|
|
85
|
-
- [Contributors](#contributors)
|
|
55
|
+
- [Installing](#installing)
|
|
56
|
+
- [Executors](#executors)
|
|
57
|
+
- [Clean Executor](#clean-executor)
|
|
58
|
+
- [Example](#example)
|
|
59
|
+
- [Options](#options)
|
|
60
|
+
- [Prepare Executor](#prepare-executor)
|
|
61
|
+
- [Example](#example-1)
|
|
62
|
+
- [Options](#options-1)
|
|
63
|
+
- [Lint Executor](#lint-executor)
|
|
64
|
+
- [Example](#example-2)
|
|
65
|
+
- [Options](#options-2)
|
|
66
|
+
- [Build Executor](#build-executor)
|
|
67
|
+
- [Example](#example-3)
|
|
68
|
+
- [Options](#options-3)
|
|
69
|
+
- [Docs Executor](#docs-executor)
|
|
70
|
+
- [Example](#example-4)
|
|
71
|
+
- [Options](#options-4)
|
|
72
|
+
- [Generators](#generators)
|
|
73
|
+
- [Sync Generator](#sync-generator)
|
|
74
|
+
- [Options](#options-5)
|
|
75
|
+
- [Building](#building)
|
|
76
|
+
- [Running unit tests](#running-unit-tests)
|
|
77
|
+
- [Storm Workspaces](#storm-workspaces)
|
|
78
|
+
- [Roadmap](#roadmap)
|
|
79
|
+
- [Support](#support)
|
|
80
|
+
- [License](#license)
|
|
81
|
+
- [Changelog](#changelog)
|
|
82
|
+
- [Contributing](#contributing)
|
|
83
|
+
- [Contributors](#contributors)
|
|
86
84
|
|
|
87
85
|
<!-- END doctoc -->
|
|
88
86
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as withExecutor, t as PowerlinesExecutorContext } from "../base-executor-
|
|
1
|
+
import { n as withExecutor, t as PowerlinesExecutorContext } from "../base-executor-D6POztG2.mjs";
|
|
2
2
|
export { PowerlinesExecutorContext, withExecutor };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as withExecutor, t as PowerlinesExecutorContext } from "../base-executor-
|
|
1
|
+
import { n as withExecutor, t as PowerlinesExecutorContext } from "../base-executor-Bj63x9OE.js";
|
|
2
2
|
export { PowerlinesExecutorContext, withExecutor };
|
|
@@ -1,4 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_chunk = require('../chunk-BE-pF4vm.js');
|
|
3
|
+
let _storm_software_config_tools_logger = require("@storm-software/config-tools/logger");
|
|
4
|
+
let _storm_software_workspace_tools_base_base_executor = require("@storm-software/workspace-tools/base/base-executor");
|
|
5
|
+
let _stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
|
|
6
|
+
let defu = require("defu");
|
|
7
|
+
defu = require_chunk.__toESM(defu);
|
|
8
|
+
let powerlines = require("powerlines");
|
|
9
|
+
powerlines = require_chunk.__toESM(powerlines);
|
|
3
10
|
|
|
4
|
-
|
|
11
|
+
//#region src/base/base-executor.ts
|
|
12
|
+
/**
|
|
13
|
+
* A utility function to create a Powerlines executor that can be used with the `withRunExecutor` function.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* This function is designed to simplify the creation of Powerlines executors by providing a consistent interface and error handling.
|
|
17
|
+
*
|
|
18
|
+
* @param command - The command that the executor will handle (e.g., "new", "prepare", "build", etc.).
|
|
19
|
+
* @param executorFn - The function that will be executed when the command is run.
|
|
20
|
+
* @returns A Promise that resolves to the result of the executor function.
|
|
21
|
+
*/
|
|
22
|
+
function withExecutor(command, executorFn) {
|
|
23
|
+
return (0, _storm_software_workspace_tools_base_base_executor.withRunExecutor)(`Powerlines ${command} command executor`, async (options, context, workspaceConfig) => {
|
|
24
|
+
if (!context.projectName) throw new Error("The executor requires `projectName` on the context object.");
|
|
25
|
+
if (!context.projectName || !context.projectsConfigurations?.projects || !context.projectsConfigurations.projects[context.projectName] || !context.projectsConfigurations.projects[context.projectName]?.root) throw new Error("The executor requires `projectsConfigurations` on the context object.");
|
|
26
|
+
const projectConfig = context.projectsConfigurations.projects[context.projectName];
|
|
27
|
+
const api = await powerlines.default.from(workspaceConfig.workspaceRoot, (0, defu.default)({
|
|
28
|
+
input: options.input,
|
|
29
|
+
output: {
|
|
30
|
+
outputPath: options.outputPath ?? projectConfig.targets?.build?.options?.outputPath,
|
|
31
|
+
format: options.format,
|
|
32
|
+
sourceMap: options.sourceMap
|
|
33
|
+
},
|
|
34
|
+
resolve: {
|
|
35
|
+
external: options.external,
|
|
36
|
+
noExternal: options.noExternal,
|
|
37
|
+
skipNodeModulesBundle: options.skipNodeModulesBundle
|
|
38
|
+
},
|
|
39
|
+
root: projectConfig.root,
|
|
40
|
+
projectType: projectConfig.projectType,
|
|
41
|
+
sourceRoot: projectConfig.sourceRoot,
|
|
42
|
+
tsconfig: options.tsconfig,
|
|
43
|
+
platform: options.platform,
|
|
44
|
+
define: options.define,
|
|
45
|
+
logLevel: options.logLevel,
|
|
46
|
+
mode: options.mode
|
|
47
|
+
}, options));
|
|
48
|
+
try {
|
|
49
|
+
return await Promise.resolve(executorFn((0, defu.default)({
|
|
50
|
+
projectName: context.projectName,
|
|
51
|
+
options,
|
|
52
|
+
workspaceConfig,
|
|
53
|
+
inlineConfig: {
|
|
54
|
+
command,
|
|
55
|
+
configFile: options.configFile
|
|
56
|
+
},
|
|
57
|
+
command
|
|
58
|
+
}, context), api));
|
|
59
|
+
} catch (error) {
|
|
60
|
+
(0, _storm_software_config_tools_logger.writeError)(`An error occurred while executing the Powerlines ${command} command executor: ${(0, _stryke_type_checks_is_error.isError)(error) ? `${error.message}
|
|
61
|
+
|
|
62
|
+
${error.stack}` : "Unknown error"}`);
|
|
63
|
+
return { success: false };
|
|
64
|
+
} finally {
|
|
65
|
+
await api.finalize();
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
skipReadingConfig: false,
|
|
69
|
+
hooks: { applyDefaultOptions: (options) => {
|
|
70
|
+
if (options.mode !== "development" && options.mode !== "test") options.mode = "production";
|
|
71
|
+
options.outputPath ??= "dist/{projectRoot}";
|
|
72
|
+
options.configFile ??= "{projectRoot}/powerlines.config.ts";
|
|
73
|
+
return options;
|
|
74
|
+
} }
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
exports.withExecutor = withExecutor;
|
|
@@ -1,4 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
1
|
+
import { writeError } from "@storm-software/config-tools/logger";
|
|
2
|
+
import { withRunExecutor } from "@storm-software/workspace-tools/base/base-executor";
|
|
3
|
+
import { isError } from "@stryke/type-checks/is-error";
|
|
4
|
+
import defu from "defu";
|
|
5
|
+
import PowerlinesAPI from "powerlines";
|
|
3
6
|
|
|
4
|
-
|
|
7
|
+
//#region src/base/base-executor.ts
|
|
8
|
+
/**
|
|
9
|
+
* A utility function to create a Powerlines executor that can be used with the `withRunExecutor` function.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* This function is designed to simplify the creation of Powerlines executors by providing a consistent interface and error handling.
|
|
13
|
+
*
|
|
14
|
+
* @param command - The command that the executor will handle (e.g., "new", "prepare", "build", etc.).
|
|
15
|
+
* @param executorFn - The function that will be executed when the command is run.
|
|
16
|
+
* @returns A Promise that resolves to the result of the executor function.
|
|
17
|
+
*/
|
|
18
|
+
function withExecutor(command, executorFn) {
|
|
19
|
+
return withRunExecutor(`Powerlines ${command} command executor`, async (options, context, workspaceConfig) => {
|
|
20
|
+
if (!context.projectName) throw new Error("The executor requires `projectName` on the context object.");
|
|
21
|
+
if (!context.projectName || !context.projectsConfigurations?.projects || !context.projectsConfigurations.projects[context.projectName] || !context.projectsConfigurations.projects[context.projectName]?.root) throw new Error("The executor requires `projectsConfigurations` on the context object.");
|
|
22
|
+
const projectConfig = context.projectsConfigurations.projects[context.projectName];
|
|
23
|
+
const api = await PowerlinesAPI.from(workspaceConfig.workspaceRoot, defu({
|
|
24
|
+
input: options.input,
|
|
25
|
+
output: {
|
|
26
|
+
outputPath: options.outputPath ?? projectConfig.targets?.build?.options?.outputPath,
|
|
27
|
+
format: options.format,
|
|
28
|
+
sourceMap: options.sourceMap
|
|
29
|
+
},
|
|
30
|
+
resolve: {
|
|
31
|
+
external: options.external,
|
|
32
|
+
noExternal: options.noExternal,
|
|
33
|
+
skipNodeModulesBundle: options.skipNodeModulesBundle
|
|
34
|
+
},
|
|
35
|
+
root: projectConfig.root,
|
|
36
|
+
projectType: projectConfig.projectType,
|
|
37
|
+
sourceRoot: projectConfig.sourceRoot,
|
|
38
|
+
tsconfig: options.tsconfig,
|
|
39
|
+
platform: options.platform,
|
|
40
|
+
define: options.define,
|
|
41
|
+
logLevel: options.logLevel,
|
|
42
|
+
mode: options.mode
|
|
43
|
+
}, options));
|
|
44
|
+
try {
|
|
45
|
+
return await Promise.resolve(executorFn(defu({
|
|
46
|
+
projectName: context.projectName,
|
|
47
|
+
options,
|
|
48
|
+
workspaceConfig,
|
|
49
|
+
inlineConfig: {
|
|
50
|
+
command,
|
|
51
|
+
configFile: options.configFile
|
|
52
|
+
},
|
|
53
|
+
command
|
|
54
|
+
}, context), api));
|
|
55
|
+
} catch (error) {
|
|
56
|
+
writeError(`An error occurred while executing the Powerlines ${command} command executor: ${isError(error) ? `${error.message}
|
|
57
|
+
|
|
58
|
+
${error.stack}` : "Unknown error"}`);
|
|
59
|
+
return { success: false };
|
|
60
|
+
} finally {
|
|
61
|
+
await api.finalize();
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
skipReadingConfig: false,
|
|
65
|
+
hooks: { applyDefaultOptions: (options) => {
|
|
66
|
+
if (options.mode !== "development" && options.mode !== "test") options.mode = "production";
|
|
67
|
+
options.outputPath ??= "dist/{projectRoot}";
|
|
68
|
+
options.configFile ??= "{projectRoot}/powerlines.config.ts";
|
|
69
|
+
return options;
|
|
70
|
+
} }
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
export { withExecutor };
|
|
76
|
+
//# 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 - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutorContext, PromiseExecutor } from \"@nx/devkit\";\nimport { writeError } from \"@storm-software/config-tools/logger\";\nimport { StormWorkspaceConfig } from \"@storm-software/config/types\";\nimport { withRunExecutor } from \"@storm-software/workspace-tools/base/base-executor\";\nimport { BaseExecutorResult } from \"@storm-software/workspace-tools/types\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport defu from \"defu\";\nimport type {\n InitialUserConfig,\n InlineConfig,\n PowerlinesCommand\n} from \"powerlines\";\nimport PowerlinesAPI from \"powerlines\";\nimport { BaseExecutorSchema } from \"./base-executor.schema\";\n\nexport type PowerlinesExecutorContext<\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 Powerlines executor that can be used with the `withRunExecutor` function.\n *\n * @remarks\n * This function is designed to simplify the creation of Powerlines 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: PowerlinesExecutorContext<TCommand, TExecutorSchema>,\n api: PowerlinesAPI\n ) =>\n | Promise<BaseExecutorResult | null | undefined>\n | BaseExecutorResult\n | null\n | undefined\n): PromiseExecutor<TExecutorSchema> {\n return withRunExecutor(\n `Powerlines ${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 api = await PowerlinesAPI.from(\n workspaceConfig.workspaceRoot,\n defu(\n {\n input: options.input,\n output: {\n outputPath:\n options.outputPath ??\n projectConfig.targets?.build?.options?.outputPath,\n format: options.format,\n sourceMap: options.sourceMap\n },\n resolve: {\n external: options.external,\n noExternal: options.noExternal,\n skipNodeModulesBundle: options.skipNodeModulesBundle\n },\n root: projectConfig.root,\n projectType: projectConfig.projectType,\n sourceRoot: projectConfig.sourceRoot,\n tsconfig: options.tsconfig,\n platform: options.platform,\n define: options.define,\n logLevel: options.logLevel,\n mode: options.mode\n },\n options\n ) as InitialUserConfig\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 Powerlines ${\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 if (options.mode !== \"development\" && options.mode !== \"test\") {\n options.mode = \"production\";\n }\n\n options.outputPath ??= \"dist/{projectRoot}\";\n options.configFile ??= \"{projectRoot}/powerlines.config.ts\";\n\n return options as TExecutorSchema;\n }\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsDA,SAAgB,aAId,SACA,YAQkC;AAClC,QAAO,gBACL,cAAc,QAAQ,oBACtB,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;EAElD,MAAM,MAAM,MAAM,cAAc,KAC9B,gBAAgB,eAChB,KACE;GACE,OAAO,QAAQ;GACf,QAAQ;IACN,YACE,QAAQ,cACR,cAAc,SAAS,OAAO,SAAS;IACzC,QAAQ,QAAQ;IAChB,WAAW,QAAQ;IACpB;GACD,SAAS;IACP,UAAU,QAAQ;IAClB,YAAY,QAAQ;IACpB,uBAAuB,QAAQ;IAChC;GACD,MAAM,cAAc;GACpB,aAAa,cAAc;GAC3B,YAAY,cAAc;GAC1B,UAAU,QAAQ;GAClB,UAAU,QAAQ;GAClB,QAAQ,QAAQ;GAChB,UAAU,QAAQ;GAClB,MAAM,QAAQ;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,oDACE,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,OAAI,QAAQ,SAAS,iBAAiB,QAAQ,SAAS,OACrD,SAAQ,OAAO;AAGjB,WAAQ,eAAe;AACvB,WAAQ,eAAe;AAEvB,UAAO;KAEV;EACF,CACF"}
|
|
@@ -1,2 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/base/base-executor.schema.d.ts
|
|
2
|
+
// Generated by @storm-software/untyped
|
|
3
|
+
// Do not edit this file directly
|
|
4
|
+
interface BaseExecutorSchema {
|
|
5
|
+
/**
|
|
6
|
+
* Powerlines Configuration File
|
|
7
|
+
*
|
|
8
|
+
* The path to the Powerlines configuration file
|
|
9
|
+
*
|
|
10
|
+
* @default "{projectRoot}/powerlines.config.ts"
|
|
11
|
+
*
|
|
12
|
+
* @format path
|
|
13
|
+
*/
|
|
14
|
+
configFile?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Input Entry File(s)
|
|
17
|
+
*
|
|
18
|
+
* The entry file(s) that serve as the input for the project
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
* @format path
|
|
22
|
+
*/
|
|
23
|
+
input?: Array<string>;
|
|
24
|
+
/**
|
|
25
|
+
* TSConfig Path
|
|
26
|
+
*
|
|
27
|
+
* The path to the tsconfig file
|
|
28
|
+
*
|
|
29
|
+
* @default "{projectRoot}/tsconfig.json"
|
|
30
|
+
*
|
|
31
|
+
* @format path
|
|
32
|
+
*/
|
|
33
|
+
tsconfig?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Output Path
|
|
36
|
+
*
|
|
37
|
+
* The path to the output directory for the build artifacts
|
|
38
|
+
*
|
|
39
|
+
*
|
|
40
|
+
* @format path
|
|
41
|
+
*/
|
|
42
|
+
outputPath?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Sourcemap
|
|
45
|
+
*
|
|
46
|
+
* Generate a sourcemap
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
sourceMap?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Format
|
|
52
|
+
*
|
|
53
|
+
* The format to build
|
|
54
|
+
*
|
|
55
|
+
* @default ["cjs","esm"]
|
|
56
|
+
*/
|
|
57
|
+
format?: Array<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Platform
|
|
60
|
+
*
|
|
61
|
+
* The platform to build
|
|
62
|
+
*
|
|
63
|
+
* @default "neutral"
|
|
64
|
+
*
|
|
65
|
+
* @enum neutral,node,browser
|
|
66
|
+
*/
|
|
67
|
+
platform?: string;
|
|
68
|
+
/**
|
|
69
|
+
* External
|
|
70
|
+
*
|
|
71
|
+
* The external dependencies
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
external?: Array<any>;
|
|
75
|
+
/**
|
|
76
|
+
* No External
|
|
77
|
+
*
|
|
78
|
+
* The dependencies that should not be treated as external
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
noExternal?: Array<any>;
|
|
82
|
+
/**
|
|
83
|
+
* Skip Node Modules Bundle
|
|
84
|
+
*
|
|
85
|
+
* Skip bundling node_modules during the build process (if required)
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
skipNodeModulesBundle?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Mode
|
|
91
|
+
*
|
|
92
|
+
* The build mode
|
|
93
|
+
*
|
|
94
|
+
*
|
|
95
|
+
* @enum development,test,production
|
|
96
|
+
*/
|
|
97
|
+
mode?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Log Level
|
|
100
|
+
*
|
|
101
|
+
* The log level to use for the build process
|
|
102
|
+
*
|
|
103
|
+
*
|
|
104
|
+
* @enum fatal,error,warn,success,info,debug,trace,silent
|
|
105
|
+
*/
|
|
106
|
+
logLevel?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Define
|
|
109
|
+
*
|
|
110
|
+
* The `define` values
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
113
|
+
define?: Record<string, string>;
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
export { BaseExecutorSchema };
|
|
117
|
+
//# sourceMappingURL=base-executor.schema.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-executor.schema.d.mts","names":["BaseExecutorSchema","Array","Record","configFile","input","tsconfig","outputPath","sourceMap","format","platform","external","noExternal","skipNodeModulesBundle","mode","logLevel","define"],"sources":["../../../src/base/base-executor.schema.d.ts"],"mappings":";;;UAIiBA,kBAAAA;;;;;;;;;;EAUhBG,UAAAA;;;;;;;;;EAUAC,KAAAA,GAAQH,KAAAA;;;;;;;;;;EAWRI,QAAAA;;;;;;;;;EAUAC,UAAAA;;;;;;;EAQAC,SAAAA;;;;;;;;EASAC,MAAAA,GAASP,KAAAA;;;;;;;;;;EAWTQ,QAAAA;;;;;;;EAQAC,QAAAA,GAAWT,KAAAA;;;;;;;EAQXU,UAAAA,GAAaV,KAAAA;;;;;;;EAQbW,qBAAAA;;;;;;;;;EAUAC,IAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,MAAAA,GAASb,MAAAA;AAAAA"}
|
|
@@ -1,2 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/base/base-executor.schema.d.ts
|
|
2
|
+
// Generated by @storm-software/untyped
|
|
3
|
+
// Do not edit this file directly
|
|
4
|
+
interface BaseExecutorSchema {
|
|
5
|
+
/**
|
|
6
|
+
* Powerlines Configuration File
|
|
7
|
+
*
|
|
8
|
+
* The path to the Powerlines configuration file
|
|
9
|
+
*
|
|
10
|
+
* @default "{projectRoot}/powerlines.config.ts"
|
|
11
|
+
*
|
|
12
|
+
* @format path
|
|
13
|
+
*/
|
|
14
|
+
configFile?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Input Entry File(s)
|
|
17
|
+
*
|
|
18
|
+
* The entry file(s) that serve as the input for the project
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
* @format path
|
|
22
|
+
*/
|
|
23
|
+
input?: Array<string>;
|
|
24
|
+
/**
|
|
25
|
+
* TSConfig Path
|
|
26
|
+
*
|
|
27
|
+
* The path to the tsconfig file
|
|
28
|
+
*
|
|
29
|
+
* @default "{projectRoot}/tsconfig.json"
|
|
30
|
+
*
|
|
31
|
+
* @format path
|
|
32
|
+
*/
|
|
33
|
+
tsconfig?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Output Path
|
|
36
|
+
*
|
|
37
|
+
* The path to the output directory for the build artifacts
|
|
38
|
+
*
|
|
39
|
+
*
|
|
40
|
+
* @format path
|
|
41
|
+
*/
|
|
42
|
+
outputPath?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Sourcemap
|
|
45
|
+
*
|
|
46
|
+
* Generate a sourcemap
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
sourceMap?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Format
|
|
52
|
+
*
|
|
53
|
+
* The format to build
|
|
54
|
+
*
|
|
55
|
+
* @default ["cjs","esm"]
|
|
56
|
+
*/
|
|
57
|
+
format?: Array<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Platform
|
|
60
|
+
*
|
|
61
|
+
* The platform to build
|
|
62
|
+
*
|
|
63
|
+
* @default "neutral"
|
|
64
|
+
*
|
|
65
|
+
* @enum neutral,node,browser
|
|
66
|
+
*/
|
|
67
|
+
platform?: string;
|
|
68
|
+
/**
|
|
69
|
+
* External
|
|
70
|
+
*
|
|
71
|
+
* The external dependencies
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
external?: Array<any>;
|
|
75
|
+
/**
|
|
76
|
+
* No External
|
|
77
|
+
*
|
|
78
|
+
* The dependencies that should not be treated as external
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
noExternal?: Array<any>;
|
|
82
|
+
/**
|
|
83
|
+
* Skip Node Modules Bundle
|
|
84
|
+
*
|
|
85
|
+
* Skip bundling node_modules during the build process (if required)
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
skipNodeModulesBundle?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Mode
|
|
91
|
+
*
|
|
92
|
+
* The build mode
|
|
93
|
+
*
|
|
94
|
+
*
|
|
95
|
+
* @enum development,test,production
|
|
96
|
+
*/
|
|
97
|
+
mode?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Log Level
|
|
100
|
+
*
|
|
101
|
+
* The log level to use for the build process
|
|
102
|
+
*
|
|
103
|
+
*
|
|
104
|
+
* @enum fatal,error,warn,success,info,debug,trace,silent
|
|
105
|
+
*/
|
|
106
|
+
logLevel?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Define
|
|
109
|
+
*
|
|
110
|
+
* The `define` values
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
113
|
+
define?: Record<string, string>;
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
export { BaseExecutorSchema };
|
|
117
|
+
//# sourceMappingURL=base-executor.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-executor.schema.d.ts","names":["BaseExecutorSchema","Array","Record","configFile","input","tsconfig","outputPath","sourceMap","format","platform","external","noExternal","skipNodeModulesBundle","mode","logLevel","define"],"sources":["../../../src/base/base-executor.schema.d.ts"],"mappings":";;;UAIiBA,kBAAAA;;;;;;;;;;EAUhBG,UAAAA;;;;;;;;;EAUAC,KAAAA,GAAQH,KAAAA;;;;;;;;;;EAWRI,QAAAA;;;;;;;;;EAUAC,UAAAA;;;;;;;EAQAC,SAAAA;;;;;;;;EASAC,MAAAA,GAASP,KAAAA;;;;;;;;;;EAWTQ,QAAAA;;;;;;;EAQAC,QAAAA,GAAWT,KAAAA;;;;;;;EAQXU,UAAAA,GAAaV,KAAAA;;;;;;;EAQbW,qBAAAA;;;;;;;;;EAUAC,IAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,MAAAA,GAASb,MAAAA;AAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "../base-executor.untyped-
|
|
1
|
+
import { t as _default } from "../base-executor.untyped-hmlG6oyC.mjs";
|
|
2
2
|
export { _default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "../base-executor.untyped-
|
|
1
|
+
import { t as _default } from "../base-executor.untyped-D4R6pki2.js";
|
|
2
2
|
export = _default;
|
|
@@ -1,3 +1,136 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_chunk = require('../chunk-BE-pF4vm.js');
|
|
2
|
+
let untyped = require("untyped");
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
//#region src/base/base-executor.untyped.ts
|
|
5
|
+
var base_executor_untyped_default = (0, untyped.defineUntypedSchema)({
|
|
6
|
+
$schema: {
|
|
7
|
+
id: "BaseExecutorSchema",
|
|
8
|
+
title: "Base Executor",
|
|
9
|
+
description: "A shared/base schema type definition for Powerlines executors",
|
|
10
|
+
required: []
|
|
11
|
+
},
|
|
12
|
+
configFile: {
|
|
13
|
+
$schema: {
|
|
14
|
+
title: "Powerlines Configuration File",
|
|
15
|
+
type: "string",
|
|
16
|
+
format: "path",
|
|
17
|
+
description: "The path to the Powerlines configuration file"
|
|
18
|
+
},
|
|
19
|
+
$default: "{projectRoot}/powerlines.config.ts"
|
|
20
|
+
},
|
|
21
|
+
input: { $schema: {
|
|
22
|
+
title: "Input Entry File(s)",
|
|
23
|
+
format: "path",
|
|
24
|
+
type: "array",
|
|
25
|
+
description: "The entry file(s) that serve as the input for the project",
|
|
26
|
+
items: { type: "string" }
|
|
27
|
+
} },
|
|
28
|
+
tsconfig: {
|
|
29
|
+
$schema: {
|
|
30
|
+
title: "TSConfig Path",
|
|
31
|
+
type: "string",
|
|
32
|
+
format: "path",
|
|
33
|
+
description: "The path to the tsconfig file"
|
|
34
|
+
},
|
|
35
|
+
$default: "{projectRoot}/tsconfig.json"
|
|
36
|
+
},
|
|
37
|
+
outputPath: { $schema: {
|
|
38
|
+
title: "Output Path",
|
|
39
|
+
type: "string",
|
|
40
|
+
format: "path",
|
|
41
|
+
description: "The path to the output directory for the build artifacts"
|
|
42
|
+
} },
|
|
43
|
+
sourceMap: { $schema: {
|
|
44
|
+
title: "Sourcemap",
|
|
45
|
+
type: "boolean",
|
|
46
|
+
description: "Generate a sourcemap"
|
|
47
|
+
} },
|
|
48
|
+
format: {
|
|
49
|
+
$schema: {
|
|
50
|
+
title: "Format",
|
|
51
|
+
type: "array",
|
|
52
|
+
description: "The format to build",
|
|
53
|
+
items: {
|
|
54
|
+
type: "string",
|
|
55
|
+
enum: [
|
|
56
|
+
"cjs",
|
|
57
|
+
"esm",
|
|
58
|
+
"iife"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
$resolve: (val = ["cjs", "esm"]) => [].concat(val)
|
|
63
|
+
},
|
|
64
|
+
platform: {
|
|
65
|
+
$schema: {
|
|
66
|
+
title: "Platform",
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "The platform to build",
|
|
69
|
+
enum: [
|
|
70
|
+
"neutral",
|
|
71
|
+
"node",
|
|
72
|
+
"browser"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
$default: "neutral"
|
|
76
|
+
},
|
|
77
|
+
external: {
|
|
78
|
+
$schema: {
|
|
79
|
+
title: "External",
|
|
80
|
+
type: "array",
|
|
81
|
+
description: "The external dependencies"
|
|
82
|
+
},
|
|
83
|
+
$resolve: (val = []) => [].concat(val)
|
|
84
|
+
},
|
|
85
|
+
noExternal: {
|
|
86
|
+
$schema: {
|
|
87
|
+
title: "No External",
|
|
88
|
+
type: "array",
|
|
89
|
+
description: "The dependencies that should not be treated as external"
|
|
90
|
+
},
|
|
91
|
+
$resolve: (val = []) => [].concat(val)
|
|
92
|
+
},
|
|
93
|
+
skipNodeModulesBundle: { $schema: {
|
|
94
|
+
title: "Skip Node Modules Bundle",
|
|
95
|
+
type: "boolean",
|
|
96
|
+
description: "Skip bundling node_modules during the build process (if required)"
|
|
97
|
+
} },
|
|
98
|
+
mode: { $schema: {
|
|
99
|
+
title: "Mode",
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "The build mode",
|
|
102
|
+
enum: [
|
|
103
|
+
"development",
|
|
104
|
+
"test",
|
|
105
|
+
"production"
|
|
106
|
+
]
|
|
107
|
+
} },
|
|
108
|
+
logLevel: { $schema: {
|
|
109
|
+
title: "Log Level",
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "The log level to use for the build process",
|
|
112
|
+
enum: [
|
|
113
|
+
"fatal",
|
|
114
|
+
"error",
|
|
115
|
+
"warn",
|
|
116
|
+
"success",
|
|
117
|
+
"info",
|
|
118
|
+
"debug",
|
|
119
|
+
"trace",
|
|
120
|
+
"silent"
|
|
121
|
+
]
|
|
122
|
+
} },
|
|
123
|
+
define: {
|
|
124
|
+
$schema: {
|
|
125
|
+
title: "Define",
|
|
126
|
+
type: "object",
|
|
127
|
+
tsType: "Record<string, string>",
|
|
128
|
+
description: "The `define` values"
|
|
129
|
+
},
|
|
130
|
+
$resolve: (val = {}) => val,
|
|
131
|
+
$default: {}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
//#endregion
|
|
136
|
+
module.exports = base_executor_untyped_default;
|