@p8ec/shared 2.6.0 → 2.6.1
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 +1 -1
- package/dist/cjs/bin/p8-shared-cli.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ p8-cli [command] [options]
|
|
|
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
67
|
`packageManager` - `npm`, `yarn`, `pnpm` or `auto` (detected by default), `workspaceMode` - mode of concurrency for workspaces
|
|
68
|
-
(if applicable): `seq` (default)
|
|
68
|
+
(if applicable): `seq`, `par`, `auto` (detected by default).
|
|
69
69
|
- Example: `p8-cli run build` - returns the `build` script using the detected package manager.
|
|
70
70
|
- Example: `p8-cli run test auto par` - returns the `test` script using the detected
|
|
71
71
|
package manager in parallel mode for workspaces.
|
|
@@ -94,7 +94,7 @@ Commands:
|
|
|
94
94
|
Options:
|
|
95
95
|
script: The script to run.
|
|
96
96
|
packageManager: The package manager to use ('npm', 'yarn', 'pnpm' or 'auto'). Defaults to npm.
|
|
97
|
-
workspaceMode: Whether to run in workspace mode ('seq'
|
|
97
|
+
workspaceMode: Whether to run in workspace mode ('seq', 'par', 'auto' for pnpm and yarn, and 'seq' for npm). Defaults to none.
|
|
98
98
|
`);
|
|
99
99
|
if (exports.IS_DEV) {
|
|
100
100
|
writeLn(`DEVELOPMENT MODE`);
|
|
@@ -239,12 +239,12 @@ const dirn = (levelsUp) => {
|
|
|
239
239
|
return process.cwd().split(path.sep).reverse()[levels];
|
|
240
240
|
};
|
|
241
241
|
exports.dirn = dirn;
|
|
242
|
-
const run = (script, packageManager
|
|
242
|
+
const run = (script, packageManager, workspaceMode) => {
|
|
243
243
|
var _a;
|
|
244
|
-
if (!workspaceMode || workspaceMode === '
|
|
244
|
+
if (!workspaceMode || workspaceMode === 'auto') {
|
|
245
245
|
workspaceMode = (0, exports.detectWorkspace)() ? 'seq' : 'none';
|
|
246
246
|
}
|
|
247
|
-
if (packageManager === 'auto') {
|
|
247
|
+
if (!packageManager || packageManager === 'auto') {
|
|
248
248
|
packageManager = (0, exports.detectPackageManager)();
|
|
249
249
|
}
|
|
250
250
|
const pnpmWorkspaceSeq = '-r --workspace-concurrency=1 --if-present --reporter-hide-prefix';
|