@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
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { BaseStorageAdapter } from "./base.mjs";
|
|
2
|
+
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
3
|
+
|
|
4
|
+
//#region src/storage/virtual.ts
|
|
5
|
+
/**
|
|
6
|
+
* Virtual/in-memory storage adapter implementation.
|
|
7
|
+
*/
|
|
8
|
+
var VirtualStorageAdapter = class extends BaseStorageAdapter {
|
|
9
|
+
/**
|
|
10
|
+
* A name identifying the storage adapter type.
|
|
11
|
+
*/
|
|
12
|
+
name = "virtual";
|
|
13
|
+
/**
|
|
14
|
+
* The storage preset for the adapter.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* This can be used as an alternate way to identify the type of storage being used.
|
|
18
|
+
*/
|
|
19
|
+
preset = "virtual";
|
|
20
|
+
/**
|
|
21
|
+
* In-memory data storage.
|
|
22
|
+
*/
|
|
23
|
+
data = /* @__PURE__ */ new Map();
|
|
24
|
+
/**
|
|
25
|
+
* Constructor for the VirtualStorageAdapter.
|
|
26
|
+
*
|
|
27
|
+
* @param context - The Powerlines context.
|
|
28
|
+
* @param options - Configuration options for the storage adapter.
|
|
29
|
+
*/
|
|
30
|
+
constructor(context, options) {
|
|
31
|
+
super(context, options);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Synchronously checks if a key exists in the storage.
|
|
35
|
+
*
|
|
36
|
+
* @param key - The key to check for existence.
|
|
37
|
+
* @returns Returns `true` if the key exists, otherwise `false`.
|
|
38
|
+
*/
|
|
39
|
+
existsSync(key) {
|
|
40
|
+
return this.data.has(this.resolve(key));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Synchronously retrieves the value associated with a given key.
|
|
44
|
+
*
|
|
45
|
+
* @param key - The key whose value is to be retrieved.
|
|
46
|
+
* @returns The value associated with the key, or `null` if the key does not exist.
|
|
47
|
+
*/
|
|
48
|
+
getSync(key) {
|
|
49
|
+
return this.data.get(this.resolve(key)) ?? null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Synchronously sets the value for a given key.
|
|
53
|
+
*
|
|
54
|
+
* @param key - The key to set the value for.
|
|
55
|
+
* @param value - The value to set.
|
|
56
|
+
*/
|
|
57
|
+
setSync(key, value) {
|
|
58
|
+
if (!this.isReadOnly && (!this.existsSync(key) || this.overwrite)) this.data.set(this.resolve(key), value);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Synchronously removes a key from the storage.
|
|
62
|
+
*
|
|
63
|
+
* @param key - The key to remove.
|
|
64
|
+
*/
|
|
65
|
+
removeSync(key) {
|
|
66
|
+
if (!this.isReadOnly && this.overwrite) this.data.delete(this.resolve(key));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Lists all keys under a given base path synchronously.
|
|
70
|
+
*
|
|
71
|
+
* @param base - The base path to list keys from.
|
|
72
|
+
* @returns An array of keys under the specified base path.
|
|
73
|
+
*/
|
|
74
|
+
listSync(base) {
|
|
75
|
+
return [...this.data.keys().filter((key) => !base ? true : isParentPath(key, this.resolve(base)))];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Disposes of the storage adapter, releasing any held resources.
|
|
79
|
+
*
|
|
80
|
+
* @returns A promise that resolves when the disposal is complete.
|
|
81
|
+
*/
|
|
82
|
+
async dispose() {
|
|
83
|
+
return this.clear();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Determines if the storage adapter should overwrite existing keys based on the provided options and context configuration.
|
|
87
|
+
*
|
|
88
|
+
* @returns `true` if the storage adapter should overwrite existing keys, otherwise `false`.
|
|
89
|
+
*/
|
|
90
|
+
get overwrite() {
|
|
91
|
+
return !this.isReadOnly;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
export { VirtualStorageAdapter };
|
|
97
|
+
//# sourceMappingURL=virtual.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual.mjs","names":[],"sources":["../../src/storage/virtual.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Context } from \"@powerlines/core\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { BaseStorageAdapter, StorageAdapterOptions } from \"./base\";\n\n/**\n * Virtual/in-memory storage adapter implementation.\n */\nexport class VirtualStorageAdapter extends BaseStorageAdapter {\n /**\n * A name identifying the storage adapter type.\n */\n public name = \"virtual\";\n\n /**\n * The storage preset for the adapter.\n *\n * @remarks\n * This can be used as an alternate way to identify the type of storage being used.\n */\n public override readonly preset = \"virtual\";\n\n /**\n * In-memory data storage.\n */\n protected data = new Map<string, any>();\n\n /**\n * Constructor for the VirtualStorageAdapter.\n *\n * @param context - The Powerlines context.\n * @param options - Configuration options for the storage adapter.\n */\n public constructor(context: Context, options?: StorageAdapterOptions) {\n super(context, options);\n }\n\n /**\n * Synchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns Returns `true` if the key exists, otherwise `false`.\n */\n public existsSync(key: string): boolean {\n return this.data.has(this.resolve(key));\n }\n\n /**\n * Synchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns The value associated with the key, or `null` if the key does not exist.\n */\n public getSync(key: string): string | null {\n return this.data.get(this.resolve(key)) ?? null;\n }\n\n /**\n * Synchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public setSync(key: string, value: string) {\n if (!this.isReadOnly && (!this.existsSync(key) || this.overwrite)) {\n this.data.set(this.resolve(key), value);\n }\n }\n\n /**\n * Synchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public removeSync(key: string) {\n if (!this.isReadOnly && this.overwrite) {\n this.data.delete(this.resolve(key));\n }\n }\n\n /**\n * Lists all keys under a given base path synchronously.\n *\n * @param base - The base path to list keys from.\n * @returns An array of keys under the specified base path.\n */\n public listSync(base?: string): string[] {\n return [\n ...this.data\n .keys()\n .filter(key => (!base ? true : isParentPath(key, this.resolve(base))))\n ];\n }\n\n /**\n * Disposes of the storage adapter, releasing any held resources.\n *\n * @returns A promise that resolves when the disposal is complete.\n */\n public override async dispose(): Promise<void> {\n return this.clear();\n }\n\n /**\n * Determines if the storage adapter should overwrite existing keys based on the provided options and context configuration.\n *\n * @returns `true` if the storage adapter should overwrite existing keys, otherwise `false`.\n */\n protected override get overwrite() {\n return !this.isReadOnly;\n }\n}\n"],"mappings":";;;;;;;AAyBA,IAAa,wBAAb,cAA2C,mBAAmB;;;;CAI5D,AAAO,OAAO;;;;;;;CAQd,AAAyB,SAAS;;;;CAKlC,AAAU,uBAAO,IAAI,KAAkB;;;;;;;CAQvC,AAAO,YAAY,SAAkB,SAAiC;AACpE,QAAM,SAAS,QAAQ;;;;;;;;CASzB,AAAO,WAAW,KAAsB;AACtC,SAAO,KAAK,KAAK,IAAI,KAAK,QAAQ,IAAI,CAAC;;;;;;;;CASzC,AAAO,QAAQ,KAA4B;AACzC,SAAO,KAAK,KAAK,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI;;;;;;;;CAS7C,AAAO,QAAQ,KAAa,OAAe;AACzC,MAAI,CAAC,KAAK,eAAe,CAAC,KAAK,WAAW,IAAI,IAAI,KAAK,WACrD,MAAK,KAAK,IAAI,KAAK,QAAQ,IAAI,EAAE,MAAM;;;;;;;CAS3C,AAAO,WAAW,KAAa;AAC7B,MAAI,CAAC,KAAK,cAAc,KAAK,UAC3B,MAAK,KAAK,OAAO,KAAK,QAAQ,IAAI,CAAC;;;;;;;;CAUvC,AAAO,SAAS,MAAyB;AACvC,SAAO,CACL,GAAG,KAAK,KACL,MAAM,CACN,QAAO,QAAQ,CAAC,OAAO,OAAO,aAAa,KAAK,KAAK,QAAQ,KAAK,CAAC,CAAE,CACzE;;;;;;;CAQH,MAAsB,UAAyB;AAC7C,SAAO,KAAK,OAAO;;;;;;;CAQrB,IAAuB,YAAY;AACjC,SAAO,CAAC,KAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts-morph-
|
|
1
|
+
{"version":3,"file":"ts-morph-C6YBNc46.mjs","names":["#context"],"sources":["../src/typescript/ts-morph.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Context } from \"@powerlines/core\";\nimport defu from \"defu\";\nimport {\n CompilerOptions,\n FileSystemHost,\n InMemoryFileSystemHost,\n Project,\n ProjectOptions,\n RuntimeDirEntry\n} from \"ts-morph\";\n\nexport class VirtualFileSystemHost\n extends InMemoryFileSystemHost\n implements FileSystemHost\n{\n #context: Context;\n\n public constructor(context: Context) {\n super();\n\n this.#context = context;\n }\n\n public override deleteSync(path: string) {\n this.#context.fs.removeSync(path);\n }\n\n public override readDirSync(dirPath: string): RuntimeDirEntry[] {\n if (!this.#context.fs.isDirectorySync(dirPath)) {\n return [];\n }\n\n return this.#context.fs.listSync(dirPath).reduce((ret, entry) => {\n const fullPath = this.#context.fs.resolveSync(entry);\n if (fullPath) {\n ret.push({\n name: entry,\n isDirectory: this.#context.fs.isDirectorySync(fullPath),\n isFile: this.#context.fs.isFileSync(fullPath),\n isSymlink: false\n });\n }\n\n return ret;\n }, [] as RuntimeDirEntry[]);\n }\n\n public override async readFile(filePath: string) {\n if (!this.#context.fs.isFileSync(filePath)) {\n return \"\";\n }\n\n return (await this.#context.fs.read(filePath))!;\n }\n\n public override readFileSync(filePath: string) {\n if (!this.#context.fs.isFileSync(filePath)) {\n return \"\";\n }\n\n return this.#context.fs.readSync(filePath)!;\n }\n\n public override async writeFile(filePath: string, fileText: string) {\n return this.#context.fs.write(filePath, fileText);\n }\n\n public override writeFileSync(filePath: string, fileText: string) {\n this.#context.fs.writeSync(filePath, fileText);\n }\n\n public override async mkdir(dirPath: string) {\n await this.#context.fs.mkdir(dirPath);\n }\n\n public override mkdirSync(dirPath: string) {\n this.#context.fs.mkdirSync(dirPath);\n }\n\n public override async move(srcPath: string, destPath: string) {\n await this.#context.fs.move(srcPath, destPath);\n }\n\n public override moveSync(srcPath: string, destPath: string) {\n this.#context.fs.moveSync(srcPath, destPath);\n }\n\n public override async copy(srcPath: string, destPath: string) {\n await this.#context.fs.copy(srcPath, destPath);\n }\n\n public override copySync(srcPath: string, destPath: string) {\n this.#context.fs.copySync(srcPath, destPath);\n }\n\n public override async fileExists(filePath: string) {\n return this.#context.fs.isFile(filePath);\n }\n\n public override fileExistsSync(filePath: string) {\n return this.#context.fs.isFileSync(filePath);\n }\n\n public override async directoryExists(dirPath: string) {\n return this.#context.fs.isDirectory(dirPath);\n }\n\n public override directoryExistsSync(dirPath: string): boolean {\n return this.#context.fs.isDirectorySync(dirPath);\n }\n\n public override realpathSync(path: string) {\n return this.#context.fs.resolveSync(path) || path;\n }\n\n public override getCurrentDirectory() {\n return this.#context.config.cwd;\n }\n\n public override async glob(\n patterns: ReadonlyArray<string>\n ): Promise<string[]> {\n return this.#context.fs.glob(patterns as string[]);\n }\n\n public override globSync(patterns: ReadonlyArray<string>): string[] {\n return this.#context.fs.globSync(patterns as string[]);\n }\n}\n\n/**\n * Create a ts-morph {@link Project} instance used for type reflection and module manipulation during processing\n *\n * @param context - The Powerlines context\n * @returns A ts-morph {@link Project} instance\n */\nexport function createProgram(\n context: Context,\n override: Partial<ProjectOptions>\n): Project {\n context.debug(\n `Creating ts-morph Project instance with configuration from: ${\n context.tsconfig.tsconfigFilePath\n }.`\n );\n\n const project = new Project(\n defu(override ?? {}, {\n skipAddingFilesFromTsConfig: false,\n tsConfigFilePath: context.tsconfig.tsconfigFilePath,\n fileSystem: new VirtualFileSystemHost(context),\n comp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AC9B,CAAC;EACH,CAAC,CAGU"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-C0xms8kb.cjs');
|
|
2
|
+
let _stryke_fs_exists = require("@stryke/fs/exists");
|
|
2
3
|
let _stryke_path_append = require("@stryke/path/append");
|
|
4
|
+
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
3
5
|
let defu = require("defu");
|
|
4
6
|
defu = require_chunk.__toESM(defu, 1);
|
|
5
|
-
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
6
|
-
let _stryke_fs_exists = require("@stryke/fs/exists");
|
|
7
7
|
let _stryke_fs_json = require("@stryke/fs/json");
|
|
8
8
|
let typescript = require("typescript");
|
|
9
9
|
typescript = require_chunk.__toESM(typescript, 1);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { existsSync } from "@stryke/fs/exists";
|
|
1
2
|
import { appendPath } from "@stryke/path/append";
|
|
2
|
-
import defu from "defu";
|
|
3
3
|
import { joinPaths } from "@stryke/path/join-paths";
|
|
4
|
-
import
|
|
4
|
+
import defu from "defu";
|
|
5
5
|
import { readJsonFileSync } from "@stryke/fs/json";
|
|
6
6
|
import ts from "typescript";
|
|
7
7
|
|
|
@@ -152,4 +152,4 @@ ${parsedCommandLine.errors.map((error) => `- ${(error.category !== void 0 && err
|
|
|
152
152
|
|
|
153
153
|
//#endregion
|
|
154
154
|
export { isIncludeMatchFound as a, getTsconfigFilePath as i, findMatch as n, isMatchFound as o, getParsedTypeScriptConfig as r, tryTsconfigFilePath as s, findIncludeMatch as t };
|
|
155
|
-
//# sourceMappingURL=tsconfig-
|
|
155
|
+
//# sourceMappingURL=tsconfig-HzJsMUrr.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsconfig-MeFEs21S.mjs","names":[],"sources":["../src/typescript/tsconfig.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ParsedTypeScriptConfig, TSConfig } from \"@powerlines/core\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { readJsonFileSync } from \"@stryke/fs/json\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { FilterPattern } from \"@stryke/types/file\";\nimport { TsConfigJson } from \"@stryke/types/tsconfig\";\nimport defu from \"defu\";\nimport ts from \"typescript\";\n\n/**\n * Get the path to the tsconfig.json file.\n *\n * @param cwd - The root directory of the workspace.\n * @param root - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @returns The absolute path to the tsconfig.json file.\n * @throws If the tsconfig.json file does not exist.\n */\nexport function getTsconfigFilePath(\n cwd: string,\n root: string,\n tsconfig?: string\n): string {\n let tsconfigFilePath: string | undefined;\n if (tsconfig) {\n tsconfigFilePath = tryTsconfigFilePath(cwd, root, tsconfig);\n } else {\n tsconfigFilePath = tryTsconfigFilePath(cwd, root, \"tsconfig.app.json\");\n if (!tsconfigFilePath) {\n tsconfigFilePath = tryTsconfigFilePath(cwd, root, \"tsconfig.lib.json\");\n if (!tsconfigFilePath) {\n tsconfigFilePath = tryTsconfigFilePath(cwd, root, \"tsconfig.json\");\n }\n }\n }\n\n if (!tsconfigFilePath) {\n throw new Error(\n `Cannot find the \\`tsconfig.json\\` configuration file for the project at ${\n root\n }.`\n );\n }\n\n return tsconfigFilePath;\n}\n\n/**\n * Get the path to the tsconfig.json file.\n *\n * @param cwd - The root directory of the workspace.\n * @param root - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @returns The absolute path to the tsconfig.json file.\n * @throws If the tsconfig.json file does not exist.\n */\nexport function tryTsconfigFilePath(\n cwd: string,\n root: string,\n tsconfig: string\n): string | undefined {\n let tsconfigFilePath = tsconfig;\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(tsconfig, root);\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(tsconfig, appendPath(root, cwd));\n if (!existsSync(tsconfigFilePath)) {\n return undefined;\n }\n }\n }\n\n return tsconfigFilePath;\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function findMatch(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[],\n extensions: string[] = [\".ts\", \".tsx\", \".d.ts\"]\n): string | RegExp | null | undefined {\n return types.find(\n type =>\n tsconfigType?.toString().toLowerCase() ===\n type?.toString().toLowerCase() ||\n tsconfigType?.toString().toLowerCase() ===\n `./${type?.toString().toLowerCase()}` ||\n `./${tsconfigType?.toString().toLowerCase()}` ===\n type?.toString().toLowerCase() ||\n extensions.some(\n ext =>\n `${tsconfigType?.toString().toLowerCase()}${ext}` ===\n type?.toString().toLowerCase() ||\n `${tsconfigType?.toString().toLowerCase()}${ext}` ===\n `./${type?.toString().toLowerCase()}` ||\n `${type?.toString().toLowerCase()}${ext}` ===\n `./${tsconfigType?.toString().toLowerCase()}` ||\n tsconfigType?.toString().toLowerCase() ===\n `${type?.toString().toLowerCase()}${ext}` ||\n tsconfigType?.toString().toLowerCase() ===\n `./${type?.toString().toLowerCase()}${ext}` ||\n type?.toString().toLowerCase() ===\n `./${tsconfigType?.toString().toLowerCase()}${ext}`\n )\n );\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function findIncludeMatch(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[]\n): string | RegExp | null | undefined {\n return findMatch(tsconfigType, types, [\n \".ts\",\n \".tsx\",\n \".d.ts\",\n \".js\",\n \".jsx\",\n \".mjs\",\n \".cjs\",\n \".mts\",\n \".cts\",\n \"/*.ts\",\n \"/*.tsx\",\n \"/*.d.ts\",\n \"/*.js\",\n \"/*.jsx\",\n \"/*.mjs\",\n \"/*.cjs\",\n \"/*.mts\",\n \"/*.cts\",\n \"/**/*.ts\",\n \"/**/*.tsx\",\n \"/**/*.d.ts\",\n \"/**/*.js\",\n \"/**/*.jsx\",\n \"/**/*.mjs\",\n \"/**/*.cjs\",\n \"/**/*.mts\",\n \"/**/*.cts\"\n ]);\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function isMatchFound(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[]\n): boolean {\n return findMatch(tsconfigType, types) !== undefined;\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function isIncludeMatchFound(\n tsconfigType: FilterPattern,\n types: FilterPattern[]\n): boolean {\n return (\n findIncludeMatch(\n tsconfigType as string | RegExp | null,\n types as (string | RegExp | null)[]\n ) !== undefined\n );\n}\n\n/**\n * Get the parsed TypeScript configuration.\n *\n * @param workspaceRoot - The root directory of the workspace.\n * @param projectRoot - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @param tsconfigRaw - The raw tsconfig.json content.\n * @param originalTsconfigJson - The original tsconfig.json content.\n * @param host - The TypeScript parse config host.\n * @returns The resolved TypeScript configuration.\n */\nexport function getParsedTypeScriptConfig(\n workspaceRoot: string,\n projectRoot: string,\n tsconfig?: string,\n tsconfigRaw: TSConfig = {},\n originalTsconfigJson?: TSConfig,\n host: ts.ParseConfigHost = ts.sys\n): ParsedTypeScriptConfig {\n const tsconfigFilePath = getTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n tsconfig\n );\n const tsconfigJson = readJsonFileSync<TSConfig>(tsconfigFilePath);\n if (!tsconfigJson) {\n throw new Error(\n `Cannot find the \\`tsconfig.json\\` configuration file at ${joinPaths(\n projectRoot,\n tsconfig ?? \"tsconfig.json\"\n )}`\n );\n }\n\n const parsedCommandLine = ts.parseJsonConfigFileContent(\n defu(tsconfigRaw ?? {}, tsconfigJson),\n host,\n appendPath(projectRoot, workspaceRoot)\n );\n if (parsedCommandLine.errors.length > 0) {\n const errorMessage = `Cannot parse the TypeScript compiler options. Please investigate the following issues:\n${parsedCommandLine.errors\n .map(\n error =>\n `- ${\n (error.category !== undefined && error.code\n ? `[${error.category}-${error.code}]: `\n : \"\") + error.messageText.toString()\n }`\n )\n .join(\"\\n\")}\n `;\n\n throw new Error(errorMessage);\n }\n\n return {\n ...parsedCommandLine,\n originalTsconfigJson: (originalTsconfigJson ??\n tsconfigJson) as TsConfigJson,\n tsconfigJson,\n tsconfigFilePath\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAqCA,SAAgB,oBACd,KACA,MACA,UACQ;CACR,IAAI;AACJ,KAAI,SACF,oBAAmB,oBAAoB,KAAK,MAAM,SAAS;MACtD;AACL,qBAAmB,oBAAoB,KAAK,MAAM,oBAAoB;AACtE,MAAI,CAAC,kBAAkB;AACrB,sBAAmB,oBAAoB,KAAK,MAAM,oBAAoB;AACtE,OAAI,CAAC,iBACH,oBAAmB,oBAAoB,KAAK,MAAM,gBAAgB;;;AAKxE,KAAI,CAAC,iBACH,OAAM,IAAI,MACR,2EACE,KACD,GACF;AAGH,QAAO;;;;;;;;;;;AAYT,SAAgB,oBACd,KACA,MACA,UACoB;CACpB,I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,aACd,cACA,OACS;AACT,QAAO,UAAU,cAAc,MAAM,KAAK;;;;;;;;;AAU5C,SAAgB,oBACd,cACA,OACS;AACT,QACE,iBACE,cACA,MACD,KAAK;;;;;;;;;;;;;AAeV,SAAgB,0BACd,eACA,aACA,UACA,cAAwB,EAAE,EAC1B,sBACA,OAA2B,GAAG,KACN;CACxB,MAAM,mBAAmB,oBACvB,eACA,aACA,SACD;CACD,MAAM,eAAe,iBAA2B,iBAAiB;AACjE,KAAI,CAAC,aACH,OAAM,IAAI,MACR,2DAA2D,UACzD,aACA,YAAY,gBACb,GACF;CAGH,MAAM,oBAAoB,GAAG,2BAC3B,KAAK,eAAe,EAAE,EAAE,aAAa,EACrC,MACA,WAAW,aAAa,cAAc,CACvC;AACD,KAAI,kBAAkB,OAAO,SAAS,GAAG;EACvC,MAAM,eAAe;EACvB,kBAAkB,OACjB,KACC,UACE,MACG,MAAM,aAAa,UAAa,MAAM,OACnC,IAAI,MAAM,SAAS,GAAG,MAAM,KAAK,OACjC,MAAM,MAAM,YAAY,UAAU,GAE3C,CACA,KAAK,KAAK,CAAC;;AAGV,QAAM,IAAI,MAAM,aAAa;;AAG/B,QAAO;EACL,GAAG;EACH,sBAAuB,wBACrB;EACF;EACA;EACD"}
|
|
1
|
+
{"version":3,"file":"tsconfig-HzJsMUrr.mjs","names":[],"sources":["../src/typescript/tsconfig.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ParsedTypeScriptConfig, TSConfig } from \"@powerlines/core\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { readJsonFileSync } from \"@stryke/fs/json\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { FilterPattern } from \"@stryke/types/file\";\nimport { TsConfigJson } from \"@stryke/types/tsconfig\";\nimport defu from \"defu\";\nimport ts from \"typescript\";\n\n/**\n * Get the path to the tsconfig.json file.\n *\n * @param cwd - The root directory of the workspace.\n * @param root - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @returns The absolute path to the tsconfig.json file.\n * @throws If the tsconfig.json file does not exist.\n */\nexport function getTsconfigFilePath(\n cwd: string,\n root: string,\n tsconfig?: string\n): string {\n let tsconfigFilePath: string | undefined;\n if (tsconfig) {\n tsconfigFilePath = tryTsconfigFilePath(cwd, root, tsconfig);\n } else {\n tsconfigFilePath = tryTsconfigFilePath(cwd, root, \"tsconfig.app.json\");\n if (!tsconfigFilePath) {\n tsconfigFilePath = tryTsconfigFilePath(cwd, root, \"tsconfig.lib.json\");\n if (!tsconfigFilePath) {\n tsconfigFilePath = tryTsconfigFilePath(cwd, root, \"tsconfig.json\");\n }\n }\n }\n\n if (!tsconfigFilePath) {\n throw new Error(\n `Cannot find the \\`tsconfig.json\\` configuration file for the project at ${\n root\n }.`\n );\n }\n\n return tsconfigFilePath;\n}\n\n/**\n * Get the path to the tsconfig.json file.\n *\n * @param cwd - The root directory of the workspace.\n * @param root - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @returns The absolute path to the tsconfig.json file.\n * @throws If the tsconfig.json file does not exist.\n */\nexport function tryTsconfigFilePath(\n cwd: string,\n root: string,\n tsconfig: string\n): string | undefined {\n let tsconfigFilePath = tsconfig;\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(tsconfig, root);\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(tsconfig, appendPath(root, cwd));\n if (!existsSync(tsconfigFilePath)) {\n return undefined;\n }\n }\n }\n\n return tsconfigFilePath;\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function findMatch(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[],\n extensions: string[] = [\".ts\", \".tsx\", \".d.ts\"]\n): string | RegExp | null | undefined {\n return types.find(\n type =>\n tsconfigType?.toString().toLowerCase() ===\n type?.toString().toLowerCase() ||\n tsconfigType?.toString().toLowerCase() ===\n `./${type?.toString().toLowerCase()}` ||\n `./${tsconfigType?.toString().toLowerCase()}` ===\n type?.toString().toLowerCase() ||\n extensions.some(\n ext =>\n `${tsconfigType?.toString().toLowerCase()}${ext}` ===\n type?.toString().toLowerCase() ||\n `${tsconfigType?.toString().toLowerCase()}${ext}` ===\n `./${type?.toString().toLowerCase()}` ||\n `${type?.toString().toLowerCase()}${ext}` ===\n `./${tsconfigType?.toString().toLowerCase()}` ||\n tsconfigType?.toString().toLowerCase() ===\n `${type?.toString().toLowerCase()}${ext}` ||\n tsconfigType?.toString().toLowerCase() ===\n `./${type?.toString().toLowerCase()}${ext}` ||\n type?.toString().toLowerCase() ===\n `./${tsconfigType?.toString().toLowerCase()}${ext}`\n )\n );\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function findIncludeMatch(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[]\n): string | RegExp | null | undefined {\n return findMatch(tsconfigType, types, [\n \".ts\",\n \".tsx\",\n \".d.ts\",\n \".js\",\n \".jsx\",\n \".mjs\",\n \".cjs\",\n \".mts\",\n \".cts\",\n \"/*.ts\",\n \"/*.tsx\",\n \"/*.d.ts\",\n \"/*.js\",\n \"/*.jsx\",\n \"/*.mjs\",\n \"/*.cjs\",\n \"/*.mts\",\n \"/*.cts\",\n \"/**/*.ts\",\n \"/**/*.tsx\",\n \"/**/*.d.ts\",\n \"/**/*.js\",\n \"/**/*.jsx\",\n \"/**/*.mjs\",\n \"/**/*.cjs\",\n \"/**/*.mts\",\n \"/**/*.cts\"\n ]);\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function isMatchFound(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[]\n): boolean {\n return findMatch(tsconfigType, types) !== undefined;\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function isIncludeMatchFound(\n tsconfigType: FilterPattern,\n types: FilterPattern[]\n): boolean {\n return (\n findIncludeMatch(\n tsconfigType as string | RegExp | null,\n types as (string | RegExp | null)[]\n ) !== undefined\n );\n}\n\n/**\n * Get the parsed TypeScript configuration.\n *\n * @param workspaceRoot - The root directory of the workspace.\n * @param projectRoot - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @param tsconfigRaw - The raw tsconfig.json content.\n * @param originalTsconfigJson - The original tsconfig.json content.\n * @param host - The TypeScript parse config host.\n * @returns The resolved TypeScript configuration.\n */\nexport function getParsedTypeScriptConfig(\n workspaceRoot: string,\n projectRoot: string,\n tsconfig?: string,\n tsconfigRaw: TSConfig = {},\n originalTsconfigJson?: TSConfig,\n host: ts.ParseConfigHost = ts.sys\n): ParsedTypeScriptConfig {\n const tsconfigFilePath = getTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n tsconfig\n );\n const tsconfigJson = readJsonFileSync<TSConfig>(tsconfigFilePath);\n if (!tsconfigJson) {\n throw new Error(\n `Cannot find the \\`tsconfig.json\\` configuration file at ${joinPaths(\n projectRoot,\n tsconfig ?? \"tsconfig.json\"\n )}`\n );\n }\n\n const parsedCommandLine = ts.parseJsonConfigFileContent(\n defu(tsconfigRaw ?? {}, tsconfigJson),\n host,\n appendPath(projectRoot, workspaceRoot)\n );\n if (parsedCommandLine.errors.length > 0) {\n const errorMessage = `Cannot parse the TypeScript compiler options. Please investigate the following issues:\n${parsedCommandLine.errors\n .map(\n error =>\n `- ${\n (error.category !== undefined && error.code\n ? `[${error.category}-${error.code}]: `\n : \"\") + error.messageText.toString()\n }`\n )\n .join(\"\\n\")}\n `;\n\n throw new Error(errorMessage);\n }\n\n return {\n ...parsedCommandLine,\n originalTsconfigJson: (originalTsconfigJson ??\n tsconfigJson) as TsConfigJson,\n tsconfigJson,\n tsconfigFilePath\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAqCA,SAAgB,oBACd,KACA,MACA,UACQ;CACR,IAAI;AACJ,KAAI,SACF,oBAAmB,oBAAoB,KAAK,MAAM,SAAS;MACtD;AACL,qBAAmB,oBAAoB,KAAK,MAAM,oBAAoB;AACtE,MAAI,CAAC,kBAAkB;AACrB,sBAAmB,oBAAoB,KAAK,MAAM,oBAAoB;AACtE,OAAI,CAAC,iBACH,oBAAmB,oBAAoB,KAAK,MAAM,gBAAgB;;;AAKxE,KAAI,CAAC,iBACH,OAAM,IAAI,MACR,2EACE,KACD,GACF;AAGH,QAAO;;;;;;;;;;;AAYT,SAAgB,oBACd,KACA,MACA,UACoB;CACpB,IAAI,mBAAmB;AACvB,KAAI,CAAC,WAAW,iBAAiB,EAAE;AACjC,qBAAmB,WAAW,UAAU,KAAK;AAC7C,MAAI,CAAC,WAAW,iBAAiB,EAAE;AACjC,sBAAmB,WAAW,UAAU,WAAW,MAAM,IAAI,CAAC;AAC9D,OAAI,CAAC,WAAW,iBAAiB,CAC/B;;;AAKN,QAAO;;;;;;;;;AAUT,SAAgB,UACd,cACA,OACA,aAAuB;CAAC;CAAO;CAAQ;CAAQ,EACX;AAC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aACH,OAAM,IAAI,MACR,2DAA2D,UACzD,aACA,YAAY,gBACb,GACF;CAGH,MAAM,oBAAoB,GAAG,2BAC3B,KAAK,eAAe,EAAE,EAAE,aAAa,EACrC,MACA,WAAW,aAAa,cAAc,CACvC;AACD,KAAI,kBAAkB,OAAO,SAAS,GAAG;EACvC,MAAM,eAAe;EACvB,kBAAkB,OACjB,KACC,UACE,MACG,MAAM,aAAa,UAAa,MAAM,OACnC,IAAI,MAAM,SAAS,GAAG,MAAM,KAAK,OACjC,MAAM,MAAM,YAAY,UAAU,GAE3C,CACA,KAAK,KAAK,CAAC;;AAGV,QAAM,IAAI,MAAM,aAAa;;AAG/B,QAAO;EACL,GAAG;EACH,sBAAuB,wBACrB;EACF;EACA;EACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_tsconfig = require('../tsconfig-
|
|
3
|
-
const require_ts_morph = require('../ts-morph-
|
|
2
|
+
const require_tsconfig = require('../tsconfig-DeKMGasE.cjs');
|
|
3
|
+
const require_ts_morph = require('../ts-morph-BbM83PT9.cjs');
|
|
4
4
|
|
|
5
5
|
exports.VirtualFileSystemHost = require_ts_morph.VirtualFileSystemHost;
|
|
6
6
|
exports.createProgram = require_ts_morph.createProgram;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as isIncludeMatchFound, i as getTsconfigFilePath, n as findMatch, o as isMatchFound, r as getParsedTypeScriptConfig, s as tryTsconfigFilePath, t as findIncludeMatch } from "../tsconfig-
|
|
2
|
-
import { n as createProgram, t as VirtualFileSystemHost } from "../ts-morph-
|
|
1
|
+
import { a as isIncludeMatchFound, i as getTsconfigFilePath, n as findMatch, o as isMatchFound, r as getParsedTypeScriptConfig, s as tryTsconfigFilePath, t as findIncludeMatch } from "../tsconfig-HzJsMUrr.mjs";
|
|
2
|
+
import { n as createProgram, t as VirtualFileSystemHost } from "../ts-morph-C6YBNc46.mjs";
|
|
3
3
|
|
|
4
4
|
export { VirtualFileSystemHost, createProgram, findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound, isMatchFound, tryTsconfigFilePath };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "An internal package containing the core engine modules for Powerlines.",
|
|
6
6
|
"homepage": "https://stormsoftware.com",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"@cacheable/memory": "^2.0.8",
|
|
138
138
|
"@donedeal0/superdiff": "^3.2.0",
|
|
139
139
|
"@jridgewell/sourcemap-codec": "^1.5.5",
|
|
140
|
-
"@powerlines/core": "^0.
|
|
140
|
+
"@powerlines/core": "^0.47.1",
|
|
141
141
|
"@storm-software/config": "^1.137.34",
|
|
142
142
|
"@storm-software/config-tools": "^1.190.1",
|
|
143
143
|
"@stryke/async": "^0.1.1",
|
|
@@ -170,7 +170,8 @@
|
|
|
170
170
|
"ts-morph": "^27.0.2",
|
|
171
171
|
"undici": "^7.25.0",
|
|
172
172
|
"unimport": "^5.7.0",
|
|
173
|
-
"unplugin": "^3.0.0"
|
|
173
|
+
"unplugin": "^3.0.0",
|
|
174
|
+
"valibot": "^1.3.1"
|
|
174
175
|
},
|
|
175
176
|
"devDependencies": {
|
|
176
177
|
"@storm-software/testing-tools": "^1.119.155",
|
|
@@ -182,5 +183,5 @@
|
|
|
182
183
|
"typescript": "^6.0.3",
|
|
183
184
|
"undici-types": "^7.25.0"
|
|
184
185
|
},
|
|
185
|
-
"gitHead": "
|
|
186
|
+
"gitHead": "3d2c2a8ebb3941045a9aaeb5218c96368847c371"
|
|
186
187
|
}
|