@vibemakery/cli 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +16 -2
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +80 -0
- package/dist/bin.js.map +1 -0
- package/dist/check.d.ts +21 -0
- package/dist/check.js +183 -0
- package/dist/check.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/submit.d.ts +14 -0
- package/dist/submit.js +41 -0
- package/dist/submit.js.map +1 -0
- package/package.json +42 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vibe Makery
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vibemakery/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Check and submit [Vibe Makery](https://github.com/vibemakery/vibemakery-kit) make bundles: a folder with a `manifest.json` and print-ready PDFs.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx @vibemakery/cli check ./my-book
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @vibemakery/cli submit ./my-book --api <vibe-makery-url>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- `check` validates the manifest and its PDFs against the printer's rules: page size, bleed, page count, spine width.
|
|
14
|
+
- `submit` checks, uploads and prints a private review link where you see the proof and the price and approve it. Submitting the same folder again creates a new version at the same link. Pass `--new` to start a separate submission.
|
|
15
|
+
- `--json` prints machine-readable results for agents. `VIBEMAKERY_API_URL` can replace `--api`.
|
|
16
|
+
|
|
17
|
+
See the [kit README](https://github.com/vibemakery/vibemakery-kit#readme) for the agent skills and the bundle format. MIT licensed.
|
package/dist/bin.d.ts
ADDED
package/dist/bin.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import process from "node:process";
|
|
4
|
+
import { checkBundle } from "./check.js";
|
|
5
|
+
import { STATE_FILE, submitBundle } from "./submit.js";
|
|
6
|
+
const HELP = `Usage:
|
|
7
|
+
vibemakery check <bundle-folder> [--json]
|
|
8
|
+
vibemakery submit <bundle-folder> [--api <url>] [--new] [--json]
|
|
9
|
+
|
|
10
|
+
check Checks a make bundle (manifest.json plus its files) against the
|
|
11
|
+
Vibe Makery schema and the printer's rules.
|
|
12
|
+
submit Checks, uploads and submits the bundle, and prints the private
|
|
13
|
+
review link where you see the proof and approve it. Submitting the
|
|
14
|
+
same folder again creates a new version of the same submission
|
|
15
|
+
(remembered in ${STATE_FILE}); --new starts a fresh one.
|
|
16
|
+
|
|
17
|
+
Options:
|
|
18
|
+
--api <url> Vibe Makery server (or set VIBEMAKERY_API_URL)
|
|
19
|
+
--json Machine-readable output (for agents)
|
|
20
|
+
-h, --help`;
|
|
21
|
+
const icon = { pass: "✓", warning: "!", error: "✗" };
|
|
22
|
+
const printFindings = (findings) => {
|
|
23
|
+
for (const f of findings)
|
|
24
|
+
console.log(`${icon[f.level]} ${f.file ? `${f.file}: ` : ""}${f.message}`);
|
|
25
|
+
};
|
|
26
|
+
function option(args, name) {
|
|
27
|
+
const i = args.indexOf(name);
|
|
28
|
+
return i === -1 ? undefined : args[i + 1];
|
|
29
|
+
}
|
|
30
|
+
async function main(argv) {
|
|
31
|
+
const [command, ...rest] = argv;
|
|
32
|
+
if (!command || command === "-h" || command === "--help") {
|
|
33
|
+
console.log(HELP);
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
if (command !== "check" && command !== "submit") {
|
|
37
|
+
console.error(`Unknown command: ${command}\n\n${HELP}`);
|
|
38
|
+
return 2;
|
|
39
|
+
}
|
|
40
|
+
const json = rest.includes("--json");
|
|
41
|
+
const apiFlag = option(rest, "--api");
|
|
42
|
+
const dir = rest.find((a, i) => !a.startsWith("-") && rest[i - 1] !== "--api");
|
|
43
|
+
if (!dir) {
|
|
44
|
+
console.error(`Missing <bundle-folder>.\n\n${HELP}`);
|
|
45
|
+
return 2;
|
|
46
|
+
}
|
|
47
|
+
const folder = path.resolve(dir);
|
|
48
|
+
const checked = await checkBundle(folder);
|
|
49
|
+
if (command === "check" || !checked.ok || !checked.manifest) {
|
|
50
|
+
if (json)
|
|
51
|
+
console.log(JSON.stringify(checked, null, 2));
|
|
52
|
+
else {
|
|
53
|
+
printFindings(checked.findings);
|
|
54
|
+
const errors = checked.findings.filter((f) => f.level === "error").length;
|
|
55
|
+
console.log(errors ? `\n${errors} error(s). Fix them before submitting.` : "\nReady to submit.");
|
|
56
|
+
}
|
|
57
|
+
return checked.ok ? 0 : 1;
|
|
58
|
+
}
|
|
59
|
+
const apiUrl = apiFlag ?? process.env.VIBEMAKERY_API_URL;
|
|
60
|
+
if (!apiUrl) {
|
|
61
|
+
console.error("Set the Vibe Makery server with --api <url> or VIBEMAKERY_API_URL.");
|
|
62
|
+
return 2;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
const result = await submitBundle(folder, checked.manifest, apiUrl, { newSubmission: rest.includes("--new") });
|
|
66
|
+
if (json)
|
|
67
|
+
console.log(JSON.stringify(result, null, 2));
|
|
68
|
+
else {
|
|
69
|
+
printFindings(result.findings);
|
|
70
|
+
console.log(`\nSubmitted version ${result.version}: ${result.status === "ready" ? "ready to review" : "needs changes"}.\nReview it here: ${result.reviewUrl}`);
|
|
71
|
+
}
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
console.error(`Submit failed: ${error.message}`);
|
|
76
|
+
return 1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
process.exitCode = await main(process.argv.slice(2));
|
|
80
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,OAAO,MAAM,cAAc,CAAA;AAElC,OAAO,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,IAAI,GAAG;;;;;;;;;yBASY,UAAU;;;;;aAKtB,CAAA;AAEb,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAW,CAAA;AAC7D,MAAM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MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAC9G,IAAI,IAAI;YAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;aACjD,CAAC;YACJ,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YAC9B,OAAO,CAAC,GAAG,CACT,uBAAuB,MAAM,CAAC,OAAO,KAAK,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,eAAe,sBAAsB,MAAM,CAAC,SAAS,EAAE,CAClJ,CAAA;QACH,CAAC;QACD,OAAO,CAAC,CAAA;IACV,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,kBAAmB,KAAe,CAAC,OAAO,EAAE,CAAC,CAAA;QAC3D,OAAO,CAAC,CAAA;IACV,CAAC;AACH,CAAC;AAED,OAAO,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
package/dist/check.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type MakeBundleManifest } from "@vibemakery/make-bundle";
|
|
2
|
+
export type Finding = {
|
|
3
|
+
level: "pass" | "warning" | "error";
|
|
4
|
+
code: string;
|
|
5
|
+
message: string;
|
|
6
|
+
file?: string;
|
|
7
|
+
};
|
|
8
|
+
export type CheckResult = {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
manifest?: MakeBundleManifest;
|
|
11
|
+
findings: Finding[];
|
|
12
|
+
};
|
|
13
|
+
/** Reads a file from the bundle by its manifest path; undefined when it doesn't exist. */
|
|
14
|
+
export type BundleReader = (bundlePath: string) => Promise<Uint8Array | undefined>;
|
|
15
|
+
/** Checks a make bundle folder the way the Vibe Makery server will, as far as it can locally. */
|
|
16
|
+
export declare function checkBundle(dir: string): Promise<CheckResult>;
|
|
17
|
+
/**
|
|
18
|
+
* Checks a parsed manifest and its files, read through `read`. The CLI reads
|
|
19
|
+
* from disk; the Vibe Makery server reads the uploaded files from storage.
|
|
20
|
+
*/
|
|
21
|
+
export declare function checkBundleContent(raw: unknown, read: BundleReader): Promise<CheckResult>;
|
package/dist/check.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { BLEED_IN, SPINE_TEXT_MIN_PAGES, interiorPageSizeIn, makeBundleManifest, paperbackCoverSizeIn, recommendedInsideMarginIn, } from "@vibemakery/make-bundle";
|
|
4
|
+
import { PDFDocument } from "pdf-lib";
|
|
5
|
+
const POINTS_PER_IN = 72;
|
|
6
|
+
const SIZE_TOLERANCE_IN = 0.02;
|
|
7
|
+
const fmt = (n) => `${Math.round(n * 1000) / 1000} in`;
|
|
8
|
+
const close = (a, b) => Math.abs(a - b) <= SIZE_TOLERANCE_IN;
|
|
9
|
+
async function loadPdf(read, file, findings) {
|
|
10
|
+
let bytes;
|
|
11
|
+
try {
|
|
12
|
+
bytes = await read(file);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
bytes = undefined;
|
|
16
|
+
}
|
|
17
|
+
const missing = bytes === undefined;
|
|
18
|
+
try {
|
|
19
|
+
if (!bytes)
|
|
20
|
+
throw new Error("missing");
|
|
21
|
+
return await PDFDocument.load(bytes, { updateMetadata: false });
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
findings.push({
|
|
25
|
+
level: "error",
|
|
26
|
+
code: missing ? "file-missing" : "file-unreadable",
|
|
27
|
+
file,
|
|
28
|
+
message: missing ? `${file} is not in the bundle folder.` : `${file} can't be read as a PDF.`,
|
|
29
|
+
});
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** Checks a make bundle folder the way the Vibe Makery server will, as far as it can locally. */
|
|
34
|
+
export async function checkBundle(dir) {
|
|
35
|
+
let raw;
|
|
36
|
+
try {
|
|
37
|
+
raw = JSON.parse(await readFile(path.join(dir, "manifest.json"), "utf8"));
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
const missing = error.code === "ENOENT";
|
|
41
|
+
return {
|
|
42
|
+
ok: false,
|
|
43
|
+
findings: [
|
|
44
|
+
{
|
|
45
|
+
level: "error",
|
|
46
|
+
code: missing ? "manifest-missing" : "manifest-invalid-json",
|
|
47
|
+
file: "manifest.json",
|
|
48
|
+
message: missing ? "manifest.json is missing from the bundle folder." : "manifest.json is not valid JSON.",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return checkBundleContent(raw, async (bundlePath) => {
|
|
54
|
+
try {
|
|
55
|
+
return await readFile(path.join(dir, bundlePath));
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
if (error.code === "ENOENT")
|
|
59
|
+
return undefined;
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Checks a parsed manifest and its files, read through `read`. The CLI reads
|
|
66
|
+
* from disk; the Vibe Makery server reads the uploaded files from storage.
|
|
67
|
+
*/
|
|
68
|
+
export async function checkBundleContent(raw, read) {
|
|
69
|
+
const findings = [];
|
|
70
|
+
const parsed = makeBundleManifest.safeParse(raw);
|
|
71
|
+
if (!parsed.success) {
|
|
72
|
+
for (const issue of parsed.error.issues) {
|
|
73
|
+
findings.push({
|
|
74
|
+
level: "error",
|
|
75
|
+
code: "manifest-schema",
|
|
76
|
+
file: "manifest.json",
|
|
77
|
+
message: `${issue.path.join(".") || "manifest"}: ${issue.message}`,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return { ok: false, findings };
|
|
81
|
+
}
|
|
82
|
+
const manifest = parsed.data;
|
|
83
|
+
findings.push({ level: "pass", code: "manifest", file: "manifest.json", message: "Manifest matches the v1 schema." });
|
|
84
|
+
const { options, files } = manifest;
|
|
85
|
+
const binding = manifest.product === "book.paperback" ? "paperback" : "hardcover";
|
|
86
|
+
const interior = await loadPdf(read, files.interior, findings);
|
|
87
|
+
if (interior) {
|
|
88
|
+
const count = interior.getPageCount();
|
|
89
|
+
if (count !== options.pages) {
|
|
90
|
+
findings.push({
|
|
91
|
+
level: "error",
|
|
92
|
+
code: "page-count",
|
|
93
|
+
file: files.interior,
|
|
94
|
+
message: `The interior has ${count} pages but the manifest says ${options.pages}.`,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
findings.push({ level: "pass", code: "page-count", file: files.interior, message: `${count} interior pages.` });
|
|
99
|
+
}
|
|
100
|
+
const expected = interiorPageSizeIn(options.trim, options.interiorBleed);
|
|
101
|
+
const wrong = interior
|
|
102
|
+
.getPages()
|
|
103
|
+
.map((page, i) => ({ n: i + 1, ...page.getSize() }))
|
|
104
|
+
.filter((p) => !close(p.width / POINTS_PER_IN, expected.width) || !close(p.height / POINTS_PER_IN, expected.height));
|
|
105
|
+
if (wrong.length) {
|
|
106
|
+
const first = wrong[0];
|
|
107
|
+
findings.push({
|
|
108
|
+
level: "error",
|
|
109
|
+
code: "page-size",
|
|
110
|
+
file: files.interior,
|
|
111
|
+
message: `${wrong.length} page(s) aren't ${fmt(expected.width)} × ${fmt(expected.height)}${options.interiorBleed ? ` (trim plus ${BLEED_IN} in bleed on every side)` : ""}. Page ${first.n} is ${fmt(first.width / POINTS_PER_IN)} × ${fmt(first.height / POINTS_PER_IN)}.`,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
findings.push({
|
|
116
|
+
level: "pass",
|
|
117
|
+
code: "page-size",
|
|
118
|
+
file: files.interior,
|
|
119
|
+
message: `Every page is ${fmt(expected.width)} × ${fmt(expected.height)}${options.interiorBleed ? ", bleed included" : ""}.`,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const cover = await loadPdf(read, files.cover, findings);
|
|
124
|
+
if (cover) {
|
|
125
|
+
if (cover.getPageCount() !== 1) {
|
|
126
|
+
findings.push({
|
|
127
|
+
level: "error",
|
|
128
|
+
code: "cover-pages",
|
|
129
|
+
file: files.cover,
|
|
130
|
+
message: `The cover must be one page with back, spine and front side by side; it has ${cover.getPageCount()} pages.`,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
else if (binding === "paperback") {
|
|
134
|
+
const expected = paperbackCoverSizeIn(options.trim, options.pages);
|
|
135
|
+
const { width, height } = cover.getPage(0).getSize();
|
|
136
|
+
if (expected && (!close(width / POINTS_PER_IN, expected.width) || !close(height / POINTS_PER_IN, expected.height))) {
|
|
137
|
+
findings.push({
|
|
138
|
+
level: "error",
|
|
139
|
+
code: "cover-size",
|
|
140
|
+
file: files.cover,
|
|
141
|
+
message: `The cover spread should be ${fmt(expected.width)} × ${fmt(expected.height)} (spine ${fmt(expected.spine)} for ${options.pages} pages), but it's ${fmt(width / POINTS_PER_IN)} × ${fmt(height / POINTS_PER_IN)}.`,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
else if (expected) {
|
|
145
|
+
findings.push({
|
|
146
|
+
level: "pass",
|
|
147
|
+
code: "cover-size",
|
|
148
|
+
file: files.cover,
|
|
149
|
+
message: `Cover spread is ${fmt(expected.width)} × ${fmt(expected.height)} with a ${fmt(expected.spine)} spine.`,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
findings.push({
|
|
155
|
+
level: "warning",
|
|
156
|
+
code: "cover-size-server",
|
|
157
|
+
file: files.cover,
|
|
158
|
+
message: "Hardcover case-wrap covers include board wrap and hinges. Build it on Lulu's template for this page count; we check its size when you submit.",
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (options.pages < SPINE_TEXT_MIN_PAGES) {
|
|
163
|
+
findings.push({
|
|
164
|
+
level: "warning",
|
|
165
|
+
code: "spine-text",
|
|
166
|
+
message: `With ${options.pages} pages the spine is too narrow for text. Keep the spine free of text.`,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
if (options.pages > 60) {
|
|
170
|
+
findings.push({
|
|
171
|
+
level: "warning",
|
|
172
|
+
code: "gutter",
|
|
173
|
+
message: `For ${options.pages} pages, keep the inside (spine-side) margin at least ${recommendedInsideMarginIn(options.pages)} in.`,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
findings.push({
|
|
177
|
+
level: "warning",
|
|
178
|
+
code: "server-checks",
|
|
179
|
+
message: "Image resolution (300 ppi), embedded fonts, colors and the 0.5 in safety margin are checked on our side when you submit.",
|
|
180
|
+
});
|
|
181
|
+
return { ok: !findings.some((f) => f.level === "error"), manifest, findings };
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,GAE1B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAerC,MAAM,aAAa,GAAG,EAAE,CAAA;AACxB,MAAM,iBAAiB,GAAG,IAAI,CAAA;AAC9B,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAA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IAAI,CAAC;QACZ,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,0HAA0H;KACpI,CAAC,CAAA;IAEF,OAAO,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;AAC/E,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAqD,MAAM,YAAY,CAAA;AAC/G,OAAO,EAAE,UAAU,EAAE,YAAY,EAAqB,MAAM,aAAa,CAAA"}
|
package/dist/submit.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MakeBundleManifest } from "@vibemakery/make-bundle";
|
|
2
|
+
import type { Finding } from "./check.js";
|
|
3
|
+
/** Stored next to the manifest so a resubmission becomes a new version of the same submission. */
|
|
4
|
+
export declare const STATE_FILE = ".vibemakery.json";
|
|
5
|
+
export type SubmitResult = {
|
|
6
|
+
reviewUrl: string;
|
|
7
|
+
version: number;
|
|
8
|
+
status: "ready" | "needs_changes";
|
|
9
|
+
findings: Finding[];
|
|
10
|
+
};
|
|
11
|
+
/** Uploads a checked bundle and returns its private review link. */
|
|
12
|
+
export declare function submitBundle(dir: string, manifest: MakeBundleManifest, apiUrl: string, { newSubmission }?: {
|
|
13
|
+
newSubmission?: boolean;
|
|
14
|
+
}): Promise<SubmitResult>;
|
package/dist/submit.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { readFile, stat, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
/** Stored next to the manifest so a resubmission becomes a new version of the same submission. */
|
|
4
|
+
export const STATE_FILE = ".vibemakery.json";
|
|
5
|
+
async function api(url, init) {
|
|
6
|
+
const res = await fetch(url, { ...init, headers: { "content-type": "application/json", ...init.headers } });
|
|
7
|
+
const body = (await res.json().catch(() => ({})));
|
|
8
|
+
if (!res.ok)
|
|
9
|
+
throw new Error(body.error ?? `${res.status} ${res.statusText} from ${url}`);
|
|
10
|
+
return body;
|
|
11
|
+
}
|
|
12
|
+
async function readState(dir) {
|
|
13
|
+
try {
|
|
14
|
+
return JSON.parse(await readFile(path.join(dir, STATE_FILE), "utf8"));
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** Uploads a checked bundle and returns its private review link. */
|
|
21
|
+
export async function submitBundle(dir, manifest, apiUrl, { newSubmission = false } = {}) {
|
|
22
|
+
const base = apiUrl.replace(/\/+$/, "");
|
|
23
|
+
const paths = [...new Set(Object.values(manifest.files))];
|
|
24
|
+
const files = await Promise.all(paths.map(async (p) => ({ path: p, size: (await stat(path.join(dir, p))).size, contentType: "application/pdf" })));
|
|
25
|
+
const state = newSubmission ? undefined : await readState(dir);
|
|
26
|
+
const reuse = state && state.apiUrl === base;
|
|
27
|
+
const created = await api(reuse ? `${base}/api/v1/submissions/${state.token}/versions` : `${base}/api/v1/submissions`, { method: "POST", body: JSON.stringify({ manifest, files }) });
|
|
28
|
+
for (const upload of created.uploads) {
|
|
29
|
+
const res = await fetch(upload.url, {
|
|
30
|
+
method: upload.method,
|
|
31
|
+
headers: upload.headers,
|
|
32
|
+
body: await readFile(path.join(dir, upload.path)),
|
|
33
|
+
});
|
|
34
|
+
if (!res.ok)
|
|
35
|
+
throw new Error(`Upload of ${upload.path} failed: ${res.status} ${res.statusText}`);
|
|
36
|
+
}
|
|
37
|
+
const result = await api(created.completeUrl, { method: "POST", body: "{}" });
|
|
38
|
+
await writeFile(path.join(dir, STATE_FILE), JSON.stringify({ token: created.token, apiUrl: base }, null, 2) + "\n");
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;YACvB,IAAI,EAAE,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;SAClD,CAAC,CAAA;QACF,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,aAAa,MAAM,CAAC,IAAI,YAAY,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC,CAAA;IAClG,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,GAAG,CAAe,OAAO,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;IAC3F,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IACnH,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibemakery/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Check Vibe Makery make bundles before you submit them.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"vibemakery": "./dist/bin.js"
|
|
8
|
+
},
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@vibemakery/make-bundle": "^0.2.0",
|
|
20
|
+
"pdf-lib": "^1.17.1"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^24.0.0",
|
|
24
|
+
"typescript": "^5.9.3",
|
|
25
|
+
"vitest": "^5.1.2"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/vibemakery/vibemakery-kit.git",
|
|
31
|
+
"directory": "packages/cli"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/vibemakery/vibemakery-kit#readme",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/vibemakery/vibemakery-kit/issues"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsc -p tsconfig.json",
|
|
42
|
+
"test": "vitest run",
|
|
43
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
44
|
+
}
|
|
6
45
|
}
|