@nearform/fling 0.2.0 → 0.3.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/CHANGELOG.md ADDED
@@ -0,0 +1,32 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.3.0
6
+
7
+ **Breaking: no default server.** The CLI works with any Fling deployment, so it no longer has one
8
+ built in.
9
+
10
+ - `fling login <url>` (or `fling setup <url>`) signs in to the Fling at that address. The CLI
11
+ reads the server's `/.well-known/fling` (its name, sites domain, sign-in method) and remembers
12
+ both in `~/.fling/config.json`; later commands, and `fling login` without a URL, use them.
13
+ `FLING_URL` and `--server` still override it.
14
+ - Upgrading from 0.2: if you logged in with 0.2, nothing changes; the server you logged in to is
15
+ kept, and its metadata is fetched the first time it is needed. A config without a server (a new
16
+ machine, or a key set by hand) fails with `No Fling server set — run fling login <url> …`
17
+ instead of assuming a server.
18
+ - Site URLs shown before a deploy come from the server's metadata instead of being guessed from
19
+ the server URL.
20
+ - The local MCP server (`fling mcp`, the Claude Desktop extension) names your Fling and its sites
21
+ domain in its tool descriptions. The extension's **Fling server** setting has no built-in
22
+ default; the copy a Fling serves at `/downloads/fling.mcpb` has its address filled in.
23
+ - Comments: `fling comments`, `fling comment` (and `--reply`), `fling resolve`, `fling uncomment`;
24
+ the local MCP server gains `fling_comments_list`, `fling_comment_add`, `fling_comment_resolve`
25
+ and `fling_comment_delete` on an instance with the `comments` capability.
26
+ - On an instance with comments, a deploy (`fling deploy`, and the MCP server's `fling_deploy` and
27
+ `fling_publish`) also gives the review page, the link to share for feedback: in the output box,
28
+ as `reviewUrl` in `--json` and in the MCP result, where it leads.
29
+
30
+ ## 0.2.0
31
+
32
+ `fling setup`, a new look, and help by default.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Nearform
3
+ Copyright (c) 2026 Clifton Cunningham
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # @nearform/fling
2
2
 
3
- Fling a folder of static files at [fling.labs.nearform.com](https://fling.labs.nearform.com) and
4
- get a stable link back:
3
+ Fling a folder of static files at your Fling server and get a stable link back:
5
4
 
6
5
  ```
7
- https://<name>.fling.labs.nearform.com
6
+ https://<name>.<your sites domain>
8
7
  ```
9
8
 
10
- Site names are one global namespace, first come first served. Sites are private to signed-in Nearformers by default. Share links make them viewable by anyone
11
- who has the link.
9
+ Site names are one global namespace per server, first come first served. Sites are private to
10
+ people signed in to that Fling by default. Share links make them viewable by anyone who has the
11
+ link.
12
+
13
+ > **Upgrading from 0.2?** The CLI no longer has a built-in server. If you were logged in with 0.2
14
+ > it carries on with the server you logged in to. Otherwise (or on a new machine) run
15
+ > `fling login <url>` once with your Fling's address. See [CHANGELOG.md](CHANGELOG.md).
12
16
 
13
17
  ## Install
14
18
 
@@ -23,13 +27,14 @@ npx @nearform/fling …
23
27
  ## Set up
24
28
 
25
29
  ```sh
26
- fling setup
30
+ fling setup https://fling.example.com # your Fling's address; later runs can leave it out
27
31
  ```
28
32
 
29
33
  This does everything a new machine needs:
30
34
 
31
- 1. **Signs you in.** Your browser opens for Nearform Google sign-in and an API key is stored in
32
- `~/.fling/config.json` (mode 0600). This is skipped if you're already signed in.
35
+ 1. **Signs you in.** The CLI reads the server's `/.well-known/fling` (its name, where its sites
36
+ live, how people sign in) and remembers it. Your browser opens for sign-in and an API key is
37
+ stored in `~/.fling/config.json` (mode 0600). This is skipped if you're already signed in.
33
38
  2. **Adds Fling to Claude Code.** If `claude` is on your PATH, setup installs the Fling plugin
34
39
  (skill + MCP server) from the `nearform/fling` marketplace, or updates it if it's already
35
40
  installed. `--scope project|local` installs it for this project only (default `user`).
@@ -38,15 +43,17 @@ This does everything a new machine needs:
38
43
 
39
44
  On a terminal it asks before steps 2 and 3. With `--yes` it does them without asking.
40
45
 
41
- To sign in only, use `fling login`. `fling whoami` shows who you are, and `fling logout` removes the
42
- key. For CI, set `FLING_API_KEY` instead.
46
+ To sign in only, use `fling login <url>` (the URL is remembered: later `fling login` needs none).
47
+ There is no default server: until you log in, commands say to run `fling login <url>`.
48
+ `fling whoami` shows who you are, and `fling logout` removes the key (and keeps the server). For CI,
49
+ set `FLING_URL` and `FLING_API_KEY` instead.
43
50
 
44
51
  ## Deploy
45
52
 
46
53
  ```sh
47
54
  npm run build
48
55
  fling deploy ./dist # name generated from the project, e.g. rocketpod-docs; you confirm it
49
- fling deploy ./dist --name my-app # → https://my-app.fling.labs.nearform.com
56
+ fling deploy ./dist --name my-app # → https://my-app.<your sites domain>
50
57
  fling deploy ./dist --name my-app --spa # client-side routing: unknown paths serve index.html
51
58
  fling deploy ./dist --public # no sign-in needed to view
52
59
  fling deploy ./dist --yes # never prompt (CI): use the generated name as is
@@ -126,7 +133,7 @@ Without `--name`, the name is generated from the folder, never from your user na
126
133
  In a terminal, Fling checks the generated name and asks before deploying:
127
134
 
128
135
  ```
