powerlines 0.42.3 → 0.42.6
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-DGFUV-F6.cjs → api-DoC5Fbbl.cjs} +50 -47
- package/dist/{api-CSU9yoTE.mjs → api-QF6YGs6J.mjs} +51 -48
- package/dist/api-QF6YGs6J.mjs.map +1 -0
- package/dist/astro.cjs +3 -3
- package/dist/astro.mjs +3 -3
- package/dist/context/index.cjs +3 -3
- package/dist/context/index.d.cts +1 -2
- package/dist/context/index.d.cts.map +1 -1
- package/dist/context/index.d.mts +1 -2
- package/dist/context/index.d.mts.map +1 -1
- package/dist/context/index.mjs +3 -3
- package/dist/esbuild.cjs +3 -3
- package/dist/esbuild.mjs +3 -3
- package/dist/farm.cjs +3 -3
- package/dist/farm.mjs +3 -3
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/next.cjs +3 -3
- package/dist/next.mjs +3 -3
- package/dist/nuxt.cjs +3 -3
- package/dist/nuxt.mjs +3 -3
- package/dist/rolldown.cjs +3 -3
- package/dist/rolldown.mjs +3 -3
- package/dist/rollup.cjs +3 -3
- package/dist/rollup.mjs +3 -3
- package/dist/rspack.cjs +3 -3
- package/dist/rspack.mjs +3 -3
- package/dist/storage/index.cjs +1 -1
- package/dist/storage/index.mjs +1 -1
- package/dist/{tsconfig-D9GCB2I9.mjs → tsconfig-DcW7-RGh.mjs} +2 -2
- package/dist/{tsconfig-D9GCB2I9.mjs.map → tsconfig-DcW7-RGh.mjs.map} +1 -1
- package/dist/{tsconfig-BJrUrPC_.cjs → tsconfig-l-UmDdrR.cjs} +1 -1
- package/dist/tsdown.cjs +18 -15
- package/dist/tsdown.mjs +18 -15
- package/dist/tsdown.mjs.map +1 -1
- package/dist/tsup.cjs +3 -3
- package/dist/tsup.mjs +3 -3
- package/dist/typescript/index.cjs +1 -1
- package/dist/typescript/index.mjs +1 -1
- package/dist/unloader.cjs +3 -3
- package/dist/unloader.mjs +3 -3
- package/dist/unplugin.cjs +3 -3
- package/dist/unplugin.mjs +3 -3
- package/dist/{virtual-DvkJm7gK.mjs → virtual-B0n7dKeA.mjs} +3 -3
- package/dist/{virtual-DvkJm7gK.mjs.map → virtual-B0n7dKeA.mjs.map} +1 -1
- package/dist/{virtual-Cbvj12lU.cjs → virtual-BvouNuwf.cjs} +2 -2
- package/dist/vite.cjs +3 -3
- package/dist/vite.mjs +3 -3
- package/dist/webpack.cjs +3 -3
- package/dist/webpack.mjs +3 -3
- package/package.json +17 -17
- package/dist/api-CSU9yoTE.mjs.map +0 -1
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-AIJqnxB6.cjs');
|
|
2
|
-
const require_tsconfig = require('./tsconfig-
|
|
2
|
+
const require_tsconfig = require('./tsconfig-l-UmDdrR.cjs');
|
|
3
3
|
const require_plugin_utils = require('./plugin-utils.cjs');
|
|
4
4
|
const require_constants = require('./constants.cjs');
|
|
5
5
|
const require_config = require('./config.cjs');
|
|
6
6
|
const require_utils = require('./utils.cjs');
|
|
7
|
-
const require_virtual = require('./virtual-
|
|
7
|
+
const require_virtual = require('./virtual-BvouNuwf.cjs');
|
|
8
8
|
let _stryke_fs_get_workspace_root = require("@stryke/fs/get-workspace-root");
|
|
9
9
|
let _storm_software_config_tools_logger_console = require("@storm-software/config-tools/logger/console");
|
|
10
10
|
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
11
|
+
let _stryke_fs_copy_file = require("@stryke/fs/copy-file");
|
|
12
|
+
let _stryke_fs_exists = require("@stryke/fs/exists");
|
|
11
13
|
let _stryke_fs_helpers = require("@stryke/fs/helpers");
|
|
12
14
|
let _stryke_fs_install = require("@stryke/fs/install");
|
|
13
15
|
let _stryke_fs_list_files = require("@stryke/fs/list-files");
|
|
@@ -15,6 +17,8 @@ let _stryke_fs_package_fns = require("@stryke/fs/package-fns");
|
|
|
15
17
|
let _stryke_fs_resolve = require("@stryke/fs/resolve");
|
|
16
18
|
let _stryke_helpers_omit = require("@stryke/helpers/omit");
|
|
17
19
|
let _stryke_path_append = require("@stryke/path/append");
|
|
20
|
+
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
21
|
+
let _stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
|
|
18
22
|
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
19
23
|
let _stryke_path_replace = require("@stryke/path/replace");
|
|
20
24
|
let _stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
|
|
@@ -30,14 +34,11 @@ let chalk = require("chalk");
|
|
|
30
34
|
chalk = require_chunk.__toESM(chalk);
|
|
31
35
|
let handlebars = require("handlebars");
|
|
32
36
|
handlebars = require_chunk.__toESM(handlebars);
|
|
33
|
-
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
34
|
-
let _stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
|
|
35
37
|
let _stryke_string_format_pretty_bytes = require("@stryke/string-format/pretty-bytes");
|
|
36
38
|
let ts_morph = require("ts-morph");
|
|
37
39
|
let defu = require("defu");
|
|
38
40
|
defu = require_chunk.__toESM(defu);
|
|
39
41
|
let _stryke_string_format_package = require("@stryke/string-format/package");
|
|
40
|
-
let _stryke_fs_exists = require("@stryke/fs/exists");
|
|
41
42
|
let _stryke_fs_json = require("@stryke/fs/json");
|
|
42
43
|
require("@stryke/fs/remove-file");
|
|
43
44
|
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
@@ -76,7 +77,7 @@ let unplugin = require("unplugin");
|
|
|
76
77
|
|
|
77
78
|
//#region package.json
|
|
78
79
|
var name = "powerlines";
|
|
79
|
-
var version = "0.42.
|
|
80
|
+
var version = "0.42.6";
|
|
80
81
|
|
|
81
82
|
//#endregion
|
|
82
83
|
//#region src/_internal/helpers/generate-types.ts
|
|
@@ -1126,8 +1127,8 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1126
1127
|
if (!this.#resolverCache) this.#resolverCache = (0, flat_cache.create)({
|
|
1127
1128
|
cacheId: "module-resolution",
|
|
1128
1129
|
cacheDir: this.#context.cachePath,
|
|
1129
|
-
ttl:
|
|
1130
|
-
lruSize:
|
|
1130
|
+
ttl: 2.5 * 60 * 1e3,
|
|
1131
|
+
lruSize: 8e3,
|
|
1131
1132
|
persistInterval: 100
|
|
1132
1133
|
});
|
|
1133
1134
|
return this.#resolverCache;
|
|
@@ -1170,8 +1171,8 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1170
1171
|
...this.#context.config.output.storage
|
|
1171
1172
|
};
|
|
1172
1173
|
this.#storage.virtual ??= new require_virtual.VirtualStorageAdapter(context, { base: "/_virtual" });
|
|
1173
|
-
this.#storage[this.#context.config.output.publishPath] ??= new require_virtual.FileSystemStorageAdapter(context, { base: this.#context.config.output.publishPath });
|
|
1174
1174
|
this.#storage[this.#context.config.output.path] ??= new require_virtual.FileSystemStorageAdapter(context, { base: this.#context.config.output.path });
|
|
1175
|
+
if (this.#context.config.output.copy && this.#context.config.output.copy.path) this.#storage[this.#context.config.output.copy.path] ??= new require_virtual.FileSystemStorageAdapter(context, { base: this.#context.config.output.copy.path });
|
|
1175
1176
|
if (this.#context.config.output.storage !== "fs") {
|
|
1176
1177
|
this.#storage[this.#context.artifactsPath] ??= new require_virtual.VirtualStorageAdapter(context, { base: this.#context.artifactsPath });
|
|
1177
1178
|
this.#storage[this.#context.builtinsPath] ??= new require_virtual.VirtualStorageAdapter(context, { base: this.#context.builtinsPath });
|
|
@@ -1762,12 +1763,15 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
1762
1763
|
skipCache: config.skipCache,
|
|
1763
1764
|
autoInstall: config.autoInstall,
|
|
1764
1765
|
input: config.input,
|
|
1765
|
-
output: config.output,
|
|
1766
1766
|
plugins: config.plugins,
|
|
1767
1767
|
mode: config.mode,
|
|
1768
1768
|
resolve: config.resolve,
|
|
1769
1769
|
framework: config.framework,
|
|
1770
|
-
...config
|
|
1770
|
+
...config,
|
|
1771
|
+
output: {
|
|
1772
|
+
...config.output ?? {},
|
|
1773
|
+
path: config.output?.path ? (0, _stryke_path_append.appendPath)(config.output.path, config.root) : void 0
|
|
1774
|
+
}
|
|
1771
1775
|
}, { output: config.framework ? {
|
|
1772
1776
|
artifactsPath: `.${config.framework ?? "powerlines"}`,
|
|
1773
1777
|
dts: true,
|
|
@@ -1903,8 +1907,12 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
1903
1907
|
* The logger function
|
|
1904
1908
|
*/
|
|
1905
1909
|
get log() {
|
|
1906
|
-
|
|
1907
|
-
|
|
1910
|
+
const level = this.config.logLevel || "info";
|
|
1911
|
+
if (!this.logger || this.logger.level !== level) this.logger = {
|
|
1912
|
+
log: this.createLog(),
|
|
1913
|
+
level
|
|
1914
|
+
};
|
|
1915
|
+
return this.logger.log;
|
|
1908
1916
|
}
|
|
1909
1917
|
/**
|
|
1910
1918
|
* The workspace configuration
|
|
@@ -2509,7 +2517,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2509
2517
|
/**
|
|
2510
2518
|
* A logger function specific to this context
|
|
2511
2519
|
*/
|
|
2512
|
-
|
|
2520
|
+
logger;
|
|
2513
2521
|
/**
|
|
2514
2522
|
* Initialize the context with the provided configuration options
|
|
2515
2523
|
*
|
|
@@ -2576,11 +2584,8 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2576
2584
|
version: this.packageJson?.version,
|
|
2577
2585
|
description: this.packageJson?.description,
|
|
2578
2586
|
output: (0, require_plugin_utils.plugin_utils_exports.mergeConfig)(config.output ?? {}, {
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
dts: true,
|
|
2582
|
-
typegen: (0, _stryke_path_join.joinPaths)(cacheKey.root, `${config.framework ?? "powerlines"}.d.ts`),
|
|
2583
|
-
assets: [
|
|
2587
|
+
path: cacheKey.root ? (0, _stryke_path_append.appendPath)((0, _stryke_path_join.joinPaths)(cacheKey.root, "dist"), this.workspaceConfig?.workspaceRoot) : void 0,
|
|
2588
|
+
copy: { assets: [
|
|
2584
2589
|
{ glob: "LICENSE" },
|
|
2585
2590
|
{
|
|
2586
2591
|
input: cacheKey.root,
|
|
@@ -2590,7 +2595,10 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2590
2595
|
input: cacheKey.root,
|
|
2591
2596
|
glob: "package.json"
|
|
2592
2597
|
}
|
|
2593
|
-
]
|
|
2598
|
+
] },
|
|
2599
|
+
artifactsPath: `.${config.framework ?? "powerlines"}`,
|
|
2600
|
+
dts: true,
|
|
2601
|
+
typegen: (0, _stryke_path_join.joinPaths)(cacheKey.root, `${config.framework ?? "powerlines"}.d.ts`)
|
|
2594
2602
|
})
|
|
2595
2603
|
}, options.isHighPriority ? {} : this.#getConfigProps(config), {
|
|
2596
2604
|
inlineConfig: {},
|
|
@@ -2614,18 +2622,17 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2614
2622
|
if (this.config.resolve.noExternal) this.config.resolve.noExternal = (0, _stryke_helpers_get_unique.getUnique)(this.config.resolve.noExternal);
|
|
2615
2623
|
this.config.output.format = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(this.config.output?.format ?? (this.config.projectType === "library" ? ["cjs", "esm"] : ["esm"])));
|
|
2616
2624
|
if (this.config.output.dts !== false && !this.config.output.typegen) this.config.output.typegen = `${this.config.root ? `${this.config.root}/` : ""}${this.config.framework ?? "powerlines"}.d.ts`;
|
|
2617
|
-
if (this.config.root && this.config.root !== "." && this.config.root !== "./" && this.config.root !== this.workspaceConfig.workspaceRoot)
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
this.config.output.
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
this.config.output.assets = (0, _stryke_helpers_get_unique.getUniqueBy)(this.config.output.assets.map((asset) => {
|
|
2625
|
+
if (this.config.root && this.config.root !== "." && this.config.root !== "./" && this.config.root !== this.workspaceConfig.workspaceRoot) this.config.output.path ??= (0, _stryke_path_join.joinPaths)(this.config.root, "dist");
|
|
2626
|
+
else this.config.output.path ??= "dist";
|
|
2627
|
+
if (this.config.root && this.config.output.copy !== false) this.config.output.copy = {
|
|
2628
|
+
path: (0, _stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, "dist", (0, _stryke_path_replace.replacePath)(this.config.root, this.workspaceConfig.workspaceRoot)),
|
|
2629
|
+
...this.config.output.copy || {}
|
|
2630
|
+
};
|
|
2631
|
+
if (this.config.output.copy && this.config.output.copy.path && this.config.output.copy.assets && Array.isArray(this.config.output.copy.assets)) this.config.output.copy.assets = (0, _stryke_helpers_get_unique.getUniqueBy)(this.config.output.copy.assets.map((asset) => {
|
|
2625
2632
|
return {
|
|
2626
2633
|
glob: (0, _stryke_type_checks_is_set_object.isSetObject)(asset) ? asset.glob : asset,
|
|
2627
2634
|
input: (0, _stryke_type_checks_is_string.isString)(asset) || !asset.input || asset.input === "." || asset.input === "/" || asset.input === "./" ? this.workspaceConfig.workspaceRoot : (0, _stryke_path_is_parent_path.isParentPath)(asset.input, this.workspaceConfig.workspaceRoot) || asset.input === this.workspaceConfig.workspaceRoot ? asset.input : (0, _stryke_path_append.appendPath)(asset.input, this.workspaceConfig.workspaceRoot),
|
|
2628
|
-
output: (0, _stryke_type_checks_is_set_object.isSetObject)(asset) && asset.output ? (0, _stryke_path_is_parent_path.isParentPath)(asset.output, this.workspaceConfig.workspaceRoot) ? asset.output : (0, _stryke_path_append.appendPath)((0, _stryke_path_join.joinPaths)(this.config.output.
|
|
2635
|
+
output: (0, _stryke_type_checks_is_set_object.isSetObject)(asset) && asset.output ? (0, _stryke_path_is_parent_path.isParentPath)(asset.output, this.workspaceConfig.workspaceRoot) ? asset.output : (0, _stryke_path_append.appendPath)((0, _stryke_path_join.joinPaths)(this.config.output.copy.path, (0, _stryke_path_replace.replacePath)((0, _stryke_path_replace.replacePath)(asset.output, (0, _stryke_path_replace.replacePath)(this.config.output.copy.path, this.workspaceConfig.workspaceRoot)), this.config.output.copy.path)), this.workspaceConfig.workspaceRoot) : (0, _stryke_path_append.appendPath)(this.config.output.copy.path, this.workspaceConfig.workspaceRoot),
|
|
2629
2636
|
ignore: (0, _stryke_type_checks_is_set_object.isSetObject)(asset) && asset.ignore ? (0, _stryke_convert_to_array.toArray)(asset.ignore) : void 0
|
|
2630
2637
|
};
|
|
2631
2638
|
}), (a) => `${a.input}-${a.glob}-${a.output}`);
|
|
@@ -2637,7 +2644,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2637
2644
|
if (this.config.tsconfig) this.config.tsconfig = (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this, this.config.tsconfig);
|
|
2638
2645
|
if (this.config.output.typegen) if ((0, _stryke_type_checks_is_set_string.isSetString)(this.config.output.typegen)) this.config.output.typegen = (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this, this.config.output.typegen);
|
|
2639
2646
|
else this.config.output.typegen = (0, _stryke_path_join.joinPaths)(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`);
|
|
2640
|
-
if (this.config.output.assets) this.config.output.assets = this.config.output.assets.map((asset) => ({
|
|
2647
|
+
if (this.config.output.copy && this.config.output.copy.assets) this.config.output.copy.assets = this.config.output.copy.assets.map((asset) => ({
|
|
2641
2648
|
...asset,
|
|
2642
2649
|
glob: (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this, asset.glob),
|
|
2643
2650
|
ignore: asset.ignore ? asset.ignore.map((ignore) => (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this, ignore)) : void 0,
|
|
@@ -3011,7 +3018,6 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
3011
3018
|
var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext {
|
|
3012
3019
|
#environments = {};
|
|
3013
3020
|
#plugins = [];
|
|
3014
|
-
#log;
|
|
3015
3021
|
/**
|
|
3016
3022
|
* Create a new Storm context from the workspace root and user config.
|
|
3017
3023
|
*
|
|
@@ -3056,10 +3062,6 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
|
|
|
3056
3062
|
get environments() {
|
|
3057
3063
|
return this.#environments;
|
|
3058
3064
|
}
|
|
3059
|
-
get log() {
|
|
3060
|
-
if (!this.#log) this.#log = this.createLog();
|
|
3061
|
-
return this.#log;
|
|
3062
|
-
}
|
|
3063
3065
|
get plugins() {
|
|
3064
3066
|
return this.#plugins;
|
|
3065
3067
|
}
|
|
@@ -3445,7 +3447,7 @@ var PowerlinesAPI = class PowerlinesAPI {
|
|
|
3445
3447
|
this.context.info(" 📦 Building the Powerlines project");
|
|
3446
3448
|
await this.context.generateChecksum();
|
|
3447
3449
|
if (this.context.meta.checksum !== this.context.persistedMeta?.checksum || this.context.config.skipCache) {
|
|
3448
|
-
this.context.info("The project has been modified since the last time `prepare` was ran. Re-preparing the project.");
|
|
3450
|
+
this.context.info(!this.context.persistedMeta?.checksum ? "No previous build cache found. Preparing the project for the initial build." : this.context.meta.checksum !== this.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.");
|
|
3449
3451
|
inlineConfig.command ??= "build";
|
|
3450
3452
|
await this.prepare(inlineConfig);
|
|
3451
3453
|
}
|
|
@@ -3545,18 +3547,19 @@ var PowerlinesAPI = class PowerlinesAPI {
|
|
|
3545
3547
|
environment: context,
|
|
3546
3548
|
order: "normal"
|
|
3547
3549
|
});
|
|
3548
|
-
if (context.config.output.
|
|
3550
|
+
if (context.config.output.copy) {
|
|
3551
|
+
context.debug("Copying project's files from build output directory.");
|
|
3552
|
+
const destinationPath = (0, _stryke_path_is_parent_path.isParentPath)((0, _stryke_path_append.appendPath)(context.config.output.path, context.workspaceConfig.workspaceRoot), (0, _stryke_path_append.appendPath)(context.config.root, context.workspaceConfig.workspaceRoot)) ? (0, _stryke_path_join_paths.joinPaths)(context.config.output.copy.path, (0, _stryke_path_file_path_fns.relativePath)((0, _stryke_path_append.appendPath)(context.config.root, context.workspaceConfig.workspaceRoot), (0, _stryke_path_append.appendPath)(context.config.output.path, context.workspaceConfig.workspaceRoot))) : (0, _stryke_path_join_paths.joinPaths)(context.config.output.copy.path, "dist");
|
|
3549
3553
|
const sourcePath = (0, _stryke_path_append.appendPath)(context.config.output.path, context.workspaceConfig.workspaceRoot);
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
}));
|
|
3554
|
+
if ((0, _stryke_fs_exists.existsSync)(sourcePath) && sourcePath !== destinationPath) {
|
|
3555
|
+
context.debug(`Copying files from project's build output directory (${context.config.output.path}) to the project's copy/publish directory (${destinationPath}).`);
|
|
3556
|
+
await (0, _stryke_fs_copy_file.copyFiles)(sourcePath, destinationPath);
|
|
3557
|
+
} else context.warn(`The source path for the copy operation ${!(0, _stryke_fs_exists.existsSync)(sourcePath) ? "does not exist" : "is the same as the destination path"}. Source: ${sourcePath}, Destination: ${destinationPath}. Skipping copying of build output files.`);
|
|
3558
|
+
if (context.config.output.copy.assets && Array.isArray(context.config.output.copy.assets)) await Promise.all(context.config.output.copy.assets.map(async (asset) => {
|
|
3559
|
+
context.trace(`Copying asset(s): ${chalk.default.redBright(context.workspaceConfig.workspaceRoot === asset.input ? asset.glob : (0, _stryke_path_append.appendPath)(asset.glob, (0, _stryke_path_replace.replacePath)(asset.input, context.workspaceConfig.workspaceRoot)))} -> ${chalk.default.greenBright((0, _stryke_path_append.appendPath)(asset.glob, (0, _stryke_path_replace.replacePath)(asset.output, context.workspaceConfig.workspaceRoot)))} ${Array.isArray(asset.ignore) && asset.ignore.length > 0 ? ` (ignoring: ${asset.ignore.map((i) => chalk.default.yellowBright(i)).join(", ")})` : ""}`);
|
|
3560
|
+
await context.fs.copy(asset, asset.output);
|
|
3561
|
+
}));
|
|
3562
|
+
} else context.debug("No copy configuration found for the project output. Skipping the copying of build output files.");
|
|
3560
3563
|
await this.callHook("build", {
|
|
3561
3564
|
environment: context,
|
|
3562
3565
|
order: "post"
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { n as __reExport, t as __exportAll } from "./chunk-CtajNgzt.mjs";
|
|
2
|
-
import { a as isIncludeMatchFound, i as getTsconfigFilePath, l as createProgram, r as getParsedTypeScriptConfig } from "./tsconfig-
|
|
2
|
+
import { a as isIncludeMatchFound, i as getTsconfigFilePath, l as createProgram, r as getParsedTypeScriptConfig } from "./tsconfig-DcW7-RGh.mjs";
|
|
3
3
|
import { t as plugin_utils_exports } from "./plugin-utils.mjs";
|
|
4
4
|
import { t as constants_exports } from "./constants.mjs";
|
|
5
5
|
import { t as config_exports } from "./config.mjs";
|
|
6
6
|
import { t as utils_exports } from "./utils.mjs";
|
|
7
|
-
import { n as FileSystemStorageAdapter, t as VirtualStorageAdapter } from "./virtual-
|
|
7
|
+
import { n as FileSystemStorageAdapter, t as VirtualStorageAdapter } from "./virtual-B0n7dKeA.mjs";
|
|
8
8
|
import { getWorkspaceRoot, relativeToWorkspaceRoot } from "@stryke/fs/get-workspace-root";
|
|
9
9
|
import { formatLogMessage } from "@storm-software/config-tools/logger/console";
|
|
10
10
|
import { toArray } from "@stryke/convert/to-array";
|
|
11
|
+
import { copyFiles } from "@stryke/fs/copy-file";
|
|
12
|
+
import { existsSync } from "@stryke/fs/exists";
|
|
11
13
|
import { createDirectory } from "@stryke/fs/helpers";
|
|
12
14
|
import { install } from "@stryke/fs/install";
|
|
13
15
|
import { listFiles } from "@stryke/fs/list-files";
|
|
@@ -15,6 +17,8 @@ import { doesPackageMatch, getPackageListing, isPackageExists, isPackageListed }
|
|
|
15
17
|
import { getResolutionCombinations, resolve, resolvePackage, resolveSync } from "@stryke/fs/resolve";
|
|
16
18
|
import { omit } from "@stryke/helpers/omit";
|
|
17
19
|
import { appendPath } from "@stryke/path/append";
|
|
20
|
+
import { findFileDotExtensionSafe, findFileExtensionSafe, findFileName, findFilePath, hasFileExtension, relativePath } from "@stryke/path/file-path-fns";
|
|
21
|
+
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
18
22
|
import { joinPaths } from "@stryke/path/join-paths";
|
|
19
23
|
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
20
24
|
import { isError } from "@stryke/type-checks/is-error";
|
|
@@ -28,13 +32,10 @@ import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
|
28
32
|
import { isString } from "@stryke/type-checks/is-string";
|
|
29
33
|
import chalk from "chalk";
|
|
30
34
|
import Handlebars from "handlebars";
|
|
31
|
-
import { findFileDotExtensionSafe, findFileExtensionSafe, findFileName, findFilePath, hasFileExtension, relativePath } from "@stryke/path/file-path-fns";
|
|
32
|
-
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
33
35
|
import { prettyBytes } from "@stryke/string-format/pretty-bytes";
|
|
34
36
|
import { DiagnosticCategory } from "ts-morph";
|
|
35
37
|
import defu$1, { createDefu, defu } from "defu";
|
|
36
38
|
import { getPackageName, getPackageVersion, hasPackageVersion } from "@stryke/string-format/package";
|
|
37
|
-
import { existsSync } from "@stryke/fs/exists";
|
|
38
39
|
import { readJsonFile } from "@stryke/fs/json";
|
|
39
40
|
import "@stryke/fs/remove-file";
|
|
40
41
|
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
@@ -72,7 +73,7 @@ import { setParseImpl } from "unplugin";
|
|
|
72
73
|
|
|
73
74
|
//#region package.json
|
|
74
75
|
var name = "powerlines";
|
|
75
|
-
var version = "0.42.
|
|
76
|
+
var version = "0.42.6";
|
|
76
77
|
|
|
77
78
|
//#endregion
|
|
78
79
|
//#region src/_internal/helpers/generate-types.ts
|
|
@@ -1122,8 +1123,8 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1122
1123
|
if (!this.#resolverCache) this.#resolverCache = create({
|
|
1123
1124
|
cacheId: "module-resolution",
|
|
1124
1125
|
cacheDir: this.#context.cachePath,
|
|
1125
|
-
ttl:
|
|
1126
|
-
lruSize:
|
|
1126
|
+
ttl: 2.5 * 60 * 1e3,
|
|
1127
|
+
lruSize: 8e3,
|
|
1127
1128
|
persistInterval: 100
|
|
1128
1129
|
});
|
|
1129
1130
|
return this.#resolverCache;
|
|
@@ -1166,8 +1167,8 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1166
1167
|
...this.#context.config.output.storage
|
|
1167
1168
|
};
|
|
1168
1169
|
this.#storage.virtual ??= new VirtualStorageAdapter(context, { base: "/_virtual" });
|
|
1169
|
-
this.#storage[this.#context.config.output.publishPath] ??= new FileSystemStorageAdapter(context, { base: this.#context.config.output.publishPath });
|
|
1170
1170
|
this.#storage[this.#context.config.output.path] ??= new FileSystemStorageAdapter(context, { base: this.#context.config.output.path });
|
|
1171
|
+
if (this.#context.config.output.copy && this.#context.config.output.copy.path) this.#storage[this.#context.config.output.copy.path] ??= new FileSystemStorageAdapter(context, { base: this.#context.config.output.copy.path });
|
|
1171
1172
|
if (this.#context.config.output.storage !== "fs") {
|
|
1172
1173
|
this.#storage[this.#context.artifactsPath] ??= new VirtualStorageAdapter(context, { base: this.#context.artifactsPath });
|
|
1173
1174
|
this.#storage[this.#context.builtinsPath] ??= new VirtualStorageAdapter(context, { base: this.#context.builtinsPath });
|
|
@@ -1758,12 +1759,15 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
1758
1759
|
skipCache: config.skipCache,
|
|
1759
1760
|
autoInstall: config.autoInstall,
|
|
1760
1761
|
input: config.input,
|
|
1761
|
-
output: config.output,
|
|
1762
1762
|
plugins: config.plugins,
|
|
1763
1763
|
mode: config.mode,
|
|
1764
1764
|
resolve: config.resolve,
|
|
1765
1765
|
framework: config.framework,
|
|
1766
|
-
...config
|
|
1766
|
+
...config,
|
|
1767
|
+
output: {
|
|
1768
|
+
...config.output ?? {},
|
|
1769
|
+
path: config.output?.path ? appendPath(config.output.path, config.root) : void 0
|
|
1770
|
+
}
|
|
1767
1771
|
}, { output: config.framework ? {
|
|
1768
1772
|
artifactsPath: `.${config.framework ?? "powerlines"}`,
|
|
1769
1773
|
dts: true,
|
|
@@ -1899,8 +1903,12 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
1899
1903
|
* The logger function
|
|
1900
1904
|
*/
|
|
1901
1905
|
get log() {
|
|
1902
|
-
|
|
1903
|
-
|
|
1906
|
+
const level = this.config.logLevel || "info";
|
|
1907
|
+
if (!this.logger || this.logger.level !== level) this.logger = {
|
|
1908
|
+
log: this.createLog(),
|
|
1909
|
+
level
|
|
1910
|
+
};
|
|
1911
|
+
return this.logger.log;
|
|
1904
1912
|
}
|
|
1905
1913
|
/**
|
|
1906
1914
|
* The workspace configuration
|
|
@@ -2505,7 +2513,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2505
2513
|
/**
|
|
2506
2514
|
* A logger function specific to this context
|
|
2507
2515
|
*/
|
|
2508
|
-
|
|
2516
|
+
logger;
|
|
2509
2517
|
/**
|
|
2510
2518
|
* Initialize the context with the provided configuration options
|
|
2511
2519
|
*
|
|
@@ -2572,11 +2580,8 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2572
2580
|
version: this.packageJson?.version,
|
|
2573
2581
|
description: this.packageJson?.description,
|
|
2574
2582
|
output: (0, plugin_utils_exports.mergeConfig)(config.output ?? {}, {
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
dts: true,
|
|
2578
|
-
typegen: joinPaths$1(cacheKey.root, `${config.framework ?? "powerlines"}.d.ts`),
|
|
2579
|
-
assets: [
|
|
2583
|
+
path: cacheKey.root ? appendPath(joinPaths$1(cacheKey.root, "dist"), this.workspaceConfig?.workspaceRoot) : void 0,
|
|
2584
|
+
copy: { assets: [
|
|
2580
2585
|
{ glob: "LICENSE" },
|
|
2581
2586
|
{
|
|
2582
2587
|
input: cacheKey.root,
|
|
@@ -2586,7 +2591,10 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2586
2591
|
input: cacheKey.root,
|
|
2587
2592
|
glob: "package.json"
|
|
2588
2593
|
}
|
|
2589
|
-
]
|
|
2594
|
+
] },
|
|
2595
|
+
artifactsPath: `.${config.framework ?? "powerlines"}`,
|
|
2596
|
+
dts: true,
|
|
2597
|
+
typegen: joinPaths$1(cacheKey.root, `${config.framework ?? "powerlines"}.d.ts`)
|
|
2590
2598
|
})
|
|
2591
2599
|
}, options.isHighPriority ? {} : this.#getConfigProps(config), {
|
|
2592
2600
|
inlineConfig: {},
|
|
@@ -2610,18 +2618,17 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2610
2618
|
if (this.config.resolve.noExternal) this.config.resolve.noExternal = getUnique(this.config.resolve.noExternal);
|
|
2611
2619
|
this.config.output.format = getUnique(toArray(this.config.output?.format ?? (this.config.projectType === "library" ? ["cjs", "esm"] : ["esm"])));
|
|
2612
2620
|
if (this.config.output.dts !== false && !this.config.output.typegen) this.config.output.typegen = `${this.config.root ? `${this.config.root}/` : ""}${this.config.framework ?? "powerlines"}.d.ts`;
|
|
2613
|
-
if (this.config.root && this.config.root !== "." && this.config.root !== "./" && this.config.root !== this.workspaceConfig.workspaceRoot)
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
this.config.output.
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
this.config.output.assets = getUniqueBy(this.config.output.assets.map((asset) => {
|
|
2621
|
+
if (this.config.root && this.config.root !== "." && this.config.root !== "./" && this.config.root !== this.workspaceConfig.workspaceRoot) this.config.output.path ??= joinPaths$1(this.config.root, "dist");
|
|
2622
|
+
else this.config.output.path ??= "dist";
|
|
2623
|
+
if (this.config.root && this.config.output.copy !== false) this.config.output.copy = {
|
|
2624
|
+
path: joinPaths$1(this.workspaceConfig.workspaceRoot, "dist", replacePath(this.config.root, this.workspaceConfig.workspaceRoot)),
|
|
2625
|
+
...this.config.output.copy || {}
|
|
2626
|
+
};
|
|
2627
|
+
if (this.config.output.copy && this.config.output.copy.path && this.config.output.copy.assets && Array.isArray(this.config.output.copy.assets)) this.config.output.copy.assets = getUniqueBy(this.config.output.copy.assets.map((asset) => {
|
|
2621
2628
|
return {
|
|
2622
2629
|
glob: isSetObject(asset) ? asset.glob : asset,
|
|
2623
2630
|
input: isString(asset) || !asset.input || asset.input === "." || asset.input === "/" || asset.input === "./" ? this.workspaceConfig.workspaceRoot : isParentPath(asset.input, this.workspaceConfig.workspaceRoot) || asset.input === this.workspaceConfig.workspaceRoot ? asset.input : appendPath(asset.input, this.workspaceConfig.workspaceRoot),
|
|
2624
|
-
output: isSetObject(asset) && asset.output ? isParentPath(asset.output, this.workspaceConfig.workspaceRoot) ? asset.output : appendPath(joinPaths$1(this.config.output.
|
|
2631
|
+
output: isSetObject(asset) && asset.output ? isParentPath(asset.output, this.workspaceConfig.workspaceRoot) ? asset.output : appendPath(joinPaths$1(this.config.output.copy.path, replacePath(replacePath(asset.output, replacePath(this.config.output.copy.path, this.workspaceConfig.workspaceRoot)), this.config.output.copy.path)), this.workspaceConfig.workspaceRoot) : appendPath(this.config.output.copy.path, this.workspaceConfig.workspaceRoot),
|
|
2625
2632
|
ignore: isSetObject(asset) && asset.ignore ? toArray(asset.ignore) : void 0
|
|
2626
2633
|
};
|
|
2627
2634
|
}), (a) => `${a.input}-${a.glob}-${a.output}`);
|
|
@@ -2633,7 +2640,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2633
2640
|
if (this.config.tsconfig) this.config.tsconfig = (0, plugin_utils_exports.replacePathTokens)(this, this.config.tsconfig);
|
|
2634
2641
|
if (this.config.output.typegen) if (isSetString(this.config.output.typegen)) this.config.output.typegen = (0, plugin_utils_exports.replacePathTokens)(this, this.config.output.typegen);
|
|
2635
2642
|
else this.config.output.typegen = joinPaths$1(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`);
|
|
2636
|
-
if (this.config.output.assets) this.config.output.assets = this.config.output.assets.map((asset) => ({
|
|
2643
|
+
if (this.config.output.copy && this.config.output.copy.assets) this.config.output.copy.assets = this.config.output.copy.assets.map((asset) => ({
|
|
2637
2644
|
...asset,
|
|
2638
2645
|
glob: (0, plugin_utils_exports.replacePathTokens)(this, asset.glob),
|
|
2639
2646
|
ignore: asset.ignore ? asset.ignore.map((ignore) => (0, plugin_utils_exports.replacePathTokens)(this, ignore)) : void 0,
|
|
@@ -3008,7 +3015,6 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
3008
3015
|
var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext {
|
|
3009
3016
|
#environments = {};
|
|
3010
3017
|
#plugins = [];
|
|
3011
|
-
#log;
|
|
3012
3018
|
/**
|
|
3013
3019
|
* Create a new Storm context from the workspace root and user config.
|
|
3014
3020
|
*
|
|
@@ -3053,10 +3059,6 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
|
|
|
3053
3059
|
get environments() {
|
|
3054
3060
|
return this.#environments;
|
|
3055
3061
|
}
|
|
3056
|
-
get log() {
|
|
3057
|
-
if (!this.#log) this.#log = this.createLog();
|
|
3058
|
-
return this.#log;
|
|
3059
|
-
}
|
|
3060
3062
|
get plugins() {
|
|
3061
3063
|
return this.#plugins;
|
|
3062
3064
|
}
|
|
@@ -3442,7 +3444,7 @@ var PowerlinesAPI = class PowerlinesAPI {
|
|
|
3442
3444
|
this.context.info(" 📦 Building the Powerlines project");
|
|
3443
3445
|
await this.context.generateChecksum();
|
|
3444
3446
|
if (this.context.meta.checksum !== this.context.persistedMeta?.checksum || this.context.config.skipCache) {
|
|
3445
|
-
this.context.info("The project has been modified since the last time `prepare` was ran. Re-preparing the project.");
|
|
3447
|
+
this.context.info(!this.context.persistedMeta?.checksum ? "No previous build cache found. Preparing the project for the initial build." : this.context.meta.checksum !== this.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.");
|
|
3446
3448
|
inlineConfig.command ??= "build";
|
|
3447
3449
|
await this.prepare(inlineConfig);
|
|
3448
3450
|
}
|
|
@@ -3542,18 +3544,19 @@ var PowerlinesAPI = class PowerlinesAPI {
|
|
|
3542
3544
|
environment: context,
|
|
3543
3545
|
order: "normal"
|
|
3544
3546
|
});
|
|
3545
|
-
if (context.config.output.
|
|
3547
|
+
if (context.config.output.copy) {
|
|
3548
|
+
context.debug("Copying project's files from build output directory.");
|
|
3549
|
+
const destinationPath = isParentPath(appendPath(context.config.output.path, context.workspaceConfig.workspaceRoot), appendPath(context.config.root, context.workspaceConfig.workspaceRoot)) ? joinPaths(context.config.output.copy.path, relativePath(appendPath(context.config.root, context.workspaceConfig.workspaceRoot), appendPath(context.config.output.path, context.workspaceConfig.workspaceRoot))) : joinPaths(context.config.output.copy.path, "dist");
|
|
3546
3550
|
const sourcePath = appendPath(context.config.output.path, context.workspaceConfig.workspaceRoot);
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
}));
|
|
3551
|
+
if (existsSync(sourcePath) && sourcePath !== destinationPath) {
|
|
3552
|
+
context.debug(`Copying files from project's build output directory (${context.config.output.path}) to the project's copy/publish directory (${destinationPath}).`);
|
|
3553
|
+
await copyFiles(sourcePath, destinationPath);
|
|
3554
|
+
} else context.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.`);
|
|
3555
|
+
if (context.config.output.copy.assets && Array.isArray(context.config.output.copy.assets)) await Promise.all(context.config.output.copy.assets.map(async (asset) => {
|
|
3556
|
+
context.trace(`Copying asset(s): ${chalk.redBright(context.workspaceConfig.workspaceRoot === asset.input ? asset.glob : appendPath(asset.glob, replacePath(asset.input, context.workspaceConfig.workspaceRoot)))} -> ${chalk.greenBright(appendPath(asset.glob, replacePath(asset.output, context.workspaceConfig.workspaceRoot)))} ${Array.isArray(asset.ignore) && asset.ignore.length > 0 ? ` (ignoring: ${asset.ignore.map((i) => chalk.yellowBright(i)).join(", ")})` : ""}`);
|
|
3557
|
+
await context.fs.copy(asset, asset.output);
|
|
3558
|
+
}));
|
|
3559
|
+
} else context.debug("No copy configuration found for the project output. Skipping the copying of build output files.");
|
|
3557
3560
|
await this.callHook("build", {
|
|
3558
3561
|
environment: context,
|
|
3559
3562
|
order: "post"
|
|
@@ -3778,4 +3781,4 @@ ${formatTypes(types)}
|
|
|
3778
3781
|
|
|
3779
3782
|
//#endregion
|
|
3780
3783
|
export { createUnpluginFactory as a, FileMetadata as c, FileSystem as d, _capnpFileId as f, createPluginContext as i, FileMetadata_KeyValuePair as l, version as m, PowerlinesAPIContext as n, PowerlinesContext as o, name as p, PowerlinesEnvironmentContext as r, FileId as s, PowerlinesAPI as t, FileStorage as u };
|
|
3781
|
-
//# sourceMappingURL=api-
|
|
3784
|
+
//# sourceMappingURL=api-QF6YGs6J.mjs.map
|