@zuplo/cli 6.38.2 → 6.38.9

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 +1 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/cmds/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAaV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBAqCf,OAAO;;AA1C/B,wBA8CE"}
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/cmds/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAaV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBA2Cf,OAAO;;AAhD/B,wBAoDE"}
@@ -30,6 +30,12 @@ export default {
30
30
  type: "string",
31
31
  describe: "The name of the binary",
32
32
  default: "compiled-zup",
33
+ })
34
+ .option("build-id", {
35
+ type: "string",
36
+ describe: "The buildId to use for remote assets",
37
+ default: "",
38
+ hidden: true,
33
39
  })
34
40
  .middleware([setBlocking, identify])
35
41
  .check(async (argv) => {
@@ -1 +1 @@
1
- {"version":3,"file":"compile.js","sourceRoot":"","sources":["../../src/cmds/compile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AACvE,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAa,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAE3D,eAAe;IAEb,IAAI,EAAE,KAAK;IAEX,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,CAAC,KAAW,EAAiB,EAAE;QACtC,OAAO,KAAK;aACT,MAAM,CAAC,KAAK,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,mCAAmC;YAC7C,OAAO,EAAE,GAAG;YACZ,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,IAAI;SACb,CAAC;aACD,MAAM,CAAC,aAAa,EAAE;YACrB,IAAI,EAAE,QAAQ;YACd,QAAQ,EACN,mFAAmF;YACrF,MAAM,EAAE,IAAI;SACb,CAAC;aACD,MAAM,CAAC,MAAM,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,mCAAmC;YAC7C,OAAO,EAAE,IAAI;SACd,CAAC;aACD,MAAM,CAAC,aAAa,EAAE;YACrB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wBAAwB;YAClC,OAAO,EAAE,cAAc;SACxB,CAAC;aACD,UAAU,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;aACnC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACpB,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;gBAExB,OAAO,IAAI,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,OAAO,MAAM,IAAI,YAAY,CAC3B,IAAI,qBAAqB,EAAE,CAC5B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC;QACH,CAAC,CAAC,CAAC;IACP,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;QACnD,MAAM,OAAO,CAAC,IAAiB,CAAC,CAAC;IACnC,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, compile } from \"../compile/handler.js\";\n\nexport default {\n // For now, hide this command\n desc: false,\n // desc: \"Compiles a self-contained zup binary\",\n command: \"compile\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .option(\"dir\", {\n type: \"string\",\n describe: \"The directory containing your zup\",\n default: \".\",\n normalize: true,\n hidden: true,\n })\n .option(\"bundled-dir\", {\n type: \"string\",\n describe:\n \"The directory representing a built zup's sources. Use to skip build and bundling.\",\n hidden: true,\n })\n .option(\"port\", {\n type: \"number\",\n describe: \"The port to run the zup server on\",\n default: 9000,\n })\n .option(\"binary-name\", {\n type: \"string\",\n describe: \"The name of the binary\",\n default: \"compiled-zup\",\n })\n .middleware([setBlocking, identify])\n .check(async (argv) => {\n if (argv[\"bundled-dir\"]) {\n // By pass the checks because the user already has a bundled-script\n return true;\n } else {\n return await new YargsChecker<typeof argv>(\n new ZuploProjectValidator()\n ).check(argv);\n }\n });\n },\n handler: async (argv: unknown) => {\n await captureEvent({ argv, event: \"zup compile\" });\n await compile(argv as Arguments);\n },\n};\n"]}
1
+ {"version":3,"file":"compile.js","sourceRoot":"","sources":["../../src/cmds/compile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AACvE,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAa,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAE3D,eAAe;IAEb,IAAI,EAAE,KAAK;IAEX,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,CAAC,KAAW,EAAiB,EAAE;QACtC,OAAO,KAAK;aACT,MAAM,CAAC,KAAK,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,mCAAmC;YAC7C,OAAO,EAAE,GAAG;YACZ,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,IAAI;SACb,CAAC;aACD,MAAM,CAAC,aAAa,EAAE;YACrB,IAAI,EAAE,QAAQ;YACd,QAAQ,EACN,mFAAmF;YACrF,MAAM,EAAE,IAAI;SACb,CAAC;aACD,MAAM,CAAC,MAAM,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,mCAAmC;YAC7C,OAAO,EAAE,IAAI;SACd,CAAC;aACD,MAAM,CAAC,aAAa,EAAE;YACrB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wBAAwB;YAClC,OAAO,EAAE,cAAc;SACxB,CAAC;aACD,MAAM,CAAC,UAAU,EAAE;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,sCAAsC;YAChD,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,IAAI;SACb,CAAC;aACD,UAAU,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;aACnC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACpB,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;gBAExB,OAAO,IAAI,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,OAAO,MAAM,IAAI,YAAY,CAC3B,IAAI,qBAAqB,EAAE,CAC5B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC;QACH,CAAC,CAAC,CAAC;IACP,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;QACnD,MAAM,OAAO,CAAC,IAAiB,CAAC,CAAC;IACnC,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, compile } from \"../compile/handler.js\";\n\nexport default {\n // For now, hide this command\n desc: false,\n // desc: \"Compiles a self-contained zup binary\",\n command: \"compile\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .option(\"dir\", {\n type: \"string\",\n describe: \"The directory containing your zup\",\n default: \".\",\n normalize: true,\n hidden: true,\n })\n .option(\"bundled-dir\", {\n type: \"string\",\n describe:\n \"The directory representing a built zup's sources. Use to skip build and bundling.\",\n hidden: true,\n })\n .option(\"port\", {\n type: \"number\",\n describe: \"The port to run the zup server on\",\n default: 9000,\n })\n .option(\"binary-name\", {\n type: \"string\",\n describe: \"The name of the binary\",\n default: \"compiled-zup\",\n })\n .option(\"build-id\", {\n type: \"string\",\n describe: \"The buildId to use for remote assets\",\n default: \"\",\n hidden: true,\n })\n .middleware([setBlocking, identify])\n .check(async (argv) => {\n if (argv[\"bundled-dir\"]) {\n // By pass the checks because the user already has a bundled-script\n return true;\n } else {\n return await new YargsChecker<typeof argv>(\n new ZuploProjectValidator()\n ).check(argv);\n }\n });\n },\n handler: async (argv: unknown) => {\n await captureEvent({ argv, event: \"zup compile\" });\n await compile(argv as Arguments);\n },\n};\n"]}
@@ -3,6 +3,7 @@ export interface Arguments {
3
3
  "bundled-dir": string;
4
4
  port: number;
5
5
  "binary-name": string;
6
+ "build-id": string;
6
7
  }
7
8
  export declare function compile(argv: Arguments): Promise<void>;
8
9
  //# sourceMappingURL=handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/compile/handler.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,SAAS,iBA8E5C"}
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/compile/handler.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,SAAS,iBA6E5C"}
@@ -2,7 +2,7 @@ import dotenv from "dotenv";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { cpSync, existsSync, readFileSync } from "node:fs";
4
4
  import { join, relative, resolve } from "node:path";
5
- import { fileURLToPath, pathToFileURL } from "node:url";
5
+ import { fileURLToPath } from "node:url";
6
6
  import { logger } from "../common/logger.js";
7
7
  import { ConsoleOutput, printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../common/output.js";
8
8
  import { handleRuntimeStdio } from "../common/worker-output.js";
@@ -22,13 +22,9 @@ export async function compile(argv) {
22
22
  const contents = readFileSync(envZuploFile);
23
23
  envZuplo = dotenv.parse(contents);
24
24
  }
25
- const config = {
26
- build_assets_url: pathToFileURL(sourceDirectory),
27
- };
28
- process.env.__ZUPLO_CONFIG = btoa(JSON.stringify(config));
29
25
  const core = await import("@zuplo/core/cli");
30
26
  const zupPort = argv.port;
31
- const buildId = randomUUID();
27
+ const buildId = argv["build-id"] || randomUUID();
32
28
  try {
33
29
  await core.compileWorkerdServer({
34
30
  buildId,
@@ -1 +1 @@
1
- {"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/compile/handler.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAA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,QAAQ,CAAC,CAAC;IACpC,CAAC;IAGD,MAAM,MAAM,GAAG;QACb,gBAAgB,EAAE,aAAa,CAAC,eAAe,CAAC;KACjD,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAG1D,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAE7C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;IAE1B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,oBAAoB,CAAC;YAC9B,OAAO;YACP,MAAM,EAAE,IAAI,aAAa,EAAE;YAC3B,eAAe;YACf,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC;YAC/B,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC;YAC/B,+BAA+B,EAAE,QAAQ;gBACvC,CAAC,CAAC;oBACE,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;oBAC/C,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;oBAC/C,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB;iBACxD;gBACH,CAAC;oBACC,SAAS;YACb,MAAM;YACN,kBAAkB;SACnB,CAAC,CAAC;QAEH,yBAAyB,CAAC,yCAAyC,CAAC,CAAC;QACrE,MAAM,qCAAqC,CACzC,8BAA8B,eAAe,SAAS,IAAI,CAAC,aAAa,CAAC,EAAE,CAC5E,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,yBAAyB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,oCAAoC,CACxC,kCAAkC,CACnC,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["/* eslint-disable node/no-process-env */\nimport dotenv from \"dotenv\";\nimport { randomUUID } from \"node:crypto\";\nimport { cpSync, existsSync, readFileSync } from \"node:fs\";\nimport { join, relative, resolve } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { logger } from \"../common/logger.js\";\nimport {\n ConsoleOutput,\n printCriticalFailureToConsoleAndExit,\n printDiagnosticsToConsole,\n printResultToConsoleAndExitGracefully,\n} from \"../common/output.js\";\nimport { handleRuntimeStdio } from \"../common/worker-output.js\";\n\nexport interface Arguments {\n dir: string;\n \"bundled-dir\": string;\n port: number;\n \"binary-name\": string;\n}\n\nexport async function compile(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 // Check if the user has a .env.zuplo file\n let envZuplo: dotenv.DotenvParseOutput = {};\n const envZuploFile = join(sourceDirectory, \".env.zuplo\");\n if (existsSync(envZuploFile)) {\n const contents = readFileSync(envZuploFile);\n envZuplo = dotenv.parse(contents);\n }\n\n // Set other variables using __ZUPLO_CONFIG\n const config = {\n build_assets_url: pathToFileURL(sourceDirectory),\n };\n process.env.__ZUPLO_CONFIG = btoa(JSON.stringify(config));\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\n const buildId = randomUUID();\n\n try {\n await core.compileWorkerdServer({\n buildId,\n output: new ConsoleOutput(),\n sourceDirectory,\n bundledDir: argv[\"bundled-dir\"],\n port: zupPort,\n binaryName: argv[\"binary-name\"],\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 });\n\n printDiagnosticsToConsole(\"📦 Compiled a self-contained zup binary\");\n await printResultToConsoleAndExitGracefully(\n `The binary is available at ${sourceDirectory}/dist/${argv[\"binary-name\"]}`\n );\n } catch (err) {\n printDiagnosticsToConsole(err.message);\n await printCriticalFailureToConsoleAndExit(\n \"Failed to compile the zup binary\"\n );\n }\n}\n"]}
1
+ {"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/compile/handler.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,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,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,aAAa,EACb,oCAAoC,EACpC,yBAAyB,EACzB,qCAAqC,GACtC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAUhE,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAe;IAC3C,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,C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B;oBAC/C,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;oBAC/C,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB;iBACxD;gBACH,CAAC;oBACC,SAAS;YACb,MAAM;YACN,kBAAkB;SACnB,CAAC,CAAC;QAEH,yBAAyB,CAAC,yCAAyC,CAAC,CAAC;QACrE,MAAM,qCAAqC,CACzC,8BAA8B,eAAe,SAAS,IAAI,CAAC,aAAa,CAAC,EAAE,CAC5E,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,yBAAyB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,oCAAoC,CACxC,kCAAkC,CACnC,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["/* eslint-disable node/no-process-env */\nimport dotenv from \"dotenv\";\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 { logger } from \"../common/logger.js\";\nimport {\n ConsoleOutput,\n printCriticalFailureToConsoleAndExit,\n printDiagnosticsToConsole,\n printResultToConsoleAndExitGracefully,\n} from \"../common/output.js\";\nimport { handleRuntimeStdio } from \"../common/worker-output.js\";\n\nexport interface Arguments {\n dir: string;\n \"bundled-dir\": string;\n port: number;\n \"binary-name\": string;\n \"build-id\": string;\n}\n\nexport async function compile(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 // Check if the user has a .env.zuplo file\n let envZuplo: dotenv.DotenvParseOutput = {};\n const envZuploFile = join(sourceDirectory, \".env.zuplo\");\n if (existsSync(envZuploFile)) {\n const contents = readFileSync(envZuploFile);\n envZuplo = dotenv.parse(contents);\n }\n // Set other variables using __ZUPLO_CONFIG as necessary\n // const config = {\n // build_asserts_url should point to something that is accessible outside the binary (it no longer has access to the file system)\n // build_assets_url: pathToFileURL(sourceDirectory),\n // };\n // process.env.__ZUPLO_CONFIG = btoa(JSON.stringify(config));\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\n const buildId = argv[\"build-id\"] || randomUUID();\n\n try {\n await core.compileWorkerdServer({\n buildId,\n output: new ConsoleOutput(),\n sourceDirectory,\n bundledDir: argv[\"bundled-dir\"],\n port: zupPort,\n binaryName: argv[\"binary-name\"],\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 });\n\n printDiagnosticsToConsole(\"📦 Compiled a self-contained zup binary\");\n await printResultToConsoleAndExitGracefully(\n `The binary is available at ${sourceDirectory}/dist/${argv[\"binary-name\"]}`\n );\n } catch (err) {\n printDiagnosticsToConsole(err.message);\n await printCriticalFailureToConsoleAndExit(\n \"Failed to compile the zup binary\"\n );\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "6.38.2",
3
+ "version": "6.38.9",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -29,8 +29,8 @@
29
29
  "@opentelemetry/api": "^1.8.0",
30
30
  "@sentry/node": "^8.50.0",
31
31
  "@swc/core": "1.7.22",
32
- "@zuplo/core": "^6.38.2",
33
- "@zuplo/runtime": "^6.38.2",
32
+ "@zuplo/core": "^6.38.9",
33
+ "@zuplo/runtime": "^6.38.9",
34
34
  "as-table": "^1.0.55",
35
35
  "chalk": "^5.3.0",
36
36
  "chokidar": "^3.5.3",