@zuplo/cli 1.113.0 → 1.114.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.
package/dist/cli.js CHANGED
@@ -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]="59466167-0404-586c-a0b1-a43e10b758a7")}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]="b7b80df4-c767-5f13-8cfb-0f1e1b3f3d4f")}catch(e){}}();
3
3
  import * as dotenv from "dotenv";
4
4
  dotenv.config();
5
5
  import * as Sentry from "@sentry/node";
@@ -8,6 +8,7 @@ import { fileURLToPath } from "node:url";
8
8
  import { gte } from "semver";
9
9
  import { hideBin } from "yargs/helpers";
10
10
  import yargs from "yargs/yargs";
11
+ import compile from "./cmds/compile.js";
11
12
  import convert from "./cmds/convert.js";
12
13
  import deleteZup from "./cmds/delete.js";
13
14
  import deploy from "./cmds/deploy.js";
@@ -41,6 +42,7 @@ if (gte(process.versions.node, MIN_NODE_VERSION)) {
41
42
  });
42
43
  const cli = yargs(hideBin(process.argv))
43
44
  .env("ZUPLO")
45
+ .command(compile)
44
46
  .command(convert)
45
47
  .command(deleteZup)
46
48
  .command(deploy)
@@ -82,4 +84,4 @@ else {
82
84
  Consider using a Node.js version manager such as https://github.com/nvm-sh/nvm.`);
83
85
  }
84
86
  //# sourceMappingURL=cli.js.map
85
- //# debugId=59466167-0404-586c-a0b1-a43e10b758a7
87
+ //# debugId=b7b80df4-c767-5f13-8cfb-0f1e1b3f3d4f
@@ -0,0 +1,42 @@
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]="8fe11cc3-3789-5833-a7f5-87287360c988")}catch(e){}}();
3
+ import { captureEvent } from "../common/analytics/lib.js";
4
+ import { identify } from "../common/middleware/user-identification.js";
5
+ import setBlocking from "../common/output.js";
6
+ import { ZuploProjectValidator } from "../common/validators/file-system-validator.js";
7
+ import { YargsChecker } from "../common/validators/lib.js";
8
+ import { compile } from "../compile/handler.js";
9
+ export default {
10
+ desc: false,
11
+ command: "compile",
12
+ builder: (yargs) => {
13
+ return yargs
14
+ .option("dir", {
15
+ type: "string",
16
+ describe: "The directory containing your zup",
17
+ default: ".",
18
+ normalize: true,
19
+ hidden: true,
20
+ })
21
+ .option("port", {
22
+ type: "number",
23
+ describe: "The port to run the zup server on",
24
+ default: 9000,
25
+ })
26
+ .option("binary-name", {
27
+ type: "string",
28
+ describe: "The name of the binary",
29
+ default: "compiled-zup",
30
+ })
31
+ .middleware([setBlocking, identify])
32
+ .check(async (argv) => {
33
+ return await new YargsChecker(new ZuploProjectValidator()).check(argv);
34
+ });
35
+ },
36
+ handler: async (argv) => {
37
+ await captureEvent({ argv, event: "zup compile" });
38
+ await compile(argv);
39
+ },
40
+ };
41
+ //# sourceMappingURL=compile.js.map
42
+ //# debugId=8fe11cc3-3789-5833-a7f5-87287360c988
@@ -0,0 +1,42 @@
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]="e900a4a1-10a3-56de-9a5a-905c90d64f03")}catch(e){}}();
3
+ import { cpSync, existsSync } from "node:fs";
4
+ import { join, relative, resolve } from "node:path";
5
+ import { fileURLToPath, pathToFileURL } from "node:url";
6
+ import { printDiagnosticsToConsole } from "../common/output.js";
7
+ export async function compile(argv) {
8
+ const sourceDirectory = resolve(join(relative(process.cwd(), argv.dir)));
9
+ const zuploRuntimePath = new URL("../../node_modules/@zuplo/runtime", import.meta.url);
10
+ if (existsSync(zuploRuntimePath)) {
11
+ cpSync(zuploRuntimePath, join(sourceDirectory, "node_modules/@zuplo/runtime"), {
12
+ recursive: true,
13
+ dereference: true,
14
+ });
15
+ }
16
+ process.env.GLOBAL_MODULE_LOCATION = fileURLToPath(new URL("../../node_modules", import.meta.url));
17
+ const loadedEnvFiles = [];
18
+ const envFile = join(sourceDirectory, ".env");
19
+ if (existsSync(envFile)) {
20
+ loadedEnvFiles.push(".env");
21
+ }
22
+ const envZuploFile = join(sourceDirectory, ".env.zuplo");
23
+ if (existsSync(envZuploFile)) {
24
+ loadedEnvFiles.push(".env.zuplo");
25
+ }
26
+ const config = {
27
+ build_assets_url: pathToFileURL(sourceDirectory),
28
+ };
29
+ process.env.__ZUPLO_CONFIG = btoa(JSON.stringify(config));
30
+ const core = await import("@zuplo/core");
31
+ const zupPort = argv.port;
32
+ await core.default.compileWorkerdServer({
33
+ sourceDirectory,
34
+ port: zupPort,
35
+ binaryName: argv["binary-name"],
36
+ generateSourceMaps: true,
37
+ });
38
+ printDiagnosticsToConsole("📦 Compiled a self-contained zup binary");
39
+ printDiagnosticsToConsole(`The binary is available at ${sourceDirectory}/dist/${argv["binary-name"]}`);
40
+ }
41
+ //# sourceMappingURL=handler.js.map
42
+ //# debugId=e900a4a1-10a3-56de-9a5a-905c90d64f03
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "1.113.0",
3
+ "version": "1.114.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.2076.0",
67
+ "@zuplo/core": "5.2150.0",
68
68
  "@zuplo/deno-bin": "1.37.1",
69
69
  "@zuplo/pino-pretty-configurations": "^1.5.0",
70
- "@zuplo/runtime": "5.2076.0",
70
+ "@zuplo/runtime": "5.2150.0",
71
71
  "chalk": "^5.1.2",
72
72
  "chokidar": "^3.5.3",
73
73
  "dotenv": "^16.3.1",
@@ -95,7 +95,7 @@
95
95
  "tar": "^6.1.13",
96
96
  "temp": "^0.9.4",
97
97
  "uuid": "^9.0.1",
98
- "workerd": "1.20240405.0",
98
+ "workerd": "^1.20240502.0",
99
99
  "yargs": "^17.7.1"
100
100
  }
101
101
  }