@zuplo/cli 1.122.0 → 1.124.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="900cc4b4-1ae7-5479-88e9-e4202f881b3f")}catch(e){}}();
|
|
3
|
+
import jsoncParser from "jsonc-parser";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
import { readFile } from "node:fs/promises";
|
|
6
6
|
import { resolve } from "node:path";
|
|
@@ -45,7 +45,9 @@ async function processZuploConfigurationFile() {
|
|
|
45
45
|
return {};
|
|
46
46
|
}
|
|
47
47
|
const errors = [];
|
|
48
|
-
const data = parse(fileContents, errors, {
|
|
48
|
+
const data = jsoncParser.parse(fileContents, errors, {
|
|
49
|
+
allowTrailingComma: true,
|
|
50
|
+
});
|
|
49
51
|
if (errors.length > 0) {
|
|
50
52
|
logger.trace(errors[0], "Failed to parse zuplo.jsonc");
|
|
51
53
|
await printCriticalFailureToConsoleAndExit("Error: Failed to parse the values from zuplo.jsonc. Check your zuplo.jsonc file.");
|
|
@@ -59,4 +61,4 @@ const omitNull = (obj) => {
|
|
|
59
61
|
return obj;
|
|
60
62
|
};
|
|
61
63
|
//# sourceMappingURL=user-configuration.js.map
|
|
62
|
-
//# debugId=
|
|
64
|
+
//# debugId=900cc4b4-1ae7-5479-88e9-e4202f881b3f
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f0d62b68-7ff8-5a01-80ea-5acb654f8728")}catch(e){}}();
|
|
3
|
+
import jsoncParser from "jsonc-parser";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
import { readFile, writeFile } from "node:fs/promises";
|
|
6
6
|
import { join } from "node:path";
|
|
@@ -74,7 +74,9 @@ export class VsCodeSettingsJsonUpgrader extends StandardUpgrader {
|
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
76
|
const settingsRaw = await readFile(vsCodeSettingsFile, "utf-8");
|
|
77
|
-
const settingsJson = parse(settingsRaw, [], {
|
|
77
|
+
const settingsJson = jsoncParser.parse(settingsRaw, [], {
|
|
78
|
+
allowTrailingComma: true,
|
|
79
|
+
});
|
|
78
80
|
for (const schema of zuploSchemas) {
|
|
79
81
|
const existingSchema = settingsJson["json.schemas"].find((s) => s.fileMatch[0] === schema.fileMatch[0]);
|
|
80
82
|
if (existingSchema) {
|
|
@@ -93,4 +95,4 @@ export class VsCodeSettingsJsonUpgrader extends StandardUpgrader {
|
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
//# sourceMappingURL=vscode-settings-json-upgrader.js.map
|
|
96
|
-
//# debugId=
|
|
98
|
+
//# debugId=f0d62b68-7ff8-5a01-80ea-5acb654f8728
|
package/dist/link/populate.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e31f79b9-11c8-5dd6-8809-d237a2cf1a75")}catch(e){}}();
|
|
3
|
+
import jsoncParser from "jsonc-parser";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
import { readFile, writeFile } from "node:fs/promises";
|
|
6
6
|
import { join, relative } from "node:path";
|
|
7
7
|
import prettier from "prettier";
|
|
8
8
|
import { ZUPLO_FALLBACK_JSON_FILE, ZUPLO_PREFERRED_JSON_FILE, ZUPLO_SYSTEM_ENV_VAR, } from "../common/constants.js";
|
|
9
|
+
import { logger } from "../common/logger.js";
|
|
10
|
+
import { printCriticalFailureToConsoleAndExit } from "../common/output.js";
|
|
9
11
|
import settings from "../common/settings.js";
|
|
10
12
|
export async function safeMergeConfig(dir, project) {
|
|
11
13
|
const normalizedDir = join(relative(process.cwd(), dir));
|
|
@@ -13,10 +15,10 @@ export async function safeMergeConfig(dir, project) {
|
|
|
13
15
|
const zuploFallbackConfigFile = join(normalizedDir, ZUPLO_FALLBACK_JSON_FILE);
|
|
14
16
|
if (existsSync(zuploPreferredConfigFile)) {
|
|
15
17
|
const originalContents = await readFile(zuploPreferredConfigFile, "utf-8");
|
|
16
|
-
const modifyProjectEdit = modify(originalContents, ["project"], project, {
|
|
18
|
+
const modifyProjectEdit = jsoncParser.modify(originalContents, ["project"], project, {
|
|
17
19
|
getInsertionIndex: () => 2,
|
|
18
20
|
});
|
|
19
|
-
const contentsPostProject = applyEdits(originalContents, modifyProjectEdit);
|
|
21
|
+
const contentsPostProject = jsoncParser.applyEdits(originalContents, modifyProjectEdit);
|
|
20
22
|
const formatted = prettier.format(contentsPostProject, {
|
|
21
23
|
parser: "json",
|
|
22
24
|
quoteProps: "as-needed",
|
|
@@ -55,6 +57,19 @@ export async function pullSystemConfig(argv) {
|
|
|
55
57
|
authorization: `Bearer ${argv["api-key"]}`,
|
|
56
58
|
},
|
|
57
59
|
});
|
|
60
|
+
if (!environmentResponseFromDeveloperAPI.ok) {
|
|
61
|
+
if (environmentResponseFromDeveloperAPI.status === 404 ||
|
|
62
|
+
environmentResponseFromDeveloperAPI.status === 401) {
|
|
63
|
+
await printCriticalFailureToConsoleAndExit("Error: Failed to link data from the environment. The environment you specified doesn't exist or you don't have access to it.");
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
logger.error({
|
|
67
|
+
status: environmentResponseFromDeveloperAPI.status,
|
|
68
|
+
statusText: environmentResponseFromDeveloperAPI.statusText,
|
|
69
|
+
}, `Failed to link data from ${argv.environment}`);
|
|
70
|
+
await printCriticalFailureToConsoleAndExit("Error: Failed to link data from the environment. Please try again later.");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
58
73
|
const payload = await environmentResponseFromDeveloperAPI.json();
|
|
59
74
|
const content = `
|
|
60
75
|
# This file is auto-generated from zup link. Please do not edit it manually.
|
|
@@ -69,4 +84,4 @@ ZUPLO_SYSTEM_CONFIGURATIONS=${payload["systemConfigurations"]}
|
|
|
69
84
|
await writeFile(zuploPreferredConfigFile, content);
|
|
70
85
|
}
|
|
71
86
|
//# sourceMappingURL=populate.js.map
|
|
72
|
-
//# debugId=
|
|
87
|
+
//# debugId=e31f79b9-11c8-5dd6-8809-d237a2cf1a75
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.124.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": "https://github.com/zuplo/cli",
|
|
6
6
|
"description": "The command-line interface for Zuplo",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"ignore": "^5.2.4",
|
|
81
81
|
"jose": "^4.14.4",
|
|
82
82
|
"js-yaml": "^4.1.0",
|
|
83
|
-
"jsonc-parser": "^3.2.
|
|
83
|
+
"jsonc-parser": "^3.2.1",
|
|
84
84
|
"minimatch": "^9.0.3",
|
|
85
85
|
"open": "^9.1.0",
|
|
86
86
|
"pino": "^8.11.0",
|