@zurb/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/README.md +40 -2
- package/dist/api.js +26 -0
- package/dist/args.js +77 -0
- package/dist/bin.js +56 -0
- package/dist/config.js +30 -0
- package/dist/help.js +57 -0
- package/dist/login.js +71 -0
- package/package.json +29 -4
package/README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @zurb/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
One command for every ZURB tool. It starts with Studios and Clue.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install -g @zurb/cli
|
|
7
|
+
zurb login # approve in the browser, signed in to Studios
|
|
8
|
+
zurb --help # what you can run
|
|
9
|
+
zurb clue find "why do trial users stall?"
|
|
10
|
+
zurb studios customers list --output json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Commands are shaped `zurb <tool> <thing> <action>`. The CLI only holds `login` and `logout`. Every
|
|
14
|
+
other command, and the help that lists it, comes from Studios. That has two effects:
|
|
15
|
+
|
|
16
|
+
- A new command needs a Studios deploy, not a CLI release.
|
|
17
|
+
- People only see what they can run. `admin …` commands exist only for platform admins.
|
|
18
|
+
|
|
19
|
+
## Signing in
|
|
20
|
+
|
|
21
|
+
`zurb login` works like this:
|
|
22
|
+
|
|
23
|
+
1. It starts a server on `127.0.0.1` and opens Studios' `/cli/login`.
|
|
24
|
+
2. You approve there, and the page hands a one-time code back to that server.
|
|
25
|
+
3. The CLI trades the code, with a PKCE verifier only it holds, for a personal token.
|
|
26
|
+
|
|
27
|
+
The token lasts 30 days, acts as you, and is stored at `~/.zurb/config.json` (mode 600). Studios
|
|
28
|
+
keeps only its hash. `zurb logout` revokes it.
|
|
29
|
+
|
|
30
|
+
That token only reads. Commands that change data need `zurb login --write`. Only platform admins
|
|
31
|
+
can approve that sign-in, and it lasts a day.
|
|
32
|
+
|
|
33
|
+
For scripts and CI, set `ZURB_TOKEN`.
|
|
34
|
+
|
|
35
|
+
## Input
|
|
36
|
+
|
|
37
|
+
- Positional words fill the command's arguments in order.
|
|
38
|
+
- `--key value` fills the rest, using the command's schema.
|
|
39
|
+
- `--json '{…}'` or `--json @file.json` gives all the input at once.
|
|
40
|
+
- `--output json` prints the data for scripts and agents.
|
|
41
|
+
- `--customer` can be left off when you have one customer.
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Talking to Studios' /api/v1 (ZURB-4692). Errors come back as { error } with a message meant for people.
|
|
2
|
+
export class ApiError extends Error {
|
|
3
|
+
status;
|
|
4
|
+
constructor(status, message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.status = status;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export async function call(url, path, init = {}) {
|
|
10
|
+
let res;
|
|
11
|
+
try {
|
|
12
|
+
res = await fetch(url + path, {
|
|
13
|
+
method: init.method ?? (init.body === undefined ? "GET" : "POST"),
|
|
14
|
+
headers: { ...(init.token ? { Authorization: `Bearer ${init.token}` } : {}), ...(init.body === undefined ? {} : { "Content-Type": "application/json" }), "User-Agent": "zurb-cli" },
|
|
15
|
+
body: init.body === undefined ? undefined : JSON.stringify(init.body),
|
|
16
|
+
redirect: "error",
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
throw new ApiError(0, `Couldn't reach ${url}. Check your connection, or ZURB_URL.`);
|
|
21
|
+
}
|
|
22
|
+
const body = (await res.json().catch(() => null));
|
|
23
|
+
if (!res.ok)
|
|
24
|
+
throw new ApiError(res.status, body?.error ?? `${url} answered ${res.status}.`);
|
|
25
|
+
return body;
|
|
26
|
+
}
|
package/dist/args.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
export class UsageError extends Error {
|
|
3
|
+
}
|
|
4
|
+
/** The command named by the longest run of leading words. */
|
|
5
|
+
export function matchCommand(manifest, words) {
|
|
6
|
+
let best = null;
|
|
7
|
+
for (const c of manifest) {
|
|
8
|
+
const parts = c.name.split(" ");
|
|
9
|
+
if (parts.every((p, i) => words[i] === p) && (!best || parts.length > best.name.split(" ").length))
|
|
10
|
+
best = c;
|
|
11
|
+
}
|
|
12
|
+
return best ? { command: best, rest: words.slice(best.name.split(" ").length) } : null;
|
|
13
|
+
}
|
|
14
|
+
function coerce(key, value, schema) {
|
|
15
|
+
const type = schema?.type;
|
|
16
|
+
if (type === "boolean")
|
|
17
|
+
return value === true ? true : !/^(false|no|0)$/i.test(value);
|
|
18
|
+
if (value === true)
|
|
19
|
+
throw new UsageError(`--${key} needs a value.`);
|
|
20
|
+
if (type === "number" || type === "integer") {
|
|
21
|
+
const n = Number(value);
|
|
22
|
+
if (!Number.isFinite(n))
|
|
23
|
+
throw new UsageError(`--${key} takes a number.`);
|
|
24
|
+
return n;
|
|
25
|
+
}
|
|
26
|
+
if (type === "array")
|
|
27
|
+
return value.split(",").map((v) => v.trim()).filter(Boolean);
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
function readJson(value) {
|
|
31
|
+
const text = value.startsWith("@") ? readFileSync(value.slice(1), "utf8") : value;
|
|
32
|
+
try {
|
|
33
|
+
const parsed = JSON.parse(text);
|
|
34
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed))
|
|
35
|
+
return parsed;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
// Falls through.
|
|
39
|
+
}
|
|
40
|
+
throw new UsageError("--json takes a JSON object, or @file.json.");
|
|
41
|
+
}
|
|
42
|
+
export function parseInput(command, rest) {
|
|
43
|
+
const props = command.input.properties ?? {};
|
|
44
|
+
const input = {};
|
|
45
|
+
const positional = [];
|
|
46
|
+
let output = "text";
|
|
47
|
+
for (let i = 0; i < rest.length; i++) {
|
|
48
|
+
const word = rest[i];
|
|
49
|
+
if (!word.startsWith("--")) {
|
|
50
|
+
positional.push(word);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const [rawKey, inline] = word.slice(2).split(/=(.*)/s, 2);
|
|
54
|
+
const negated = rawKey.startsWith("no-") && props[rawKey.slice(3)]?.type === "boolean";
|
|
55
|
+
const key = negated ? rawKey.slice(3) : rawKey;
|
|
56
|
+
const schema = props[key];
|
|
57
|
+
const takesValue = key === "json" || key === "output" || (schema && schema.type !== "boolean");
|
|
58
|
+
const next = rest[i + 1];
|
|
59
|
+
const value = inline ?? (takesValue && next !== undefined && !next.startsWith("--") ? (i++, next) : true);
|
|
60
|
+
if (key === "json")
|
|
61
|
+
Object.assign(input, readJson(String(value)));
|
|
62
|
+
else if (key === "output") {
|
|
63
|
+
if (value !== "json" && value !== "text")
|
|
64
|
+
throw new UsageError("--output is json or text.");
|
|
65
|
+
output = value;
|
|
66
|
+
}
|
|
67
|
+
else if (!schema)
|
|
68
|
+
throw new UsageError(`zurb ${command.name} has no --${key}. Run zurb ${command.name} --help.`);
|
|
69
|
+
else
|
|
70
|
+
input[key] = negated ? false : coerce(key, value, schema);
|
|
71
|
+
}
|
|
72
|
+
const args = command.args.filter((a) => input[a] === undefined);
|
|
73
|
+
if (positional.length > args.length)
|
|
74
|
+
throw new UsageError(`Too many arguments for zurb ${command.name}. Quote text with spaces in it.`);
|
|
75
|
+
positional.forEach((p, i) => (input[args[i]] = coerce(args[i], p, props[args[i]])));
|
|
76
|
+
return { input, output };
|
|
77
|
+
}
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { ApiError, call } from "./api.js";
|
|
3
|
+
import { matchCommand, parseInput } from "./args.js";
|
|
4
|
+
import { clearConfig, readConfig, writeConfig } from "./config.js";
|
|
5
|
+
import { commandHelp, loginMessage, mainHelp } from "./help.js";
|
|
6
|
+
import { login } from "./login.js";
|
|
7
|
+
// zurb (ZURB-4692). login and logout live here; every other command, and the help listing them,
|
|
8
|
+
// comes from Studios (GET /api/v1/commands), so the CLI never has to change for a new command.
|
|
9
|
+
const VERSION = "0.2.0";
|
|
10
|
+
const say = (s) => process.stdout.write(s + "\n");
|
|
11
|
+
const warn = (s) => process.stderr.write(s + "\n");
|
|
12
|
+
async function main(argv) {
|
|
13
|
+
const config = await readConfig();
|
|
14
|
+
const help = argv.includes("--help") || argv.includes("-h");
|
|
15
|
+
const words = argv.filter((a) => a !== "--help" && a !== "-h");
|
|
16
|
+
if (words[0] === "--version" || words[0] === "-v")
|
|
17
|
+
return say(VERSION), 0;
|
|
18
|
+
if (words[0] === "login") {
|
|
19
|
+
const write = words.slice(1).includes("--write");
|
|
20
|
+
const got = await login(config.url, warn, write);
|
|
21
|
+
await writeConfig({ url: config.url, token: got.token, email: got.email, expiresAt: got.expiresAt, write: Boolean(got.write) });
|
|
22
|
+
say(loginMessage(got));
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
if (words[0] === "logout") {
|
|
26
|
+
if (config.token)
|
|
27
|
+
await call(config.url, "/api/v1/cli/logout", { token: config.token, method: "POST" }).catch(() => { });
|
|
28
|
+
await clearConfig();
|
|
29
|
+
say("Signed out.");
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
if (!config.token) {
|
|
33
|
+
if (help || !words.length)
|
|
34
|
+
return say(mainHelp(null, null)), 0;
|
|
35
|
+
warn("Not signed in. Run zurb login.");
|
|
36
|
+
return 1;
|
|
37
|
+
}
|
|
38
|
+
const { commands } = await call(config.url, "/api/v1/commands", { token: config.token });
|
|
39
|
+
if (!words.length)
|
|
40
|
+
return say(mainHelp(commands, config.email ?? null)), 0;
|
|
41
|
+
const match = matchCommand(commands, words);
|
|
42
|
+
if (!match) {
|
|
43
|
+
warn(`No command "${words.join(" ")}". Run zurb --help for the list.`);
|
|
44
|
+
return 1;
|
|
45
|
+
}
|
|
46
|
+
if (help)
|
|
47
|
+
return say(commandHelp(match.command)), 0;
|
|
48
|
+
const { input, output } = parseInput(match.command, match.rest);
|
|
49
|
+
const result = await call(config.url, `/api/v1/commands/${match.command.name.split(" ").map(encodeURIComponent).join("/")}`, { token: config.token, body: input });
|
|
50
|
+
say(output === "json" ? JSON.stringify(result.data, null, 2) : result.text);
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
main(process.argv.slice(2)).then((code) => process.exit(code), (error) => {
|
|
54
|
+
warn(error instanceof Error ? error.message : String(error));
|
|
55
|
+
process.exit(error instanceof ApiError && error.status === 401 ? 2 : 1);
|
|
56
|
+
});
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
// Where the CLI keeps its token: ~/.zurb/config.json, readable only by you. ZURB_TOKEN and
|
|
5
|
+
// ZURB_URL override it, for scripts and CI.
|
|
6
|
+
export const DEFAULT_URL = "https://studios.zurb.com";
|
|
7
|
+
export const configPath = () => process.env.ZURB_CONFIG || join(homedir(), ".zurb", "config.json");
|
|
8
|
+
export async function readConfig() {
|
|
9
|
+
let saved = {};
|
|
10
|
+
try {
|
|
11
|
+
saved = JSON.parse(await readFile(configPath(), "utf8"));
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
// No config yet.
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
...saved,
|
|
18
|
+
url: (process.env.ZURB_URL || saved.url || DEFAULT_URL).replace(/\/+$/, ""),
|
|
19
|
+
token: process.env.ZURB_TOKEN || saved.token,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export async function writeConfig(config) {
|
|
23
|
+
const path = configPath();
|
|
24
|
+
await mkdir(dirname(path), { recursive: true, mode: 0o700 });
|
|
25
|
+
await writeFile(path, JSON.stringify(config, null, 2) + "\n", { mode: 0o600 });
|
|
26
|
+
await chmod(path, 0o600);
|
|
27
|
+
}
|
|
28
|
+
export async function clearConfig() {
|
|
29
|
+
await rm(configPath(), { force: true });
|
|
30
|
+
}
|
package/dist/help.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// `zurb --help` and `zurb <command> --help`, written from Studios' manifest, so it lists only what
|
|
2
|
+
// this person can run.
|
|
3
|
+
const pad = (s, n) => (s.length >= n ? s + " " : s.padEnd(n));
|
|
4
|
+
const usage = (c) => [c.name, ...c.args.map((a) => `<${a}>`)].join(" ");
|
|
5
|
+
export function mainHelp(manifest, signedIn) {
|
|
6
|
+
const lines = ["Usage: zurb <tool> <thing> <action> [flags]", ""];
|
|
7
|
+
lines.push("ACCOUNT", ` ${pad("login | logout", 40)}sign in with your Studios account`, ` ${pad("login --write", 40)}sign in to change data, for a day (platform admins)`);
|
|
8
|
+
if (!manifest) {
|
|
9
|
+
lines.push("", "Run zurb login to see the commands you can use.");
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
const groups = new Map();
|
|
13
|
+
for (const c of manifest) {
|
|
14
|
+
const group = c.admin ? "ADMIN" : c.name.includes(" ") ? c.name.split(" ")[0].toUpperCase() : "ACCOUNT ";
|
|
15
|
+
groups.set(group, [...(groups.get(group) ?? []), c]);
|
|
16
|
+
}
|
|
17
|
+
for (const [group, cmds] of groups) {
|
|
18
|
+
if (group !== "ACCOUNT ")
|
|
19
|
+
lines.push("", group);
|
|
20
|
+
for (const c of cmds)
|
|
21
|
+
lines.push(` ${pad(usage(c), 40)}${c.summary}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
lines.push("", "FLAGS", " --json '{…}' | --json @file.json input all at once", " --output json | text json for scripts and agents", " <command> --help that command's flags");
|
|
25
|
+
if (manifest?.some((c) => c.writes))
|
|
26
|
+
lines.push("", "Commands that change data need zurb login --write.");
|
|
27
|
+
if (signedIn)
|
|
28
|
+
lines.push("", `Signed in as ${signedIn}.`);
|
|
29
|
+
return lines.join("\n");
|
|
30
|
+
}
|
|
31
|
+
const describe = (s) => {
|
|
32
|
+
const type = s.enum ? s.enum.join(" | ") : s.type === "array" ? `${s.items?.enum?.join(",") ?? s.items?.type ?? "list"},…` : (s.type ?? "value");
|
|
33
|
+
return { type, note: [s.description, s.default !== undefined ? `(default ${JSON.stringify(s.default)})` : ""].filter(Boolean).join(" ") };
|
|
34
|
+
};
|
|
35
|
+
export function commandHelp(c) {
|
|
36
|
+
const props = c.input.properties ?? {};
|
|
37
|
+
const required = new Set(c.input.required ?? []);
|
|
38
|
+
const lines = [`Usage: zurb ${usage(c)} [flags]`, "", c.summary];
|
|
39
|
+
if (c.writes)
|
|
40
|
+
lines.push("It changes data, so it needs a sign-in from zurb login --write.");
|
|
41
|
+
const flags = Object.entries(props).filter(([k]) => !c.args.includes(k));
|
|
42
|
+
if (flags.length) {
|
|
43
|
+
lines.push("", "FLAGS");
|
|
44
|
+
for (const [k, s] of flags) {
|
|
45
|
+
const { type, note } = describe(s);
|
|
46
|
+
lines.push(` ${pad(`--${k} ${s.type === "boolean" ? `| --no-${k}` : `<${type}>`}`, 40)}${note}${required.has(k) && s.default === undefined ? " (required)" : ""}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return lines.join("\n");
|
|
50
|
+
}
|
|
51
|
+
/** What `zurb login` says once it's done: a sign-in that can change data says so, and when it ends. */
|
|
52
|
+
export function loginMessage(got) {
|
|
53
|
+
if (!got.write)
|
|
54
|
+
return `Signed in as ${got.email} until ${got.expiresAt.slice(0, 10)}.`;
|
|
55
|
+
const until = new Date(got.expiresAt).toLocaleString([], { dateStyle: "medium", timeStyle: "short" });
|
|
56
|
+
return `Signed in as ${got.email}, able to change data, until ${until}. Run zurb login for an everyday sign-in after.`;
|
|
57
|
+
}
|
package/dist/login.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
3
|
+
import { createServer } from "node:http";
|
|
4
|
+
import { hostname } from "node:os";
|
|
5
|
+
import { call } from "./api.js";
|
|
6
|
+
// `zurb login` (ZURB-4692): a server on 127.0.0.1 waits for the browser, Studios' approval page
|
|
7
|
+
// sends back a one-time code, and the CLI trades it, with a PKCE verifier only it knows, for a token.
|
|
8
|
+
// `zurb login --write` asks for a token that can change data, which only platform admins can
|
|
9
|
+
// approve, for a day (ZURB-4696).
|
|
10
|
+
const b64url = (b) => b.toString("base64url");
|
|
11
|
+
export const challengeFor = (verifier) => b64url(createHash("sha256").update(verifier).digest());
|
|
12
|
+
/** A token name Studios accepts: letters, digits and a little punctuation, up to 60 characters. */
|
|
13
|
+
export const tokenName = (host = hostname()) => `zurb CLI on ${host.replace(/\.local$/, "").replace(/[^\w .@'()-]/g, "-")}`.slice(0, 60);
|
|
14
|
+
export function approvalUrl(base, port, state, challenge, name, write = false) {
|
|
15
|
+
const url = new URL("/cli/login", base);
|
|
16
|
+
for (const [k, v] of Object.entries({ port: String(port), state, challenge, name }))
|
|
17
|
+
url.searchParams.set(k, v);
|
|
18
|
+
if (write)
|
|
19
|
+
url.searchParams.set("write", "1");
|
|
20
|
+
return url.toString();
|
|
21
|
+
}
|
|
22
|
+
function openBrowser(url) {
|
|
23
|
+
const [cmd, args] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["cmd", ["/c", "start", "", url]] : ["xdg-open", [url]];
|
|
24
|
+
try {
|
|
25
|
+
spawn(cmd, args, { stdio: "ignore", detached: true }).on("error", () => { }).unref();
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// The URL is printed too.
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const PAGE = (msg) => `<!doctype html><meta charset="utf-8"><title>zurb</title><body style="font:16px system-ui;display:grid;place-items:center;height:90vh"><p>${msg}</p>`;
|
|
32
|
+
export async function login(base, log, write = false) {
|
|
33
|
+
const verifier = b64url(randomBytes(32));
|
|
34
|
+
const state = b64url(randomBytes(16));
|
|
35
|
+
const code = await new Promise((resolve, reject) => {
|
|
36
|
+
const timer = setTimeout(() => finish(new Error("Timed out waiting for the browser. Run zurb login again.")), 5 * 60_000);
|
|
37
|
+
const server = createServer((req, res) => {
|
|
38
|
+
const url = new URL(req.url ?? "/", "http://127.0.0.1");
|
|
39
|
+
if (url.pathname !== "/callback")
|
|
40
|
+
return void res.writeHead(404).end();
|
|
41
|
+
if (url.searchParams.get("state") !== state)
|
|
42
|
+
return void res.writeHead(400, { "Content-Type": "text/html" }).end(PAGE("This sign-in didn't come from this terminal."));
|
|
43
|
+
if (url.searchParams.get("error")) {
|
|
44
|
+
res.writeHead(200, { "Content-Type": "text/html" }).end(PAGE("Cancelled. You can close this tab."));
|
|
45
|
+
return finish(new Error("Sign-in was cancelled in the browser."));
|
|
46
|
+
}
|
|
47
|
+
const got = url.searchParams.get("code");
|
|
48
|
+
if (!got)
|
|
49
|
+
return void res.writeHead(400).end();
|
|
50
|
+
res.writeHead(200, { "Content-Type": "text/html" }).end(PAGE("Signed in. You can close this tab and go back to your terminal."));
|
|
51
|
+
finish(null, got);
|
|
52
|
+
});
|
|
53
|
+
function finish(err, value) {
|
|
54
|
+
clearTimeout(timer);
|
|
55
|
+
server.close();
|
|
56
|
+
if (err)
|
|
57
|
+
reject(err);
|
|
58
|
+
else
|
|
59
|
+
resolve(value);
|
|
60
|
+
}
|
|
61
|
+
server.on("error", reject);
|
|
62
|
+
server.listen(0, "127.0.0.1", () => {
|
|
63
|
+
const address = server.address();
|
|
64
|
+
const port = typeof address === "object" && address ? address.port : 0;
|
|
65
|
+
const url = approvalUrl(base, port, state, challengeFor(verifier), tokenName(), write);
|
|
66
|
+
log(`Opening your browser to approve this sign-in. If it doesn't open, go to:\n ${url}`);
|
|
67
|
+
openBrowser(url);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
return call(base, "/api/v1/cli/token", { body: { code, verifier } });
|
|
71
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zurb/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
}
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "One command for every ZURB tool, starting with Studios and Clue.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": { "zurb": "dist/bin.js" },
|
|
7
|
+
"files": ["dist"],
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"engines": { "node": ">=20" },
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/zurb/studio.git",
|
|
13
|
+
"directory": "cli"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.build.json",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"dev": "tsx src/bin.ts",
|
|
22
|
+
"typecheck": "tsc --noEmit",
|
|
23
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^20.14.0",
|
|
27
|
+
"tsx": "^4.16.0",
|
|
28
|
+
"typescript": "^5.5.0",
|
|
29
|
+
"vitest": "^2.0.0"
|
|
30
|
+
}
|
|
31
|
+
}
|