@zuplo/cli 1.137.0 → 1.138.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]="9679ce39-91f8-5b74-ad15-9a9a9427e410")}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]="e03e4373-c6b2-5c5e-b73d-fcff6d7d010b")}catch(e){}}();
3
3
  import { readFile, writeFile } from "node:fs/promises";
4
4
  import { join } from "node:path";
5
5
  import prettier from "prettier";
@@ -56,7 +56,7 @@ export class PackageJsonUpgrader extends StandardUpgrader {
56
56
  if (packageJson.devDependencies["@types/chai"])
57
57
  delete packageJson.devDependencies["@types/chai"];
58
58
  }
59
- const formatted = prettier.format(JSON.stringify(packageJson), {
59
+ const formatted = await prettier.format(JSON.stringify(packageJson), {
60
60
  parser: "json-stringify",
61
61
  quoteProps: "as-needed",
62
62
  });
@@ -64,4 +64,4 @@ export class PackageJsonUpgrader extends StandardUpgrader {
64
64
  }
65
65
  }
66
66
  //# sourceMappingURL=package-json-upgrader.js.map
67
- //# debugId=9679ce39-91f8-5b74-ad15-9a9a9427e410
67
+ //# debugId=e03e4373-c6b2-5c5e-b73d-fcff6d7d010b
@@ -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]="427b8d5d-9342-514f-bb93-cc1119525f44")}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]="2c738faa-55e9-5587-ad3f-7939112799e0")}catch(e){}}();
3
3
  import { parse } from "jsonc-parser";
4
4
  import { existsSync } from "node:fs";
5
5
  import { readFile, writeFile } from "node:fs/promises";
@@ -66,7 +66,7 @@ export class VsCodeSettingsJsonUpgrader extends StandardUpgrader {
66
66
  }
67
67
  ]
