shiply-cli 0.14.3 → 0.14.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/README.md +9 -1
- package/dist/claim.js +17 -5
- package/dist/index.js +3 -0
- package/dist/publish.js +1 -0
- package/package.json +1 -1
- package/skill/SKILL.md +10 -1
package/README.md
CHANGED
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
Publish static sites to [shiply.now](https://shiply.now) from the command line —
|
|
4
4
|
instant web hosting built for agents.
|
|
5
5
|
|
|
6
|
+
> **The npm package is `shiply-cli`, not `shiply`.** A different npm package
|
|
7
|
+
> named `shiply` (an unrelated auto-commit watcher) is published by someone
|
|
8
|
+
> else — installing it does NOT give you the shiply.now CLI. Always use
|
|
9
|
+
> `shiply-cli`. The binary on PATH is still named `shiply` after install;
|
|
10
|
+
> the warning is only about the npm package name.
|
|
11
|
+
|
|
6
12
|
```bash
|
|
7
13
|
npm install -g shiply-cli
|
|
8
|
-
# or
|
|
14
|
+
# or, no install:
|
|
15
|
+
npx -y shiply-cli@latest publish ./dist
|
|
16
|
+
# or, install script:
|
|
9
17
|
curl -fsSL https://shiply.now/install.sh | bash
|
|
10
18
|
```
|
|
11
19
|
|
package/dist/claim.js
CHANGED
|
@@ -13,20 +13,32 @@ export async function runClaimVerify(args) {
|
|
|
13
13
|
message: 'No .shiply.json in current directory. Run from the directory where you published, or rerun `shiply publish`.',
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
if (!mf.
|
|
17
|
-
return { ok: false, message: '.shiply.json is missing
|
|
16
|
+
if (!mf.claimToken) {
|
|
17
|
+
return { ok: false, message: '.shiply.json is missing claimToken.' };
|
|
18
|
+
}
|
|
19
|
+
// Anonymous publishes prior to 0.14.4 didn't write siteId to .shiply.json,
|
|
20
|
+
// and the publish API didn't return it either. The server now accepts EITHER
|
|
21
|
+
// {siteId, claimToken} or {slug, claimToken} — fall back to slug when the
|
|
22
|
+
// local state file came from an older CLI.
|
|
23
|
+
if (!mf.siteId && !mf.slug) {
|
|
24
|
+
return { ok: false, message: '.shiply.json is missing siteId or slug.' };
|
|
18
25
|
}
|
|
19
26
|
if (!/^SHIPLY-[A-Z2-7]{8}$/.test(args.code)) {
|
|
20
27
|
return { ok: false, message: 'Invalid code format. Expected SHIPLY-XXXXXXXX.' };
|
|
21
28
|
}
|
|
29
|
+
const body = { claimToken: mf.claimToken };
|
|
30
|
+
if (mf.siteId)
|
|
31
|
+
body.siteId = mf.siteId;
|
|
32
|
+
else if (mf.slug)
|
|
33
|
+
body.slug = mf.slug;
|
|
22
34
|
const res = await fetch(`${origin}/api/v1/claim/pair/${encodeURIComponent(args.code)}/verify`, {
|
|
23
35
|
method: 'POST',
|
|
24
36
|
headers: { 'content-type': 'application/json' },
|
|
25
|
-
body: JSON.stringify(
|
|
37
|
+
body: JSON.stringify(body),
|
|
26
38
|
});
|
|
27
39
|
if (!res.ok) {
|
|
28
|
-
const
|
|
29
|
-
return { ok: false, message: `verify failed: ${
|
|
40
|
+
const errBody = (await res.json().catch(() => ({})));
|
|
41
|
+
return { ok: false, message: `verify failed: ${errBody.error?.message ?? res.status}` };
|
|
30
42
|
}
|
|
31
43
|
return { ok: true, message: 'Verified — switch back to your browser to finish claiming.' };
|
|
32
44
|
}
|
package/dist/index.js
CHANGED
|
@@ -256,6 +256,9 @@ async function main() {
|
|
|
256
256
|
await writeState(publishDir, {
|
|
257
257
|
slug: res.slug,
|
|
258
258
|
siteUrl: res.siteUrl,
|
|
259
|
+
// siteId only present on 0.14.4+ servers — prefer the new response,
|
|
260
|
+
// fall back to a prior state file so re-publishes don't drop it.
|
|
261
|
+
...(res.siteId ? { siteId: res.siteId } : state?.siteId ? { siteId: state.siteId } : {}),
|
|
259
262
|
...(res.claimToken ? { claimToken: res.claimToken } : state?.claimToken && updating ? { claimToken: state.claimToken } : {}),
|
|
260
263
|
owned: !res.anonymous,
|
|
261
264
|
...(state?.databaseId ? { databaseId: state.databaseId } : {}),
|
package/dist/publish.js
CHANGED
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -5,6 +5,13 @@ description: Publish static sites to the web instantly with shiply.now and manag
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
> **IMPORTANT — npm package name is `shiply-cli`, NOT `shiply`.** A different
|
|
9
|
+
> npm package named `shiply` (an auto-commit watcher) is published by someone
|
|
10
|
+
> else — installing it does NOT give you the shiply.now CLI. Always use
|
|
11
|
+
> `npx -y shiply-cli@latest …` or `npm install -g shiply-cli`. The CLI binary
|
|
12
|
+
> on PATH is still named `shiply` once installed; the warning is only about
|
|
13
|
+
> the npm package name.
|
|
14
|
+
|
|
8
15
|
> **Skill freshness check.** Shiply ships new capabilities weekly. If this
|
|
9
16
|
> file's "Last updated" below is more than 7 days old, re-install it with
|
|
10
17
|
> `npx -y shiply-cli@latest skill --force` OR fetch `https://shiply.now/skill.md`
|
|
@@ -122,7 +129,9 @@ Newer capabilities (use when relevant):
|
|
|
122
129
|
|
|
123
130
|
### 2. CLI
|
|
124
131
|
```bash
|
|
125
|
-
npm
|
|
132
|
+
# IMPORTANT: the npm package is `shiply-cli`, not `shiply` (different package).
|
|
133
|
+
npm i -g shiply-cli # or: npx -y shiply-cli@latest <command>
|
|
134
|
+
# or: curl -fsSL https://shiply.now/install.sh | bash
|
|
126
135
|
shiply publish ./dir # live URL + confetti
|
|
127
136
|
shiply publish ./dir # run AGAIN after edits → updates the SAME site
|
|
128
137
|
shiply status <slug> --wait # SSL + readiness; prints SSL_READY / SITE_READY
|