@comet/cli 8.0.0-beta.4 → 8.0.0-beta.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.
|
@@ -112,7 +112,6 @@ exports.injectSiteConfigsCommand = new commander_1.Command("inject-site-configs"
|
|
|
112
112
|
.description("Inject site-configs into a file")
|
|
113
113
|
.requiredOption("-i, --in-file <file>", "The filename of a template file to inject.")
|
|
114
114
|
.requiredOption("-o, --out-file <file>", "Write the injected template to a file.")
|
|
115
|
-
.option("-d --dotenv", "dotenv compatibility") // https://github.com/motdotla/dotenv/issues/521#issuecomment-999016064
|
|
116
115
|
.option("--base64", "use base64 encoding")
|
|
117
116
|
.option("-f, --site-config-file <file>", "Path to ts-file which provides a default export with (env: string) => SiteConfig[]")
|
|
118
117
|
.action(function (options) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -148,7 +147,7 @@ exports.injectSiteConfigsCommand = new commander_1.Command("inject-site-configs"
|
|
|
148
147
|
};
|
|
149
148
|
str = str.replace(/"({{ site:\/\/configs\/.*\/.* }})"/g, "'$1'"); // convert to single quotes
|
|
150
149
|
return [4 /*yield*/, replaceAsync(str, RegExp("{{ site://configs/(.*)/(.*) }}", "g"), function (substr, type, env) { return __awaiter(void 0, void 0, void 0, function () {
|
|
151
|
-
var siteConfigs,
|
|
150
|
+
var siteConfigs, ret;
|
|
152
151
|
return __generator(this, function (_a) {
|
|
153
152
|
switch (_a.label) {
|
|
154
153
|
case 0: return [4 /*yield*/, getSiteConfigs(env)];
|
|
@@ -159,13 +158,10 @@ exports.injectSiteConfigsCommand = new commander_1.Command("inject-site-configs"
|
|
|
159
158
|
console.error("inject-site-configs: ERROR: type must be ".concat(Object.keys(replacerFunctions).join("|"), " (got ").concat(type, ")"));
|
|
160
159
|
return [2 /*return*/, substr];
|
|
161
160
|
}
|
|
162
|
-
|
|
161
|
+
ret = JSON.stringify(replacerFunctions[type](siteConfigs, env));
|
|
163
162
|
if (options.base64) {
|
|
164
|
-
return [2 /*return*/, Buffer.from(
|
|
163
|
+
return [2 /*return*/, Buffer.from(ret).toString("base64")];
|
|
165
164
|
}
|
|
166
|
-
ret = JSON.stringify(str).replace(/\\/g, "\\\\");
|
|
167
|
-
if (options.dotenv)
|
|
168
|
-
return [2 /*return*/, ret.replace(/\$/g, "\\$")];
|
|
169
165
|
return [2 /*return*/, ret];
|
|
170
166
|
}
|
|
171
167
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comet/cli",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"directory": "packages/cli",
|
|
6
6
|
"type": "git",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"ts-node": "^10.9.2"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@types/node": "^22.
|
|
25
|
+
"@types/node": "^22.15.21",
|
|
26
26
|
"eslint": "^9.22.0",
|
|
27
27
|
"npm-run-all2": "^5.0.2",
|
|
28
28
|
"rimraf": "^6.0.1",
|
|
29
29
|
"typescript": "^5.7.3",
|
|
30
|
-
"@comet/eslint-config": "8.0.0-beta.
|
|
30
|
+
"@comet/eslint-config": "8.0.0-beta.5"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">=22.0.0"
|