@powerlines/nx 0.11.90 → 0.11.91
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/CHANGELOG.md +6 -0
- package/dist/{chunk-D6KBHWGQ.mjs → chunk-2YJP4HRC.mjs} +4 -4
- package/dist/{chunk-AQA4P2MP.mjs → chunk-2ZMZAPKR.mjs} +1 -1
- package/dist/{chunk-N3RVDZLI.mjs → chunk-36JDZCID.mjs} +1 -1
- package/dist/{chunk-5EKDYWMD.mjs → chunk-3DTFMSQU.mjs} +1 -1
- package/dist/{chunk-LVEW4A44.js → chunk-4DD4MS57.js} +2 -2
- package/dist/{chunk-PM5REOZ2.mjs → chunk-6NUAWMPM.mjs} +41 -39
- package/dist/{chunk-ZLZUTWWG.js → chunk-AB3AIVJJ.js} +2 -2
- package/dist/{chunk-ATRCA5ZE.js → chunk-DUUEWW4P.js} +3 -3
- package/dist/{chunk-QSIJ72UX.js → chunk-ELZHVQRC.js} +37 -35
- package/dist/{chunk-AL6L2GI6.js → chunk-IR6TAW72.js} +3 -3
- package/dist/{chunk-KPZS6OF5.mjs → chunk-IWSYHFCU.mjs} +1 -1
- package/dist/{chunk-JMJ3MA4W.mjs → chunk-K6KXPEF2.mjs} +1 -1
- package/dist/{chunk-Z7MQED3F.mjs → chunk-KLLDUXCE.mjs} +2 -2
- package/dist/{chunk-LK4PXBKI.mjs → chunk-KXFIN2NL.mjs} +6 -6
- package/dist/{chunk-QSMJD4CD.js → chunk-NOSBV75N.js} +6 -6
- package/dist/{chunk-HG5GBG4Q.js → chunk-RL7KH75T.js} +2 -2
- package/dist/{chunk-BWVCZGFR.js → chunk-VSMLSWBT.js} +5 -5
- package/dist/{chunk-TNFRQNSW.js → chunk-WA6S6OWI.js} +2 -2
- package/dist/{chunk-WSNBDDTY.js → chunk-XTTP76FO.js} +2 -2
- package/dist/{chunk-APCOW5YO.mjs → chunk-XXWF7X5C.mjs} +3 -3
- package/dist/{executor-CvXGN437.d.ts → executor-Bb8vGV8C.d.ts} +3 -3
- package/dist/{executor-DKXf5LeR.d.ts → executor-C2WSCUOW.d.ts} +3 -3
- package/dist/{executor-Zks_mL9A.d.ts → executor-C5rCem7d.d.ts} +3 -3
- package/dist/{executor-Cq17c8hB.d.ts → executor-C9MI57kJ.d.ts} +3 -3
- package/dist/{executor-CBfO0S0X.d.mts → executor-CQzw0-So.d.mts} +3 -3
- package/dist/{executor-BwoBnP5U.d.mts → executor-DXaEo8YG.d.mts} +3 -3
- package/dist/{executor-CYRhjgX1.d.ts → executor-DY7vA66P.d.ts} +3 -3
- package/dist/{executor-BeiE4hj2.d.mts → executor-DwTFXSVb.d.mts} +3 -3
- package/dist/{executor-CKKx8c3Y.d.mts → executor-fccJAIjg.d.mts} +3 -3
- package/dist/{executor-BR_IsTyX.d.mts → executor-u-vw0Uzf.d.mts} +3 -3
- package/dist/executors.d.mts +5 -5
- package/dist/executors.d.ts +5 -5
- package/dist/executors.js +11 -11
- package/dist/executors.mjs +6 -6
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +14 -14
- package/dist/index.mjs +8 -8
- package/dist/src/base/base-executor.js +2 -2
- package/dist/src/base/base-executor.mjs +1 -1
- package/dist/src/base/base-executor.schema.d.d.mts +3 -3
- package/dist/src/base/base-executor.schema.d.d.ts +3 -3
- package/dist/src/base/base-executor.schema.d.ts +3 -3
- package/dist/src/base/base-executor.schema.json +4 -4
- package/dist/src/base/base-executor.untyped.js +2 -2
- package/dist/src/base/base-executor.untyped.mjs +1 -1
- package/dist/src/executors/build/executor.d.mts +1 -1
- package/dist/src/executors/build/executor.d.ts +1 -1
- package/dist/src/executors/build/executor.js +4 -4
- package/dist/src/executors/build/executor.mjs +2 -2
- package/dist/src/executors/build/schema.d.ts +3 -3
- package/dist/src/executors/build/schema.json +4 -4
- package/dist/src/executors/build/untyped.js +3 -3
- package/dist/src/executors/build/untyped.mjs +2 -2
- package/dist/src/executors/clean/executor.d.mts +1 -1
- package/dist/src/executors/clean/executor.d.ts +1 -1
- package/dist/src/executors/clean/executor.js +4 -4
- package/dist/src/executors/clean/executor.mjs +2 -2
- package/dist/src/executors/clean/schema.d.ts +3 -3
- package/dist/src/executors/clean/schema.json +4 -4
- package/dist/src/executors/clean/untyped.js +2 -2
- package/dist/src/executors/clean/untyped.mjs +1 -1
- package/dist/src/executors/docs/executor.d.mts +1 -1
- package/dist/src/executors/docs/executor.d.ts +1 -1
- package/dist/src/executors/docs/executor.js +4 -4
- package/dist/src/executors/docs/executor.mjs +2 -2
- package/dist/src/executors/docs/schema.d.ts +3 -3
- package/dist/src/executors/docs/schema.json +4 -4
- package/dist/src/executors/docs/untyped.js +3 -3
- package/dist/src/executors/docs/untyped.mjs +2 -2
- package/dist/src/executors/lint/executor.d.mts +1 -1
- package/dist/src/executors/lint/executor.d.ts +1 -1
- package/dist/src/executors/lint/executor.js +4 -4
- package/dist/src/executors/lint/executor.mjs +2 -2
- package/dist/src/executors/lint/schema.d.ts +3 -3
- package/dist/src/executors/lint/schema.json +4 -4
- package/dist/src/executors/lint/untyped.js +3 -3
- package/dist/src/executors/lint/untyped.mjs +2 -2
- package/dist/src/executors/prepare/executor.d.mts +1 -1
- package/dist/src/executors/prepare/executor.d.ts +1 -1
- package/dist/src/executors/prepare/executor.js +4 -4
- package/dist/src/executors/prepare/executor.mjs +2 -2
- package/dist/src/executors/prepare/schema.d.ts +3 -3
- package/dist/src/executors/prepare/schema.json +4 -4
- package/dist/src/executors/prepare/untyped.js +3 -3
- package/dist/src/executors/prepare/untyped.mjs +2 -2
- package/dist/src/helpers/plugin-utilities.js +4 -4
- package/dist/src/helpers/plugin-utilities.mjs +1 -1
- package/dist/src/plugin/index.js +3 -3
- package/dist/src/plugin/index.mjs +2 -2
- package/docs/api/base-executor.schema.md +3 -3
- package/docs/api/build/schema.md +3 -3
- package/docs/api/clean/schema.md +3 -3
- package/docs/api/docs/schema.md +3 -3
- package/docs/api/lint/schema.md +3 -3
- package/docs/api/prepare/schema.md +3 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Powerlines - Nx
|
|
4
4
|
|
|
5
|
+
## [0.11.90](https://github.com/storm-software/powerlines/releases/tag/nx%400.11.90) (01/15/2026)
|
|
6
|
+
|
|
7
|
+
### Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated **powerlines** to **v0.37.34**
|
|
10
|
+
|
|
5
11
|
## [0.11.89](https://github.com/storm-software/powerlines/releases/tag/nx%400.11.89) (01/15/2026)
|
|
6
12
|
|
|
7
13
|
### Updated Dependencies
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { base_executor_untyped_default } from './chunk-
|
|
1
|
+
import { base_executor_untyped_default } from './chunk-XXWF7X5C.mjs';
|
|
2
2
|
import { defineUntypedSchema } from 'untyped';
|
|
3
3
|
|
|
4
4
|
var untyped_default = defineUntypedSchema({
|
|
@@ -16,11 +16,11 @@ var untyped_default = defineUntypedSchema({
|
|
|
16
16
|
description: "Skip the cache when building"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
-
|
|
19
|
+
autoInstall: {
|
|
20
20
|
$schema: {
|
|
21
|
-
title: "
|
|
21
|
+
title: "Auto Install",
|
|
22
22
|
type: "boolean",
|
|
23
|
-
description: "
|
|
23
|
+
description: "Automatically install dependencies before building"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkELZHVQRC_js = require('./chunk-ELZHVQRC.js');
|
|
4
4
|
var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
|
|
5
5
|
var defu = require('defu');
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@ async function executorFn(context, api) {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
chunkSHUYVCID_js.__name(executorFn, "executorFn");
|
|
22
|
-
var executor =
|
|
22
|
+
var executor = chunkELZHVQRC_js.withExecutor("build", executorFn);
|
|
23
23
|
var executor_default = executor;
|
|
24
24
|
|
|
25
25
|
exports.executorFn = executorFn;
|
|
@@ -28,9 +28,10 @@ import chalk5 from 'chalk';
|
|
|
28
28
|
import Handlebars from 'handlebars';
|
|
29
29
|
import { declare } from '@babel/helper-plugin-utils';
|
|
30
30
|
import * as t from '@babel/types';
|
|
31
|
+
import { prettyBytes } from '@stryke/string-format/pretty-bytes';
|
|
32
|
+
import { toArray as toArray$1 } from 'node_modules/@farmfe/core/dist/utils/share';
|
|
33
|
+
import { InMemoryFileSystemHost, Project, DiagnosticCategory } from 'ts-morph';
|
|
31
34
|
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
32
|
-
import ts, { flattenDiagnosticMessageText } from 'typescript';
|
|
33
|
-
import { InMemoryFileSystemHost, Project } from 'ts-morph';
|
|
34
35
|
import { getPackageName, hasPackageVersion, getPackageVersion } from '@stryke/string-format/package';
|
|
35
36
|
import { getObjectDiff } from '@donedeal0/superdiff';
|
|
36
37
|
import { readJsonFile, readJsonFileSync } from '@stryke/fs/json';
|
|
@@ -38,6 +39,7 @@ import { StormJSON } from '@stryke/json/storm-json';
|
|
|
38
39
|
import { hasFileExtension, findFilePath, findFileName, findFileExtensionSafe, findFileDotExtensionSafe, relativePath } from '@stryke/path/file-path-fns';
|
|
39
40
|
import { titleCase } from '@stryke/string-format/title-case';
|
|
40
41
|
import { existsSync, exists } from '@stryke/fs/exists';
|
|
42
|
+
import ts from 'typescript';
|
|
41
43
|
import { getEnvPaths } from '@stryke/env/get-env-paths';
|
|
42
44
|
import { hashDirectory } from '@stryke/hash/hash-files';
|
|
43
45
|
import { murmurhash } from '@stryke/hash/murmurhash';
|
|
@@ -59,9 +61,8 @@ import { isDirectory, isFile } from '@stryke/fs/is-file';
|
|
|
59
61
|
import * as $ from '@stryke/capnp';
|
|
60
62
|
import { readFileBuffer, readFileBufferSync, writeFileBuffer } from '@stryke/fs/buffer';
|
|
61
63
|
import { isAbsolutePath } from '@stryke/path/is-type';
|
|
62
|
-
import { prettyBytes } from '@stryke/string-format/pretty-bytes';
|
|
63
64
|
import { isRegExp } from '@stryke/type-checks/is-regexp';
|
|
64
|
-
import { Blob } from 'node:buffer';
|
|
65
|
+
import { Blob as Blob$1 } from 'node:buffer';
|
|
65
66
|
import { fileURLToPath } from 'node:url';
|
|
66
67
|
import { getColor } from '@storm-software/config-tools/utilities/colors';
|
|
67
68
|
import { noop } from '@stryke/helpers/noop';
|
|
@@ -77,7 +78,7 @@ import { resolve } from 'node:path';
|
|
|
77
78
|
|
|
78
79
|
// ../powerlines/package.json
|
|
79
80
|
var package_default = {
|
|
80
|
-
version: "0.37.
|
|
81
|
+
version: "0.37.34"};
|
|
81
82
|
function resolveModulePath(nodePath, state) {
|
|
82
83
|
if (!t.isStringLiteral(nodePath.node)) {
|
|
83
84
|
return;
|
|
@@ -294,7 +295,7 @@ function formatTypes(code) {
|
|
|
294
295
|
}
|
|
295
296
|
__name(formatTypes, "formatTypes");
|
|
296
297
|
async function emitTypes(context, files) {
|
|
297
|
-
context.
|
|
298
|
+
context.debug(`Running the TypeScript compiler for ${files.length} generated runtime files.`);
|
|
298
299
|
const program = createProgram(context, {
|
|
299
300
|
skipAddingFilesFromTsConfig: true
|
|
300
301
|
});
|
|
@@ -302,34 +303,35 @@ async function emitTypes(context, files) {
|
|
|
302
303
|
const result = program.emitToMemory({
|
|
303
304
|
emitOnlyDtsFiles: true
|
|
304
305
|
});
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
if (
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
306
|
+
const diagnostics = result.getDiagnostics();
|
|
307
|
+
if (diagnostics && diagnostics.length > 0) {
|
|
308
|
+
if (diagnostics.some((d) => d.getCategory() === DiagnosticCategory.Error)) {
|
|
309
|
+
throw new Error(`The Typescript emit process failed while generating built-in types:
|
|
310
|
+
${diagnostics.filter((d) => d.getCategory() === DiagnosticCategory.Error).map((d) => `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : ""} ${String(d.getMessageText())} (at ${d.getStart()}:${d.getLength()})`).join("\n")}`);
|
|
311
|
+
} else if (diagnostics.some((d) => d.getCategory() === DiagnosticCategory.Warning)) {
|
|
312
|
+
context.warn(`The Typescript emit process completed with warnings while generating built-in types:
|
|
313
|
+
${diagnostics.filter((d) => d.getCategory() === DiagnosticCategory.Warning).map((d) => `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : ""} ${String(d.getMessageText())} (at ${d.getStart()}:${d.getLength()})`).join("\n")}`);
|
|
314
|
+
} else {
|
|
315
|
+
context.debug(`The Typescript emit process completed with diagnostic messages while generating built-in types:
|
|
316
|
+
${diagnostics.map((d) => `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : ""} ${String(d.getMessageText())} (at ${d.getStart()}:${d.getLength()})`).join("\n")}`);
|
|
316
317
|
}
|
|
317
318
|
}
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
319
|
+
const emittedFiles = result.getFiles();
|
|
320
|
+
context.debug(`The TypeScript compiler emitted ${emittedFiles.length} files for built-in types.`);
|
|
321
|
+
let builtinModules = "";
|
|
322
|
+
for (const emittedFile of emittedFiles) {
|
|
323
|
+
if (!emittedFile.filePath.endsWith(".map")) {
|
|
324
|
+
context.trace(`Processing emitted built-in types file: ${emittedFile.filePath}`);
|
|
325
|
+
builtinModules += `
|
|
326
|
+
declare module "${replaceExtension(replacePath(emittedFile.filePath, context.builtinsPath))}" {
|
|
327
|
+
${emittedFile.text.trim().replace(/^\s*export\s*declare\s*/gm, "export ").replace(/^\s*declare\s*/gm, "")}
|
|
328
|
+
}
|
|
329
|
+
`;
|
|
324
330
|
}
|
|
325
|
-
});
|
|
326
|
-
const diagnosticMessage = diagnosticMessages.join("\n");
|
|
327
|
-
if (diagnosticMessage) {
|
|
328
|
-
throw new Error(`TypeScript compilation failed:
|
|
329
|
-
|
|
330
|
-
${diagnosticMessage.length > 5e3 ? `${diagnosticMessage.slice(0, 5e3)}...` : diagnosticMessage}`);
|
|
331
331
|
}
|
|
332
|
-
|
|
332
|
+
builtinModules = formatTypes(builtinModules);
|
|
333
|
+
context.debug(`A TypeScript declaration file (size: ${prettyBytes(new Blob(toArray$1(builtinModules)).size)}) emitted for the built-in modules types.`);
|
|
334
|
+
return builtinModules;
|
|
333
335
|
}
|
|
334
336
|
__name(emitTypes, "emitTypes");
|
|
335
337
|
var mergeResults = createDefu((obj, key, value) => {
|
|
@@ -414,7 +416,7 @@ async function installPackage(context, packageName, dev = false) {
|
|
|
414
416
|
if (!await isPackageListed(getPackageName(packageName), {
|
|
415
417
|
cwd: context.config.projectRoot
|
|
416
418
|
})) {
|
|
417
|
-
if (context.config.
|
|
419
|
+
if (context.config.autoInstall) {
|
|
418
420
|
context.log(LogLevelLabel.WARN, `The package "${packageName}" is not installed. It will be installed automatically.`);
|
|
419
421
|
const result = await install(packageName, {
|
|
420
422
|
cwd: context.config.projectRoot,
|
|
@@ -425,7 +427,7 @@ async function installPackage(context, packageName, dev = false) {
|
|
|
425
427
|
throw new Error(`An error occurred while installing the package "${packageName}"`);
|
|
426
428
|
}
|
|
427
429
|
} else {
|
|
428
|
-
context.log(LogLevelLabel.WARN, `The package "${packageName}" is not installed. Since the "
|
|
430
|
+
context.log(LogLevelLabel.WARN, `The package "${packageName}" is not installed. Since the "autoInstall" option is set to false, it will not be installed automatically.`);
|
|
429
431
|
}
|
|
430
432
|
} else if (hasPackageVersion(packageName) && !process.env.POWERLINES_SKIP_VERSION_CHECK) {
|
|
431
433
|
const isMatching = await doesPackageMatch(getPackageName(packageName), getPackageVersion(packageName), context.config.projectRoot);
|
|
@@ -938,7 +940,7 @@ function resolveEntriesSync(context, typeDefinitions) {
|
|
|
938
940
|
name: typeDefinition.name
|
|
939
941
|
});
|
|
940
942
|
}
|
|
941
|
-
return
|
|
943
|
+
return context.fs.listSync(filePath).map((file) => resolveEntry(context, {
|
|
942
944
|
file,
|
|
943
945
|
name: typeDefinition.name
|
|
944
946
|
}));
|
|
@@ -2434,7 +2436,7 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
2434
2436
|
async write(path, data = "", options = {}) {
|
|
2435
2437
|
const meta = options.meta ?? {};
|
|
2436
2438
|
const { relativeKey, adapter } = this.#getStorage(options.storage || path);
|
|
2437
|
-
this.#log(LogLevelLabel.TRACE, `Writing ${this.#normalizePath(relativeKey)} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes(new Blob(toArray(data)).size)})`);
|
|
2439
|
+
this.#log(LogLevelLabel.TRACE, `Writing ${this.#normalizePath(relativeKey)} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes(new Blob$1(toArray(data)).size)})`);
|
|
2438
2440
|
let code = data;
|
|
2439
2441
|
try {
|
|
2440
2442
|
if (!options.skipFormat) {
|
|
@@ -2444,7 +2446,7 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
2444
2446
|
this.#log(LogLevelLabel.WARN, `Failed to format file ${this.#normalizePath(path)} before writing: ${err.message}`);
|
|
2445
2447
|
code = data;
|
|
2446
2448
|
}
|
|
2447
|
-
this.#log(LogLevelLabel.TRACE, `Writing ${this.#normalizePath(relativeKey)} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes(new Blob(toArray(code)).size)})`);
|
|
2449
|
+
this.#log(LogLevelLabel.TRACE, `Writing ${this.#normalizePath(relativeKey)} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes(new Blob$1(toArray(code)).size)})`);
|
|
2448
2450
|
const id = this.#normalizeId(meta.id || relativeKey);
|
|
2449
2451
|
this.metadata[id] = {
|
|
2450
2452
|
type: "normal",
|
|
@@ -2466,7 +2468,7 @@ var VirtualFileSystem = class _VirtualFileSystem {
|
|
|
2466
2468
|
writeSync(path, data = "", options = {}) {
|
|
2467
2469
|
const meta = options.meta ?? {};
|
|
2468
2470
|
const { relativeKey, adapter } = this.#getStorage(options.storage || path);
|
|
2469
|
-
this.#log(LogLevelLabel.TRACE, `Writing ${this.#normalizePath(relativeKey)} file to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes(new Blob(toArray(data)).size)})`);
|
|
2471
|
+
this.#log(LogLevelLabel.TRACE, `Writing ${this.#normalizePath(relativeKey)} file to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes(new Blob$1(toArray(data)).size)})`);
|
|
2470
2472
|
const id = this.#normalizeId(meta.id || relativeKey);
|
|
2471
2473
|
this.metadata[id] = {
|
|
2472
2474
|
type: "normal",
|
|
@@ -2813,7 +2815,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2813
2815
|
tsconfig: config.tsconfig,
|
|
2814
2816
|
tsconfigRaw: config.tsconfigRaw,
|
|
2815
2817
|
skipCache: config.skipCache,
|
|
2816
|
-
|
|
2818
|
+
autoInstall: config.autoInstall,
|
|
2817
2819
|
entry: config.entry,
|
|
2818
2820
|
output: config.output,
|
|
2819
2821
|
plugins: config.plugins,
|
|
@@ -4411,7 +4413,7 @@ var PowerlinesAPI = class _PowerlinesAPI {
|
|
|
4411
4413
|
order: "normal"
|
|
4412
4414
|
});
|
|
4413
4415
|
context.debug(`The configuration provided ${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 ? `:
|
|
4414
|
-
${context.entry.map((entry) => `- ${entry.file}${entry.output ? ` -> ${entry.output}` : ""}`).join(" \n")}` : ""}
|
|
4416
|
+
${context.entry.map((entry) => `- ${entry.file}${entry.output ? ` -> ${entry.output}` : ""}`).join(" \n")}` : ""}`);
|
|
4415
4417
|
await resolveTsconfig(context);
|
|
4416
4418
|
await installDependencies(context);
|
|
4417
4419
|
await this.callHook("configResolved", {
|
|
@@ -4970,7 +4972,7 @@ Please ensure the value is one of the following:
|
|
|
4970
4972
|
this.context.config.projectRoot
|
|
4971
4973
|
]
|
|
4972
4974
|
});
|
|
4973
|
-
if (!isInstalled && this.context.config.
|
|
4975
|
+
if (!isInstalled && this.context.config.autoInstall) {
|
|
4974
4976
|
this.#context.warn(`The plugin package "${pluginPath}" is not installed. It will be installed automatically.`);
|
|
4975
4977
|
const result = await install(pluginPath, {
|
|
4976
4978
|
cwd: this.context.config.projectRoot
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkELZHVQRC_js = require('./chunk-ELZHVQRC.js');
|
|
4
4
|
var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
|
|
5
5
|
|
|
6
6
|
// src/executors/clean/executor.ts
|
|
@@ -11,7 +11,7 @@ async function executorFn(context, api) {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
chunkSHUYVCID_js.__name(executorFn, "executorFn");
|
|
14
|
-
var executor =
|
|
14
|
+
var executor = chunkELZHVQRC_js.withExecutor("clean", executorFn);
|
|
15
15
|
var executor_default = executor;
|
|
16
16
|
|
|
17
17
|
exports.executorFn = executorFn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkELZHVQRC_js = require('./chunk-ELZHVQRC.js');
|
|
4
4
|
var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
|
|
5
5
|
var defu = require('defu');
|
|
6
6
|
|
|
@@ -12,14 +12,14 @@ async function executorFn(context, api) {
|
|
|
12
12
|
await api.prepare(defu__default.default({
|
|
13
13
|
command: "prepare",
|
|
14
14
|
skipCache: context.options.skipCache,
|
|
15
|
-
|
|
15
|
+
autoInstall: context.options.autoInstall
|
|
16
16
|
}, context.inlineConfig));
|
|
17
17
|
return {
|
|
18
18
|
success: true
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
chunkSHUYVCID_js.__name(executorFn, "executorFn");
|
|
22
|
-
var executor =
|
|
22
|
+
var executor = chunkELZHVQRC_js.withExecutor("prepare", executorFn);
|
|
23
23
|
var executor_default = executor;
|
|
24
24
|
|
|
25
25
|
exports.executorFn = executorFn;
|
|
@@ -30,9 +30,10 @@ var chalk5 = require('chalk');
|
|
|
30
30
|
var Handlebars = require('handlebars');
|
|
31
31
|
var helperPluginUtils = require('@babel/helper-plugin-utils');
|
|
32
32
|
var t = require('@babel/types');
|
|
33
|
-
var
|
|
34
|
-
var
|
|
33
|
+
var prettyBytes = require('@stryke/string-format/pretty-bytes');
|
|
34
|
+
var share = require('node_modules/@farmfe/core/dist/utils/share');
|
|
35
35
|
var tsMorph = require('ts-morph');
|
|
36
|
+
var types = require('@storm-software/config-tools/types');
|
|
36
37
|
var _package = require('@stryke/string-format/package');
|
|
37
38
|
var superdiff = require('@donedeal0/superdiff');
|
|
38
39
|
var json = require('@stryke/fs/json');
|
|
@@ -40,6 +41,7 @@ var stormJson = require('@stryke/json/storm-json');
|
|
|
40
41
|
var filePathFns = require('@stryke/path/file-path-fns');
|
|
41
42
|
var titleCase = require('@stryke/string-format/title-case');
|
|
42
43
|
var exists = require('@stryke/fs/exists');
|
|
44
|
+
var ts = require('typescript');
|
|
43
45
|
var getEnvPaths = require('@stryke/env/get-env-paths');
|
|
44
46
|
var hashFiles = require('@stryke/hash/hash-files');
|
|
45
47
|
var murmurhash = require('@stryke/hash/murmurhash');
|
|
@@ -61,7 +63,6 @@ var isFile = require('@stryke/fs/is-file');
|
|
|
61
63
|
var $ = require('@stryke/capnp');
|
|
62
64
|
var buffer = require('@stryke/fs/buffer');
|
|
63
65
|
var isType = require('@stryke/path/is-type');
|
|
64
|
-
var prettyBytes = require('@stryke/string-format/pretty-bytes');
|
|
65
66
|
var isRegexp = require('@stryke/type-checks/is-regexp');
|
|
66
67
|
var buffer$1 = require('buffer');
|
|
67
68
|
var url = require('url');
|
|
@@ -106,7 +107,7 @@ var $__namespace = /*#__PURE__*/_interopNamespace($);
|
|
|
106
107
|
|
|
107
108
|
// ../powerlines/package.json
|
|
108
109
|
var package_default = {
|
|
109
|
-
version: "0.37.
|
|
110
|
+
version: "0.37.34"};
|
|
110
111
|
function resolveModulePath(nodePath, state) {
|
|
111
112
|
if (!t__namespace.isStringLiteral(nodePath.node)) {
|
|
112
113
|
return;
|
|
@@ -323,7 +324,7 @@ function formatTypes(code) {
|
|
|
323
324
|
}
|
|
324
325
|
chunkSHUYVCID_js.__name(formatTypes, "formatTypes");
|
|
325
326
|
async function emitTypes(context, files) {
|
|
326
|
-
context.
|
|
327
|
+
context.debug(`Running the TypeScript compiler for ${files.length} generated runtime files.`);
|
|
327
328
|
const program = createProgram(context, {
|
|
328
329
|
skipAddingFilesFromTsConfig: true
|
|
329
330
|
});
|
|
@@ -331,34 +332,35 @@ async function emitTypes(context, files) {
|
|
|
331
332
|
const result = program.emitToMemory({
|
|
332
333
|
emitOnlyDtsFiles: true
|
|
333
334
|
});
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
if (
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
335
|
+
const diagnostics = result.getDiagnostics();
|
|
336
|
+
if (diagnostics && diagnostics.length > 0) {
|
|
337
|
+
if (diagnostics.some((d) => d.getCategory() === tsMorph.DiagnosticCategory.Error)) {
|
|
338
|
+
throw new Error(`The Typescript emit process failed while generating built-in types:
|
|
339
|
+
${diagnostics.filter((d) => d.getCategory() === tsMorph.DiagnosticCategory.Error).map((d) => `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : ""} ${String(d.getMessageText())} (at ${d.getStart()}:${d.getLength()})`).join("\n")}`);
|
|
340
|
+
} else if (diagnostics.some((d) => d.getCategory() === tsMorph.DiagnosticCategory.Warning)) {
|
|
341
|
+
context.warn(`The Typescript emit process completed with warnings while generating built-in types:
|
|
342
|
+
${diagnostics.filter((d) => d.getCategory() === tsMorph.DiagnosticCategory.Warning).map((d) => `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : ""} ${String(d.getMessageText())} (at ${d.getStart()}:${d.getLength()})`).join("\n")}`);
|
|
343
|
+
} else {
|
|
344
|
+
context.debug(`The Typescript emit process completed with diagnostic messages while generating built-in types:
|
|
345
|
+
${diagnostics.map((d) => `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : ""} ${String(d.getMessageText())} (at ${d.getStart()}:${d.getLength()})`).join("\n")}`);
|
|
345
346
|
}
|
|
346
347
|
}
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
348
|
+
const emittedFiles = result.getFiles();
|
|
349
|
+
context.debug(`The TypeScript compiler emitted ${emittedFiles.length} files for built-in types.`);
|
|
350
|
+
let builtinModules = "";
|
|
351
|
+
for (const emittedFile of emittedFiles) {
|
|
352
|
+
if (!emittedFile.filePath.endsWith(".map")) {
|
|
353
|
+
context.trace(`Processing emitted built-in types file: ${emittedFile.filePath}`);
|
|
354
|
+
builtinModules += `
|
|
355
|
+
declare module "${replace.replaceExtension(replace.replacePath(emittedFile.filePath, context.builtinsPath))}" {
|
|
356
|
+
${emittedFile.text.trim().replace(/^\s*export\s*declare\s*/gm, "export ").replace(/^\s*declare\s*/gm, "")}
|
|
357
|
+
}
|
|
358
|
+
`;
|
|
353
359
|
}
|
|
354
|
-
});
|
|
355
|
-
const diagnosticMessage = diagnosticMessages.join("\n");
|
|
356
|
-
if (diagnosticMessage) {
|
|
357
|
-
throw new Error(`TypeScript compilation failed:
|
|
358
|
-
|
|
359
|
-
${diagnosticMessage.length > 5e3 ? `${diagnosticMessage.slice(0, 5e3)}...` : diagnosticMessage}`);
|
|
360
360
|
}
|
|
361
|
-
|
|
361
|
+
builtinModules = formatTypes(builtinModules);
|
|
362
|
+
context.debug(`A TypeScript declaration file (size: ${prettyBytes.prettyBytes(new Blob(share.toArray(builtinModules)).size)}) emitted for the built-in modules types.`);
|
|
363
|
+
return builtinModules;
|
|
362
364
|
}
|
|
363
365
|
chunkSHUYVCID_js.__name(emitTypes, "emitTypes");
|
|
364
366
|
var mergeResults = defu6.createDefu((obj, key, value) => {
|
|
@@ -443,7 +445,7 @@ async function installPackage(context, packageName, dev = false) {
|
|
|
443
445
|
if (!await packageFns.isPackageListed(_package.getPackageName(packageName), {
|
|
444
446
|
cwd: context.config.projectRoot
|
|
445
447
|
})) {
|
|
446
|
-
if (context.config.
|
|
448
|
+
if (context.config.autoInstall) {
|
|
447
449
|
context.log(types.LogLevelLabel.WARN, `The package "${packageName}" is not installed. It will be installed automatically.`);
|
|
448
450
|
const result = await install.install(packageName, {
|
|
449
451
|
cwd: context.config.projectRoot,
|
|
@@ -454,7 +456,7 @@ async function installPackage(context, packageName, dev = false) {
|
|
|
454
456
|
throw new Error(`An error occurred while installing the package "${packageName}"`);
|
|
455
457
|
}
|
|
456
458
|
} else {
|
|
457
|
-
context.log(types.LogLevelLabel.WARN, `The package "${packageName}" is not installed. Since the "
|
|
459
|
+
context.log(types.LogLevelLabel.WARN, `The package "${packageName}" is not installed. Since the "autoInstall" option is set to false, it will not be installed automatically.`);
|
|
458
460
|
}
|
|
459
461
|
} else if (_package.hasPackageVersion(packageName) && !process.env.POWERLINES_SKIP_VERSION_CHECK) {
|
|
460
462
|
const isMatching = await packageFns.doesPackageMatch(_package.getPackageName(packageName), _package.getPackageVersion(packageName), context.config.projectRoot);
|
|
@@ -967,7 +969,7 @@ function resolveEntriesSync(context, typeDefinitions) {
|
|
|
967
969
|
name: typeDefinition.name
|
|
968
970
|
});
|
|
969
971
|
}
|
|
970
|
-
return
|
|
972
|
+
return context.fs.listSync(filePath).map((file) => resolveEntry(context, {
|
|
971
973
|
file,
|
|
972
974
|
name: typeDefinition.name
|
|
973
975
|
}));
|
|
@@ -2842,7 +2844,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2842
2844
|
tsconfig: config.tsconfig,
|
|
2843
2845
|
tsconfigRaw: config.tsconfigRaw,
|
|
2844
2846
|
skipCache: config.skipCache,
|
|
2845
|
-
|
|
2847
|
+
autoInstall: config.autoInstall,
|
|
2846
2848
|
entry: config.entry,
|
|
2847
2849
|
output: config.output,
|
|
2848
2850
|
plugins: config.plugins,
|
|
@@ -4440,7 +4442,7 @@ var PowerlinesAPI = class _PowerlinesAPI {
|
|
|
4440
4442
|
order: "normal"
|
|
4441
4443
|
});
|
|
4442
4444
|
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 ? `:
|
|
4443
|
-
${context.entry.map((entry) => `- ${entry.file}${entry.output ? ` -> ${entry.output}` : ""}`).join(" \n")}` : ""}
|
|
4445
|
+
${context.entry.map((entry) => `- ${entry.file}${entry.output ? ` -> ${entry.output}` : ""}`).join(" \n")}` : ""}`);
|
|
4444
4446
|
await resolveTsconfig(context);
|
|
4445
4447
|
await installDependencies(context);
|
|
4446
4448
|
await this.callHook("configResolved", {
|
|
@@ -4999,7 +5001,7 @@ Please ensure the value is one of the following:
|
|
|
4999
5001
|
this.context.config.projectRoot
|
|
5000
5002
|
]
|
|
5001
5003
|
});
|
|
5002
|
-
if (!isInstalled && this.context.config.
|
|
5004
|
+
if (!isInstalled && this.context.config.autoInstall) {
|
|
5003
5005
|
this.#context.warn(`The plugin package "${pluginPath}" is not installed. It will be installed automatically.`);
|
|
5004
5006
|
const result = await install.install(pluginPath, {
|
|
5005
5007
|
cwd: this.context.config.projectRoot
|
|
@@ -45,11 +45,11 @@ var base_executor_untyped_default = untyped.defineUntypedSchema({
|
|
|
45
45
|
]
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
|
|
48
|
+
autoInstall: {
|
|
49
49
|
$schema: {
|
|
50
|
-
title: "
|
|
50
|
+
title: "Auto Install",
|
|
51
51
|
type: "boolean",
|
|
52
|
-
description: "
|
|
52
|
+
description: "Automatically install dependencies during prepare stage"
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
skipCache: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { withExecutor } from './chunk-
|
|
1
|
+
import { withExecutor } from './chunk-6NUAWMPM.mjs';
|
|
2
2
|
import { __name } from './chunk-O6YSETKJ.mjs';
|
|
3
3
|
import defu from 'defu';
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ async function executorFn(context, api) {
|
|
|
6
6
|
await api.prepare(defu({
|
|
7
7
|
command: "prepare",
|
|
8
8
|
skipCache: context.options.skipCache,
|
|
9
|
-
|
|
9
|
+
autoInstall: context.options.autoInstall
|
|
10
10
|
}, context.inlineConfig));
|
|
11
11
|
return {
|
|
12
12
|
success: true
|
|
@@ -112,7 +112,7 @@ function createNxPlugin(opts) {
|
|
|
112
112
|
options: {
|
|
113
113
|
outputPath: userConfig.output?.outputPath || "dist/{projectRoot}",
|
|
114
114
|
projectType: projectConfig.projectType || userConfig.type,
|
|
115
|
-
|
|
115
|
+
autoInstall: userConfig.autoInstall
|
|
116
116
|
},
|
|
117
117
|
configurations: {
|
|
118
118
|
production: {
|
|
@@ -146,7 +146,7 @@ function createNxPlugin(opts) {
|
|
|
146
146
|
options: {
|
|
147
147
|
entry: userConfig.entry,
|
|
148
148
|
projectType: projectConfig.projectType || userConfig.type,
|
|
149
|
-
|
|
149
|
+
autoInstall: userConfig.autoInstall,
|
|
150
150
|
skipCache: userConfig.skipCache
|
|
151
151
|
},
|
|
152
152
|
configurations: {
|
|
@@ -181,7 +181,7 @@ function createNxPlugin(opts) {
|
|
|
181
181
|
entry: userConfig.entry,
|
|
182
182
|
outputPath: userConfig.output?.outputPath || "dist/{projectRoot}",
|
|
183
183
|
projectType: projectConfig.projectType || userConfig.type,
|
|
184
|
-
|
|
184
|
+
autoInstall: userConfig.autoInstall,
|
|
185
185
|
skipCache: userConfig.skipCache
|
|
186
186
|
},
|
|
187
187
|
configurations: {
|
|
@@ -221,7 +221,7 @@ function createNxPlugin(opts) {
|
|
|
221
221
|
options: {
|
|
222
222
|
entry: userConfig.entry,
|
|
223
223
|
projectType: projectConfig.projectType || userConfig.type,
|
|
224
|
-
|
|
224
|
+
autoInstall: userConfig.autoInstall,
|
|
225
225
|
skipCache: userConfig.skipCache
|
|
226
226
|
},
|
|
227
227
|
configurations: {
|
|
@@ -261,7 +261,7 @@ function createNxPlugin(opts) {
|
|
|
261
261
|
options: {
|
|
262
262
|
entry: userConfig.entry,
|
|
263
263
|
projectType: projectConfig.projectType || userConfig.type,
|
|
264
|
-
|
|
264
|
+
autoInstall: userConfig.autoInstall,
|
|
265
265
|
skipCache: userConfig.skipCache
|
|
266
266
|
},
|
|
267
267
|
configurations: {
|
|
@@ -301,7 +301,7 @@ function createNxPlugin(opts) {
|
|
|
301
301
|
options: {
|
|
302
302
|
entry: userConfig.entry,
|
|
303
303
|
projectType: projectConfig.projectType || userConfig.type,
|
|
304
|
-
|
|
304
|
+
autoInstall: userConfig.autoInstall,
|
|
305
305
|
skipCache: userConfig.skipCache
|
|
306
306
|
},
|
|
307
307
|
configurations: {
|
|
@@ -118,7 +118,7 @@ function createNxPlugin(opts) {
|
|
|
118
118
|
options: {
|
|
119
119
|
outputPath: userConfig.output?.outputPath || "dist/{projectRoot}",
|
|
120
120
|
projectType: projectConfig.projectType || userConfig.type,
|
|
121
|
-
|
|
121
|
+
autoInstall: userConfig.autoInstall
|
|
122
122
|
},
|
|
123
123
|
configurations: {
|
|
124
124
|
production: {
|
|
@@ -152,7 +152,7 @@ function createNxPlugin(opts) {
|
|
|
152
152
|
options: {
|
|
153
153
|
entry: userConfig.entry,
|
|
154
154
|
projectType: projectConfig.projectType || userConfig.type,
|
|
155
|
-
|
|
155
|
+
autoInstall: userConfig.autoInstall,
|
|
156
156
|
skipCache: userConfig.skipCache
|
|
157
157
|
},
|
|
158
158
|
configurations: {
|
|
@@ -187,7 +187,7 @@ function createNxPlugin(opts) {
|
|
|
187
187
|
entry: userConfig.entry,
|
|
188
188
|
outputPath: userConfig.output?.outputPath || "dist/{projectRoot}",
|
|
189
189
|
projectType: projectConfig.projectType || userConfig.type,
|
|
190
|
-
|
|
190
|
+
autoInstall: userConfig.autoInstall,
|
|
191
191
|
skipCache: userConfig.skipCache
|
|
192
192
|
},
|
|
193
193
|
configurations: {
|
|
@@ -227,7 +227,7 @@ function createNxPlugin(opts) {
|
|
|
227
227
|
options: {
|
|
228
228
|
entry: userConfig.entry,
|
|
229
229
|
projectType: projectConfig.projectType || userConfig.type,
|
|
230
|
-
|
|
230
|
+
autoInstall: userConfig.autoInstall,
|
|
231
231
|
skipCache: userConfig.skipCache
|
|
232
232
|
},
|
|
233
233
|
configurations: {
|
|
@@ -267,7 +267,7 @@ function createNxPlugin(opts) {
|
|
|
267
267
|
options: {
|
|
268
268
|
entry: userConfig.entry,
|
|
269
269
|
projectType: projectConfig.projectType || userConfig.type,
|
|
270
|
-
|
|
270
|
+
autoInstall: userConfig.autoInstall,
|
|
271
271
|
skipCache: userConfig.skipCache
|
|
272
272
|
},
|
|
273
273
|
configurations: {
|
|
@@ -307,7 +307,7 @@ function createNxPlugin(opts) {
|
|
|
307
307
|
options: {
|
|
308
308
|
entry: userConfig.entry,
|
|
309
309
|
projectType: projectConfig.projectType || userConfig.type,
|
|
310
|
-
|
|
310
|
+
autoInstall: userConfig.autoInstall,
|
|
311
311
|
skipCache: userConfig.skipCache
|
|
312
312
|
},
|
|
313
313
|
configurations: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkELZHVQRC_js = require('./chunk-ELZHVQRC.js');
|
|
4
4
|
var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
|
|
5
5
|
|
|
6
6
|
// src/executors/lint/executor.ts
|
|
@@ -11,7 +11,7 @@ async function executorFn(context, api) {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
chunkSHUYVCID_js.__name(executorFn, "executorFn");
|
|
14
|
-
var executor =
|
|
14
|
+
var executor = chunkELZHVQRC_js.withExecutor("lint", executorFn);
|
|
15
15
|
var executor_default = executor;
|
|
16
16
|
|
|
17
17
|
exports.executorFn = executorFn;
|