@raizn/cli 0.1.0 → 0.1.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/README.md +20 -5
- package/dist/commands/theme.js +13 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,12 +25,24 @@ useless to anyone else, because it needs a secret that never leaves this process
|
|
|
25
25
|
lasts 90 days and appears in Settings → AI assistant connection (MCP) as "raizn CLI — <computer>",
|
|
26
26
|
where you can revoke it.
|
|
27
27
|
|
|
28
|
+
**macOS: `EACCES: permission denied` on `npm i -g`.** Node's installer makes the global folder
|
|
29
|
+
belong to the system. Don't use `sudo`. Either run commands through `npx @raizn/cli …`, or point
|
|
30
|
+
npm's global folder at your home directory once:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
mkdir -p ~/.npm-global
|
|
34
|
+
npm config set prefix ~/.npm-global
|
|
35
|
+
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
|
|
36
|
+
npm i -g @raizn/cli
|
|
37
|
+
```
|
|
38
|
+
|
|
28
39
|
No browser on this machine (a server over SSH)? Create a token by hand in that Settings page and run
|
|
29
40
|
`raizn login --token`, or pipe it in with `echo "$TOKEN" | raizn login`.
|
|
30
41
|
|
|
31
42
|
**Releasing a new version** (maintainers): bump `version` in `packages/cli/package.json` in a PR,
|
|
32
|
-
merge it, then run the **Publish raizn CLI** workflow (GitHub → Actions).
|
|
33
|
-
|
|
43
|
+
merge it, then run the **Publish raizn CLI** workflow (GitHub → Actions). There is no npm token to
|
|
44
|
+
manage: npm trusts that workflow in this repo directly (trusted publishing, set on npmjs.com →
|
|
45
|
+
`@raizn/cli` → Settings).
|
|
34
46
|
|
|
35
47
|
Either way, `login` checks the token with the server before saving it, and prints who you are, the
|
|
36
48
|
stores the token can reach and its permissions. A token the server rejects is not saved.
|
|
@@ -65,7 +77,10 @@ raizn theme submit -m "Ramadan homepage" # send for approval; prints the admin
|
|
|
65
77
|
prints a diff (server vs yours) and exits 1. Merge the changes and push again, or use `--force`
|
|
66
78
|
to overwrite the server's copy.
|
|
67
79
|
- **preview** prints the signed preview link, and `--open` opens it in your browser.
|
|
68
|
-
- **submit** refuses while you have unpushed changes.
|
|
80
|
+
- **submit** refuses while you have unpushed changes. For **Raizn's own team** (a member of the Raizn
|
|
81
|
+
organisation with a @raizn.net / @raizn.com email) the server approves and publishes it in the same
|
|
82
|
+
step: `submit` says the change is **LIVE** and prints the request link, where Rollback is one click.
|
|
83
|
+
Everyone else's request waits for someone with publish rights. It prints the request id and
|
|
69
84
|
`https://ecom.raizn.com/themes/requests/<id>`.
|
|
70
85
|
|
|
71
86
|
### Custom sections
|
|
@@ -114,8 +129,8 @@ is never pulled for editing.
|
|
|
114
129
|
|
|
115
130
|
## What this can never do
|
|
116
131
|
|
|
117
|
-
- Publish, unpublish or roll back a theme or a section. `raizn theme publish` explains
|
|
118
|
-
publishing happens in the admin after approval.
|
|
132
|
+
- Publish, unpublish or roll back a theme or a section on its own. `raizn theme publish` explains
|
|
133
|
+
that publishing happens in the admin after approval (or, for the Raizn team, on `submit`).
|
|
119
134
|
- Write to the live theme. The server refuses it (`not_a_draft`), and the CLI refuses first.
|
|
120
135
|
- Reach anything but the theme: no orders, customers, staff or payments.
|
|
121
136
|
- Talk to any host but the configured API. `*.vercel.app` is refused (Jordanian ISPs reset those
|
package/dist/commands/theme.js
CHANGED
|
@@ -287,11 +287,20 @@ export async function themeSubmit(s, opts) {
|
|
|
287
287
|
}
|
|
288
288
|
const client = await s.client(state);
|
|
289
289
|
const r = await submitForApproval(client, state.store, state.themeId, title, opts.description);
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
if (r.
|
|
293
|
-
s
|
|
290
|
+
const link = `${apiOrigin(client.url)}/themes/requests/${encodeURIComponent(r.requestId)}`;
|
|
291
|
+
const sections = r.sections && r.sections.length > 0 ? r.sections.map((x) => `${x.type} v${x.version}`).join(", ") : null;
|
|
292
|
+
if (r.published) {
|
|
293
|
+
// Raizn's own team skips review: the server approved and published it in the same step.
|
|
294
|
+
s.out(`Published "${state.themeName}" — it is LIVE now (Raizn team changes skip review). Request ${r.requestId}`);
|
|
295
|
+
if (sections)
|
|
296
|
+
s.out(`These custom sections went live with it: ${sections}.`);
|
|
297
|
+
s.out(`Something wrong? Roll it back in one click: ${link}`);
|
|
298
|
+
return 0;
|
|
294
299
|
}
|
|
300
|
+
s.out(`Submitted "${state.themeName}" for approval: request ${r.requestId}`);
|
|
301
|
+
s.out(`Review it: ${link}`);
|
|
302
|
+
if (sections)
|
|
303
|
+
s.out(`These custom sections will go live with this request when it is published: ${sections}.`);
|
|
295
304
|
s.out("Nothing is live yet. Someone with publish rights approves and publishes it in the Raizn admin.");
|
|
296
305
|
return 0;
|
|
297
306
|
}
|
package/package.json
CHANGED