@sasjs/cli 4.20.6 → 4.20.7

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 (42) hide show
  1. package/build/commands/add/spec/addTarget.spec.js +5 -5
  2. package/build/commands/build/spec/build.spec.js +3 -3
  3. package/build/commands/compile/internal/spec/compileTestFile.spec.js +1 -1
  4. package/build/commands/compile/spec/compareFolders.spec.js +2 -1
  5. package/build/commands/compile/spec/compile.spec.js +7 -7
  6. package/build/commands/compile/spec/compileFile.spec.js +1 -1
  7. package/build/commands/compile/spec/copyFilesToBuildFolder.spec.js +1 -1
  8. package/build/commands/compile/spec/loadDependencies.spec.js +1 -1
  9. package/build/commands/create/spec/create.spec.js +45 -11
  10. package/build/commands/db/spec/db.spec.js +1 -1
  11. package/build/commands/deploy/spec/cbd.spec.js +1 -1
  12. package/build/commands/deploy/spec/deploy.spec.js +1 -1
  13. package/build/commands/deploy/spec/getDeployScripts.spec.js +1 -1
  14. package/build/commands/docs/generateDocs.js +2 -2
  15. package/build/commands/docs/spec/generateDocs.spec.js +41 -8
  16. package/build/commands/docs/spec/generateDot.spec.js +3 -3
  17. package/build/commands/docs/spec/initDocs.spec.js +1 -1
  18. package/build/commands/flow/internal/spec/saveToCsv.spec.js +4 -3
  19. package/build/commands/flow/internal/spec/validateParams.spec.js +2 -1
  20. package/build/commands/init/spec/init.spec.js +3 -3
  21. package/build/commands/testing/spec/testing.spec.js +1 -1
  22. package/build/commands/version/version.js +4 -9
  23. package/build/commands/web/internal/spec/updateScriptTag.spec.js +2 -1
  24. package/build/commands/web/internal/spec/updateStyleTag.spec.js +2 -1
  25. package/build/commands/web/spec/web.spec.js +1 -1
  26. package/build/utils/auth.d.ts +6 -0
  27. package/build/utils/auth.js +7 -1
  28. package/build/utils/shell.d.ts +60 -0
  29. package/build/utils/shell.js +155 -0
  30. package/build/utils/spec/auth.spec.js +13 -0
  31. package/build/utils/spec/config.spec.js +13 -13
  32. package/build/utils/spec/downloadFile.spec.js +37 -10
  33. package/build/utils/spec/file.spec.js +2 -1
  34. package/build/utils/spec/shell.spec.d.ts +1 -0
  35. package/build/utils/spec/shell.spec.js +156 -0
  36. package/build/utils/spec/utils.spec.js +5 -5
  37. package/build/utils/spec/zip.spec.js +2 -1
  38. package/build/utils/test.d.ts +10 -0
  39. package/build/utils/test.js +16 -1
  40. package/build/utils/utils.d.ts +2 -2
  41. package/build/utils/utils.js +65 -31
  42. package/package.json +1 -3
@@ -343,7 +343,7 @@ describe('utils', function () {
343
343
  });
344
344
  });
