@elench/testkit 0.1.129 → 0.1.131
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/lib/app/typecheck.mjs +31 -1
- package/node_modules/@elench/next-analysis/package.json +1 -1
- package/node_modules/@elench/testkit-bridge/package.json +2 -2
- package/node_modules/@elench/testkit-protocol/package.json +1 -1
- package/node_modules/@elench/ts-analysis/package.json +1 -1
- package/package.json +5 -5
package/lib/app/typecheck.mjs
CHANGED
|
@@ -101,6 +101,7 @@ function writeNextServiceTypecheckConfig({ productDir, cwd, outputDir, serviceNa
|
|
|
101
101
|
compilerOptions: buildTypecheckCompilerOptions({
|
|
102
102
|
tsconfigPath,
|
|
103
103
|
extendsPath,
|
|
104
|
+
extraPaths: nextRuntimeTypePaths({ tsconfigPath, serviceDir }),
|
|
104
105
|
}),
|
|
105
106
|
include: [
|
|
106
107
|
serviceExists(serviceDir, "next-env.d.ts") ? relativeJsonPath(tsconfigPath, path.join(serviceDir, "next-env.d.ts")) : undefined,
|
|
@@ -202,10 +203,11 @@ function packageTypePaths(tsconfigPath) {
|
|
|
202
203
|
};
|
|
203
204
|
}
|
|
204
205
|
|
|
205
|
-
export function buildTypecheckCompilerOptions({ tsconfigPath, extendsPath, rootDir }) {
|
|
206
|
+
export function buildTypecheckCompilerOptions({ tsconfigPath, extendsPath, rootDir, extraPaths = {} }) {
|
|
206
207
|
const inheritedPaths = extendsPath ? resolveInheritedPathMappings({ tsconfigPath, extendsPath }) : {};
|
|
207
208
|
const paths = {
|
|
208
209
|
...inheritedPaths,
|
|
210
|
+
...extraPaths,
|
|
209
211
|
...packageTypePaths(tsconfigPath),
|
|
210
212
|
};
|
|
211
213
|
|
|
@@ -240,3 +242,31 @@ function resolveInheritedPathMappings({ tsconfigPath, extendsPath }) {
|
|
|
240
242
|
|
|
241
243
|
return Object.fromEntries(mappedEntries);
|
|
242
244
|
}
|
|
245
|
+
|
|
246
|
+
export function nextRuntimeTypePaths({ tsconfigPath, serviceDir }) {
|
|
247
|
+
const nextTypesPath = findNodeModuleFileUpward(serviceDir, [
|
|
248
|
+
path.join("next", "types.d.ts"),
|
|
249
|
+
path.join("next", "types.js"),
|
|
250
|
+
]);
|
|
251
|
+
if (!nextTypesPath) return {};
|
|
252
|
+
|
|
253
|
+
const mappedPath = relativeJsonPath(tsconfigPath, nextTypesPath);
|
|
254
|
+
return {
|
|
255
|
+
"next/types": [mappedPath],
|
|
256
|
+
"next/types.js": [mappedPath],
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function findNodeModuleFileUpward(startDir, packageRelativePaths) {
|
|
261
|
+
let current = path.resolve(startDir);
|
|
262
|
+
while (true) {
|
|
263
|
+
for (const packageRelativePath of packageRelativePaths) {
|
|
264
|
+
const candidate = path.join(current, "node_modules", packageRelativePath);
|
|
265
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const parent = path.dirname(current);
|
|
269
|
+
if (parent === current) return null;
|
|
270
|
+
current = parent;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elench/testkit-bridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.130",
|
|
4
4
|
"description": "Browser bridge helpers for testkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@elench/testkit-protocol": "0.1.
|
|
25
|
+
"@elench/testkit-protocol": "0.1.130"
|
|
26
26
|
},
|
|
27
27
|
"private": false
|
|
28
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elench/testkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.131",
|
|
4
4
|
"description": "Assistant-first CLI for running, inspecting, and debugging local testkit suites",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
@@ -95,10 +95,10 @@
|
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"@babel/code-frame": "^7.29.0",
|
|
98
|
-
"@elench/next-analysis": "0.1.
|
|
99
|
-
"@elench/testkit-bridge": "0.1.
|
|
100
|
-
"@elench/testkit-protocol": "0.1.
|
|
101
|
-
"@elench/ts-analysis": "0.1.
|
|
98
|
+
"@elench/next-analysis": "0.1.130",
|
|
99
|
+
"@elench/testkit-bridge": "0.1.130",
|
|
100
|
+
"@elench/testkit-protocol": "0.1.130",
|
|
101
|
+
"@elench/ts-analysis": "0.1.130",
|
|
102
102
|
"@oclif/core": "^4.10.6",
|
|
103
103
|
"@playwright/test": "^1.52.0",
|
|
104
104
|
"esbuild": "^0.25.11",
|