@paleo/workspace 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/slots.d.ts +1 -1
- package/dist/slots.js +1 -1
- package/dist/workspace.js +8 -8
- package/package.json +1 -1
package/dist/slots.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PortScheme } from "./ports.js";
|
|
2
|
-
export declare const REGISTRY_SUBDIR = "
|
|
2
|
+
export declare const REGISTRY_SUBDIR = "workspace-registry";
|
|
3
3
|
export declare function registryDirFor(runtimeDir: string): string;
|
|
4
4
|
/** `registryDir` is gone from the config types but may linger in a consumer's config file. */
|
|
5
5
|
export declare function warnLegacyRegistryDir(config: {
|
package/dist/slots.js
CHANGED
|
@@ -3,7 +3,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
3
3
|
import { dirname, join, resolve } from "node:path";
|
|
4
4
|
import { allPorts, isValidPort } from "./ports.js";
|
|
5
5
|
import { getWorktreeBranch } from "./worktree.js";
|
|
6
|
-
export const REGISTRY_SUBDIR = "
|
|
6
|
+
export const REGISTRY_SUBDIR = "workspace-registry";
|
|
7
7
|
const SLOTS_FILENAME = "slots.json";
|
|
8
8
|
export function registryDirFor(runtimeDir) {
|
|
9
9
|
return join(runtimeDir, REGISTRY_SUBDIR);
|
package/dist/workspace.js
CHANGED
|
@@ -122,7 +122,7 @@ async function runSetup(command, ctx, run, config, registryDir) {
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
linkSharedDirectories(setupCtx, config.sharedDirs, verboseLog);
|
|
125
|
-
|
|
125
|
+
linkWorkspaceRegistry(setupCtx, config.runtimeDir, verboseLog);
|
|
126
126
|
generateConfigFiles(setupCtx, config.configFiles, slot, ports, command.force, verboseLog);
|
|
127
127
|
teeLog(config.printSummary({
|
|
128
128
|
slot,
|
|
@@ -459,7 +459,7 @@ function handleSetOwnerMode(command, ctx, registryDir) {
|
|
|
459
459
|
}
|
|
460
460
|
console.log(`Owner for slot ${slotPort}: ${newOwner ?? "(none)"}`);
|
|
461
461
|
}
|
|
462
|
-
/** Transitional (0.16 only): merge a pre-0.16 registry into `${runtimeDir}/
|
|
462
|
+
/** Transitional (0.16 only): merge a pre-0.16 registry into `${runtimeDir}/workspace-registry`. */
|
|
463
463
|
function handleMigrate(command, config, newRel) {
|
|
464
464
|
const ctx = detectWorktree();
|
|
465
465
|
const oldRel = command.oldRegistryDir;
|
|
@@ -504,7 +504,7 @@ function relinkWorktrees(slots, mainWorktree, runtimeDir) {
|
|
|
504
504
|
console.warn(`Warning: worktree ${entry.worktree} not found; skipping symlink.`);
|
|
505
505
|
continue;
|
|
506
506
|
}
|
|
507
|
-
|
|
507
|
+
linkWorkspaceRegistry({ currentWorktree: entry.worktree, mainWorktree, isMainWorktree: false }, runtimeDir, console.log, { force: true });
|
|
508
508
|
++count;
|
|
509
509
|
}
|
|
510
510
|
return count;
|
|
@@ -534,11 +534,11 @@ function linkSharedDirectories(ctx, dirs, log) {
|
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
/**
|
|
537
|
-
* Symlinks the linked worktree's `${runtimeDir}/
|
|
537
|
+
* Symlinks the linked worktree's `${runtimeDir}/workspace-registry` to the main worktree's, so the
|
|
538
538
|
* cwd-relative registry read in `resolveCurrentSlot` reaches main. `runtimeDir` is per-worktree and
|
|
539
539
|
* not in `sharedDirs`, so this is distinct from {@link linkSharedDirectories}.
|
|
540
540
|
*/
|
|
541
|
-
function
|
|
541
|
+
function linkWorkspaceRegistry(ctx, runtimeDir, log, opts) {
|
|
542
542
|
if (ctx.isMainWorktree)
|
|
543
543
|
return;
|
|
544
544
|
const mainDir = join(ctx.mainWorktree, runtimeDir, REGISTRY_SUBDIR);
|
|
@@ -551,17 +551,17 @@ function linkSharedRegistry(ctx, runtimeDir, log, opts) {
|
|
|
551
551
|
const linkStat = lstatSync(link, { throwIfNoEntry: false });
|
|
552
552
|
if (linkStat) {
|
|
553
553
|
if (!linkStat.isSymbolicLink()) {
|
|
554
|
-
log("Skipped
|
|
554
|
+
log("Skipped workspace-registry symlink (a real directory exists here).");
|
|
555
555
|
return;
|
|
556
556
|
}
|
|
557
557
|
if (!opts?.force && existsSync(link)) {
|
|
558
|
-
log("Skipped
|
|
558
|
+
log("Skipped workspace-registry symlink (already exists).");
|
|
559
559
|
return;
|
|
560
560
|
}
|
|
561
561
|
rmSync(link);
|
|
562
562
|
}
|
|
563
563
|
symlinkSync(relative(runtimeRoot, mainDir), link);
|
|
564
|
-
log("Created
|
|
564
|
+
log("Created workspace-registry symlink → main worktree.");
|
|
565
565
|
}
|
|
566
566
|
function generateConfigFiles(ctx, entries, slot, ports, force, log) {
|
|
567
567
|
for (const entry of entries) {
|