bun-workspaces 1.11.1 → 1.12.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/AGENTS.md CHANGED
@@ -11,6 +11,16 @@ Three main domain terms to know:
11
11
 
12
12
  bw also supports **affected workspace** detection: given a set of changed files (from a git diff or an explicit list), it determines which workspaces are meaningfully changed. This drives `bw list-affected`/`bw run-affected` for orchestrating builds, tests, etc. across only the workspaces that need them.
13
13
 
14
+ ### Deprecation Notice
15
+
16
+ bun-workspaces has been **deprecated** and **is now developed as `pacwich`**, which supports Bun, npm, and pnpm workspaces, with a mostly backwards compatible CLI and API.
17
+
18
+ Users can expect little to no disruption beyond the package name change, with the full migration guide available at [https://pacwich.dev/intro/bun-workspaces-migration](https://pacwich.dev/intro/bun-workspaces-migration).
19
+
20
+ An LLM agent can read `https://pacwich.dev/intro/bun-workspaces-migration/index.md` to assist with migration.
21
+
22
+ `bun-workspaces` will not receive further releases save for critical security updates if found.
23
+
14
24
  ## Concepts
15
25
 
16
26
  ### Workspace patterns
package/README.md CHANGED
@@ -1,17 +1,23 @@
1
- <a href="https://bunworkspaces.com">
2
- <img src="./workspaces/web/documentation-website/src/pages/public/images/png/bwunster-bg-rect-title-wide_3000x900.png" alt="bun-workspaces" width="100%" />
3
- </a>
1
+ ## ⚠️ Deprecated Package
2
+
3
+ bun-workspaces has been **deprecated** and **is now developed as [`pacwich`](https://pacwich.dev)**, which supports Bun, npm, and pnpm workspaces, with a mostly backwards compatible CLI and API.
4
4
 
5
- <br/>
5
+ Users can expect little to no disruption beyond the package name change and config file name changes.
6
+ Config files rename to `pacwich.workspace.{ts,js,json,jsonc}` and `pacwich.project.{ts,js,json,jsonc}` (instead of `bw.root.{ts,js,json,jsonc}`).
6
7
 
7
- Full Documentation: [https://bunworkspaces.com](https://bunworkspaces.com)
8
+ A full migration guide covering all differences between the packages is available at [https://pacwich.dev/intro/bun-workspaces-migration](https://pacwich.dev/intro/bun-workspaces-migration).
8
9
 
9
- Changelog: [GitHub Releases](https://github.com/bun-workspaces/bun-workspaces/releases)
10
+ You can also instruct an LLM agent to read `https://pacwich.dev/intro/bun-workspaces-migration/index.md`
11
+ to assist with migration.
10
12
 
11
- Example Projects: [Repository](https://github.com/bun-workspaces/bun-workspaces-examples)
13
+ [Read the launch blog post](https://smorsic.io/blog/pacwich-launch) about the motivations and development strategy.
14
+
15
+ `bun-workspaces` will not receive further releases save for critical security patches if necessary.
12
16
 
13
17
  # bun-workspaces
14
18
 
19
+ [Full Documentation](https://bunworkspaces.com)
20
+
15
21
  A [monorepo](http://sonarsource.com/resources/library/monorepo/) tool that enhances native [Bun workspaces](https://bun.sh/docs/install/workspaces).
16
22
 
17
23
  - Works right away, with **no boilerplate required** 🍽️
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bun-workspaces",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
4
4
  "description": "A monorepo management tool for Bun, with a CLI and API to enhance Bun's native workspaces.",
5
5
  "license": "MIT",
6
6
  "exports": {
@@ -2,6 +2,7 @@ import package_0 from "../../package.json";
2
2
  import { validateCurrentBunVersion } from "../internal/bun/index.mjs";
3
3
  import { createCommand } from "../internal/bundledDeps/commander.mjs";
4
4
  import { BunWorkspacesError } from "../internal/core/index.mjs";
5
+ import { showDeprecationNotice } from "../internal/deprecationNotice.mjs";
5
6
  import { logger } from "../internal/logger/index.mjs";
6
7
  import {
7
8
  defineGlobalCommands,
@@ -13,6 +14,7 @@ import { initializeWithGlobalOptions } from "./globalOptions/index.mjs";
13
14
  import { resolveMiddleware } from "./middleware.mjs";
14
15
 
15
16
  const createCli = ({ defaultCwd = process.cwd(), defaultMiddleware } = {}) => {
17
+ showDeprecationNotice();
16
18
  logger.debug(`Creating CLI with default cwd: ${defaultCwd}`);
17
19
  const run = async ({
18
20
  argv = process.argv,
@@ -0,0 +1,27 @@
1
+ import { logger } from "./logger/index.mjs";
2
+
3
+ const DEPRECATION_NOTICE_STATE = {
4
+ warned: false,
5
+ };
6
+ const showDeprecationNotice = () => {
7
+ if (!DEPRECATION_NOTICE_STATE.warned) {
8
+ DEPRECATION_NOTICE_STATE.warned = true;
9
+ logger.warn(
10
+ `
11
+ bun-workspaces has been \x1b[1;33mdeprecated\x1b[0;33m and is now developed as \x1b[1;33mpacwich\x1b[0;33m, which supports Bun, npm, and pnpm workspaces, with a mostly backwards compatible CLI and API.
12
+
13
+ Users can expect little to no disruption beyond the package name change. Config files rename to pacwich.workspace.{ts,js,json,jsonc} and pacwich.project.{ts,js,json,jsonc} (instead of bw.root.{ts,js,json,jsonc}).
14
+
15
+ A full migration guide including all changes is available: \x1b[4;33mhttps://pacwich.dev/intro/bun-workspaces-migration\x1b[0;33m
16
+
17
+ Installation documentation: \x1b[4;33mhttps://pacwich.dev/intro/getting-started\x1b[0;33m
18
+
19
+ For LLM migration assistance, instruct an agent to read \x1b[4;33mhttps://pacwich.dev/intro/bun-workspaces-migration/index.md\x1b[0;33m
20
+
21
+ bun-workspaces will not receive further releases save for critical security patches if necessary.
22
+ `.trim(),
23
+ );
24
+ }
25
+ };
26
+
27
+ export { DEPRECATION_NOTICE_STATE, showDeprecationNotice };
@@ -10,6 +10,16 @@ Three main domain terms to know:
10
10
  - Script: an entry in the \`scripts\` field of a workspace's \`package.json\` file. bw can also run one-off commands known as "inline scripts," which can use the Bun shell or system shell (\`sh -c\` or \`cmd /d /s /c\` for windows).
11
11
 
12
12
  bw also supports **affected workspace** detection: given a set of changed files (from a git diff or an explicit list), it determines which workspaces are meaningfully changed. This drives \`bw list-affected\`/\`bw run-affected\` for orchestrating builds, tests, etc. across only the workspaces that need them.
13
+
14
+ ### Deprecation Notice
15
+
16
+ bun-workspaces has been **deprecated** and **is now developed as \`pacwich\`**, which supports Bun, npm, and pnpm workspaces, with a mostly backwards compatible CLI and API.
17
+
18
+ Users can expect little to no disruption beyond the package name change, with the full migration guide available at [https://pacwich.dev/intro/bun-workspaces-migration](https://pacwich.dev/intro/bun-workspaces-migration).
19
+
20
+ An LLM agent can read \`https://pacwich.dev/intro/bun-workspaces-migration/index.md\` to assist with migration.
21
+
22
+ \`bun-workspaces\` will not receive further releases save for critical security updates if found.
13
23
  `;
14
24
  const DOC_CONCEPTS = `## Concepts
15
25
 
@@ -25,7 +25,11 @@ import {
25
25
  import { createMultiProcessOutput } from "../../../runScript/output/multiProcessOutput.mjs";
26
26
  import { checkIsRecursiveScript } from "../../../runScript/recursion.mjs";
27
27
  import { resolveScriptShell } from "../../../runScript/scriptShellOption.mjs";
28
- import { findWorkspaces, sortWorkspaces } from "../../../workspaces/index.mjs";
28
+ import {
29
+ findWorkspaces,
30
+ parseWorkspacePattern,
31
+ sortWorkspaces,
32
+ } from "../../../workspaces/index.mjs";
29
33
  import { preventDependencyCycles } from "../../../workspaces/dependencyGraph/index.mjs";
30
34
  import { PROJECT_ERRORS } from "../../errors.mjs";
31
35
  import {
@@ -418,10 +422,9 @@ class _FileSystemProject extends ProjectBase {
418
422
  );
419
423
  }
420
424
  const matchedWorkspaces = sortWorkspaces(
421
- (
422
- options.workspacePatterns ??
423
- this.workspaces.map((workspace) => workspace.name)
424
- ).flatMap((pattern) => this.findWorkspacesByPattern(pattern)),
425
+ options.workspacePatterns
426
+ ? this.findWorkspacesByPattern(...options.workspacePatterns)
427
+ : this.workspaces,
425
428
  );
426
429
  let workspaces = matchedWorkspaces
427
430
  .filter(
@@ -442,13 +445,24 @@ class _FileSystemProject extends ProjectBase {
442
445
  return (aScriptConfig.order ?? 0) - (bScriptConfig.order ?? 0);
443
446
  });
444
447
  if (!workspaces.length) {
448
+ const singlePattern =
449
+ options.workspacePatterns?.length === 1
450
+ ? options.workspacePatterns[0]
451
+ : null;
452
+ const parsedSingle = singlePattern
453
+ ? parseWorkspacePattern(singlePattern)
454
+ : null;
445
455
  const isSingleMatchNotFound =
446
- options.workspacePatterns?.length === 1 &&
447
- !options.workspacePatterns[0].includes("*") &&
456
+ parsedSingle !== null &&
457
+ parsedSingle.target === "default" &&
458
+ !parsedSingle.isNegated &&
459
+ !parsedSingle.isRegex &&
460
+ !parsedSingle.isRootSelector &&
461
+ !parsedSingle.value.includes("*") &&
448
462
  !matchedWorkspaces.length;
449
463
  throw new PROJECT_ERRORS.ProjectWorkspaceNotFound(
450
464
  isSingleMatchNotFound
451
- ? `Workspace name or alias not found: ${JSON.stringify(options?.workspacePatterns?.[0])}`
465
+ ? `Workspace name or alias not found: ${JSON.stringify(singlePattern)}`
452
466
  : `No matching workspaces found with script ${JSON.stringify(options.script)}`,
453
467
  );
454
468
  }
@@ -1,6 +1,7 @@
1
1
  import path from "path";
2
2
  import { validateCurrentBunVersion } from "../../internal/bun/index.mjs";
3
3
  import { validateJSTypes } from "../../internal/core/index.mjs";
4
+ import { showDeprecationNotice } from "../../internal/deprecationNotice.mjs";
4
5
  import { logger } from "../../internal/logger/index.mjs";
5
6
  import { createWorkspaceScriptCommand } from "../../runScript/index.mjs";
6
7
  import { sortWorkspaces } from "../../workspaces/index.mjs";
@@ -15,6 +16,7 @@ const resolveRootWorkspaceSelector = (workspacePattern, project) =>
15
16
  : project.findWorkspaceByNameOrAlias(workspacePattern);
16
17
  class ProjectBase {
17
18
  constructor(_ignoreBunVersion = false) {
19
+ showDeprecationNotice();
18
20
  const bunVersionError = validateCurrentBunVersion();
19
21
  if (bunVersionError && !_ignoreBunVersion) {
20
22
  logger.error(