129
- fling Site name: rocketpod-docs → https://rocketpod-docs.fling.labs.nearform.com/ (new)
136
+ fling Site name: rocketpod-docs → https://rocketpod-docs.sites.example.com/ (new)
130
137
  Use "rocketpod-docs"? [Y/n or type another name]
131
138
  ```
132
139
 
@@ -162,8 +169,24 @@ and a taken name fails (exit 1) with suggestions rather than picking another nam
162
169
  | `fling archive <name>` / `fling unarchive <name>` | take offline and keep the files, or bring back |
163
170
  | `fling rm <name> [--yes]` | delete permanently |
164
171
 
165
- Global options: `--json` prints machine-readable output, and `--server <url>` points at another
166
- server. Exit codes are `0` ok, `1` error, `2` not logged in and `3` forbidden.
172
+ ## Comments
173
+
174
+ People review a site on its review page (`<your Fling>/review/<name>`, the **Review** button on the
175
+ sites page): the site beside its comments. Anyone signed in who can open the site can comment; the
176
+ CLI reads and writes the same threads. On a Fling with comments, `fling deploy` (and the MCP
177
+ server's `fling_deploy` / `fling_publish`) also prints the review page as the link to share for
178
+ feedback (`reviewUrl` in `--json`); reviewers sign in to use it.
179
+
180
+ | Command | |
181
+ |---|---|
182
+ | `fling comments <name> [--path <page>] [--all]` | open threads (with replies) by page; `--all` adds resolved ones |
183
+ | `fling comment <name> "text" [--path <page>]` | comment on a page (default `/`) |
184
+ | `fling comment <name> "text" --reply <id>` | reply to a thread |
185
+ | `fling resolve <name> <id> [--reopen]` | resolve a thread, or reopen it |
186
+ | `fling uncomment <name> <id> [--yes]` | delete a comment (a thread with its replies): your own, or any on your site |
187
+
188
+ Global options: `--json` prints machine-readable output, and `--server <url>` points one command at
189
+ another server. Exit codes are `0` ok, `1` error, `2` not logged in and `3` forbidden.
167
190
 
168
191
  Environment: `FLING_API_KEY`, `FLING_URL`, `FLING_CONFIG_DIR`, `FLING_DEBUG`, `FLING_DOWNLOADS_DIR`
169
192
  (where the MCP server looks for files given by name first), `FLING_NO_WAIT=1` (after a deploy or a new share
@@ -185,7 +208,9 @@ Or install it by hand in Claude Code:
185
208
  /plugin install fling@fling
186
209
  ```
187
210
 
188
- Log in once with `fling login` (or `npx @nearform/fling login` if it is not installed). The MCP server reuses that login.
211
+ Log in once with `fling login <url>` (or `npx @nearform/fling login <url>` if it is not installed).
212
+ The MCP server reuses that login, and its tool descriptions name your Fling and where its sites
213
+ live.
189
214
 
190
215
  The MCP tools:
191
216
 
@@ -215,20 +240,21 @@ For Claude Desktop (including Cowork), install the one-click extension. It runs
215
240
  on your computer, so Claude can fling files you downloaded or that Claude Desktop saved, by name,
216
241
  without uploading anything from Claude's sandbox.
217
242
 
218
- 1. Download [fling.mcpb](https://fling.labs.nearform.com/downloads/fling.mcpb).
243
+ 1. Download `fling.mcpb` from your Fling (Get started → Download, or `https://<your Fling>/downloads/fling.mcpb`).
219
244
  2. Double-click it, or drag it into Claude Desktop, or go to **Settings → Extensions → Advanced
220
245
  settings → Install Extension…** and pick the file.
221
- 3. Optional settings: **Fling server** (default `https://fling.labs.nearform.com`) and **Downloads
222
- folder** (default `~/Downloads`).
246
+ 3. Optional settings: **Fling server** (filled in with the Fling you downloaded it from; empty means
247
+ the one the CLI is logged in to) and **Downloads folder** (default `~/Downloads`).
223
248
  4. Ask Claude to "fling Pitch Deck.html from my Downloads". If you're not signed in, Claude calls
224
249
  `fling_login` and your browser opens. The extension and the CLI share the login in
225
250
  `~/.fling/config.json`.
226
251
 
227
252
  It needs Node.js 20 or later, which Claude Desktop provides, on macOS or Windows.
228
253
 
229
- Build it with `pnpm --filter @nearform/fling build:mcpb`. That bundles `src/mcp-entry.ts` and every
230
- dependency into one file, then validates and packs `mcpb/manifest.json` into `dist/fling.mcpb`.
231
- CI publishes it at `/downloads/fling.mcpb`.
254
+ Build it with `pnpm --filter ./apps/cli build:mcpb`. That bundles `src/mcp-entry.ts` and every
255
+ dependency into one file, then validates and packs `mcpb/manifest.json` into `dist/fling.mcpb`
256
+ (`FLING_MCPB_SERVER_URL` sets the **Fling server** default). A deploy publishes it at
257
+ `/downloads/fling.mcpb`.
232
258
 
233
259
  To use the MCP server in another client, run it over stdio:
234
260
 
@@ -241,7 +267,7 @@ To use the MCP server in another client, run it over stdio:
241
267
  From the repo root:
242
268
 
243
269
  ```sh
244
- pnpm cli --server http://localhost:3001 login # against `pnpm dev`
245
- pnpm --filter @nearform/fling test
246
- pnpm --filter @nearform/fling build # → dist/cli.js
270
+ pnpm cli login http://localhost:47101 # against `pnpm dev`
271
+ pnpm --filter ./apps/cli test
272
+ pnpm --filter ./apps/cli build # → dist/cli.js
247
273
  ```