@powerlines/engine 0.0.25 → 0.9.1
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/api/build.cjs +66 -0
- package/dist/api/build.d.cts +14 -0
- package/dist/api/build.d.cts.map +1 -0
- package/dist/api/build.d.mts +14 -0
- package/dist/api/build.d.mts.map +1 -0
- package/dist/api/build.mjs +64 -0
- package/dist/api/build.mjs.map +1 -0
- package/dist/api/clean.cjs +29 -0
- package/dist/api/clean.d.cts +14 -0
- package/dist/api/clean.d.cts.map +1 -0
- package/dist/api/clean.d.mts +14 -0
- package/dist/api/clean.d.mts.map +1 -0
- package/dist/api/clean.mjs +28 -0
- package/dist/api/clean.mjs.map +1 -0
- package/dist/api/create.cjs +59 -0
- package/dist/api/create.d.cts +14 -0
- package/dist/api/create.d.cts.map +1 -0
- package/dist/api/create.d.mts +14 -0
- package/dist/api/create.d.mts.map +1 -0
- package/dist/api/create.mjs +57 -0
- package/dist/api/create.mjs.map +1 -0
- package/dist/api/deploy.cjs +25 -0
- package/dist/api/deploy.d.cts +17 -0
- package/dist/api/deploy.d.cts.map +1 -0
- package/dist/api/deploy.d.mts +17 -0
- package/dist/api/deploy.d.mts.map +1 -0
- package/dist/api/deploy.mjs +24 -0
- package/dist/api/deploy.mjs.map +1 -0
- package/dist/api/docs.cjs +25 -0
- package/dist/api/docs.d.cts +17 -0
- package/dist/api/docs.d.cts.map +1 -0
- package/dist/api/docs.d.mts +17 -0
- package/dist/api/docs.d.mts.map +1 -0
- package/dist/api/docs.mjs +24 -0
- package/dist/api/docs.mjs.map +1 -0
- package/dist/api/lint.cjs +28 -0
- package/dist/api/lint.d.cts +17 -0
- package/dist/api/lint.d.cts.map +1 -0
- package/dist/api/lint.d.mts +17 -0
- package/dist/api/lint.d.mts.map +1 -0
- package/dist/api/lint.mjs +27 -0
- package/dist/api/lint.mjs.map +1 -0
- package/dist/api/prepare.cjs +69 -0
- package/dist/api/prepare.d.cts +14 -0
- package/dist/api/prepare.d.cts.map +1 -0
- package/dist/api/prepare.d.mts +14 -0
- package/dist/api/prepare.d.mts.map +1 -0
- package/dist/api/prepare.mjs +68 -0
- package/dist/api/prepare.mjs.map +1 -0
- package/dist/api/test.cjs +28 -0
- package/dist/api/test.d.cts +17 -0
- package/dist/api/test.d.cts.map +1 -0
- package/dist/api/test.d.mts +17 -0
- package/dist/api/test.d.mts.map +1 -0
- package/dist/api/test.mjs +27 -0
- package/dist/api/test.mjs.map +1 -0
- package/dist/api/types.cjs +71 -0
- package/dist/api/types.d.cts +17 -0
- package/dist/api/types.d.cts.map +1 -0
- package/dist/api/types.d.mts +17 -0
- package/dist/api/types.d.mts.map +1 -0
- package/dist/api/types.mjs +70 -0
- package/dist/api/types.mjs.map +1 -0
- package/dist/api-Bw-RpQgX.d.cts +134 -0
- package/dist/api-Bw-RpQgX.d.cts.map +1 -0
- package/dist/api-D9bpSxPB.d.mts +134 -0
- package/dist/api-D9bpSxPB.d.mts.map +1 -0
- package/dist/config-B_E_HMcT.d.cts +200 -0
- package/dist/config-B_E_HMcT.d.cts.map +1 -0
- package/dist/config-FB8Zqjjz.d.mts +200 -0
- package/dist/config-FB8Zqjjz.d.mts.map +1 -0
- package/dist/context/index.cjs +2 -9
- package/dist/context/index.d.cts +2 -660
- package/dist/context/index.d.mts +2 -660
- package/dist/context/index.mjs +2 -4
- package/dist/context-C_P-KYJX.d.cts +149 -0
- package/dist/context-C_P-KYJX.d.cts.map +1 -0
- package/dist/context-DrNGEC0b.d.mts +149 -0
- package/dist/context-DrNGEC0b.d.mts.map +1 -0
- package/dist/engine-context-BXjBJuHe.d.mts +54 -0
- package/dist/engine-context-BXjBJuHe.d.mts.map +1 -0
- package/dist/engine-context-CPYw-aGB.d.cts +54 -0
- package/dist/engine-context-CPYw-aGB.d.cts.map +1 -0
- package/dist/engine-context-SEzTm1aq.cjs +179 -0
- package/dist/engine-context-f72fUF0N.mjs +173 -0
- package/dist/engine-context-f72fUF0N.mjs.map +1 -0
- package/dist/engine.cjs +267 -0
- package/dist/engine.d.cts +143 -0
- package/dist/engine.d.cts.map +1 -0
- package/dist/engine.d.mts +143 -0
- package/dist/engine.d.mts.map +1 -0
- package/dist/engine.mjs +263 -0
- package/dist/engine.mjs.map +1 -0
- package/dist/helpers/create-execution-host.cjs +23 -0
- package/dist/helpers/create-execution-host.d.cts +18 -0
- package/dist/helpers/create-execution-host.d.cts.map +1 -0
- package/dist/helpers/create-execution-host.d.mts +18 -0
- package/dist/helpers/create-execution-host.d.mts.map +1 -0
- package/dist/helpers/create-execution-host.mjs +22 -0
- package/dist/helpers/create-execution-host.mjs.map +1 -0
- package/dist/helpers/execution-host-worker.cjs +307 -0
- package/dist/helpers/execution-host-worker.d.cts +64 -0
- package/dist/helpers/execution-host-worker.d.cts.map +1 -0
- package/dist/helpers/execution-host-worker.d.mts +64 -0
- package/dist/helpers/execution-host-worker.d.mts.map +1 -0
- package/dist/helpers/execution-host-worker.mjs +306 -0
- package/dist/helpers/execution-host-worker.mjs.map +1 -0
- package/dist/helpers/finalize.cjs +27 -0
- package/dist/helpers/finalize.d.cts +12 -0
- package/dist/helpers/finalize.d.cts.map +1 -0
- package/dist/helpers/finalize.d.mts +12 -0
- package/dist/helpers/finalize.d.mts.map +1 -0
- package/dist/helpers/finalize.mjs +26 -0
- package/dist/helpers/finalize.mjs.map +1 -0
- package/dist/helpers/rpc.cjs +140 -0
- package/dist/helpers/rpc.d.cts +7 -0
- package/dist/helpers/rpc.d.cts.map +1 -0
- package/dist/helpers/rpc.d.mts +7 -0
- package/dist/helpers/rpc.d.mts.map +1 -0
- package/dist/helpers/rpc.mjs +139 -0
- package/dist/helpers/rpc.mjs.map +1 -0
- package/dist/index.cjs +4 -567
- package/dist/index.d.cts +5 -126
- package/dist/index.d.mts +5 -126
- package/dist/index.mjs +2 -567
- package/dist/worker/execution-host.cjs +419 -0
- package/dist/worker/execution-host.d.cts +26 -0
- package/dist/worker/execution-host.d.cts.map +1 -0
- package/dist/worker/execution-host.d.mts +26 -0
- package/dist/worker/execution-host.d.mts.map +1 -0
- package/dist/worker/execution-host.mjs +382 -0
- package/dist/worker/execution-host.mjs.map +1 -0
- package/package.json +88 -124
- package/dist/_internal/worker.cjs +0 -4844
- package/dist/_internal/worker.d.cts +0 -38
- package/dist/_internal/worker.d.cts.map +0 -1
- package/dist/_internal/worker.d.mts +0 -38
- package/dist/_internal/worker.d.mts.map +0 -1
- package/dist/_internal/worker.mjs +0 -4805
- package/dist/_internal/worker.mjs.map +0 -1
- package/dist/api.cjs +0 -1274
- package/dist/api.d.cts +0 -265
- package/dist/api.d.cts.map +0 -1
- package/dist/api.d.mts +0 -265
- package/dist/api.d.mts.map +0 -1
- package/dist/api.mjs +0 -1270
- package/dist/api.mjs.map +0 -1
- package/dist/base-context-BUnL_9z8.mjs +0 -241
- package/dist/base-context-BUnL_9z8.mjs.map +0 -1
- package/dist/base-context-CFvO2N9I.cjs +0 -248
- package/dist/context/index.d.cts.map +0 -1
- package/dist/context/index.d.mts.map +0 -1
- package/dist/engine-context-BuD9AGfd.mjs +0 -41
- package/dist/engine-context-BuD9AGfd.mjs.map +0 -1
- package/dist/engine-context-NO6enYev.cjs +0 -45
- package/dist/execution-context-Cq9cjr28.mjs +0 -2571
- package/dist/execution-context-Cq9cjr28.mjs.map +0 -1
- package/dist/execution-context-CyDSAifN.cjs +0 -2615
- package/dist/fs-D1nIP45P.mjs +0 -226
- package/dist/fs-D1nIP45P.mjs.map +0 -1
- package/dist/fs-XogSgMqT.cjs +0 -262
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/schemas.cjs +0 -9
- package/dist/schemas.d.cts +0 -127
- package/dist/schemas.d.cts.map +0 -1
- package/dist/schemas.d.mts +0 -127
- package/dist/schemas.d.mts.map +0 -1
- package/dist/schemas.mjs +0 -3
- package/dist/storage/index.cjs +0 -9
- package/dist/storage/index.d.cts +0 -419
- package/dist/storage/index.d.cts.map +0 -1
- package/dist/storage/index.d.mts +0 -419
- package/dist/storage/index.d.mts.map +0 -1
- package/dist/storage/index.mjs +0 -3
- package/dist/ts-morph-BaLPVAdB.cjs +0 -114
- package/dist/ts-morph-D0CaA37w.mjs +0 -102
- package/dist/ts-morph-D0CaA37w.mjs.map +0 -1
- package/dist/tsconfig-Cstsoprg.mjs +0 -155
- package/dist/tsconfig-Cstsoprg.mjs.map +0 -1
- package/dist/tsconfig-DeyWQC2N.cjs +0 -198
- package/dist/typescript/index.cjs +0 -13
- package/dist/typescript/index.d.cts +0 -106
- package/dist/typescript/index.d.cts.map +0 -1
- package/dist/typescript/index.d.mts +0 -106
- package/dist/typescript/index.d.mts.map +0 -1
- package/dist/typescript/index.mjs +0 -4
- package/dist/virtual-BNdKVkRw.cjs +0 -548
- package/dist/virtual-gIlTc3Lj.mjs +0 -513
- package/dist/virtual-gIlTc3Lj.mjs.map +0 -1
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { formatFolder } from "@powerlines/core";
|
|
2
|
+
import { executeEnvironments } from "@powerlines/core/lib/environment";
|
|
3
|
+
import { copyFiles } from "@stryke/fs/copy-file";
|
|
4
|
+
import { appendPath } from "@stryke/path/append";
|
|
5
|
+
import { relativePath } from "@stryke/path/file-path-fns";
|
|
6
|
+
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
7
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
8
|
+
import { replacePath } from "@stryke/path/replace";
|
|
9
|
+
import chalk from "chalk";
|
|
10
|
+
import { existsSync } from "node:fs";
|
|
11
|
+
import { handleTypes } from "@powerlines/core/lib/generate-types";
|
|
12
|
+
import { installDependencies } from "@powerlines/core/lib/install-dependencies";
|
|
13
|
+
import { writeMetaFile } from "@powerlines/core/lib/meta";
|
|
14
|
+
import { initializeTsconfig, resolveTsconfig } from "@powerlines/core/lib/typescript/tsconfig";
|
|
15
|
+
import { format, formatFolder as formatFolder$1 } from "@powerlines/core/lib/utilities/format";
|
|
16
|
+
import { formatConfig } from "@powerlines/core/plugin-utils";
|
|
17
|
+
import { toArray } from "@stryke/convert/to-array";
|
|
18
|
+
import { createDirectory } from "@stryke/fs/helpers";
|
|
19
|
+
import { isObject } from "@stryke/type-checks/is-object";
|
|
20
|
+
import { joinPaths as joinPaths$1 } from "@stryke/path/join";
|
|
21
|
+
import { listFiles } from "@stryke/fs/list-files";
|
|
22
|
+
import Handlebars from "handlebars";
|
|
23
|
+
import { formatLogMessage } from "@storm-software/config-tools/logger";
|
|
24
|
+
import { omit } from "@stryke/helpers/omit";
|
|
25
|
+
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
26
|
+
import { PowerlinesExecutionContext } from "@powerlines/core/context/execution-context";
|
|
27
|
+
import { resolvePluginConfig } from "@powerlines/core/lib/context-helpers";
|
|
28
|
+
|
|
29
|
+
//#region src/api/prepare.ts
|
|
30
|
+
/**
|
|
31
|
+
* Prepare the project
|
|
32
|
+
*
|
|
33
|
+
* @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.
|
|
34
|
+
*/
|
|
35
|
+
async function prepare$1(context, skipTypes = false) {
|
|
36
|
+
const timer = context.timer("Preparation");
|
|
37
|
+
await executeEnvironments(context, async (env) => {
|
|
38
|
+
env.debug(`Initializing the processing options for the Powerlines project.`);
|
|
39
|
+
await context.callHook("configResolved", {
|
|
40
|
+
environment: env,
|
|
41
|
+
order: "pre"
|
|
42
|
+
});
|
|
43
|
+
await initializeTsconfig(env);
|
|
44
|
+
await context.callHook("configResolved", {
|
|
45
|
+
environment: env,
|
|
46
|
+
order: "normal"
|
|
47
|
+
});
|
|
48
|
+
if (env.entry.length > 0) env.debug(`The configuration provided ${isObject(env.config.input) ? Object.keys(env.config.input).length : toArray(env.config.input).length} entry point(s), Powerlines has found ${env.entry.length} entry files(s) for the ${env.config.title} project${env.entry.length > 0 && env.entry.length < 10 ? `: \n${env.entry.map((entry) => `- ${entry.file}${entry.output ? ` -> ${entry.output}` : ""}`).join(" \n")}` : ""}`);
|
|
49
|
+
else env.warn(`No entry files were found for the ${env.config.title} project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`);
|
|
50
|
+
await resolveTsconfig(env);
|
|
51
|
+
await installDependencies(env);
|
|
52
|
+
await context.callHook("configResolved", {
|
|
53
|
+
environment: env,
|
|
54
|
+
order: "post"
|
|
55
|
+
});
|
|
56
|
+
env.trace({
|
|
57
|
+
meta: { category: "config" },
|
|
58
|
+
message: `Powerlines configuration after configResolved hook: \n${formatConfig(env.config)}`
|
|
59
|
+
});
|
|
60
|
+
if (!env.fs.existsSync(env.cachePath)) await createDirectory(env.cachePath);
|
|
61
|
+
if (!env.fs.existsSync(env.dataPath)) await createDirectory(env.dataPath);
|
|
62
|
+
await context.callHook("prepare", {
|
|
63
|
+
environment: env,
|
|
64
|
+
order: "pre"
|
|
65
|
+
});
|
|
66
|
+
await context.callHook("prepare", {
|
|
67
|
+
environment: env,
|
|
68
|
+
order: "normal"
|
|
69
|
+
});
|
|
70
|
+
await context.callHook("prepare", {
|
|
71
|
+
environment: env,
|
|
72
|
+
order: "post"
|
|
73
|
+
});
|
|
74
|
+
if (!skipTypes && env.config.output.types !== false) await handleTypes(context, env);
|
|
75
|
+
context.debug("Formatting files generated during the prepare step.");
|
|
76
|
+
await Promise.all([formatFolder$1(env, env.builtinsPath), formatFolder$1(env, env.entryPath)]);
|
|
77
|
+
await writeMetaFile(env);
|
|
78
|
+
env.persistedMeta = env.meta;
|
|
79
|
+
});
|
|
80
|
+
timer();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/api/build.ts
|
|
85
|
+
async function handleBuild(context, env) {
|
|
86
|
+
await context.callHook("build", {
|
|
87
|
+
environment: env,
|
|
88
|
+
order: "pre"
|
|
89
|
+
});
|
|
90
|
+
env.debug("Formatting the generated entry files before the build process starts.");
|
|
91
|
+
await formatFolder(env, env.entryPath);
|
|
92
|
+
await context.callHook("build", {
|
|
93
|
+
environment: env,
|
|
94
|
+
order: "normal"
|
|
95
|
+
});
|
|
96
|
+
if (env.config.output.copy) {
|
|
97
|
+
env.debug("Copying project's files from build output directory.");
|
|
98
|
+
const destinationPath = isParentPath(appendPath(env.config.output.path, env.config.cwd), appendPath(env.config.root, env.config.cwd)) ? joinPaths(env.config.output.copy.path, relativePath(appendPath(env.config.root, env.config.cwd), appendPath(env.config.output.path, env.config.cwd))) : joinPaths(env.config.output.copy.path, "dist");
|
|
99
|
+
const sourcePath = env.config.output.path;
|
|
100
|
+
if (existsSync(sourcePath) && sourcePath !== destinationPath) {
|
|
101
|
+
env.debug(`Copying files from project's build output directory (${env.config.output.path}) to the project's copy/publish directory (${destinationPath}).`);
|
|
102
|
+
await copyFiles(sourcePath, destinationPath);
|
|
103
|
+
} else env.warn(`The source path for the copy operation ${!existsSync(sourcePath) ? "does not exist" : "is the same as the destination path"}. Source: ${sourcePath}, Destination: ${destinationPath}. Skipping copying of build output files.`);
|
|
104
|
+
if (env.config.output.copy.assets && Array.isArray(env.config.output.copy.assets)) await Promise.all(env.config.output.copy.assets.map(async (asset) => {
|
|
105
|
+
env.trace(`Copying asset(s): ${chalk.redBright(env.config.cwd === asset.input ? asset.glob : appendPath(asset.glob, replacePath(asset.input, env.config.cwd)))} -> ${chalk.greenBright(appendPath(asset.glob, replacePath(asset.output, env.config.cwd)))} ${Array.isArray(asset.ignore) && asset.ignore.length > 0 ? ` (ignoring: ${asset.ignore.map((i) => chalk.yellowBright(i)).join(", ")})` : ""}`);
|
|
106
|
+
await env.fs.copy(asset, asset.output);
|
|
107
|
+
}));
|
|
108
|
+
} else env.debug("No copy configuration found for the project output. Skipping the copying of build output files.");
|
|
109
|
+
await context.callHook("build", {
|
|
110
|
+
environment: env,
|
|
111
|
+
order: "post"
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Build the project
|
|
116
|
+
*
|
|
117
|
+
* @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.
|
|
118
|
+
*/
|
|
119
|
+
async function build$1(context) {
|
|
120
|
+
const timer = context.timer("Building");
|
|
121
|
+
await context.generateChecksum();
|
|
122
|
+
if (context.meta.checksum !== context.persistedMeta?.checksum || context.config.skipCache) {
|
|
123
|
+
context.info(!context.persistedMeta?.checksum ? "No previous build cache found. Preparing the project for the initial build." : context.meta.checksum !== context.persistedMeta.checksum ? "The project has been modified since the last time `prepare` was ran. Re-preparing the project." : "The project is configured to skip cache. Re-preparing the project.");
|
|
124
|
+
await prepare$1(context);
|
|
125
|
+
}
|
|
126
|
+
if (context.config.singleBuild) await handleBuild(context, await context.toEnvironment());
|
|
127
|
+
else await executeEnvironments(context, async (env) => {
|
|
128
|
+
await handleBuild(context, env);
|
|
129
|
+
});
|
|
130
|
+
timer();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/api/clean.ts
|
|
135
|
+
/**
|
|
136
|
+
* Clean any previously prepared artifacts
|
|
137
|
+
*
|
|
138
|
+
* @param context - The execution context for the clean process, which provides access to the project configuration, environment, and utility functions for performing the clean operation. The context is used to manage the state and behavior of the clean process, allowing for hooks to be called at different stages of the clean and for environment-specific configurations to be applied.
|
|
139
|
+
*/
|
|
140
|
+
async function clean$1(context) {
|
|
141
|
+
const timer = context.timer("Cleaning");
|
|
142
|
+
await prepare$1(context, true);
|
|
143
|
+
await executeEnvironments(context, async (env) => {
|
|
144
|
+
env.debug("Cleaning the project's dist and artifacts directories.");
|
|
145
|
+
await env.fs.remove(joinPaths$1(env.config.cwd, env.config.output.path));
|
|
146
|
+
await env.fs.remove(joinPaths$1(env.config.cwd, env.config.root, env.config.output.artifactsPath));
|
|
147
|
+
await context.callHook("clean", {
|
|
148
|
+
environment: env,
|
|
149
|
+
sequential: false
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
timer();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/api/create.ts
|
|
157
|
+
/**
|
|
158
|
+
* Create a new Powerlines project
|
|
159
|
+
*
|
|
160
|
+
* @param context - The execution context for the create process, which provides access to the project configuration, environment, and utility functions for performing the create operation. The context is used to manage the state and behavior of the create process, allowing for hooks to be called at different stages of the create and for environment-specific configurations to be applied.
|
|
161
|
+
*/
|
|
162
|
+
async function create$1(context) {
|
|
163
|
+
const timer = context.timer("Create a New Project Generation");
|
|
164
|
+
await prepare$1(context, true);
|
|
165
|
+
await executeEnvironments(context, async (env) => {
|
|
166
|
+
env.debug("Initializing the processing options for the project.");
|
|
167
|
+
await context.callHook("create", {
|
|
168
|
+
environment: env,
|
|
169
|
+
order: "pre"
|
|
170
|
+
});
|
|
171
|
+
const files = await listFiles(joinPaths$1(env.powerlinesPath, "files/common/**/*.hbs"));
|
|
172
|
+
for (const file of files) {
|
|
173
|
+
env.trace(`Adding template file to project: ${file}`);
|
|
174
|
+
const template = Handlebars.compile(file);
|
|
175
|
+
await env.fs.write(joinPaths$1(env.config.root, file.replace(".hbs", "")), template(env));
|
|
176
|
+
}
|
|
177
|
+
await context.callHook("create", {
|
|
178
|
+
environment: env,
|
|
179
|
+
order: "normal"
|
|
180
|
+
});
|
|
181
|
+
if (env.config.projectType === "application") {
|
|
182
|
+
const appFiles = await listFiles(joinPaths$1(env.powerlinesPath, "files/application/**/*.hbs"));
|
|
183
|
+
for (const file of appFiles) {
|
|
184
|
+
env.trace(`Adding application template file: ${file}`);
|
|
185
|
+
const template = Handlebars.compile(file);
|
|
186
|
+
await env.fs.write(joinPaths$1(env.config.root, file.replace(".hbs", "")), template(env));
|
|
187
|
+
}
|
|
188
|
+
} else {
|
|
189
|
+
const libFiles = await listFiles(joinPaths$1(env.powerlinesPath, "files/library/**/*.hbs"));
|
|
190
|
+
for (const file of libFiles) {
|
|
191
|
+
env.trace(`Adding library template file: ${file}`);
|
|
192
|
+
const template = Handlebars.compile(file);
|
|
193
|
+
await env.fs.write(joinPaths$1(env.config.root, file.replace(".hbs", "")), template(env));
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
await context.callHook("create", {
|
|
197
|
+
environment: env,
|
|
198
|
+
order: "post"
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
timer();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/api/deploy.ts
|
|
206
|
+
/**
|
|
207
|
+
* Deploy the project's source files to the target environment.
|
|
208
|
+
*
|
|
209
|
+
* @remarks
|
|
210
|
+
* This function serves as the main entry point for the deployment process, orchestrating the execution of deployment hooks across different environments defined in the project configuration. It ensures that all relevant deployment operations are performed in a structured manner, allowing for pre-deployment, main deployment, and post-deployment hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the deployment operation, providing insights into the performance of the deployment process.
|
|
211
|
+
*
|
|
212
|
+
* @param context - The execution context for the deploy process, which provides access to the project configuration, environment, and utility functions for performing the deploy operation. The context is used to manage the state and behavior of the deploy process, allowing for hooks to be called at different stages of the deploy and for environment-specific configurations to be applied.
|
|
213
|
+
*/
|
|
214
|
+
async function deploy$1(context) {
|
|
215
|
+
const timer = context.timer("Deployment");
|
|
216
|
+
await prepare$1(context);
|
|
217
|
+
await executeEnvironments(context, async (env) => {
|
|
218
|
+
await context.callHook("deploy", { environment: env });
|
|
219
|
+
});
|
|
220
|
+
timer();
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/api/docs.ts
|
|
225
|
+
/**
|
|
226
|
+
* Generate the project's documentation.
|
|
227
|
+
*
|
|
228
|
+
* @remarks
|
|
229
|
+
* This function serves as the main entry point for the documentation generation process, orchestrating the execution of documentation hooks across different environments defined in the project configuration. It ensures that all relevant documentation operations are performed in a structured manner, allowing for pre-documentation, main documentation, and post-documentation hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the documentation operation, providing insights into the performance of the documentation process.
|
|
230
|
+
*
|
|
231
|
+
* @param context - The execution context for the documentation process, which provides access to the project configuration, environment, and utility functions for performing the documentation operation. The context is used to manage the state and behavior of the documentation process, allowing for hooks to be called at different stages of the documentation and for environment-specific configurations to be applied.
|
|
232
|
+
*/
|
|
233
|
+
async function docs$1(context) {
|
|
234
|
+
const timer = context.timer("Documentation");
|
|
235
|
+
await prepare$1(context);
|
|
236
|
+
await executeEnvironments(context, async (env) => {
|
|
237
|
+
await context.callHook("docs", { environment: env });
|
|
238
|
+
});
|
|
239
|
+
timer();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/api/lint.ts
|
|
244
|
+
/**
|
|
245
|
+
* Lint the project's source files and report any issues found.
|
|
246
|
+
*
|
|
247
|
+
* @remarks
|
|
248
|
+
* This function serves as the main entry point for the linting process, orchestrating the execution of linting hooks across different environments defined in the project configuration. It ensures that all relevant linting operations are performed in a structured manner, allowing for pre-linting, main linting, and post-linting hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the linting operation, providing insights into the performance of the linting process.
|
|
249
|
+
*
|
|
250
|
+
* @param context - The execution context for the lint process, which provides access to the project configuration, environment, and utility functions for performing the lint operation. The context is used to manage the state and behavior of the lint process, allowing for hooks to be called at different stages of the lint and for environment-specific configurations to be applied.
|
|
251
|
+
*/
|
|
252
|
+
async function lint$1(context) {
|
|
253
|
+
const timer = context.timer("Linting");
|
|
254
|
+
await prepare$1(context);
|
|
255
|
+
await executeEnvironments(context, async (env) => {
|
|
256
|
+
await context.callHook("lint", {
|
|
257
|
+
environment: env,
|
|
258
|
+
sequential: false
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
timer();
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/api/test.ts
|
|
266
|
+
/**
|
|
267
|
+
* Test the project's source files and report any issues found.
|
|
268
|
+
*
|
|
269
|
+
* @remarks
|
|
270
|
+
* This function serves as the main entry point for the testing process, orchestrating the execution of testing hooks across different environments defined in the project configuration. It ensures that all relevant testing operations are performed in a structured manner, allowing for pre-testing, main testing, and post-testing hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the testing operation, providing insights into the performance of the testing process.
|
|
271
|
+
*
|
|
272
|
+
* @param context - The execution context for the test process, which provides access to the project configuration, environment, and utility functions for performing the test operation. The context is used to manage the state and behavior of the test process, allowing for hooks to be called at different stages of the test and for environment-specific configurations to be applied.
|
|
273
|
+
*/
|
|
274
|
+
async function test$1(context) {
|
|
275
|
+
const timer = context.timer("Testing");
|
|
276
|
+
await prepare$1(context);
|
|
277
|
+
await executeEnvironments(context, async (env) => {
|
|
278
|
+
await context.callHook("test", {
|
|
279
|
+
environment: env,
|
|
280
|
+
sequential: false
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
timer();
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region src/api/types.ts
|
|
288
|
+
/**
|
|
289
|
+
* Generate runtime types for the Powerlines project.
|
|
290
|
+
*
|
|
291
|
+
* @remarks
|
|
292
|
+
* This function is responsible for generating TypeScript declaration files based on the project's configuration and environment. It executes hooks at various stages of the type generation process, allowing for customization and extension by plugins. The generated types are formatted and written to the appropriate location in the project's file system, ensuring that they are available for use by other parts of the Powerlines system and by end-users of the project.
|
|
293
|
+
*
|
|
294
|
+
* @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.
|
|
295
|
+
*/
|
|
296
|
+
async function types$1(context) {
|
|
297
|
+
const timer = context.timer("Type Generation");
|
|
298
|
+
context.debug(" Aggregating configuration options for the Powerlines project");
|
|
299
|
+
await executeEnvironments(context, async (env) => {
|
|
300
|
+
env.debug(`Initializing the processing options for the Powerlines project.`);
|
|
301
|
+
await context.callHook("configResolved", {
|
|
302
|
+
environment: env,
|
|
303
|
+
order: "pre"
|
|
304
|
+
});
|
|
305
|
+
await initializeTsconfig(env);
|
|
306
|
+
await context.callHook("configResolved", {
|
|
307
|
+
environment: env,
|
|
308
|
+
order: "normal"
|
|
309
|
+
});
|
|
310
|
+
if (env.entry.length > 0) env.debug(`The configuration provided ${isObject(env.config.input) ? Object.keys(env.config.input).length : toArray(env.config.input).length} entry point(s), Powerlines has found ${env.entry.length} entry files(s) for the ${env.config.title} project${env.entry.length > 0 && env.entry.length < 10 ? `: \n${env.entry.map((entry) => `- ${entry.file}${entry.output ? ` -> ${entry.output}` : ""}`).join(" \n")}` : ""}`);
|
|
311
|
+
else env.warn(`No entry files were found for the ${env.config.title} project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`);
|
|
312
|
+
await resolveTsconfig(env);
|
|
313
|
+
await installDependencies(env);
|
|
314
|
+
await context.callHook("configResolved", {
|
|
315
|
+
environment: env,
|
|
316
|
+
order: "post"
|
|
317
|
+
});
|
|
318
|
+
context.trace(`Powerlines configuration has been resolved: \n\n${formatLogMessage({
|
|
319
|
+
...env.config,
|
|
320
|
+
userConfig: isSetObject(env.config.userConfig) ? omit(env.config.userConfig, ["plugins"]) : void 0,
|
|
321
|
+
inlineConfig: isSetObject(env.config.inlineConfig) ? env.config.inlineConfig : void 0,
|
|
322
|
+
plugins: env.plugins.map((plugin) => plugin.name)
|
|
323
|
+
})}`);
|
|
324
|
+
if (!env.fs.existsSync(env.cachePath)) await createDirectory(env.cachePath);
|
|
325
|
+
if (!env.fs.existsSync(env.dataPath)) await createDirectory(env.dataPath);
|
|
326
|
+
if (env.config.skipCache === true || env.persistedMeta?.checksum !== env.meta.checksum) env.debug(`Using previously prepared files as the meta checksum has not changed.`);
|
|
327
|
+
else {
|
|
328
|
+
env.info(`Running \`prepare\` command as the meta checksum has changed since the last run.`);
|
|
329
|
+
await prepare$1(context, true);
|
|
330
|
+
}
|
|
331
|
+
await handleTypes(context, env);
|
|
332
|
+
context.debug("Formatting files generated during the types step.");
|
|
333
|
+
await format(env, env.typesPath, await env.fs.read(env.typesPath) ?? "");
|
|
334
|
+
await writeMetaFile(env);
|
|
335
|
+
env.persistedMeta = env.meta;
|
|
336
|
+
});
|
|
337
|
+
timer();
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
//#endregion
|
|
341
|
+
//#region src/helpers/create-execution-host.ts
|
|
342
|
+
/**
|
|
343
|
+
* Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.
|
|
344
|
+
*
|
|
345
|
+
* @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.
|
|
346
|
+
* @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.
|
|
347
|
+
*/
|
|
348
|
+
function createExecutionHost(methods) {
|
|
349
|
+
return Object.fromEntries(Object.entries(methods).map(([method, fn]) => [method, async (params) => {
|
|
350
|
+
const context = await PowerlinesExecutionContext.from(params.options, params.inlineConfig ?? {});
|
|
351
|
+
context.logger.info(`Starting ${method} execution (${params.options.executionId})`);
|
|
352
|
+
await resolvePluginConfig(context);
|
|
353
|
+
await fn(context);
|
|
354
|
+
}]));
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
//#endregion
|
|
358
|
+
//#region src/execution-host.ts
|
|
359
|
+
const executionHost = createExecutionHost({
|
|
360
|
+
types: types$1,
|
|
361
|
+
prepare: prepare$1,
|
|
362
|
+
create: create$1,
|
|
363
|
+
clean: clean$1,
|
|
364
|
+
lint: lint$1,
|
|
365
|
+
test: test$1,
|
|
366
|
+
build: build$1,
|
|
367
|
+
docs: docs$1,
|
|
368
|
+
deploy: deploy$1
|
|
369
|
+
});
|
|
370
|
+
const types = executionHost.types;
|
|
371
|
+
const prepare = executionHost.prepare;
|
|
372
|
+
const create = executionHost.create;
|
|
373
|
+
const clean = executionHost.clean;
|
|
374
|
+
const lint = executionHost.lint;
|
|
375
|
+
const test = executionHost.test;
|
|
376
|
+
const build = executionHost.build;
|
|
377
|
+
const docs = executionHost.docs;
|
|
378
|
+
const deploy = executionHost.deploy;
|
|
379
|
+
|
|
380
|
+
//#endregion
|
|
381
|
+
export { build, clean, create, deploy, docs, lint, prepare, test, types };
|
|
382
|
+
//# sourceMappingURL=execution-host.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-host.mjs","names":["prepare","formatFolder","build","prepare","clean","prepare","joinPaths","create","prepare","joinPaths","deploy","prepare","docs","prepare","lint","prepare","test","prepare","types","prepare","executeTypes","executePrepare","executeCreate","executeClean","executeLint","executeTest","executeBuild","executeDocs","executeDeploy"],"sources":["../../src/api/prepare.ts","../../src/api/build.ts","../../src/api/clean.ts","../../src/api/create.ts","../../src/api/deploy.ts","../../src/api/docs.ts","../../src/api/lint.ts","../../src/api/test.ts","../../src/api/types.ts","../../src/helpers/create-execution-host.ts","../../src/execution-host.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 { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { handleTypes } from \"@powerlines/core/lib/generate-types\";\nimport { installDependencies } from \"@powerlines/core/lib/install-dependencies\";\nimport { writeMetaFile } from \"@powerlines/core/lib/meta\";\nimport {\n initializeTsconfig,\n resolveTsconfig\n} from \"@powerlines/core/lib/typescript/tsconfig\";\nimport { formatFolder } from \"@powerlines/core/lib/utilities/format\";\nimport { formatConfig } from \"@powerlines/core/plugin-utils\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\n\n/**\n * Prepare the project\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function prepare<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(\n context: ExecutionContext<TResolvedConfig, TSystemContext>,\n skipTypes = false\n) {\n const timer = context.timer(\"Preparation\");\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig, TSystemContext>(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n env.debug(\n `The configuration provided ${\n isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length\n } entry point(s), Powerlines has found ${\n env.entry.length\n } entry files(s) for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${entry.file}${\n entry.output ? ` -> ${entry.output}` : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig<TResolvedConfig, TSystemContext>(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n env.trace({\n meta: {\n category: \"config\"\n },\n message: `Powerlines configuration after configResolved hook: \\n${formatConfig(\n env.config\n )}`\n });\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"pre\"\n });\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"normal\"\n });\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"post\"\n });\n\n if (!skipTypes && env.config.output.types !== false) {\n await handleTypes(context, env);\n }\n\n context.debug(\"Formatting files generated during the prepare step.\");\n\n await Promise.all([\n formatFolder(env, env.builtinsPath),\n formatFolder(env, env.entryPath)\n ]);\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\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 {\n EnvironmentContext,\n ExecutionContext,\n formatFolder\n} from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { copyFiles } from \"@stryke/fs/copy-file\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { relativePath } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport chalk from \"chalk\";\nimport { existsSync } from \"node:fs\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\nasync function handleBuild<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(\n context: ExecutionContext<TResolvedConfig, TSystemContext>,\n env: EnvironmentContext<TResolvedConfig, TSystemContext>\n) {\n await context.callHook(\"build\", {\n environment: env,\n order: \"pre\"\n });\n\n env.debug(\n \"Formatting the generated entry files before the build process starts.\"\n );\n await formatFolder(env, env.entryPath);\n\n await context.callHook(\"build\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.config.output.copy) {\n env.debug(\"Copying project's files from build output directory.\");\n\n const destinationPath = isParentPath(\n appendPath(env.config.output.path, env.config.cwd),\n appendPath(env.config.root, env.config.cwd)\n )\n ? joinPaths(\n env.config.output.copy.path,\n relativePath(\n appendPath(env.config.root, env.config.cwd),\n appendPath(env.config.output.path, env.config.cwd)\n )\n )\n : joinPaths(env.config.output.copy.path, \"dist\");\n const sourcePath = env.config.output.path;\n\n if (existsSync(sourcePath) && sourcePath !== destinationPath) {\n env.debug(\n `Copying files from project's build output directory (${\n env.config.output.path\n }) to the project's copy/publish directory (${destinationPath}).`\n );\n\n await copyFiles(sourcePath, destinationPath);\n } else {\n env.warn(\n `The source path for the copy operation ${\n !existsSync(sourcePath)\n ? \"does not exist\"\n : \"is the same as the destination path\"\n }. Source: ${sourcePath}, Destination: ${\n destinationPath\n }. Skipping copying of build output files.`\n );\n }\n\n if (\n env.config.output.copy.assets &&\n Array.isArray(env.config.output.copy.assets)\n ) {\n await Promise.all(\n env.config.output.copy.assets.map(async asset => {\n env.trace(\n `Copying asset(s): ${chalk.redBright(\n env.config.cwd === asset.input\n ? asset.glob\n : appendPath(\n asset.glob,\n replacePath(asset.input, env.config.cwd)\n )\n )} -> ${chalk.greenBright(\n appendPath(asset.glob, replacePath(asset.output, env.config.cwd))\n )} ${\n Array.isArray(asset.ignore) && asset.ignore.length > 0\n ? ` (ignoring: ${asset.ignore\n .map(i => chalk.yellowBright(i))\n .join(\", \")})`\n : \"\"\n }`\n );\n\n await env.fs.copy(asset, asset.output);\n })\n );\n }\n } else {\n env.debug(\n \"No copy configuration found for the project output. Skipping the copying of build output files.\"\n );\n }\n\n await context.callHook(\"build\", {\n environment: env,\n order: \"post\"\n });\n}\n\n/**\n * Build the project\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function build<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Building\");\n\n await context.generateChecksum();\n if (\n context.meta.checksum !== context.persistedMeta?.checksum ||\n context.config.skipCache\n ) {\n context.info(\n !context.persistedMeta?.checksum\n ? \"No previous build cache found. Preparing the project for the initial build.\"\n : context.meta.checksum !== context.persistedMeta.checksum\n ? \"The project has been modified since the last time `prepare` was ran. Re-preparing the project.\"\n : \"The project is configured to skip cache. Re-preparing the project.\"\n );\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n }\n\n if (context.config.singleBuild) {\n await handleBuild<TResolvedConfig, TSystemContext>(\n context,\n await context.toEnvironment()\n );\n } else {\n await executeEnvironments(context, async env => {\n await handleBuild<TResolvedConfig, TSystemContext>(context, env);\n });\n }\n\n timer();\n}\n","/* -------------------------------------------------------------------\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 { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Clean any previously prepared artifacts\n *\n * @param context - The execution context for the clean process, which provides access to the project configuration, environment, and utility functions for performing the clean operation. The context is used to manage the state and behavior of the clean process, allowing for hooks to be called at different stages of the clean and for environment-specific configurations to be applied.\n */\nexport async function clean<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Cleaning\");\n\n await prepare<TResolvedConfig, TSystemContext>(context, true);\n await executeEnvironments(context, async env => {\n env.debug(\"Cleaning the project's dist and artifacts directories.\");\n\n await env.fs.remove(joinPaths(env.config.cwd, env.config.output.path));\n await env.fs.remove(\n joinPaths(\n env.config.cwd,\n env.config.root,\n env.config.output.artifactsPath\n )\n );\n\n await context.callHook(\"clean\", {\n environment: env,\n sequential: false\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\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 { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { listFiles } from \"@stryke/fs/list-files\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport Handlebars from \"handlebars\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Create a new Powerlines project\n *\n * @param context - The execution context for the create process, which provides access to the project configuration, environment, and utility functions for performing the create operation. The context is used to manage the state and behavior of the create process, allowing for hooks to be called at different stages of the create and for environment-specific configurations to be applied.\n */\nexport async function create<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Create a New Project Generation\");\n\n await prepare<TResolvedConfig, TSystemContext>(context, true);\n await executeEnvironments(context, async env => {\n env.debug(\"Initializing the processing options for the project.\");\n\n await context.callHook(\"create\", {\n environment: env,\n order: \"pre\"\n });\n\n const files = await listFiles(\n joinPaths(env.powerlinesPath, \"files/common/**/*.hbs\")\n );\n for (const file of files) {\n env.trace(`Adding template file to project: ${file}`);\n\n const template = Handlebars.compile(file);\n await env.fs.write(\n joinPaths(env.config.root, file.replace(\".hbs\", \"\")),\n template(env)\n );\n }\n\n await context.callHook(\"create\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.config.projectType === \"application\") {\n const appFiles = await listFiles(\n joinPaths(env.powerlinesPath, \"files/application/**/*.hbs\")\n );\n for (const file of appFiles) {\n env.trace(`Adding application template file: ${file}`);\n\n const template = Handlebars.compile(file);\n await env.fs.write(\n joinPaths(env.config.root, file.replace(\".hbs\", \"\")),\n template(env)\n );\n }\n } else {\n const libFiles = await listFiles(\n joinPaths(env.powerlinesPath, \"files/library/**/*.hbs\")\n );\n for (const file of libFiles) {\n env.trace(`Adding library template file: ${file}`);\n\n const template = Handlebars.compile(file);\n await env.fs.write(\n joinPaths(env.config.root, file.replace(\".hbs\", \"\")),\n template(env)\n );\n }\n }\n\n await context.callHook(\"create\", {\n environment: env,\n order: \"post\"\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\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 { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Deploy the project's source files to the target environment.\n *\n * @remarks\n * This function serves as the main entry point for the deployment process, orchestrating the execution of deployment hooks across different environments defined in the project configuration. It ensures that all relevant deployment operations are performed in a structured manner, allowing for pre-deployment, main deployment, and post-deployment hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the deployment operation, providing insights into the performance of the deployment process.\n *\n * @param context - The execution context for the deploy process, which provides access to the project configuration, environment, and utility functions for performing the deploy operation. The context is used to manage the state and behavior of the deploy process, allowing for hooks to be called at different stages of the deploy and for environment-specific configurations to be applied.\n */\nexport async function deploy<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Deployment\");\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"deploy\", {\n environment: env\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\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 { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Generate the project's documentation.\n *\n * @remarks\n * This function serves as the main entry point for the documentation generation process, orchestrating the execution of documentation hooks across different environments defined in the project configuration. It ensures that all relevant documentation operations are performed in a structured manner, allowing for pre-documentation, main documentation, and post-documentation hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the documentation operation, providing insights into the performance of the documentation process.\n *\n * @param context - The execution context for the documentation process, which provides access to the project configuration, environment, and utility functions for performing the documentation operation. The context is used to manage the state and behavior of the documentation process, allowing for hooks to be called at different stages of the documentation and for environment-specific configurations to be applied.\n */\nexport async function docs<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Documentation\");\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"docs\", {\n environment: env\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\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 { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Lint the project's source files and report any issues found.\n *\n * @remarks\n * This function serves as the main entry point for the linting process, orchestrating the execution of linting hooks across different environments defined in the project configuration. It ensures that all relevant linting operations are performed in a structured manner, allowing for pre-linting, main linting, and post-linting hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the linting operation, providing insights into the performance of the linting process.\n *\n * @param context - The execution context for the lint process, which provides access to the project configuration, environment, and utility functions for performing the lint operation. The context is used to manage the state and behavior of the lint process, allowing for hooks to be called at different stages of the lint and for environment-specific configurations to be applied.\n */\nexport async function lint<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Linting\");\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"lint\", {\n environment: env,\n sequential: false\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\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 { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Test the project's source files and report any issues found.\n *\n * @remarks\n * This function serves as the main entry point for the testing process, orchestrating the execution of testing hooks across different environments defined in the project configuration. It ensures that all relevant testing operations are performed in a structured manner, allowing for pre-testing, main testing, and post-testing hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the testing operation, providing insights into the performance of the testing process.\n *\n * @param context - The execution context for the test process, which provides access to the project configuration, environment, and utility functions for performing the test operation. The context is used to manage the state and behavior of the test process, allowing for hooks to be called at different stages of the test and for environment-specific configurations to be applied.\n */\nexport async function test<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Testing\");\n\n await prepare(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"test\", {\n environment: env,\n sequential: false\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\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 { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { handleTypes } from \"@powerlines/core/lib/generate-types\";\nimport { installDependencies } from \"@powerlines/core/lib/install-dependencies\";\nimport { writeMetaFile } from \"@powerlines/core/lib/meta\";\nimport {\n initializeTsconfig,\n resolveTsconfig\n} from \"@powerlines/core/lib/typescript/tsconfig\";\nimport { format } from \"@powerlines/core/lib/utilities/format\";\nimport { ExecutionContext } from \"@powerlines/core/types/context\";\nimport { formatLogMessage } from \"@storm-software/config-tools/logger\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Generate runtime types for the Powerlines project.\n *\n * @remarks\n * This function is responsible for generating TypeScript declaration files based on the project's configuration and environment. It executes hooks at various stages of the type generation process, allowing for customization and extension by plugins. The generated types are formatted and written to the appropriate location in the project's file system, ensuring that they are available for use by other parts of the Powerlines system and by end-users of the project.\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function types<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Type Generation\");\n context.debug(\n \" Aggregating configuration options for the Powerlines project\"\n );\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig, TSystemContext>(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n env.debug(\n `The configuration provided ${\n isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length\n } entry point(s), Powerlines has found ${\n env.entry.length\n } entry files(s) for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${entry.file}${\n entry.output ? ` -> ${entry.output}` : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig<TResolvedConfig, TSystemContext>(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n context.trace(\n `Powerlines configuration has been resolved: \\n\\n${formatLogMessage({\n ...env.config,\n userConfig: isSetObject(env.config.userConfig)\n ? omit(env.config.userConfig, [\"plugins\"])\n : undefined,\n inlineConfig: isSetObject(env.config.inlineConfig)\n ? env.config.inlineConfig\n : undefined,\n plugins: env.plugins.map(plugin => plugin.name)\n })}`\n );\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n if (\n env.config.skipCache === true ||\n env.persistedMeta?.checksum !== env.meta.checksum\n ) {\n env.debug(\n `Using previously prepared files as the meta checksum has not changed.`\n );\n } else {\n env.info(\n `Running \\`prepare\\` command as the meta checksum has changed since the last run.`\n );\n\n await prepare(context, true);\n }\n\n await handleTypes(context, env);\n\n context.debug(\"Formatting files generated during the types step.\");\n\n await format(env, env.typesPath, (await env.fs.read(env.typesPath)) ?? \"\");\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\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 { PowerlinesExecutionContext } from \"@powerlines/core/context/execution-context\";\nimport { resolvePluginConfig } from \"@powerlines/core/lib/context-helpers\";\nimport { ExecutionHostParams } from \"../types/api\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\n\n/**\n * Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.\n *\n * @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.\n * @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.\n */\nexport function createExecutionHost<\n TContext extends PowerlinesExecutionContext<\n EngineResolvedConfig,\n EngineSystemContext\n > = PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext>\n>(methods: Record<string, (context: TContext) => Promise<void>>) {\n return Object.fromEntries(\n Object.entries(methods).map(([method, fn]) => [\n method,\n async (params: ExecutionHostParams) => {\n const context = (await PowerlinesExecutionContext.from(\n params.options,\n params.inlineConfig ?? {}\n )) as TContext;\n context.logger.info(\n `Starting ${method} execution (${params.options.executionId})`\n );\n\n await resolvePluginConfig(context as PowerlinesExecutionContext<any>);\n\n await fn(context);\n }\n ])\n );\n}\n","/* -------------------------------------------------------------------\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 { build as executeBuild } from \"./api/build\";\nimport { clean as executeClean } from \"./api/clean\";\nimport { create as executeCreate } from \"./api/create\";\nimport { deploy as executeDeploy } from \"./api/deploy\";\nimport { docs as executeDocs } from \"./api/docs\";\nimport { lint as executeLint } from \"./api/lint\";\nimport { prepare as executePrepare } from \"./api/prepare\";\nimport { test as executeTest } from \"./api/test\";\nimport { types as executeTypes } from \"./api/types\";\nimport { createExecutionHost } from \"./helpers/create-execution-host\";\n\nconst executionHost = createExecutionHost({\n types: executeTypes,\n prepare: executePrepare,\n create: executeCreate,\n clean: executeClean,\n lint: executeLint,\n test: executeTest,\n build: executeBuild,\n docs: executeDocs,\n deploy: executeDeploy\n});\n\nexport const types = executionHost.types;\nexport const prepare = executionHost.prepare;\nexport const create = executionHost.create;\nexport const clean = executionHost.clean;\nexport const lint = executionHost.lint;\nexport const test = executionHost.test;\nexport const build = executionHost.build;\nexport const docs = executionHost.docs;\nexport const deploy = executionHost.deploy;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,eAAsBA,UAIpB,SACA,YAAY,OACZ;CACA,MAAM,QAAQ,QAAQ,MAAM,cAAc;AAE1C,OAAM,oBAAoB,SAAS,OAAM,QAAO;AAC9C,MAAI,MACF,kEACD;AAED,QAAM,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