lucid-package 0.0.29 → 0.0.30

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": "lucid-package",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -10,6 +10,7 @@ const child_process = require("child_process");
10
10
  const shapelibrary_1 = require("./shapelibrary");
11
11
  const packagemanifest_1 = require("./packagemanifest");
12
12
  const path = require("path");
13
+ const shellutil_1 = require("./shellutil");
13
14
  const WebPackCLI = require('webpack-cli');
14
15
  function linkInternalTestingSDK() {
15
16
  if (!oldFs.existsSync('node_modules/lucid-extension-sdk')) {
@@ -19,12 +20,12 @@ function linkInternalTestingSDK() {
19
20
  const sdkPath = cwd.substr(0, pos + rootSearch.length) + 'lucid-extension-sdk';
20
21
  const relativePath = path.relative(cwd, sdkPath);
21
22
  console.log('Using symlink for dependency on SDK for internal testing');
22
- console.log(child_process.execSync(`npm install --silent --save ${relativePath}`).toString());
23
+ console.log((0, shellutil_1.execSyncLoggingOutputOnError)(`npm install --silent --save ${relativePath}`).toString());
23
24
  }
24
25
  }
25
26
  function installDependenciesIfNeeded(isInternalTesting) {
26
27
  if (!oldFs.existsSync('node_modules')) {
27
- console.log(child_process.execSync('npm install --silent').toString());
28
+ console.log((0, shellutil_1.execSyncLoggingOutputOnError)('npm install --silent').toString());
28
29
  }
29
30
  if (!oldFs.existsSync('node_modules/lucid-extension-sdk')) {
30
31
  if (isInternalTesting) {
@@ -32,7 +33,7 @@ function installDependenciesIfNeeded(isInternalTesting) {
32
33
  }
33
34
  else {
34
35
  console.log('Adding dependency on SDK');
35
- console.log(child_process.execSync('npm install --save lucid-extension-sdk').toString());
36
+ console.log((0, shellutil_1.execSyncLoggingOutputOnError)('npm install --save lucid-extension-sdk').toString());
36
37
  }
37
38
  }
38
39
  }
@@ -66,7 +67,7 @@ exports.buildEditorExtension = buildEditorExtension;
66
67
  async function updateExtensionSDK(name) {
67
68
  process.chdir('editorextensions/' + name);
68
69
  console.log('Installing latest SDK in extension ' + name);
69
- console.log(child_process.execSync('npm install lucid-extension-sdk@latest').toString());
70
+ console.log((0, shellutil_1.execSyncLoggingOutputOnError)('npm install lucid-extension-sdk@latest').toString());
70
71
  }
71
72
  exports.updateExtensionSDK = updateExtensionSDK;
72
73
  /**
package/src/package.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.writePackage = exports.updateAllExtensionSDK = exports.modifyManifest = exports.currentlyInPackage = exports.createEmptyPackage = void 0;
4
- const child_process = require("child_process");
5
4
  const fsOld = require("fs");
6
5
  const fs = require("fs/promises");
7
6
  const JSZip = require("jszip");
@@ -9,6 +8,7 @@ const editorextension_1 = require("./editorextension");
9
8
  const filesystemutil_1 = require("./filesystemutil");
10
9
  const packagemanifest_1 = require("./packagemanifest");
11
10
  const shapelibrary_1 = require("./shapelibrary");
11
+ const shellutil_1 = require("./shellutil");
12
12
  async function createEmptyPackage(root) {
13
13
  console.log('Creating empty Lucid Suite package in ' + root);
14
14
  (0, filesystemutil_1.copyFolderRecursiveSync)(__dirname + '/../templates/package', root);
@@ -66,7 +66,7 @@ async function writePackage(quiet = false) {
66
66
  parts[1] +
67
67
  '"';
68
68
  console.log(cmd);
69
- console.log(child_process.execSync(cmd).toString());
69
+ console.log((0, shellutil_1.execSyncLoggingOutputOnError)(cmd).toString());
70
70
  }
71
71
  zip.file(extension['codePath'], await fs.readFile(extension['codePath']));
72
72
  }
@@ -0,0 +1,2 @@
1
+ /// <reference types="node" />
2
+ export declare function execSyncLoggingOutputOnError(cmd: string): Buffer;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execSyncLoggingOutputOnError = void 0;
4
+ const child_process = require("child_process");
5
+ function execSyncLoggingOutputOnError(cmd) {
6
+ try {
7
+ return child_process.execSync(cmd);
8
+ }
9
+ catch (e) {
10
+ console.log(String(e.stdout));
11
+ console.error(String(e.stderr));
12
+ throw e;
13
+ }
14
+ }
15
+ exports.execSyncLoggingOutputOnError = execSyncLoggingOutputOnError;