@sasjs/cli 3.5.1 → 3.6.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.
@@ -42,7 +42,7 @@ var config_1 = require("../../../utils/config");
42
42
  function loadDependencies(target, filePath, macroFolders, programFolders, type) {
43
43
  var _a;
44
44
  return __awaiter(this, void 0, void 0, function () {
45
- var fileContent, configuration, _b, buildSourceFolder, macroCorePath;
45
+ var fileContent, configuration, _b, buildSourceFolder, macroCorePath, binaryFolders;
46
46
  return __generator(this, function (_c) {
47
47
  switch (_c.label) {
48
48
  case 0:
@@ -54,6 +54,9 @@ function loadDependencies(target, filePath, macroFolders, programFolders, type)
54
54
  case 2:
55
55
  configuration = (_c.sent()).configuration;
56
56
  _b = process.sasjsConstants, buildSourceFolder = _b.buildSourceFolder, macroCorePath = _b.macroCorePath;
57
+ return [4 /*yield*/, config_1.getBinaryFolders(target)];
58
+ case 3:
59
+ binaryFolders = _c.sent();
57
60
  headerSyntaxNotices(fileContent);
58
61
  return [4 /*yield*/, utils_1.loadDependenciesFile({
59
62
  fileContent: fileContent,
@@ -64,9 +67,10 @@ function loadDependencies(target, filePath, macroFolders, programFolders, type)
64
67
  macroFolders: macroFolders,
65
68
  programFolders: programFolders,
66
69
  buildSourceFolder: buildSourceFolder,
67
- macroCorePath: macroCorePath
70
+ macroCorePath: macroCorePath,
71
+ binaryFolders: binaryFolders
68
72
  })];
69
- case 3: return [2 /*return*/, _c.sent()];
73
+ case 4: return [2 /*return*/, _c.sent()];
70
74
  }
71
75
  });
72
76
  });
@@ -128,10 +128,10 @@ describe('compileTestFile', function () {
128
128
  return [4 /*yield*/, utils_1.readFile(compiledTestFilePath)];
129
129
  case 2:
130
130
  testFileContent = _a.apply(void 0, [_b.sent()]);
131
- testVar = replaceLineBreaks("* Test Variables start;\n\n%let " + Object.keys(target.testConfig.macroVars)[0] + "=" + Object.values(target.testConfig.macroVars)[0] + ";\n\n*Test Variables end;");
131
+ testVar = replaceLineBreaks("* Test Variables start;\n\n%let " + Object.keys(target.testConfig.macroVars)[0] + "=" + Object.values(target.testConfig.macroVars)[0] + ";\n\n* Test Variables end;");
132
132
  testInit = replaceLineBreaks("* TestInit start;\n/**\n @file\n @brief setting up the test\n\n <h4> SAS Macros </h4>\n**/\n\n%put testing, init;\n* TestInit end;");
133
133
  testTerm = replaceLineBreaks("* TestTerm start;\n/**\n @file\n @brief ending the test\n\n <h4> SAS Macros </h4>\n**/\n\n%put testing, termed;\n* TestTerm end;");
134
- mvWebout = "%macro mv_webout(action,ds,fref=_mvwtemp,dslabel=,fmt=Y,stream=Y);";
134
+ mvWebout = "%macro mv_webout(action,ds,fref=_mvwtemp,dslabel=,fmt=Y,stream=Y,missing=NULL<br> ,showmeta=NO<br>);";
135
135
  expect(testFileContent.indexOf(testVar)).toBeGreaterThan(-1);
136
136
  expect(testFileContent.indexOf(testInit)).toBeGreaterThan(-1);
137
137
  expect(testFileContent.indexOf(testTerm)).toBeGreaterThan(-1);
@@ -121,7 +121,7 @@ var serviceConfig = function (root) {
121
121
  }
122
122
  });
123
123
  };
