powerlines 0.37.31 → 0.37.32
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.cjs +2 -2
- package/dist/api.js +1 -1
- package/dist/astro.cjs +4 -4
- package/dist/astro.js +3 -3
- package/dist/{chunk-ST65VKTR.cjs → chunk-3ZV6MOMH.cjs} +167 -210
- package/dist/{chunk-Z5JSF22L.js → chunk-D5W4OJQI.js} +3 -3
- package/dist/{chunk-4VHA6QFN.js → chunk-DFHVFK5Q.js} +154 -199
- package/dist/{chunk-K2PLWWNA.js → chunk-DJ4FRBNH.js} +3 -3
- package/dist/{chunk-5WZHLXMC.js → chunk-MJ7BK6OR.js} +3 -3
- package/dist/{chunk-DQFKSPI5.cjs → chunk-OLOGZ27T.cjs} +5 -5
- package/dist/{chunk-6WYVGWDN.cjs → chunk-UO3UVXLR.cjs} +4 -4
- package/dist/{chunk-W6O3CPYC.js → chunk-VURVUUYR.js} +3 -3
- package/dist/chunk-WD2SDIXV.cjs +12 -0
- package/dist/{chunk-MS7QGIJM.cjs → chunk-XR4OJDFT.cjs} +4 -4
- package/dist/chunk-XZI5Z56Q.cjs +12 -0
- package/dist/{chunk-3XBU4DDR.js → chunk-Z4HHHZMP.js} +3 -3
- package/dist/esbuild.cjs +6 -6
- package/dist/esbuild.js +3 -3
- package/dist/farm.cjs +3 -3
- package/dist/farm.js +2 -2
- package/dist/index.cjs +10 -10
- package/dist/index.js +2 -2
- package/dist/lib/build/esbuild.cjs +5 -5
- package/dist/lib/build/esbuild.js +2 -2
- package/dist/lib/build/index.cjs +12 -12
- package/dist/lib/build/index.d.cts +1 -1
- package/dist/lib/build/index.d.ts +1 -1
- package/dist/lib/build/index.js +4 -4
- package/dist/lib/build/tsup.cjs +6 -6
- package/dist/lib/build/tsup.js +3 -3
- package/dist/lib/build/unbuild.d.cts +1 -1
- package/dist/lib/build/unbuild.d.ts +1 -1
- package/dist/lib/build/vite.cjs +5 -5
- package/dist/lib/build/vite.js +3 -3
- package/dist/lib/{chunk-NPRQVHXP.cjs → chunk-2J3BIEL5.cjs} +7 -83
- package/dist/lib/chunk-2J3BIEL5.cjs.map +1 -0
- package/dist/lib/{chunk-NMZHPWB6.js → chunk-2JWZTFXS.js} +4 -4
- package/dist/lib/{chunk-NMZHPWB6.js.map → chunk-2JWZTFXS.js.map} +1 -1
- package/dist/lib/{chunk-FSQATFTG.js → chunk-2NYU6PWO.js} +3 -3
- package/dist/lib/{chunk-FSQATFTG.js.map → chunk-2NYU6PWO.js.map} +1 -1
- package/dist/lib/{chunk-TFOAWLRF.js → chunk-2Q4HYRK6.js} +3 -3
- package/dist/lib/{chunk-TFOAWLRF.js.map → chunk-2Q4HYRK6.js.map} +1 -1
- package/dist/lib/{chunk-3DYPJHNF.js → chunk-5X6JDPCN.js} +3 -3
- package/dist/lib/{chunk-3DYPJHNF.js.map → chunk-5X6JDPCN.js.map} +1 -1
- package/dist/lib/{chunk-37QKQRHL.js → chunk-ABGPMB5O.js} +3 -3
- package/dist/lib/{chunk-37QKQRHL.js.map → chunk-ABGPMB5O.js.map} +1 -1
- package/dist/lib/{chunk-O7HKPUBS.cjs → chunk-BCRIAJHV.cjs} +4 -4
- package/dist/lib/{chunk-O7HKPUBS.cjs.map → chunk-BCRIAJHV.cjs.map} +1 -1
- package/dist/lib/{chunk-7ZLMFCZF.js → chunk-CQMZHDZP.js} +3 -3
- package/dist/lib/{chunk-7ZLMFCZF.js.map → chunk-CQMZHDZP.js.map} +1 -1
- package/dist/lib/{chunk-NMCDCHEL.cjs → chunk-HFM5IVGD.cjs} +39 -33
- package/dist/lib/chunk-HFM5IVGD.cjs.map +1 -0
- package/dist/lib/{chunk-GF5FQKAI.js → chunk-HX5UF7YV.js} +36 -30
- package/dist/lib/chunk-HX5UF7YV.js.map +1 -0
- package/dist/lib/{chunk-6MX6ZNGS.cjs → chunk-JF4ZEC67.cjs} +19 -19
- package/dist/lib/{chunk-6MX6ZNGS.cjs.map → chunk-JF4ZEC67.cjs.map} +1 -1
- package/dist/lib/{chunk-PD6TYAFZ.cjs → chunk-KCMW3IVY.cjs} +4 -4
- package/dist/lib/{chunk-PD6TYAFZ.cjs.map → chunk-KCMW3IVY.cjs.map} +1 -1
- package/dist/lib/{chunk-S6HKYEP4.js → chunk-L3BXKH76.js} +51 -48
- package/dist/lib/chunk-L3BXKH76.js.map +1 -0
- package/dist/lib/{chunk-TAXCKJWL.cjs → chunk-LV5UDNR3.cjs} +75 -72
- package/dist/lib/chunk-LV5UDNR3.cjs.map +1 -0
- package/dist/lib/{chunk-KLU5DWCZ.js → chunk-N37JIOZ4.js} +28 -8
- package/dist/lib/chunk-N37JIOZ4.js.map +1 -0
- package/dist/lib/{chunk-HUWGH27W.cjs → chunk-N3CUVN4G.cjs} +4 -4
- package/dist/lib/{chunk-HUWGH27W.cjs.map → chunk-N3CUVN4G.cjs.map} +1 -1
- package/dist/lib/{chunk-TAHP4BEC.cjs → chunk-NAMUQY7P.cjs} +4 -4
- package/dist/lib/{chunk-TAHP4BEC.cjs.map → chunk-NAMUQY7P.cjs.map} +1 -1
- package/dist/lib/{chunk-TBRFVVYJ.cjs → chunk-O3ZBMF6Z.cjs} +6 -6
- package/dist/lib/{chunk-TBRFVVYJ.cjs.map → chunk-O3ZBMF6Z.cjs.map} +1 -1
- package/dist/lib/{chunk-QNGZB26V.cjs → chunk-V5I52KN4.cjs} +4 -4
- package/dist/lib/{chunk-QNGZB26V.cjs.map → chunk-V5I52KN4.cjs.map} +1 -1
- package/dist/lib/{chunk-NMHBDJX7.js → chunk-WQRK3BBU.js} +7 -83
- package/dist/lib/chunk-WQRK3BBU.js.map +1 -0
- package/dist/lib/{chunk-EEF6LJVD.js → chunk-X6CZ2G2G.js} +3 -3
- package/dist/lib/{chunk-EEF6LJVD.js.map → chunk-X6CZ2G2G.js.map} +1 -1
- package/dist/lib/{chunk-FQZQA4EJ.cjs → chunk-Y36HVRRL.cjs} +29 -7
- package/dist/lib/chunk-Y36HVRRL.cjs.map +1 -0
- package/dist/lib/contexts/api-context.cjs +6 -6
- package/dist/lib/contexts/api-context.d.cts +1 -1
- package/dist/lib/contexts/api-context.d.ts +1 -1
- package/dist/lib/contexts/api-context.js +5 -5
- package/dist/lib/contexts/context.cjs +4 -4
- package/dist/lib/contexts/context.d.cts +5 -5
- package/dist/lib/contexts/context.d.ts +5 -5
- package/dist/lib/contexts/context.js +3 -3
- package/dist/lib/contexts/environment-context.cjs +5 -5
- package/dist/lib/contexts/environment-context.d.cts +1 -1
- package/dist/lib/contexts/environment-context.d.ts +1 -1
- package/dist/lib/contexts/environment-context.js +4 -4
- package/dist/lib/contexts/index.cjs +8 -8
- package/dist/lib/contexts/index.d.cts +1 -1
- package/dist/lib/contexts/index.d.ts +1 -1
- package/dist/lib/contexts/index.js +5 -5
- package/dist/lib/contexts/plugin-context.d.cts +1 -1
- package/dist/lib/contexts/plugin-context.d.ts +1 -1
- package/dist/lib/entry.cjs +17 -9
- package/dist/lib/entry.d.cts +16 -2
- package/dist/lib/entry.d.ts +16 -2
- package/dist/lib/entry.js +1 -1
- package/dist/lib/fs/index.cjs +2 -2
- package/dist/lib/fs/index.js +1 -1
- package/dist/lib/fs/vfs.cjs +2 -2
- package/dist/lib/fs/vfs.js +1 -1
- package/dist/lib/index.cjs +32 -24
- package/dist/lib/index.d.cts +2 -2
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/index.js +9 -9
- package/dist/lib/{internal-DyXNBori.d.ts → internal-CFBs3Fok.d.cts} +1 -5
- package/dist/lib/{internal-Dt8PM9M2.d.cts → internal-Dlj-vo3a.d.ts} +1 -5
- package/dist/lib/unplugin/factory.cjs +7 -7
- package/dist/lib/unplugin/factory.js +6 -6
- package/dist/lib/unplugin/index.cjs +7 -7
- package/dist/lib/unplugin/index.js +6 -6
- package/dist/lib/utilities/bundle.cjs +4 -4
- package/dist/lib/utilities/bundle.js +3 -3
- package/dist/lib/utilities/index.cjs +6 -6
- package/dist/lib/utilities/index.js +4 -4
- package/dist/lib/utilities/resolve.cjs +5 -5
- package/dist/lib/utilities/resolve.js +4 -4
- package/dist/next.cjs +4 -4
- package/dist/next.js +3 -3
- package/dist/nuxt.cjs +8 -13
- package/dist/nuxt.js +4 -9
- package/dist/rolldown.cjs +6 -6
- package/dist/rolldown.js +3 -3
- package/dist/rollup.cjs +3 -3
- package/dist/rollup.js +2 -2
- package/dist/rspack.cjs +3 -3
- package/dist/rspack.js +2 -2
- package/dist/tsdown.cjs +4 -4
- package/dist/tsdown.js +3 -3
- package/dist/tsup.cjs +4 -4
- package/dist/tsup.js +3 -3
- package/dist/types/internal.d.cts +1 -5
- package/dist/types/internal.d.ts +1 -5
- package/dist/unloader.cjs +3 -3
- package/dist/unloader.js +2 -2
- package/dist/unplugin.cjs +8 -8
- package/dist/unplugin.js +4 -4
- package/dist/vite.cjs +6 -6
- package/dist/vite.js +3 -3
- package/dist/webpack.cjs +6 -6
- package/dist/webpack.js +3 -3
- package/package.json +2 -2
- package/dist/chunk-KQNFLNDO.cjs +0 -12
- package/dist/chunk-ZPGYJJAN.cjs +0 -12
- package/dist/lib/chunk-FQZQA4EJ.cjs.map +0 -1
- package/dist/lib/chunk-GF5FQKAI.js.map +0 -1
- package/dist/lib/chunk-KLU5DWCZ.js.map +0 -1
- package/dist/lib/chunk-NMCDCHEL.cjs.map +0 -1
- package/dist/lib/chunk-NMHBDJX7.js.map +0 -1
- package/dist/lib/chunk-NPRQVHXP.cjs.map +0 -1
- package/dist/lib/chunk-S6HKYEP4.js.map +0 -1
- package/dist/lib/chunk-TAXCKJWL.cjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkMFC7UJHT_cjs = require('./chunk-MFC7UJHT.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkO3ZBMF6Z_cjs = require('./chunk-O3ZBMF6Z.cjs');
|
|
5
|
+
var chunkHFM5IVGD_cjs = require('./chunk-HFM5IVGD.cjs');
|
|
6
6
|
var chunkBJGMF356_cjs = require('./chunk-BJGMF356.cjs');
|
|
7
7
|
var chunkZWLSNYIN_cjs = require('./chunk-ZWLSNYIN.cjs');
|
|
8
8
|
var chunkQHTL2U3L_cjs = require('./chunk-QHTL2U3L.cjs');
|
|
@@ -70,6 +70,9 @@ var chalk3__default = /*#__PURE__*/_interopDefault(chalk3);
|
|
|
70
70
|
var Handlebars__default = /*#__PURE__*/_interopDefault(Handlebars);
|
|
71
71
|
var t__namespace = /*#__PURE__*/_interopNamespace(t);
|
|
72
72
|
|
|
73
|
+
// package.json
|
|
74
|
+
var package_default = {
|
|
75
|
+
version: "0.37.31"};
|
|
73
76
|
function resolveModulePath(nodePath, state) {
|
|
74
77
|
if (!t__namespace.isStringLiteral(nodePath.node)) {
|
|
75
78
|
return;
|
|
@@ -488,17 +491,17 @@ var PowerlinesAPI = class _PowerlinesAPI {
|
|
|
488
491
|
* @returns A new instance of the Powerlines API
|
|
489
492
|
*/
|
|
490
493
|
static async from(workspaceRoot, config) {
|
|
491
|
-
const api = new _PowerlinesAPI(await
|
|
494
|
+
const api = new _PowerlinesAPI(await chunkO3ZBMF6Z_cjs.PowerlinesAPIContext.from(workspaceRoot, config));
|
|
492
495
|
api.#context.$$internal = {
|
|
493
496
|
api,
|
|
494
|
-
addPlugin: api.#addPlugin.bind(api)
|
|
495
|
-
entry: []
|
|
497
|
+
addPlugin: api.#addPlugin.bind(api)
|
|
496
498
|
};
|
|
499
|
+
api.context.info(`\u{1F50C} The Powerlines v${package_default.version} engine has started`);
|
|
497
500
|
for (const plugin of api.context.config.plugins ?? []) {
|
|
498
501
|
await api.#addPlugin(plugin);
|
|
499
502
|
}
|
|
500
503
|
if (api.context.plugins.length === 0) {
|
|
501
|
-
api.context.
|
|
504
|
+
api.context.warn("No Powerlines plugins were specified in the options. Please ensure this is correct, as it is generally not recommended.");
|
|
502
505
|
}
|
|
503
506
|
const pluginConfig = await api.callHook("config", {
|
|
504
507
|
environment: await api.context.getEnvironment(),
|
|
@@ -521,11 +524,11 @@ var PowerlinesAPI = class _PowerlinesAPI {
|
|
|
521
524
|
async prepare(inlineConfig = {
|
|
522
525
|
command: "prepare"
|
|
523
526
|
}) {
|
|
524
|
-
this.context.
|
|
525
|
-
this.context.
|
|
527
|
+
this.context.info(" \u{1F3D7}\uFE0F Preparing the Powerlines project");
|
|
528
|
+
this.context.debug(" \u2699\uFE0F Aggregating configuration options for the Powerlines project");
|
|
526
529
|
await this.context.withInlineConfig(inlineConfig);
|
|
527
530
|
await this.#executeEnvironments(async (context) => {
|
|
528
|
-
context.
|
|
531
|
+
context.debug(`Initializing the processing options for the Powerlines project.`);
|
|
529
532
|
await this.callHook("configResolved", {
|
|
530
533
|
environment: context,
|
|
531
534
|
order: "pre"
|
|
@@ -535,7 +538,7 @@ var PowerlinesAPI = class _PowerlinesAPI {
|
|
|
535
538
|
environment: context,
|
|
536
539
|
order: "normal"
|
|
537
540
|
});
|
|
538
|
-
context.
|
|
541
|
+
context.debug(`The configuration provided ${toArray.toArray(context.config.entry).length} entry point(s), Powerlines has found ${context.entry.length} entry files(s) for the ${context.config.title} project${context.entry.length > 0 && context.entry.length < 10 ? `:
|
|
539
542
|
${context.entry.map((entry) => `- ${entry.file}${entry.output ? ` -> ${entry.output}` : ""}`).join(" \n")}` : ""}.`);
|
|
540
543
|
await resolveTsconfig(context);
|
|
541
544
|
await installDependencies(context);
|
|
@@ -543,7 +546,7 @@ ${context.entry.map((entry) => `- ${entry.file}${entry.output ? ` -> ${entry.out
|
|
|
543
546
|
environment: context,
|
|
544
547
|
order: "post"
|
|
545
548
|
});
|
|
546
|
-
context.
|
|
549
|
+
context.trace(`Powerlines configuration has been resolved:
|
|
547
550
|
|
|
548
551
|
${console.formatLogMessage(context.config)}`);
|
|
549
552
|
if (!context.fs.existsSync(context.cachePath)) {
|
|
@@ -561,11 +564,11 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
561
564
|
order: "normal"
|
|
562
565
|
});
|
|
563
566
|
if (context.config.output.dts !== false) {
|
|
564
|
-
context.
|
|
567
|
+
context.debug(`Preparing the TypeScript definitions for the Powerlines project.`);
|
|
565
568
|
if (context.fs.existsSync(context.dtsPath)) {
|
|
566
569
|
await context.fs.remove(context.dtsPath);
|
|
567
570
|
}
|
|
568
|
-
context.
|
|
571
|
+
context.debug("Transforming built-ins runtime modules files.");
|
|
569
572
|
const builtinFilePaths = await Promise.all((await context.getBuiltins()).map(async (file) => {
|
|
570
573
|
const result2 = await core.transformAsync(file.code.toString(), {
|
|
571
574
|
highlightCode: true,
|
|
@@ -598,7 +601,7 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
598
601
|
context.warn(`File ID is missing for a built-in runtime file at ${file.path}.`);
|
|
599
602
|
file.id = replace.replacePath(replace.replacePath(file.path, context.workspaceConfig.workspaceRoot), context.builtinsPath);
|
|
600
603
|
}
|
|
601
|
-
context.
|
|
604
|
+
context.trace(`Writing transformed built-in runtime file ${file.id}.`);
|
|
602
605
|
await context.emitBuiltin(result2.code, file.id);
|
|
603
606
|
return file.path;
|
|
604
607
|
}));
|
|
@@ -617,9 +620,9 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
617
620
|
[]
|
|
618
621
|
// [joinPaths(typescriptPath, "lib", "lib.esnext.full.d.ts")]
|
|
619
622
|
);
|
|
620
|
-
context.
|
|
621
|
-
let types
|
|
622
|
-
context.
|
|
623
|
+
context.debug("Parsing TypeScript configuration for the Powerlines project.");
|
|
624
|
+
let types = await emitTypes(context, files);
|
|
625
|
+
context.debug(`Generating TypeScript declaration file ${context.dtsPath}.`);
|
|
623
626
|
const directives = [];
|
|
624
627
|
const asNextParam = /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((previousResult) => isObject.isObject(previousResult) ? previousResult.code : previousResult, "asNextParam");
|
|
625
628
|
let result = await this.callHook("types", {
|
|
@@ -628,15 +631,15 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
628
631
|
order: "pre",
|
|
629
632
|
result: "merge",
|
|
630
633
|
asNextParam
|
|
631
|
-
}, types
|
|
634
|
+
}, types);
|
|
632
635
|
if (result) {
|
|
633
636
|
if (isSetObject.isSetObject(result)) {
|
|
634
|
-
types
|
|
637
|
+
types = result.code;
|
|
635
638
|
if (Array.isArray(result.directives) && result.directives.length > 0) {
|
|
636
639
|
directives.push(...result.directives);
|
|
637
640
|
}
|
|
638
641
|
} else if (isSetString.isSetString(result)) {
|
|
639
|
-
types
|
|
642
|
+
types = result;
|
|
640
643
|
}
|
|
641
644
|
}
|
|
642
645
|
result = await this.callHook("types", {
|
|
@@ -645,15 +648,15 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
645
648
|
order: "normal",
|
|
646
649
|
result: "merge",
|
|
647
650
|
asNextParam
|
|
648
|
-
}, types
|
|
651
|
+
}, types);
|
|
649
652
|
if (result) {
|
|
650
653
|
if (isSetObject.isSetObject(result)) {
|
|
651
|
-
types
|
|
654
|
+
types = result.code;
|
|
652
655
|
if (Array.isArray(result.directives) && result.directives.length > 0) {
|
|
653
656
|
directives.push(...result.directives);
|
|
654
657
|
}
|
|
655
658
|
} else if (isSetString.isSetString(result)) {
|
|
656
|
-
types
|
|
659
|
+
types = result;
|
|
657
660
|
}
|
|
658
661
|
}
|
|
659
662
|
result = await this.callHook("types", {
|
|
@@ -662,18 +665,18 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
662
665
|
order: "post",
|
|
663
666
|
result: "merge",
|
|
664
667
|
asNextParam
|
|
665
|
-
}, types
|
|
668
|
+
}, types);
|
|
666
669
|
if (result) {
|
|
667
670
|
if (isSetObject.isSetObject(result)) {
|
|
668
|
-
types
|
|
671
|
+
types = result.code;
|
|
669
672
|
if (Array.isArray(result.directives) && result.directives.length > 0) {
|
|
670
673
|
directives.push(...result.directives);
|
|
671
674
|
}
|
|
672
675
|
} else if (isSetString.isSetString(result)) {
|
|
673
|
-
types
|
|
676
|
+
types = result;
|
|
674
677
|
}
|
|
675
678
|
}
|
|
676
|
-
if (types
|
|
679
|
+
if (types?.trim() || directives.length > 0) {
|
|
677
680
|
await context.fs.write(context.dtsPath, `${directives ? `${directives.map((directive) => `/// <reference types="${directive}" />`).join("\n")}
|
|
678
681
|
|
|
679
682
|
` : ""}${chunkMFC7UJHT_cjs.getFileHeader(context, {
|
|
@@ -681,7 +684,7 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
681
684
|
prettierIgnore: false
|
|
682
685
|
})}
|
|
683
686
|
|
|
684
|
-
${formatTypes(types
|
|
687
|
+
${formatTypes(types)}
|
|
685
688
|
`);
|
|
686
689
|
} else {
|
|
687
690
|
const dtsRelativePath = getTsconfigDtsPath(context);
|
|
@@ -696,7 +699,7 @@ ${formatTypes(types$1)}
|
|
|
696
699
|
if (!context.tsconfig) {
|
|
697
700
|
throw new Error("Failed to parse the TypeScript configuration file.");
|
|
698
701
|
}
|
|
699
|
-
this.context.
|
|
702
|
+
this.context.debug("Formatting files generated during the prepare step.");
|
|
700
703
|
await Promise.all([
|
|
701
704
|
chunkQSNEYALY_cjs.formatFolder(context, context.builtinsPath),
|
|
702
705
|
chunkQSNEYALY_cjs.formatFolder(context, context.entryPath)
|
|
@@ -708,7 +711,7 @@ ${formatTypes(types$1)}
|
|
|
708
711
|
await chunkBJGMF356_cjs.writeMetaFile(context);
|
|
709
712
|
context.persistedMeta = context.meta;
|
|
710
713
|
});
|
|
711
|
-
this.context.
|
|
714
|
+
this.context.info("\u2714 Powerlines preparation has completed successfully");
|
|
712
715
|
}
|
|
713
716
|
/**
|
|
714
717
|
* Create a new Powerlines project
|
|
@@ -720,17 +723,17 @@ ${formatTypes(types$1)}
|
|
|
720
723
|
* @returns A promise that resolves when the project has been created
|
|
721
724
|
*/
|
|
722
725
|
async new(inlineConfig) {
|
|
723
|
-
this.context.
|
|
726
|
+
this.context.info("\u{1F195} Creating a new Powerlines project");
|
|
724
727
|
await this.prepare(inlineConfig);
|
|
725
728
|
await this.#executeEnvironments(async (context) => {
|
|
726
|
-
context.
|
|
729
|
+
context.debug("Initializing the processing options for the Powerlines project.");
|
|
727
730
|
await this.callHook("new", {
|
|
728
731
|
environment: context,
|
|
729
732
|
order: "pre"
|
|
730
733
|
});
|
|
731
734
|
const files = await listFiles.listFiles(joinPaths.joinPaths(context.powerlinesPath, "files/common/**/*.hbs"));
|
|
732
735
|
for (const file of files) {
|
|
733
|
-
context.
|
|
736
|
+
context.trace(`Adding template file to project: ${file}`);
|
|
734
737
|
const template = Handlebars__default.default.compile(file);
|
|
735
738
|
await context.fs.write(joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
736
739
|
}
|
|
@@ -741,14 +744,14 @@ ${formatTypes(types$1)}
|
|
|
741
744
|
if (context.config.projectType === "application") {
|
|
742
745
|
const files2 = await listFiles.listFiles(joinPaths.joinPaths(context.powerlinesPath, "files/application/**/*.hbs"));
|
|
743
746
|
for (const file of files2) {
|
|
744
|
-
context.
|
|
747
|
+
context.trace(`Adding application template file: ${file}`);
|
|
745
748
|
const template = Handlebars__default.default.compile(file);
|
|
746
749
|
await context.fs.write(joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
747
750
|
}
|
|
748
751
|
} else {
|
|
749
752
|
const files2 = await listFiles.listFiles(joinPaths.joinPaths(context.powerlinesPath, "files/library/**/*.hbs"));
|
|
750
753
|
for (const file of files2) {
|
|
751
|
-
context.
|
|
754
|
+
context.trace(`Adding library template file: ${file}`);
|
|
752
755
|
const template = Handlebars__default.default.compile(file);
|
|
753
756
|
await context.fs.write(joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
754
757
|
}
|
|
@@ -758,7 +761,7 @@ ${formatTypes(types$1)}
|
|
|
758
761
|
order: "post"
|
|
759
762
|
});
|
|
760
763
|
});
|
|
761
|
-
this.context.
|
|
764
|
+
this.context.debug("\u2714 Powerlines new command completed successfully");
|
|
762
765
|
}
|
|
763
766
|
/**
|
|
764
767
|
* Clean any previously prepared artifacts
|
|
@@ -772,10 +775,10 @@ ${formatTypes(types$1)}
|
|
|
772
775
|
async clean(inlineConfig = {
|
|
773
776
|
command: "clean"
|
|
774
777
|
}) {
|
|
775
|
-
this.context.
|
|
778
|
+
this.context.info("\u{1F9F9} Cleaning the previous Powerlines artifacts");
|
|
776
779
|
await this.prepare(inlineConfig);
|
|
777
780
|
await this.#executeEnvironments(async (context) => {
|
|
778
|
-
|
|
781
|
+
context.debug("Cleaning the project's dist and artifacts directories.");
|
|
779
782
|
await context.fs.remove(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.output.buildPath));
|
|
780
783
|
await context.fs.remove(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.output.artifactsPath));
|
|
781
784
|
await this.callHook("clean", {
|
|
@@ -783,7 +786,7 @@ ${formatTypes(types$1)}
|
|
|
783
786
|
sequential: false
|
|
784
787
|
});
|
|
785
788
|
});
|
|
786
|
-
this.context.
|
|
789
|
+
this.context.debug("\u2714 Powerlines cleaning completed successfully");
|
|
787
790
|
}
|
|
788
791
|
/**
|
|
789
792
|
* Lint the project
|
|
@@ -794,7 +797,7 @@ ${formatTypes(types$1)}
|
|
|
794
797
|
async lint(inlineConfig = {
|
|
795
798
|
command: "lint"
|
|
796
799
|
}) {
|
|
797
|
-
this.context.
|
|
800
|
+
this.context.info("\u{1F4CB} Linting the Powerlines project");
|
|
798
801
|
await this.prepare(inlineConfig);
|
|
799
802
|
await this.#executeEnvironments(async (context) => {
|
|
800
803
|
if (context.config.lint !== false) {
|
|
@@ -804,7 +807,7 @@ ${formatTypes(types$1)}
|
|
|
804
807
|
});
|
|
805
808
|
}
|
|
806
809
|
});
|
|
807
|
-
this.context.
|
|
810
|
+
this.context.debug("\u2714 Powerlines linting completed successfully");
|
|
808
811
|
}
|
|
809
812
|
/**
|
|
810
813
|
* Build the project
|
|
@@ -818,7 +821,7 @@ ${formatTypes(types$1)}
|
|
|
818
821
|
async build(inlineConfig = {
|
|
819
822
|
command: "build"
|
|
820
823
|
}) {
|
|
821
|
-
this.context.
|
|
824
|
+
this.context.info("\u{1F4E6} Building the Powerlines project");
|
|
822
825
|
await this.prepare(inlineConfig);
|
|
823
826
|
if (this.context.config.singleBuild) {
|
|
824
827
|
await this.#handleBuild(await this.#context.toEnvironment());
|
|
@@ -827,7 +830,7 @@ ${formatTypes(types$1)}
|
|
|
827
830
|
await this.#handleBuild(context);
|
|
828
831
|
});
|
|
829
832
|
}
|
|
830
|
-
this.context.
|
|
833
|
+
this.context.debug("\u2714 Powerlines build completed successfully");
|
|
831
834
|
}
|
|
832
835
|
/**
|
|
833
836
|
* Prepare the documentation for the project
|
|
@@ -838,10 +841,10 @@ ${formatTypes(types$1)}
|
|
|
838
841
|
async docs(inlineConfig = {
|
|
839
842
|
command: "docs"
|
|
840
843
|
}) {
|
|
841
|
-
this.context.
|
|
844
|
+
this.context.info("\u{1F4D3} Generating documentation for the Powerlines project");
|
|
842
845
|
await this.prepare(inlineConfig);
|
|
843
846
|
await this.#executeEnvironments(async (context) => {
|
|
844
|
-
context.
|
|
847
|
+
context.debug("Writing documentation for the Powerlines project artifacts.");
|
|
845
848
|
await this.prepare(inlineConfig);
|
|
846
849
|
await this.#executeEnvironments(async (context2) => {
|
|
847
850
|
await this.callHook("docs", {
|
|
@@ -849,7 +852,7 @@ ${formatTypes(types$1)}
|
|
|
849
852
|
});
|
|
850
853
|
});
|
|
851
854
|
});
|
|
852
|
-
this
|
|
855
|
+
this.context.debug("\u2714 Powerlines documentation generation completed successfully");
|
|
853
856
|
}
|
|
854
857
|
/**
|
|
855
858
|
* Deploy the project source code
|
|
@@ -862,14 +865,14 @@ ${formatTypes(types$1)}
|
|
|
862
865
|
async deploy(inlineConfig = {
|
|
863
866
|
command: "deploy"
|
|
864
867
|
}) {
|
|
865
|
-
this.context.
|
|
868
|
+
this.context.info("\u{1F680} Deploying the Powerlines project");
|
|
866
869
|
await this.prepare(inlineConfig);
|
|
867
870
|
await this.#executeEnvironments(async (context) => {
|
|
868
871
|
await this.callHook("deploy", {
|
|
869
872
|
environment: context
|
|
870
873
|
});
|
|
871
874
|
});
|
|
872
|
-
this.context.
|
|
875
|
+
this.context.debug("\u2714 Powerlines deploy completed successfully");
|
|
873
876
|
}
|
|
874
877
|
/**
|
|
875
878
|
* Finalization process
|
|
@@ -880,14 +883,14 @@ ${formatTypes(types$1)}
|
|
|
880
883
|
* @returns A promise that resolves when the finalization process has completed
|
|
881
884
|
*/
|
|
882
885
|
async finalize() {
|
|
883
|
-
this.context.
|
|
886
|
+
this.context.info("\u{1F3C1} Powerlines finalization processes started");
|
|
884
887
|
await this.#executeEnvironments(async (context) => {
|
|
885
888
|
await this.callHook("finalize", {
|
|
886
889
|
environment: context
|
|
887
890
|
});
|
|
888
891
|
await context.fs.dispose();
|
|
889
892
|
});
|
|
890
|
-
this.context.
|
|
893
|
+
this.context.debug("\u2714 Powerlines finalization completed successfully");
|
|
891
894
|
}
|
|
892
895
|
/**
|
|
893
896
|
* Invokes the configured plugin hooks
|
|
@@ -928,12 +931,12 @@ ${formatTypes(types$1)}
|
|
|
928
931
|
const sourcePath = append.appendPath(context.config.output.buildPath, context.workspaceConfig.workspaceRoot);
|
|
929
932
|
const destinationPath = joinPaths.joinPaths(append.appendPath(context.config.output.outputPath, context.workspaceConfig.workspaceRoot), "dist");
|
|
930
933
|
if (context.fs.existsSync(sourcePath) && sourcePath !== destinationPath) {
|
|
931
|
-
context.
|
|
934
|
+
context.debug(`Copying build output files from project's build directory (${context.config.output.buildPath}) to the workspace's output directory (${context.config.output.outputPath}).`);
|
|
932
935
|
await context.fs.copy(sourcePath, destinationPath);
|
|
933
936
|
}
|
|
934
937
|
}
|
|
935
938
|
await Promise.all(context.config.output.assets.map(async (asset) => {
|
|
936
|
-
context.
|
|
939
|
+
context.trace(`Copying asset(s): ${chalk3__default.default.redBright(context.workspaceConfig.workspaceRoot === asset.input ? asset.glob : joinPaths.joinPaths(replace.replacePath(asset.input, context.workspaceConfig.workspaceRoot), asset.glob))} -> ${chalk3__default.default.greenBright(joinPaths.joinPaths(replace.replacePath(asset.output, context.workspaceConfig.workspaceRoot), asset.glob))} ${Array.isArray(asset.ignore) && asset.ignore.length > 0 ? ` (ignoring: ${asset.ignore.map((i) => chalk3__default.default.yellowBright(i)).join(", ")})` : ""}`);
|
|
937
940
|
await context.fs.copy(asset, asset.output);
|
|
938
941
|
}));
|
|
939
942
|
await this.callHook("build", {
|
|
@@ -948,12 +951,12 @@ ${formatTypes(types$1)}
|
|
|
948
951
|
*/
|
|
949
952
|
async #getEnvironments() {
|
|
950
953
|
if (!this.context.config.environments || Object.keys(this.context.config.environments).length <= 1) {
|
|
951
|
-
this.context.
|
|
954
|
+
this.context.debug("No environments are configured for this Powerlines project. Using the default environment.");
|
|
952
955
|
return [
|
|
953
956
|
await this.context.getEnvironment()
|
|
954
957
|
];
|
|
955
958
|
}
|
|
956
|
-
this.context.
|
|
959
|
+
this.context.debug(`Found ${Object.keys(this.context.config.environments).length} configured environment(s) for this Powerlines project.`);
|
|
957
960
|
return (await Promise.all(Object.entries(this.context.config.environments).map(async ([name, config]) => {
|
|
958
961
|
const environment = await this.context.getEnvironmentSafe(name);
|
|
959
962
|
if (!environment) {
|
|
@@ -989,7 +992,7 @@ ${formatTypes(types$1)}
|
|
|
989
992
|
return;
|
|
990
993
|
}
|
|
991
994
|
for (const plugin of result) {
|
|
992
|
-
this.context.
|
|
995
|
+
this.context.debug(`Successfully initialized the ${chalk3__default.default.bold.cyanBright(plugin.name)} plugin`);
|
|
993
996
|
await this.context.addPlugin(plugin);
|
|
994
997
|
}
|
|
995
998
|
}
|
|
@@ -1006,8 +1009,8 @@ ${formatTypes(types$1)}
|
|
|
1006
1009
|
if (isPromise.isPromiseLike(config)) {
|
|
1007
1010
|
awaited = await Promise.resolve(config);
|
|
1008
1011
|
}
|
|
1009
|
-
if (!
|
|
1010
|
-
const invalid =
|
|
1012
|
+
if (!chunkHFM5IVGD_cjs.isPluginConfig(awaited)) {
|
|
1013
|
+
const invalid = chunkHFM5IVGD_cjs.findInvalidPluginConfig(awaited);
|
|
1011
1014
|
throw new Error(`Invalid ${invalid && invalid.length > 1 ? "plugins" : "plugin"} specified in the configuration - ${invalid && invalid.length > 0 ? JSON.stringify(awaited) : invalid?.join("\n\n")}
|
|
1012
1015
|
|
|
1013
1016
|
Please ensure the value is one of the following:
|
|
@@ -1019,7 +1022,7 @@ Please ensure the value is one of the following:
|
|
|
1019
1022
|
- an array of plugins or plugin configurations`);
|
|
1020
1023
|
}
|
|
1021
1024
|
let plugins;
|
|
1022
|
-
if (
|
|
1025
|
+
if (chunkHFM5IVGD_cjs.isPlugin(awaited)) {
|
|
1023
1026
|
plugins = [
|
|
1024
1027
|
awaited
|
|
1025
1028
|
];
|
|
@@ -1032,9 +1035,9 @@ Please ensure the value is one of the following:
|
|
|
1032
1035
|
} else {
|
|
1033
1036
|
plugins = toArray.toArray(resolved);
|
|
1034
1037
|
}
|
|
1035
|
-
} else if (Array.isArray(awaited) && awaited.every(
|
|
1038
|
+
} else if (Array.isArray(awaited) && awaited.every(chunkHFM5IVGD_cjs.isPlugin)) {
|
|
1036
1039
|
plugins = awaited;
|
|
1037
|
-
} else if (Array.isArray(awaited) && awaited.every(
|
|
1040
|
+
} else if (Array.isArray(awaited) && awaited.every(chunkHFM5IVGD_cjs.isPluginConfig)) {
|
|
1038
1041
|
plugins = [];
|
|
1039
1042
|
for (const pluginConfig of awaited) {
|
|
1040
1043
|
const initialized = await this.#initPlugin(pluginConfig);
|
|
@@ -1042,10 +1045,10 @@ Please ensure the value is one of the following:
|
|
|
1042
1045
|
plugins.push(...initialized);
|
|
1043
1046
|
}
|
|
1044
1047
|
}
|
|
1045
|
-
} else if (
|
|
1048
|
+
} else if (chunkHFM5IVGD_cjs.isPluginConfigTuple(awaited) || chunkHFM5IVGD_cjs.isPluginConfigObject(awaited)) {
|
|
1046
1049
|
let pluginConfig;
|
|
1047
1050
|
let pluginOptions;
|
|
1048
|
-
if (
|
|
1051
|
+
if (chunkHFM5IVGD_cjs.isPluginConfigTuple(awaited)) {
|
|
1049
1052
|
pluginConfig = awaited[0];
|
|
1050
1053
|
pluginOptions = awaited?.length === 2 ? awaited[1] : void 0;
|
|
1051
1054
|
} else {
|
|
@@ -1061,25 +1064,25 @@ Please ensure the value is one of the following:
|
|
|
1061
1064
|
}
|
|
1062
1065
|
} else if (isFunction.isFunction(pluginConfig)) {
|
|
1063
1066
|
plugins = toArray.toArray(await Promise.resolve(pluginConfig(pluginOptions)));
|
|
1064
|
-
} else if (Array.isArray(pluginConfig) && pluginConfig.every(
|
|
1067
|
+
} else if (Array.isArray(pluginConfig) && pluginConfig.every(chunkHFM5IVGD_cjs.isPlugin)) {
|
|
1065
1068
|
plugins = pluginConfig;
|
|
1066
|
-
} else if (
|
|
1069
|
+
} else if (chunkHFM5IVGD_cjs.isPlugin(pluginConfig)) {
|
|
1067
1070
|
plugins = toArray.toArray(pluginConfig);
|
|
1068
1071
|
}
|
|
1069
1072
|
}
|
|
1070
1073
|
if (!plugins) {
|
|
1071
1074
|
throw new Error(`The plugin configuration ${JSON.stringify(awaited)} is invalid. This configuration must point to a valid Powerlines plugin module.`);
|
|
1072
1075
|
}
|
|
1073
|
-
if (plugins.length > 0 && !plugins.every(
|
|
1076
|
+
if (plugins.length > 0 && !plugins.every(chunkHFM5IVGD_cjs.isPlugin)) {
|
|
1074
1077
|
throw new Error(`The plugin option ${JSON.stringify(plugins)} does not export a valid module. This configuration must point to a valid Powerlines plugin module.`);
|
|
1075
1078
|
}
|
|
1076
1079
|
const result = [];
|
|
1077
1080
|
for (const plugin of plugins) {
|
|
1078
|
-
if (
|
|
1079
|
-
this.context.
|
|
1081
|
+
if (chunkHFM5IVGD_cjs.checkDedupe(plugin, this.context.plugins)) {
|
|
1082
|
+
this.context.trace(`Duplicate ${chalk3__default.default.bold.cyanBright(plugin.name)} plugin dependency detected - Skipping initialization.`);
|
|
1080
1083
|
} else {
|
|
1081
1084
|
result.push(plugin);
|
|
1082
|
-
this.context.
|
|
1085
|
+
this.context.trace(`Initializing the ${chalk3__default.default.bold.cyanBright(plugin.name)} plugin...`);
|
|
1083
1086
|
}
|
|
1084
1087
|
}
|
|
1085
1088
|
return result;
|
|
@@ -1096,12 +1099,12 @@ Please ensure the value is one of the following:
|
|
|
1096
1099
|
]
|
|
1097
1100
|
});
|
|
1098
1101
|
if (!isInstalled && this.context.config.skipInstalls !== true) {
|
|
1099
|
-
this.#context.
|
|
1102
|
+
this.#context.warn(`The plugin package "${pluginPath}" is not installed. It will be installed automatically.`);
|
|
1100
1103
|
const result = await install.install(pluginPath, {
|
|
1101
1104
|
cwd: this.context.config.projectRoot
|
|
1102
1105
|
});
|
|
1103
1106
|
if (isNumber.isNumber(result.exitCode) && result.exitCode > 0) {
|
|
1104
|
-
this.#context.
|
|
1107
|
+
this.#context.error(result.stderr);
|
|
1105
1108
|
throw new Error(`An error occurred while installing the build plugin package "${pluginPath}" `);
|
|
1106
1109
|
}
|
|
1107
1110
|
}
|
|
@@ -1246,5 +1249,5 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
1246
1249
|
chunkPK6SKIKE_cjs.__name(createUnpluginFactory, "createUnpluginFactory");
|
|
1247
1250
|
|
|
1248
1251
|
exports.createUnpluginFactory = createUnpluginFactory;
|
|
1249
|
-
//# sourceMappingURL=chunk-
|
|
1250
|
-
//# sourceMappingURL=chunk-
|
|
1252
|
+
//# sourceMappingURL=chunk-LV5UDNR3.cjs.map
|
|
1253
|
+
//# sourceMappingURL=chunk-LV5UDNR3.cjs.map
|