@powerlines/engine 0.46.6 → 0.47.1
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 +18 -18
- package/dist/api.d.mts +1 -1
- package/dist/api.mjs +16 -16
- package/dist/{base-context-CbFlRUd-.cjs → base-context-DLemGRbd.cjs} +12 -12
- package/dist/{base-context-Ce9PuQ9z.mjs → base-context-DUha4Lz-.mjs} +17 -17
- package/dist/{base-context-Ce9PuQ9z.mjs.map → base-context-DUha4Lz-.mjs.map} +1 -1
- package/dist/context/index.cjs +3 -3
- package/dist/context/index.d.mts +1 -1
- package/dist/context/index.mjs +3 -3
- package/dist/{engine-context-CEbC9dHR.mjs → engine-context-BfFiKN53.mjs} +3 -3
- package/dist/{engine-context-CEbC9dHR.mjs.map → engine-context-BfFiKN53.mjs.map} +1 -1
- package/dist/{engine-context-D-rpz-J2.cjs → engine-context-D0y88i_J.cjs} +2 -2
- package/dist/{execution-context-DUtt6PWE.mjs → execution-context-CE5H90Um.mjs} +51 -50
- package/dist/execution-context-CE5H90Um.mjs.map +1 -0
- package/dist/{execution-context-9aXwcpL6.cjs → execution-context-CnyaM3Ul.cjs} +33 -32
- package/dist/{execution-context-Da_wozne.d.mts → execution-context-YrjFeD9k.d.mts} +1 -1
- package/dist/{execution-context-Da_wozne.d.mts.map → execution-context-YrjFeD9k.d.mts.map} +1 -1
- package/dist/{fs-D1nIP45P.mjs → fs-Dcle8lUp.mjs} +1 -1
- package/dist/{fs-D1nIP45P.mjs.map → fs-Dcle8lUp.mjs.map} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +5 -5
- package/dist/rpc/client.cjs +74 -0
- package/dist/rpc/client.d.cts +31 -0
- package/dist/rpc/client.d.cts.map +1 -0
- package/dist/rpc/client.d.mts +31 -0
- package/dist/rpc/client.d.mts.map +1 -0
- package/dist/rpc/client.mjs +71 -0
- package/dist/rpc/client.mjs.map +1 -0
- package/dist/rpc/serialization.cjs +82 -0
- package/dist/rpc/serialization.d.cts +46 -0
- package/dist/rpc/serialization.d.cts.map +1 -0
- package/dist/rpc/serialization.d.mts +46 -0
- package/dist/rpc/serialization.d.mts.map +1 -0
- package/dist/rpc/serialization.mjs +76 -0
- package/dist/rpc/serialization.mjs.map +1 -0
- package/dist/rpc/server.cjs +69 -0
- package/dist/rpc/server.d.cts +29 -0
- package/dist/rpc/server.d.cts.map +1 -0
- package/dist/rpc/server.d.mts +29 -0
- package/dist/rpc/server.d.mts.map +1 -0
- package/dist/rpc/server.mjs +66 -0
- package/dist/rpc/server.mjs.map +1 -0
- package/dist/rpc/types.cjs +0 -0
- package/dist/rpc/types.d.cts +70 -0
- package/dist/rpc/types.d.cts.map +1 -0
- package/dist/rpc/types.d.mts +70 -0
- package/dist/rpc/types.d.mts.map +1 -0
- package/dist/rpc/types.mjs +1 -0
- package/dist/schemas.cjs +1 -1
- package/dist/schemas.mjs +1 -1
- package/dist/storage/base.cjs +216 -0
- package/dist/storage/base.d.cts +199 -0
- package/dist/storage/base.d.cts.map +1 -0
- package/dist/storage/base.d.mts +199 -0
- package/dist/storage/base.d.mts.map +1 -0
- package/dist/storage/base.mjs +215 -0
- package/dist/storage/base.mjs.map +1 -0
- package/dist/storage/file-system.cjs +180 -0
- package/dist/storage/file-system.d.cts +127 -0
- package/dist/storage/file-system.d.cts.map +1 -0
- package/dist/storage/file-system.d.mts +127 -0
- package/dist/storage/file-system.d.mts.map +1 -0
- package/dist/storage/file-system.mjs +179 -0
- package/dist/storage/file-system.mjs.map +1 -0
- package/dist/storage/helpers.cjs +37 -0
- package/dist/storage/helpers.d.cts +25 -0
- package/dist/storage/helpers.d.cts.map +1 -0
- package/dist/storage/helpers.d.mts +25 -0
- package/dist/storage/helpers.d.mts.map +1 -0
- package/dist/storage/helpers.mjs +34 -0
- package/dist/storage/helpers.mjs.map +1 -0
- package/dist/storage/index.cjs +10 -7
- package/dist/storage/index.d.cts +5 -419
- package/dist/storage/index.d.mts +5 -419
- package/dist/storage/index.mjs +4 -1
- package/dist/storage/virtual.cjs +98 -0
- package/dist/storage/virtual.d.cts +80 -0
- package/dist/storage/virtual.d.cts.map +1 -0
- package/dist/storage/virtual.d.mts +80 -0
- package/dist/storage/virtual.d.mts.map +1 -0
- package/dist/storage/virtual.mjs +97 -0
- package/dist/storage/virtual.mjs.map +1 -0
- package/dist/{ts-morph-D0CaA37w.mjs → ts-morph-C6YBNc46.mjs} +1 -1
- package/dist/{ts-morph-D0CaA37w.mjs.map → ts-morph-C6YBNc46.mjs.map} +1 -1
- package/dist/{tsconfig-BUDqmOaT.cjs → tsconfig-DeKMGasE.cjs} +2 -2
- package/dist/{tsconfig-MeFEs21S.mjs → tsconfig-HzJsMUrr.mjs} +3 -3
- package/dist/{tsconfig-MeFEs21S.mjs.map → tsconfig-HzJsMUrr.mjs.map} +1 -1
- package/dist/typescript/index.cjs +2 -2
- package/dist/typescript/index.mjs +2 -2
- package/package.json +5 -4
- package/dist/execution-context-DUtt6PWE.mjs.map +0 -1
- package/dist/storage/index.d.cts.map +0 -1
- package/dist/storage/index.d.mts.map +0 -1
- package/dist/virtual-CYGZHTDd.mjs +0 -513
- package/dist/virtual-CYGZHTDd.mjs.map +0 -1
- package/dist/virtual-Ct3ZqPeN.cjs +0 -548
- /package/dist/{fs-XogSgMqT.cjs → fs-CeEdzPKE.cjs} +0 -0
- /package/dist/{ts-morph-BaLPVAdB.cjs → ts-morph-BbM83PT9.cjs} +0 -0
|
@@ -1,39 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as getTsconfigFilePath } from "./tsconfig-
|
|
5
|
-
import {
|
|
6
|
-
import { toArray } from "@stryke/convert/to-array";
|
|
7
|
-
import { getResolutionCombinations, resolve, resolveSync } from "@stryke/fs/resolve";
|
|
8
|
-
import { joinPaths } from "@stryke/path/join";
|
|
9
|
-
import { isSet } from "@stryke/type-checks/is-set";
|
|
10
|
-
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
11
|
-
import { isString } from "@stryke/type-checks/is-string";
|
|
12
|
-
import { messageParent } from "jest-worker";
|
|
13
|
-
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
1
|
+
import { a as FileSystem } from "./fs-Dcle8lUp.mjs";
|
|
2
|
+
import { FileSystemStorageAdapter } from "./storage/file-system.mjs";
|
|
3
|
+
import { VirtualStorageAdapter } from "./storage/virtual.mjs";
|
|
4
|
+
import { i as getTsconfigFilePath } from "./tsconfig-HzJsMUrr.mjs";
|
|
5
|
+
import { t as PowerlinesBaseContext } from "./base-context-DUha4Lz-.mjs";
|
|
14
6
|
import { uuid } from "@stryke/unique-id/uuid";
|
|
7
|
+
import { format } from "@powerlines/core/lib/utilities/format";
|
|
15
8
|
import { addPluginHook, createLogger, dedupeHooklist, formatConfig, getPackageJsonOrganization, isDuplicate, isPlugin, isPluginConfig, isPluginHook, isPluginHookField, mergeConfig, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn } from "@powerlines/core/plugin-utils";
|
|
16
9
|
import { colorText } from "@powerlines/core/plugin-utils/logging";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
21
|
-
import chalk from "chalk";
|
|
22
|
-
import defu, { defu as defu$1 } from "defu";
|
|
23
|
-
import { existsSync } from "node:fs";
|
|
24
|
-
import { joinPaths as joinPaths$1 } from "@stryke/path/join-paths";
|
|
25
|
-
import { format } from "@powerlines/core/lib/utilities/format";
|
|
26
|
-
import { existsSync as existsSync$1 } from "@stryke/fs/exists";
|
|
10
|
+
import { toArray } from "@stryke/convert/to-array";
|
|
11
|
+
import { existsSync } from "@stryke/fs/exists";
|
|
12
|
+
import { getResolutionCombinations, resolve, resolveSync } from "@stryke/fs/resolve";
|
|
27
13
|
import { getUnique, getUniqueBy } from "@stryke/helpers/get-unique";
|
|
28
14
|
import { omit } from "@stryke/helpers/omit";
|
|
15
|
+
import { appendPath } from "@stryke/path/append";
|
|
29
16
|
import { findFileDotExtensionSafe, findFileExtensionSafe, findFileName, findFilePath, hasFileExtension } from "@stryke/path/file-path-fns";
|
|
30
17
|
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
18
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
19
|
+
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
31
20
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
32
21
|
import { isFunction } from "@stryke/type-checks/is-function";
|
|
33
22
|
import { isObject } from "@stryke/type-checks/is-object";
|
|
23
|
+
import { isSet } from "@stryke/type-checks/is-set";
|
|
24
|
+
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
25
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
26
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
27
|
+
import chalk from "chalk";
|
|
28
|
+
import defu, { defu as defu$1 } from "defu";
|
|
29
|
+
import { CACHE_HASH_LENGTH, DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_ENVIRONMENT, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, GLOBAL_ENVIRONMENT, LogCategories, PLUGIN_NON_HOOK_FIELDS, ROOT_HASH_LENGTH } from "@powerlines/core/constants";
|
|
34
30
|
import { readJsonFile } from "@stryke/fs/json";
|
|
35
31
|
import { deepClone } from "@stryke/helpers/deep-clone";
|
|
32
|
+
import { joinPaths as joinPaths$1 } from "@stryke/path/join";
|
|
36
33
|
import { getUniqueInputs, isTypeDefinition, resolveInputsSync } from "@powerlines/core/lib/entry";
|
|
34
|
+
import { getEnvPaths } from "@stryke/env/get-env-paths";
|
|
37
35
|
import { relativeToWorkspaceRoot } from "@stryke/fs/get-workspace-root";
|
|
38
36
|
import { murmurhash } from "@stryke/hash";
|
|
39
37
|
import { hashDirectory } from "@stryke/hash/node";
|
|
@@ -43,9 +41,12 @@ import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
|
43
41
|
import { match, tsconfigPathsToRegExp } from "bundle-require";
|
|
44
42
|
import { resolveCompatibilityDates } from "compatx";
|
|
45
43
|
import { create } from "flat-cache";
|
|
44
|
+
import { existsSync as existsSync$1 } from "node:fs";
|
|
46
45
|
import { parse } from "oxc-parser";
|
|
47
46
|
import { Agent, Response, interceptors, setGlobalDispatcher } from "undici";
|
|
48
47
|
import "@stryke/fs/remove-file";
|
|
48
|
+
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
49
|
+
import { messageParent } from "jest-worker";
|
|
49
50
|
import * as capnp from "@stryke/capnp";
|
|
50
51
|
import { readFileBuffer, readFileBufferSync, writeFileBuffer } from "@stryke/fs/buffer";
|
|
51
52
|
import { correctPath, stripStars } from "@stryke/path/correct-path";
|
|
@@ -137,7 +138,7 @@ function getPrefixedRootHash(name, rootHash) {
|
|
|
137
138
|
* @returns A promise that resolves when the meta file has been written.
|
|
138
139
|
*/
|
|
139
140
|
async function writeMetaFile(context) {
|
|
140
|
-
const metaFilePath = joinPaths
|
|
141
|
+
const metaFilePath = joinPaths(context.dataPath, "meta.json");
|
|
141
142
|
context.debug(`Writing runtime metadata to ${metaFilePath}`);
|
|
142
143
|
await context.fs.write(metaFilePath, JSON.stringify(context.meta, null, 2));
|
|
143
144
|
}
|
|
@@ -257,7 +258,7 @@ function normalizePath(path, builtinsPath, prefix = "powerlines") {
|
|
|
257
258
|
*/
|
|
258
259
|
function normalizeGlobPatterns(workspaceRoot, patterns) {
|
|
259
260
|
return getUnique(toArray(patterns).map((pattern) => {
|
|
260
|
-
if (isSetObject(pattern) && (isSetString(pattern.input) || isSetString(pattern.glob))) return joinPaths(pattern.input || workspaceRoot, pattern.glob || "**/*");
|
|
261
|
+
if (isSetObject(pattern) && (isSetString(pattern.input) || isSetString(pattern.glob))) return joinPaths$1(pattern.input || workspaceRoot, pattern.glob || "**/*");
|
|
261
262
|
else if (!isSetString(pattern)) return;
|
|
262
263
|
return pattern;
|
|
263
264
|
}).filter(isSetString));
|
|
@@ -409,7 +410,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
409
410
|
if (!importer) {
|
|
410
411
|
paths.push(this.#context.config.cwd);
|
|
411
412
|
paths.push(appendPath(this.#context.config.root, this.#context.config.cwd));
|
|
412
|
-
paths.push(appendPath(joinPaths(this.#context.config.root, "src"), this.#context.config.cwd));
|
|
413
|
+
paths.push(appendPath(joinPaths$1(this.#context.config.root, "src"), this.#context.config.cwd));
|
|
413
414
|
}
|
|
414
415
|
paths.push(...Object.keys(this.#context.tsconfig?.options?.paths ?? {}).filter((tsconfigPath) => path.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig?.options?.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => appendPath(tsconfigPath, this.#context.config.cwd)));
|
|
415
416
|
for (const combination of getResolutionCombinations(path, { paths: getUnique(paths) })) {
|
|
@@ -464,7 +465,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
464
465
|
if (!importer) {
|
|
465
466
|
paths.push(this.#context.config.cwd);
|
|
466
467
|
paths.push(appendPath(this.#context.config.root, this.#context.config.cwd));
|
|
467
|
-
paths.push(appendPath(joinPaths(this.#context.config.root, "src"), this.#context.config.cwd));
|
|
468
|
+
paths.push(appendPath(joinPaths$1(this.#context.config.root, "src"), this.#context.config.cwd));
|
|
468
469
|
}
|
|
469
470
|
paths.push(...Object.keys(this.#context.tsconfig?.options?.paths ?? {}).filter((tsconfigPath) => path.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig?.options?.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => appendPath(tsconfigPath, this.#context.config.cwd)));
|
|
470
471
|
for (const combination of getResolutionCombinations(path, { paths })) {
|
|
@@ -495,8 +496,8 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
495
496
|
static async create(context) {
|
|
496
497
|
context.debug("Starting virtual file system (VFS) initialization processes...");
|
|
497
498
|
let result;
|
|
498
|
-
if (!context.config.skipCache && existsSync$1(
|
|
499
|
-
const buffer = await readFileBuffer(joinPaths(context.dataPath, "fs.bin"));
|
|
499
|
+
if (!context.config.skipCache && existsSync(joinPaths$1(context.dataPath, "fs.bin"))) {
|
|
500
|
+
const buffer = await readFileBuffer(joinPaths$1(context.dataPath, "fs.bin"));
|
|
500
501
|
const fs = new capnp.Message(buffer, false).getRoot(FileSystem);
|
|
501
502
|
result = new VirtualFileSystem(context, fs);
|
|
502
503
|
if (fs._hasStorage() && fs.storage.length > 0) await Promise.all(fs.storage.values().map(async (file) => {
|
|
@@ -529,8 +530,8 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
529
530
|
static createSync(context) {
|
|
530
531
|
context.debug("Starting virtual file system (VFS) initialization processes...");
|
|
531
532
|
let result;
|
|
532
|
-
if (!context.config.skipCache && existsSync$1(
|
|
533
|
-
const buffer = readFileBufferSync(joinPaths(context.dataPath, "fs.bin"));
|
|
533
|
+
if (!context.config.skipCache && existsSync(joinPaths$1(context.dataPath, "fs.bin"))) {
|
|
534
|
+
const buffer = readFileBufferSync(joinPaths$1(context.dataPath, "fs.bin"));
|
|
534
535
|
const fs = new capnp.Message(buffer, false).getRoot(FileSystem);
|
|
535
536
|
result = new VirtualFileSystem(context, fs);
|
|
536
537
|
if (fs._hasStorage() && fs.storage.length > 0) fs.storage.values().forEach((file) => {
|
|
@@ -1180,7 +1181,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1180
1181
|
async resolve(id, importer, options = {}) {
|
|
1181
1182
|
const origResult = await this.#innerResolve(id, importer, options);
|
|
1182
1183
|
if (origResult && options.isFile && await this.isDirectory(origResult)) {
|
|
1183
|
-
const indexResult = await this.resolve(joinPaths(origResult, "index"), importer, options);
|
|
1184
|
+
const indexResult = await this.resolve(joinPaths$1(origResult, "index"), importer, options);
|
|
1184
1185
|
if (indexResult) return indexResult;
|
|
1185
1186
|
if (!hasFileExtension(origResult)) for (const ext of DEFAULT_EXTENSIONS) {
|
|
1186
1187
|
const extResult = await this.resolve(`${origResult}.${ext}`, importer, options);
|
|
@@ -1209,7 +1210,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1209
1210
|
resolveSync(id, importer, options = {}) {
|
|
1210
1211
|
const origResult = this.#innerResolveSync(id, importer, options);
|
|
1211
1212
|
if (origResult && options.isFile && this.isDirectorySync(origResult)) {
|
|
1212
|
-
const indexResult = this.resolveSync(joinPaths(origResult, "index"), importer, options);
|
|
1213
|
+
const indexResult = this.resolveSync(joinPaths$1(origResult, "index"), importer, options);
|
|
1213
1214
|
if (indexResult) return indexResult;
|
|
1214
1215
|
if (!hasFileExtension(origResult)) for (const ext of DEFAULT_EXTENSIONS) {
|
|
1215
1216
|
const extResult = this.resolveSync(`${origResult}.${ext}`, importer, options);
|
|
@@ -1226,7 +1227,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1226
1227
|
if (!this.#isDisposed) {
|
|
1227
1228
|
this.#isDisposed = true;
|
|
1228
1229
|
this.#logger.debug("Disposing virtual file system...");
|
|
1229
|
-
await this.remove(joinPaths(this.#context.dataPath, "fs.bin"));
|
|
1230
|
+
await this.remove(joinPaths$1(this.#context.dataPath, "fs.bin"));
|
|
1230
1231
|
const message = new capnp.Message();
|
|
1231
1232
|
const fs = message.initRoot(FileSystem);
|
|
1232
1233
|
const storage = fs._initStorage(Object.keys(this.#paths).length);
|
|
@@ -1257,7 +1258,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1257
1258
|
});
|
|
1258
1259
|
}
|
|
1259
1260
|
});
|
|
1260
|
-
await writeFileBuffer(joinPaths(this.#context.dataPath, "fs.bin"), message.toArrayBuffer());
|
|
1261
|
+
await writeFileBuffer(joinPaths$1(this.#context.dataPath, "fs.bin"), message.toArrayBuffer());
|
|
1261
1262
|
if (!this.#context.config.skipCache) this.resolverCache.save(true);
|
|
1262
1263
|
await Promise.all(this.#getStorages().map(async (storage) => storage.adapter.dispose()));
|
|
1263
1264
|
this.#logger.trace("Virtual file system has been disposed.");
|
|
@@ -1419,37 +1420,37 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
1419
1420
|
* Get the path to the artifacts directory for the project
|
|
1420
1421
|
*/
|
|
1421
1422
|
get artifactsPath() {
|
|
1422
|
-
return joinPaths(this.config.cwd, this.config.root, this.config.output?.artifactsPath || `.${this.config.framework || "powerlines"}`);
|
|
1423
|
+
return joinPaths$1(this.config.cwd, this.config.root, this.config.output?.artifactsPath || `.${this.config.framework || "powerlines"}`);
|
|
1423
1424
|
}
|
|
1424
1425
|
/**
|
|
1425
1426
|
* Get the path to the builtin modules used by the project
|
|
1426
1427
|
*/
|
|
1427
1428
|
get builtinsPath() {
|
|
1428
|
-
return joinPaths(this.artifactsPath, "builtins");
|
|
1429
|
+
return joinPaths$1(this.artifactsPath, "builtins");
|
|
1429
1430
|
}
|
|
1430
1431
|
/**
|
|
1431
1432
|
* Get the path to the entry directory for the project
|
|
1432
1433
|
*/
|
|
1433
1434
|
get entryPath() {
|
|
1434
|
-
return joinPaths(this.artifactsPath, "entry");
|
|
1435
|
+
return joinPaths$1(this.artifactsPath, "entry");
|
|
1435
1436
|
}
|
|
1436
1437
|
/**
|
|
1437
1438
|
* Get the path to the infrastructure modules used by the project
|
|
1438
1439
|
*/
|
|
1439
1440
|
get infrastructurePath() {
|
|
1440
|
-
return joinPaths(this.artifactsPath, "infrastructure");
|
|
1441
|
+
return joinPaths$1(this.artifactsPath, "infrastructure");
|
|
1441
1442
|
}
|
|
1442
1443
|
/**
|
|
1443
1444
|
* Get the path to the data directory for the project
|
|
1444
1445
|
*/
|
|
1445
1446
|
get dataPath() {
|
|
1446
|
-
return joinPaths(this.envPaths.data, "projects", getPrefixedRootHash(this.config.name, this.meta.rootHash));
|
|
1447
|
+
return joinPaths$1(this.envPaths.data, "projects", getPrefixedRootHash(this.config.name, this.meta.rootHash));
|
|
1447
1448
|
}
|
|
1448
1449
|
/**
|
|
1449
1450
|
* Get the path to the cache directory for the project
|
|
1450
1451
|
*/
|
|
1451
1452
|
get cachePath() {
|
|
1452
|
-
return joinPaths(this.envPaths.cache, "projects", murmurhash({
|
|
1453
|
+
return joinPaths$1(this.envPaths.cache, "projects", murmurhash({
|
|
1453
1454
|
checksum: this.#checksum,
|
|
1454
1455
|
config: this.meta.configHash
|
|
1455
1456
|
}, { maxLength: CACHE_HASH_LENGTH }));
|
|
@@ -1458,7 +1459,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
1458
1459
|
* Get the path to the generated declaration file for the project
|
|
1459
1460
|
*/
|
|
1460
1461
|
get typesPath() {
|
|
1461
|
-
return this.config.output.types ? appendPath(this.config.output.types, this.config.cwd) : joinPaths(this.config.cwd, this.config.root, "powerlines.d.ts");
|
|
1462
|
+
return this.config.output.types ? appendPath(this.config.output.types, this.config.cwd) : joinPaths$1(this.config.cwd, this.config.root, "powerlines.d.ts");
|
|
1462
1463
|
}
|
|
1463
1464
|
/**
|
|
1464
1465
|
* Get the project root relative to the workspace root
|
|
@@ -2055,7 +2056,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
2055
2056
|
if (isUndefined(mergedConfig.framework)) mergedConfig.framework = "powerlines";
|
|
2056
2057
|
if (isUndefined(mergedConfig.platform)) mergedConfig.platform = "neutral";
|
|
2057
2058
|
mergedConfig.compatibilityDate = resolveCompatibilityDates(mergedConfig.compatibilityDate, "latest");
|
|
2058
|
-
if (!this.packageJson && existsSync(joinPaths(appendPath(mergedConfig.root, mergedConfig.cwd), "package.json")) || !this.projectJson && existsSync(joinPaths(appendPath(mergedConfig.root, mergedConfig.cwd), "project.json"))) {
|
|
2059
|
+
if (!this.packageJson && existsSync$1(joinPaths$1(appendPath(mergedConfig.root, mergedConfig.cwd), "package.json")) || !this.projectJson && existsSync$1(joinPaths$1(appendPath(mergedConfig.root, mergedConfig.cwd), "project.json"))) {
|
|
2059
2060
|
await this.resolvePackageConfigs(mergedConfig.cwd, mergedConfig.root);
|
|
2060
2061
|
if (this.packageJson) mergedConfig.organization ??= getPackageJsonOrganization(this.packageJson) || "powerlines";
|
|
2061
2062
|
}
|
|
@@ -2080,16 +2081,16 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
2080
2081
|
else mergedConfig.tsconfig = getTsconfigFilePath(mergedConfig.cwd, mergedConfig.root);
|
|
2081
2082
|
mergedConfig.output.format = getUnique(toArray(mergedConfig.output?.format ?? (mergedConfig.projectType === "library" ? ["cjs", "esm"] : ["esm"])));
|
|
2082
2083
|
if (isSetString(mergedConfig.output.path)) mergedConfig.output.path = appendPath(replacePathTokens(this, mergedConfig.output.path), mergedConfig.cwd);
|
|
2083
|
-
else mergedConfig.output.path = appendPath(joinPaths(mergedConfig.root, "dist"), mergedConfig.cwd);
|
|
2084
|
+
else mergedConfig.output.path = appendPath(joinPaths$1(mergedConfig.root, "dist"), mergedConfig.cwd);
|
|
2084
2085
|
mergedConfig.output.copy ??= {};
|
|
2085
2086
|
if (mergedConfig.output.copy !== false) if (!mergedConfig.root.replace(/^\.\/?/, "")) mergedConfig.output.copy.path = isSetString(mergedConfig.output.copy.path) ? appendPath(replacePathTokens(this, mergedConfig.output.copy.path), mergedConfig.cwd) : mergedConfig.output.path;
|
|
2086
|
-
else mergedConfig.output.copy.path = appendPath(replacePathTokens(this, isSetString(mergedConfig.output.copy.path) ? mergedConfig.output.copy.path : joinPaths("dist", mergedConfig.root)), mergedConfig.cwd);
|
|
2087
|
-
if (mergedConfig.output.types !== false) mergedConfig.output.types = appendPath(replacePathTokens(this, mergedConfig.output.types || joinPaths(mergedConfig.root, `${mergedConfig.framework ?? "powerlines"}.d.ts`)), mergedConfig.cwd);
|
|
2087
|
+
else mergedConfig.output.copy.path = appendPath(replacePathTokens(this, isSetString(mergedConfig.output.copy.path) ? mergedConfig.output.copy.path : joinPaths$1("dist", mergedConfig.root)), mergedConfig.cwd);
|
|
2088
|
+
if (mergedConfig.output.types !== false) mergedConfig.output.types = appendPath(replacePathTokens(this, mergedConfig.output.types || joinPaths$1(mergedConfig.root, `${mergedConfig.framework ?? "powerlines"}.d.ts`)), mergedConfig.cwd);
|
|
2088
2089
|
if (mergedConfig.output.copy && mergedConfig.output.copy.path && mergedConfig.output.copy.assets && Array.isArray(mergedConfig.output.copy.assets)) mergedConfig.output.copy.assets = getUniqueBy(mergedConfig.output.copy.assets.map((asset) => {
|
|
2089
2090
|
return {
|
|
2090
2091
|
glob: isSetObject(asset) ? asset.glob : asset,
|
|
2091
2092
|
input: isString(asset) || !asset.input || asset.input === "." || asset.input === "/" || asset.input === "./" ? mergedConfig.cwd : isParentPath(asset.input, mergedConfig.cwd) || isEqual(asset.input, mergedConfig.cwd) ? asset.input : appendPath(asset.input, mergedConfig.cwd),
|
|
2092
|
-
output: isSetObject(asset) && asset.output ? isParentPath(asset.output, mergedConfig.cwd) ? asset.output : appendPath(joinPaths(mergedConfig.output.copy.path, replacePath(replacePath(asset.output, replacePath(mergedConfig.output.copy.path, mergedConfig.cwd)), mergedConfig.output.copy.path)), mergedConfig.cwd) : appendPath(mergedConfig.output.copy.path, mergedConfig.cwd),
|
|
2093
|
+
output: isSetObject(asset) && asset.output ? isParentPath(asset.output, mergedConfig.cwd) ? asset.output : appendPath(joinPaths$1(mergedConfig.output.copy.path, replacePath(replacePath(asset.output, replacePath(mergedConfig.output.copy.path, mergedConfig.cwd)), mergedConfig.output.copy.path)), mergedConfig.cwd) : appendPath(mergedConfig.output.copy.path, mergedConfig.cwd),
|
|
2093
2094
|
ignore: isSetObject(asset) && asset.ignore ? toArray(asset.ignore) : void 0
|
|
2094
2095
|
};
|
|
2095
2096
|
}), (a) => `${a.input}-${a.glob}-${a.output}`);
|
|
@@ -2683,8 +2684,8 @@ var PowerlinesExecutionContext = class PowerlinesExecutionContext extends Powerl
|
|
|
2683
2684
|
async setInlineConfig(config) {
|
|
2684
2685
|
await super.setInlineConfig(config);
|
|
2685
2686
|
if (this.inlineConfig.command === "new") {
|
|
2686
|
-
const workspacePackageJsonPath = joinPaths(this.config.cwd, "package.json");
|
|
2687
|
-
if (!existsSync
|
|
2687
|
+
const workspacePackageJsonPath = joinPaths$1(this.config.cwd, "package.json");
|
|
2688
|
+
if (!existsSync(workspacePackageJsonPath)) throw new Error(`The workspace package.json file could not be found at ${workspacePackageJsonPath}`);
|
|
2688
2689
|
this.packageJson = await readJsonFile(workspacePackageJsonPath);
|
|
2689
2690
|
}
|
|
2690
2691
|
}
|
|
@@ -2841,4 +2842,4 @@ var PowerlinesExecutionContext = class PowerlinesExecutionContext extends Powerl
|
|
|
2841
2842
|
|
|
2842
2843
|
//#endregion
|
|
2843
2844
|
export { mergeConfigs as a, callHook as i, PowerlinesEnvironmentContext as n, PowerlinesContext as o, createPluginContext as r, writeMetaFile as s, PowerlinesExecutionContext as t };
|
|
2844
|
-
//# sourceMappingURL=execution-context-
|
|
2845
|
+
//# sourceMappingURL=execution-context-CE5H90Um.mjs.map
|