68
68
  }`;
69
- const formatted = prettier.format(content, {
69
+ const formatted = await prettier.format(content, {
70
70
  parser: "json",
71
71
  quoteProps: "as-needed",
72
72
  });
@@ -84,7 +84,7 @@ export class VsCodeSettingsJsonUpgrader extends StandardUpgrader {
84
84
  settingsJson["json.schemas"].push(schema);
85
85
  }
86
86
  }
87
- const formatted = prettier.format(JSON.stringify(settingsJson), {
87
+ const formatted = await prettier.format(JSON.stringify(settingsJson), {
88
88
  parser: "json",
89
89
  quoteProps: "as-needed",
90
90
  });
@@ -93,4 +93,4 @@ export class VsCodeSettingsJsonUpgrader extends StandardUpgrader {
93
93
  }
94
94
  }
95
95
  //# sourceMappingURL=vscode-settings-json-upgrader.js.map
96
- //# debugId=427b8d5d-9342-514f-bb93-cc1119525f44
96
+ //# debugId=2c738faa-55e9-5587-ad3f-7939112799e0
@@ -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]="e6a52b60-c0b1-5706-8119-a479c0ba9592")}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]="7ee0b975-ed5e-5b29-8cde-a84beac8baad")}catch(e){}}();
3
3
  import { writeFileSync } from "node:fs";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import { join, relative } from "node:path";
@@ -15,7 +15,7 @@ export async function convert(argv) {
15
15
  const routes = JSON.parse(rawRoutes.toString());
16
16
  const openApi = convertRoutes(routes);
17
17
  const openAPIFilePath = join(normalizedDir, "config", "routes.oas.json");
18
- const formattedOpenAPI = prettier.format(JSON.stringify(openApi), {
18
+ const formattedOpenAPI = await prettier.format(JSON.stringify(openApi), {
19
19
  parser: "json-stringify",
20
20
  });
21
21
  writeFileSync(openAPIFilePath, formattedOpenAPI, {
@@ -23,7 +23,7 @@ export async function convert(argv) {
23
23
  });
24
24
  const policies = convertPolicies(routes);
25
25
  const policiesFilePath = join(normalizedDir, "config", "policies.json");
26
- const formattedPolicies = prettier.format(JSON.stringify(policies), {
26
+ const formattedPolicies = await prettier.format(JSON.stringify(policies), {
27
27
  parser: "json-stringify",
28
28
  });
29
29
  writeFileSync(policiesFilePath, formattedPolicies, {
@@ -36,4 +36,4 @@ export async function convert(argv) {
36
36
  }
37
37
  }
38
38
  //# sourceMappingURL=handler.js.map
39
- //# debugId=e6a52b60-c0b1-5706-8119-a479c0ba9592
39
+ //# debugId=7ee0b975-ed5e-5b29-8cde-a84beac8baad
@@ -1,17 +1,24 @@
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]="a334ee0f-c282-5c19-8ff1-5d9a20596571")}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]="2a68c8a7-7685-52e4-93e9-6b7b75a92f82")}catch(e){}}();
3
3
  import ignore from "ignore";
4
4
  import { minimatch } from "minimatch";
5
+ import { randomBytes } from "node:crypto";
5
6
  import { existsSync, mkdirSync, readFileSync, writeFileSync, } from "node:fs";
7
+ import { tmpdir } from "node:os";
6
8
  import { join, relative, sep } from "node:path";
7
9
  import { simpleGit } from "simple-git";
8
10
  import * as tar from "tar";
9
- import * as temp from "temp";
10
11
  import { DEPLOYER_METADATA_FILE } from "../common/constants.js";
11
12
  import { logger } from "../common/logger.js";
12
13
  export const ARCHIVE_EXTENSION = ".tar.gz";
14
+ function createTempFileWithSuffix(suffix = ARCHIVE_EXTENSION) {
15
+ const tempDir = tmpdir();
16
+ const randomName = randomBytes(16).toString("hex");
17
+ const tempFilePath = join(tempDir, `${randomName}${suffix}`);
18
+ return tempFilePath;
19
+ }
13
20
  export async function archive(argv) {
14
- const tarball = temp.path({ suffix: ARCHIVE_EXTENSION });
21
+ const tarball = createTempFileWithSuffix();
15
22
  const dir = argv.dir;
16
23
  const ignoreFn = createIgnoreFunction(dir);
17
24
  const normalizedDir = join(relative(process.cwd(), dir));
@@ -108,4 +115,4 @@ async function writeGeneratedMetadata(dir, metadata) {
108
115
  });
109
116
  }
110
117
  //# sourceMappingURL=archive.js.map
111
- //# debugId=a334ee0f-c282-5c19-8ff1-5d9a20596571
118
+ //# debugId=2a68c8a7-7685-52e4-93e9-6b7b75a92f82
@@ -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]="a94104ad-6a44-5d00-851d-f9a06e68c72c")}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]="67cff82f-69c9-50d3-876f-40e3b6b9afd6")}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";
@@ -19,7 +19,7 @@ export async function safeMergeConfig(dir, project) {
19
19
  getInsertionIndex: () => 2,
20
20
  });
21
21
  const contentsPostProject = applyEdits(originalContents, modifyProjectEdit);
22
- const formatted = prettier.format(contentsPostProject, {
22
+ const formatted = await prettier.format(contentsPostProject, {
23
23
  parser: "json",
24
24
  quoteProps: "as-needed",
25
25
  });
@@ -27,7 +27,7 @@ export async function safeMergeConfig(dir, project) {
27
27
  }
28
28
  else if (existsSync(zuploFallbackConfigFile)) {
29
29
  const config = JSON.parse(await readFile(zuploFallbackConfigFile, "utf-8"));
30
- const formatted = prettier.format(JSON.stringify({
30
+ const formatted = await prettier.format(JSON.stringify({
31
31
  version: 1,
32
32
  project: project,
33
33
  compatibilityDate: config.compatibilityDate,
@@ -38,7 +38,7 @@ export async function safeMergeConfig(dir, project) {
38
38
  await writeFile(zuploPreferredConfigFile, formatted);
39
39
  }
40
40
  else {
41
- const formatted = prettier.format(JSON.stringify({
41
+ const formatted = await prettier.format(JSON.stringify({
42
42
  version: 1,
43
43
  project: project,
44
44
  compatibilityDate: "2023-03-14",
@@ -84,4 +84,4 @@ ZUPLO_SYSTEM_CONFIGURATIONS=${payload["systemConfigurations"]}
84
84
  await writeFile(zuploPreferredConfigFile, content);
85
85
  }
86
86
  //# sourceMappingURL=populate.js.map
87
- //# debugId=a94104ad-6a44-5d00-851d-f9a06e68c72c
87
+ //# debugId=67cff82f-69c9-50d3-876f-40e3b6b9afd6
@@ -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]="f2551837-2c92-5d06-a4ed-dc11de482182")}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]="2c36d082-afe3-5d10-a05d-e20f9c10dcf8")}catch(e){}}();
3
3
  import { logger } from "../common/logger.js";
4
4
  import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, textOrJson, } from "../common/output.js";
5
5
  import settings from "../common/settings.js";
@@ -23,7 +23,7 @@ async function listFromSaas(argv) {
23
23
  });
24
24
  if (listResponse.ok) {
25
25
  const { data: deployments } = await listResponse.json();
26
- const output = deployments.map((deployment) => deployment.url).join("\n");
26
+ const output = deployments.filter((deployment) => deployment.url).map((deployment) => deployment.url).join("\n");
27
27
  await printResultToConsoleAndExitGracefully(output);
28
28
  }
29
29
  else {
@@ -56,4 +56,4 @@ async function listFromSelfHosted(argv) {
56
56
  }
57
57
  }
58
58
  //# sourceMappingURL=handler.js.map
59
- //# debugId=f2551837-2c92-5d06-a4ed-dc11de482182
59
+ //# debugId=2c36d082-afe3-5d10-a05d-e20f9c10dcf8
@@ -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]="033f0170-115e-58e0-8515-63e43519f59c")}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]="c5129a8e-104c-557e-bd58-09f307c47a3f")}catch(e){}}();
3
3
  import { confirm } from "@inquirer/prompts";
4
4
  import jsYaml from "js-yaml";
5
5
  import { existsSync, writeFileSync } from "node:fs";
@@ -133,7 +133,7 @@ export async function importOpenApi(argv) {
133
133
  }
134
134
  }
135
135
  addOperationIdsAsNecessary(parsedOpenApiSpec);
136
- const formattedOpenApi = prettier.format(JSON.stringify(parsedOpenApiSpec), {
136
+ const formattedOpenApi = await prettier.format(JSON.stringify(parsedOpenApiSpec), {
137
137
  parser: "json-stringify",
138
138
  });
139
139
  writeFileSync(destinationFilePath, formattedOpenApi, {
@@ -142,4 +142,4 @@ export async function importOpenApi(argv) {
142
142
  await printResultToConsoleAndExitGracefully(`Import successful. File written to ${destinationFilePath}`);
143
143
  }
144
144
  //# sourceMappingURL=handler.js.map
145
- //# debugId=033f0170-115e-58e0-8515-63e43519f59c
145
+ //# debugId=c5129a8e-104c-557e-bd58-09f307c47a3f
@@ -1,16 +1,14 @@
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]="22d3731c-201b-5303-ad12-25a85ff3fb29")}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]="1ca2f9a0-dd2a-5e05-9db2-0a83d26896ad")}catch(e){}}();
3
3
  import fg from "fast-glob";
4
- import { promisify } from "node:util";
5
- import rimraf from "rimraf";
4
+ import { rimrafSync } from "rimraf";
6
5
  import { TEST_IN_FOLDER, TEST_OUT_FOLDER } from "../common/constants.js";
7
6
  import { logger } from "../common/logger.js";
8
7
  import { generateBuildOptionsForTest } from "./esbuild-config.js";
9
8
  import { runTests } from "./invoke-test.js";
10
- const rimrafp = promisify(rimraf);
11
9
  import esbuild from "esbuild";
12
10
  export async function test(argv) {
13
- await rimrafp(`${argv.dir}/${TEST_OUT_FOLDER}`);
11
+ rimrafSync(`${argv.dir}/${TEST_OUT_FOLDER}`);
14
12
  const result = await esbuild.build({
15
13
  ...generateBuildOptionsForTest(argv),
16
14
  entryPoints: fg.sync(`${argv.dir}/${TEST_IN_FOLDER}/**/*.test.ts`),
@@ -27,4 +25,4 @@ export async function test(argv) {
27
25
  }
28
26
  }
29
27
  //# sourceMappingURL=handler.js.map
30
- //# debugId=22d3731c-201b-5303-ad12-25a85ff3fb29
28
+ //# debugId=1ca2f9a0-dd2a-5e05-9db2-0a83d26896ad
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "1.137.0",
3
+ "version": "1.138.0",
4
4
  "type": "module",
5
5
  "repository": "https://github.com/zuplo/cli",
6
6
  "description": "The command-line interface for Zuplo",
@@ -11,8 +11,7 @@
11
11
  "build": "tsc --build && node ./scripts/post-build.js",
12
12
  "clean": "git clean -Xfde !.env",
13
13
  "sentry:sourcemaps": "sentry-cli sourcemaps inject --org zuplo --project zuplo-cli ./dist",
14
- "test": "mocha",
15
- "test:debug": "mocha --timeout 0"
14
+ "test": "node --test dist/**/*.spec.js"
16
15
  },
17
16
  "engines": {
18
17
  "node": ">=18.0.0"
@@ -30,37 +29,32 @@
30
29
  },
31
30
  "devDependencies": {
32
31
  "@sentry/cli": "^2.20.7",
33
- "@types/chai": "^4.3.4",
34
- "@types/js-yaml": "^4.0.8",
35
- "@types/mocha": "^10.0.1",
32
+ "@types/chai": "^4.3.17",
33
+ "@types/js-yaml": "^4.0.9",
36
34
  "@types/node": "^18.15.11",
37
- "@types/prettier": "^2.7.2",
38
- "@types/rimraf": "^3.0.2",
39
- "@types/semver": "^7.3.13",
40
- "@types/tar": "^6.1.4",
41
- "@types/temp": "^0.9.1",
42
- "@types/uuid": "^9.0.6",
43
- "@types/yargs": "^17.0.24",
44
- "@typescript-eslint/eslint-plugin": "^5.57.1",
45
- "@typescript-eslint/parser": "^5.57.1",
46
- "chai": "^4.3.7",
47
- "eslint": "^8.37.0",
48
- "eslint-config-prettier": "^8.8.0",
49
- "eslint-plugin-import": "^2.27.5",
35
+ "@types/semver": "^7.5.8",
36
+ "@types/tar": "^6.1.13",
37
+ "@types/temp": "^0.9.4",
38
+ "@types/uuid": "^10.0.0",
39
+ "@types/yargs": "^17.0.33",
40
+ "@typescript-eslint/eslint-plugin": "^8.2.0",
41
+ "@typescript-eslint/parser": "^8.2.0",
42
+ "chai": "^5.1.1",
43
+ "eslint": "^9.9.1",
44
+ "eslint-config-prettier": "^9.1.0",
50
45
  "eslint-plugin-node": "^11.1.0",
51
- "eslint-plugin-unicorn": "^44.0.2",
52
- "husky": "^8.0.3",
53
- "lint-staged": "^13.2.0",
54
- "mocha": "^10.2.0",
46
+ "eslint-plugin-unicorn": "^55.0.0",
47
+ "husky": "^9.1.5",
48
+ "lint-staged": "^15.2.9",
55
49
  "openapi-types": "^12.1.3",
56
- "prettier-plugin-organize-imports": "^3.2.2",
57
- "typescript": "^5.2.2",
58
- "undici": "^6.10.1"
50
+ "prettier-plugin-organize-imports": "^4.0.0",
51
+ "typescript": "^5.5.4",
52
+ "undici": "^6.19.8"
59
53
  },
60
54
  "dependencies": {
61
- "@fastify/cors": "^8.3.0",
62
- "@fastify/static": "^6.10.2",
63
- "@inquirer/prompts": "^3.0.4",
55
+ "@fastify/cors": "^9.0.1",
56
+ "@fastify/static": "^7.0.4",
57
+ "@inquirer/prompts": "^5.3.8",
64
58
  "@opentelemetry/api": "^1.8.0",
65
59
  "@sentry/node": "7.69.0",
66
60
  "@swc/core": "1.3.78",
@@ -83,17 +77,15 @@
83
77
  "jsonc-parser": "3.2.0",
84
78
  "minimatch": "^9.0.3",
85
79
  "open": "^9.1.0",
86
- "pino": "^8.11.0",
87
- "pino-pretty": "^9.4.0",
80
+ "pino": "^9.3.2",
81
+ "pino-pretty": "^11.2.2",
88
82
  "posthog-node": "4.0.1",
89
- "prettier": "^2.8.7",
90
- "rimraf": "^3.0.2",
91
- "rollup-plugin-node-polyfills": "^0.2.1",
83
+ "prettier": "^3.3.3",
84
+ "rimraf": "^5.0.10",
92
85
  "semver": "^7.5.2",
93
86
  "simple-git": "^3.17.0",
94
87
  "strip-ansi": "^7.1.0",
95
- "tar": "^7.1.0",
96
- "temp": "^0.9.4",
88
+ "tar": "^7.4.3",
97
89
  "uuid": "^9.0.1",
98
90
  "workerd": "1.20240725.0",
99
91
  "yargs": "^17.7.1"