@bobfrankston/npmglobalize 1.0.158 → 1.0.159

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.
Files changed (2) hide show
  1. package/cli.js +4 -7
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * npmglobalize CLI - Transform file: dependencies to npm versions for publishing
4
4
  */
5
- import { globalize, globalizeWorkspace, installCleanupHandlers, readConfig, readPackageJson, readUserNpmConfig, writeConfig, writePackageJson, confirm, getBuildIssues, clearBuildIssues, recordBuildIssue, extractFirstTscError, ensureFileDepModules } from './lib.js';
5
+ import { globalize, globalizeWorkspace, installCleanupHandlers, readConfig, readPackageJson, readUserNpmConfig, writeConfig, writePackageJson, confirm, getBuildIssues, clearBuildIssues, recordBuildIssue, extractFirstTscError, ensureFileDepModules, runCommand } from './lib.js';
6
6
  import fs from 'fs';
7
7
  import path from 'path';
8
8
  import { styleText } from 'util';
@@ -454,16 +454,13 @@ export async function main() {
454
454
  }
455
455
  if (pkg.scripts?.build) {
456
456
  ensureFileDepModules(cwd, !!cliOptions.verbose);
457
- const { spawnSync } = await import('child_process');
458
457
  console.log(`Building ${cwd}...`);
459
- const buildResult = spawnSync('npm', ['run', 'build'], {
460
- cwd, encoding: 'utf-8', stdio: 'pipe', shell: true
461
- });
462
- if (buildResult.status === 0) {
458
+ const buildResult = runCommand('npm', ['run', 'build'], { cwd, silent: true });
459
+ if (buildResult.success) {
463
460
  console.log(styleText('green', '✓ Build succeeded'));
464
461
  }
465
462
  else {
466
- const buildOutput = (buildResult.stderr || '') + (buildResult.stdout || '');
463
+ const buildOutput = (buildResult.stderr || '') + (buildResult.output || '');
467
464
  if (buildOutput)
468
465
  console.error(buildOutput);
469
466
  console.error(styleText('red', `Build failed in ${cwd}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/npmglobalize",
3
- "version": "1.0.158",
3
+ "version": "1.0.159",
4
4
  "description": "Transform file: dependencies to npm versions for publishing",
5
5
  "main": "index.js",
6
6
  "type": "module",