@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 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, yarn, or pnpm (auto-detected by default), `workspaceMode` - mode of concurrency for workspaces
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 pnpm par` - returns the `test` script using
71
- `pnpm` in parallel mode for workspaces.
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
- - 'start': Starts the application.
97
- - 'build': Builds the application.
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@p8ec/shared",
3
- "version": "2.5.3",
3
+ "version": "2.6.0",
4
4
  "description": "P(8) Global Shared Library for Javascript",
5
5
  "repository": {
6
6
  "type": "git",