bun-workspaces 0.2.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.
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.
@@ -23,6 +47,7 @@ alias bw="bunx bun-workspaces"
23
47
  # List all workspaces
24
48
  bw list-workspaces
25
49
  bw ls
50
+
26
51
  # List workspace names only
27
52
  bw list-workspaces --name-only
28
53
 
@@ -31,6 +56,7 @@ bw list-workspaces "my-*"
31
56
 
32
57
  # List all workspace scripts
33
58
  bw list-scripts
59
+
34
60
  # List script names only
35
61
  bw list-scripts --name-only
36
62
 
@@ -40,21 +66,28 @@ bw info my-workspace
40
66
 
41
67
  # Get info about a script
42
68
  bw script-info my-script
69
+
43
70
  # Only print list of workspace names that have the script
44
71
  bw script-info my-script --workspaces-only
45
72
 
73
+ # Get JSON output
74
+ bw list-workspaces --json --pretty # optionally pretty print JSON
75
+ bw list-scripts --json
76
+ bw workspace-info my-workspace --json
77
+ bw script-info my-script --json
78
+
46
79
  # Run a script for all
47
80
  # workspaces that have it
48
81
  # in their `scripts` field
49
82
  bw run my-script
50
83
 
51
- # 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
52
85
  bw run my-script my-workspace
53
86
 
54
87
  # Run a script for multiple workspaces
55
88
  bw run my-script workspace-a workspace-b
56
89
 
57
- # Run a script for workspaces using wildcard
90
+ # Run a script for workspaces using wildcard (does not take into account workspace aliases)
58
91
  bw run my-script "my-workspace-*"
59
92
 
60
93
  # Run script in parallel for all workspaces
@@ -63,6 +96,9 @@ bw run my-script --parallel
63
96
  # Append args to each script call
64
97
  bw run my-script --args "--my --args"
65
98
 
99
+ # Use the workspace name in args
100
+ bw run my-script --args "--my --args=<workspace>"
101
+
66
102
  # Help (--help can also be passed to any command)
67
103
  bw help
68
104
  bw --help
@@ -70,4 +106,10 @@ bw --help
70
106
  # Pass --cwd to any command
71
107
  bw --cwd /path/to/your/project ls
72
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
73
115
  ```