@powerlines/nx 0.13.128 → 0.13.130
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/src/_virtual/_rolldown/runtime.js +0 -22
- package/dist/src/base/base-executor.d.mts +0 -2
- package/dist/src/base/base-executor.d.mts.map +1 -1
- package/dist/src/base/base-executor.js +0 -8
- package/dist/src/base/base-executor.mjs +1 -12
- package/dist/src/base/base-executor.mjs.map +1 -1
- package/dist/src/base/base-executor.schema.d.js +0 -8
- package/dist/src/base/base-executor.schema.d.mts +0 -2
- package/dist/src/base/base-executor.schema.d.mts.map +1 -1
- package/dist/src/base/base-executor.untyped.d.mts +0 -2
- package/dist/src/base/base-executor.untyped.js +1 -18
- package/dist/src/base/base-executor.untyped.mjs +162 -176
- package/dist/src/base/base-executor.untyped.mjs.map +1 -1
- package/dist/src/base/index.d.mts +0 -2
- package/dist/src/base/index.js +0 -8
- package/dist/src/base/index.mjs +3 -17
- package/dist/src/helpers/constants.d.mts +0 -2
- package/dist/src/helpers/constants.d.mts.map +1 -1
- package/dist/src/helpers/constants.js +0 -8
- package/dist/src/helpers/constants.mjs +30 -41
- package/dist/src/helpers/constants.mjs.map +1 -1
- package/dist/src/helpers/index.d.mts +0 -2
- package/dist/src/helpers/index.js +0 -8
- package/dist/src/helpers/index.mjs +3 -17
- package/dist/src/helpers/plugin-utilities.d.mts +0 -2
- package/dist/src/helpers/plugin-utilities.d.mts.map +1 -1
- package/dist/src/helpers/plugin-utilities.js +0 -8
- package/dist/src/helpers/plugin-utilities.mjs +2 -15
- package/dist/src/helpers/plugin-utilities.mjs.map +1 -1
- package/dist/src/index.d.mts +0 -2
- package/dist/src/index.js +0 -8
- package/dist/src/index.mjs +3 -12
- package/dist/src/types/index.d.mts +0 -2
- package/dist/src/types/index.js +0 -8
- package/dist/src/types/index.mjs +1 -16
- package/dist/src/types/plugin.d.mts +0 -2
- package/dist/src/types/plugin.d.mts.map +1 -1
- package/dist/src/types/plugin.js +0 -21
- package/dist/src/types/plugin.mjs +1 -18
- package/package.json +11 -11
- package/dist/src/_virtual/_rolldown/runtime.mjs +0 -28
- package/dist/src/base/base-executor.test.d.mts +0 -2
- package/dist/src/base/base-executor.test.d.ts +0 -1
- package/dist/src/base/base-executor.test.js +0 -25
- package/dist/src/base/base-executor.test.mjs +0 -33
- package/dist/src/base/base-executor.test.mjs.map +0 -1
- package/dist/src/base/base-executor.untyped.test.d.mts +0 -2
- package/dist/src/base/base-executor.untyped.test.d.ts +0 -1
- package/dist/src/base/base-executor.untyped.test.js +0 -23
- package/dist/src/base/base-executor.untyped.test.mjs +0 -31
- package/dist/src/base/base-executor.untyped.test.mjs.map +0 -1
- package/dist/src/base/index.mjs.map +0 -1
- package/dist/src/helpers/constants.test.d.mts +0 -2
- package/dist/src/helpers/constants.test.d.ts +0 -1
- package/dist/src/helpers/constants.test.js +0 -35
- package/dist/src/helpers/constants.test.mjs +0 -43
- package/dist/src/helpers/constants.test.mjs.map +0 -1
- package/dist/src/helpers/index.mjs.map +0 -1
- package/dist/src/helpers/plugin-utilities.test.d.mts +0 -2
- package/dist/src/helpers/plugin-utilities.test.d.ts +0 -1
- package/dist/src/helpers/plugin-utilities.test.js +0 -50
- package/dist/src/helpers/plugin-utilities.test.mjs +0 -59
- package/dist/src/helpers/plugin-utilities.test.mjs.map +0 -1
- package/dist/src/types/index.mjs.map +0 -1
- package/dist/src/types/plugin.mjs.map +0 -1
- package/dist/src/types/plugin.test.d.mts +0 -2
- package/dist/src/types/plugin.test.d.ts +0 -1
- package/dist/src/types/plugin.test.js +0 -23
- package/dist/src/types/plugin.test.mjs +0 -31
- package/dist/src/types/plugin.test.mjs.map +0 -1
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
1
|
//#region \0rolldown/runtime.js
|
|
10
2
|
var __create = Object.create;
|
|
11
3
|
var __defProp = Object.defineProperty;
|
|
@@ -13,19 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
13
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
15
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __exportAll = (all, no_symbols) => {
|
|
17
|
-
let target = {};
|
|
18
|
-
for (var name in all) {
|
|
19
|
-
__defProp(target, name, {
|
|
20
|
-
get: all[name],
|
|
21
|
-
enumerable: true
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
if (!no_symbols) {
|
|
25
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
};
|
|
29
8
|
var __copyProps = (to, from, except, desc) => {
|
|
30
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
31
10
|
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -47,5 +26,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
47
26
|
|
|
48
27
|
//#endregion
|
|
49
28
|
|
|
50
|
-
exports.__exportAll = __exportAll;
|
|
51
29
|
exports.__toESM = __toESM;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import __tsdown_shims_path from 'node:path';
|
|
2
|
-
import __tsdown_shims_url from 'node:url';
|
|
3
1
|
import { BaseExecutorSchema } from "./base-executor.schema.mjs";
|
|
4
2
|
import { ExecutorContext, PromiseExecutor } from "@nx/devkit";
|
|
5
3
|
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-executor.d.mts","names":[],"sources":["../../../src/base/base-executor.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-executor.d.mts","names":[],"sources":["../../../src/base/base-executor.ts"],"mappings":";;;;;;;;KA6CY,yBAAA,yBACc,kBAAA,GAAqB,kBAAA,IAC3C,eAAA;EACF,WAAA;EACA,OAAA;EACA,OAAA,EAAS,eAAA;EACT,YAAA,EAAc,YAAA;EACd,eAAA,EAAiB,oBAAA;AAAA;AAAA,KAGP,qBAAA,IACV,YAAA,EAAc,YAAA,KACX,OAAO;AAAA,UAEK,mBAAA;EARD;;;;;EAcd,UAAA;EAnB6C;;;;;;EA2B7C,cAAA,GAAiB,WAAA,CAAY,gBAAA;EAtBf;;;;AACuB;AAGvC;;;;;;;;AAEY;EAgCV,SAAA,GAAY,gBAAA;AAAA;;;;;;;;;;;;iBAcE,YAAA,yBACU,kBAAA,GAAqB,kBAAA,EAE7C,OAAA,UACA,UAAA,GACE,OAAA,EAAS,yBAAA,CAA0B,eAAA,GACnC,GAAA,EAAK,qBAAA,KAEH,OAAA,CAAQ,kBAAA,uBACR,kBAAA,qBAGJ,OAAA,GAAS,mBAAA,GACR,eAAA,CAAgB,eAAA"}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
10
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
11
3
|
let _storm_software_config_tools_logger = require("@storm-software/config-tools/logger");
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
|
-
import { __esmMin } from "../_virtual/_rolldown/runtime.mjs";
|
|
10
1
|
import { writeError } from "@storm-software/config-tools/logger";
|
|
11
2
|
import { withRunExecutor } from "@storm-software/workspace-tools/base/base-executor";
|
|
12
3
|
import { omit } from "@stryke/helpers/omit";
|
|
@@ -117,9 +108,7 @@ ${error.stack}` : "Unknown error"}`);
|
|
|
117
108
|
} }
|
|
118
109
|
});
|
|
119
110
|
}
|
|
120
|
-
var init_base_executor = __esmMin((() => {}));
|
|
121
111
|
|
|
122
112
|
//#endregion
|
|
123
|
-
|
|
124
|
-
export { init_base_executor, withExecutor };
|
|
113
|
+
export { withExecutor };
|
|
125
114
|
//# sourceMappingURL=base-executor.mjs.map
|
|
@@ -1 +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 type { ExecutorContext, PromiseExecutor } from \"@nx/devkit\";\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 { omit } from \"@stryke/helpers/omit\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { isSetArray } from \"@stryke/type-checks/is-set-array\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type { DeepPartial } from \"@stryke/types/base\";\nimport defu from \"defu\";\nimport { createJiti } from \"jiti\";\nimport type {\n ExecutionApiParams,\n ExecutionOptions,\n FrameworkOptions,\n InlineConfig,\n Mode,\n OutputConfig\n} from \"powerlines\";\nimport { formatExecutionId } from \"powerlines/plugin-utils\";\nimport type { BaseExecutorSchema } from \"./base-executor.schema\";\n\nexport type PowerlinesExecutorContext<\n TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema\n> = ExecutorContext & {\n projectName: string;\n command: string;\n options: TExecutorSchema;\n inlineConfig: InlineConfig;\n workspaceConfig: StormWorkspaceConfig;\n};\n\nexport type PowerlinesExecutorApi = (\n inlineConfig: InlineConfig\n) => Promise<void>;\n\nexport interface WithExecutorOptions {\n /**\n * The import path for the executor API module, which is used to dynamically import the API function that will be called during execution. This value should be a string representing the module path, and it defaults to \"powerlines/api\" if not provided. The specified module should export a default function that matches the expected signature for the executor API, which will be invoked with the execution parameters when the executor is run.\n *\n * @defaultValue \"powerlines/api\"\n */\n importPath?: string;\n\n /**\n * Default options to be merged with the execution options, which can be used to provide default values for certain execution parameters or to override specific options for all executions of the executor. This value should be an object that matches the shape of the `ExecutionOptions` type, and it will be merged with the options provided during execution to create the final set of options that will be passed to the executor API function.\n *\n * @remarks\n * This can be useful for setting default values for options that are commonly used across multiple executions, or for providing a consistent set of options for all executions of the executor without requiring the caller to specify them each time.\n */\n defaultOptions?: DeepPartial<ExecutionOptions>;\n\n /**\n * Details about the framework being used in the current execution, which can be used by plugins and other parts of the system to customize behavior based on the framework.\n *\n * @remarks\n * This should only be used by framework plugins to ensure the correct framework name is applied\n *\n * @defaultValue\n * ```ts\n * {\n * name: \"powerlines\",\n * orgId: \"storm-software\"\n * }\n * ```\n */\n framework?: FrameworkOptions;\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 * @param options - Additional options for configuring the executor, such as the import path for the API module and default execution options.\n * @returns A Promise that resolves to the result of the executor function.\n */\nexport function withExecutor<\n TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema\n>(\n command: string,\n executorFn: (\n context: PowerlinesExecutorContext<TExecutorSchema>,\n api: PowerlinesExecutorApi\n ) =>\n | Promise<BaseExecutorResult | null | undefined>\n | BaseExecutorResult\n | null\n | undefined,\n options: WithExecutorOptions = {}\n): PromiseExecutor<TExecutorSchema> {\n const {\n importPath = \"powerlines/api\",\n defaultOptions = {},\n framework = {} as FrameworkOptions\n } = options;\n\n framework.name ??= \"powerlines\";\n framework.orgId ??= \"storm-software\";\n\n return withRunExecutor(\n `${titleCase(framework.name)} - ${titleCase(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 ${titleCase(framework.name)} - ${titleCase(\n command\n )} 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 ${titleCase(framework.name)} - ${titleCase(\n command\n )} 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, {\n cache: false,\n tsconfigPaths: true\n });\n const api = await jiti\n .import<{\n default: (params: ExecutionApiParams) => Promise<void>;\n }>(jiti.esmResolve(importPath))\n .then(mod => mod.default);\n\n try {\n return await Promise.resolve(\n executorFn(\n defu(\n {\n projectName: context.projectName,\n options,\n workspaceConfig,\n command,\n inlineConfig: defu(\n {\n name: context.projectName,\n command,\n root: projectConfig.root,\n configFile: options.configFile || options.config,\n configIndex: options.configIndex,\n projectType: projectConfig.projectType,\n mode: options.mode as Mode,\n output: {\n path: options.outputPath,\n copy:\n options.copyPath === false\n ? false\n : {\n path: options.copyPath,\n assets: options.assets\n },\n minify: options.minify,\n sourceMap: options.sourceMap\n } as OutputConfig,\n resolve:\n isSetArray(options.external) ||\n isSetArray(options.noExternal) ||\n isSet(options.skipNodeModulesBundle)\n ? {\n external: isSetArray(options.external)\n ? options.external\n : undefined,\n noExternal: isSetArray(options.noExternal)\n ? options.noExternal\n : undefined,\n skipNodeModulesBundle: isSet(\n options.skipNodeModulesBundle\n )\n ? options.skipNodeModulesBundle\n : undefined\n }\n : undefined,\n define: isSetObject(options.define)\n ? options.define\n : undefined,\n assets: isSetObject(options.assets)\n ? options.assets\n : undefined\n },\n omit(options, [\n \"config\",\n \"configFile\",\n \"outputPath\",\n \"copyPath\",\n \"sourceMap\",\n \"minify\",\n \"format\",\n \"external\",\n \"noExternal\",\n \"skipNodeModulesBundle\",\n \"mode\",\n \"define\",\n \"assets\"\n ])\n ) as InlineConfig\n },\n context\n ),\n async (inlineConfig: InlineConfig) =>\n api({\n options: defu(defaultOptions, {\n executionId: formatExecutionId(\n inlineConfig.name ||\n context.projectName ||\n projectConfig.root,\n command,\n options.configIndex ?? 0\n ),\n cwd: context.root,\n root: projectConfig.root,\n configFile:\n options.configFile ||\n options.config ||\n joinPaths(\n projectConfig.root,\n `${kebabCase(framework.name)}.config.ts`\n ),\n configIndex: options.configIndex,\n framework\n }) as ExecutionOptions,\n command,\n inlineConfig\n })\n )\n );\n } catch (error) {\n writeError(\n `An error occurred while executing the ${titleCase(\n framework.name\n )} - ${titleCase(command)} executor: ${\n isError(error)\n ? `${error.message}\n\n${error.stack}`\n : \"Unknown error\"\n }`\n );\n\n return { success: false };\n }\n },\n {\n skipReadingConfig: false,\n hooks: {\n applyDefaultOptions: (options: Partial<TExecutorSchema>) => {\n options.copyPath ??= \"dist/{projectRoot}\";\n\n return options as TExecutorSchema;\n }\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuGA,SAAgB,aAGd,SACA,YAQA,UAA+B,CAAC,GACE;CAClC,MAAM,EACJ,aAAa,kBACb,iBAAiB,CAAC,GAClB,YAAY,CAAC,MACX;CAEJ,UAAU,SAAS;CACnB,UAAU,UAAU;CAEpB,OAAO,gBACL,GAAG,UAAU,UAAU,IAAI,EAAE,KAAK,UAAU,OAAO,EAAE,YACrD,OACE,SACA,SACA,oBACmD;EACnD,IAAI,CAAC,QAAQ,aACX,MAAM,IAAI,MACR,OAAO,UAAU,UAAU,IAAI,EAAE,KAAK,UACpC,OACF,EAAE,0DACJ;EAGF,IACE,CAAC,QAAQ,eACT,CAAC,QAAQ,wBAAwB,YACjC,CAAC,QAAQ,uBAAuB,SAAS,QAAQ,gBACjD,CAAC,QAAQ,uBAAuB,SAAS,QAAQ,cAAc,MAE/D,MAAM,IAAI,MACR,OAAO,UAAU,UAAU,IAAI,EAAE,KAAK,UACpC,OACF,EAAE,qEACJ;EAGF,MAAM,gBACJ,QAAQ,uBAAuB,SAAS,QAAQ;EAElD,MAAM,OAAO,WAAW,QAAQ,MAAM;GACpC,OAAO;GACP,eAAe;EACjB,CAAC;EACD,MA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GACF,CAAC,CACL,CACF;EACF,SAAS,OAAO;GACd,WACE,yCAAyC,UACvC,UAAU,IACZ,EAAE,KAAK,UAAU,OAAO,EAAE,aACxB,QAAQ,KAAK,IACT,GAAG,MAAM,QAAQ;;EAE/B,MAAM,UACQ,iBAER;GAEA,OAAO,EAAE,SAAS,MAAM;EAC1B;CACF,GACA;EACE,mBAAmB;EACnB,OAAO,EACL,sBAAsB,YAAsC;GAC1D,QAAQ,aAAa;GAErB,OAAO;EACT,EACF;CACF,CACF;AACF"}
|
|
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 type { ExecutorContext, PromiseExecutor } from \"@nx/devkit\";\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 { omit } from \"@stryke/helpers/omit\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { isSetArray } from \"@stryke/type-checks/is-set-array\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type { DeepPartial } from \"@stryke/types/base\";\nimport defu from \"defu\";\nimport { createJiti } from \"jiti\";\nimport type {\n ExecutionApiParams,\n ExecutionOptions,\n FrameworkOptions,\n InlineConfig,\n Mode,\n OutputConfig\n} from \"powerlines\";\nimport { formatExecutionId } from \"powerlines/plugin-utils\";\nimport type { BaseExecutorSchema } from \"./base-executor.schema\";\n\nexport type PowerlinesExecutorContext<\n TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema\n> = ExecutorContext & {\n projectName: string;\n command: string;\n options: TExecutorSchema;\n inlineConfig: InlineConfig;\n workspaceConfig: StormWorkspaceConfig;\n};\n\nexport type PowerlinesExecutorApi = (\n inlineConfig: InlineConfig\n) => Promise<void>;\n\nexport interface WithExecutorOptions {\n /**\n * The import path for the executor API module, which is used to dynamically import the API function that will be called during execution. This value should be a string representing the module path, and it defaults to \"powerlines/api\" if not provided. The specified module should export a default function that matches the expected signature for the executor API, which will be invoked with the execution parameters when the executor is run.\n *\n * @defaultValue \"powerlines/api\"\n */\n importPath?: string;\n\n /**\n * Default options to be merged with the execution options, which can be used to provide default values for certain execution parameters or to override specific options for all executions of the executor. This value should be an object that matches the shape of the `ExecutionOptions` type, and it will be merged with the options provided during execution to create the final set of options that will be passed to the executor API function.\n *\n * @remarks\n * This can be useful for setting default values for options that are commonly used across multiple executions, or for providing a consistent set of options for all executions of the executor without requiring the caller to specify them each time.\n */\n defaultOptions?: DeepPartial<ExecutionOptions>;\n\n /**\n * Details about the framework being used in the current execution, which can be used by plugins and other parts of the system to customize behavior based on the framework.\n *\n * @remarks\n * This should only be used by framework plugins to ensure the correct framework name is applied\n *\n * @defaultValue\n * ```ts\n * {\n * name: \"powerlines\",\n * orgId: \"storm-software\"\n * }\n * ```\n */\n framework?: FrameworkOptions;\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 * @param options - Additional options for configuring the executor, such as the import path for the API module and default execution options.\n * @returns A Promise that resolves to the result of the executor function.\n */\nexport function withExecutor<\n TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema\n>(\n command: string,\n executorFn: (\n context: PowerlinesExecutorContext<TExecutorSchema>,\n api: PowerlinesExecutorApi\n ) =>\n | Promise<BaseExecutorResult | null | undefined>\n | BaseExecutorResult\n | null\n | undefined,\n options: WithExecutorOptions = {}\n): PromiseExecutor<TExecutorSchema> {\n const {\n importPath = \"powerlines/api\",\n defaultOptions = {},\n framework = {} as FrameworkOptions\n } = options;\n\n framework.name ??= \"powerlines\";\n framework.orgId ??= \"storm-software\";\n\n return withRunExecutor(\n `${titleCase(framework.name)} - ${titleCase(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 ${titleCase(framework.name)} - ${titleCase(\n command\n )} 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 ${titleCase(framework.name)} - ${titleCase(\n command\n )} 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, {\n cache: false,\n tsconfigPaths: true\n });\n const api = await jiti\n .import<{\n default: (params: ExecutionApiParams) => Promise<void>;\n }>(jiti.esmResolve(importPath))\n .then(mod => mod.default);\n\n try {\n return await Promise.resolve(\n executorFn(\n defu(\n {\n projectName: context.projectName,\n options,\n workspaceConfig,\n command,\n inlineConfig: defu(\n {\n name: context.projectName,\n command,\n root: projectConfig.root,\n configFile: options.configFile || options.config,\n configIndex: options.configIndex,\n projectType: projectConfig.projectType,\n mode: options.mode as Mode,\n output: {\n path: options.outputPath,\n copy:\n options.copyPath === false\n ? false\n : {\n path: options.copyPath,\n assets: options.assets\n },\n minify: options.minify,\n sourceMap: options.sourceMap\n } as OutputConfig,\n resolve:\n isSetArray(options.external) ||\n isSetArray(options.noExternal) ||\n isSet(options.skipNodeModulesBundle)\n ? {\n external: isSetArray(options.external)\n ? options.external\n : undefined,\n noExternal: isSetArray(options.noExternal)\n ? options.noExternal\n : undefined,\n skipNodeModulesBundle: isSet(\n options.skipNodeModulesBundle\n )\n ? options.skipNodeModulesBundle\n : undefined\n }\n : undefined,\n define: isSetObject(options.define)\n ? options.define\n : undefined,\n assets: isSetObject(options.assets)\n ? options.assets\n : undefined\n },\n omit(options, [\n \"config\",\n \"configFile\",\n \"outputPath\",\n \"copyPath\",\n \"sourceMap\",\n \"minify\",\n \"format\",\n \"external\",\n \"noExternal\",\n \"skipNodeModulesBundle\",\n \"mode\",\n \"define\",\n \"assets\"\n ])\n ) as InlineConfig\n },\n context\n ),\n async (inlineConfig: InlineConfig) =>\n api({\n options: defu(defaultOptions, {\n executionId: formatExecutionId(\n inlineConfig.name ||\n context.projectName ||\n projectConfig.root,\n command,\n options.configIndex ?? 0\n ),\n cwd: context.root,\n root: projectConfig.root,\n configFile:\n options.configFile ||\n options.config ||\n joinPaths(\n projectConfig.root,\n `${kebabCase(framework.name)}.config.ts`\n ),\n configIndex: options.configIndex,\n framework\n }) as ExecutionOptions,\n command,\n inlineConfig\n })\n )\n );\n } catch (error) {\n writeError(\n `An error occurred while executing the ${titleCase(\n framework.name\n )} - ${titleCase(command)} executor: ${\n isError(error)\n ? `${error.message}\n\n${error.stack}`\n : \"Unknown error\"\n }`\n );\n\n return { success: false };\n }\n },\n {\n skipReadingConfig: false,\n hooks: {\n applyDefaultOptions: (options: Partial<TExecutorSchema>) => {\n options.copyPath ??= \"dist/{projectRoot}\";\n\n return options as TExecutorSchema;\n }\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuGA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KAC7B,MAAM,QAAQ,qBAAqB,IAC/B;MACE,UAAU,WAAW,QAAQ,QAAQ,IACjC,QAAQ,WACR;MACJ,YAAY,WAAW,QAAQ,UAAU,IACrC,QAAQ,aACR;MACJ,uBAAuB,MACrB,QAAQ,qBACV,IACI,QAAQ,wBACR;KACN,IACA;KACN,QAAQ,YAAY,QAAQ,MAAM,IAC9B,QAAQ,SACR;KACJ,QAAQ,YAAY,QAAQ,MAAM,IAC9B,QAAQ,SACR;IACN,GACA,KAAK,SAAS;KACZ;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;IACF,CAAC,CACH;GACF,GACA,OACF,GACA,OAAO,iBACL,IAAI;IACF,SAAS,KAAK,gBAAgB;KAC5B,aAAa,kBACX,aAAa,QACX,QAAQ,eACR,cAAc,MAChB,SACA,QAAQ,eAAe,CACzB;KACA,KAAK,QAAQ;KACb,MAAM,cAAc;KACpB,YACE,QAAQ,cACR,QAAQ,UACR,UACE,cAAc,MACd,GAAG,UAAU,UAAU,IAAI,EAAE,WAC/B;KACF,aAAa,QAAQ;KACrB;IACF,CAAC;IACD;IACA;GACF,CAAC,CACL,CACF;EACF,SAAS,OAAO;GACd,WACE,yCAAyC,UACvC,UAAU,IACZ,EAAE,KAAK,UAAU,OAAO,EAAE,aACxB,QAAQ,KAAK,IACT,GAAG,MAAM,QAAQ;;EAE/B,MAAM,UACQ,iBAER;GAEA,OAAO,EAAE,SAAS,MAAM;EAC1B;CACF,GACA;EACE,mBAAmB;EACnB,OAAO,EACL,sBAAsB,YAAsC;GAC1D,QAAQ,aAAa;GAErB,OAAO;EACT,EACF;CACF,CACF;AACF"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-executor.schema.d.mts","names":["config","configFile","configIndex","input","Array","tsconfig","outputPath","copyPath","sourceMap","minify","format","platform","external","noExternal","skipNodeModulesBundle","mode","logLevel","define","Record","assets","output","glob","ignore","dot","additionalArgs"],"sources":["../../../src/base/base-executor.schema.d.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-executor.schema.d.mts","names":["config","configFile","configIndex","input","Array","tsconfig","outputPath","copyPath","sourceMap","minify","format","platform","external","noExternal","skipNodeModulesBundle","mode","logLevel","define","Record","assets","output","glob","ignore","dot","additionalArgs"],"sources":["../../../src/base/base-executor.schema.d.ts"],"mappings":";;;UAIiB,kBAAA;;;;;;;;;EAShBA,MAAAA;;;;;;;;;EAUAC,UAAAA;;;;;;;;EASAC,WAAAA;;;;;;;;;EAUAC,KAAAA,GAAQ,KAAA;EAqIe;AAAA;;;;;;;EA3HvBE,QAAAA;;;;;;;;;EAUAC,UAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,SAAAA;;;;;;;EAQAC,MAAAA;;;;;;;;EASAC,MAAAA,GAAS,KAAA;;;;;;;;;EAUTC,QAAAA;;;;;;;EAQAC,QAAAA,GAAW,KAAA;;;;;;;EAQXC,UAAAA,GAAa,KAAA;;;;;;;EAQbC,qBAAAA;;;;;;;;;EAUAC,IAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,MAAAA,GAAS,MAAA;;;;;;;EAQTE,MAAAA,GAAS,KAAA;IAAQhB,KAAAA;IAAgBiB,MAAAA;IAAiBC,IAAAA;IAAcC,MAAAA;IAAmBC,GAAAA;EAAAA;;;;;;;EAQnFC,cAAAA,GAAiB,MAAA;AAAA"}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
10
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
11
1
|
let untyped = require("untyped");
|
|
12
2
|
|
|
13
3
|
//#region src/base/base-executor.untyped.ts
|
|
14
|
-
var base_executor_untyped_exports = /* @__PURE__ */ require_runtime.__exportAll({ default: () => base_executor_untyped_default });
|
|
15
4
|
var base_executor_untyped_default = (0, untyped.defineUntypedSchema)({
|
|
16
5
|
$schema: {
|
|
17
6
|
id: "BaseExecutorSchema",
|
|
@@ -184,10 +173,4 @@ var base_executor_untyped_default = (0, untyped.defineUntypedSchema)({
|
|
|
184
173
|
});
|
|
185
174
|
|
|
186
175
|
//#endregion
|
|
187
|
-
|
|
188
|
-
enumerable: true,
|
|
189
|
-
get: function () {
|
|
190
|
-
return base_executor_untyped_exports;
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
exports.default = base_executor_untyped_default;
|
|
176
|
+
module.exports = base_executor_untyped_default;
|
|
@@ -1,191 +1,177 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
|
-
import { __esmMin, __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
10
1
|
import { defineUntypedSchema } from "untyped";
|
|
11
2
|
|
|
12
3
|
//#region src/base/base-executor.untyped.ts
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
var base_executor_untyped_default = defineUntypedSchema({
|
|
5
|
+
$schema: {
|
|
6
|
+
id: "BaseExecutorSchema",
|
|
7
|
+
title: "Base Executor",
|
|
8
|
+
description: "A shared/base schema type definition for Powerlines executors",
|
|
9
|
+
required: []
|
|
10
|
+
},
|
|
11
|
+
config: { $schema: {
|
|
12
|
+
title: "Powerlines Configuration File",
|
|
13
|
+
type: "string",
|
|
14
|
+
format: "path",
|
|
15
|
+
description: "The path to the Powerlines configuration file. Alias for `configFile`."
|
|
16
|
+
} },
|
|
17
|
+
configFile: { $schema: {
|
|
18
|
+
title: "Powerlines Configuration File",
|
|
19
|
+
type: "string",
|
|
20
|
+
format: "path",
|
|
21
|
+
description: "The path to the Powerlines configuration file. Alias for `config`."
|
|
22
|
+
} },
|
|
23
|
+
configIndex: {
|
|
17
24
|
$schema: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
description: "
|
|
21
|
-
required: []
|
|
25
|
+
title: "Powerlines Configuration Index",
|
|
26
|
+
type: "number",
|
|
27
|
+
description: "The index in the Powerlines configuration file to use (if an array of configurations are provided)."
|
|
22
28
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
$default: 0
|
|
30
|
+
},
|
|
31
|
+
input: { $schema: {
|
|
32
|
+
title: "Input Entry File(s)",
|
|
33
|
+
format: "path",
|
|
34
|
+
type: "array",
|
|
35
|
+
description: "The entry file(s) that serve as the input for the project",
|
|
36
|
+
items: { type: "string" }
|
|
37
|
+
} },
|
|
38
|
+
tsconfig: { $schema: {
|
|
39
|
+
title: "TSConfig Path",
|
|
40
|
+
type: "string",
|
|
41
|
+
format: "path",
|
|
42
|
+
description: "The path to the tsconfig file"
|
|
43
|
+
} },
|
|
44
|
+
outputPath: { $schema: {
|
|
45
|
+
title: "Output Path",
|
|
46
|
+
type: "string",
|
|
47
|
+
format: "path",
|
|
48
|
+
description: "The path to the output directory for the build artifacts"
|
|
49
|
+
} },
|
|
50
|
+
copyPath: { $schema: {
|
|
51
|
+
title: "Copy Path",
|
|
52
|
+
description: "A directory path to copy the build artifacts into",
|
|
53
|
+
oneOf: [{
|
|
31
54
|
type: "string",
|
|
32
|
-
format: "path"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
55
|
+
format: "path"
|
|
56
|
+
}, {
|
|
57
|
+
type: "boolean",
|
|
58
|
+
enum: [false]
|
|
59
|
+
}]
|
|
60
|
+
} },
|
|
61
|
+
sourceMap: { $schema: {
|
|
62
|
+
title: "Sourcemap",
|
|
63
|
+
type: "boolean",
|
|
64
|
+
description: "Generate a sourcemap"
|
|
65
|
+
} },
|
|
66
|
+
minify: { $schema: {
|
|
67
|
+
title: "Minify",
|
|
68
|
+
type: "boolean",
|
|
69
|
+
description: "Minify the output"
|
|
70
|
+
} },
|
|
71
|
+
format: {
|
|
72
|
+
$schema: {
|
|
73
|
+
title: "Format",
|
|
46
74
|
type: "array",
|
|
47
|
-
description: "The
|
|
48
|
-
items: {
|
|
49
|
-
} },
|
|
50
|
-
tsconfig: { $schema: {
|
|
51
|
-
title: "TSConfig Path",
|
|
52
|
-
type: "string",
|
|
53
|
-
format: "path",
|
|
54
|
-
description: "The path to the tsconfig file"
|
|
55
|
-
} },
|
|
56
|
-
outputPath: { $schema: {
|
|
57
|
-
title: "Output Path",
|
|
58
|
-
type: "string",
|
|
59
|
-
format: "path",
|
|
60
|
-
description: "The path to the output directory for the build artifacts"
|
|
61
|
-
} },
|
|
62
|
-
copyPath: { $schema: {
|
|
63
|
-
title: "Copy Path",
|
|
64
|
-
description: "A directory path to copy the build artifacts into",
|
|
65
|
-
oneOf: [{
|
|
75
|
+
description: "The format to build",
|
|
76
|
+
items: {
|
|
66
77
|
type: "string",
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
sourceMap: { $schema: {
|
|
74
|
-
title: "Sourcemap",
|
|
75
|
-
type: "boolean",
|
|
76
|
-
description: "Generate a sourcemap"
|
|
77
|
-
} },
|
|
78
|
-
minify: { $schema: {
|
|
79
|
-
title: "Minify",
|
|
80
|
-
type: "boolean",
|
|
81
|
-
description: "Minify the output"
|
|
82
|
-
} },
|
|
83
|
-
format: {
|
|
84
|
-
$schema: {
|
|
85
|
-
title: "Format",
|
|
86
|
-
type: "array",
|
|
87
|
-
description: "The format to build",
|
|
88
|
-
items: {
|
|
89
|
-
type: "string",
|
|
90
|
-
enum: [
|
|
91
|
-
"cjs",
|
|
92
|
-
"esm",
|
|
93
|
-
"iife"
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
$resolve: (val = ["cjs", "esm"]) => val.filter((format) => [
|
|
98
|
-
"cjs",
|
|
99
|
-
"esm",
|
|
100
|
-
"iife"
|
|
101
|
-
].includes(format))
|
|
78
|
+
enum: [
|
|
79
|
+
"cjs",
|
|
80
|
+
"esm",
|
|
81
|
+
"iife"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
102
84
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
85
|
+
$resolve: (val = ["cjs", "esm"]) => val.filter((format) => [
|
|
86
|
+
"cjs",
|
|
87
|
+
"esm",
|
|
88
|
+
"iife"
|
|
89
|
+
].includes(format))
|
|
90
|
+
},
|
|
91
|
+
platform: { $schema: {
|
|
92
|
+
title: "Platform",
|
|
93
|
+
type: "string",
|
|
94
|
+
description: "The platform to build",
|
|
95
|
+
enum: [
|
|
96
|
+
"neutral",
|
|
97
|
+
"node",
|
|
98
|
+
"browser"
|
|
99
|
+
]
|
|
100
|
+
} },
|
|
101
|
+
external: {
|
|
102
|
+
$schema: {
|
|
103
|
+
title: "External",
|
|
104
|
+
type: "array",
|
|
105
|
+
description: "The external dependencies"
|
|
120
106
|
},
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
107
|
+
$resolve: (val = []) => [].concat(val)
|
|
108
|
+
},
|
|
109
|
+
noExternal: {
|
|
110
|
+
$schema: {
|
|
111
|
+
title: "No External",
|
|
112
|
+
type: "array",
|
|
113
|
+
description: "The dependencies that should not be treated as external"
|
|
128
114
|
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
115
|
+
$resolve: (val = []) => [].concat(val)
|
|
116
|
+
},
|
|
117
|
+
skipNodeModulesBundle: { $schema: {
|
|
118
|
+
title: "Skip Node Modules Bundle",
|
|
119
|
+
type: "boolean",
|
|
120
|
+
description: "Skip bundling node_modules during the build process (if required)"
|
|
121
|
+
} },
|
|
122
|
+
mode: { $schema: {
|
|
123
|
+
title: "Mode",
|
|
124
|
+
type: "string",
|
|
125
|
+
description: "The build mode",
|
|
126
|
+
enum: [
|
|
127
|
+
"development",
|
|
128
|
+
"test",
|
|
129
|
+
"production"
|
|
130
|
+
]
|
|
131
|
+
} },
|
|
132
|
+
logLevel: { $schema: {
|
|
133
|
+
title: "Log Level",
|
|
134
|
+
type: "string",
|
|
135
|
+
description: "The log level to use for the build process",
|
|
136
|
+
enum: [
|
|
137
|
+
"fatal",
|
|
138
|
+
"error",
|
|
139
|
+
"warn",
|
|
140
|
+
"success",
|
|
141
|
+
"info",
|
|
142
|
+
"debug",
|
|
143
|
+
"trace",
|
|
144
|
+
"silent"
|
|
145
|
+
]
|
|
146
|
+
} },
|
|
147
|
+
define: {
|
|
148
|
+
$schema: {
|
|
149
|
+
title: "Define",
|
|
150
|
+
type: "object",
|
|
151
|
+
tsType: "Record<string, string>",
|
|
152
|
+
description: "The `define` values"
|
|
153
|
+
},
|
|
154
|
+
$resolve: (val = {}) => val,
|
|
155
|
+
$default: {}
|
|
156
|
+
},
|
|
157
|
+
assets: { $schema: {
|
|
158
|
+
title: "Assets",
|
|
159
|
+
type: "any",
|
|
160
|
+
tsType: "Array<{ input?: string; output?: string; glob: string; ignore?: string[]; dot?: boolean; }>",
|
|
161
|
+
description: "The `assets` values"
|
|
162
|
+
} },
|
|
163
|
+
additionalArgs: {
|
|
164
|
+
$schema: {
|
|
165
|
+
title: "Additional Arguments",
|
|
166
|
+
type: "object",
|
|
167
|
+
tsType: "Record<string, string>",
|
|
168
|
+
description: "The additional arguments provided during execution of the command"
|
|
168
169
|
},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
description: "The `assets` values"
|
|
174
|
-
} },
|
|
175
|
-
additionalArgs: {
|
|
176
|
-
$schema: {
|
|
177
|
-
title: "Additional Arguments",
|
|
178
|
-
type: "object",
|
|
179
|
-
tsType: "Record<string, string>",
|
|
180
|
-
description: "The additional arguments provided during execution of the command"
|
|
181
|
-
},
|
|
182
|
-
$resolve: (val = {}) => val,
|
|
183
|
-
$default: {}
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
}));
|
|
170
|
+
$resolve: (val = {}) => val,
|
|
171
|
+
$default: {}
|
|
172
|
+
}
|
|
173
|
+
});
|
|
187
174
|
|
|
188
175
|
//#endregion
|
|
189
|
-
|
|
190
|
-
export { base_executor_untyped_exports, base_executor_untyped_default as default, init_base_executor_untyped };
|
|
176
|
+
export { base_executor_untyped_default as default };
|
|
191
177
|
//# sourceMappingURL=base-executor.untyped.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-executor.untyped.mjs","names":[],"sources":["../../../src/base/base-executor.untyped.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 { defineUntypedSchema } from \"untyped\";\n\nexport default defineUntypedSchema({\n $schema: {\n id: \"BaseExecutorSchema\",\n title: \"Base Executor\",\n description:\n \"A shared/base schema type definition for Powerlines executors\",\n required: []\n },\n config: {\n $schema: {\n title: \"Powerlines Configuration File\",\n type: \"string\",\n format: \"path\",\n description:\n \"The path to the Powerlines configuration file. Alias for `configFile`.\"\n }\n },\n configFile: {\n $schema: {\n title: \"Powerlines Configuration File\",\n type: \"string\",\n format: \"path\",\n description:\n \"The path to the Powerlines configuration file. Alias for `config`.\"\n }\n },\n configIndex: {\n $schema: {\n title: \"Powerlines Configuration Index\",\n type: \"number\",\n description:\n \"The index in the Powerlines configuration file to use (if an array of configurations are provided).\"\n },\n $default: 0\n },\n input: {\n $schema: {\n title: \"Input Entry File(s)\",\n format: \"path\",\n type: \"array\",\n description: \"The entry file(s) that serve as the input for the project\",\n items: { type: \"string\" }\n }\n },\n tsconfig: {\n $schema: {\n title: \"TSConfig Path\",\n type: \"string\",\n format: \"path\",\n description: \"The path to the tsconfig file\"\n }\n },\n outputPath: {\n $schema: {\n title: \"Output Path\",\n type: \"string\",\n format: \"path\",\n description: \"The path to the output directory for the build artifacts\"\n }\n },\n copyPath: {\n $schema: {\n title: \"Copy Path\",\n description: \"A directory path to copy the build artifacts into\",\n oneOf: [\n { type: \"string\", format: \"path\" },\n { type: \"boolean\", enum: [false] }\n ]\n }\n },\n sourceMap: {\n $schema: {\n title: \"Sourcemap\",\n type: \"boolean\",\n description: \"Generate a sourcemap\"\n }\n },\n minify: {\n $schema: {\n title: \"Minify\",\n type: \"boolean\",\n description: \"Minify the output\"\n }\n },\n format: {\n $schema: {\n title: \"Format\",\n type: \"array\",\n description: \"The format to build\",\n items: {\n type: \"string\",\n enum: [\"cjs\", \"esm\", \"iife\"]\n }\n },\n $resolve: (val: string[] = [\"cjs\", \"esm\"]) =>\n val.filter(format => [\"cjs\", \"esm\", \"iife\"].includes(format))\n },\n platform: {\n $schema: {\n title: \"Platform\",\n type: \"string\",\n description: \"The platform to build\",\n enum: [\"neutral\", \"node\", \"browser\"]\n }\n },\n external: {\n $schema: {\n title: \"External\",\n type: \"array\",\n description: \"The external dependencies\"\n },\n $resolve: (val: string[] = []) => ([] as string[]).concat(val)\n },\n noExternal: {\n $schema: {\n title: \"No External\",\n type: \"array\",\n description: \"The dependencies that should not be treated as external\"\n },\n $resolve: (val: string[] = []) => ([] as string[]).concat(val)\n },\n skipNodeModulesBundle: {\n $schema: {\n title: \"Skip Node Modules Bundle\",\n type: \"boolean\",\n description:\n \"Skip bundling node_modules during the build process (if required)\"\n }\n },\n mode: {\n $schema: {\n title: \"Mode\",\n type: \"string\",\n description: \"The build mode\",\n enum: [\"development\", \"test\", \"production\"]\n }\n },\n logLevel: {\n $schema: {\n title: \"Log Level\",\n type: \"string\",\n description: \"The log level to use for the build process\",\n enum: [\n \"fatal\",\n \"error\",\n \"warn\",\n \"success\",\n \"info\",\n \"debug\",\n \"trace\",\n \"silent\"\n ]\n }\n },\n define: {\n $schema: {\n title: \"Define\",\n type: \"object\",\n tsType: \"Record<string, string>\",\n description: \"The `define` values\"\n },\n $resolve: (val: Record<string, string> = {}) => val,\n $default: {}\n },\n assets: {\n $schema: {\n title: \"Assets\",\n type: \"any\",\n tsType:\n \"Array<{ input?: string; output?: string; glob: string; ignore?: string[]; dot?: boolean; }>\",\n description: \"The `assets` values\"\n }\n },\n additionalArgs: {\n $schema: {\n title: \"Additional Arguments\",\n type: \"object\",\n tsType: \"Record<string, string>\",\n description:\n \"The additional arguments provided during execution of the command\"\n },\n $resolve: (val: Record<string, string> = {}) => val,\n $default: {}\n }\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-executor.untyped.mjs","names":[],"sources":["../../../src/base/base-executor.untyped.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 { defineUntypedSchema } from \"untyped\";\n\nexport default defineUntypedSchema({\n $schema: {\n id: \"BaseExecutorSchema\",\n title: \"Base Executor\",\n description:\n \"A shared/base schema type definition for Powerlines executors\",\n required: []\n },\n config: {\n $schema: {\n title: \"Powerlines Configuration File\",\n type: \"string\",\n format: \"path\",\n description:\n \"The path to the Powerlines configuration file. Alias for `configFile`.\"\n }\n },\n configFile: {\n $schema: {\n title: \"Powerlines Configuration File\",\n type: \"string\",\n format: \"path\",\n description:\n \"The path to the Powerlines configuration file. Alias for `config`.\"\n }\n },\n configIndex: {\n $schema: {\n title: \"Powerlines Configuration Index\",\n type: \"number\",\n description:\n \"The index in the Powerlines configuration file to use (if an array of configurations are provided).\"\n },\n $default: 0\n },\n input: {\n $schema: {\n title: \"Input Entry File(s)\",\n format: \"path\",\n type: \"array\",\n description: \"The entry file(s) that serve as the input for the project\",\n items: { type: \"string\" }\n }\n },\n tsconfig: {\n $schema: {\n title: \"TSConfig Path\",\n type: \"string\",\n format: \"path\",\n description: \"The path to the tsconfig file\"\n }\n },\n outputPath: {\n $schema: {\n title: \"Output Path\",\n type: \"string\",\n format: \"path\",\n description: \"The path to the output directory for the build artifacts\"\n }\n },\n copyPath: {\n $schema: {\n title: \"Copy Path\",\n description: \"A directory path to copy the build artifacts into\",\n oneOf: [\n { type: \"string\", format: \"path\" },\n { type: \"boolean\", enum: [false] }\n ]\n }\n },\n sourceMap: {\n $schema: {\n title: \"Sourcemap\",\n type: \"boolean\",\n description: \"Generate a sourcemap\"\n }\n },\n minify: {\n $schema: {\n title: \"Minify\",\n type: \"boolean\",\n description: \"Minify the output\"\n }\n },\n format: {\n $schema: {\n title: \"Format\",\n type: \"array\",\n description: \"The format to build\",\n items: {\n type: \"string\",\n enum: [\"cjs\", \"esm\", \"iife\"]\n }\n },\n $resolve: (val: string[] = [\"cjs\", \"esm\"]) =>\n val.filter(format => [\"cjs\", \"esm\", \"iife\"].includes(format))\n },\n platform: {\n $schema: {\n title: \"Platform\",\n type: \"string\",\n description: \"The platform to build\",\n enum: [\"neutral\", \"node\", \"browser\"]\n }\n },\n external: {\n $schema: {\n title: \"External\",\n type: \"array\",\n description: \"The external dependencies\"\n },\n $resolve: (val: string[] = []) => ([] as string[]).concat(val)\n },\n noExternal: {\n $schema: {\n title: \"No External\",\n type: \"array\",\n description: \"The dependencies that should not be treated as external\"\n },\n $resolve: (val: string[] = []) => ([] as string[]).concat(val)\n },\n skipNodeModulesBundle: {\n $schema: {\n title: \"Skip Node Modules Bundle\",\n type: \"boolean\",\n description:\n \"Skip bundling node_modules during the build process (if required)\"\n }\n },\n mode: {\n $schema: {\n title: \"Mode\",\n type: \"string\",\n description: \"The build mode\",\n enum: [\"development\", \"test\", \"production\"]\n }\n },\n logLevel: {\n $schema: {\n title: \"Log Level\",\n type: \"string\",\n description: \"The log level to use for the build process\",\n enum: [\n \"fatal\",\n \"error\",\n \"warn\",\n \"success\",\n \"info\",\n \"debug\",\n \"trace\",\n \"silent\"\n ]\n }\n },\n define: {\n $schema: {\n title: \"Define\",\n type: \"object\",\n tsType: \"Record<string, string>\",\n description: \"The `define` values\"\n },\n $resolve: (val: Record<string, string> = {}) => val,\n $default: {}\n },\n assets: {\n $schema: {\n title: \"Assets\",\n type: \"any\",\n tsType:\n \"Array<{ input?: string; output?: string; glob: string; ignore?: string[]; dot?: boolean; }>\",\n description: \"The `assets` values\"\n }\n },\n additionalArgs: {\n $schema: {\n title: \"Additional Arguments\",\n type: \"object\",\n tsType: \"Record<string, string>\",\n description:\n \"The additional arguments provided during execution of the command\"\n },\n $resolve: (val: Record<string, string> = {}) => val,\n $default: {}\n }\n});\n"],"mappings":";;;AAoBA,oCAAe,oBAAoB;CACjC,SAAS;EACP,IAAI;EACJ,OAAO;EACP,aACE;EACF,UAAU,CAAC;CACb;CACA,QAAQ,EACN,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aACE;CACJ,EACF;CACA,YAAY,EACV,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aACE;CACJ,EACF;CACA,aAAa;EACX,SAAS;GACP,OAAO;GACP,MAAM;GACN,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,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,MAAM;GAAC;GAAe;GAAQ;EAAY;CAC5C,EACF;CACA,UAAU,EACR,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF,EACF;CACA,QAAQ;EACN,SAAS;GACP,OAAO;GACP,MAAM;GACN,QAAQ;GACR,aAAa;EACf;EACA,WAAW,MAA8B,CAAC,MAAM;EAChD,UAAU,CAAC;CACb;CACA,QAAQ,EACN,SAAS;EACP,OAAO;EACP,MAAM;EACN,QACE;EACF,aAAa;CACf,EACF;CACA,gBAAgB;EACd,SAAS;GACP,OAAO;GACP,MAAM;GACN,QAAQ;GACR,aACE;EACJ;EACA,WAAW,MAA8B,CAAC,MAAM;EAChD,UAAU,CAAC;CACb;AACF,CAAC"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import __tsdown_shims_path from 'node:path';
|
|
2
|
-
import __tsdown_shims_url from 'node:url';
|
|
3
1
|
import { PowerlinesExecutorApi, PowerlinesExecutorContext, WithExecutorOptions, withExecutor } from "./base-executor.mjs";
|
|
4
2
|
export { PowerlinesExecutorApi, PowerlinesExecutorContext, WithExecutorOptions, withExecutor };
|