fix: keep lazy editor build portable

Issue: #337
User-Visible: no
This commit is contained in:
Matysh
2026-08-28 08:29:44 +03:00
parent 59be9c8565
commit df450c9c5e
18 changed files with 142 additions and 113 deletions
+17
View File
@@ -103,3 +103,20 @@ test('lazy runtime boundary keeps the eager entry independent and does not grow
);
assert.ok(anyCount <= 1123, `src any count grew from 1123 to ${anyCount}`);
});
test('source type references stay portable across build hosts', () => {
const sources = [];
const visit = (directory) => {
for (const name of readdirSync(directory)) {
const path = join(directory, name);
if (statSync(path).isDirectory()) visit(path);
else if (/\.ts$/.test(name)) sources.push(readFileSync(path, 'utf8'));
}
};
visit(join(repoRoot, 'src'));
assert.doesNotMatch(
sources.join('\n'),
/import\(["'][A-Za-z]:[\\/]/,
'type imports must not capture an absolute Windows workspace path',
);
});
+5 -1
View File
@@ -168,7 +168,11 @@ test('release ZIP inspection is portable and does not depend on tar', () => {
assert.equal(archived.status, 0, archived.stderr || archived.stdout);
const entries = readZipEntries(zip, ['manifest.json', 'frontend/houseplan-card.js']);
assert.equal(typeof JSON.parse(entries.get('manifest.json').toString('utf8')).version, 'string');
assert.ok(entries.get('frontend/houseplan-card.js').length > 1_000);
const entry = entries.get('frontend/houseplan-card.js');
// #337 deliberately turns the public entry into a tiny bootstrap; the
// manifest-driven verifier owns completeness of its hashed asset tree.
assert.ok(entry.length > 100);
assert.match(entry.toString('utf8'), /__HOUSEPLAN_BUILD_FINGERPRINT__/);
const committedResult = spawnSync('git', ['show', 'HEAD:dist/houseplan-card.js'], {
cwd: root,
// The production bundle is larger than Node's spawnSync default buffer.