@jcoreio/toolchain 3.5.0 → 3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcoreio/toolchain",
3
- "version": "3.5.0",
3
+ "version": "3.6.0",
4
4
  "description": "base JS build toolchain",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,7 +33,8 @@ const scripts = {
33
33
  name,
34
34
  typeof script === 'string'
35
35
  ? {
36
- run: () => execa(script, { shell: true }),
36
+ run: (args = []) =>
37
+ execa([script, ...args].join(' '), { shell: true }),
37
38
  description: script,
38
39
  }
39
40
  : script,
@@ -48,9 +49,13 @@ async function toolchain(command, args) {
48
49
  /* eslint-disable no-console */
49
50
  console.error('Usage: toolchain <command> <arguments...>\n')
50
51
  console.error('Available commands:')
52
+ const scriptColWidth =
53
+ Math.max(...Object.keys(scripts).map((s) => s.length)) + 1
51
54
  for (const script of Object.keys(scripts).sort()) {
52
55
  console.error(
53
- chalk` {bold ${script.padEnd(20)}}${scripts[script].description}`
56
+ chalk` {bold ${script.padEnd(scriptColWidth)}}${
57
+ scripts[script].description
58
+ }`
54
59
  )
55
60
  }
56
61
  /* eslint-enable no-console */