deplhoy 0.4.0 → 0.4.1
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/core.js +1 -1
- package/dist/mcp.js +2 -1
- package/dist/setup.js +9 -3
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -5,7 +5,7 @@ import { collectFiles, defaultName, detectBuildDir, formatBytes, MAX_VERSION_BYT
|
|
|
5
5
|
import { DEFAULT_API, readAccount, readProject, readProjects, writeProject } from './config.js';
|
|
6
6
|
import { gitInfo } from './git.js';
|
|
7
7
|
import { scanFiles } from './secrets.js';
|
|
8
|
-
export const VERSION = '0.4.
|
|
8
|
+
export const VERSION = '0.4.1';
|
|
9
9
|
export const BEHAVIOR_MAX_BYTES = 4 * 1024; // same limit as the API
|
|
10
10
|
export class CliError extends Error {
|
|
11
11
|
code;
|
package/dist/mcp.js
CHANGED
|
@@ -18,7 +18,8 @@ const TOOLS = [
|
|
|
18
18
|
'Publishes a static build (a folder with index.html: dist, build or out by default) and returns its URL; every call is a new immutable version. ' +
|
|
19
19
|
'First build the project as static files, then write .deplhoy/sitemap.json (every page, and the links between them with the text of the control) and .deplhoy/behavior.md ' +
|
|
20
20
|
'(what it does, states, edge cases, fake data, open questions; at most 4 KB), or pass them as arguments: reviewers get the flow and developers the handoff. ' +
|
|
21
|
-
'
|
|
21
|
+
'A project with a backend of its own is not a reason to stop: build a static version that fakes the API in the browser (example data in localStorage, behind a build flag) and say so in behavior.md. ' +
|
|
22
|
+
'Otherwise do not change the prototype to publish it. Needs network access. The server instructions have the details.',
|
|
22
23
|
inputSchema: {
|
|
23
24
|
type: 'object',
|
|
24
25
|
properties: {
|
package/dist/setup.js
CHANGED
|
@@ -13,7 +13,13 @@ export const GUIDE = `## Publishing prototypes with deplhoy
|
|
|
13
13
|
|
|
14
14
|
When the person asks to publish, share or "deplhoy" this prototype:
|
|
15
15
|
|
|
16
|
-
1. **Build it as static files** (\`npm run build\` or the project's equivalent). deplhoy serves HTML, CSS and JS only: no server code, no API routes, no secrets in the build.
|
|
16
|
+
1. **Build it as static files** (\`npm run build\` or the project's equivalent). deplhoy serves HTML, CSS and JS only: no server code, no API routes, no secrets in the build.
|
|
17
|
+
- **If the prototype has a backend of its own** (a Node/Express/Next API, a database, realtime sync), don't give up: publish a static version that fakes it in the browser. People review the screens and the flow, not the server.
|
|
18
|
+
- Put the fake behind the code that calls the API (its client, fetch wrapper or store): seed it with realistic example data and keep changes in \`localStorage\`, so creating, editing and deleting still work and survive a reload. Keep the real path intact: a build flag (e.g. \`VITE_DEPLHOY=1\`) or a branch, never by deleting the backend code.
|
|
19
|
+
- Server rendering or server actions: export the pages statically and move what they fetched into the same fake.
|
|
20
|
+
- Keys for paid services (an AI model, payments, email): never put them in the build. Use canned example responses instead.
|
|
21
|
+
- Write in behavior.md what is faked and what that means for reviewers (e.g. "each reviewer sees their own data; there is no live sync"), and tell the person in your reply.
|
|
22
|
+
- Stop and ask only if faking would defeat the point of the review (e.g. the prototype is about a real integration's live results).
|
|
17
23
|
- Next.js: set \`output: 'export'\` and \`images: { unoptimized: true }\` in next.config. Dynamic routes whose ids only exist in the browser become a query string (\`/cards?id=…\` instead of \`/cards/[id]\`). Make these changes on a branch and say so.
|
|
18
24
|
- Vite, React, Vue, Svelte, plain HTML: build as usual.
|
|
19
25
|
2. **Update \`.deplhoy/sitemap.json\`**: every page a person can reach, and the links between pages with the text of the control that navigates. Group pages by flow if it helps. A page that only shows other data by query string (\`/product?id=…\`) goes once, with one example; list a query variant as its own page only when it is a different state (\`/checkout?price=up\`). deplhoy draws the flow from this file and adds the pages people reach that are missing.
|
|
@@ -32,7 +38,7 @@ When the person asks to publish, share or "deplhoy" this prototype:
|
|
|
32
38
|
4. **Publish** with the deplhoy MCP tool \`publish\`, or \`npx deplhoy publish\` in a terminal. Building and publishing need network access: ask for it if you run in a sandbox.
|
|
33
39
|
5. **Reply** with the URL and the version, plus any warnings. If publishing reports secret keys, show the file and line and do not remove anything without asking.
|
|
34
40
|
|
|
35
|
-
Publishing does not change the prototype: do not edit its content or copy to publish it. If you notice a problem, mention it in the reply or under open questions in behavior.md.
|
|
41
|
+
Publishing does not change the prototype: do not edit its content or copy to publish it (faking a backend as above is the one exception, and it keeps the screens as they are). If you notice a problem, mention it in the reply or under open questions in behavior.md.
|
|
36
42
|
|
|
37
43
|
When the person asks to work on the review comments:
|
|
38
44
|
1. Read them with the MCP tool \`get_comments\` (or \`npx deplhoy comments --json\`). You only get the comments an owner sent to agents. Each one says the element it is pinned to (role, text, page, device), its thread and, when the owner gave one, an \`instruction\`: follow it, it is the owner's decision on that feedback. Comments "pending" from an earlier version may already be fixed: check the code.
|
|
@@ -50,7 +56,7 @@ description: Publish this prototype to deplhoy and get a private URL for the tea
|
|
|
50
56
|
|
|
51
57
|
Follow the "Publishing prototypes with deplhoy" section of AGENTS.md in this project. In short:
|
|
52
58
|
|
|
53
|
-
1. Build static files.
|
|
59
|
+
1. Build static files. If it has a backend of its own, fake it in the browser (example data in localStorage, behind a build flag), say so in behavior.md, and publish that.
|
|
54
60
|
2. Update \`.deplhoy/sitemap.json\` (entry, pages, links with the text of the control) and \`.deplhoy/behavior.md\` (at most 4 KB).
|
|
55
61
|
3. Call the \`publish\` tool of the deplhoy MCP server (or run \`npx deplhoy publish\`). It needs network access.
|
|
56
62
|
4. Reply with the URL, the version and any warnings.
|