bun-workspaces 0.3.0 → 1.0.0-alpha

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.
Files changed (41) hide show
  1. package/README.md +32 -2
  2. package/bun.lock +576 -0
  3. package/package.json +14 -15
  4. package/src/cli/cli.ts +3 -8
  5. package/src/cli/globalOptions.ts +61 -23
  6. package/src/cli/projectCommands.ts +41 -40
  7. package/src/config/bunWorkspacesConfig.ts +62 -0
  8. package/src/config/configFile.ts +33 -0
  9. package/src/config/index.ts +7 -0
  10. package/src/internal/env.ts +25 -1
  11. package/src/internal/logger.ts +143 -19
  12. package/src/project/project.ts +24 -1
  13. package/src/workspaces/errors.ts +2 -0
  14. package/src/workspaces/findWorkspaces.ts +36 -8
  15. package/src/workspaces/index.ts +0 -1
  16. package/src/workspaces/packageJson.ts +1 -1
  17. package/src/workspaces/workspace.ts +2 -0
  18. package/.vscode/extensions.json +0 -12
  19. package/.vscode/settings.json +0 -23
  20. package/bun-workspaces-0.1.0-alpha-test-publish-2.tgz +0 -0
  21. package/eslint.config.mjs +0 -45
  22. package/ignore-me-CHANGELOG_TEMPLATE.md +0 -264
  23. package/ignore-me-test-projects/no-fail/applications/applicationA/package.json +0 -8
  24. package/ignore-me-test-projects/no-fail/applications/applicationB/package.json +0 -8
  25. package/ignore-me-test-projects/no-fail/libraries/libraryA/package.json +0 -8
  26. package/ignore-me-test-projects/no-fail/libraries/libraryB/package.json +0 -8
  27. package/ignore-me-test-projects/no-fail/libraries/nested/libraryC/package.json +0 -8
  28. package/ignore-me-test-projects/no-fail/package.json +0 -7
  29. package/ignore-me-test-projects/one-fail/applications/applicationA/package.json +0 -8
  30. package/ignore-me-test-projects/one-fail/applications/applicationB/package.json +0 -8
  31. package/ignore-me-test-projects/one-fail/libraries/libraryA/package.json +0 -8
  32. package/ignore-me-test-projects/one-fail/libraries/libraryB/package.json +0 -8
  33. package/ignore-me-test-projects/one-fail/libraries/nested/libraryC/package.json +0 -8
  34. package/ignore-me-test-projects/one-fail/package.json +0 -7
  35. package/ignore-me-test-projects/two-fail/applications/applicationA/package.json +0 -8
  36. package/ignore-me-test-projects/two-fail/applications/applicationB/package.json +0 -8
  37. package/ignore-me-test-projects/two-fail/libraries/libraryA/package.json +0 -8
  38. package/ignore-me-test-projects/two-fail/libraries/libraryB/package.json +0 -8
  39. package/ignore-me-test-projects/two-fail/libraries/nested/libraryC/package.json +0 -8
  40. package/ignore-me-test-projects/two-fail/package.json +0 -7
  41. package/src/cli/output.ts +0 -6
package/README.md CHANGED
@@ -13,6 +13,30 @@ $ bun add --dev bun-workspaces
13
13
  $ bunx bun-workspaces --help
14
14
  ```
15
15
 
16
+ ### Config file
17
+
18
+ You can create a config file at `bw.json` in your project root, or you can pass a config file to the CLI with the `--configFile` (or `-c`) option.
19
+
20
+ #### Example config
21
+
22
+ In this config, "app-a" is an alias for package "@my-org/application-a" and "app-b" is an alias for package "@my-org/application-b".
23
+
24
+ CLI log levels are `debug`, `info`, `warn`, and `error` or `silent`. The default log level is `info`. Commands that are intended to print specific output will still print at `silent`, such as `list-workspaces`, `list-scripts`, `workspace-info`, `script-info`, etc., but other logs will be suppressed.
25
+
26
+ ```json
27
+ {
28
+ "workspaceAliases": {
29
+ "app-a": "@my-org/application-a",
30
+ "app-b": "@my-org/application-b"
31
+ },
32
+ "cli": {
33
+ "logLevel": "warn"
34
+ }
35
+ }
36
+ ```
37
+
38
+ You can also pass a config file to the CLI with the `-c` or `--configFile` option.
39
+
16
40
  ### Examples
17
41
 
18
42
  You might consider making a shorter alias in your `.bashrc`, `.zshrc`, or similar shell configuration file, such as `alias bw="bunx bun-workspaces"`, for convenience.
@@ -57,13 +81,13 @@ bw script-info my-script --json
57
81
  # in their `scripts` field
58
82
  bw run my-script
59
83
 
60
- # Run a script for a specific workspace
84
+ # Run a script for a specific workspace by its package.json name or alias from the config
61
85
  bw run my-script my-workspace
62
86
 
63
87
  # Run a script for multiple workspaces
64
88
  bw run my-script workspace-a workspace-b
65
89
 
66
- # Run a script for workspaces using wildcard
90
+ # Run a script for workspaces using wildcard (does not take into account workspace aliases)
67
91
  bw run my-script "my-workspace-*"
68
92
 
69
93
  # Run script in parallel for all workspaces
@@ -82,4 +106,10 @@ bw --help
82
106
  # Pass --cwd to any command
83
107
  bw --cwd /path/to/your/project ls
84
108
  bw --cwd /path/to/your/project run-script my-script
109
+
110
+ # Pass --configFile to any command
111
+ bw --configFile /path/to/your/config.json ls
112
+
113
+ # Pass --logLevel to any command (debug, info, warn, error, or silent)
114
+ bw --logLevel silent run my-script
85
115
  ```