@zuplo/cli 1.119.0 → 1.120.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,5 +1,5 @@
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]="42cac298-fcf2-5562-897a-c038f723b42f")}catch(e){}}();
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]="be0ac435-2dd7-5dd2-8b70-531169e83b20")}catch(e){}}();
3
3
  export {};
4
4
  //# sourceMappingURL=lib.js.map
5
- //# debugId=42cac298-fcf2-5562-897a-c038f723b42f
5
+ //# debugId=be0ac435-2dd7-5dd2-8b70-531169e83b20
@@ -1,5 +1,5 @@
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]="73d10b24-273b-5673-84fb-1a5d0cf42473")}catch(e){}}();
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]="925b9d73-a4de-58c0-8f9c-d757c8155db7")}catch(e){}}();
3
3
  import dotenv from "dotenv";
4
4
  import { cpSync, existsSync, readFileSync } from "node:fs";
5
5
  import { join, relative, resolve } from "node:path";
@@ -37,10 +37,11 @@ export async function compile(argv) {
37
37
  ZUPLO_PROJECT_NAME: envZuplo.ZUPLO_PROJECT_NAME,
38
38
  ZUPLO_ENVIRONMENT_TYPE: envZuplo.ZUPLO_ENVIRONMENT_TYPE,
39
39
  }
40
- : {},
40
+ :
41
+ undefined,
41
42
  });
42
43
  printDiagnosticsToConsole("📦 Compiled a self-contained zup binary");
43
44
  printDiagnosticsToConsole(`The binary is available at ${sourceDirectory}/dist/${argv["binary-name"]}`);
44
45
  }
45
46
  //# sourceMappingURL=handler.js.map
46
- //# debugId=73d10b24-273b-5673-84fb-1a5d0cf42473
47
+ //# debugId=925b9d73-a4de-58c0-8f9c-d757c8155db7
@@ -1,5 +1,5 @@
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]="5bca5e0a-7dea-5646-b573-80529e630b6e")}catch(e){}}();
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]="249e5ca0-cf2e-5cef-a5c8-0d053825f965")}catch(e){}}();
3
3
  import dotenv from "dotenv";
4
4
  import { cpSync, existsSync, readFileSync } from "node:fs";
5
5
  import { join, relative, resolve } from "node:path";
@@ -23,7 +23,7 @@ export async function dev(argv) {
23
23
  if (existsSync(envFile)) {
24
24
  loadedEnvFiles.push(".env");
25
25
  }
26
- let envZuplo = {};
26
+ let envZuplo;
27
27
  const envZuploFile = join(sourceDirectory, ".env.zuplo");
28
28
  if (existsSync(envZuploFile)) {
29
29
  const contents = readFileSync(envZuploFile);
@@ -34,6 +34,7 @@ export async function dev(argv) {
34
34
  build_assets_url: pathToFileURL(sourceDirectory),
35
35
  };
36
36
  process.env.__ZUPLO_CONFIG = btoa(JSON.stringify(config));
37
+ process.env.ZUPLO_IS_LOCAL_DEVELOPMENT = "true";
37
38
  const core = await import("@zuplo/core");
38
39
  const zupPort = argv.port;
39
40
  const zupEditorPort = argv.editorPort;
@@ -62,7 +63,8 @@ export async function dev(argv) {
62
63
  ZUPLO_PROJECT_NAME: envZuplo.ZUPLO_PROJECT_NAME,
63
64
  ZUPLO_ENVIRONMENT_TYPE: envZuplo.ZUPLO_ENVIRONMENT_TYPE,
64
65
  }
65
- : {},
66
+ :
67
+ undefined,
66
68
  });
67
69
  let editor;
68
70
  if (argv["start-editor"]) {
@@ -100,4 +102,4 @@ export async function dev(argv) {
100
102
  });
101
103
  }
102
104
  //# sourceMappingURL=handler.js.map
103
- //# debugId=5bca5e0a-7dea-5646-b573-80529e630b6e
105
+ //# debugId=249e5ca0-cf2e-5cef-a5c8-0d053825f965
@@ -1,5 +1,5 @@
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]="ad2554cf-74a8-5032-b89f-1ffefcd558f0")}catch(e){}}();
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]="90968db1-f5e4-5d8c-bbaa-d4b1a87e94fa")}catch(e){}}();
3
3
  import { select } from "@inquirer/prompts";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import { join } from "node:path";
