@zuplo/cli 6.59.43 → 6.59.45
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.
package/dist/cmds/dev.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cmds/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAWV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cmds/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAWV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBAwCf,OAAO;;AA3C/B,wBAwDE"}
|
package/dist/cmds/dev.js
CHANGED
|
@@ -34,6 +34,11 @@ export default {
|
|
|
34
34
|
.option("debug-port", {
|
|
35
35
|
type: "number",
|
|
36
36
|
describe: "The port to run the Chrome inspector on",
|
|
37
|
+
})
|
|
38
|
+
.option("unsafely-ignore-certificate-errors", {
|
|
39
|
+
type: "boolean",
|
|
40
|
+
describe: "Unsafely ignore certificate errors",
|
|
41
|
+
default: false,
|
|
37
42
|
})
|
|
38
43
|
.middleware([setBlocking, identify])
|
|
39
44
|
.check(async (argv) => {
|
|
@@ -45,6 +50,7 @@ export default {
|
|
|
45
50
|
argv,
|
|
46
51
|
properties: {
|
|
47
52
|
"debug-port": argv["debugPort"],
|
|
53
|
+
"unsafely-ignore-certificate-errors": argv["unsafelyIgnoreCertificateErrors"],
|
|
48
54
|
},
|
|
49
55
|
event: "zuplo dev",
|
|
50
56
|
});
|
package/dist/cmds/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/cmds/dev.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,Y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AAyC;SACpD,CAAC;aACD,MAAM,CAAC,oCAAoC,EAAE;YAC5C,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,oCAAoC;YAC9C,OAAO,EAAE,KAAK;SACf,CAAC;aACD,UAAU,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;aACnC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACpB,OAAO,MAAM,IAAI,YAAY,CAC3B,IAAI,qBAAqB,EAAE,CAC5B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC;YACjB,IAAI;YACJ,UAAU,EAAE;gBACV,YAAY,EAAG,IAAkB,CAAC,WAAW,CAAC;gBAC9C,oCAAoC,EAAG,IAAkB,CACvD,iCAAiC,CAClC;aACF;YACD,KAAK,EAAE,WAAW;SACnB,CAAC,CAAC;QACH,MAAM,GAAG,CAAC,IAAiB,CAAC,CAAC;IAC/B,CAAC;CACF,CAAC","sourcesContent":["import { Argv } from \"yargs\";\nimport { captureEvent } from \"../common/analytics/lib.js\";\nimport { identify } from \"../common/middleware/user-identification.js\";\nimport setBlocking from \"../common/output.js\";\nimport { ZuploProjectValidator } from \"../common/validators/file-system-validator.js\";\nimport { YargsChecker } from \"../common/validators/lib.js\";\nimport { Arguments, dev } from \"../dev/handler.js\";\n\nexport default {\n desc: \"Runs the Zuplo API locally\",\n command: \"dev\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .option(\"dir\", {\n type: \"string\",\n describe: \"The directory containing your Zuplo API\",\n default: \".\",\n normalize: true,\n hidden: true,\n })\n .option(\"start-editor\", {\n type: \"boolean\",\n describe: \"Start the editor with the local server\",\n default: true,\n })\n .option(\"port\", {\n type: \"number\",\n describe: \"The port to run the local server on\",\n default: 9000,\n })\n .option(\"editor-port\", {\n type: \"number\",\n describe: \"The port to run the route designer on\",\n default: 9100,\n })\n .option(\"debug-port\", {\n type: \"number\",\n describe: \"The port to run the Chrome inspector on\",\n })\n .option(\"unsafely-ignore-certificate-errors\", {\n type: \"boolean\",\n describe: \"Unsafely ignore certificate errors\",\n default: false,\n })\n .middleware([setBlocking, identify])\n .check(async (argv) => {\n return await new YargsChecker<typeof argv>(\n new ZuploProjectValidator()\n ).check(argv);\n });\n },\n handler: async (argv: unknown) => {\n await captureEvent({\n argv,\n properties: {\n \"debug-port\": (argv as Arguments)[\"debugPort\"],\n \"unsafely-ignore-certificate-errors\": (argv as Arguments)[\n \"unsafelyIgnoreCertificateErrors\"\n ],\n },\n event: \"zuplo dev\",\n });\n await dev(argv as Arguments);\n },\n};\n"]}
|
package/dist/dev/handler.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/dev/handler.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/dev/handler.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B,CAAC,EAAE,OAAO,CAAC;CAC3C;AAED,wBAAsB,GAAG,CAAC,IAAI,EAAE,SAAS,iBAiKxC"}
|
package/dist/dev/handler.js
CHANGED
|
@@ -56,7 +56,8 @@ export async function dev(argv) {
|
|
|
56
56
|
output: new ConsoleOutput(),
|
|
57
57
|
sourceDirectory,
|
|
58
58
|
port: zupPort,
|
|
59
|
-
debugPort: argv.debugPort
|
|
59
|
+
debugPort: argv.debugPort,
|
|
60
|
+
unsafelyIgnoreCertificateErrors: argv.unsafelyIgnoreCertificateErrors,
|
|
60
61
|
publicZuploEnvironmentVariables: envZuplo
|
|
61
62
|
? {
|
|
62
63
|
ZUPLO_ACCOUNT_NAME: envZuplo.ZUPLO_ACCOUNT_NAME,
|
package/dist/dev/handler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/dev/handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,aAAa,EACb,oCAAoC,EACpC,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/dev/handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,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B,CACvB,uCAAuC,IAAI,CAAC,UAAU,EAAE,CACzD,CAAC;IACJ,CAAC;IACD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,yBAAyB,CACvB,iCAAiC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CACpE,CAAC;IACJ,CAAC;IACD,yBAAyB,CAAC,EAAE,CAAC,CAAC;IAC9B,yBAAyB,CAAC,EAAE,CAAC,CAAC;IAE9B,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QACnC,KAAK,UAAU,IAAI;YACjB,yBAAyB,CAAC,EAAE,CAAC,CAAC;YAC9B,yBAAyB,CAAC,sCAAsC,CAAC,CAAC;YAElE,IAAI,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;gBACzB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACvB,CAAC;YACD,OAAO,EAAE,CAAC;QACZ,CAAC;QAGD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAE5B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/* eslint-disable node/no-process-env */\n\nimport { randomUUID } from \"node:crypto\";\nimport { cpSync, existsSync, readFileSync } from \"node:fs\";\nimport { join, relative, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport dotenv from \"dotenv\";\nimport { logger } from \"../common/logger.js\";\nimport {\n ConsoleOutput,\n printCriticalFailureToConsoleAndExit,\n printDiagnosticsToConsole,\n} from \"../common/output.js\";\nimport { isPortAvailable } from \"../common/utils/ports.js\";\nimport { handleRuntimeStdio } from \"../common/worker-output.js\";\nimport { ApiServer } from \"../editor/server/server.js\";\n\nexport interface Arguments {\n dir: string;\n \"start-editor\": boolean;\n port: number;\n editorPort: number;\n debugPort?: number;\n unsafelyIgnoreCertificateErrors?: boolean;\n}\n\nexport async function dev(argv: Arguments) {\n const sourceDirectory = resolve(join(relative(process.cwd(), argv.dir)));\n\n // When we build, we MIGHT need to use the @zuplo/runtime from the node_modules if the user\n // has installed our packages using https://www.npmjs.com/package/zuplo in a global directory\n\n // Try to copy the @zuplo/runtime locally\n const zuploRuntimePath = new URL(\n \"../../node_modules/@zuplo/runtime\",\n import.meta.url\n );\n if (existsSync(zuploRuntimePath)) {\n cpSync(\n zuploRuntimePath,\n join(sourceDirectory, \"node_modules/@zuplo/runtime\"),\n {\n recursive: true,\n dereference: true,\n }\n );\n }\n\n // Set GLOBAL_MODULE_LOCATION to the location of the CLIs node_modules\n process.env.GLOBAL_MODULE_LOCATION = fileURLToPath(\n new URL(\"../../node_modules\", import.meta.url)\n );\n\n const loadedEnvFiles: string[] = [];\n\n // Check if the user has a .env file\n const envFile = join(sourceDirectory, \".env\");\n if (existsSync(envFile)) {\n loadedEnvFiles.push(\".env\");\n }\n\n // Check if the user has a .env.zuplo file\n let envZuplo: dotenv.DotenvParseOutput | undefined;\n const envZuploFile = join(sourceDirectory, \".env.zuplo\");\n if (existsSync(envZuploFile)) {\n const contents = readFileSync(envZuploFile);\n envZuplo = dotenv.parse(contents);\n loadedEnvFiles.push(\".env.zuplo\");\n }\n\n // Set other variables using __ZUPLO_CONFIG as necessary\n // const config = {\n // };\n // process.env.__ZUPLO_CONFIG = btoa(JSON.stringify(config));\n process.env.ZUPLO_IS_LOCAL_DEVELOPMENT = \"true\";\n\n // Use a dynamic import so that setting process.env has effect\n const core = await import(\"@zuplo/core/cli\");\n\n const zupPort = argv.port;\n const zupEditorPort = argv.editorPort;\n const zupDebugPort = argv.debugPort;\n\n const isZupPortAvailable = await isPortAvailable(\"localhost\", zupPort);\n if (!isZupPortAvailable) {\n await printCriticalFailureToConsoleAndExit(\n `Port ${zupPort} is already in use. Please specify a different port using --port.`\n );\n }\n\n const isZupEditorPortAvailable = await isPortAvailable(\n \"localhost\",\n zupEditorPort\n );\n if (!isZupEditorPortAvailable) {\n await printCriticalFailureToConsoleAndExit(\n `Port ${zupEditorPort} is already in use. Please specify a different port using --editor-port.`\n );\n }\n\n if (zupDebugPort) {\n const isZupDebugPortAvailable = await isPortAvailable(\n \"localhost\",\n zupDebugPort\n );\n if (!isZupDebugPortAvailable) {\n await printCriticalFailureToConsoleAndExit(\n `Port ${zupDebugPort} is already in use. Please specify a different port using --debug-port.`\n );\n }\n }\n\n const buildId = randomUUID();\n\n let firstLoad = true;\n\n await core.startDevServer({\n buildId,\n output: new ConsoleOutput(),\n sourceDirectory,\n port: zupPort,\n debugPort: argv.debugPort,\n unsafelyIgnoreCertificateErrors: argv.unsafelyIgnoreCertificateErrors,\n publicZuploEnvironmentVariables: envZuplo\n ? {\n ZUPLO_ACCOUNT_NAME: envZuplo.ZUPLO_ACCOUNT_NAME,\n ZUPLO_PROJECT_NAME: envZuplo.ZUPLO_PROJECT_NAME,\n ZUPLO_ENVIRONMENT_TYPE: envZuplo.ZUPLO_ENVIRONMENT_TYPE,\n }\n : // Leave this as undefined to simulate the old behavior\n undefined,\n logger,\n handleRuntimeStdio,\n onReload: () => {\n if (firstLoad) {\n firstLoad = false;\n } else {\n printDiagnosticsToConsole(\"Code changed. Server reloaded...\");\n }\n },\n });\n\n let editor: ApiServer;\n\n if (argv[\"start-editor\"]) {\n editor = new ApiServer({\n cliArgs: argv,\n workingDir: sourceDirectory,\n port: argv.editorPort,\n isStandalone: false,\n });\n editor.start().catch((err) => logger.error(err));\n }\n\n printDiagnosticsToConsole(\"Started local development setup\");\n printDiagnosticsToConsole(\"Ctrl+C to exit\");\n printDiagnosticsToConsole(\"\");\n printDiagnosticsToConsole(`🚀 Zuplo Gateway: http://localhost:${zupPort}`);\n if (argv[\"start-editor\"]) {\n printDiagnosticsToConsole(\n `📘 Route Designer: http://localhost:${argv.editorPort}`\n );\n }\n if (loadedEnvFiles.length > 0) {\n printDiagnosticsToConsole(\n `⚙️ Loaded env files: \\n - ${loadedEnvFiles.join(\" \\n - \")}`\n );\n }\n printDiagnosticsToConsole(\"\");\n printDiagnosticsToConsole(\"\");\n\n return new Promise<void>((resolve) => {\n async function exit() {\n printDiagnosticsToConsole(\"\");\n printDiagnosticsToConsole(\"Stopping local development server...\");\n\n if (argv[\"start-editor\"]) {\n await editor.close();\n }\n resolve();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n process.on(\"SIGTERM\", exit);\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n process.on(\"SIGINT\", exit);\n });\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/cli",
|
|
3
|
-
"version": "6.59.
|
|
3
|
+
"version": "6.59.45",
|
|
4
4
|
"repository": "https://github.com/zuplo/zuplo",
|
|
5
5
|
"author": "Zuplo, Inc.",
|
|
6
6
|
"type": "module",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@opentelemetry/api": "1.9.0",
|
|
30
30
|
"@sentry/node": "9.22.0",
|
|
31
31
|
"@swc/core": "1.10.18",
|
|
32
|
-
"@zuplo/core": "6.59.
|
|
33
|
-
"@zuplo/openapi-tools": "6.59.
|
|
34
|
-
"@zuplo/runtime": "6.59.
|
|
32
|
+
"@zuplo/core": "6.59.45",
|
|
33
|
+
"@zuplo/openapi-tools": "6.59.45",
|
|
34
|
+
"@zuplo/runtime": "6.59.45",
|
|
35
35
|
"as-table": "1.0.55",
|
|
36
36
|
"chalk": "5.4.1",
|
|
37
37
|
"chokidar": "3.5.3",
|