124
- var compiledVars = function (type) { return "* " + type + " Variables start;\n\n%let macrovar1=macro " + type.toLowerCase() + " value configuration 1;\n%let macrovar2=macro " + type.toLowerCase() + " value target 2;\n%let macrovar3=macro " + type.toLowerCase() + " value target 3;\n\n*" + type + " Variables end;"; };
124
+ var compiledVars = function (type) { return "* " + type + " Variables start;\n\n%let macrovar1=macro " + type.toLowerCase() + " value configuration 1;\n%let macrovar2=macro " + type.toLowerCase() + " value target 2;\n%let macrovar3=macro " + type.toLowerCase() + " value target 3;\n\n* " + type + " Variables end;"; };
125
125
  describe('loadDependencies', function () {
126
126
  var appName = "cli-tests-load-dependencies-" + utils_1.generateTimestamp();
127
127
  var temp = test_1.generateTestTarget(appName, '/Public/app', {
@@ -139,13 +139,13 @@ describe('sasjs cbd with server type SASJS', function () {
139
139
  name: 'appinit',
140
140
  type: 'service',
141
141
  code: utils_3.removeComments("" + mf_getuser + mp_jsonout + ms_webout + webout +
142
- '/* provide additional debug info */\n%global _program;\n%put &=syscc;\n%put user=%mf_getuser();\n%put pgm=&_program;\n%put timestamp=%sysfunc(datetime(),datetime19.);\n* Service Variables start;\n*Service Variables end;\n* Dependencies start;\n* Dependencies end;\n* Programs start;\n*Programs end;\n* Service start;\nproc sql;\ncreate table areas as select distinct area\n from sashelp.springs;\n%webout(OPEN)\n%webout(OBJ,areas)\n%webout(CLOSE)\n* Service end;')
142
+ '/* provide additional debug info */\n%global _program;\n%put &=syscc;\n%put user=%mf_getuser();\n%put pgm=&_program;\n%put timestamp=%sysfunc(datetime(),datetime19.);\n* Service Variables start;\n* Service Variables end;\n* SAS Macros start;\n* SAS Macros end;\n* SAS Includes start;\n* SAS Includes end;\n* Binary Files start;\n* Binary Files end;\n* Service start;\nproc sql;\ncreate table areas as select distinct area\n from sashelp.springs;\n%webout(OPEN)\n%webout(OBJ,areas)\n%webout(CLOSE)\n* Service end;')
143
143
  },
144
144
  {
145
145
  name: 'getdata',
146
146
  type: 'service',
147
147
  code: utils_3.removeComments("" + mf_getuser + mp_jsonout + ms_webout + webout +
148
- '/* provide additional debug info */\n%global _program;\n%put &=syscc;\n%put user=%mf_getuser();\n%put pgm=&_program;\n%put timestamp=%sysfunc(datetime(),datetime19.);\n* Service Variables start;\n*Service Variables end;\n* Dependencies start;\n* Dependencies end;\n* Programs start;\n*Programs end;\n* Service start;\n%webout(FETCH)\nproc sql;\ncreate table springs as select * from sashelp.springs\n where area in (select area from work.areas);\n%webout(OPEN)\n%webout(OBJ,springs)\n%webout(CLOSE)\n* Service end;')
148
+ '/* provide additional debug info */\n%global _program;\n%put &=syscc;\n%put user=%mf_getuser();\n%put pgm=&_program;\n%put timestamp=%sysfunc(datetime(),datetime19.);\n* Service Variables start;\n* Service Variables end;\n* SAS Macros start;\n* SAS Macros end;\n* SAS Includes start;\n* SAS Includes end;\n* Binary Files start;\n* Binary Files end;\n* Service start;\n%webout(FETCH)\nproc sql;\ncreate table springs as select * from sashelp.springs\n where area in (select area from work.areas);\n%webout(OPEN)\n%webout(OBJ,springs)\n%webout(CLOSE)\n* Service end;')
149
149
  }
150
150
  ]
151
151
  }
package/build/config.json CHANGED
@@ -235,6 +235,7 @@
235
235
  },
236
236
  "macroFolders": ["sasjs/macros"],
237
237
  "programFolders": ["sasjs/programs"],
238
+ "binaryFolders": ["sasjs/binaries"],
238
239
  "serverType": "SASVIYA",
