powerlines 0.24.3 → 0.24.5
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-2DHR5VPL.js → chunk-4YOH66OR.js} +1 -1
- package/dist/{chunk-VO7UNY6U.js → chunk-5VVIGLK7.js} +36 -65
- package/dist/{chunk-AOAZS3KU.js → chunk-6F2RGMWO.js} +1 -1
- package/dist/{chunk-DMV2VN3N.cjs → chunk-D7IZZTKR.cjs} +2 -2
- package/dist/{chunk-WG76FEAR.js → chunk-E2CYWY4C.js} +1 -1
- package/dist/{chunk-37PJDPER.cjs → chunk-J42CWDHS.cjs} +3 -3
- package/dist/{chunk-YWDLT2K5.cjs → chunk-MBWFPGQL.cjs} +2 -2
- package/dist/{chunk-XFPLVPMF.cjs → chunk-MWURGZO3.cjs} +44 -73
- package/dist/{chunk-MR2ARFN4.js → chunk-RUNRTWUD.js} +1 -1
- package/dist/{chunk-WJQX2T36.cjs → chunk-TSGTSGEL.cjs} +2 -2
- 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 +11 -11
- package/dist/index.js +2 -2
- package/dist/lib/{chunk-LDMWUKGL.js → chunk-B6MVU5AR.js} +1 -1
- package/dist/lib/{chunk-VSN5AZP5.cjs → chunk-FSV2WXHS.cjs} +4 -4
- package/dist/lib/{chunk-BQU53ZNB.cjs → chunk-GA3RXX4R.cjs} +24 -7
- package/dist/lib/{chunk-3HVJF7CD.js → chunk-HQ7626MD.js} +2 -2
- package/dist/lib/{chunk-NKV4KVFI.js → chunk-IRIEW3X6.js} +15 -59
- package/dist/lib/{chunk-RJLPU6PQ.js → chunk-JFHYBGFE.js} +2 -1
- package/dist/lib/{chunk-PPUZYUCI.cjs → chunk-QOS4T645.cjs} +2 -1
- package/dist/lib/{chunk-4YERLWXX.cjs → chunk-SJCNXDNU.cjs} +38 -82
- package/dist/lib/{chunk-YOENMDZY.js → chunk-ZGMEHSNN.js} +24 -8
- package/dist/lib/{chunk-INSBEK3W.cjs → chunk-ZTI2BIQ4.cjs} +10 -10
- package/dist/lib/contexts/api-context.cjs +5 -4
- package/dist/lib/contexts/api-context.js +4 -3
- package/dist/lib/contexts/context.cjs +3 -2
- package/dist/lib/contexts/context.js +2 -1
- package/dist/lib/contexts/environment-context.cjs +4 -3
- package/dist/lib/contexts/environment-context.js +3 -2
- package/dist/lib/contexts/index.cjs +7 -6
- package/dist/lib/contexts/index.js +4 -3
- package/dist/lib/index.cjs +38 -34
- package/dist/lib/index.d.cts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +5 -5
- package/dist/lib/typescript/compiler-host.cjs +2 -2
- package/dist/lib/typescript/compiler-host.js +1 -1
- package/dist/lib/typescript/index.cjs +29 -25
- package/dist/lib/typescript/index.d.cts +1 -1
- package/dist/lib/typescript/index.d.ts +1 -1
- package/dist/lib/typescript/index.js +1 -1
- package/dist/lib/typescript/tsconfig.cjs +11 -7
- package/dist/lib/typescript/tsconfig.d.cts +11 -1
- package/dist/lib/typescript/tsconfig.d.ts +11 -1
- package/dist/lib/typescript/tsconfig.js +1 -1
- package/dist/lib/unplugin/factory.cjs +6 -6
- package/dist/lib/unplugin/factory.js +5 -5
- package/dist/lib/unplugin/index.cjs +6 -6
- package/dist/lib/unplugin/index.js +5 -5
- package/dist/next.cjs +4 -4
- package/dist/next.js +3 -3
- package/dist/nuxt.cjs +6 -6
- package/dist/nuxt.js +4 -4
- package/dist/rolldown.cjs +3 -3
- package/dist/rolldown.js +2 -2
- 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/tsup.cjs +4 -4
- package/dist/tsup.js +3 -3
- package/dist/unloader.cjs +3 -3
- package/dist/unloader.js +2 -2
- package/dist/unplugin.cjs +5 -5
- package/dist/unplugin.js +3 -3
- 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 +14 -14
package/dist/api.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMWURGZO3_cjs = require('./chunk-MWURGZO3.cjs');
|
|
4
4
|
require('./chunk-ETKZMGLN.cjs');
|
|
5
5
|
require('./chunk-PAMSESZV.cjs');
|
|
6
6
|
require('./chunk-AYKZK666.cjs');
|
|
@@ -10,5 +10,5 @@ require('./chunk-USNT2KNT.cjs');
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "PowerlinesAPI", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkMWURGZO3_cjs.PowerlinesAPI; }
|
|
14
14
|
});
|
package/dist/api.js
CHANGED
package/dist/astro.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var chunkTSGTSGEL_cjs = require('./chunk-TSGTSGEL.cjs');
|
|
6
6
|
require('./chunk-5IBA5HC2.cjs');
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-J42CWDHS.cjs');
|
|
8
|
+
require('./chunk-MWURGZO3.cjs');
|
|
9
9
|
require('./chunk-ETKZMGLN.cjs');
|
|
10
10
|
require('./chunk-PAMSESZV.cjs');
|
|
11
11
|
require('./chunk-AYKZK666.cjs');
|
|
@@ -15,7 +15,7 @@ var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
|
15
15
|
var astro = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((config) => ({
|
|
16
16
|
vite: {
|
|
17
17
|
plugins: [
|
|
18
|
-
|
|
18
|
+
chunkTSGTSGEL_cjs.vite_default(config)
|
|
19
19
|
]
|
|
20
20
|
}
|
|
21
21
|
}), "astro");
|
package/dist/astro.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { vite_default } from './chunk-
|
|
1
|
+
import { vite_default } from './chunk-RUNRTWUD.js';
|
|
2
2
|
import './chunk-VBR53KGY.js';
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
import './chunk-6F2RGMWO.js';
|
|
4
|
+
import './chunk-5VVIGLK7.js';
|
|
5
5
|
import './chunk-JQCWV4DT.js';
|
|
6
6
|
import './chunk-JKBJF3UI.js';
|
|
7
7
|
import './chunk-VT7NVLLU.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { extractESBuildConfig } from './chunk-VBR53KGY.js';
|
|
2
|
-
import { createUnpluginFactory } from './chunk-
|
|
2
|
+
import { createUnpluginFactory } from './chunk-6F2RGMWO.js';
|
|
3
3
|
import { __name } from './chunk-SHUYVCID.js';
|
|
4
4
|
import { isUndefined } from '@stryke/type-checks/is-undefined';
|
|
5
5
|
import { createEsbuildPlugin } from 'unplugin';
|
|
@@ -32,9 +32,9 @@ import defu6, { defu } from 'defu';
|
|
|
32
32
|
import { getPackageName, hasPackageVersion, getPackageVersion } from '@stryke/string-format/package';
|
|
33
33
|
import { getObjectDiff } from '@donedeal0/superdiff';
|
|
34
34
|
import { readJsonFile, readJsonFileSync } from '@stryke/fs/json';
|
|
35
|
-
import { loadTsConfig } from '@stryke/fs/tsconfig';
|
|
36
35
|
import { StormJSON } from '@stryke/json/storm-json';
|
|
37
|
-
import { findFilePath, relativePath, findFileName, findFileDotExtensionSafe } from '@stryke/path/file-path-fns';
|
|
36
|
+
import { findFilePath, findFileExtension, relativePath, findFileName, findFileDotExtensionSafe } from '@stryke/path/file-path-fns';
|
|
37
|
+
import { isParentPath } from '@stryke/path/is-parent-path';
|
|
38
38
|
import { titleCase } from '@stryke/string-format/title-case';
|
|
39
39
|
import { writeFile as writeFile$1 } from '@stryke/fs/write-file';
|
|
40
40
|
import { resolveConfig, format } from 'prettier';
|
|
@@ -69,7 +69,6 @@ import { getLogFn, getLogLevel } from '@storm-software/config-tools/logger';
|
|
|
69
69
|
import { getColor } from '@storm-software/config-tools/utilities/colors';
|
|
70
70
|
import { noop } from '@stryke/helpers/noop';
|
|
71
71
|
import { slash } from '@stryke/path/slash';
|
|
72
|
-
import { isParentPath } from '@stryke/path/is-parent-path';
|
|
73
72
|
import { Volume } from 'memfs';
|
|
74
73
|
import { Union } from 'unionfs';
|
|
75
74
|
import { InMemoryFileSystemHost, Project } from 'ts-morph';
|
|
@@ -309,23 +308,39 @@ ${Object.entries(context.devDependencies).map(([name, version]) => `- ${name}@${
|
|
|
309
308
|
]);
|
|
310
309
|
}
|
|
311
310
|
__name(installDependencies, "installDependencies");
|
|
312
|
-
function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig
|
|
311
|
+
function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
|
|
312
|
+
let tsconfigFilePath;
|
|
313
|
+
if (tsconfig) {
|
|
314
|
+
tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
|
|
315
|
+
} else {
|
|
316
|
+
tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.app.json");
|
|
317
|
+
if (!tsconfigFilePath) {
|
|
318
|
+
tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.lib.json");
|
|
319
|
+
if (!tsconfigFilePath) {
|
|
320
|
+
tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.json");
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (!tsconfigFilePath) {
|
|
325
|
+
throw new Error(`Cannot find the \`tsconfig.json\` configuration file for the project at ${projectRoot}.`);
|
|
326
|
+
}
|
|
327
|
+
return tsconfigFilePath;
|
|
328
|
+
}
|
|
329
|
+
__name(getTsconfigFilePath, "getTsconfigFilePath");
|
|
330
|
+
function tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
|
|
313
331
|
let tsconfigFilePath = tsconfig;
|
|
314
332
|
if (!existsSync(tsconfigFilePath)) {
|
|
315
333
|
tsconfigFilePath = appendPath(tsconfig, projectRoot);
|
|
316
334
|
if (!existsSync(tsconfigFilePath)) {
|
|
317
|
-
tsconfigFilePath = appendPath(tsconfig, workspaceRoot);
|
|
335
|
+
tsconfigFilePath = appendPath(tsconfig, appendPath(projectRoot, workspaceRoot));
|
|
318
336
|
if (!existsSync(tsconfigFilePath)) {
|
|
319
|
-
|
|
320
|
-
if (!existsSync(tsconfigFilePath)) {
|
|
321
|
-
throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${tsconfig}, ${appendPath(tsconfig, projectRoot)}, ${appendPath(tsconfig, workspaceRoot)}, or ${tsconfigFilePath}`);
|
|
322
|
-
}
|
|
337
|
+
return void 0;
|
|
323
338
|
}
|
|
324
339
|
}
|
|
325
340
|
}
|
|
326
341
|
return tsconfigFilePath;
|
|
327
342
|
}
|
|
328
|
-
__name(
|
|
343
|
+
__name(tryTsconfigFilePath, "tryTsconfigFilePath");
|
|
329
344
|
function findMatch(tsconfigType, types, extensions = [
|
|
330
345
|
".ts",
|
|
331
346
|
".tsx",
|
|
@@ -416,22 +431,14 @@ async function resolveTsconfigChanges(context) {
|
|
|
416
431
|
const tsconfigFilePath = getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
417
432
|
const tsconfigJson = await readJsonFile(tsconfigFilePath);
|
|
418
433
|
tsconfigJson.compilerOptions ??= {};
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
tsconfigJson.compilerOptions.experimentalDecorators = true;
|
|
426
|
-
}
|
|
427
|
-
if (tsconfig.options.emitDecoratorMetadata !== true) {
|
|
428
|
-
tsconfigJson.compilerOptions.emitDecoratorMetadata = true;
|
|
429
|
-
}
|
|
430
|
-
if (context.config.output.dts) {
|
|
431
|
-
const dtsFilePath = context.config.output.dts ? context.config.output.dts.startsWith(context.workspaceConfig.workspaceRoot) ? context.config.output.dts : joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.output.dts) : joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, "storm.d.ts");
|
|
432
|
-
const dtsRelativePath = joinPaths$1(relativePath(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot), findFilePath(dtsFilePath)), findFileName(dtsFilePath));
|
|
434
|
+
if (context.config.output.dts !== false) {
|
|
435
|
+
context.config.output.dts = context.config.output.dts ? isParentPath(context.config.output.dts, context.workspaceConfig.workspaceRoot) ? context.config.output.dts : appendPath(context.config.output.dts, context.workspaceConfig.workspaceRoot) : appendPath(context.config.projectRoot, context.workspaceConfig.workspaceRoot);
|
|
436
|
+
if (findFileExtension(context.config.output.dts) !== "d.ts" && findFileExtension(context.config.output.dts) !== "d.cts" && findFileExtension(context.config.output.dts) !== "d.mts") {
|
|
437
|
+
context.config.output.dts = joinPaths$1(context.config.output.dts, "powerlines.d.ts");
|
|
438
|
+
}
|
|
439
|
+
const dtsRelativePath = joinPaths$1(relativePath(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot), findFilePath(context.config.output.dts)), findFileName(context.config.output.dts));
|
|
433
440
|
if (!tsconfigJson.include?.some((filePattern) => isIncludeMatchFound(filePattern, [
|
|
434
|
-
|
|
441
|
+
String(context.config.output.dts),
|
|
435
442
|
dtsRelativePath,
|
|
436
443
|
"storm.d.ts"
|
|
437
444
|
]))) {
|
|
@@ -466,49 +473,13 @@ async function resolveTsconfigChanges(context) {
|
|
|
466
473
|
if (tsconfig.options.moduleDetection !== ts2.ModuleDetectionKind.Force) {
|
|
467
474
|
tsconfigJson.compilerOptions.moduleDetection = "force";
|
|
468
475
|
}
|
|
469
|
-
if (tsconfig.options.allowSyntheticDefaultImports !== true) {
|
|
470
|
-
tsconfigJson.compilerOptions.allowSyntheticDefaultImports = true;
|
|
471
|
-
}
|
|
472
|
-
if (tsconfig.options.noImplicitOverride !== true) {
|
|
473
|
-
tsconfigJson.compilerOptions.noImplicitOverride = true;
|
|
474
|
-
}
|
|
475
|
-
if (tsconfig.options.noUncheckedIndexedAccess !== true) {
|
|
476
|
-
tsconfigJson.compilerOptions.noUncheckedIndexedAccess = true;
|
|
477
|
-
}
|
|
478
|
-
if (tsconfig.options.skipLibCheck !== true) {
|
|
479
|
-
tsconfigJson.compilerOptions.skipLibCheck = true;
|
|
480
|
-
}
|
|
481
|
-
if (tsconfig.options.resolveJsonModule !== true) {
|
|
482
|
-
tsconfigJson.compilerOptions.resolveJsonModule = true;
|
|
483
|
-
}
|
|
484
|
-
if (tsconfig.options.isolatedModules !== true) {
|
|
485
|
-
tsconfigJson.compilerOptions.isolatedModules = true;
|
|
486
|
-
}
|
|
487
|
-
if (tsconfig.options.verbatimModuleSyntax !== false) {
|
|
488
|
-
tsconfigJson.compilerOptions.verbatimModuleSyntax = false;
|
|
489
|
-
}
|
|
490
|
-
if (tsconfig.options.allowJs !== true) {
|
|
491
|
-
tsconfigJson.compilerOptions.allowJs = true;
|
|
492
|
-
}
|
|
493
476
|
if (tsconfig.options.esModuleInterop !== true) {
|
|
494
477
|
tsconfigJson.compilerOptions.esModuleInterop = true;
|
|
495
478
|
}
|
|
496
|
-
if (tsconfig.options.
|
|
497
|
-
tsconfigJson.compilerOptions.
|
|
479
|
+
if (tsconfig.options.isolatedModules !== true) {
|
|
480
|
+
tsconfigJson.compilerOptions.isolatedModules = true;
|
|
498
481
|
}
|
|
499
|
-
if (context.
|
|
500
|
-
if (tsconfig.options.jsx !== ts2.JsxEmit.ReactJSX) {
|
|
501
|
-
tsconfigJson.compilerOptions.jsx = "react-jsx";
|
|
502
|
-
}
|
|
503
|
-
if (!tsconfig.options.lib?.some((lib) => lib.toLowerCase() !== "dom")) {
|
|
504
|
-
tsconfigJson.compilerOptions.lib ??= [];
|
|
505
|
-
tsconfigJson.compilerOptions.lib.push("dom");
|
|
506
|
-
}
|
|
507
|
-
if (!tsconfig.options.lib?.some((lib) => lib.toLowerCase() !== "dom.iterable")) {
|
|
508
|
-
tsconfigJson.compilerOptions.lib ??= [];
|
|
509
|
-
tsconfigJson.compilerOptions.lib.push("dom.iterable");
|
|
510
|
-
}
|
|
511
|
-
} else if (context.config.build.platform === "node") {
|
|
482
|
+
if (context.config.build.platform === "node") {
|
|
512
483
|
if (!tsconfig.options.types?.some((type) => type.toLowerCase() === "node" || type.toLowerCase() === "@types/node")) {
|
|
513
484
|
tsconfigJson.compilerOptions.types ??= [];
|
|
514
485
|
tsconfigJson.compilerOptions.types.push("node");
|
|
@@ -3017,6 +2988,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
3017
2988
|
userConfig
|
|
3018
2989
|
});
|
|
3019
2990
|
}
|
|
2991
|
+
this.config.tsconfig ??= getTsconfigFilePath(this.workspaceConfig.workspaceRoot, cacheKey.projectRoot, config.tsconfig);
|
|
3020
2992
|
if (isSetObject(config)) {
|
|
3021
2993
|
this.resolvedConfig = defu6({
|
|
3022
2994
|
inlineConfig: this.config.inlineConfig,
|
|
@@ -3032,7 +3004,6 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
3032
3004
|
name: this.projectJson?.name || this.packageJson?.name,
|
|
3033
3005
|
version: this.packageJson?.version,
|
|
3034
3006
|
description: this.packageJson?.description,
|
|
3035
|
-
tsconfig: appendPath("tsconfig.json", cacheKey.projectRoot),
|
|
3036
3007
|
sourceRoot: this.projectJson?.sourceRoot || appendPath("src", cacheKey.projectRoot),
|
|
3037
3008
|
output: {
|
|
3038
3009
|
outputPath: cacheKey.projectRoot ? joinPaths(this.workspaceConfig?.directories?.build || "dist", cacheKey.projectRoot) : this.workspaceConfig?.directories?.build || "dist",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createLog, PowerlinesAPI } from './chunk-
|
|
1
|
+
import { createLog, PowerlinesAPI } from './chunk-5VVIGLK7.js';
|
|
2
2
|
import { __name } from './chunk-SHUYVCID.js';
|
|
3
3
|
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
4
4
|
import { getWorkspaceRoot } from '@stryke/fs/get-workspace-root';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkJ42CWDHS_cjs = require('./chunk-J42CWDHS.cjs');
|
|
4
4
|
var unplugin = require('unplugin');
|
|
5
5
|
|
|
6
|
-
var webpack = unplugin.createWebpackPlugin(
|
|
6
|
+
var webpack = unplugin.createWebpackPlugin(chunkJ42CWDHS_cjs.createUnpluginFactory("webpack"));
|
|
7
7
|
var webpack_default = webpack;
|
|
8
8
|
|
|
9
9
|
exports.webpack = webpack;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMWURGZO3_cjs = require('./chunk-MWURGZO3.cjs');
|
|
4
4
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
var types = require('@storm-software/config-tools/types');
|
|
6
6
|
var getWorkspaceRoot = require('@stryke/fs/get-workspace-root');
|
|
@@ -26,7 +26,7 @@ chunkUSNT2KNT_cjs.__name(getString, "getString");
|
|
|
26
26
|
// src/lib/unplugin/factory.ts
|
|
27
27
|
function createUnpluginFactory(variant, decorate) {
|
|
28
28
|
return (config, meta) => {
|
|
29
|
-
const log =
|
|
29
|
+
const log = chunkMWURGZO3_cjs.createLog("unplugin", config);
|
|
30
30
|
log(types.LogLevelLabel.DEBUG, "Initializing Unplugin");
|
|
31
31
|
try {
|
|
32
32
|
const userConfig = {
|
|
@@ -38,7 +38,7 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
38
38
|
async function buildStart() {
|
|
39
39
|
log(types.LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
|
|
40
40
|
const workspaceRoot = getWorkspaceRoot.getWorkspaceRoot(process.cwd());
|
|
41
|
-
api = await
|
|
41
|
+
api = await chunkMWURGZO3_cjs.PowerlinesAPI.from(workspaceRoot, userConfig);
|
|
42
42
|
log(types.LogLevelLabel.DEBUG, "Preparing build artifacts for the Powerlines project...");
|
|
43
43
|
await api.prepare({
|
|
44
44
|
command: "build"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk5IBA5HC2_cjs = require('./chunk-5IBA5HC2.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkJ42CWDHS_cjs = require('./chunk-J42CWDHS.cjs');
|
|
5
5
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
6
6
|
var isUndefined = require('@stryke/type-checks/is-undefined');
|
|
7
7
|
var unplugin = require('unplugin');
|
|
8
8
|
|
|
9
|
-
var esbuild = unplugin.createEsbuildPlugin(
|
|
9
|
+
var esbuild = unplugin.createEsbuildPlugin(chunkJ42CWDHS_cjs.createUnpluginFactory("esbuild", (api, plugin) => {
|
|
10
10
|
return {
|
|
11
11
|
...plugin,
|
|
12
12
|
esbuild: {
|
|
@@ -34,9 +34,9 @@ var defu6 = require('defu');
|
|
|
34
34
|
var _package = require('@stryke/string-format/package');
|
|
35
35
|
var superdiff = require('@donedeal0/superdiff');
|
|
36
36
|
var json = require('@stryke/fs/json');
|
|
37
|
-
var tsconfig = require('@stryke/fs/tsconfig');
|
|
38
37
|
var stormJson = require('@stryke/json/storm-json');
|
|
39
38
|
var filePathFns = require('@stryke/path/file-path-fns');
|
|
39
|
+
var isParentPath = require('@stryke/path/is-parent-path');
|
|
40
40
|
var titleCase = require('@stryke/string-format/title-case');
|
|
41
41
|
var writeFile$1 = require('@stryke/fs/write-file');
|
|
42
42
|
var prettier = require('prettier');
|
|
@@ -71,7 +71,6 @@ var logger = require('@storm-software/config-tools/logger');
|
|
|
71
71
|
var colors = require('@storm-software/config-tools/utilities/colors');
|
|
72
72
|
var noop = require('@stryke/helpers/noop');
|
|
73
73
|
var slash = require('@stryke/path/slash');
|
|
74
|
-
var isParentPath = require('@stryke/path/is-parent-path');
|
|
75
74
|
var memfs = require('memfs');
|
|
76
75
|
var unionfs = require('unionfs');
|
|
77
76
|
var tsMorph = require('ts-morph');
|
|
@@ -339,23 +338,39 @@ ${Object.entries(context.devDependencies).map(([name, version]) => `- ${name}@${
|
|
|
339
338
|
]);
|
|
340
339
|
}
|
|
341
340
|
chunkUSNT2KNT_cjs.__name(installDependencies, "installDependencies");
|
|
342
|
-
function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig
|
|
341
|
+
function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
|
|
342
|
+
let tsconfigFilePath;
|
|
343
|
+
if (tsconfig) {
|
|
344
|
+
tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
|
|
345
|
+
} else {
|
|
346
|
+
tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.app.json");
|
|
347
|
+
if (!tsconfigFilePath) {
|
|
348
|
+
tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.lib.json");
|
|
349
|
+
if (!tsconfigFilePath) {
|
|
350
|
+
tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.json");
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
if (!tsconfigFilePath) {
|
|
355
|
+
throw new Error(`Cannot find the \`tsconfig.json\` configuration file for the project at ${projectRoot}.`);
|
|
356
|
+
}
|
|
357
|
+
return tsconfigFilePath;
|
|
358
|
+
}
|
|
359
|
+
chunkUSNT2KNT_cjs.__name(getTsconfigFilePath, "getTsconfigFilePath");
|
|
360
|
+
function tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
|
|
343
361
|
let tsconfigFilePath = tsconfig;
|
|
344
362
|
if (!exists.existsSync(tsconfigFilePath)) {
|
|
345
363
|
tsconfigFilePath = append.appendPath(tsconfig, projectRoot);
|
|
346
364
|
if (!exists.existsSync(tsconfigFilePath)) {
|
|
347
|
-
tsconfigFilePath = append.appendPath(tsconfig, workspaceRoot);
|
|
365
|
+
tsconfigFilePath = append.appendPath(tsconfig, append.appendPath(projectRoot, workspaceRoot));
|
|
348
366
|
if (!exists.existsSync(tsconfigFilePath)) {
|
|
349
|
-
|
|
350
|
-
if (!exists.existsSync(tsconfigFilePath)) {
|
|
351
|
-
throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${tsconfig}, ${append.appendPath(tsconfig, projectRoot)}, ${append.appendPath(tsconfig, workspaceRoot)}, or ${tsconfigFilePath}`);
|
|
352
|
-
}
|
|
367
|
+
return void 0;
|
|
353
368
|
}
|
|
354
369
|
}
|
|
355
370
|
}
|
|
356
371
|
return tsconfigFilePath;
|
|
357
372
|
}
|
|
358
|
-
chunkUSNT2KNT_cjs.__name(
|
|
373
|
+
chunkUSNT2KNT_cjs.__name(tryTsconfigFilePath, "tryTsconfigFilePath");
|
|
359
374
|
function findMatch(tsconfigType, types, extensions = [
|
|
360
375
|
".ts",
|
|
361
376
|
".tsx",
|
|
@@ -442,26 +457,18 @@ chunkUSNT2KNT_cjs.__name(writeFile, "writeFile");
|
|
|
442
457
|
|
|
443
458
|
// src/internal/helpers/resolve-tsconfig.ts
|
|
444
459
|
async function resolveTsconfigChanges(context) {
|
|
445
|
-
const tsconfig
|
|
460
|
+
const tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw);
|
|
446
461
|
const tsconfigFilePath = getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
447
462
|
const tsconfigJson = await json.readJsonFile(tsconfigFilePath);
|
|
448
463
|
tsconfigJson.compilerOptions ??= {};
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
tsconfigJson.compilerOptions.experimentalDecorators = true;
|
|
456
|
-
}
|
|
457
|
-
if (tsconfig$1.options.emitDecoratorMetadata !== true) {
|
|
458
|
-
tsconfigJson.compilerOptions.emitDecoratorMetadata = true;
|
|
459
|
-
}
|
|
460
|
-
if (context.config.output.dts) {
|
|
461
|
-
const dtsFilePath = context.config.output.dts ? context.config.output.dts.startsWith(context.workspaceConfig.workspaceRoot) ? context.config.output.dts : joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.output.dts) : joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, "storm.d.ts");
|
|
462
|
-
const dtsRelativePath = joinPaths.joinPaths(filePathFns.relativePath(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot), filePathFns.findFilePath(dtsFilePath)), filePathFns.findFileName(dtsFilePath));
|
|
464
|
+
if (context.config.output.dts !== false) {
|
|
465
|
+
context.config.output.dts = context.config.output.dts ? isParentPath.isParentPath(context.config.output.dts, context.workspaceConfig.workspaceRoot) ? context.config.output.dts : append.appendPath(context.config.output.dts, context.workspaceConfig.workspaceRoot) : append.appendPath(context.config.projectRoot, context.workspaceConfig.workspaceRoot);
|
|
466
|
+
if (filePathFns.findFileExtension(context.config.output.dts) !== "d.ts" && filePathFns.findFileExtension(context.config.output.dts) !== "d.cts" && filePathFns.findFileExtension(context.config.output.dts) !== "d.mts") {
|
|
467
|
+
context.config.output.dts = joinPaths.joinPaths(context.config.output.dts, "powerlines.d.ts");
|
|
468
|
+
}
|
|
469
|
+
const dtsRelativePath = joinPaths.joinPaths(filePathFns.relativePath(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot), filePathFns.findFilePath(context.config.output.dts)), filePathFns.findFileName(context.config.output.dts));
|
|
463
470
|
if (!tsconfigJson.include?.some((filePattern) => isIncludeMatchFound(filePattern, [
|
|
464
|
-
|
|
471
|
+
String(context.config.output.dts),
|
|
465
472
|
dtsRelativePath,
|
|
466
473
|
"storm.d.ts"
|
|
467
474
|
]))) {
|
|
@@ -469,7 +476,7 @@ async function resolveTsconfigChanges(context) {
|
|
|
469
476
|
tsconfigJson.include.push(dtsRelativePath.startsWith("./") ? dtsRelativePath.slice(2) : dtsRelativePath);
|
|
470
477
|
}
|
|
471
478
|
}
|
|
472
|
-
if (!tsconfig
|
|
479
|
+
if (!tsconfig.options.lib?.some((lib) => [
|
|
473
480
|
"lib.esnext.d.ts",
|
|
474
481
|
"lib.es2021.d.ts",
|
|
475
482
|
"lib.es2022.d.ts",
|
|
@@ -478,68 +485,32 @@ async function resolveTsconfigChanges(context) {
|
|
|
478
485
|
tsconfigJson.compilerOptions.lib ??= [];
|
|
479
486
|
tsconfigJson.compilerOptions.lib.push("esnext");
|
|
480
487
|
}
|
|
481
|
-
if (tsconfig
|
|
488
|
+
if (tsconfig.options.module !== ts2__default.default.ModuleKind.ESNext) {
|
|
482
489
|
tsconfigJson.compilerOptions.module = "ESNext";
|
|
483
490
|
}
|
|
484
|
-
if (!tsconfig
|
|
491
|
+
if (!tsconfig.options.target || ![
|
|
485
492
|
ts2__default.default.ScriptTarget.ESNext,
|
|
486
493
|
ts2__default.default.ScriptTarget.ES2024,
|
|
487
494
|
ts2__default.default.ScriptTarget.ES2023,
|
|
488
495
|
ts2__default.default.ScriptTarget.ES2022,
|
|
489
496
|
ts2__default.default.ScriptTarget.ES2021
|
|
490
|
-
].includes(tsconfig
|
|
497
|
+
].includes(tsconfig.options.target)) {
|
|
491
498
|
tsconfigJson.compilerOptions.target = "ESNext";
|
|
492
499
|
}
|
|
493
|
-
if (tsconfig
|
|
500
|
+
if (tsconfig.options.moduleResolution !== ts2__default.default.ModuleResolutionKind.Bundler) {
|
|
494
501
|
tsconfigJson.compilerOptions.moduleResolution = "Bundler";
|
|
495
502
|
}
|
|
496
|
-
if (tsconfig
|
|
503
|
+
if (tsconfig.options.moduleDetection !== ts2__default.default.ModuleDetectionKind.Force) {
|
|
497
504
|
tsconfigJson.compilerOptions.moduleDetection = "force";
|
|
498
505
|
}
|
|
499
|
-
if (tsconfig
|
|
500
|
-
tsconfigJson.compilerOptions.allowSyntheticDefaultImports = true;
|
|
501
|
-
}
|
|
502
|
-
if (tsconfig$1.options.noImplicitOverride !== true) {
|
|
503
|
-
tsconfigJson.compilerOptions.noImplicitOverride = true;
|
|
504
|
-
}
|
|
505
|
-
if (tsconfig$1.options.noUncheckedIndexedAccess !== true) {
|
|
506
|
-
tsconfigJson.compilerOptions.noUncheckedIndexedAccess = true;
|
|
507
|
-
}
|
|
508
|
-
if (tsconfig$1.options.skipLibCheck !== true) {
|
|
509
|
-
tsconfigJson.compilerOptions.skipLibCheck = true;
|
|
510
|
-
}
|
|
511
|
-
if (tsconfig$1.options.resolveJsonModule !== true) {
|
|
512
|
-
tsconfigJson.compilerOptions.resolveJsonModule = true;
|
|
513
|
-
}
|
|
514
|
-
if (tsconfig$1.options.isolatedModules !== true) {
|
|
515
|
-
tsconfigJson.compilerOptions.isolatedModules = true;
|
|
516
|
-
}
|
|
517
|
-
if (tsconfig$1.options.verbatimModuleSyntax !== false) {
|
|
518
|
-
tsconfigJson.compilerOptions.verbatimModuleSyntax = false;
|
|
519
|
-
}
|
|
520
|
-
if (tsconfig$1.options.allowJs !== true) {
|
|
521
|
-
tsconfigJson.compilerOptions.allowJs = true;
|
|
522
|
-
}
|
|
523
|
-
if (tsconfig$1.options.esModuleInterop !== true) {
|
|
506
|
+
if (tsconfig.options.esModuleInterop !== true) {
|
|
524
507
|
tsconfigJson.compilerOptions.esModuleInterop = true;
|
|
525
508
|
}
|
|
526
|
-
if (tsconfig
|
|
527
|
-
tsconfigJson.compilerOptions.
|
|
509
|
+
if (tsconfig.options.isolatedModules !== true) {
|
|
510
|
+
tsconfigJson.compilerOptions.isolatedModules = true;
|
|
528
511
|
}
|
|
529
|
-
if (context.
|
|
530
|
-
if (tsconfig
|
|
531
|
-
tsconfigJson.compilerOptions.jsx = "react-jsx";
|
|
532
|
-
}
|
|
533
|
-
if (!tsconfig$1.options.lib?.some((lib) => lib.toLowerCase() !== "dom")) {
|
|
534
|
-
tsconfigJson.compilerOptions.lib ??= [];
|
|
535
|
-
tsconfigJson.compilerOptions.lib.push("dom");
|
|
536
|
-
}
|
|
537
|
-
if (!tsconfig$1.options.lib?.some((lib) => lib.toLowerCase() !== "dom.iterable")) {
|
|
538
|
-
tsconfigJson.compilerOptions.lib ??= [];
|
|
539
|
-
tsconfigJson.compilerOptions.lib.push("dom.iterable");
|
|
540
|
-
}
|
|
541
|
-
} else if (context.config.build.platform === "node") {
|
|
542
|
-
if (!tsconfig$1.options.types?.some((type) => type.toLowerCase() === "node" || type.toLowerCase() === "@types/node")) {
|
|
512
|
+
if (context.config.build.platform === "node") {
|
|
513
|
+
if (!tsconfig.options.types?.some((type) => type.toLowerCase() === "node" || type.toLowerCase() === "@types/node")) {
|
|
543
514
|
tsconfigJson.compilerOptions.types ??= [];
|
|
544
515
|
tsconfigJson.compilerOptions.types.push("node");
|
|
545
516
|
}
|
|
@@ -3047,6 +3018,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
3047
3018
|
userConfig
|
|
3048
3019
|
});
|
|
3049
3020
|
}
|
|
3021
|
+
this.config.tsconfig ??= getTsconfigFilePath(this.workspaceConfig.workspaceRoot, cacheKey.projectRoot, config.tsconfig);
|
|
3050
3022
|
if (isSetObject.isSetObject(config)) {
|
|
3051
3023
|
this.resolvedConfig = defu6__default.default({
|
|
3052
3024
|
inlineConfig: this.config.inlineConfig,
|
|
@@ -3062,7 +3034,6 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
3062
3034
|
name: this.projectJson?.name || this.packageJson?.name,
|
|
3063
3035
|
version: this.packageJson?.version,
|
|
3064
3036
|
description: this.packageJson?.description,
|
|
3065
|
-
tsconfig: append.appendPath("tsconfig.json", cacheKey.projectRoot),
|
|
3066
3037
|
sourceRoot: this.projectJson?.sourceRoot || append.appendPath("src", cacheKey.projectRoot),
|
|
3067
3038
|
output: {
|
|
3068
3039
|
outputPath: cacheKey.projectRoot ? join.joinPaths(this.workspaceConfig?.directories?.build || "dist", cacheKey.projectRoot) : this.workspaceConfig?.directories?.build || "dist",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { extractESBuildConfig } from './chunk-VBR53KGY.js';
|
|
2
|
-
import { createUnpluginFactory } from './chunk-
|
|
2
|
+
import { createUnpluginFactory } from './chunk-6F2RGMWO.js';
|
|
3
3
|
import { __name } from './chunk-SHUYVCID.js';
|
|
4
4
|
import { isDevelopmentMode, isTestMode } from '@stryke/env/environment-checks';
|
|
5
5
|
import defu from 'defu';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk5IBA5HC2_cjs = require('./chunk-5IBA5HC2.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkJ42CWDHS_cjs = require('./chunk-J42CWDHS.cjs');
|
|
5
5
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
6
6
|
var environmentChecks = require('@stryke/env/environment-checks');
|
|
7
7
|
var defu = require('defu');
|
|
@@ -83,7 +83,7 @@ function extractViteConfig(context) {
|
|
|
83
83
|
chunkUSNT2KNT_cjs.__name(extractViteConfig, "extractViteConfig");
|
|
84
84
|
|
|
85
85
|
// src/vite.ts
|
|
86
|
-
var vite = unplugin.createVitePlugin(
|
|
86
|
+
var vite = unplugin.createVitePlugin(chunkJ42CWDHS_cjs.createUnpluginFactory("vite", (api, plugin) => {
|
|
87
87
|
return {
|
|
88
88
|
...plugin,
|
|
89
89
|
vite: {
|
package/dist/esbuild.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var chunkMBWFPGQL_cjs = require('./chunk-MBWFPGQL.cjs');
|
|
6
6
|
require('./chunk-5IBA5HC2.cjs');
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-J42CWDHS.cjs');
|
|
8
|
+
require('./chunk-MWURGZO3.cjs');
|
|
9
9
|
require('./chunk-ETKZMGLN.cjs');
|
|
10
10
|
require('./chunk-PAMSESZV.cjs');
|
|
11
11
|
require('./chunk-AYKZK666.cjs');
|
|
@@ -15,13 +15,13 @@ require('./chunk-USNT2KNT.cjs');
|
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "default", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkMBWFPGQL_cjs.esbuild_default; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "esbuild", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkMBWFPGQL_cjs.esbuild; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "module.exports", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkMBWFPGQL_cjs.esbuild; }
|
|
27
27
|
});
|
package/dist/esbuild.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { esbuild_default as default, esbuild, esbuild as "module.exports" } from './chunk-
|
|
1
|
+
export { esbuild_default as default, esbuild, esbuild as "module.exports" } from './chunk-4YOH66OR.js';
|
|
2
2
|
import './chunk-VBR53KGY.js';
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
import './chunk-6F2RGMWO.js';
|
|
4
|
+
import './chunk-5VVIGLK7.js';
|
|
5
5
|
import './chunk-JQCWV4DT.js';
|
|
6
6
|
import './chunk-JKBJF3UI.js';
|
|
7
7
|
import './chunk-VT7NVLLU.js';
|
package/dist/farm.cjs
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var chunkJ42CWDHS_cjs = require('./chunk-J42CWDHS.cjs');
|
|
6
|
+
require('./chunk-MWURGZO3.cjs');
|
|
7
7
|
require('./chunk-ETKZMGLN.cjs');
|
|
8
8
|
require('./chunk-PAMSESZV.cjs');
|
|
9
9
|
require('./chunk-AYKZK666.cjs');
|
|
10
10
|
require('./chunk-USNT2KNT.cjs');
|
|
11
11
|
var unplugin = require('unplugin');
|
|
12
12
|
|
|
13
|
-
var farm = unplugin.createFarmPlugin(
|
|
13
|
+
var farm = unplugin.createFarmPlugin(chunkJ42CWDHS_cjs.createUnpluginFactory("farm"));
|
|
14
14
|
var farm_default = farm;
|
|
15
15
|
|
|
16
16
|
exports.default = farm_default;
|
package/dist/farm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createUnpluginFactory } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
import { createUnpluginFactory } from './chunk-6F2RGMWO.js';
|
|
2
|
+
import './chunk-5VVIGLK7.js';
|
|
3
3
|
import './chunk-JQCWV4DT.js';
|
|
4
4
|
import './chunk-JKBJF3UI.js';
|
|
5
5
|
import './chunk-VT7NVLLU.js';
|