@sasjs/cli 4.18.5 → 4.18.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.
|
@@ -251,10 +251,17 @@ function getBuildInfo(target, streamWeb) {
|
|
|
251
251
|
case 6: return [4 /*yield*/, getDepsContent(dependencyFilePaths, target, macroFolders)];
|
|
252
252
|
case 7:
|
|
253
253
|
dependenciesContent = _a.sent();
|
|
254
|
-
return [4 /*yield*/, getBuildVars(target)
|
|
254
|
+
return [4 /*yield*/, getBuildVars(target)
|
|
255
|
+
/* NOTE: keep %global as the first line - a leading /** comment block is
|
|
256
|
+
stripped by removeHeader() when the final build file is assembled, so
|
|
257
|
+
the guidance below must come AFTER code to survive into the output. */
|
|
258
|
+
];
|
|
255
259
|
case 8:
|
|
256
260
|
buildVars = _a.sent();
|
|
257
|
-
|
|
261
|
+
/* NOTE: keep %global as the first line - a leading /** comment block is
|
|
262
|
+
stripped by removeHeader() when the final build file is assembled, so
|
|
263
|
+
the guidance below must come AFTER code to survive into the output. */
|
|
264
|
+
return [2 /*return*/, "\n%global appLoc;\n\n/**\n * The appLoc represents the metadata or SAS Drive location of the app you\n * are about to deploy\n *\n * To set an alternative appLoc, simply populate the appLoc variable prior\n * to running this program, eg:\n *\n * %let apploc=/my/apploc;\n * %inc thisfile;\n *\n * Do NOT change compiled_apploc - it is not the deploy location, it is the\n * appLoc that was baked into the frontend files at build time. It is used\n * by the swap= parameter of %mv_createfile to rewrite that string to the\n * runtime appLoc when streaming web (html/css/js) files are uploaded.\n * Changing it breaks dynamic appLoc switching (no strings will match).\n *\n */\n\n%let compiled_apploc=".concat(appLoc, ";\n%let appLoc=%sysfunc(coalescec(&appLoc,&compiled_apploc));\n\n\n").concat(serverType === utils_1.ServerType.Sas9
|
|
258
265
|
? "\n/**\n * The serverName represents the SAS 9 logical server context\n * There is no programmatic (SAS code) way to obtain this\n * So it is taken from the sasjsconfig file OR supplied at runtime, eg:\n *\n * %let apploc=/my/apploc;\n * %let serverName=SASAppDC;\n * %inc thisfile;\n *\n */\n\n%global serverName;\n%let compiled_serverName=".concat(serverName, ";\n%let serverName=%sysfunc(coalescec(&serverName,&compiled_serverName));\n")
|
|
259
266
|
: '', "\n\n%let sasjs_clickmeservice=clickme;\n%let syscc=0;\noptions ps=max nonotes nosgen nomprint nomlogic nosource2 nosource noquotelenmax;\n/* user supplied build vars */\n").concat(buildVars, "\n/* user supplied build vars end */\n/* system macro dependencies for build process */\n").concat(dependenciesContent, "\n/* system macro dependencies for build process end*/\n/* system macros for build process */\n").concat((0, utils_1.removeHeader)(buildConfig), "\n/* system macros for build process end */\n")];
|
|
260
267
|
}
|
|
@@ -144,6 +144,9 @@ describe('sasjs build', function () {
|
|
|
144
144
|
expect(finalSasFile.includes(commentLine1.split("'").join("'".repeat(2)))).toBeTruthy();
|
|
145
145
|
expect(commentLine2.split("'").join("'".repeat(2))).toBeTruthy();
|
|
146
146
|
expect(finalSasFile.includes(afterComment)).toBeTruthy();
|
|
147
|
+
// The guidance comment only survives removeHeader() because `%global appLoc;`
|
|
148
|
+
// precedes it (regex ^\s*/(\*){1,2}... does not match) - lock that in.
|
|
149
|
+
expect(finalSasFile.includes('Do NOT change compiled_apploc')).toBeTruthy();
|
|
147
150
|
return [2 /*return*/];
|
|
148
151
|
}
|
|
149
152
|
});
|
package/package.json
CHANGED