239
240
  "targets": [
240
241
  {
@@ -39,6 +39,7 @@ export declare function getFolders(): Promise<any>;
39
39
  * @param {Target} target- the target to check program folders for.
40
40
  */
41
41
  export declare function getProgramFolders(target: Target): Promise<string[]>;
42
+ export declare function getBinaryFolders(target: Target): Promise<string[]>;
42
43
  /**
43
44
  * Returns SAS macro folders from configuration.
44
45
  * This list includes both common and target-specific folders.
@@ -71,7 +71,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
71
71
  return (mod && mod.__esModule) ? mod : { "default": mod };
72
72
  };
73
73
  Object.defineProperty(exports, "__esModule", { value: true });
74
- exports.getTestTearDown = exports.getTestSetUp = exports.overrideEnvVariables = exports.getAccessToken = exports.getAuthConfig = exports.getProjectRoot = exports.sanitizeAppLoc = exports.getMacroCorePath = exports.getStreamConfig = exports.getMacroFolders = exports.getProgramFolders = exports.getFolders = exports.saveToLocalConfig = exports.saveLocalConfigFile = exports.getLocalOrGlobalConfig = exports.getLocalConfig = exports.removeFromLocalConfig = exports.removeFromGlobalConfig = exports.saveToGlobalConfig = exports.saveGlobalRcFile = exports.getLocalRcFile = exports.getGlobalRcFile = exports.findTargetInConfiguration = exports.getConfiguration = void 0;
74
+ exports.getTestTearDown = exports.getTestSetUp = exports.overrideEnvVariables = exports.getAccessToken = exports.getAuthConfig = exports.getProjectRoot = exports.sanitizeAppLoc = exports.getMacroCorePath = exports.getStreamConfig = exports.getMacroFolders = exports.getBinaryFolders = exports.getProgramFolders = exports.getFolders = exports.saveToLocalConfig = exports.saveLocalConfigFile = exports.getLocalOrGlobalConfig = exports.getLocalConfig = exports.removeFromLocalConfig = exports.removeFromGlobalConfig = exports.saveToGlobalConfig = exports.saveGlobalRcFile = exports.getLocalRcFile = exports.getGlobalRcFile = exports.findTargetInConfiguration = exports.getConfiguration = void 0;
75
75
  var node_1 = __importDefault(require("@sasjs/adapter/node"));
76
76
  var utils_1 = require("@sasjs/utils");
77
77
  var auth_1 = require("./auth");
@@ -641,6 +641,32 @@ function getProgramFolders(target) {
641
641
  });
642
642
  }
643
643
  exports.getProgramFolders = getProgramFolders;
644
+ function getBinaryFolders(target) {
645
+ return __awaiter(this, void 0, void 0, function () {
646
+ var binaryFolders, localConfig, buildSourceFolder;
647
+ return __generator(this, function (_a) {
648
+ switch (_a.label) {
649
+ case 0:
650
+ binaryFolders = [];
651
+ return [4 /*yield*/, getLocalConfig().catch(function () { return null; })];
652
+ case 1:
653
+ localConfig = _a.sent();
654
+ if (localConfig === null || localConfig === void 0 ? void 0 : localConfig.binaryFolders) {
655
+ binaryFolders = binaryFolders.concat(localConfig.binaryFolders);
656
+ }
657
+ if (target === null || target === void 0 ? void 0 : target.binaryFolders) {
658
+ binaryFolders = binaryFolders.concat(target.binaryFolders);
659
+ }
660
+ buildSourceFolder = process.sasjsConstants.buildSourceFolder;
661
+ binaryFolders = binaryFolders.map(function (binaryFolder) {
662
+ return utils_1.getAbsolutePath(binaryFolder, buildSourceFolder);
663
+ });
664
+ return [2 /*return*/, __spreadArray([], __read(new Set(binaryFolders)))];
665
+ }
666
+ });
667
+ });
668
+ }
669
+ exports.getBinaryFolders = getBinaryFolders;
644
670
  /**
645
671
  * Returns SAS macro folders from configuration.
646
672
  * This list includes both common and target-specific folders.
@@ -350,7 +350,9 @@ var verifyPackageJsonContent = function (parentFolderName) {
350
350
  case 2:
351
351
  packageJsonContent = _a.sent();
352
352
  packageJson = JSON.parse(packageJsonContent);
353
- expect(packageJson.dependencies).toEqual(expect.objectContaining({ '@sasjs/core': expect.anything() }));
353
+ expect(parentFolderName.includes('minimal')
354
+ ? packageJson.devDependencies
355
+ : packageJson.dependencies).toEqual(expect.objectContaining({ '@sasjs/core': expect.anything() }));
354
356
  return [2 /*return*/];
355
357
  }
356
358
  });
package/package.json CHANGED
@@ -49,10 +49,10 @@
49
49
  "access": "public"
50
50
  },
51
51
  "dependencies": {
52
- "@sasjs/adapter": "3.3.1",
53
- "@sasjs/core": "^3.9.1",
52
+ "@sasjs/adapter": "3.4.1",
53
+ "@sasjs/core": "3.10.0",
54
54
  "@sasjs/lint": "1.11.2",
55
- "@sasjs/utils": "2.34.1",
55
+ "@sasjs/utils": "2.35.0",
56
56
  "chalk": "4.1.2",
57
57
  "csv-stringify": "5.6.5",
58
58
  "dotenv": "10.0.0",
@@ -67,7 +67,7 @@
67
67
  "node-graphviz": "0.1.0",
68
68
  "ora": "5.4.1",
69
69
  "rimraf": "3.0.2",
70
- "shelljs": "0.8.4",
70
+ "shelljs": "0.8.5",
71
71
  "xml": "1.0.1",
72
72
  "yargs": "17.2.1"
73
73
  },
@@ -97,5 +97,5 @@
97
97
  "typescript": "4.3.5",
98
98
  "util": "0.12.4"
99
99
  },
100
- "version": "3.5.1"
100
+ "version": "3.6.0"
101
101
  }