@p8ec/shared 2.5.3 → 2.6.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/README.md +3 -3
- package/dist/cjs/bin/p8-shared-cli.js +5 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,8 +64,8 @@ p8-cli [command] [options]
|
|
|
64
64
|
directory, etc.
|
|
65
65
|
- Example: `p8-cli dirn 1` - shows the parent directory name.
|
|
66
66
|
- `run` - Returns a script string using the detected or specified package manager. Options: `script` - script name,
|
|
67
|
-
`packageManager` - npm
|
|
67
|
+
`packageManager` - `npm`, `yarn`, `pnpm` or `auto` (detected by default), `workspaceMode` - mode of concurrency for workspaces
|
|
68
68
|
(if applicable): `seq` (default) or `par`.
|
|
69
69
|
- Example: `p8-cli run build` - returns the `build` script using the detected package manager.
|
|
70
|
-
- Example: `p8-cli run test
|
|
71
|
-
|
|
70
|
+
- Example: `p8-cli run test auto par` - returns the `test` script using the detected
|
|
71
|
+
package manager in parallel mode for workspaces.
|
|
@@ -93,16 +93,8 @@ Commands:
|
|
|
93
93
|
Returns a command to run a script with the specified package manager.
|
|
94
94
|
Options:
|
|
95
95
|
script: The script to run.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
- 'test': Runs tests.
|
|
99
|
-
- 'lint': Lints the application.
|
|
100
|
-
- 'start-workspace': Starts the workspace.
|
|
101
|
-
- 'build-workspace': Builds the workspace.
|
|
102
|
-
- 'test-workspace': Runs tests in the workspace.
|
|
103
|
-
- 'lint-workspace': Lints the workspace.
|
|
104
|
-
packageManager: The package manager to use (npm, yarn, pnpm). Defaults to npm.
|
|
105
|
-
workspaceMode: Whether to run in workspace mode (seq or par for pnpm). Defaults to none.
|
|
96
|
+
packageManager: The package manager to use ('npm', 'yarn', 'pnpm' or 'auto'). Defaults to npm.
|
|
97
|
+
workspaceMode: Whether to run in workspace mode ('seq' or 'par' for pnpm and yarn, and 'seq' for npm). Defaults to none.
|
|
106
98
|
`);
|
|
107
99
|
if (exports.IS_DEV) {
|
|
108
100
|
writeLn(`DEVELOPMENT MODE`);
|
|
@@ -252,6 +244,9 @@ const run = (script, packageManager = (0, exports.detectPackageManager)(), works
|
|
|
252
244
|
if (!workspaceMode || workspaceMode === 'none') {
|
|
253
245
|
workspaceMode = (0, exports.detectWorkspace)() ? 'seq' : 'none';
|
|
254
246
|
}
|
|
247
|
+
if (packageManager === 'auto') {
|
|
248
|
+
packageManager = (0, exports.detectPackageManager)();
|
|
249
|
+
}
|
|
255
250
|
const pnpmWorkspaceSeq = '-r --workspace-concurrency=1 --if-present --reporter-hide-prefix';
|
|
256
251
|
const pnpmWorkspacePar = '-r --if-present --parallel';
|
|
257
252
|
const yarnWorkspaceSeq = 'workspaces foreach -A';
|