@powerlines/engine 0.47.4 → 0.49.2
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/build.cjs +66 -0
- package/dist/api/build.d.cts +14 -0
- package/dist/api/build.d.cts.map +1 -0
- package/dist/api/build.d.mts +14 -0
- package/dist/api/build.d.mts.map +1 -0
- package/dist/api/build.mjs +64 -0
- package/dist/api/build.mjs.map +1 -0
- package/dist/api/clean.cjs +28 -0
- package/dist/api/clean.d.cts +14 -0
- package/dist/api/clean.d.cts.map +1 -0
- package/dist/api/clean.d.mts +14 -0
- package/dist/api/clean.d.mts.map +1 -0
- package/dist/api/clean.mjs +28 -0
- package/dist/api/clean.mjs.map +1 -0
- package/dist/api/create.cjs +59 -0
- package/dist/api/create.d.cts +14 -0
- package/dist/api/create.d.cts.map +1 -0
- package/dist/api/create.d.mts +14 -0
- package/dist/api/create.d.mts.map +1 -0
- package/dist/api/create.mjs +57 -0
- package/dist/api/create.mjs.map +1 -0
- package/dist/api/deploy.cjs +24 -0
- package/dist/api/deploy.d.cts +17 -0
- package/dist/api/deploy.d.cts.map +1 -0
- package/dist/api/deploy.d.mts +17 -0
- package/dist/api/deploy.d.mts.map +1 -0
- package/dist/api/deploy.mjs +24 -0
- package/dist/api/deploy.mjs.map +1 -0
- package/dist/api/docs.cjs +24 -0
- package/dist/api/docs.d.cts +17 -0
- package/dist/api/docs.d.cts.map +1 -0
- package/dist/api/docs.d.mts +17 -0
- package/dist/api/docs.d.mts.map +1 -0
- package/dist/api/docs.mjs +24 -0
- package/dist/api/docs.mjs.map +1 -0
- package/dist/api/lint.cjs +27 -0
- package/dist/api/lint.d.cts +17 -0
- package/dist/api/lint.d.cts.map +1 -0
- package/dist/api/lint.d.mts +17 -0
- package/dist/api/lint.d.mts.map +1 -0
- package/dist/api/lint.mjs +27 -0
- package/dist/api/lint.mjs.map +1 -0
- package/dist/api/prepare.cjs +68 -0
- package/dist/api/prepare.d.cts +14 -0
- package/dist/api/prepare.d.cts.map +1 -0
- package/dist/api/prepare.d.mts +14 -0
- package/dist/api/prepare.d.mts.map +1 -0
- package/dist/api/prepare.mjs +68 -0
- package/dist/api/prepare.mjs.map +1 -0
- package/dist/api/test.cjs +27 -0
- package/dist/api/test.d.cts +17 -0
- package/dist/api/test.d.cts.map +1 -0
- package/dist/api/test.d.mts +17 -0
- package/dist/api/test.d.mts.map +1 -0
- package/dist/api/test.mjs +27 -0
- package/dist/api/test.mjs.map +1 -0
- package/dist/api/types.cjs +70 -0
- package/dist/api/types.d.cts +17 -0
- package/dist/api/types.d.cts.map +1 -0
- package/dist/api/types.d.mts +17 -0
- package/dist/api/types.d.mts.map +1 -0
- package/dist/api/types.mjs +70 -0
- package/dist/api/types.mjs.map +1 -0
- package/dist/api-BgyEi2hF.d.mts +138 -0
- package/dist/api-BgyEi2hF.d.mts.map +1 -0
- package/dist/api-DcHfCjQK.d.cts +138 -0
- package/dist/api-DcHfCjQK.d.cts.map +1 -0
- package/dist/api.cjs +39 -1268
- package/dist/api.d.cts +11 -300
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +11 -300
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +31 -1264
- package/dist/api.mjs.map +1 -1
- package/dist/config-ByLyzMI0.d.mts +204 -0
- package/dist/config-ByLyzMI0.d.mts.map +1 -0
- package/dist/config-DKEmqMrh.d.cts +204 -0
- package/dist/config-DKEmqMrh.d.cts.map +1 -0
- package/dist/context/engine-context.cjs +177 -0
- package/dist/context/engine-context.d.cts +2 -0
- package/dist/context/engine-context.d.mts +2 -0
- package/dist/context/engine-context.mjs +175 -0
- package/dist/context/engine-context.mjs.map +1 -0
- package/dist/context/index.cjs +2 -9
- package/dist/context/index.d.cts +2 -150
- package/dist/context/index.d.mts +2 -150
- package/dist/context/index.mjs +2 -4
- package/dist/context-D0_a0kRO.d.cts +149 -0
- package/dist/context-D0_a0kRO.d.cts.map +1 -0
- package/dist/context-DcXV6_GL.d.mts +149 -0
- package/dist/context-DcXV6_GL.d.mts.map +1 -0
- package/dist/engine-Dz6BvkFY.cjs +590 -0
- package/dist/engine-context-B8K6Jtkk.d.cts +53 -0
- package/dist/engine-context-B8K6Jtkk.d.cts.map +1 -0
- package/dist/engine-context-DKlA5Pgu.d.mts +53 -0
- package/dist/engine-context-DKlA5Pgu.d.mts.map +1 -0
- package/dist/engine-q6YKXXcB.mjs +571 -0
- package/dist/engine-q6YKXXcB.mjs.map +1 -0
- package/dist/engine.cjs +6 -0
- package/dist/engine.d.cts +143 -0
- package/dist/engine.d.cts.map +1 -0
- package/dist/engine.d.mts +143 -0
- package/dist/engine.d.mts.map +1 -0
- package/dist/engine.mjs +3 -0
- package/dist/helpers/create-execution-host.cjs +57 -0
- package/dist/helpers/create-execution-host.d.cts +20 -0
- package/dist/helpers/create-execution-host.d.cts.map +1 -0
- package/dist/helpers/create-execution-host.d.mts +20 -0
- package/dist/helpers/create-execution-host.d.mts.map +1 -0
- package/dist/helpers/create-execution-host.mjs +57 -0
- package/dist/helpers/create-execution-host.mjs.map +1 -0
- package/dist/helpers/finalize.cjs +26 -0
- package/dist/helpers/finalize.d.cts +12 -0
- package/dist/helpers/finalize.d.cts.map +1 -0
- package/dist/helpers/finalize.d.mts +12 -0
- package/dist/helpers/finalize.d.mts.map +1 -0
- package/dist/helpers/finalize.mjs +26 -0
- package/dist/helpers/finalize.mjs.map +1 -0
- package/dist/helpers/index.cjs +12 -0
- package/dist/helpers/index.d.cts +5 -0
- package/dist/helpers/index.d.mts +5 -0
- package/dist/helpers/index.mjs +6 -0
- package/dist/helpers/rpc.cjs +139 -0
- package/dist/helpers/rpc.d.cts +7 -0
- package/dist/helpers/rpc.d.cts.map +1 -0
- package/dist/helpers/rpc.d.mts +7 -0
- package/dist/helpers/rpc.d.mts.map +1 -0
- package/dist/helpers/rpc.mjs +139 -0
- package/dist/helpers/rpc.mjs.map +1 -0
- package/dist/helpers/stream.cjs +119 -0
- package/dist/helpers/stream.d.cts +45 -0
- package/dist/helpers/stream.d.cts.map +1 -0
- package/dist/helpers/stream.d.mts +45 -0
- package/dist/helpers/stream.d.mts.map +1 -0
- package/dist/helpers/stream.mjs +117 -0
- package/dist/helpers/stream.mjs.map +1 -0
- package/dist/index-BVVgDSdq.d.cts +1 -0
- package/dist/index-BVVgDSdq.d.mts +1 -0
- package/dist/index.cjs +8 -748
- package/dist/index.d.cts +6 -140
- package/dist/index.d.mts +6 -140
- package/dist/index.mjs +4 -747
- package/package.json +102 -132
- package/dist/_internal/worker.cjs +0 -5192
- package/dist/_internal/worker.d.cts +0 -46
- package/dist/_internal/worker.d.cts.map +0 -1
- package/dist/_internal/worker.d.mts +0 -46
- package/dist/_internal/worker.d.mts.map +0 -1
- package/dist/_internal/worker.mjs +0 -5153
- package/dist/_internal/worker.mjs.map +0 -1
- package/dist/base-context-DLemGRbd.cjs +0 -322
- package/dist/base-context-DUha4Lz-.mjs +0 -315
- package/dist/base-context-DUha4Lz-.mjs.map +0 -1
- package/dist/context/index.d.cts.map +0 -1
- package/dist/context/index.d.mts.map +0 -1
- package/dist/engine-context-BfFiKN53.mjs +0 -86
- package/dist/engine-context-BfFiKN53.mjs.map +0 -1
- package/dist/engine-context-D0y88i_J.cjs +0 -91
- package/dist/execution-context-CE5H90Um.mjs +0 -2845
- package/dist/execution-context-CE5H90Um.mjs.map +0 -1
- package/dist/execution-context-CnyaM3Ul.cjs +0 -2889
- package/dist/execution-context-NyDjVZ6T.d.cts +0 -647
- package/dist/execution-context-NyDjVZ6T.d.cts.map +0 -1
- package/dist/execution-context-YrjFeD9k.d.mts +0 -647
- package/dist/execution-context-YrjFeD9k.d.mts.map +0 -1
- package/dist/fs-CeEdzPKE.cjs +0 -262
- package/dist/fs-Dcle8lUp.mjs +0 -226
- package/dist/fs-Dcle8lUp.mjs.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/rpc/client.cjs +0 -74
- package/dist/rpc/client.d.cts +0 -31
- package/dist/rpc/client.d.cts.map +0 -1
- package/dist/rpc/client.d.mts +0 -31
- package/dist/rpc/client.d.mts.map +0 -1
- package/dist/rpc/client.mjs +0 -71
- package/dist/rpc/client.mjs.map +0 -1
- package/dist/rpc/serialization.cjs +0 -82
- package/dist/rpc/serialization.d.cts +0 -46
- package/dist/rpc/serialization.d.cts.map +0 -1
- package/dist/rpc/serialization.d.mts +0 -46
- package/dist/rpc/serialization.d.mts.map +0 -1
- package/dist/rpc/serialization.mjs +0 -76
- package/dist/rpc/serialization.mjs.map +0 -1
- package/dist/rpc/server.cjs +0 -69
- package/dist/rpc/server.d.cts +0 -29
- package/dist/rpc/server.d.cts.map +0 -1
- package/dist/rpc/server.d.mts +0 -29
- package/dist/rpc/server.d.mts.map +0 -1
- package/dist/rpc/server.mjs +0 -66
- package/dist/rpc/server.mjs.map +0 -1
- package/dist/rpc/types.cjs +0 -0
- package/dist/rpc/types.d.cts +0 -70
- package/dist/rpc/types.d.cts.map +0 -1
- package/dist/rpc/types.d.mts +0 -70
- package/dist/rpc/types.d.mts.map +0 -1
- package/dist/rpc/types.mjs +0 -1
- package/dist/schemas.cjs +0 -9
- package/dist/schemas.d.cts +0 -127
- package/dist/schemas.d.cts.map +0 -1
- package/dist/schemas.d.mts +0 -127
- package/dist/schemas.d.mts.map +0 -1
- package/dist/schemas.mjs +0 -3
- package/dist/storage/base.cjs +0 -216
- package/dist/storage/base.d.cts +0 -199
- package/dist/storage/base.d.cts.map +0 -1
- package/dist/storage/base.d.mts +0 -199
- package/dist/storage/base.d.mts.map +0 -1
- package/dist/storage/base.mjs +0 -215
- package/dist/storage/base.mjs.map +0 -1
- package/dist/storage/file-system.cjs +0 -180
- package/dist/storage/file-system.d.cts +0 -127
- package/dist/storage/file-system.d.cts.map +0 -1
- package/dist/storage/file-system.d.mts +0 -127
- package/dist/storage/file-system.d.mts.map +0 -1
- package/dist/storage/file-system.mjs +0 -179
- package/dist/storage/file-system.mjs.map +0 -1
- package/dist/storage/helpers.cjs +0 -37
- package/dist/storage/helpers.d.cts +0 -25
- package/dist/storage/helpers.d.cts.map +0 -1
- package/dist/storage/helpers.d.mts +0 -25
- package/dist/storage/helpers.d.mts.map +0 -1
- package/dist/storage/helpers.mjs +0 -34
- package/dist/storage/helpers.mjs.map +0 -1
- package/dist/storage/index.cjs +0 -12
- package/dist/storage/index.d.cts +0 -5
- package/dist/storage/index.d.mts +0 -5
- package/dist/storage/index.mjs +0 -6
- package/dist/storage/virtual.cjs +0 -98
- package/dist/storage/virtual.d.cts +0 -80
- package/dist/storage/virtual.d.cts.map +0 -1
- package/dist/storage/virtual.d.mts +0 -80
- package/dist/storage/virtual.d.mts.map +0 -1
- package/dist/storage/virtual.mjs +0 -97
- package/dist/storage/virtual.mjs.map +0 -1
- package/dist/ts-morph-BbM83PT9.cjs +0 -114
- package/dist/ts-morph-C6YBNc46.mjs +0 -102
- package/dist/ts-morph-C6YBNc46.mjs.map +0 -1
- package/dist/tsconfig-DeKMGasE.cjs +0 -198
- package/dist/tsconfig-HzJsMUrr.mjs +0 -155
- package/dist/tsconfig-HzJsMUrr.mjs.map +0 -1
- package/dist/typescript/index.cjs +0 -13
- package/dist/typescript/index.d.cts +0 -106
- package/dist/typescript/index.d.cts.map +0 -1
- package/dist/typescript/index.d.mts +0 -106
- package/dist/typescript/index.d.mts.map +0 -1
- package/dist/typescript/index.mjs +0 -4
- /package/dist/{chunk-C0xms8kb.cjs → chunk-C_NdSu1c.cjs} +0 -0
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { existsSync } from "@stryke/fs/exists";
|
|
2
|
-
import { appendPath } from "@stryke/path/append";
|
|
3
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
4
|
-
import defu from "defu";
|
|
5
|
-
import { readJsonFileSync } from "@stryke/fs/json";
|
|
6
|
-
import ts from "typescript";
|
|
7
|
-
|
|
8
|
-
//#region src/typescript/tsconfig.ts
|
|
9
|
-
/**
|
|
10
|
-
* Get the path to the tsconfig.json file.
|
|
11
|
-
*
|
|
12
|
-
* @param cwd - The root directory of the workspace.
|
|
13
|
-
* @param root - The root directory of the project.
|
|
14
|
-
* @param tsconfig - The path to the tsconfig.json file.
|
|
15
|
-
* @returns The absolute path to the tsconfig.json file.
|
|
16
|
-
* @throws If the tsconfig.json file does not exist.
|
|
17
|
-
*/
|
|
18
|
-
function getTsconfigFilePath(cwd, root, tsconfig) {
|
|
19
|
-
let tsconfigFilePath;
|
|
20
|
-
if (tsconfig) tsconfigFilePath = tryTsconfigFilePath(cwd, root, tsconfig);
|
|
21
|
-
else {
|
|
22
|
-
tsconfigFilePath = tryTsconfigFilePath(cwd, root, "tsconfig.app.json");
|
|
23
|
-
if (!tsconfigFilePath) {
|
|
24
|
-
tsconfigFilePath = tryTsconfigFilePath(cwd, root, "tsconfig.lib.json");
|
|
25
|
-
if (!tsconfigFilePath) tsconfigFilePath = tryTsconfigFilePath(cwd, root, "tsconfig.json");
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
if (!tsconfigFilePath) throw new Error(`Cannot find the \`tsconfig.json\` configuration file for the project at ${root}.`);
|
|
29
|
-
return tsconfigFilePath;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Get the path to the tsconfig.json file.
|
|
33
|
-
*
|
|
34
|
-
* @param cwd - The root directory of the workspace.
|
|
35
|
-
* @param root - The root directory of the project.
|
|
36
|
-
* @param tsconfig - The path to the tsconfig.json file.
|
|
37
|
-
* @returns The absolute path to the tsconfig.json file.
|
|
38
|
-
* @throws If the tsconfig.json file does not exist.
|
|
39
|
-
*/
|
|
40
|
-
function tryTsconfigFilePath(cwd, root, tsconfig) {
|
|
41
|
-
let tsconfigFilePath = tsconfig;
|
|
42
|
-
if (!existsSync(tsconfigFilePath)) {
|
|
43
|
-
tsconfigFilePath = appendPath(tsconfig, root);
|
|
44
|
-
if (!existsSync(tsconfigFilePath)) {
|
|
45
|
-
tsconfigFilePath = appendPath(tsconfig, appendPath(root, cwd));
|
|
46
|
-
if (!existsSync(tsconfigFilePath)) return;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return tsconfigFilePath;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Check if the TypeScript configuration type matches any of the provided types.
|
|
53
|
-
*
|
|
54
|
-
* @param tsconfigType - The type from the TypeScript configuration.
|
|
55
|
-
* @param types - An array of type names to check against.
|
|
56
|
-
* @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
|
|
57
|
-
*/
|
|
58
|
-
function findMatch(tsconfigType, types, extensions = [
|
|
59
|
-
".ts",
|
|
60
|
-
".tsx",
|
|
61
|
-
".d.ts"
|
|
62
|
-
]) {
|
|
63
|
-
return types.find((type) => tsconfigType?.toString().toLowerCase() === type?.toString().toLowerCase() || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}` || `./${tsconfigType?.toString().toLowerCase()}` === type?.toString().toLowerCase() || extensions.some((ext) => `${tsconfigType?.toString().toLowerCase()}${ext}` === type?.toString().toLowerCase() || `${tsconfigType?.toString().toLowerCase()}${ext}` === `./${type?.toString().toLowerCase()}` || `${type?.toString().toLowerCase()}${ext}` === `./${tsconfigType?.toString().toLowerCase()}` || tsconfigType?.toString().toLowerCase() === `${type?.toString().toLowerCase()}${ext}` || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}${ext}` || type?.toString().toLowerCase() === `./${tsconfigType?.toString().toLowerCase()}${ext}`));
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Check if the TypeScript configuration type matches any of the provided types.
|
|
67
|
-
*
|
|
68
|
-
* @param tsconfigType - The type from the TypeScript configuration.
|
|
69
|
-
* @param types - An array of type names to check against.
|
|
70
|
-
* @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
|
|
71
|
-
*/
|
|
72
|
-
function findIncludeMatch(tsconfigType, types) {
|
|
73
|
-
return findMatch(tsconfigType, types, [
|
|
74
|
-
".ts",
|
|
75
|
-
".tsx",
|
|
76
|
-
".d.ts",
|
|
77
|
-
".js",
|
|
78
|
-
".jsx",
|
|
79
|
-
".mjs",
|
|
80
|
-
".cjs",
|
|
81
|
-
".mts",
|
|
82
|
-
".cts",
|
|
83
|
-
"/*.ts",
|
|
84
|
-
"/*.tsx",
|
|
85
|
-
"/*.d.ts",
|
|
86
|
-
"/*.js",
|
|
87
|
-
"/*.jsx",
|
|
88
|
-
"/*.mjs",
|
|
89
|
-
"/*.cjs",
|
|
90
|
-
"/*.mts",
|
|
91
|
-
"/*.cts",
|
|
92
|
-
"/**/*.ts",
|
|
93
|
-
"/**/*.tsx",
|
|
94
|
-
"/**/*.d.ts",
|
|
95
|
-
"/**/*.js",
|
|
96
|
-
"/**/*.jsx",
|
|
97
|
-
"/**/*.mjs",
|
|
98
|
-
"/**/*.cjs",
|
|
99
|
-
"/**/*.mts",
|
|
100
|
-
"/**/*.cts"
|
|
101
|
-
]);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Check if the TypeScript configuration type matches any of the provided types.
|
|
105
|
-
*
|
|
106
|
-
* @param tsconfigType - The type from the TypeScript configuration.
|
|
107
|
-
* @param types - An array of type names to check against.
|
|
108
|
-
* @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
|
|
109
|
-
*/
|
|
110
|
-
function isMatchFound(tsconfigType, types) {
|
|
111
|
-
return findMatch(tsconfigType, types) !== void 0;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Check if the TypeScript configuration type matches any of the provided types.
|
|
115
|
-
*
|
|
116
|
-
* @param tsconfigType - The type from the TypeScript configuration.
|
|
117
|
-
* @param types - An array of type names to check against.
|
|
118
|
-
* @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
|
|
119
|
-
*/
|
|
120
|
-
function isIncludeMatchFound(tsconfigType, types) {
|
|
121
|
-
return findIncludeMatch(tsconfigType, types) !== void 0;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Get the parsed TypeScript configuration.
|
|
125
|
-
*
|
|
126
|
-
* @param workspaceRoot - The root directory of the workspace.
|
|
127
|
-
* @param projectRoot - The root directory of the project.
|
|
128
|
-
* @param tsconfig - The path to the tsconfig.json file.
|
|
129
|
-
* @param tsconfigRaw - The raw tsconfig.json content.
|
|
130
|
-
* @param originalTsconfigJson - The original tsconfig.json content.
|
|
131
|
-
* @param host - The TypeScript parse config host.
|
|
132
|
-
* @returns The resolved TypeScript configuration.
|
|
133
|
-
*/
|
|
134
|
-
function getParsedTypeScriptConfig(workspaceRoot, projectRoot, tsconfig, tsconfigRaw = {}, originalTsconfigJson, host = ts.sys) {
|
|
135
|
-
const tsconfigFilePath = getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
|
|
136
|
-
const tsconfigJson = readJsonFileSync(tsconfigFilePath);
|
|
137
|
-
if (!tsconfigJson) throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${joinPaths(projectRoot, tsconfig ?? "tsconfig.json")}`);
|
|
138
|
-
const parsedCommandLine = ts.parseJsonConfigFileContent(defu(tsconfigRaw ?? {}, tsconfigJson), host, appendPath(projectRoot, workspaceRoot));
|
|
139
|
-
if (parsedCommandLine.errors.length > 0) {
|
|
140
|
-
const errorMessage = `Cannot parse the TypeScript compiler options. Please investigate the following issues:
|
|
141
|
-
${parsedCommandLine.errors.map((error) => `- ${(error.category !== void 0 && error.code ? `[${error.category}-${error.code}]: ` : "") + error.messageText.toString()}`).join("\n")}
|
|
142
|
-
`;
|
|
143
|
-
throw new Error(errorMessage);
|
|
144
|
-
}
|
|
145
|
-
return {
|
|
146
|
-
...parsedCommandLine,
|
|
147
|
-
originalTsconfigJson: originalTsconfigJson ?? tsconfigJson,
|
|
148
|
-
tsconfigJson,
|
|
149
|
-
tsconfigFilePath
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
//#endregion
|
|
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-HzJsMUrr.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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":"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"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_tsconfig = require('../tsconfig-DeKMGasE.cjs');
|
|
3
|
-
const require_ts_morph = require('../ts-morph-BbM83PT9.cjs');
|
|
4
|
-
|
|
5
|
-
exports.VirtualFileSystemHost = require_ts_morph.VirtualFileSystemHost;
|
|
6
|
-
exports.createProgram = require_ts_morph.createProgram;
|
|
7
|
-
exports.findIncludeMatch = require_tsconfig.findIncludeMatch;
|
|
8
|
-
exports.findMatch = require_tsconfig.findMatch;
|
|
9
|
-
exports.getParsedTypeScriptConfig = require_tsconfig.getParsedTypeScriptConfig;
|
|
10
|
-
exports.getTsconfigFilePath = require_tsconfig.getTsconfigFilePath;
|
|
11
|
-
exports.isIncludeMatchFound = require_tsconfig.isIncludeMatchFound;
|
|
12
|
-
exports.isMatchFound = require_tsconfig.isMatchFound;
|
|
13
|
-
exports.tryTsconfigFilePath = require_tsconfig.tryTsconfigFilePath;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { Context, ParsedTypeScriptConfig, TSConfig } from "@powerlines/core";
|
|
2
|
-
import { FileSystemHost, InMemoryFileSystemHost, Project, ProjectOptions, RuntimeDirEntry } from "ts-morph";
|
|
3
|
-
import { FilterPattern } from "@stryke/types/file";
|
|
4
|
-
import ts from "typescript";
|
|
5
|
-
|
|
6
|
-
//#region src/typescript/ts-morph.d.ts
|
|
7
|
-
declare class VirtualFileSystemHost extends InMemoryFileSystemHost implements FileSystemHost {
|
|
8
|
-
#private;
|
|
9
|
-
constructor(context: Context);
|
|
10
|
-
deleteSync(path: string): void;
|
|
11
|
-
readDirSync(dirPath: string): RuntimeDirEntry[];
|
|
12
|
-
readFile(filePath: string): Promise<string>;
|
|
13
|
-
readFileSync(filePath: string): string;
|
|
14
|
-
writeFile(filePath: string, fileText: string): Promise<void>;
|
|
15
|
-
writeFileSync(filePath: string, fileText: string): void;
|
|
16
|
-
mkdir(dirPath: string): Promise<void>;
|
|
17
|
-
mkdirSync(dirPath: string): void;
|
|
18
|
-
move(srcPath: string, destPath: string): Promise<void>;
|
|
19
|
-
moveSync(srcPath: string, destPath: string): void;
|
|
20
|
-
copy(srcPath: string, destPath: string): Promise<void>;
|
|
21
|
-
copySync(srcPath: string, destPath: string): void;
|
|
22
|
-
fileExists(filePath: string): Promise<boolean>;
|
|
23
|
-
fileExistsSync(filePath: string): boolean;
|
|
24
|
-
directoryExists(dirPath: string): Promise<boolean>;
|
|
25
|
-
directoryExistsSync(dirPath: string): boolean;
|
|
26
|
-
realpathSync(path: string): string;
|
|
27
|
-
getCurrentDirectory(): string;
|
|
28
|
-
glob(patterns: ReadonlyArray<string>): Promise<string[]>;
|
|
29
|
-
globSync(patterns: ReadonlyArray<string>): string[];
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Create a ts-morph {@link Project} instance used for type reflection and module manipulation during processing
|
|
33
|
-
*
|
|
34
|
-
* @param context - The Powerlines context
|
|
35
|
-
* @returns A ts-morph {@link Project} instance
|
|
36
|
-
*/
|
|
37
|
-
declare function createProgram(context: Context, override: Partial<ProjectOptions>): Project;
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/typescript/tsconfig.d.ts
|
|
40
|
-
/**
|
|
41
|
-
* Get the path to the tsconfig.json file.
|
|
42
|
-
*
|
|
43
|
-
* @param cwd - The root directory of the workspace.
|
|
44
|
-
* @param root - The root directory of the project.
|
|
45
|
-
* @param tsconfig - The path to the tsconfig.json file.
|
|
46
|
-
* @returns The absolute path to the tsconfig.json file.
|
|
47
|
-
* @throws If the tsconfig.json file does not exist.
|
|
48
|
-
*/
|
|
49
|
-
declare function getTsconfigFilePath(cwd: string, root: string, tsconfig?: string): string;
|
|
50
|
-
/**
|
|
51
|
-
* Get the path to the tsconfig.json file.
|
|
52
|
-
*
|
|
53
|
-
* @param cwd - The root directory of the workspace.
|
|
54
|
-
* @param root - The root directory of the project.
|
|
55
|
-
* @param tsconfig - The path to the tsconfig.json file.
|
|
56
|
-
* @returns The absolute path to the tsconfig.json file.
|
|
57
|
-
* @throws If the tsconfig.json file does not exist.
|
|
58
|
-
*/
|
|
59
|
-
declare function tryTsconfigFilePath(cwd: string, root: string, tsconfig: string): string | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* Check if the TypeScript configuration type matches any of the provided types.
|
|
62
|
-
*
|
|
63
|
-
* @param tsconfigType - The type from the TypeScript configuration.
|
|
64
|
-
* @param types - An array of type names to check against.
|
|
65
|
-
* @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
|
|
66
|
-
*/
|
|
67
|
-
declare function findMatch(tsconfigType: string | RegExp | null, types: (string | RegExp | null)[], extensions?: string[]): string | RegExp | null | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Check if the TypeScript configuration type matches any of the provided types.
|
|
70
|
-
*
|
|
71
|
-
* @param tsconfigType - The type from the TypeScript configuration.
|
|
72
|
-
* @param types - An array of type names to check against.
|
|
73
|
-
* @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
|
|
74
|
-
*/
|
|
75
|
-
declare function findIncludeMatch(tsconfigType: string | RegExp | null, types: (string | RegExp | null)[]): string | RegExp | null | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Check if the TypeScript configuration type matches any of the provided types.
|
|
78
|
-
*
|
|
79
|
-
* @param tsconfigType - The type from the TypeScript configuration.
|
|
80
|
-
* @param types - An array of type names to check against.
|
|
81
|
-
* @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
|
|
82
|
-
*/
|
|
83
|
-
declare function isMatchFound(tsconfigType: string | RegExp | null, types: (string | RegExp | null)[]): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Check if the TypeScript configuration type matches any of the provided types.
|
|
86
|
-
*
|
|
87
|
-
* @param tsconfigType - The type from the TypeScript configuration.
|
|
88
|
-
* @param types - An array of type names to check against.
|
|
89
|
-
* @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
|
|
90
|
-
*/
|
|
91
|
-
declare function isIncludeMatchFound(tsconfigType: FilterPattern, types: FilterPattern[]): boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Get the parsed TypeScript configuration.
|
|
94
|
-
*
|
|
95
|
-
* @param workspaceRoot - The root directory of the workspace.
|
|
96
|
-
* @param projectRoot - The root directory of the project.
|
|
97
|
-
* @param tsconfig - The path to the tsconfig.json file.
|
|
98
|
-
* @param tsconfigRaw - The raw tsconfig.json content.
|
|
99
|
-
* @param originalTsconfigJson - The original tsconfig.json content.
|
|
100
|
-
* @param host - The TypeScript parse config host.
|
|
101
|
-
* @returns The resolved TypeScript configuration.
|
|
102
|
-
*/
|
|
103
|
-
declare function getParsedTypeScriptConfig(workspaceRoot: string, projectRoot: string, tsconfig?: string, tsconfigRaw?: TSConfig, originalTsconfigJson?: TSConfig, host?: ts.ParseConfigHost): ParsedTypeScriptConfig;
|
|
104
|
-
//#endregion
|
|
105
|
-
export { VirtualFileSystemHost, createProgram, findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound, isMatchFound, tryTsconfigFilePath };
|
|
106
|
-
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/typescript/ts-morph.ts","../../src/typescript/tsconfig.ts"],"mappings":";;;;;;cA6Ba,qBAAA,SACH,sBAAA,YACG,cAAA;EAAA;cAIQ,OAAA,EAAS,OAAA;EAMZ,UAAA,CAAW,IAAA;EAIX,WAAA,CAAY,OAAA,WAAkB,eAAA;EAoBxB,QAAA,CAAS,QAAA,WAAgB,OAAA;EAQ/B,YAAA,CAAa,QAAA;EAQP,SAAA,CAAU,QAAA,UAAkB,QAAA,WAAgB,OAAA;EAIlD,aAAA,CAAc,QAAA,UAAkB,QAAA;EAI1B,KAAA,CAAM,OAAA,WAAe,OAAA;EAI3B,SAAA,CAAU,OAAA;EAIJ,IAAA,CAAK,OAAA,UAAiB,QAAA,WAAgB,OAAA;EAI5C,QAAA,CAAS,OAAA,UAAiB,QAAA;EAIpB,IAAA,CAAK,OAAA,UAAiB,QAAA,WAAgB,OAAA;EAI5C,QAAA,CAAS,OAAA,UAAiB,QAAA;EAIpB,UAAA,CAAW,QAAA,WAAgB,OAAA;EAIjC,cAAA,CAAe,QAAA;EAIT,eAAA,CAAgB,OAAA,WAAe,OAAA;EAIrC,mBAAA,CAAoB,OAAA;EAIpB,YAAA,CAAa,IAAA;EAIb,mBAAA,CAAA;EAIM,IAAA,CACpB,QAAA,EAAU,aAAA,WACT,OAAA;EAIa,QAAA,CAAS,QAAA,EAAU,aAAA;AAAA;;;;;;;iBAWrB,aAAA,CACd,OAAA,EAAS,OAAA,EACT,QAAA,EAAU,OAAA,CAAQ,cAAA,IACjB,OAAA;;;;;;AAhIH;;;;;;iBCQgB,mBAAA,CACd,GAAA,UACA,IAAA,UACA,QAAA;;;;;;;;;;iBAmCc,mBAAA,CACd,GAAA,UACA,IAAA,UACA,QAAA;;;;;;;;iBAuBc,SAAA,CACd,YAAA,WAAuB,MAAA,SACvB,KAAA,YAAiB,MAAA,YACjB,UAAA,uBACU,MAAA;;;;;;;;iBAkCI,gBAAA,CACd,YAAA,WAAuB,MAAA,SACvB,KAAA,YAAiB,MAAA,sBACP,MAAA;;;;;;;;iBAuCI,YAAA,CACd,YAAA,WAAuB,MAAA,SACvB,KAAA,YAAiB,MAAA;;;;;;;;iBAYH,mBAAA,CACd,YAAA,EAAc,aAAA,EACd,KAAA,EAAO,aAAA;;;;;;;;;;;;iBAqBO,yBAAA,CACd,aAAA,UACA,WAAA,UACA,QAAA,WACA,WAAA,GAAa,QAAA,EACb,oBAAA,GAAuB,QAAA,EACvB,IAAA,GAAM,EAAA,CAAG,eAAA,GACR,sBAAA"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { FileSystemHost, InMemoryFileSystemHost, Project, ProjectOptions, RuntimeDirEntry } from "ts-morph";
|
|
3
|
-
import { Context, ParsedTypeScriptConfig, TSConfig } from "@powerlines/core";
|
|
4
|
-
import { FilterPattern } from "@stryke/types/file";
|
|
5
|
-
|
|
6
|
-
//#region src/typescript/ts-morph.d.ts
|
|
7
|
-
declare class VirtualFileSystemHost extends InMemoryFileSystemHost implements FileSystemHost {
|
|
8
|
-
#private;
|
|
9
|
-
constructor(context: Context);
|
|
10
|
-
deleteSync(path: string): void;
|
|
11
|
-
readDirSync(dirPath: string): RuntimeDirEntry[];
|
|
12
|
-
readFile(filePath: string): Promise<string>;
|
|
13
|
-
readFileSync(filePath: string): string;
|
|
14
|
-
writeFile(filePath: string, fileText: string): Promise<void>;
|
|
15
|
-
writeFileSync(filePath: string, fileText: string): void;
|
|
16
|
-
mkdir(dirPath: string): Promise<void>;
|
|
17
|
-
mkdirSync(dirPath: string): void;
|
|
18
|
-
move(srcPath: string, destPath: string): Promise<void>;
|
|
19
|
-
moveSync(srcPath: string, destPath: string): void;
|
|
20
|
-
copy(srcPath: string, destPath: string): Promise<void>;
|
|
21
|
-
copySync(srcPath: string, destPath: string): void;
|
|
22
|
-
fileExists(filePath: string): Promise<boolean>;
|
|
23
|
-
fileExistsSync(filePath: string): boolean;
|
|
24
|
-
directoryExists(dirPath: string): Promise<boolean>;
|
|
25
|
-
directoryExistsSync(dirPath: string): boolean;
|
|
26
|
-
realpathSync(path: string): string;
|
|
27
|
-
getCurrentDirectory(): string;
|
|
28
|
-
glob(patterns: ReadonlyArray<string>): Promise<string[]>;
|
|
29
|
-
globSync(patterns: ReadonlyArray<string>): string[];
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Create a ts-morph {@link Project} instance used for type reflection and module manipulation during processing
|
|
33
|
-
*
|
|
34
|
-
* @param context - The Powerlines context
|
|
35
|
-
* @returns A ts-morph {@link Project} instance
|
|
36
|
-
*/
|
|
37
|
-
declare function createProgram(context: Context, override: Partial<ProjectOptions>): Project;
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/typescript/tsconfig.d.ts
|
|
40
|
-
/**
|
|
41
|
-
* Get the path to the tsconfig.json file.
|
|
42
|
-
*
|
|
43
|
-
* @param cwd - The root directory of the workspace.
|
|
44
|
-
* @param root - The root directory of the project.
|
|
45
|
-
* @param tsconfig - The path to the tsconfig.json file.
|
|
46
|
-
* @returns The absolute path to the tsconfig.json file.
|
|
47
|
-
* @throws If the tsconfig.json file does not exist.
|
|
48
|
-
*/
|
|
49
|
-
declare function getTsconfigFilePath(cwd: string, root: string, tsconfig?: string): string;
|
|
50
|
-
/**
|
|
51
|
-
* Get the path to the tsconfig.json file.
|
|
52
|
-
*
|
|
53
|
-
* @param cwd - The root directory of the workspace.
|
|
54
|
-
* @param root - The root directory of the project.
|
|
55
|
-
* @param tsconfig - The path to the tsconfig.json file.
|
|
56
|
-
* @returns The absolute path to the tsconfig.json file.
|
|
57
|
-
* @throws If the tsconfig.json file does not exist.
|
|
58
|
-
*/
|
|
59
|
-
declare function tryTsconfigFilePath(cwd: string, root: string, tsconfig: string): string | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* Check if the TypeScript configuration type matches any of the provided types.
|
|
62
|
-
*
|
|
63
|
-
* @param tsconfigType - The type from the TypeScript configuration.
|
|
64
|
-
* @param types - An array of type names to check against.
|
|
65
|
-
* @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
|
|
66
|
-
*/
|
|
67
|
-
declare function findMatch(tsconfigType: string | RegExp | null, types: (string | RegExp | null)[], extensions?: string[]): string | RegExp | null | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Check if the TypeScript configuration type matches any of the provided types.
|
|
70
|
-
*
|
|
71
|
-
* @param tsconfigType - The type from the TypeScript configuration.
|
|
72
|
-
* @param types - An array of type names to check against.
|
|
73
|
-
* @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
|
|
74
|
-
*/
|
|
75
|
-
declare function findIncludeMatch(tsconfigType: string | RegExp | null, types: (string | RegExp | null)[]): string | RegExp | null | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Check if the TypeScript configuration type matches any of the provided types.
|
|
78
|
-
*
|
|
79
|
-
* @param tsconfigType - The type from the TypeScript configuration.
|
|
80
|
-
* @param types - An array of type names to check against.
|
|
81
|
-
* @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
|
|
82
|
-
*/
|
|
83
|
-
declare function isMatchFound(tsconfigType: string | RegExp | null, types: (string | RegExp | null)[]): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Check if the TypeScript configuration type matches any of the provided types.
|
|
86
|
-
*
|
|
87
|
-
* @param tsconfigType - The type from the TypeScript configuration.
|
|
88
|
-
* @param types - An array of type names to check against.
|
|
89
|
-
* @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
|
|
90
|
-
*/
|
|
91
|
-
declare function isIncludeMatchFound(tsconfigType: FilterPattern, types: FilterPattern[]): boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Get the parsed TypeScript configuration.
|
|
94
|
-
*
|
|
95
|
-
* @param workspaceRoot - The root directory of the workspace.
|
|
96
|
-
* @param projectRoot - The root directory of the project.
|
|
97
|
-
* @param tsconfig - The path to the tsconfig.json file.
|
|
98
|
-
* @param tsconfigRaw - The raw tsconfig.json content.
|
|
99
|
-
* @param originalTsconfigJson - The original tsconfig.json content.
|
|
100
|
-
* @param host - The TypeScript parse config host.
|
|
101
|
-
* @returns The resolved TypeScript configuration.
|
|
102
|
-
*/
|
|
103
|
-
declare function getParsedTypeScriptConfig(workspaceRoot: string, projectRoot: string, tsconfig?: string, tsconfigRaw?: TSConfig, originalTsconfigJson?: TSConfig, host?: ts.ParseConfigHost): ParsedTypeScriptConfig;
|
|
104
|
-
//#endregion
|
|
105
|
-
export { VirtualFileSystemHost, createProgram, findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound, isMatchFound, tryTsconfigFilePath };
|
|
106
|
-
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/typescript/ts-morph.ts","../../src/typescript/tsconfig.ts"],"mappings":";;;;;;cA6Ba,qBAAA,SACH,sBAAA,YACG,cAAA;EAAA;cAIQ,OAAA,EAAS,OAAA;EAMZ,UAAA,CAAW,IAAA;EAIX,WAAA,CAAY,OAAA,WAAkB,eAAA;EAoBxB,QAAA,CAAS,QAAA,WAAgB,OAAA;EAQ/B,YAAA,CAAa,QAAA;EAQP,SAAA,CAAU,QAAA,UAAkB,QAAA,WAAgB,OAAA;EAIlD,aAAA,CAAc,QAAA,UAAkB,QAAA;EAI1B,KAAA,CAAM,OAAA,WAAe,OAAA;EAI3B,SAAA,CAAU,OAAA;EAIJ,IAAA,CAAK,OAAA,UAAiB,QAAA,WAAgB,OAAA;EAI5C,QAAA,CAAS,OAAA,UAAiB,QAAA;EAIpB,IAAA,CAAK,OAAA,UAAiB,QAAA,WAAgB,OAAA;EAI5C,QAAA,CAAS,OAAA,UAAiB,QAAA;EAIpB,UAAA,CAAW,QAAA,WAAgB,OAAA;EAIjC,cAAA,CAAe,QAAA;EAIT,eAAA,CAAgB,OAAA,WAAe,OAAA;EAIrC,mBAAA,CAAoB,OAAA;EAIpB,YAAA,CAAa,IAAA;EAIb,mBAAA,CAAA;EAIM,IAAA,CACpB,QAAA,EAAU,aAAA,WACT,OAAA;EAIa,QAAA,CAAS,QAAA,EAAU,aAAA;AAAA;;;;;;;iBAWrB,aAAA,CACd,OAAA,EAAS,OAAA,EACT,QAAA,EAAU,OAAA,CAAQ,cAAA,IACjB,OAAA;;;;;;AAhIH;;;;;;iBCQgB,mBAAA,CACd,GAAA,UACA,IAAA,UACA,QAAA;;;;;;;;;;iBAmCc,mBAAA,CACd,GAAA,UACA,IAAA,UACA,QAAA;;;;;;;;iBAuBc,SAAA,CACd,YAAA,WAAuB,MAAA,SACvB,KAAA,YAAiB,MAAA,YACjB,UAAA,uBACU,MAAA;;;;;;;;iBAkCI,gBAAA,CACd,YAAA,WAAuB,MAAA,SACvB,KAAA,YAAiB,MAAA,sBACP,MAAA;;;;;;;;iBAuCI,YAAA,CACd,YAAA,WAAuB,MAAA,SACvB,KAAA,YAAiB,MAAA;;;;;;;;iBAYH,mBAAA,CACd,YAAA,EAAc,aAAA,EACd,KAAA,EAAO,aAAA;;;;;;;;;;;;iBAqBO,yBAAA,CACd,aAAA,UACA,WAAA,UACA,QAAA,WACA,WAAA,GAAa,QAAA,EACb,oBAAA,GAAuB,QAAA,EACvB,IAAA,GAAM,EAAA,CAAG,eAAA,GACR,sBAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
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
|
-
|
|
4
|
-
export { VirtualFileSystemHost, createProgram, findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound, isMatchFound, tryTsconfigFilePath };
|
|
File without changes
|