mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 11:40:39 +09:00
chore(dev): preflight workspace links and simplify worktree helpers
This commit is contained in:
parent
b1e9215375
commit
8e88577371
5 changed files with 83 additions and 188 deletions
|
|
@ -44,6 +44,13 @@ function discoverWorkspacePackagePaths(rootDir: string): Map<string, string> {
|
|||
}
|
||||
|
||||
const workspacePackagePaths = discoverWorkspacePackagePaths(repoRoot);
|
||||
const workspaceDirs = Array.from(
|
||||
new Set(
|
||||
Array.from(workspacePackagePaths.values())
|
||||
.map((packagePath) => path.relative(repoRoot, packagePath))
|
||||
.filter((workspaceDir) => workspaceDir.length > 0),
|
||||
),
|
||||
).sort();
|
||||
|
||||
function findWorkspaceLinkMismatches(workspaceDir: string): WorkspaceLinkMismatch[] {
|
||||
const packageJson = readJsonFile(path.join(repoRoot, workspaceDir, "package.json"));
|
||||
|
|
@ -100,6 +107,6 @@ async function ensureWorkspaceLinksCurrent(workspaceDir: string) {
|
|||
);
|
||||
}
|
||||
|
||||
for (const workspaceDir of ["server", "ui"]) {
|
||||
for (const workspaceDir of workspaceDirs) {
|
||||
await ensureWorkspaceLinksCurrent(workspaceDir);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue