@zuplo/cli 6.10.1 → 6.12.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 +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;oBA0Bf,OAAO;;AA/B/B,wBAmCE"}
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"}
@@ -15,6 +15,11 @@ export default {
15
15
  default: ".",
16
16
  normalize: true,
17
17
  hidden: true,
18
+ })
19
+ .option("bundled-script", {
20
+ type: "string",
21
+ describe: "The .js file representing a built zup. Use to skip build and bundling.",
22
+ hidden: true,
18
23
  })
19
24
  .option("port", {
20
25
  type: "number",
@@ -28,7 +33,12 @@ export default {
28
33
  })
29
34
  .middleware([setBlocking, identify])
30
35
  .check(async (argv) => {
31
- return await new YargsChecker(new ZuploProjectValidator()).check(argv);
36
+ if (argv["bundled-script"]) {
37
+ return true;
38
+ }
39
+ else {
40
+ return await new YargsChecker(new ZuploProjectValidator()).check(argv);
41
+ }
32
42
  });
33
43
  },
34
44
  handler: 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,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,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,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(\"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 return await new YargsChecker<typeof argv>(\n new ZuploProjectValidator()\n ).check(argv);\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,gBAAgB,EAAE;YACxB,IAAI,EAAE,QAAQ;YACd,QAAQ,EACN,wEAAwE;YAC1E,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,gBAAgB,CAAC,EAAE,CAAC;gBAE3B,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-script\", {\n type: \"string\",\n describe:\n \"The .js file representing a built zup. 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-script\"]) {\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,5 +1,6 @@
1
1
  export interface Arguments {
2
2
  dir: string;
3
+ "bundled-script": string;
3
4
  port: number;
4
5
  "binary-name": string;
5
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/compile/handler.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,SAAS,iBAiE5C"}
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/compile/handler.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,SAAS,iBAkE5C"}
@@ -28,6 +28,7 @@ export async function compile(argv) {
28
28
  const zupPort = argv.port;
29
29
  await core.compileWorkerdServer({
30
30
  sourceDirectory,
31
+ bundledScript: argv["bundled-script"],
31
32
  port: zupPort,
32
33
  binaryName: argv["binary-name"],
33
34
  publicZuploEnvironmentVariables: envZuplo
@@ -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,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,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ7C,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,CAAC;IAMzE,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAC9B,mCAAmC,EACnC,MAAM,CAAC,IAAI,CAAC,GAAG,CAChB,CAAC;IACF,IAAI,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACjC,MAAM,CACJ,gBAAgB,EAChB,IAAI,CAAC,eAAe,EAAE,6BAA6B,CAAC,EACpD;YACE,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,IAAI;SAClB,CACF,CAAC;IACJ,CAAC;IAGD,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,aAAa,CAChD,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAC/C,CAAC;IAGF,IAAI,QAAQ,GAA6B,EAAE,CAAC;IAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;IACzD,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;QAC5C,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,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,IAAI,CAAC,oBAAoB,CAAC;QAC9B,eAAe;QACf,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC;QAC/B,+BAA+B,EAAE,QAAQ;YACvC,CAAC,CAAC;gBACE,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;gBAC/C,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;gBAC/C,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB;aACxD;YACH,CAAC;gBACC,SAAS;QACb,MAAM;KACP,CAAC,CAAC;IAEH,yBAAyB,CAAC,yCAAyC,CAAC,CAAC;IACrE,yBAAyB,CACvB,8BAA8B,eAAe,SAAS,IAAI,CAAC,aAAa,CAAC,EAAE,CAC5E,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable node/no-process-env */\nimport dotenv from \"dotenv\";\nimport { cpSync, existsSync, readFileSync } from \"node:fs\";\nimport { join, relative, resolve } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { printDiagnosticsToConsole } from \"../common/output.js\";\nimport { logger } from \"../common/logger.js\";\n\nexport interface Arguments {\n 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 await core.compileWorkerdServer({\n sourceDirectory,\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 });\n\n printDiagnosticsToConsole(\"📦 Compiled a self-contained zup binary\");\n printDiagnosticsToConsole(\n `The binary is available at ${sourceDirectory}/dist/${argv[\"binary-name\"]}`\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,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,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAS7C,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,CAAC;IAMzE,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAC9B,mCAAmC,EACnC,MAAM,CAAC,IAAI,CAAC,GAAG,CAChB,CAAC;IACF,IAAI,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACjC,MAAM,CACJ,gBAAgB,EAChB,IAAI,CAAC,eAAe,EAAE,6BAA6B,CAAC,EACpD;YACE,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,IAAI;SAClB,CACF,CAAC;IACJ,CAAC;IAGD,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,aAAa,CAChD,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAC/C,CAAC;IAGF,IAAI,QAAQ,GAA6B,EAAE,CAAC;IAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;IACzD,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;QAC5C,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,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,IAAI,CAAC,oBAAoB,CAAC;QAC9B,eAAe;QACf,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC;QACrC,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC;QAC/B,+BAA+B,EAAE,QAAQ;YACvC,CAAC,CAAC;gBACE,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;gBAC/C,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;gBAC/C,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB;aACxD;YACH,CAAC;gBACC,SAAS;QACb,MAAM;KACP,CAAC,CAAC;IAEH,yBAAyB,CAAC,yCAAyC,CAAC,CAAC;IACrE,yBAAyB,CACvB,8BAA8B,eAAe,SAAS,IAAI,CAAC,aAAa,CAAC,EAAE,CAC5E,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable node/no-process-env */\nimport dotenv from \"dotenv\";\nimport { cpSync, existsSync, readFileSync } from \"node:fs\";\nimport { join, relative, resolve } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { printDiagnosticsToConsole } from \"../common/output.js\";\nimport { logger } from \"../common/logger.js\";\n\nexport interface Arguments {\n dir: string;\n \"bundled-script\": 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 await core.compileWorkerdServer({\n sourceDirectory,\n bundledScript: argv[\"bundled-script\"],\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 });\n\n printDiagnosticsToConsole(\"📦 Compiled a self-contained zup binary\");\n printDiagnosticsToConsole(\n `The binary is available at ${sourceDirectory}/dist/${argv[\"binary-name\"]}`\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "6.10.1",
3
+ "version": "6.12.0",
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.8.0",
30
30
  "@sentry/node": "^7.119.2",
31
31
  "@swc/core": "1.7.6",
32
- "@zuplo/core": "^6.10.1",
32
+ "@zuplo/core": "^6.12.0",
33
33
  "@zuplo/pino-pretty-configurations": "^1.5.0",
34
- "@zuplo/runtime": "^6.10.1",
34
+ "@zuplo/runtime": "^6.12.0",
35
35
  "chalk": "^5.3.0",
36
36
  "chokidar": "^3.5.3",
37
37
  "dotenv": "^16.4.5",