@nearform/fling 0.9.0 → 0.10.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 +70 -20
- package/dist/cli.js +1163 -195
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -145,7 +145,9 @@ What you can fling:
|
|
|
145
145
|
- **A single `.html`/`.htm` file**, served as the site's `index.html`.
|
|
146
146
|
- **A `.zip`**: extracted (paths that would escape the folder are refused), `__MACOSX/` and dotfiles
|
|
147
147
|
skipped (dotfiles such as `.env` are listed), and a single top-level folder unwrapped.
|
|
148
|
-
- **
|
|
148
|
+
- **A single Markdown file** (`.md`, `.markdown`), on a Fling that renders Markdown (the
|
|
149
|
+
`markdown` capability): its rendered page is the site's home page.
|
|
150
|
+
- **Any other file** (`.pdf`, `.svg`, `.png`…), served next to a small generated `index.html`
|
|
149
151
|
that shows it (images, PDF, video, audio) or links to it.
|
|
150
152
|
|
|
151
153
|
A file's default site name comes from its name, without the extension or a browser's ` (1)`
|
|
@@ -156,21 +158,23 @@ does; see below).
|
|
|
156
158
|
|
|
157
159
|
- Re-fling to update. Identical content is a no-op, and content you deployed before is restored
|
|
158
160
|
instantly without uploading.
|
|
159
|
-
- **Publish one folder of a site** with `--path` (and `--name`): `fling deploy ./
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
- **Publish one folder of a site as its Path** with `--path` (and `--name`): `fling deploy ./plan
|
|
162
|
+
--name payments-plans --path PAY-412` serves the plan at `https://payments-plans.<sites
|
|
163
|
+
domain>/PAY-412/`. A Path is one top-level folder with its own versions, rollback, owners and
|
|
164
|
+
publishers; publishing it never touches the rest of the site or its other Paths, so teammates
|
|
165
|
+
publishing different Paths never collide. The first publish makes the Path, with you as its
|
|
166
|
+
owner. `--path` takes one folder: nested folders (`reports/2026`) are refused, so publish them as
|
|
167
|
+
part of their top-level folder. A folder pulled with `fling pull --path` deploys back to its
|
|
168
|
+
Path. On a Fling without path publishing (`pathPublish`) the CLI refuses rather than replace the
|
|
169
|
+
whole site. See [Paths](#paths).
|
|
166
170
|
- **Change a site you can open** with `fling pull <name> [dir]`: it downloads the current version
|
|
167
171
|
into `dir` (default `./<name>`) with a site link, `.fling-site.json`, naming the server, the site
|
|
168
172
|
and the version pulled. `fling deploy <dir>` then publishes to that site on that version and
|
|
169
173
|
uploads only what changed (`3 changed, 1 removed`). If someone published the site since you
|
|
170
174
|
pulled, it stops (`base_changed`) rather than overwrite their work: pull again into another
|
|
171
175
|
folder and redo your change, or `fling deploy <dir> --force` to replace what they published.
|
|
172
|
-
`--path <folder>` pulls one
|
|
173
|
-
publishers). Anyone signed in who can open the site may pull it; only its owners and publishers
|
|
176
|
+
`--path <folder>` pulls one of the site's Paths, its files at the top of `dir`; `--version-id
|
|
177
|
+
<id>` another version (owners and publishers). Anyone signed in who can open the site may pull it; only its owners and publishers
|
|
174
178
|
may deploy. A folder that isn't empty needs `--force`. On a Fling without the `pull` capability
|
|
175
179
|
the CLI says so.
|
|
176
180
|
- **Fling never publishes dotfiles, gitignored files, secret files (keys, certs, credentials) or
|
|
@@ -252,15 +256,15 @@ and a taken name fails (exit 1) with suggestions rather than picking another nam
|
|
|
252
256
|
|---|---|
|
|
253
257
|
| `fling ls [--archived] [--sort updated\|created\|name]` | your sites, last updated first (`created`: newest first; `name`: A–Z) |
|
|
254
258
|
| `fling ls --shared [--sort …]` | the restricted sites others have shared with you: owner, and how (your address or a group) |
|
|
255
|
-
| `fling info <name>` / `fling versions <name
|
|
259
|
+
| `fling info <name>` / `fling versions <name> [--path <folder>]` | details and version history, with who published each version; `--path`: a Path's own versions |
|
|
256
260
|
| `fling pull <name> [dir] [--path <folder>] [--version-id <id>] [--force]` | download a site's files to change them; `fling deploy <dir>` publishes on the version pulled |
|
|
257
|
-
| `fling files <name> [versionId]` | the files in the live version (or an earlier one) |
|
|
258
|
-
| `fling rollback <name> <versionId
|
|
261
|
+
| `fling files <name> [versionId] [--path <folder>]` | the files in the live version (or an earlier one), or a Path's |
|
|
262
|
+
| `fling rollback <name> <versionId> [--path <folder>]` | serve an earlier version (of the site, or of one Path) |
|
|
259
263
|
| `fling share <name> [--refresh] [--revoke]` | public share link: print or create it, rotate it, or remove it |
|
|
260
264
|
| `fling visibility <name> private\|public` | require sign-in, or not (private again: the access it had) |
|
|
261
265
|
| `fling access <name> [--only-me \| --members \| --public] [--add <emails>] [--remove <emails>] [--group <slugs>] [--remove-group <slugs>] [--clear]` | who can open a site: only you, listed people and groups, everyone signed in, or anyone |
|
|
262
|
-
| `fling owners <name> [--add <emails>] [--remove <emails>] [--set <emails>] [--group <slugs>] [--remove-group <slugs>]` | who owns a site, or change it |
|
|
263
|
-
| `fling publishers <name> [--add …] [--remove …] [--set …] [--group …] [--remove-group …]` | who publishes a site without owning it, or change it |
|
|
266
|
+
| `fling owners <name> [--add <emails>] [--remove <emails>] [--set <emails>] [--group <slugs>] [--remove-group <slugs>] [--path <folder>]` | who owns a site (or a Path), or change it |
|
|
267
|
+
| `fling publishers <name> [--add …] [--remove …] [--set …] [--group …] [--remove-group …] [--path <folder>]` | who publishes a site (or a Path) without owning it, or change it |
|
|
264
268
|
| `fling archive <name>` / `fling unarchive <name>` | take offline and keep the files, or bring back |
|
|
265
269
|
| `fling rm <name> [--yes]` | delete permanently |
|
|
266
270
|
|
|
@@ -338,6 +342,46 @@ admin for an admin's view), and `fling info` its Owners, Publishers and You. As
|
|
|
338
342
|
commands print `{ name, role, owners, publishers }`, each list `{ emails: [{ email, known, guest?
|
|
339
343
|
}], groups: [{ slug, name, size }] }`.
|
|
340
344
|
|
|
345
|
+
### Paths
|
|
346
|
+
|
|
347
|
+
A **Path** is a top-level folder of a site published on its own, such as one plan per ticket on a
|
|
348
|
+
team's site: `fling deploy ./plan --name payments-plans --path PAY-412`. Each Path has its own
|
|
349
|
+
versions, rollback, owners and publishers, and is served at `<site>/<folder>/`. Who can open it is
|
|
350
|
+
the site's. Its owners and publishers, and the site's owners, can publish it, roll it back and
|
|
351
|
+
change it; the site's publishers can make new Paths. On a Fling with Paths (the `paths`
|
|
352
|
+
capability):
|
|
353
|
+
|
|
354
|
+
```sh
|
|
355
|
+
fling paths payments-plans # its Paths: folder, title, version, state, can you publish, updated
|
|
356
|
+
fling versions payments-plans --path PAY-412 # the Path's own versions (* = live)
|
|
357
|
+
fling files payments-plans --path PAY-412 # the files of its live version (or give a version id)
|
|
358
|
+
fling rollback payments-plans <versionId> --path PAY-412 # roll back only the Path
|
|
359
|
+
fling owners payments-plans --path PAY-412 --add cat@example.com
|
|
360
|
+
fling publishers payments-plans --path PAY-412 --add bob@example.com
|
|
361
|
+
fling paths archive payments-plans PAY-412 # take it off the site (404), keep its versions; `paths unarchive` brings it back
|
|
362
|
+
fling paths delete payments-plans PAY-412 # delete it and its versions (asks first unless --yes)
|
|
363
|
+
fling pull payments-plans --path PAY-412 # its files, to change and deploy back to the Path
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
**The home page.** A site's home page (its root `index.html`) can list its Paths, three ways:
|
|
367
|
+
|
|
368
|
+
- **Default**: with no `index.html` of its own, the site's home page is a listing of its live
|
|
369
|
+
Paths. A site whose first publish is a Path gets one. Nothing to do.
|
|
370
|
+
- **Custom**: your own `index.html` with a Paths block, which Fling fills with the live Paths
|
|
371
|
+
whenever one changes (and serves as JSON at `/_fling-paths.json`). `fling paths init [dir]
|
|
372
|
+
--template plans|docs|reports|minimal [--title T]` writes a starter (it never replaces an
|
|
373
|
+
`index.html` without `--force`); adapt it, keeping the block, check it with `fling paths check
|
|
374
|
+
[dir|file]` (errors exit 1, warnings are printed), then deploy the folder as the site root,
|
|
375
|
+
without `--path`. The block is the bare marker `<!-- fling:paths -->` (Fling's default list,
|
|
376
|
+
styled by your page) or a template, `<!-- fling:paths sort=updated --> <a href="{{href}}">{{title}}</a>
|
|
377
|
+
<!-- fling:empty --> None yet. <!-- /fling:paths -->`, whose item repeats per Path with
|
|
378
|
+
`{{href}} {{folder}} {{title}} {{updated}} {{date}} {{version}}`. Options: `sort=updated|oldest|folder|folder-desc`,
|
|
379
|
+
`nocontrols`, `nostyle`; `<!-- fling:paths-controls -->` places the search and sort controls.
|
|
380
|
+
- **None**: an `index.html` without a Paths block lists no Paths, and a deploy says so.
|
|
381
|
+
|
|
382
|
+
With `--json`, `fling paths` prints `{ name, paths: [{ folder, title, url, currentVersionId,
|
|
383
|
+
archived, owners?, publishers?, canPublish, createdAt, updatedAt }] }`.
|
|
384
|
+
|
|
341
385
|
### Groups
|
|
342
386
|
|
|
343
387
|
A group is a named list of people, such as a team, that anyone signed in can use in a site's
|
|
@@ -397,8 +441,10 @@ fling responses my-app --format csv -o labels.csv # the export: json, j
|
|
|
397
441
|
- `fling deploy` checks the file against the folder's pages and stops on errors. After the deploy
|
|
398
442
|
it lists each form and the pages it applies to (`forms` in `--json`). Without the file, it ends
|
|
399
443
|
with one line on adding a form (`formsHint` in `--json`; `--quiet` leaves it out).
|
|
400
|
-
- Without the file, deploying a whole site removes its forms. A
|
|
401
|
-
|
|
444
|
+
- Without the file, deploying a whole site removes its forms. A pulled folder keeps them, unless it
|
|
445
|
+
was pulled with a `fling.forms.json` you have since deleted. Forms are the site's: a `--path`
|
|
446
|
+
deploy leaves them as they are and refuses a folder with `fling.forms.json`. Deploy the forms with
|
|
447
|
+
the site's root, with `paths` patterns that reach the Path's pages (`PAY-412/**`).
|
|
402
448
|
- `fling pull` writes the site's `fling.forms.json` back into the folder.
|
|
403
449
|
- On a form with `"visibility": "own"`, reviewers see only their own answers; the site's owners see
|
|
404
450
|
everyone's.
|
|
@@ -474,14 +520,14 @@ accepts).
|
|
|
474
520
|
The MCP tools:
|
|
475
521
|
|
|
476
522
|
- `fling_deploy`: a folder, `.html`, `.zip` or other file on this computer, by path or just its
|
|
477
|
-
name (looked up like the CLI does). `sitePath` (with `name`) publishes it
|
|
478
|
-
site
|
|
523
|
+
name (looked up like the CLI does). `sitePath` (with `name`) publishes it as that Path of the
|
|
524
|
+
site, the rest untouched, like `--path`. A folder pulled with `fling pull` or `fling_pull` deploys
|
|
479
525
|
on the version pulled, like the CLI; `force: true` publishes over whatever is live.
|
|
480
526
|
- `fling_pull`: downloads a site into a folder on this computer (default
|
|
481
527
|
`~/Documents/Claude/fling/<name>`) to change it and deploy it again with `fling_deploy`.
|
|
482
528
|
- `fling_read_files`: a site's files inline, a page at a time, for reading without a download.
|
|
483
529
|
- `fling_publish`: files passed inline, for content Claude wrote in the conversation. It has the same
|
|
484
|
-
definition as the remote connector's tool; `path` publishes them
|
|
530
|
+
definition as the remote connector's tool; `path` publishes them as that Path of the site;
|
|
485
531
|
`base` (a version from `fling_read_files`) sends only the files that changed, and `remove` names
|
|
486
532
|
files to delete.
|
|
487
533
|
- `fling_find_files`: recent `.html`/`.zip` files and folders with an `index.html` in those folders,
|
|
@@ -493,6 +539,10 @@ The MCP tools:
|
|
|
493
539
|
current), read when called. `{use: <server>}` makes one current, the same as `fling use`.
|
|
494
540
|
- `fling_doctor`: the checks of `fling doctor`, read-only, as lines and data. Claude calls it when
|
|
495
541
|
something about Fling doesn't work (sign-in, tools missing, versions) and tells you the fixes.
|
|
542
|
+
- `fling_paths` (a site's Paths, and what its home page does with them) where a Fling has Paths,
|
|
543
|
+
and `fling_paths_template` and `fling_paths_check` (a starter home page with a Paths block, and
|
|
544
|
+
its check), which need no Fling. `fling_info`, `fling_files` and `fling_rollback` take `path` to
|
|
545
|
+
act on one Path.
|
|
496
546
|
- `fling_check_name`, `fling_list`, `fling_info`, `fling_files`, `fling_share`,
|
|
497
547
|
`fling_set_visibility`, `fling_archive`, `fling_rollback`, `fling_delete` (needs
|
|
498
548
|
`confirm: true`), `fling_whoami`, the comment tools when a Fling has comments, the forms tools when it has forms
|