@mediamonks/canopy-cli 0.7.64 → 0.7.65

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.
@@ -30,6 +30,8 @@ async function bundleWorker(projectDir, entry) {
30
30
  platform: "neutral",
31
31
  format: "esm",
32
32
  target: "es2022",
33
+ mainFields: ["module", "main"],
34
+ conditions: ["workerd", "worker"],
33
35
  packages: "bundle",
34
36
  plugins: [nodeBuiltins, wasmModules(projectDir, wasm)],
35
37
  logLevel: "silent"
@@ -167,19 +169,11 @@ function wasmModules(projectDir, found) {
167
169
  return {
168
170
  name: "canopy-wasm-modules",
169
171
  setup(build) {
170
- build.onResolve({ filter: WASM_IMPORT }, async (args) => {
171
- if (args.pluginData === "canopy-wasm") return void 0;
172
- const resolved = await build.resolve(args.path.replace(/\?module$/, ""), {
173
- kind: args.kind,
174
- resolveDir: args.resolveDir,
175
- importer: args.importer,
176
- pluginData: "canopy-wasm"
177
- });
178
- if (resolved.errors.length > 0) return { errors: resolved.errors };
179
- const data = new Uint8Array(readFileSync(resolved.path));
172
+ const ship = (file) => {
173
+ const data = new Uint8Array(readFileSync(file));
180
174
  const name = `${createHash("sha256").update(data).digest("hex").slice(0, 16)}.wasm`;
181
175
  if (!found.has(name)) {
182
- const source = relative(realpathSync(projectDir), resolved.path);
176
+ const source = relative(realpathSync(projectDir), file);
183
177
  found.set(name, {
184
178
  name,
185
179
  source,
@@ -190,6 +184,24 @@ function wasmModules(projectDir, found) {
190
184
  path: `./wasm/${name}`,
191
185
  external: true
192
186
  };
187
+ };
188
+ const resolveOnce = (path, args) => build.resolve(path, {
189
+ kind: args.kind,
190
+ resolveDir: args.resolveDir,
191
+ importer: args.importer,
192
+ pluginData: "canopy-wasm"
193
+ });
194
+ build.onResolve({ filter: WASM_IMPORT }, async (args) => {
195
+ if (args.pluginData === "canopy-wasm") return void 0;
196
+ const resolved = await resolveOnce(args.path.replace(/\?module$/, ""), args);
197
+ if (resolved.errors.length > 0) return { errors: resolved.errors };
198
+ return ship(resolved.path);
199
+ });
200
+ build.onResolve({ filter: /^[^./]/ }, async (args) => {
201
+ if (args.pluginData === "canopy-wasm" || WASM_IMPORT.test(args.path)) return void 0;
202
+ const resolved = await resolveOnce(args.path, args);
203
+ if (resolved.errors.length > 0 || !resolved.path.endsWith(".wasm")) return void 0;
204
+ return ship(resolved.path);
193
205
  });
194
206
  }
195
207
  };
@@ -0,0 +1,2 @@
1
+ import { n as devCommand } from "./dev-PRvTQ7Cl.mjs";
2
+ export { devCommand };
@@ -107,7 +107,7 @@ async function workerPlugin(flags, slug, workerAttest, remoteUser, roles) {
107
107
  console.log(`note: canopy.json points "worker" at ${entry}, which does not exist — skipping.`);
108
108
  return;
109
109
  }
110
- const { missingSecretNames, readDevVars, workerDevPlugin } = await import("./dev-worker-Dqj7TnAk.mjs");
110
+ const { missingSecretNames, readDevVars, workerDevPlugin } = await import("./dev-worker-Bmea0X0L.mjs");
111
111
  const secrets = readDevVars(flags.dir);
112
112
  const email = siteConfig().email;
113
113
  const found = await remoteUser?.() ?? (email ? {
@@ -326,7 +326,7 @@ async function devRemote(flags, slug) {
326
326
  async function devLocal(flags, slug) {
327
327
  let dump;
328
328
  if (flags.pull) {
329
- const { fetchProjectDump } = await import("./local-BJ1RM1Wb.mjs");
329
+ const { fetchProjectDump } = await import("./local-dg7vpGYM.mjs");
330
330
  console.log(`Pulling a fresh export of ${slug}${flags.staging ? " [staging]" : ""}…`);
331
331
  dump = await fetchProjectDump(slug, flags.staging ? "staging" : "live");
332
332
  }
@@ -343,7 +343,7 @@ async function devLocal(flags, slug) {
343
343
  }
344
344
  const workerAttest = randomBytes(24).toString("base64url");
345
345
  const devRoles = await resolveDevRoles(slug, flags.asRoles);
346
- const { createSandbox } = await import("./local-BJ1RM1Wb.mjs");
346
+ const { createSandbox } = await import("./local-dg7vpGYM.mjs");
347
347
  const sandbox = await createSandbox({
348
348
  slug,
349
349
  persistDir: join(flags.dir, ".canopy", "local"),
@@ -320,12 +320,15 @@ function workerDevPlugin(options) {
320
320
  name: "canopy-project-worker",
321
321
  enforce: "pre",
322
322
  async resolveId(source, importer, opts) {
323
- if (!WASM_IMPORT.test(source) || !isServerGraph(this, opts)) return null;
323
+ const wasmImport = WASM_IMPORT.test(source);
324
+ if (!wasmImport && (/^[./]/.test(source) || source.startsWith("\0"))) return null;
325
+ if (!isServerGraph(this, opts)) return null;
324
326
  const resolved = await this.resolve(source.replace(/\?module$/, ""), importer, {
325
327
  ...opts,
326
328
  skipSelf: true
327
329
  });
328
- return resolved ? `${WASM_MODULE_PREFIX}${resolved.id}` : null;
330
+ if (!resolved || !wasmImport && !resolved.id.endsWith(".wasm")) return null;
331
+ return `${WASM_MODULE_PREFIX}${resolved.id}`;
329
332
  },
330
333
  load(id) {
331
334
  if (!id.startsWith(WASM_MODULE_PREFIX)) return null;
@@ -1,4 +1,4 @@
1
- import { t as version } from "./package-B5JwwJRq.mjs";
1
+ import { t as version } from "./package-DI8sTmYn.mjs";
2
2
  import { r as siteConfig } from "./site-Bz-fEyKS.mjs";
3
3
  import { i as latestKnownVersion, r as compareSemver } from "./version-check-CcsA1QjI.mjs";
4
4
  import { n as agentHeaders } from "./api-C2cvuMD1.mjs";
@@ -1,4 +1,4 @@
1
- import { t as version } from "./package-B5JwwJRq.mjs";
1
+ import { t as version } from "./package-DI8sTmYn.mjs";
2
2
  import { f as resolveProject, g as tryResolveProject, h as tryReadCanopyJson, l as projectDirArgs, r as siteConfig } from "./site-Bz-fEyKS.mjs";
3
3
  import { a as apiRequest, c as credentials, i as apiDownload, o as apiUpload, s as commonHeaders } from "./api-C2cvuMD1.mjs";
4
4
  import { i as reportErrors, n as formatDateTime } from "./ui-CVzXhfWN.mjs";
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as version } from "./package-B5JwwJRq.mjs";
2
+ import { t as version } from "./package-DI8sTmYn.mjs";
3
3
  import { i as siteHeaderLine, n as setInvocationProfile } from "./site-Bz-fEyKS.mjs";
4
4
  import { a as notifyOfUpdate, o as runRefresh } from "./version-check-CcsA1QjI.mjs";
5
5
  import { defineCommand, runMain } from "citty";
@@ -59,12 +59,12 @@ const main = defineCommand({
59
59
  projects: () => import("./projects-B3ycJGaX.mjs").then((m) => m.projectsCommand),
60
60
  delete: () => import("./projects-B3ycJGaX.mjs").then((m) => m.deleteCommand),
61
61
  rename: () => import("./rename-BY2_4F4b.mjs").then((m) => m.renameCommand),
62
- dev: () => import("./dev-CtXO9PIL.mjs").then((m) => m.devCommand),
63
- deploy: () => import("./deploy-DOe7vPjH.mjs").then((m) => m.deployCommand),
64
- promote: () => import("./deploy-DOe7vPjH.mjs").then((m) => m.promoteCommand),
62
+ dev: () => import("./dev-Bv14Oar6.mjs").then((m) => m.devCommand),
63
+ deploy: () => import("./deploy-Bzr6p0nl.mjs").then((m) => m.deployCommand),
64
+ promote: () => import("./deploy-Bzr6p0nl.mjs").then((m) => m.promoteCommand),
65
65
  staging: () => import("./staging-CSv8OWNT.mjs").then((m) => m.stagingCommand),
66
- rollback: () => import("./deploy-DOe7vPjH.mjs").then((m) => m.rollbackCommand),
67
- download: () => import("./deploy-DOe7vPjH.mjs").then((m) => m.downloadCommand),
66
+ rollback: () => import("./deploy-Bzr6p0nl.mjs").then((m) => m.rollbackCommand),
67
+ download: () => import("./deploy-Bzr6p0nl.mjs").then((m) => m.downloadCommand),
68
68
  versions: () => import("./versions-DKVNY2Zo.mjs").then((m) => m.versionsCommand),
69
69
  token: () => import("./token-DakMHZEr.mjs").then((m) => m.tokenCommand),
70
70
  egress: () => import("./egress-bVy6U5ho.mjs").then((m) => m.egressCommand),
@@ -74,18 +74,18 @@ const main = defineCommand({
74
74
  roles: () => import("./roles-wEgE5ICf.mjs").then((m) => m.rolesCommand),
75
75
  members: () => import("./roles-wEgE5ICf.mjs").then((m) => m.membersCommand),
76
76
  schedule: () => import("./schedule-D6tTBal3.mjs").then((m) => m.scheduleCommand),
77
- feedback: () => import("./feedback-eIZOXXg1.mjs").then((m) => m.feedbackCommand),
77
+ feedback: () => import("./feedback-m49QTrTe.mjs").then((m) => m.feedbackCommand),
78
78
  db: () => import("./db-BKo39uJt.mjs").then((m) => m.dbCommand),
79
79
  files: () => import("./files-DVFs1rmn.mjs").then((m) => m.filesCommand),
80
80
  usage: () => import("./usage-DcDBqrLf.mjs").then((m) => m.usageCommand),
81
81
  ai: () => import("./ai-CGYbKeZq.mjs").then((m) => m.aiCommand),
82
82
  open: () => import("./open-B2fimu3z.mjs").then((m) => m.openCommand),
83
83
  browse: () => import("./browse-CAidI-BT.mjs").then((m) => m.browseCommand),
84
- docs: () => import("./docs-Cpk-qZkk.mjs").then((m) => m.docsCommand),
85
- skill: () => import("./skill-Dv8e09Xl.mjs").then((m) => m.skillCommand),
86
- upgrade: () => import("./upgrade-CryZqevW.mjs").then((m) => m.upgradeCommand),
84
+ docs: () => import("./docs-_Bb03nNw.mjs").then((m) => m.docsCommand),
85
+ skill: () => import("./skill-D50OjY5d.mjs").then((m) => m.skillCommand),
86
+ upgrade: () => import("./upgrade-DWQ4ouir.mjs").then((m) => m.upgradeCommand),
87
87
  logs: () => import("./logs-DTXFm5DB.mjs").then((m) => m.logsCommand),
88
- mcp: () => import("./mcp-BOzF_oAR.mjs").then((m) => m.mcpCommand),
88
+ mcp: () => import("./mcp-CC6yUXD0.mjs").then((m) => m.mcpCommand),
89
89
  repo: () => import("./repo-xl6Rb6BC.mjs").then((m) => m.repoCommand),
90
90
  template: () => import("./project-template-Ckh8JDkS.mjs").then((m) => m.templateCommand),
91
91
  audience: () => import("./audience-BspIO-MA.mjs").then((m) => m.audienceCommand),
@@ -1,6 +1,6 @@
1
1
  import { c as dbRouter, h as isCreateOnly, l as hasPrivateNames, m as blobRouter, p as STREAMED_BLOB_BYTES, s as realtimeRouter, t as WORKER_ATTEST_HEADER, u as META_COLUMNS } from "./src-Dlg7aeRj.mjs";
2
2
  import { r as apiDataRequest } from "./api-C2cvuMD1.mjs";
3
- import { a as rewriteApiPath } from "./dev-CT2_x96K.mjs";
3
+ import { a as rewriteApiPath } from "./dev-PRvTQ7Cl.mjs";
4
4
  import { createRequire } from "node:module";
5
5
  import { createWriteStream, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
6
6
  import { dirname, join, relative, sep } from "node:path";
@@ -1,4 +1,4 @@
1
- import { t as version } from "./package-B5JwwJRq.mjs";
1
+ import { t as version } from "./package-DI8sTmYn.mjs";
2
2
  import { d as projectUrl, g as tryResolveProject, m as stagingUrl, r as siteConfig } from "./site-Bz-fEyKS.mjs";
3
3
  import { a as apiRequest, f as noticeRenamesOnly, l as currentSlug, t as ApiError } from "./api-C2cvuMD1.mjs";
4
4
  import { t as liveDevServer } from "./dev-server-file-Dk9pk4AR.mjs";
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.7.64";
2
+ var version = "0.7.65";
3
3
  //#endregion
4
4
  export { version as t };
@@ -1,4 +1,4 @@
1
- import { t as version } from "./package-B5JwwJRq.mjs";
1
+ import { t as version } from "./package-DI8sTmYn.mjs";
2
2
  import { i as reportErrors } from "./ui-CVzXhfWN.mjs";
3
3
  import { defineCommand } from "citty";
4
4
  import { cpSync, existsSync, mkdirSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
@@ -112,7 +112,7 @@ const upgradeCommand = defineCommand({
112
112
  const spec = `${PACKAGE_NAME}@${args.version ?? "latest"}`;
113
113
  const command = pmCommand(pm);
114
114
  const cmd = installArgs(pm, spec);
115
- const { skillInstalled } = await import("./skill-Dv8e09Xl.mjs");
115
+ const { skillInstalled } = await import("./skill-D50OjY5d.mjs");
116
116
  const { homedir } = await import("node:os");
117
117
  const refreshGlobal = skillInstalled(homedir());
118
118
  const refreshRepo = process.cwd() !== homedir() && skillInstalled(process.cwd());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediamonks/canopy-cli",
3
- "version": "0.7.64",
3
+ "version": "0.7.65",
4
4
  "description": "Canopy CLI — create, develop and deploy Canopy projects.",
5
5
  "bin": {
6
6
  "canopy": "./dist/index.mjs"
@@ -22,8 +22,8 @@
22
22
  "esbuild": "^0.28.1",
23
23
  "hono": "^4.8.0",
24
24
  "vite-server": "npm:vite@^7",
25
- "@mediamonks/canopy-data-plane": "0.0.4",
26
- "@mediamonks/canopy": "0.0.20"
25
+ "@mediamonks/canopy": "0.0.20",
26
+ "@mediamonks/canopy-data-plane": "0.0.4"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "^24",
@@ -1,2 +0,0 @@
1
- import { n as devCommand } from "./dev-CT2_x96K.mjs";
2
- export { devCommand };