@sasjs/cli 4.0.6 → 4.1.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.
Files changed (28) hide show
  1. package/build/commands/build/build.js +3 -3
  2. package/build/commands/compile/compile.js +52 -55
  3. package/build/commands/compile/compileCommand.js +5 -3
  4. package/build/commands/compile/compileSingleFile.d.ts +5 -0
  5. package/build/commands/compile/compileSingleFile.js +36 -25
  6. package/build/commands/compile/internal/checkCompileStatus.js +7 -9
  7. package/build/commands/compile/internal/compileFile.js +2 -2
  8. package/build/commands/compile/internal/compileTestFile.d.ts +1 -1
  9. package/build/commands/compile/internal/compileTestFile.js +16 -14
  10. package/build/commands/compile/internal/getAllFolders.d.ts +3 -2
  11. package/build/commands/compile/internal/getAllFolders.js +1 -0
  12. package/build/commands/compile/internal/identifySasFile.d.ts +2 -1
  13. package/build/commands/compile/internal/identifySasFile.js +20 -11
  14. package/build/commands/compile/internal/index.d.ts +9 -0
  15. package/build/commands/compile/internal/index.js +25 -0
  16. package/build/commands/compile/internal/spec/compileTestFile.spec.js +4 -4
  17. package/build/commands/compile/internal/spec/getAllFolders.spec.js +3 -3
  18. package/build/commands/compile/spec/compareFolders.spec.js +8 -8
  19. package/build/commands/compile/spec/compile.spec.js +42 -0
  20. package/build/commands/compile/spec/compileFile.spec.js +5 -6
  21. package/build/commands/compile/spec/compileSingleFile.spec.d.ts +1 -0
  22. package/build/commands/compile/spec/compileSingleFile.spec.js +162 -0
  23. package/build/commands/compile/spec/loadDependencies.spec.js +13 -13
  24. package/build/commands/run/run.js +2 -2
  25. package/build/types/command/commandBase.js +1 -1
  26. package/package.json +1 -1
  27. package/build/commands/compile/internal/getServerType.d.ts +0 -9
  28. package/build/commands/compile/internal/getServerType.js +0 -60
@@ -72,7 +72,7 @@ var utils_1 = require("@sasjs/utils");
72
72
  var __1 = require("../");
73
73
  var utils_2 = require("../../utils/");
74
74
  var axios_1 = __importDefault(require("axios"));
75
- var getDestinationPath_1 = require("../compile/internal/getDestinationPath");
75
+ var internal_1 = require("../compile/internal");
76
76
  var saveLog_1 = require("../../utils/saveLog");
77
77
  var parseSourceFile_1 = require("../../utils/parseSourceFile");
78
78
  /**
@@ -104,7 +104,7 @@ function runSasCode(target, filePath, compile, logFile, source) {
104
104
  sourcefilePathParts = path_1.default.normalize(filePath).split(path_1.default.sep);
105
105
  sourcefilePathParts.splice(-1, 1);
106
106
  sourceFolderPath = sourcefilePathParts.join(path_1.default.sep);
107
- return [4 /*yield*/, (0, __1.compileSingleFile)(target, 'identify', filePath, (0, getDestinationPath_1.getDestinationServicePath)(sourceFolderPath), true)];
107
+ return [4 /*yield*/, (0, __1.compileSingleFile)(target, 'identify', filePath, (0, internal_1.getDestinationServicePath)(sourceFolderPath), true)];
108
108
  case 3:
109
109
  (filePath = (_c.sent()).destinationPath);
110
110
  (_a = process.logger) === null || _a === void 0 ? void 0 : _a.success("File Compiled and placed at: ".concat(filePath, " ."));
@@ -79,7 +79,7 @@ exports.CommandBase = exports.defaultCommandOptions = void 0;
79
79
  var yargs_1 = __importDefault(require("yargs"));
80
80
  var unalias_1 = require("./unalias");
81
81
  var subCommandMap = new Map([
82
- ['compile', ['job', 'service', 'identify']],
82
+ ['compile', ['job', 'service', 'test', 'identify']],
83
83
  ['context', ['create', 'delete', 'edit', 'export', 'list']],
84
84
  ['folder', ['create', 'delete', 'list']],
85
85
  ['doc', ['init', 'lineage']],
package/package.json CHANGED
@@ -102,5 +102,5 @@
102
102
  "typescript": "4.9.5",
103
103
  "util": "0.12.4"
104
104
  },
105
- "version": "4.0.6"
105
+ "version": "4.1.0"
106
106
  }
@@ -1,9 +0,0 @@
1
- import { Target } from '@sasjs/utils';
2
- import { ServerType } from '@sasjs/utils/types';
3
- /**
4
- * Returns server type for 'compile' step.
5
- * If target is not present, it looks for serverType at root level
6
- * Default value for serverType is 'SASVIYA'
7
- * @param {Target} target- the target to check server type.
8
- */
9
- export declare function getServerType(target: Target): Promise<ServerType>;
@@ -1,60 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.getServerType = void 0;
40
- var types_1 = require("@sasjs/utils/types");
41
- /**
42
- * Returns server type for 'compile' step.
43
- * If target is not present, it looks for serverType at root level
44
- * Default value for serverType is 'SASVIYA'
45
- * @param {Target} target- the target to check server type.
46
- */
47
- function getServerType(target) {
48
- return __awaiter(this, void 0, void 0, function () {
49
- var configuration;
50
- return __generator(this, function (_a) {
51
- if (target === null || target === void 0 ? void 0 : target.serverType)
52
- return [2 /*return*/, target.serverType];
53
- configuration = process.sasjsConfig;
54
- return [2 /*return*/, (configuration === null || configuration === void 0 ? void 0 : configuration.serverType)
55
- ? configuration.serverType
56
- : types_1.ServerType.SasViya];
57
- });
58
- });
59
- }
60
- exports.getServerType = getServerType;