moving
Some checks failed
Installer Smoke / installer-smoke (push) Has been cancelled

This commit is contained in:
Oleg Maslov
2026-09-02 10:10:29 +02:00
commit 0c3e2ead3b
3841 changed files with 970576 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
import { describe, expect, it } from 'vitest';
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
const sourceRoot = join(process.cwd(), 'src');
describe('build warning hygiene', () => {
it('does not dynamically import shape-selection from the adapter', () => {
const adapterSource = readFileSync(join(sourceRoot, 'lib', 'adapter.ts'), 'utf8');
expect(adapterSource).not.toContain("import('./shape-selection')");
expect(adapterSource).toContain("from './shape-selection'");
});
it('keeps routed app surfaces out of the root app bundle', () => {
const appSource = readFileSync(join(sourceRoot, 'App.tsx'), 'utf8');
expect(appSource).not.toContain('from "@/routes"');
for (const route of ['HomeRoute', 'LauncherRoute', 'SettingsRoute']) {
expect(appSource).toContain(`lazy(() => import("@/routes/${route}"))`);
}
});
it('keeps closed shell overlays out of the root shell bundle', () => {
const shellSource = readFileSync(join(sourceRoot, 'components', 'os', 'AppShell.tsx'), 'utf8');
expect(shellSource).not.toContain("import ChatHost from './ChatHost'");
expect(shellSource).toContain("lazy(() => import('./ChatHost'))");
for (const overlay of [
'CommandCenter',
'CreateWorkspaceDialog',
'PersonaSwitcher',
'SpawnAgentDialog',
'WorkspaceSwitcher',
'NotificationInbox',
'KeyboardShortcutsHelp',
'OnboardingWizard',
'OnboardingTooltips',
'LoginBriefing',
'ContextRail',
'TrialExpiredModal',
]) {
expect(shellSource).not.toContain(`import ${overlay} from './overlays/${overlay}'`);
expect(shellSource).toContain(`lazy(() => import('./overlays/${overlay}'))`);
}
});
it('keeps cloud analytics out of the startup bundle', () => {
const mainSource = readFileSync(join(sourceRoot, 'main.tsx'), 'utf8');
expect(mainSource).not.toContain('from "@/lib/posthog"');
expect(mainSource).toContain('import("@/lib/posthog")');
});
});