@powerlines/nx 0.11.212 → 0.11.214
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 +12 -0
- package/dist/{chunk-YAU4VWTI.mjs → chunk-2WJBBANZ.mjs} +1 -1
- package/dist/{chunk-ZDAXSLBQ.js → chunk-7VQI63XV.js} +2 -2
- package/dist/{chunk-P7336MS6.mjs → chunk-C2QU2QP6.mjs} +1 -1
- package/dist/{chunk-T7X3ARNH.js → chunk-EQL4JDSC.js} +2 -2
- package/dist/{chunk-PIPXZTQ4.js → chunk-N3IEG3T5.js} +2 -2
- package/dist/{chunk-IXWGWKQW.mjs → chunk-OQLAJNR4.mjs} +1 -1
- package/dist/{chunk-QSORNZHH.mjs → chunk-PJK4VPGU.mjs} +1 -1
- package/dist/{chunk-VPKY2ES2.mjs → chunk-R6RVZI3W.mjs} +206 -178
- package/dist/{chunk-CZMHZKJ2.js → chunk-SCT3TD5X.js} +206 -178
- package/dist/{chunk-47EZNKRS.js → chunk-Z3J6TUMI.js} +2 -2
- package/dist/{chunk-OOHNZ6U5.mjs → chunk-ZNGUNE5Z.mjs} +1 -1
- package/dist/{chunk-BPBARX7E.js → chunk-ZPSEUVGR.js} +2 -2
- package/dist/executors.js +11 -11
- package/dist/executors.mjs +6 -6
- package/dist/index.js +11 -11
- package/dist/index.mjs +6 -6
- package/dist/src/base/base-executor.js +2 -2
- package/dist/src/base/base-executor.mjs +1 -1
- package/dist/src/executors/build/executor.js +4 -4
- package/dist/src/executors/build/executor.mjs +2 -2
- package/dist/src/executors/clean/executor.js +4 -4
- package/dist/src/executors/clean/executor.mjs +2 -2
- package/dist/src/executors/docs/executor.js +4 -4
- package/dist/src/executors/docs/executor.mjs +2 -2
- package/dist/src/executors/lint/executor.js +4 -4
- package/dist/src/executors/lint/executor.mjs +2 -2
- package/dist/src/executors/prepare/executor.js +4 -4
- package/dist/src/executors/prepare/executor.mjs +2 -2
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Powerlines - Nx
|
|
4
4
|
|
|
5
|
+
## [0.11.213](https://github.com/storm-software/powerlines/releases/tag/nx%400.11.213) (02/19/2026)
|
|
6
|
+
|
|
7
|
+
### Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated **powerlines** to **v0.38.53**
|
|
10
|
+
|
|
11
|
+
## [0.11.212](https://github.com/storm-software/powerlines/releases/tag/nx%400.11.212) (02/19/2026)
|
|
12
|
+
|
|
13
|
+
### Updated Dependencies
|
|
14
|
+
|
|
15
|
+
- Updated **powerlines** to **v0.38.52**
|
|
16
|
+
|
|
5
17
|
## [0.11.211](https://github.com/storm-software/powerlines/releases/tag/nx%400.11.211) (02/19/2026)
|
|
6
18
|
|
|
7
19
|
### Updated Dependencies
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSCT3TD5X_js = require('./chunk-SCT3TD5X.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 = chunkSCT3TD5X_js.withExecutor("lint", 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 chunkSCT3TD5X_js = require('./chunk-SCT3TD5X.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 = chunkSCT3TD5X_js.withExecutor("prepare", executorFn);
|
|
23
23
|
var executor_default = executor;
|
|
24
24
|
|
|
25
25
|
exports.executorFn = executorFn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSCT3TD5X_js = require('./chunk-SCT3TD5X.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 = chunkSCT3TD5X_js.withExecutor("build", executorFn);
|
|
23
23
|
var executor_default = executor;
|
|
24
24
|
|
|
25
25
|
exports.executorFn = executorFn;
|
|
@@ -30,6 +30,7 @@ import { hasFileExtension, findFilePath, findFileName, findFileExtensionSafe, fi
|
|
|
30
30
|
import { isParentPath } from '@stryke/path/is-parent-path';
|
|
31
31
|
import { prettyBytes } from '@stryke/string-format/pretty-bytes';
|
|
32
32
|
import { InMemoryFileSystemHost, Project, DiagnosticCategory } from 'ts-morph';
|
|
33
|
+
import { isUndefined } from '@stryke/type-checks/is-undefined';
|
|
33
34
|
import { getPackageName, hasPackageVersion, getPackageVersion } from '@stryke/string-format/package';
|
|
34
35
|
import { getObjectDiff } from '@donedeal0/superdiff';
|
|
35
36
|
import { readJsonFile, readJsonFileSync } from '@stryke/fs/json';
|
|
@@ -52,7 +53,6 @@ import { create } from 'flat-cache';
|
|
|
52
53
|
import { parse } from 'oxc-parser';
|
|
53
54
|
import { Agent, setGlobalDispatcher, interceptors, Response } from 'undici';
|
|
54
55
|
import { createJiti } from 'jiti';
|
|
55
|
-
import { isUndefined } from '@stryke/type-checks/is-undefined';
|
|
56
56
|
import { parseTypeDefinition } from '@stryke/convert/parse-type-definition';
|
|
57
57
|
import { isAbsolutePath } from '@stryke/path/is-type';
|
|
58
58
|
import * as $ from '@stryke/capnp';
|
|
@@ -76,7 +76,7 @@ import { resolve } from 'node:path';
|
|
|
76
76
|
|
|
77
77
|
// ../powerlines/package.json
|
|
78
78
|
var package_default = {
|
|
79
|
-
version: "0.38.
|
|
79
|
+
version: "0.38.53"};
|
|
80
80
|
var VirtualFileSystemHost = class extends InMemoryFileSystemHost {
|
|
81
81
|
static {
|
|
82
82
|
__name(this, "VirtualFileSystemHost");
|
|
@@ -253,7 +253,175 @@ declare module "${moduleId}" {
|
|
|
253
253
|
return builtinModules;
|
|
254
254
|
}
|
|
255
255
|
__name(emitBuiltinTypes, "emitBuiltinTypes");
|
|
256
|
-
|
|
256
|
+
|
|
257
|
+
// ../powerlines/src/types/build.ts
|
|
258
|
+
var UNPLUGIN_BUILDER_VARIANTS = [
|
|
259
|
+
"rollup",
|
|
260
|
+
"webpack",
|
|
261
|
+
"rspack",
|
|
262
|
+
"vite",
|
|
263
|
+
"esbuild",
|
|
264
|
+
"farm",
|
|
265
|
+
"unloader",
|
|
266
|
+
"rolldown",
|
|
267
|
+
"bun"
|
|
268
|
+
];
|
|
269
|
+
var BUILDER_VARIANTS = [
|
|
270
|
+
...UNPLUGIN_BUILDER_VARIANTS,
|
|
271
|
+
"tsup",
|
|
272
|
+
"tsdown",
|
|
273
|
+
"unbuild"
|
|
274
|
+
];
|
|
275
|
+
|
|
276
|
+
// ../powerlines/src/types/commands.ts
|
|
277
|
+
var SUPPORTED_COMMANDS = [
|
|
278
|
+
"new",
|
|
279
|
+
"clean",
|
|
280
|
+
"prepare",
|
|
281
|
+
"lint",
|
|
282
|
+
"test",
|
|
283
|
+
"build",
|
|
284
|
+
"docs",
|
|
285
|
+
"deploy",
|
|
286
|
+
"finalize"
|
|
287
|
+
];
|
|
288
|
+
|
|
289
|
+
// ../powerlines/src/types/plugin.ts
|
|
290
|
+
var PLUGIN_NON_HOOK_FIELDS = [
|
|
291
|
+
"name",
|
|
292
|
+
"api",
|
|
293
|
+
"enforce",
|
|
294
|
+
"dedupe",
|
|
295
|
+
"applyToEnvironment"
|
|
296
|
+
];
|
|
297
|
+
var PLUGIN_HOOKS_FIELDS = [
|
|
298
|
+
...SUPPORTED_COMMANDS,
|
|
299
|
+
"config",
|
|
300
|
+
"configEnvironment",
|
|
301
|
+
"configResolved",
|
|
302
|
+
"types",
|
|
303
|
+
"buildStart",
|
|
304
|
+
"buildEnd",
|
|
305
|
+
"transform",
|
|
306
|
+
"load",
|
|
307
|
+
"resolveId",
|
|
308
|
+
"writeBundle"
|
|
309
|
+
];
|
|
310
|
+
|
|
311
|
+
// ../powerlines/src/plugin-utils/helpers.ts
|
|
312
|
+
function isPlugin(value) {
|
|
313
|
+
return isSetObject(value) && "name" in value && isSetString(value.name) && (isUndefined(value.api) || "api" in value && isSetObject(value.api)) && (isUndefined(value.applyToEnvironment) || "applyToEnvironment" in value && isFunction(value.applyToEnvironment)) && (isUndefined(value.dedupe) || "dedupe" in value && isFunction(value.dedupe)) && PLUGIN_HOOKS_FIELDS.every((hook) => isUndefined(value[hook]) || hook in value && (isPluginHookFunction(value[hook]) || hook === "config" && isSetObject(value[hook]))) && BUILDER_VARIANTS.every((variant) => isUndefined(value[variant]) || variant in value && isSetObject(value[variant]));
|
|
314
|
+
}
|
|
315
|
+
__name(isPlugin, "isPlugin");
|
|
316
|
+
function isPluginConfigObject(value) {
|
|
317
|
+
return isSetObject(value) && "plugin" in value && ((isSetString(value.plugin) || isFunction(value.plugin)) && "options" in value && isSetObject(value.options) || isPlugin(value.plugin));
|
|
318
|
+
}
|
|
319
|
+
__name(isPluginConfigObject, "isPluginConfigObject");
|
|
320
|
+
function isPluginConfigTuple(value) {
|
|
321
|
+
return Array.isArray(value) && (value.length === 1 || value.length === 2) && ((isSetString(value[0]) || isFunction(value[0])) && value.length > 1 && isSetObject(value[1]) || isPlugin(value[0]));
|
|
322
|
+
}
|
|
323
|
+
__name(isPluginConfigTuple, "isPluginConfigTuple");
|
|
324
|
+
function isPluginConfig(value) {
|
|
325
|
+
return isSetString(value) || isFunction(value) || isPlugin(value) || isPluginConfigObject(value) || isPluginConfigTuple(value) || Array.isArray(value) && value.every((item) => isPluginConfig(item));
|
|
326
|
+
}
|
|
327
|
+
__name(isPluginConfig, "isPluginConfig");
|
|
328
|
+
function isPluginHookObject(value) {
|
|
329
|
+
return isSetObject(value) && "handler" in value && isFunction(value.handler);
|
|
330
|
+
}
|
|
331
|
+
__name(isPluginHookObject, "isPluginHookObject");
|
|
332
|
+
function isPluginHookFunction(value) {
|
|
333
|
+
return isFunction(value) || isPluginHookObject(value);
|
|
334
|
+
}
|
|
335
|
+
__name(isPluginHookFunction, "isPluginHookFunction");
|
|
336
|
+
function isPluginHook(value) {
|
|
337
|
+
return isPluginHookFunction(value) || isPluginHookObject(value);
|
|
338
|
+
}
|
|
339
|
+
__name(isPluginHook, "isPluginHook");
|
|
340
|
+
function getHookHandler(pluginHook) {
|
|
341
|
+
return isFunction(pluginHook) ? pluginHook : pluginHook.handler;
|
|
342
|
+
}
|
|
343
|
+
__name(getHookHandler, "getHookHandler");
|
|
344
|
+
function isUnpluginHookKey(keys) {
|
|
345
|
+
return UNPLUGIN_BUILDER_VARIANTS.some((variant) => keys.startsWith(`${variant}:`));
|
|
346
|
+
}
|
|
347
|
+
__name(isUnpluginHookKey, "isUnpluginHookKey");
|
|
348
|
+
function isPluginHookField(keys) {
|
|
349
|
+
return !isUnpluginHookKey(keys) && PLUGIN_HOOKS_FIELDS.includes(keys);
|
|
350
|
+
}
|
|
351
|
+
__name(isPluginHookField, "isPluginHookField");
|
|
352
|
+
function isUnpluginHookField(field) {
|
|
353
|
+
return !isPluginHookField(field) && UNPLUGIN_BUILDER_VARIANTS.includes(field);
|
|
354
|
+
}
|
|
355
|
+
__name(isUnpluginHookField, "isUnpluginHookField");
|
|
356
|
+
function checkDedupe(plugin, plugins) {
|
|
357
|
+
return plugin.dedupe === false || plugins.some((p) => p.dedupe !== false && (isFunction(p.dedupe) && p.dedupe(plugin) || p.name === plugin.name));
|
|
358
|
+
}
|
|
359
|
+
__name(checkDedupe, "checkDedupe");
|
|
360
|
+
function addPluginHook(context, plugin, pluginHook, hooksList) {
|
|
361
|
+
if (!checkDedupe(plugin, hooksList.map((hook) => hook.plugin).filter(Boolean))) {
|
|
362
|
+
const handler = /* @__PURE__ */ __name((...args) => getHookHandler(pluginHook).apply(context, args), "handler");
|
|
363
|
+
if (!handler) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
hooksList.push({
|
|
367
|
+
plugin,
|
|
368
|
+
handler
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
__name(addPluginHook, "addPluginHook");
|
|
373
|
+
function findInvalidPluginConfig(config) {
|
|
374
|
+
if (isPluginConfig(config)) {
|
|
375
|
+
return null;
|
|
376
|
+
}
|
|
377
|
+
if (Array.isArray(config)) {
|
|
378
|
+
const invalidItems = [];
|
|
379
|
+
config.forEach((item) => {
|
|
380
|
+
const invalid = findInvalidPluginConfig(item);
|
|
381
|
+
if (invalid) {
|
|
382
|
+
invalidItems.push(...invalid.map((i) => JSON.stringify(i, null, 2)));
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
return invalidItems.length > 0 ? invalidItems : null;
|
|
386
|
+
}
|
|
387
|
+
return [
|
|
388
|
+
JSON.stringify(config, null, 2)
|
|
389
|
+
];
|
|
390
|
+
}
|
|
391
|
+
__name(findInvalidPluginConfig, "findInvalidPluginConfig");
|
|
392
|
+
|
|
393
|
+
// ../powerlines/src/plugin-utils/merge.ts
|
|
394
|
+
createDefu((obj, key, value) => {
|
|
395
|
+
if (isPluginHook(obj[key]) && isPluginHook(value)) {
|
|
396
|
+
obj[key] = {
|
|
397
|
+
...obj[key],
|
|
398
|
+
...value,
|
|
399
|
+
handler: /* @__PURE__ */ __name(async (...params) => {
|
|
400
|
+
const [resultA, resultB] = await Promise.all([
|
|
401
|
+
// eslint-disable-next-line ts/no-unsafe-call
|
|
402
|
+
getHookHandler(obj[key])(...params),
|
|
403
|
+
// eslint-disable-next-line ts/no-unsafe-call
|
|
404
|
+
getHookHandler(value)(...params)
|
|
405
|
+
]);
|
|
406
|
+
return resultB && resultA ? defu7(resultA, resultB) : resultA || resultB;
|
|
407
|
+
}, "handler")
|
|
408
|
+
};
|
|
409
|
+
return true;
|
|
410
|
+
}
|
|
411
|
+
return false;
|
|
412
|
+
});
|
|
413
|
+
var mergeConfig = createDefu((obj, key, value) => {
|
|
414
|
+
if (isString(obj[key]) && isString(value)) {
|
|
415
|
+
if (isSetString(value)) {
|
|
416
|
+
obj[key] = value;
|
|
417
|
+
}
|
|
418
|
+
return true;
|
|
419
|
+
}
|
|
420
|
+
return false;
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
// ../powerlines/src/internal/helpers/hooks.ts
|
|
424
|
+
var mergeResultObjects = createDefu((obj, key, value) => {
|
|
257
425
|
if (isString(obj[key]) && isString(value)) {
|
|
258
426
|
obj[key] = `${obj[key] || ""}
|
|
259
427
|
${value || ""}`.trim();
|
|
@@ -261,6 +429,34 @@ ${value || ""}`.trim();
|
|
|
261
429
|
}
|
|
262
430
|
return false;
|
|
263
431
|
});
|
|
432
|
+
function mergeResults(currentResult, previousResults) {
|
|
433
|
+
if (isString(currentResult)) {
|
|
434
|
+
previousResults = [
|
|
435
|
+
`${isString(previousResults[0]) ? previousResults[0] || "" : ""}
|
|
436
|
+
${currentResult || ""}`.trim()
|
|
437
|
+
];
|
|
438
|
+
} else if (isObject(currentResult)) {
|
|
439
|
+
previousResults = [
|
|
440
|
+
mergeResultObjects(currentResult, previousResults[0] ?? {})
|
|
441
|
+
];
|
|
442
|
+
}
|
|
443
|
+
return previousResults;
|
|
444
|
+
}
|
|
445
|
+
__name(mergeResults, "mergeResults");
|
|
446
|
+
function mergeConfigs(currentResult, previousResults) {
|
|
447
|
+
if (isString(currentResult)) {
|
|
448
|
+
previousResults = [
|
|
449
|
+
`${isString(previousResults[0]) ? previousResults[0] || "" : ""}
|
|
450
|
+
${currentResult || ""}`.trim()
|
|
451
|
+
];
|
|
452
|
+
} else if (isObject(currentResult)) {
|
|
453
|
+
previousResults = [
|
|
454
|
+
mergeConfig(currentResult, previousResults[0] ?? {})
|
|
455
|
+
];
|
|
456
|
+
}
|
|
457
|
+
return previousResults;
|
|
458
|
+
}
|
|
459
|
+
__name(mergeConfigs, "mergeConfigs");
|
|
264
460
|
async function callHook(context, key, options, ...args) {
|
|
265
461
|
const hooks = context.selectHooks(key, options);
|
|
266
462
|
if (hooks.length > 0) {
|
|
@@ -301,19 +497,14 @@ async function callHook(context, key, options, ...args) {
|
|
|
301
497
|
...sequenceArgs
|
|
302
498
|
]));
|
|
303
499
|
if (result) {
|
|
304
|
-
if (options
|
|
500
|
+
if (options.result === "last") {
|
|
305
501
|
results = [
|
|
306
502
|
result
|
|
307
503
|
];
|
|
308
|
-
} else if (
|
|
309
|
-
results =
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
];
|
|
313
|
-
} else if (isObject(result)) {
|
|
314
|
-
results = [
|
|
315
|
-
mergeResults(result, results[0] ?? {})
|
|
316
|
-
];
|
|
504
|
+
} else if (options.result === "merge" && options.merge) {
|
|
505
|
+
results = options.merge(result, results);
|
|
506
|
+
} else {
|
|
507
|
+
results = mergeResults(result, results);
|
|
317
508
|
}
|
|
318
509
|
}
|
|
319
510
|
}
|
|
@@ -662,170 +853,6 @@ function createResolver(options) {
|
|
|
662
853
|
return baseResolver;
|
|
663
854
|
}
|
|
664
855
|
__name(createResolver, "createResolver");
|
|
665
|
-
|
|
666
|
-
// ../powerlines/src/types/build.ts
|
|
667
|
-
var UNPLUGIN_BUILDER_VARIANTS = [
|
|
668
|
-
"rollup",
|
|
669
|
-
"webpack",
|
|
670
|
-
"rspack",
|
|
671
|
-
"vite",
|
|
672
|
-
"esbuild",
|
|
673
|
-
"farm",
|
|
674
|
-
"unloader",
|
|
675
|
-
"rolldown",
|
|
676
|
-
"bun"
|
|
677
|
-
];
|
|
678
|
-
var BUILDER_VARIANTS = [
|
|
679
|
-
...UNPLUGIN_BUILDER_VARIANTS,
|
|
680
|
-
"tsup",
|
|
681
|
-
"tsdown",
|
|
682
|
-
"unbuild"
|
|
683
|
-
];
|
|
684
|
-
|
|
685
|
-
// ../powerlines/src/types/commands.ts
|
|
686
|
-
var SUPPORTED_COMMANDS = [
|
|
687
|
-
"new",
|
|
688
|
-
"clean",
|
|
689
|
-
"prepare",
|
|
690
|
-
"lint",
|
|
691
|
-
"test",
|
|
692
|
-
"build",
|
|
693
|
-
"docs",
|
|
694
|
-
"deploy",
|
|
695
|
-
"finalize"
|
|
696
|
-
];
|
|
697
|
-
|
|
698
|
-
// ../powerlines/src/types/plugin.ts
|
|
699
|
-
var PLUGIN_NON_HOOK_FIELDS = [
|
|
700
|
-
"name",
|
|
701
|
-
"api",
|
|
702
|
-
"enforce",
|
|
703
|
-
"dedupe",
|
|
704
|
-
"applyToEnvironment"
|
|
705
|
-
];
|
|
706
|
-
var PLUGIN_HOOKS_FIELDS = [
|
|
707
|
-
...SUPPORTED_COMMANDS,
|
|
708
|
-
"config",
|
|
709
|
-
"configEnvironment",
|
|
710
|
-
"configResolved",
|
|
711
|
-
"types",
|
|
712
|
-
"buildStart",
|
|
713
|
-
"buildEnd",
|
|
714
|
-
"transform",
|
|
715
|
-
"load",
|
|
716
|
-
"resolveId",
|
|
717
|
-
"writeBundle"
|
|
718
|
-
];
|
|
719
|
-
|
|
720
|
-
// ../powerlines/src/plugin-utils/helpers.ts
|
|
721
|
-
function isPlugin(value) {
|
|
722
|
-
return isSetObject(value) && "name" in value && isSetString(value.name) && (isUndefined(value.api) || "api" in value && isSetObject(value.api)) && (isUndefined(value.applyToEnvironment) || "applyToEnvironment" in value && isFunction(value.applyToEnvironment)) && (isUndefined(value.dedupe) || "dedupe" in value && isFunction(value.dedupe)) && PLUGIN_HOOKS_FIELDS.every((hook) => isUndefined(value[hook]) || hook in value && (isPluginHookFunction(value[hook]) || hook === "config" && isSetObject(value[hook]))) && BUILDER_VARIANTS.every((variant) => isUndefined(value[variant]) || variant in value && isSetObject(value[variant]));
|
|
723
|
-
}
|
|
724
|
-
__name(isPlugin, "isPlugin");
|
|
725
|
-
function isPluginConfigObject(value) {
|
|
726
|
-
return isSetObject(value) && "plugin" in value && ((isSetString(value.plugin) || isFunction(value.plugin)) && "options" in value && isSetObject(value.options) || isPlugin(value.plugin));
|
|
727
|
-
}
|
|
728
|
-
__name(isPluginConfigObject, "isPluginConfigObject");
|
|
729
|
-
function isPluginConfigTuple(value) {
|
|
730
|
-
return Array.isArray(value) && (value.length === 1 || value.length === 2) && ((isSetString(value[0]) || isFunction(value[0])) && value.length > 1 && isSetObject(value[1]) || isPlugin(value[0]));
|
|
731
|
-
}
|
|
732
|
-
__name(isPluginConfigTuple, "isPluginConfigTuple");
|
|
733
|
-
function isPluginConfig(value) {
|
|
734
|
-
return isSetString(value) || isFunction(value) || isPlugin(value) || isPluginConfigObject(value) || isPluginConfigTuple(value) || Array.isArray(value) && value.every((item) => isPluginConfig(item));
|
|
735
|
-
}
|
|
736
|
-
__name(isPluginConfig, "isPluginConfig");
|
|
737
|
-
function isPluginHookObject(value) {
|
|
738
|
-
return isSetObject(value) && "handler" in value && isFunction(value.handler);
|
|
739
|
-
}
|
|
740
|
-
__name(isPluginHookObject, "isPluginHookObject");
|
|
741
|
-
function isPluginHookFunction(value) {
|
|
742
|
-
return isFunction(value) || isPluginHookObject(value);
|
|
743
|
-
}
|
|
744
|
-
__name(isPluginHookFunction, "isPluginHookFunction");
|
|
745
|
-
function isPluginHook(value) {
|
|
746
|
-
return isPluginHookFunction(value) || isPluginHookObject(value);
|
|
747
|
-
}
|
|
748
|
-
__name(isPluginHook, "isPluginHook");
|
|
749
|
-
function getHookHandler(pluginHook) {
|
|
750
|
-
return isFunction(pluginHook) ? pluginHook : pluginHook.handler;
|
|
751
|
-
}
|
|
752
|
-
__name(getHookHandler, "getHookHandler");
|
|
753
|
-
function isUnpluginHookKey(keys) {
|
|
754
|
-
return UNPLUGIN_BUILDER_VARIANTS.some((variant) => keys.startsWith(`${variant}:`));
|
|
755
|
-
}
|
|
756
|
-
__name(isUnpluginHookKey, "isUnpluginHookKey");
|
|
757
|
-
function isPluginHookField(keys) {
|
|
758
|
-
return !isUnpluginHookKey(keys) && PLUGIN_HOOKS_FIELDS.includes(keys);
|
|
759
|
-
}
|
|
760
|
-
__name(isPluginHookField, "isPluginHookField");
|
|
761
|
-
function isUnpluginHookField(field) {
|
|
762
|
-
return !isPluginHookField(field) && UNPLUGIN_BUILDER_VARIANTS.includes(field);
|
|
763
|
-
}
|
|
764
|
-
__name(isUnpluginHookField, "isUnpluginHookField");
|
|
765
|
-
function checkDedupe(plugin, plugins) {
|
|
766
|
-
return plugin.dedupe === false || plugins.some((p) => p.dedupe !== false && (isFunction(p.dedupe) && p.dedupe(plugin) || p.name === plugin.name));
|
|
767
|
-
}
|
|
768
|
-
__name(checkDedupe, "checkDedupe");
|
|
769
|
-
function addPluginHook(context, plugin, pluginHook, hooksList) {
|
|
770
|
-
if (!checkDedupe(plugin, hooksList.map((hook) => hook.plugin).filter(Boolean))) {
|
|
771
|
-
const handler = /* @__PURE__ */ __name((...args) => getHookHandler(pluginHook).apply(context, args), "handler");
|
|
772
|
-
if (!handler) {
|
|
773
|
-
return;
|
|
774
|
-
}
|
|
775
|
-
hooksList.push({
|
|
776
|
-
plugin,
|
|
777
|
-
handler
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
__name(addPluginHook, "addPluginHook");
|
|
782
|
-
function findInvalidPluginConfig(config) {
|
|
783
|
-
if (isPluginConfig(config)) {
|
|
784
|
-
return null;
|
|
785
|
-
}
|
|
786
|
-
if (Array.isArray(config)) {
|
|
787
|
-
const invalidItems = [];
|
|
788
|
-
config.forEach((item) => {
|
|
789
|
-
const invalid = findInvalidPluginConfig(item);
|
|
790
|
-
if (invalid) {
|
|
791
|
-
invalidItems.push(...invalid.map((i) => JSON.stringify(i, null, 2)));
|
|
792
|
-
}
|
|
793
|
-
});
|
|
794
|
-
return invalidItems.length > 0 ? invalidItems : null;
|
|
795
|
-
}
|
|
796
|
-
return [
|
|
797
|
-
JSON.stringify(config, null, 2)
|
|
798
|
-
];
|
|
799
|
-
}
|
|
800
|
-
__name(findInvalidPluginConfig, "findInvalidPluginConfig");
|
|
801
|
-
createDefu((obj, key, value) => {
|
|
802
|
-
if (isPluginHook(obj[key]) && isPluginHook(value)) {
|
|
803
|
-
obj[key] = {
|
|
804
|
-
...obj[key],
|
|
805
|
-
...value,
|
|
806
|
-
handler: /* @__PURE__ */ __name(async (...params) => {
|
|
807
|
-
const [resultA, resultB] = await Promise.all([
|
|
808
|
-
// eslint-disable-next-line ts/no-unsafe-call
|
|
809
|
-
getHookHandler(obj[key])(...params),
|
|
810
|
-
// eslint-disable-next-line ts/no-unsafe-call
|
|
811
|
-
getHookHandler(value)(...params)
|
|
812
|
-
]);
|
|
813
|
-
return resultB && resultA ? defu7(resultA, resultB) : resultA || resultB;
|
|
814
|
-
}, "handler")
|
|
815
|
-
};
|
|
816
|
-
return true;
|
|
817
|
-
}
|
|
818
|
-
return false;
|
|
819
|
-
});
|
|
820
|
-
var mergeConfig = createDefu((obj, key, value) => {
|
|
821
|
-
if (isString(obj[key]) && isString(value)) {
|
|
822
|
-
if (isSetString(value)) {
|
|
823
|
-
obj[key] = value;
|
|
824
|
-
}
|
|
825
|
-
return true;
|
|
826
|
-
}
|
|
827
|
-
return false;
|
|
828
|
-
});
|
|
829
856
|
function replacePathTokens(context, path) {
|
|
830
857
|
if (!path) {
|
|
831
858
|
return path;
|
|
@@ -4367,7 +4394,8 @@ var PowerlinesAPI = class _PowerlinesAPI {
|
|
|
4367
4394
|
const pluginConfig = await api.callHook("config", {
|
|
4368
4395
|
environment: await api.context.getEnvironment(),
|
|
4369
4396
|
sequential: true,
|
|
4370
|
-
result: "merge"
|
|
4397
|
+
result: "merge",
|
|
4398
|
+
merge: mergeConfigs
|
|
4371
4399
|
});
|
|
4372
4400
|
await api.context.withUserConfig(pluginConfig, {
|
|
4373
4401
|
isHighPriority: false
|