@mediamonks/canopy-cli 0.4.3 → 0.4.4
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/dev-R6nzDtA-.mjs +2 -0
- package/dist/{dev-CGiJJ5mj.mjs → dev-pPVCUaFp.mjs} +28 -13
- package/dist/index.mjs +4 -4
- package/dist/{local-DSGE-qxT.mjs → local-MLfuFVZb.mjs} +1 -1
- package/dist/{package-M9p3aYWG.mjs → package-BHlmIdUm.mjs} +1 -1
- package/dist/{skill-BYuy0tS3.mjs → skill-BsZKAgGI.mjs} +1 -1
- package/dist/{upgrade-fRFEV1GC.mjs → upgrade-nYLjXxPk.mjs} +1 -1
- package/package.json +1 -1
- package/dist/dev-fNEcOnTg.mjs +0 -2
|
@@ -22,7 +22,7 @@ function rewriteApiPath(path, slug) {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Load Vite's `createServer`, preferring the Vite installed in the *project*
|
|
25
|
-
* over the copy bundled with the CLI.
|
|
25
|
+
* over the copy bundled with the CLI. `bundled` reports which one we got.
|
|
26
26
|
*
|
|
27
27
|
* Why the project's own Vite: the dev server and the project's
|
|
28
28
|
* vite.config/plugins must run on ONE Vite instance. When they don't — e.g. the
|
|
@@ -38,21 +38,36 @@ function rewriteApiPath(path, slug) {
|
|
|
38
38
|
*/
|
|
39
39
|
async function loadCreateServer(dir) {
|
|
40
40
|
try {
|
|
41
|
-
return
|
|
41
|
+
return {
|
|
42
|
+
createServer: (await import(pathToFileURL(createRequire(join(dir, "package.json")).resolve("vite")).href)).createServer,
|
|
43
|
+
bundled: false
|
|
44
|
+
};
|
|
42
45
|
} catch {
|
|
43
|
-
return
|
|
46
|
+
return {
|
|
47
|
+
createServer: (await import("vite-server")).createServer,
|
|
48
|
+
bundled: true
|
|
49
|
+
};
|
|
44
50
|
}
|
|
45
51
|
}
|
|
46
52
|
async function startVite(flags, serverOverrides) {
|
|
47
|
-
const
|
|
53
|
+
const { createServer, bundled } = await loadCreateServer(flags.dir);
|
|
54
|
+
const plugins = [{
|
|
55
|
+
name: "canopy-platform-api-external",
|
|
56
|
+
resolveId: (id) => id.startsWith("/_api/") ? {
|
|
57
|
+
id,
|
|
58
|
+
external: true
|
|
59
|
+
} : void 0
|
|
60
|
+
}];
|
|
61
|
+
if (bundled) plugins.push({
|
|
62
|
+
name: "canopy-no-build-static",
|
|
63
|
+
transformIndexHtml: {
|
|
64
|
+
order: "post",
|
|
65
|
+
handler: (html) => html.replace(/\s*<script type="module" src="\/@vite\/client"><\/script>/g, "")
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const server = await createServer({
|
|
48
69
|
root: flags.dir,
|
|
49
|
-
plugins
|
|
50
|
-
name: "canopy-platform-api-external",
|
|
51
|
-
resolveId: (id) => id.startsWith("/_api/") ? {
|
|
52
|
-
id,
|
|
53
|
-
external: true
|
|
54
|
-
} : void 0
|
|
55
|
-
}],
|
|
70
|
+
plugins,
|
|
56
71
|
server: {
|
|
57
72
|
port: flags.port,
|
|
58
73
|
...serverOverrides
|
|
@@ -79,7 +94,7 @@ async function devRemote(flags, slug) {
|
|
|
79
94
|
async function devLocal(flags, slug) {
|
|
80
95
|
let dump;
|
|
81
96
|
if (flags.pull) {
|
|
82
|
-
const { fetchProjectDump } = await import("./local-
|
|
97
|
+
const { fetchProjectDump } = await import("./local-MLfuFVZb.mjs");
|
|
83
98
|
console.log(`Pulling a fresh export of ${slug}…`);
|
|
84
99
|
dump = await fetchProjectDump(slug);
|
|
85
100
|
}
|
|
@@ -93,7 +108,7 @@ async function devLocal(flags, slug) {
|
|
|
93
108
|
} catch (err) {
|
|
94
109
|
console.log(`Note: ai/services will be unavailable — could not reach the platform (${err instanceof Error ? err.message : String(err)}).`);
|
|
95
110
|
}
|
|
96
|
-
const { createSandbox } = await import("./local-
|
|
111
|
+
const { createSandbox } = await import("./local-MLfuFVZb.mjs");
|
|
97
112
|
const sandbox = await createSandbox({
|
|
98
113
|
slug,
|
|
99
114
|
persistDir: join(flags.dir, ".canopy", "local"),
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as version } from "./package-
|
|
2
|
+
import { t as version } from "./package-BHlmIdUm.mjs";
|
|
3
3
|
import { i as runRefresh, r as notifyOfUpdate } from "./version-check-CoWgQs2h.mjs";
|
|
4
4
|
import { defineCommand, runMain } from "citty";
|
|
5
5
|
//#region src/index.ts
|
|
@@ -48,7 +48,7 @@ const main = defineCommand({
|
|
|
48
48
|
init: () => import("./projects-oyjC4ZGb.mjs").then((m) => m.initCommand),
|
|
49
49
|
projects: () => import("./projects-oyjC4ZGb.mjs").then((m) => m.projectsCommand),
|
|
50
50
|
delete: () => import("./projects-oyjC4ZGb.mjs").then((m) => m.deleteCommand),
|
|
51
|
-
dev: () => import("./dev-
|
|
51
|
+
dev: () => import("./dev-R6nzDtA-.mjs").then((m) => m.devCommand),
|
|
52
52
|
deploy: () => import("./deploy-BO_-gK32.mjs").then((m) => m.deployCommand),
|
|
53
53
|
rollback: () => import("./deploy-BO_-gK32.mjs").then((m) => m.rollbackCommand),
|
|
54
54
|
download: () => import("./deploy-BO_-gK32.mjs").then((m) => m.downloadCommand),
|
|
@@ -56,8 +56,8 @@ const main = defineCommand({
|
|
|
56
56
|
db: () => import("./db-Bkq-_qkd.mjs").then((m) => m.dbCommand),
|
|
57
57
|
open: () => import("./open-xLiGUz_W.mjs").then((m) => m.openCommand),
|
|
58
58
|
docs: () => import("./docs-C3aOAx_A.mjs").then((m) => m.docsCommand),
|
|
59
|
-
skill: () => import("./skill-
|
|
60
|
-
upgrade: () => import("./upgrade-
|
|
59
|
+
skill: () => import("./skill-BsZKAgGI.mjs").then((m) => m.skillCommand),
|
|
60
|
+
upgrade: () => import("./upgrade-nYLjXxPk.mjs").then((m) => m.upgradeCommand),
|
|
61
61
|
logs: planned("logs", "Tail worker logs", "2")
|
|
62
62
|
}
|
|
63
63
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as apiRequest } from "./api-BcX_w6Xf.mjs";
|
|
2
|
-
import { n as rewriteApiPath } from "./dev-
|
|
2
|
+
import { n as rewriteApiPath } from "./dev-pPVCUaFp.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as version } from "./package-
|
|
1
|
+
import { t as version } from "./package-BHlmIdUm.mjs";
|
|
2
2
|
import { n as reportErrors } from "./ui-C8VuPzGp.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-
|
|
115
|
+
const { skillInstalled } = await import("./skill-BsZKAgGI.mjs");
|
|
116
116
|
const refreshSkill = skillInstalled(process.cwd());
|
|
117
117
|
console.log(`Upgrading via ${command}: ${command} ${cmd.join(" ")}`);
|
|
118
118
|
await run(command, cmd);
|
package/package.json
CHANGED
package/dist/dev-fNEcOnTg.mjs
DELETED