Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions apps/desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ signature seal. Write access to this repository is therefore a deliberate trust
assumption of the development workflow — a separate matter from who may claim
the bundle's identity.

The default profile is `~/Library/Application Support/Maka Dev-<worktree-id>`,
which keeps development isolated from the packaged Maka profile; an explicit
`--user-data-dir` takes precedence. Shutdown matches this worktree's own bundle
path, so a concurrent worktree's app is unaffected. Because that lock is keyed
The default profile is `~/Library/Application Support/Maka Dev`, which keeps
development isolated from the packaged Maka profile and is shared by the
repository CLI (`npm run cli:dev`), the plain dev build, and the TCC dev build;
an explicit `--user-data-dir` takes precedence. Shutdown matches this worktree's
own bundle path, so a concurrent worktree's app survives — and then holds the
single-instance lock for the shared profile. Because that lock is keyed
on the profile, a launch first reclaims any app left over from a hard-killed
session — otherwise the stale app would absorb the new launch and keep showing
its old, dead Vite URL.
Expand Down
16 changes: 10 additions & 6 deletions apps/desktop/scripts/dev-app-runtime.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ const MARKER = join(DEV_RUNTIME_DIR, 'runtime.json');
const ELECTRON_PACKAGE = join(REPO_ROOT, 'node_modules', 'electron', 'package.json');
const SOURCE_APP = join(REPO_ROOT, 'node_modules', 'electron', 'dist', 'Electron.app');
const WORKTREE_ID = createHash('sha256').update(REPO_ROOT).digest('hex').slice(0, 12);
const DEV_USER_DATA_DIR = join(
homedir(),
'Library',
'Application Support',
`Maka Dev-${WORKTREE_ID}`,
);
// Deliberately NOT worktree-scoped, unlike the bundle identifier above: the
// profile is what `app.setName('Maka Dev')` already yields on the plain
// `npm run dev` path and what `npm run cli:dev` writes to, so scoping it here
// would only mean that turning MAKA_DEV_TCC on silently switched the
// developer's database. TCC isolation is provided by DEV_BUNDLE_ID, not by the
// data root. An explicit `--user-data-dir=` still takes precedence.
const DEV_USER_DATA_DIR = join(homedir(), 'Library', 'Application Support', 'Maka Dev');

/**
* Per-worktree, and deliberately so. An ad-hoc signature designates a bare
Expand Down Expand Up @@ -484,6 +485,9 @@ export function createRuntimeMarker(electronVersion) {
electronVersion,
bundleId: DEV_BUNDLE_ID,
desktopDir: DESKTOP_DIR,
// Burned into the generated bootstrap, so a change here must invalidate
// the cached bundle (isDevelopmentRuntimeCurrent compares every field).
userDataDir: DEV_USER_DATA_DIR,
};
}

Expand Down