@sasjs/cli 4.0.4 → 4.0.6
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/build/cli.js +2 -5
- package/build/commands/add/spec/addCommand.spec.js +7 -0
- package/build/commands/build/build.d.ts +1 -1
- package/build/commands/build/build.js +9 -14
- package/build/commands/build/internal/config.js +14 -21
- package/build/commands/build/spec/buildCommand.spec.js +8 -1
- package/build/commands/build/spec/compileBuildCommand.spec.js +8 -1
- package/build/commands/compile/compile.js +22 -24
- package/build/commands/compile/internal/compileTestFile.d.ts +1 -1
- package/build/commands/compile/internal/compileTestFile.js +16 -24
- package/build/commands/compile/internal/getAllFolders.d.ts +1 -1
- package/build/commands/compile/internal/getAllFolders.js +28 -40
- package/build/commands/compile/internal/getServerType.js +6 -12
- package/build/commands/compile/internal/loadDependencies.d.ts +1 -1
- package/build/commands/compile/internal/loadDependencies.js +6 -7
- package/build/commands/compile/internal/spec/getAllFolders.spec.js +1 -1
- package/build/commands/compile/spec/compile.spec.js +43 -29
- package/build/commands/compile/spec/compileCommand.spec.js +11 -3
- package/build/commands/compile/spec/loadDependencies.spec.js +11 -6
- package/build/commands/context/spec/contextCommand.spec.js +8 -0
- package/build/commands/deploy/internal/getDeployScripts.js +4 -15
- package/build/commands/deploy/spec/cbd.spec.js +26 -22
- package/build/commands/deploy/spec/compileBuildDeployCommand.spec.js +9 -2
- package/build/commands/deploy/spec/deployCommand.spec.js +7 -0
- package/build/commands/docs/docsCommand.js +4 -9
- package/build/commands/docs/spec/docsCommand.spec.js +4 -0
- package/build/commands/flow/spec/flowCommand.spec.js +7 -11
- package/build/commands/folder/spec/folderCommand.spec.js +7 -0
- package/build/commands/fs/spec/fsCommand.spec.js +19 -22
- package/build/commands/job/spec/jobCommand.spec.js +6 -0
- package/build/commands/request/spec/requestCommand.spec.js +7 -11
- package/build/commands/run/spec/runCommand.spec.js +7 -11
- package/build/commands/servicepack/spec/servicepackCommand.spec.js +7 -11
- package/build/commands/testing/spec/testCommand.spec.js +7 -11
- package/build/commands/web/spec/web.spec.js +12 -7
- package/build/commands/web/spec/webCommand.spec.js +8 -1
- package/build/types/command/targetCommand.js +25 -5
- package/build/utils/config.js +60 -74
- package/build/utils/setConstants.d.ts +2 -3
- package/build/utils/setConstants.js +55 -77
- package/build/utils/spec/setConstants.spec.js +1 -1
- package/build/utils/test.js +32 -17
- package/package.json +1 -1
|
@@ -39,86 +39,64 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.
|
|
42
|
+
exports.setConstants = exports.contextName = void 0;
|
|
43
43
|
var path_1 = __importDefault(require("path"));
|
|
44
|
-
var config_1 = require("./config");
|
|
45
44
|
var utils_1 = require("./utils");
|
|
46
45
|
var utils_2 = require("@sasjs/utils");
|
|
47
46
|
exports.contextName = 'sasjs cli compute context';
|
|
48
|
-
var setConstants = function (
|
|
49
|
-
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
'
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
47
|
+
var setConstants = function (isLocal, target, configuration) {
|
|
48
|
+
if (isLocal === void 0) { isLocal = true; }
|
|
49
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
50
|
+
var buildOutputFolder, buildResultsFolder, homeDir, buildSourceFolder, buildSourceDbFolder, buildDestinationFolder, buildDestinationServicesFolder, buildDestinationTestFolder, buildDestinationJobsFolder, buildDestinationDbFolder, buildDestinationDocsFolder, macroCorePath, buildDestinationResultsFolder, buildDestinationResultsLogsFolder, sas9CredentialsError, invalidSasError, sas9GUID;
|
|
51
|
+
return __generator(this, function (_a) {
|
|
52
|
+
switch (_a.label) {
|
|
53
|
+
case 0:
|
|
54
|
+
buildOutputFolder = (target === null || target === void 0 ? void 0 : target.sasjsBuildFolder) ||
|
|
55
|
+
(configuration === null || configuration === void 0 ? void 0 : configuration.sasjsBuildFolder) ||
|
|
56
|
+
(isLocal ? 'sasjsbuild' : '.sasjs/sasjsbuild');
|
|
57
|
+
buildResultsFolder = (target === null || target === void 0 ? void 0 : target.sasjsResultsFolder) ||
|
|
58
|
+
(configuration === null || configuration === void 0 ? void 0 : configuration.sasjsResultsFolder) ||
|
|
59
|
+
(isLocal ? 'sasjsresults' : '.sasjs/sasjsresults');
|
|
60
|
+
homeDir = require('os').homedir();
|
|
61
|
+
buildSourceFolder = path_1.default.join(isLocal ? process.projectDir : homeDir);
|
|
62
|
+
buildSourceDbFolder = path_1.default.join(isLocal ? process.projectDir : homeDir, 'sasjs', 'db');
|
|
63
|
+
buildDestinationFolder = (0, utils_2.getAbsolutePath)(buildOutputFolder, isLocal ? process.projectDir : homeDir);
|
|
64
|
+
buildDestinationServicesFolder = path_1.default.join(buildDestinationFolder, 'services');
|
|
65
|
+
buildDestinationTestFolder = path_1.default.join(buildDestinationFolder, 'tests');
|
|
66
|
+
buildDestinationJobsFolder = path_1.default.join(buildDestinationFolder, 'jobs');
|
|
67
|
+
buildDestinationDbFolder = path_1.default.join(buildDestinationFolder, 'db');
|
|
68
|
+
buildDestinationDocsFolder = path_1.default.join(buildDestinationFolder, 'docs');
|
|
69
|
+
return [4 /*yield*/, (0, utils_1.getNodeModulePath)('@sasjs/core')];
|
|
70
|
+
case 1:
|
|
71
|
+
macroCorePath = _a.sent();
|
|
72
|
+
buildDestinationResultsFolder = (0, utils_2.getAbsolutePath)(buildResultsFolder, isLocal ? process.projectDir : homeDir);
|
|
73
|
+
buildDestinationResultsLogsFolder = path_1.default.join(buildDestinationResultsFolder, 'logs');
|
|
74
|
+
sas9CredentialsError = 'The following attributes were not found:' +
|
|
75
|
+
'\n* SAS_USERNAME' +
|
|
76
|
+
'\n* SAS_PASSWORD' +
|
|
77
|
+
'\nPlease run "sasjs auth" for your specified target to apply the correct credentials.';
|
|
78
|
+
invalidSasError = 'Url specified does not contain a valid sas program. Please provide valid url.';
|
|
79
|
+
sas9GUID = 'pZKd6F95jECvRQlN0LCfdA==';
|
|
80
|
+
process.sasjsConstants = {
|
|
81
|
+
buildSourceFolder: buildSourceFolder,
|
|
82
|
+
buildSourceDbFolder: buildSourceDbFolder,
|
|
83
|
+
buildDestinationFolder: buildDestinationFolder,
|
|
84
|
+
buildDestinationServicesFolder: buildDestinationServicesFolder,
|
|
85
|
+
buildDestinationJobsFolder: buildDestinationJobsFolder,
|
|
86
|
+
buildDestinationDbFolder: buildDestinationDbFolder,
|
|
87
|
+
buildDestinationDocsFolder: buildDestinationDocsFolder,
|
|
88
|
+
buildDestinationResultsFolder: buildDestinationResultsFolder,
|
|
89
|
+
buildDestinationResultsLogsFolder: buildDestinationResultsLogsFolder,
|
|
90
|
+
buildDestinationTestFolder: buildDestinationTestFolder,
|
|
91
|
+
macroCorePath: macroCorePath,
|
|
92
|
+
contextName: exports.contextName,
|
|
93
|
+
sas9CredentialsError: sas9CredentialsError,
|
|
94
|
+
invalidSasError: invalidSasError,
|
|
95
|
+
sas9GUID: sas9GUID
|
|
96
|
+
};
|
|
97
|
+
return [2 /*return*/];
|
|
98
|
+
}
|
|
99
|
+
});
|
|
101
100
|
});
|
|
102
|
-
}); };
|
|
103
|
-
exports.setConstants = setConstants;
|
|
104
|
-
var updateSasjsConstants = function (target, isLocal) {
|
|
105
|
-
var homeDir = require('os').homedir();
|
|
106
|
-
if (target.sasjsBuildFolder) {
|
|
107
|
-
var buildOutputFolder = target.sasjsBuildFolder;
|
|
108
|
-
var buildDestinationFolder = (0, utils_2.getAbsolutePath)(buildOutputFolder, isLocal ? process.projectDir : homeDir);
|
|
109
|
-
process.sasjsConstants.buildDestinationFolder = buildDestinationFolder;
|
|
110
|
-
process.sasjsConstants.buildDestinationServicesFolder = path_1.default.join(buildDestinationFolder, 'services');
|
|
111
|
-
process.sasjsConstants.buildDestinationTestFolder = path_1.default.join(buildDestinationFolder, 'tests');
|
|
112
|
-
process.sasjsConstants.buildDestinationJobsFolder = path_1.default.join(buildDestinationFolder, 'jobs');
|
|
113
|
-
process.sasjsConstants.buildDestinationDbFolder = path_1.default.join(buildDestinationFolder, 'db');
|
|
114
|
-
process.sasjsConstants.buildDestinationDocsFolder = path_1.default.join(buildDestinationFolder, 'docs');
|
|
115
|
-
}
|
|
116
|
-
if (target.sasjsResultsFolder) {
|
|
117
|
-
var buildResultsFolder = target.sasjsResultsFolder;
|
|
118
|
-
var buildDestinationResultsFolder = (0, utils_2.getAbsolutePath)(buildResultsFolder, isLocal ? process.projectDir : homeDir);
|
|
119
|
-
process.sasjsConstants.buildDestinationResultsFolder =
|
|
120
|
-
buildDestinationResultsFolder;
|
|
121
|
-
process.sasjsConstants.buildDestinationResultsLogsFolder = path_1.default.join(buildDestinationResultsFolder, 'logs');
|
|
122
|
-
}
|
|
123
101
|
};
|
|
124
|
-
exports.
|
|
102
|
+
exports.setConstants = setConstants;
|
|
@@ -157,7 +157,7 @@ describe('setConstants', function () {
|
|
|
157
157
|
})];
|
|
158
158
|
});
|
|
159
159
|
}); });
|
|
160
|
-
return [4 /*yield*/, (0, setConstants_1.setConstants)()];
|
|
160
|
+
return [4 /*yield*/, (0, setConstants_1.setConstants)(false)];
|
|
161
161
|
case 1:
|
|
162
162
|
_a.sent();
|
|
163
163
|
verifySasjsConstants(undefined, false, false);
|
package/build/utils/test.js
CHANGED
|
@@ -66,57 +66,72 @@ var create_1 = require("../commands/create/create");
|
|
|
66
66
|
var setConstants_1 = require("./setConstants");
|
|
67
67
|
var node_1 = __importDefault(require("@sasjs/adapter/node"));
|
|
68
68
|
var createTestApp = function (parentFolder, appName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
var _a;
|
|
70
|
+
return __generator(this, function (_b) {
|
|
71
|
+
switch (_b.label) {
|
|
71
72
|
case 0:
|
|
72
73
|
process.projectDir = parentFolder;
|
|
73
74
|
return [4 /*yield*/, (0, create_1.create)(appName, '')];
|
|
74
75
|
case 1:
|
|
75
|
-
|
|
76
|
+
_b.sent();
|
|
76
77
|
process.projectDir = path_1.default.join(parentFolder, appName);
|
|
77
78
|
process.currentDir = process.projectDir;
|
|
78
|
-
|
|
79
|
+
_a = process;
|
|
80
|
+
return [4 /*yield*/, (0, config_1.getLocalConfig)()];
|
|
79
81
|
case 2:
|
|
80
|
-
_a.sent();
|
|
82
|
+
_a.sasjsConfig = _b.sent();
|
|
83
|
+
return [4 /*yield*/, (0, setConstants_1.setConstants)()];
|
|
84
|
+
case 3:
|
|
85
|
+
_b.sent();
|
|
81
86
|
return [2 /*return*/];
|
|
82
87
|
}
|
|
83
88
|
});
|
|
84
89
|
}); };
|
|
85
90
|
exports.createTestApp = createTestApp;
|
|
86
91
|
var createTestJobsApp = function (parentFolder, appName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
var _a;
|
|
93
|
+
return __generator(this, function (_b) {
|
|
94
|
+
switch (_b.label) {
|
|
89
95
|
case 0:
|
|
90
96
|
process.projectDir = parentFolder;
|
|
91
97
|
return [4 /*yield*/, (0, create_1.create)(appName, 'jobs')];
|
|
92
98
|
case 1:
|
|
93
|
-
|
|
99
|
+
_b.sent();
|
|
94
100
|
process.projectDir = path_1.default.join(parentFolder, appName);
|
|
95
101
|
process.currentDir = process.projectDir;
|
|
96
|
-
|
|
102
|
+
_a = process;
|
|
103
|
+
return [4 /*yield*/, (0, config_1.getLocalConfig)()];
|
|
97
104
|
case 2:
|
|
98
|
-
_a.sent();
|
|
99
|
-
return [4 /*yield*/, (0,
|
|
105
|
+
_a.sasjsConfig = _b.sent();
|
|
106
|
+
return [4 /*yield*/, (0, setConstants_1.setConstants)()];
|
|
100
107
|
case 3:
|
|
101
|
-
|
|
108
|
+
_b.sent();
|
|
109
|
+
return [4 /*yield*/, (0, exports.updateTarget)({ serverUrl: 'https://example.com' }, 'viya')];
|
|
110
|
+
case 4:
|
|
111
|
+
_b.sent();
|
|
102
112
|
return [2 /*return*/];
|
|
103
113
|
}
|
|
104
114
|
});
|
|
105
115
|
}); };
|
|
106
116
|
exports.createTestJobsApp = createTestJobsApp;
|
|
107
117
|
var createTestMinimalApp = function (parentFolder, appName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
108
|
-
|
|
109
|
-
|
|
118
|
+
var _a;
|
|
119
|
+
return __generator(this, function (_b) {
|
|
120
|
+
switch (_b.label) {
|
|
110
121
|
case 0:
|
|
111
122
|
process.projectDir = parentFolder;
|
|
112
123
|
return [4 /*yield*/, (0, create_1.create)(appName, 'minimal')];
|
|
113
124
|
case 1:
|
|
114
|
-
|
|
125
|
+
_b.sent();
|
|
115
126
|
process.projectDir = path_1.default.join(parentFolder, appName);
|
|
116
127
|
process.currentDir = process.projectDir;
|
|
117
|
-
|
|
128
|
+
_a = process;
|
|
129
|
+
return [4 /*yield*/, (0, config_1.getLocalConfig)()];
|
|
118
130
|
case 2:
|
|
119
|
-
_a.sent();
|
|
131
|
+
_a.sasjsConfig = _b.sent();
|
|
132
|
+
return [4 /*yield*/, (0, setConstants_1.setConstants)()];
|
|
133
|
+
case 3:
|
|
134
|
+
_b.sent();
|
|
120
135
|
return [2 /*return*/];
|
|
121
136
|
}
|
|
122
137
|
});
|
package/package.json
CHANGED