diff --git a/apps/desktop/main/config.ts b/apps/desktop/main/config.ts index 123be51f..c58637f4 100644 --- a/apps/desktop/main/config.ts +++ b/apps/desktop/main/config.ts @@ -2,7 +2,7 @@ * Electron-Specific Runtime Configuration * * Runtime configuration and state for the Electron main process. - * For shared constants, see backend/config.ts + * For shared constants, see apps/desktop/config.ts */ // Re-export shared constants for convenience diff --git a/apps/desktop/main/core-glue.ts b/apps/desktop/main/core-glue.ts index 5c3da5e4..7eb4a80e 100644 --- a/apps/desktop/main/core-glue.ts +++ b/apps/desktop/main/core-glue.ts @@ -29,7 +29,7 @@ * * The URL loaded stays `peek://app/background.html` — the protocol * handler already resolves that to `rootDir/app/background.html`, and - * `WEB_CORE_ADDRESS` in `backend/config.ts` is used elsewhere (e.g. + * `WEB_CORE_ADDRESS` in `apps/desktop/config.ts` is used elsewhere (e.g. * `closeOrHideWindow` refuses to close the core window by address * match, `countVisibleWindows` excludes it, session restore skips it). * diff --git a/apps/desktop/tests/README.md b/apps/desktop/tests/README.md index f3cdf192..20592538 100644 --- a/apps/desktop/tests/README.md +++ b/apps/desktop/tests/README.md @@ -170,7 +170,7 @@ Both test frameworks cover equivalent functionality: | Extension windows | `Peeks`, `Slides`, `Groups` | N/A (UI only) | **Note:** UI-specific tests (Settings, Cmd Palette, extension windows) only run via Playwright. -Tauri Rust tests focus on backend/datastore functionality. +Tauri Rust tests focus on apps/datastore functionality. ## Writing Tests @@ -282,7 +282,7 @@ When working on tests: 1. **Cross-backend tests go in `tests/desktop/`** 2. **Use `desktopApp` fixture, never `_electron` directly** in cross-backend tests -3. **Backend-specific tests go in `backend/{name}/tests/`** +3. **Backend-specific tests go in `apps/{name}/tests/`** 4. **Always use PROFILE for data isolation** 5. **Test both backends before marking complete:** `yarn test` 6. **Follow existing patterns** - look at smoke.spec.ts for examples diff --git a/packages/schema/fidelity.test.js b/packages/schema/fidelity.test.js index cf589d84..fe8e498b 100644 --- a/packages/schema/fidelity.test.js +++ b/packages/schema/fidelity.test.js @@ -3,12 +3,12 @@ * Schema Fidelity Tests * * Verifies that all backend schema implementations match the canonical schema. - * Run with: node schema/fidelity.test.js + * Run with: node packages/schema/fidelity.test.js * yarn schema:test * * These tests: * 1. Parse CREATE TABLE statements from each backend - * 2. Compare against required sync columns from schema/v1.json + * 2. Compare against required sync columns from packages/schema/v1.json * 3. Verify timestamp columns use INTEGER (not TEXT) * 4. Verify id columns use TEXT (not INTEGER) */ @@ -81,7 +81,7 @@ function parseCreateTable(sql, tableName) { * Read schema from Electron datastore.ts */ function getElectronSchema() { - const path = join(__dirname, '../apps/desktop/main/datastore.ts'); + const path = join(__dirname, '../../apps/desktop/main/datastore.ts'); return readFileSync(path, 'utf-8'); } @@ -97,7 +97,7 @@ function getServerSchema() { * Read schema from Tauri Desktop datastore.rs */ function getTauriDesktopSchema() { - const path = join(__dirname, '../apps/tauri-desktop/src-tauri/src/datastore.rs'); + const path = join(__dirname, '../../apps/tauri-desktop/src-tauri/src/datastore.rs'); return readFileSync(path, 'utf-8'); } @@ -105,7 +105,7 @@ function getTauriDesktopSchema() { * Read schema from Tauri Mobile lib.rs */ function getTauriMobileSchema() { - const path = join(__dirname, '../apps/mobile/src-tauri/src/lib.rs'); + const path = join(__dirname, '../../apps/mobile/src-tauri/src/lib.rs'); return readFileSync(path, 'utf-8'); } @@ -359,7 +359,7 @@ describe('Schema Fidelity Tests', () => { const schemaValues = parseSchemaCheckValues('items', 'type'); assert.ok(schemaValues, 'v1.json items.type should have a CHECK constraint'); - const typesTs = readFileSync(join(__dirname, '../backend/types/index.ts'), 'utf-8'); + const typesTs = readFileSync(join(__dirname, '../../apps/desktop/types/index.ts'), 'utf-8'); const match = typesTs.match(/export type ItemType\s*=\s*([^;]+);/); assert.ok(match, 'ItemType should be defined in types/index.ts'); @@ -374,7 +374,7 @@ describe('Schema Fidelity Tests', () => { describe('Table Completeness', () => { test('all tables in Electron createTableStatements are in TypeScript TableName', () => { - const typesTs = readFileSync(join(__dirname, '../backend/types/index.ts'), 'utf-8'); + const typesTs = readFileSync(join(__dirname, '../../apps/desktop/types/index.ts'), 'utf-8'); // Extract TableName union values const tableNameMatch = typesTs.match(/export type TableName\s*=([^;]+);/s); @@ -405,7 +405,7 @@ describe('Schema Fidelity Tests', () => { }); test('tableNames array matches TableName union', () => { - const typesTs = readFileSync(join(__dirname, '../backend/types/index.ts'), 'utf-8'); + const typesTs = readFileSync(join(__dirname, '../../apps/desktop/types/index.ts'), 'utf-8'); // Extract TableName union values const tableNameMatch = typesTs.match(/export type TableName\s*=([^;]+);/s);