v1.60.0-beta.1: unify background editing and device deletion

This commit is contained in:
Matysh
2026-08-07 11:14:20 +03:00
parent 6a9122f41f
commit 29fb9deb43
61 changed files with 3350 additions and 1191 deletions
+23 -6
View File
@@ -1,8 +1,25 @@
// tsc keeps extensionless relative imports; Node ESM requires explicit ".js".
// Walk the complete output tree: feature modules may import siblings from a
// nested directory, and a root-only pass leaves those suites unable to start.
import { readdirSync, readFileSync, writeFileSync } from 'node:fs';
for (const f of readdirSync('test-build')) {
if (!f.endsWith('.js')) continue;
const p = `test-build/${f}`;
const s = readFileSync(p, 'utf8').replace(/from\s+'(\.\/[\w-]+)'/g, "from '$1.js'");
writeFileSync(p, s);
}
import { extname, join } from 'node:path';
const patchImports = (dir) => {
for (const entry of readdirSync(dir, { withFileTypes: true })) {
const path = join(dir, entry.name);
if (entry.isDirectory()) {
patchImports(path);
continue;
}
if (!entry.name.endsWith('.js')) continue;
const source = readFileSync(path, 'utf8').replace(
/(from\s+['"]|import\s*\(\s*['"])(\.\.?\/[^'"]+)(['"])/g,
(match, prefix, specifier, suffix) => (
extname(specifier) ? match : `${prefix}${specifier}.js${suffix}`
),
);
writeFileSync(path, source);
}
};
patchImports('test-build');