everything-dev 1.22.0 → 1.23.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/src/plugin.ts CHANGED
@@ -17,6 +17,7 @@ import {
17
17
  runDockerComposeUp,
18
18
  runTypesGen,
19
19
  scaffoldMinimalProject,
20
+ stripOrphanedWorkspacesFromLockfile,
20
21
  writeInitSnapshot,
21
22
  } from "./cli/init";
22
23
  import { promptInitOptions } from "./cli/prompts";
@@ -1428,6 +1429,10 @@ export default createPlugin({
1428
1429
  );
1429
1430
  }
1430
1431
 
1432
+ const lockfilePath = join(targetDir, "bun.lock");
1433
+ const allowedWorkspaces = computeAllowedWorkspaces(overrides, plugins);
1434
+ stripOrphanedWorkspacesFromLockfile(lockfilePath, allowedWorkspaces);
1435
+
1431
1436
  const initConfig = await timePhase(
1432
1437
  timings,
1433
1438
  "resolve config",
@@ -1454,8 +1459,12 @@ export default createPlugin({
1454
1459
  );
1455
1460
 
1456
1461
  if (!input.noInstall) {
1457
- await timePhase(timings, "install dependencies", () => runBunInstall(targetDir), s);
1458
- await timePhase(timings, "generate types", () => runTypesGen(targetDir), s);
1462
+ await timePhase(timings, "install dependencies", () =>
1463
+ runBunInstall(targetDir, s ?? undefined),
1464
+ );
1465
+ await timePhase(timings, "generate types", () =>
1466
+ runTypesGen(targetDir, s ?? undefined),
1467
+ );
1459
1468
  await timePhase(
1460
1469
  timings,
1461
1470
  "generate migrations",
@@ -1738,3 +1747,23 @@ function extractTransactionHash(error: unknown) {
1738
1747
  const match = message.match(/Transaction ID:\s*([A-Za-z0-9]+)/i);
1739
1748
  return match?.[1];
1740
1749
  }
1750
+
1751
+ const OVERRIDE_WORKSPACE_MAP: Record<string, string[]> = {
1752
+ ui: ["ui"],
1753
+ api: ["api"],
1754
+ host: ["host"],
1755
+ plugins: [],
1756
+ };
1757
+
1758
+ function computeAllowedWorkspaces(overrides: string[], plugins?: string[]): string[] {
1759
+ const workspaces: string[] = [];
1760
+ for (const section of overrides) {
1761
+ workspaces.push(...(OVERRIDE_WORKSPACE_MAP[section] ?? []));
1762
+ }
1763
+ if (plugins) {
1764
+ for (const plugin of plugins) {
1765
+ workspaces.push(`plugins/${plugin}`);
1766
+ }
1767
+ }
1768
+ return workspaces;
1769
+ }