345
345
  describe('loadEnvVariables', function () {
346
- var fileName = ".env.".concat((0, utils_2.generateTimestamp)());
346
+ var fileName = ".env.".concat((0, test_1.generateUniqueTimestamp)());
347
347
  var filePath = path_1.default.join(process.projectDir, fileName);
348
348
  beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
349
349
  var fileContent;
@@ -426,7 +426,7 @@ describe('utils', function () {
426
426
  return __generator(this, function (_a) {
427
427
  switch (_a.label) {
428
428
  case 0:
429
- projectDir = path_1.default.join(__dirname, "is-sasjs-project-".concat((0, utils_2.generateTimestamp)()));
429
+ projectDir = path_1.default.join(__dirname, "is-sasjs-project-".concat((0, test_1.generateUniqueTimestamp)()));
430
430
  originalProjectDir = process.projectDir;
431
431
  return [4 /*yield*/, (0, utils_2.createFolder)(path_1.default.join(projectDir, 'sasjs'))];
432
432
  case 1:
@@ -451,7 +451,7 @@ describe('utils', function () {
451
451
  return __generator(this, function (_a) {
452
452
  switch (_a.label) {
453
453
  case 0:
454
- projectDir = path_1.default.join(require('os').tmpdir(), "not-a-sasjs-project-".concat((0, utils_2.generateTimestamp)()));
454
+ projectDir = path_1.default.join(require('os').tmpdir(), "not-a-sasjs-project-".concat((0, test_1.generateUniqueTimestamp)()));
455
455
  originalProjectDir = process.projectDir;
456
456
  return [4 /*yield*/, (0, utils_2.createFolder)(projectDir)];
457
457
  case 1:
@@ -498,8 +498,8 @@ describe('utils', function () {
498
498
  return __generator(this, function (_a) {
499
499
  switch (_a.label) {
500
500
  case 0:
501
- fakeModuleName = "sasjs-test-fake-module-".concat((0, utils_2.generateTimestamp)());
502
- fromDir = path_1.default.join(require('os').tmpdir(), "getNodeModulePath-".concat((0, utils_2.generateTimestamp)()));
501
+ fakeModuleName = "sasjs-test-fake-module-".concat((0, test_1.generateUniqueTimestamp)());
502
+ fromDir = path_1.default.join(require('os').tmpdir(), "getNodeModulePath-".concat((0, test_1.generateUniqueTimestamp)()));
503
503
  fakeModuleDir = path_1.default.join(fromDir, 'node_modules', fakeModuleName);
504
504
  return [4 /*yield*/, (0, utils_2.createFolder)(fakeModuleDir)];
505
505
  case 1:
@@ -43,6 +43,7 @@ var fs_1 = __importDefault(require("fs"));
43
43
  var path_1 = __importDefault(require("path"));
44
44
  var yazl_1 = __importDefault(require("yazl"));
45
45
  var utils_1 = require("@sasjs/utils");
46
+ var test_1 = require("../test");
46
47
  var zip_1 = require("../zip");
47
48
  var utils_2 = require("@sasjs/utils");
48
49
  var makeZip = function (entries, zipPath) {
@@ -84,7 +85,7 @@ var setEntryPlatform = function (zipPath, platform) {
84
85
  fs_1.default.writeFileSync(zipPath, buffer);
85
86
  };
86
87
  describe('zip', function () {
87
- var tmpRoot = path_1.default.join(__dirname, "zip-spec-".concat((0, utils_2.generateTimestamp)()));
88
+ var tmpRoot = path_1.default.join(__dirname, "zip-spec-".concat((0, test_1.generateUniqueTimestamp)()));
88
89
  var destDir = path_1.default.join(tmpRoot, 'dest');
89
90
  beforeAll(function () { return __awaiter(void 0, void 0, void 0, function () {
90
91
  return __generator(this, function (_a) {
@@ -1,6 +1,16 @@
1
1
  import { ServerType, Target, TargetJson, Configuration } from '@sasjs/utils/types';
2
2
  import { Folder } from '../types';
3
3
  import { ServiceConfig, JobConfig } from '@sasjs/utils/types/config';
4
+ /**
5
+ * A name for a test app or output folder that two specs cannot collide on.
6
+ *
7
+ * `generateTimestamp()` is second-resolution - year, month, day, hour, minute,
8
+ * second, and nothing finer - so two specs in one directory starting within the
9
+ * same second build the same folder name and clobber each other, which is what
10
+ * the docs specs do whenever jest runs them in parallel. The milliseconds and a
11
+ * short random suffix make that impossible while keeping the name readable.
12
+ */
13
+ export declare const generateUniqueTimestamp: () => string;
4
14
  export declare const createTestApp: (parentFolder: string, appName: string) => Promise<void>;
5
15
  export declare const createTestJobsApp: (parentFolder: string, appName: string) => Promise<void>;
6
16
  export declare const createTestMinimalApp: (parentFolder: string, appName: string) => Promise<void>;
@@ -75,7 +75,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
75
75
  return (mod && mod.__esModule) ? mod : { "default": mod };
76
76
  };
77
77
  Object.defineProperty(exports, "__esModule", { value: true });
78
- exports.verifyGitNotPresent = exports.verifyCompiledJob = exports.verifyCompiledService = exports.verifyDotFilesNotGenerated = exports.verifyDotFiles = exports.verifyDocs = exports.updateConfig = exports.updateTarget = exports.removeAllTargetsFromConfigs = exports.verifyPackageJsonContent = exports.verifyFolder = exports.mockProcessExit = exports.verifyStep = exports.createTestGlobalTarget = exports.generateTestTarget = exports.removeTestServerFolder = exports.removeTestApp = exports.createTestMinimalApp = exports.createTestJobsApp = exports.createTestApp = void 0;
78
+ exports.verifyGitNotPresent = exports.verifyCompiledJob = exports.verifyCompiledService = exports.verifyDotFilesNotGenerated = exports.verifyDotFiles = exports.verifyDocs = exports.updateConfig = exports.updateTarget = exports.removeAllTargetsFromConfigs = exports.verifyPackageJsonContent = exports.verifyFolder = exports.mockProcessExit = exports.verifyStep = exports.createTestGlobalTarget = exports.generateTestTarget = exports.removeTestServerFolder = exports.removeTestApp = exports.createTestMinimalApp = exports.createTestJobsApp = exports.createTestApp = exports.generateUniqueTimestamp = void 0;
79
79
  var path_1 = __importDefault(require("path"));
80
80
  var dotenv_1 = __importDefault(require("dotenv"));
81
81
  var utils_1 = require("@sasjs/utils");
@@ -89,6 +89,21 @@ var builtFiles_1 = require("./fileStructures/builtFiles");
89
89
  var builtFilesCustom1_1 = require("./fileStructures/builtFilesCustom1");
90
90
  var create_1 = require("../commands/create/create");
91
91
  var setConstants_1 = require("./setConstants");
92
+ /**
93
+ * A name for a test app or output folder that two specs cannot collide on.
94
+ *
95
+ * `generateTimestamp()` is second-resolution - year, month, day, hour, minute,
96
+ * second, and nothing finer - so two specs in one directory starting within the
97
+ * same second build the same folder name and clobber each other, which is what
98
+ * the docs specs do whenever jest runs them in parallel. The milliseconds and a
99
+ * short random suffix make that impossible while keeping the name readable.
100
+ */
101
+ var generateUniqueTimestamp = function () {
102
+ return "".concat((0, utils_1.generateTimestamp)(), "-").concat(Date.now() % 1000, "-").concat(Math.random()
103
+ .toString(36)
104
+ .slice(2, 7));
105
+ };
106
+ exports.generateUniqueTimestamp = generateUniqueTimestamp;
92
107
  var createTestApp = function (parentFolder, appName) { return __awaiter(void 0, void 0, void 0, function () {
93
108
  var _a;
94
109
  return __generator(this, function (_b) {
@@ -1,4 +1,4 @@
1
- import { ShellString } from 'shelljs';
1
+ import { ShellResult } from './shell';
2
2
  import { Target, MacroVars } from '@sasjs/utils';
3
3
  import SASjs from '@sasjs/adapter/node';
4
4
  import { LogJson } from '../types';
@@ -8,7 +8,7 @@ export declare function createReactApp(folderPath: string): Promise<void>;
8
8
  export declare function createAngularApp(folderPath: string): Promise<void>;
9
9
  export declare function createMinimalApp(folderPath: string): Promise<void>;
10
10
  export declare function createTemplateApp(folderPath: string, template: string): Promise<void>;
11
- export declare function downloadFile(url: string, filename?: string): ShellString;
11
+ export declare function downloadFile(url: string, filename?: string): ShellResult;
12
12
  export declare function setupNpmProject(folderName: string): Promise<void>;
13
13
  export declare function setupGitIgnore(folderName: string): Promise<void>;
14
14
  export declare function setupDoxygen(folderPath: string): Promise<void>;
@@ -110,8 +110,10 @@ exports.checkNodeVersion = checkNodeVersion;
110
110
  exports.getAdapterInstance = getAdapterInstance;
111
111
  exports.displaySasjsRunnerError = displaySasjsRunnerError;
112
112
  exports.prefixAppLoc = prefixAppLoc;
113
- var shelljs_1 = __importDefault(require("shelljs"));
113
+ var shell_1 = require("./shell");
114
114
  var node_powershell_1 = require("node-powershell");
115
+ var fs_1 = __importDefault(require("fs"));
116
+ var os_1 = __importDefault(require("os"));
115
117
  var path_1 = __importDefault(require("path"));
116
118
  var ora_1 = __importDefault(require("ora"));
117
119
  var axios_1 = __importDefault(require("axios"));
@@ -208,15 +210,17 @@ function createTemplateApp(folderPath, template) {
208
210
  var _this = this;
209
211
  return __generator(this, function (_a) {
210
212
  return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
211
- var probeFile, _a, stderr, code;
213
+ var probeDir, probeFile, _a, stderr, code;
212
214
  return __generator(this, function (_b) {
213
215
  switch (_b.label) {
214
216
  case 0:
215
- probeFile = 'response.txt';
217
+ probeDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'sasjs-probe-'));
218
+ probeFile = path_1.default.join(probeDir, 'response.txt');
216
219
  _a = downloadFile("https://username:password@github.com/sasjs/template_".concat(template), probeFile), stderr = _a.stderr, code = _a.code;
217
220
  return [4 /*yield*/, (0, utils_1.deleteFile)(probeFile).catch(function () { })];
218
221
  case 1:
219
222
  _b.sent();
223
+ (0, shell_1.rm)([probeDir], true);
220
224
  if (stderr.includes('404: Not Found') || code) {
221
225
  return [2 /*return*/, reject(new Error("Template \"".concat(template, "\" is not a SASjs template")))];
222
226
  }
@@ -242,43 +246,64 @@ function createTemplateApp(folderPath, template) {
242
246
  */
243
247
  function createApp(folderPath_1, repoUrl_1, docsUrl_1, errorCallback_1) {
244
248
  return __awaiter(this, arguments, void 0, function (folderPath, repoUrl, docsUrl, errorCallback, installDependencies) {
245
- var zipName, zipPath, fullZipPath, spinner, _a, stdout, stderr, code, _b, stdout_1, stderr_1, code_1, zipWithoutExtension;
249
+ var zipName, zipPath, fullZipPath, spinner, workspace, _a, stderr, code, _b, stderr_1, code_1, zipWithoutExtension, extractedFolder, err_1;
250
+ var _c;
246
251
  if (installDependencies === void 0) { installDependencies = true; }
247
- return __generator(this, function (_c) {
248
- switch (_c.label) {
252
+ return __generator(this, function (_d) {
253
+ switch (_d.label) {
249
254
  case 0:
250
255
  zipName = 'main.zip';
251
256
  zipPath = "/archive/refs/heads/";
252
257
  fullZipPath = "".concat(zipPath).concat(zipName);
253
258
  spinner = (0, ora_1.default)("Creating SASjs project in ".concat(folderPath, "."));
254
259
  spinner.start();
255
- _a = downloadFile("".concat(repoUrl).concat(fullZipPath), zipName), stdout = _a.stdout, stderr = _a.stderr, code = _a.code;
260
+ workspace = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'sasjs-create-'));
261
+ _a = downloadFile("".concat(repoUrl).concat(fullZipPath), path_1.default.join(workspace, zipName)), stderr = _a.stderr, code = _a.code;
256
262
  // If doesn't exist, we try again, but with master.zip for the zip name.
257
263
  // Since that's the name generated from branch name.
258
264
  if (stderr.includes('404: Not Found') || code) {
259
265
  zipName = 'master.zip';
260
- _b = downloadFile("".concat(repoUrl).concat(zipPath).concat(zipName), zipName), stdout_1 = _b.stdout, stderr_1 = _b.stderr, code_1 = _b.code;
266
+ _b = downloadFile("".concat(repoUrl).concat(zipPath).concat(zipName), path_1.default.join(workspace, zipName)), stderr_1 = _b.stderr, code_1 = _b.code;
261
267
  if (stderr_1.includes('404: Not Found') || code_1) {
268
+ spinner.stop();
269
+ (0, shell_1.rm)([workspace], true);
262
270
  errorCallback("Could not download ".concat(repoUrl).concat(zipPath, "main.zip or master.zip - is ").concat(repoUrl, " a SASjs repository?"));
263
271
  return [2 /*return*/];
264
272
  }
265
273
  }
266
274
  zipWithoutExtension = zipName.replace('.zip', '');
267
- return [4 /*yield*/, (0, zip_1.extractZip)(zipName, "./", true)];
275
+ _d.label = 1;
268
276
  case 1:
269
- _c.sent();
270
- shelljs_1.default.cp('-r', "".concat(shelljs_1.default.ls('-d', "./*".concat(zipWithoutExtension))[0], "/."), folderPath);
271
- shelljs_1.default.rm('-rf', ["./*".concat(zipWithoutExtension)]);
272
- shelljs_1.default.rm('-rf', ["./".concat(zipName)]);
273
- return [4 /*yield*/, loadDocsSubmodule(docsUrl, folderPath, fullZipPath)];
277
+ _d.trys.push([1, 5, 6, 7]);
278
+ return [4 /*yield*/, (0, zip_1.extractZip)(path_1.default.join(workspace, zipName), workspace, true)];
274
279
  case 2:
275
- _c.sent();
276
- shelljs_1.default.rm('-f', [path_1.default.join(folderPath, '.gitmodules')]);
280
+ _d.sent();
281
+ extractedFolder = (0, shell_1.ls)(path_1.default.join(workspace, "*".concat(zipWithoutExtension)))[0];
282
+ if (!extractedFolder) {
283
+ spinner.stop();
284
+ return [2 /*return*/, errorCallback("Could not find the unzipped ".concat(zipWithoutExtension, " folder."))];
285
+ }
286
+ return [4 /*yield*/, (0, shell_1.cp)("".concat(extractedFolder, "/."), folderPath)];
287
+ case 3:
288
+ _d.sent();
289
+ return [4 /*yield*/, loadDocsSubmodule(docsUrl, folderPath, workspace, fullZipPath)];
290
+ case 4:
291
+ _d.sent();
292
+ (0, shell_1.rm)([path_1.default.join(folderPath, '.gitmodules')]);
293
+ return [3 /*break*/, 7];
294
+ case 5:
295
+ err_1 = _d.sent();
296
+ spinner.stop();
297
+ return [2 /*return*/, errorCallback((_c = err_1 === null || err_1 === void 0 ? void 0 : err_1.message) !== null && _c !== void 0 ? _c : String(err_1))];
298
+ case 6:
299
+ (0, shell_1.rm)([workspace], true);
300
+ return [7 /*endfinally*/];
301
+ case 7:
277
302
  spinner.stop();
278
303
  if (installDependencies) {
279
304
  spinner.text = 'Installing dependencies...';
280
305
  spinner.start();
281
- shelljs_1.default.exec("cd \"".concat(folderPath, "\" && npm install"), {
306
+ (0, shell_1.exec)("cd \"".concat(folderPath, "\" && npm install"), {
282
307
  silent: true
283
308
  });
284
309
  spinner.stop();
@@ -292,10 +317,11 @@ function createApp(folderPath_1, repoUrl_1, docsUrl_1, errorCallback_1) {
292
317
  * It will download and unzip `sasjs/docs` into newly created folder into `docs` subfolder
293
318
  * @param docsUrl sasjs/docs repo url
294
319
  * @param folderPath full path to the newly created folder that contains the seed app
320
+ * @param workspace directory this run unpacks into
295
321
  * @param zipPath fixed path of where github puts zip for repo download
296
322
  */
297
- var loadDocsSubmodule = function (docsUrl, folderPath, zipPath) { return __awaiter(void 0, void 0, void 0, function () {
298
- var docsFolderPath;
323
+ var loadDocsSubmodule = function (docsUrl, folderPath, workspace, zipPath) { return __awaiter(void 0, void 0, void 0, function () {
324
+ var docsFolderPath, docsWorkspace, docsFolder;
299
325
  return __generator(this, function (_a) {
300
326
  switch (_a.label) {
301
327
  case 0:
@@ -305,36 +331,44 @@ var loadDocsSubmodule = function (docsUrl, folderPath, zipPath) { return __await
305
331
  case 1:
306
332
  if (!(_a.sent()))
307
333
  docsFolderPath = "".concat(folderPath, "/docs"); // If not, we load submodule in root
308
- downloadFile("".concat(docsUrl).concat(zipPath), 'main.zip');
309
- return [4 /*yield*/, (0, zip_1.extractZip)('main.zip', './', true)];
334
+ docsWorkspace = path_1.default.join(workspace, 'docs');
335
+ fs_1.default.mkdirSync(docsWorkspace, { recursive: true });
336
+ downloadFile("".concat(docsUrl).concat(zipPath), path_1.default.join(docsWorkspace, 'main.zip'));
337
+ return [4 /*yield*/, (0, zip_1.extractZip)(path_1.default.join(docsWorkspace, 'main.zip'), docsWorkspace, true)];
310
338
  case 2:
311
339
  _a.sent();
312
- shelljs_1.default.cp('-r', "".concat(shelljs_1.default.ls('-d', "./*-main")[0], "/."), docsFolderPath);
313
- shelljs_1.default.rm('-rf', ["./*-main"]);
314
- shelljs_1.default.rm('-rf', ["./main.zip"]);
340
+ docsFolder = (0, shell_1.ls)(path_1.default.join(docsWorkspace, '*-main'))[0];
341
+ if (!docsFolder) {
342
+ throw new Error('Could not find the unzipped docs folder.');
343
+ }
344
+ return [4 /*yield*/, (0, shell_1.cp)("".concat(docsFolder, "/."), docsFolderPath)];
345
+ case 3:
346
+ _a.sent();
315
347
  return [2 /*return*/];
316
348
  }
317
349
  });
318
350
  }); };
319
351
  function downloadFile(url, filename) {
320
- if ((0, utils_1.isLinux)() && shelljs_1.default.which('wget')) {
352
+ if ((0, utils_1.isLinux)() && (0, shell_1.which)('wget')) {
321
353
  // -O <filename> writes to the given name; without it, wget defaults to the
322
354
  // remote URL's basename, which silently ignores the caller's `filename` and
323
355
  // can leave an unexpectedly-named file behind (e.g. a repo-existence probe
324
356
  // meant to be discarded as `response.txt` instead landing as the repo name).
325
- return shelljs_1.default.exec("wget ".concat(url).concat(filename ? ' -O ' + filename : ''), {
357
+ return (0, shell_1.exec)("wget ".concat(url).concat(filename ? ' -O ' + filename : ''), {
326
358
  silent: true
327
359
  });
328
360
  }
329
361
  else if ((0, utils_1.isWindows)()) {
330
362
  // First We set TLS12 & then we invoke request to download file.
331
- return shelljs_1.default.exec("powershell.exe \"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest ".concat(url, " ").concat(filename ? '-O ' + filename : '', "\""), { silent: true });
363
+ return (0, shell_1.exec)("powershell.exe \"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest ".concat(url, " ").concat(filename ? '-O ' + filename : '', "\""), { silent: true });
332
364
  }
333
365
  else {
334
366
  // curl, on macOS and on Linux hosts without wget. -o <filename> writes to
335
367
  // the given name; -O instead saves under the remote URL's basename, ignoring
336
368
  // `filename` - see the wget note above for the same issue.
337
- return shelljs_1.default.exec("curl ".concat(url, " -L -f").concat(filename ? ' -o ' + filename : ' -O'), { silent: true });
369
+ return (0, shell_1.exec)("curl ".concat(url, " -L -f").concat(filename ? ' -o ' + filename : ' -O'), {
370
+ silent: true
371
+ });
338
372
  }
339
373
  }
340
374
  function setupNpmProject(folderName) {
@@ -353,7 +387,7 @@ function setupNpmProject(folderName) {
353
387
  isExistingProject = _d.sent();
354
388
  if (!isExistingProject) {
355
389
  (_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Initialising NPM project in ".concat(folderPath));
356
- shelljs_1.default.exec("cd \"".concat(folderPath, "\" && npm init --yes"), {
390
+ (0, shell_1.exec)("cd \"".concat(folderPath, "\" && npm init --yes"), {
357
391
  silent: true
358
392
  });
359
393
  }
@@ -361,7 +395,7 @@ function setupNpmProject(folderName) {
361
395
  (_b = process.logger) === null || _b === void 0 ? void 0 : _b.success('Existing NPM project detected.');
362
396
  }
363
397
  (_c = process.logger) === null || _c === void 0 ? void 0 : _c.info('Installing @sasjs/core');
364
- shelljs_1.default.exec("cd \"".concat(folderPath, "\" && npm i @sasjs/core --save"), {
398
+ (0, shell_1.exec)("cd \"".concat(folderPath, "\" && npm i @sasjs/core --save"), {
365
399
  silent: true
366
400
  });
367
401
  return [2 /*return*/, resolve()];
@@ -465,7 +499,7 @@ function executeShellScript(filePath, logFilePath) {
465
499
  switch (_b.label) {
466
500
  case 0:
467
501
  shellCommand = (0, utils_1.isWindows)() ? "".concat(filePath) : "bash ".concat(filePath);
468
- result = shelljs_1.default.exec(shellCommand, { silent: true });
502
+ result = (0, shell_1.exec)(shellCommand, { silent: true });
469
503
  if (!result.code) return [3 /*break*/, 1];
470
504
  (_a = process.logger) === null || _a === void 0 ? void 0 : _a.error("Error: ".concat(result.stderr));
471
505
  reject(result.code);
package/package.json CHANGED
@@ -88,7 +88,6 @@
88
88
  "node-powershell": "5.0.1",
89
89
  "ora": "5.4.1",
90
90
  "prompts": "2.4.2",
91
- "shelljs": "0.10.0",
92
91
  "ssl-root-cas": "1.3.1",
93
92
  "xml": "1.0.1",
94
93
  "yargs": "17.6.2",
@@ -107,7 +106,6 @@
107
106
  "@types/lodash.groupby": "4.6.9",
108
107
  "@types/lodash.uniqby": "4.7.9",
109
108
  "@types/node": "22.10.2",
110
- "@types/shelljs": "0.8.10",
111
109
  "@types/url-parse": "1.4.11",
112
110
  "@types/xml": "1.0.11",
113
111
  "@types/yauzl": "3.4.0",
@@ -130,5 +128,5 @@
130
128
  "ws": "8.21.0",
131
129
  "nanoid": "3.3.18"
132
130
  },
133
- "version": "4.20.6"
131
+ "version": "4.20.7"
134
132
  }