@sasjs/cli 3.13.4 → 3.13.5

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.
@@ -329,7 +329,7 @@ function recreateBuildFolder() {
329
329
  }
330
330
  // REFACTOR: combine compileServiceFolder and compileJobFolder
331
331
  var compileServiceFolder = function (target, serviceFolder, macroFolders, programFolders, compileTree) { return __awaiter(void 0, void 0, void 0, function () {
332
- var destinationPath, subFolders, filesNamesInPath;
332
+ var destinationPath, subFolders, sourceFiles;
333
333
  return __generator(this, function (_a) {
334
334
  switch (_a.label) {
335
335
  case 0:
@@ -337,21 +337,21 @@ var compileServiceFolder = function (target, serviceFolder, macroFolders, progra
337
337
  return [4 /*yield*/, (0, utils_1.listSubFoldersInFolder)(destinationPath)];
338
338
  case 1:
339
339
  subFolders = _a.sent();
340
- return [4 /*yield*/, (0, utils_1.listFilesInFolder)(destinationPath)
340
+ return [4 /*yield*/, (0, utils_1.listFilesInFolder)(serviceFolder)
341
341
  // Checks if file in sasjsbuild folder exists in source folder.
342
342
  // If not, it means that the file shouldn't be compiled.
343
343
  ];
344
344
  case 2:
345
- filesNamesInPath = _a.sent();
345
+ sourceFiles = _a.sent();
346
346
  // Checks if file in sasjsbuild folder exists in source folder.
347
347
  // If not, it means that the file shouldn't be compiled.
348
- return [4 /*yield*/, (0, utils_1.asyncForEach)(filesNamesInPath, function (fileName, i) { return __awaiter(void 0, void 0, void 0, function () {
348
+ return [4 /*yield*/, (0, utils_1.asyncForEach)(sourceFiles, function (fileName, i) { return __awaiter(void 0, void 0, void 0, function () {
349
349
  return __generator(this, function (_a) {
350
350
  switch (_a.label) {
351
351
  case 0: return [4 /*yield*/, (0, utils_1.fileExists)(path_1.default.join(serviceFolder, fileName))];
352
352
  case 1:
353
353
  if (!(_a.sent())) {
354
- filesNamesInPath.splice(i, 1);
354
+ sourceFiles.splice(i, 1);
355
355
  }
356
356
  return [2 /*return*/];
357
357
  }
@@ -361,7 +361,7 @@ var compileServiceFolder = function (target, serviceFolder, macroFolders, progra
361
361
  // Checks if file in sasjsbuild folder exists in source folder.
362
362
  // If not, it means that the file shouldn't be compiled.
363
363
  _a.sent();
364
- return [4 /*yield*/, (0, utils_1.asyncForEach)(filesNamesInPath, function (fileName) { return __awaiter(void 0, void 0, void 0, function () {
364
+ return [4 /*yield*/, (0, utils_1.asyncForEach)(sourceFiles, function (fileName) { return __awaiter(void 0, void 0, void 0, function () {
365
365
  var filePath;
366
366
  return __generator(this, function (_a) {
367
367
  switch (_a.label) {
@@ -383,15 +383,15 @@ var compileServiceFolder = function (target, serviceFolder, macroFolders, progra
383
383
  case 4:
384
384
  _a.sent();
385
385
  return [4 /*yield*/, (0, utils_1.asyncForEach)(subFolders, function (subFolder) { return __awaiter(void 0, void 0, void 0, function () {
386
- var sourceFolder, fileNames;
386
+ var sourceFolder, sourceFiles;
387
387
  return __generator(this, function (_a) {
388
388
  switch (_a.label) {
389
389
  case 0:
390
390
  sourceFolder = path_1.default.join(serviceFolder, subFolder);
391
391
  return [4 /*yield*/, (0, utils_1.listFilesInFolder)(sourceFolder)];
392
392
  case 1:
393
- fileNames = _a.sent();
394
- return [4 /*yield*/, (0, utils_1.asyncForEach)(fileNames, function (fileName) { return __awaiter(void 0, void 0, void 0, function () {
393
+ sourceFiles = _a.sent();
394
+ return [4 /*yield*/, (0, utils_1.asyncForEach)(sourceFiles, function (fileName) { return __awaiter(void 0, void 0, void 0, function () {
395
395
  var filePath;
396
396
  return __generator(this, function (_a) {
397
397
  switch (_a.label) {
@@ -424,7 +424,7 @@ var compileServiceFolder = function (target, serviceFolder, macroFolders, progra
424
424
  });
425
425
  }); };
426
426
  var compileJobFolder = function (target, jobFolder, macroFolders, programFolders, compileTree) { return __awaiter(void 0, void 0, void 0, function () {
427
- var destinationPath, subFolders, filesNamesInPath;
427
+ var destinationPath, subFolders, sourceFiles;
428
428
  return __generator(this, function (_a) {
429
429
  switch (_a.label) {
430
430
  case 0:
@@ -437,16 +437,16 @@ var compileJobFolder = function (target, jobFolder, macroFolders, programFolders
437
437
  // If not, it means that the file shouldn't be compiled.
438
438
  ];
439
439
  case 2:
440
- filesNamesInPath = _a.sent();
440
+ sourceFiles = _a.sent();
441
441
  // Checks if file in sasjsbuild folder exists in source folder.
442
442
  // If not, it means that the file shouldn't be compiled.
443
- return [4 /*yield*/, (0, utils_1.asyncForEach)(filesNamesInPath, function (fileName, i) { return __awaiter(void 0, void 0, void 0, function () {
443
+ return [4 /*yield*/, (0, utils_1.asyncForEach)(sourceFiles, function (fileName, i) { return __awaiter(void 0, void 0, void 0, function () {
444
444
  return __generator(this, function (_a) {
445
445
  switch (_a.label) {
446
446
  case 0: return [4 /*yield*/, (0, utils_1.fileExists)(path_1.default.join(jobFolder, fileName))];
447
447
  case 1:
448
448
  if (!(_a.sent())) {
449
- filesNamesInPath.splice(i, 1);
449
+ sourceFiles.splice(i, 1);
450
450
  }
451
451
  return [2 /*return*/];
452
452
  }
@@ -456,7 +456,7 @@ var compileJobFolder = function (target, jobFolder, macroFolders, programFolders
456
456
  // Checks if file in sasjsbuild folder exists in source folder.
457
457
  // If not, it means that the file shouldn't be compiled.
458
458
  _a.sent();
459
- return [4 /*yield*/, (0, utils_1.asyncForEach)(filesNamesInPath, function (fileName) { return __awaiter(void 0, void 0, void 0, function () {
459
+ return [4 /*yield*/, (0, utils_1.asyncForEach)(sourceFiles, function (fileName) { return __awaiter(void 0, void 0, void 0, function () {
460
460
  var filePath;
461
461
  return __generator(this, function (_a) {
462
462
  switch (_a.label) {
@@ -478,15 +478,15 @@ var compileJobFolder = function (target, jobFolder, macroFolders, programFolders
478
478
  case 4:
479
479
  _a.sent();
480
480
  return [4 /*yield*/, (0, utils_1.asyncForEach)(subFolders, function (subFolder) { return __awaiter(void 0, void 0, void 0, function () {
481
- var sourcePath, fileNames;
481
+ var sourcePath, sourceFiles;
482
482
  return __generator(this, function (_a) {
483
483
  switch (_a.label) {
484
484
  case 0:
485
485
  sourcePath = path_1.default.join(jobFolder, subFolder);
486
- return [4 /*yield*/, (0, utils_1.listFilesInFolder)(path_1.default.join(jobFolder, subFolder))];
486
+ return [4 /*yield*/, (0, utils_1.listFilesInFolder)(sourcePath)];
487
487
  case 1:
488
- fileNames = _a.sent();
489
- return [4 /*yield*/, (0, utils_1.asyncForEach)(fileNames, function (fileName) { return __awaiter(void 0, void 0, void 0, function () {
488
+ sourceFiles = _a.sent();
489
+ return [4 /*yield*/, (0, utils_1.asyncForEach)(sourceFiles, function (fileName) { return __awaiter(void 0, void 0, void 0, function () {
490
490
  var filePath;
491
491
  return __generator(this, function (_a) {
492
492
  switch (_a.label) {
@@ -1,4 +1,15 @@
1
1
  import { CompileTree } from '@sasjs/utils';
2
2
  import { Target, ServerType, SASJsFileType } from '@sasjs/utils/types';
3
+ /**
4
+ * Compiles file dependencies.
5
+ * @param {Target} target - SAS server configuration.
6
+ * @param {string} filePath - file path of the file to be compiled.
7
+ * @param {string[]} macroFolders - macro folders paths.
8
+ * @param {string[]} programFolders - program folders paths.
9
+ * @param {string} programVar - program variable.
10
+ * @param {object} compileTree - compilation tree that stores used compilation assets.
11
+ * @param {SASJsFileType} fileType - sasjs file type.
12
+ * @param {string} sourceFolder - folder path of the source folder.
13
+ */
3
14
  export declare function compileFile(target: Target, filePath: string, macroFolders: string[], programFolders: string[], programVar: string | undefined, compileTree: CompileTree, fileType: SASJsFileType, sourceFolder: string): Promise<void>;
4
15
  export declare function getPreCodeForServicePack(serverType: ServerType): Promise<string>;
@@ -46,6 +46,17 @@ var error_1 = require("@sasjs/utils/error");
46
46
  var loadDependencies_1 = require("./loadDependencies");
47
47
  var getServerType_1 = require("./getServerType");
48
48
  var path_1 = __importDefault(require("path"));
49
+ /**
50
+ * Compiles file dependencies.
51
+ * @param {Target} target - SAS server configuration.
52
+ * @param {string} filePath - file path of the file to be compiled.
53
+ * @param {string[]} macroFolders - macro folders paths.
54
+ * @param {string[]} programFolders - program folders paths.
55
+ * @param {string} programVar - program variable.
56
+ * @param {object} compileTree - compilation tree that stores used compilation assets.
57
+ * @param {SASJsFileType} fileType - sasjs file type.
58
+ * @param {string} sourceFolder - folder path of the source folder.
59
+ */
49
60
  function compileFile(target, filePath, macroFolders, programFolders, programVar, compileTree, fileType, sourceFolder) {
50
61
  if (programVar === void 0) { programVar = ''; }
51
62
  return __awaiter(this, void 0, void 0, function () {
package/package.json CHANGED
@@ -65,7 +65,7 @@
65
65
  "ora": "5.4.1",
66
66
  "rimraf": "3.0.2",
67
67
  "shelljs": "0.8.5",
68
- "ssl-root-cas": "^1.3.1",
68
+ "ssl-root-cas": "1.3.1",
69
69
  "xml": "1.0.1",
70
70
  "yargs": "17.2.1"
71
71
  },
@@ -87,11 +87,12 @@
87
87
  "jest-cli": "27.4.7",
88
88
  "jest-extended": "1.1.0",
89
89
  "nodemon": "2.0.15",
90
+ "prettier": "2.6.2",
90
91
  "ts-jest": "27.1.2",
91
92
  "ts-node": "10.4.0",
92
93
  "tslib": "2.3.1",
93
94
  "typescript": "4.5.4",
94
95
  "util": "0.12.4"
95
96
  },
96
- "version": "3.13.4"
97
+ "version": "3.13.5"
97
98
  }