@@ -9,6 +9,19 @@ import { printCriticalFailureToConsoleAndExit, printResultToConsoleAndExitGracef
9
9
  import settings from "../common/settings.js";
10
10
  import { ZUPLO_XDG_STATE_HOME } from "../common/xdg/lib.js";
11
11
  import { pullSystemConfig, safeMergeConfig } from "./populate.js";
12
+ function prettyPrintEnvironmentPrompt(env) {
13
+ const name = env.name;
14
+ let environmentType = env.environmentType.toLowerCase();
15
+ let branchName = env.branchName;
16
+ switch (environmentType) {
17
+ case "working-copy":
18
+ case "working_copy":
19
+ environmentType = "development";
20
+ branchName = "(via portal.zuplo.com)";
21
+ break;
22
+ }
23
+ return `${env.name} (${environmentType}, ${branchName})`;
24
+ }
12
25
  export async function link(argv) {
13
26
  const rawAuth = await readFile(join(ZUPLO_XDG_STATE_HOME, ZUPLO_AUTH_FILE_NAME), "utf-8");
14
27
  const authJson = JSON.parse(rawAuth);
@@ -88,17 +101,33 @@ export async function link(argv) {
88
101
  },
89
102
  });
90
103
  const environmentJsonFromDeveloperAPI = (await environmentResponseFromDeveloperAPI.json());
91
- const environments = Object.assign({}, environmentJsonFromZuploAPI.data.map((env) => env.name), environmentJsonFromDeveloperAPI.data.map((env) => env.name));
92
- if (environments.length === 1) {
93
- environment = environments[0];
104
+ const environments = Object.assign({}, environmentJsonFromZuploAPI.data
105
+ .map((env) => {
106
+ return {
107
+ [prettyPrintEnvironmentPrompt(env)]: env.name,
108
+ };
109
+ })
110
+ .reduce((acc, curr) => {
111
+ return { ...acc, ...curr };
112
+ }), environmentJsonFromDeveloperAPI.data
113
+ .map((env) => {
114
+ return {
115
+ [prettyPrintEnvironmentPrompt(env)]: env.name,
116
+ };
117
+ })
118
+ .reduce((acc, curr) => {
119
+ return { ...acc, ...curr };
120
+ }));
121
+ if (Object.values(environments).length === 1) {
122
+ environment = Object.values(environments)[0];
94
123
  }
95
124
  else {
96
125
  environment = await select({
97
126
  message: "Select the environment to work with",
98
- choices: Object.values(environments).map((env) => {
127
+ choices: Object.entries(environments).map(([key, value]) => {
99
128
  return {
100
- name: env,
101
- value: env,
129
+ name: key,
130
+ value,
102
131
  };
103
132
  }),
104
133
  });
@@ -114,4 +143,4 @@ Successfully linked your local directory to the ${project} project in the ${acco
114
143
  .env.zuplo and zuplo.jsonc have been updated with the new values.`);
115
144
  }
116
145
  //# sourceMappingURL=handler.js.map
117
- //# debugId=ad2554cf-74a8-5032-b89f-1ffefcd558f0
146
+ //# debugId=90968db1-f5e4-5d8c-bbaa-d4b1a87e94fa
@@ -1,5 +1,5 @@
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]="da90a012-8772-5d2a-9ae1-fcaa66577120")}catch(e){}}();
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]="6b8807e2-ae71-5c69-b1b0-2b87dae3cfdb")}catch(e){}}();
3
3
  import { applyEdits, modify } from "jsonc-parser";
4
4
  import { existsSync } from "node:fs";
5
5
  import { readFile, writeFile } from "node:fs/promises";
@@ -64,9 +64,9 @@ export async function pullSystemConfig(argv) {
64
64
  ZUPLO_ACCOUNT_NAME=${payload.accountName}
65
65
  ZUPLO_PROJECT_NAME=${payload.projectName}
66
66
  ZUPLO_ENVIRONMENT_TYPE=${payload.environmentType}
67
- SYSTEM_CONFIGURATIONS=${payload["systemConfigurations"]}
67
+ ZUPLO_SYSTEM_CONFIGURATIONS=${payload["systemConfigurations"]}
68
68
  `;
69
69
  await writeFile(zuploPreferredConfigFile, content);
70
70
  }
71
71
  //# sourceMappingURL=populate.js.map
72
- //# debugId=da90a012-8772-5d2a-9ae1-fcaa66577120
72
+ //# debugId=6b8807e2-ae71-5c69-b1b0-2b87dae3cfdb
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "1.119.0",
3
+ "version": "1.120.0",
4
4
  "type": "module",
5
5
  "repository": "https://github.com/zuplo/cli",
6
6
  "description": "The command-line interface for Zuplo",
@@ -64,10 +64,10 @@
64
64
  "@opentelemetry/api": "^1.8.0",
65
65
  "@sentry/node": "7.69.0",
66
66
  "@swc/core": "1.3.78",
67
- "@zuplo/core": "5.2249.0",
67
+ "@zuplo/core": "5.2251.0",
68
68
  "@zuplo/deno-bin": "1.37.1",
69
69
  "@zuplo/pino-pretty-configurations": "^1.5.0",
70
- "@zuplo/runtime": "5.2249.0",
70
+ "@zuplo/runtime": "5.2251.0",
71
71
  "chalk": "^5.1.2",
72
72
  "chokidar": "^3.5.3",
73
73
  "dotenv": "^16.3.1",