@nearform/fling 0.1.1 → 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 +52 -24
- package/dist/cli.js +1253 -461
- package/dist/cli.js.map +4 -4
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -20,55 +20,77 @@ npm install -g @nearform/fling # then: fling …
|
|
|
20
20
|
npx @nearform/fling …
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Set up
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
fling
|
|
26
|
+
fling setup
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
This
|
|
30
|
-
|
|
29
|
+
This does everything a new machine needs:
|
|
30
|
+
|
|
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.
|
|
33
|
+
2. **Adds Fling to Claude Code.** If `claude` is on your PATH, setup installs the Fling plugin
|
|
34
|
+
(skill + MCP server) from the `nearform/fling` marketplace, or updates it if it's already
|
|
35
|
+
installed. `--scope project|local` installs it for this project only (default `user`).
|
|
36
|
+
3. **Adds Fling to Claude Desktop.** If Claude Desktop is installed (macOS, Windows), setup
|
|
37
|
+
downloads `fling.mcpb` and opens it, and Claude Desktop asks you to confirm.
|
|
38
|
+
|
|
39
|
+
On a terminal it asks before steps 2 and 3. With `--yes` it does them without asking.
|
|
40
|
+
|
|
41
|
+
To sign in only, use `fling login`. `fling whoami` shows who you are, and `fling logout` removes the
|
|
31
42
|
key. For CI, set `FLING_API_KEY` instead.
|
|
32
43
|
|
|
33
44
|
## Deploy
|
|
34
45
|
|
|
35
46
|
```sh
|
|
36
47
|
npm run build
|
|
37
|
-
fling ./dist # name generated from the project, e.g. rocketpod-docs; you confirm it
|
|
38
|
-
fling ./dist --name my-app # → https://my-app.fling.labs.nearform.com
|
|
39
|
-
fling ./dist --name my-app --spa # client-side routing: unknown paths serve index.html
|
|
40
|
-
fling ./dist --public # no sign-in needed to view
|
|
41
|
-
fling ./dist --yes # never prompt (CI): use the generated name as is
|
|
42
|
-
fling # deploys the current folder
|
|
43
|
-
fling "Pitch Deck.html" # a single page, served as index.html → pitch-deck
|
|
44
|
-
fling site.zip # a zip of a site: extracted, a single top folder unwrapped
|
|
45
|
-
fling diagram.svg # any other file, next to a generated page that shows it
|
|
48
|
+
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
|
|
50
|
+
fling deploy ./dist --name my-app --spa # client-side routing: unknown paths serve index.html
|
|
51
|
+
fling deploy ./dist --public # no sign-in needed to view
|
|
52
|
+
fling deploy ./dist --yes # never prompt (CI): use the generated name as is
|
|
53
|
+
fling deploy # deploys the current folder
|
|
54
|
+
fling deploy "Pitch Deck.html" # a single page, served as index.html → pitch-deck
|
|
55
|
+
fling deploy site.zip # a zip of a site: extracted, a single top folder unwrapped
|
|
56
|
+
fling deploy diagram.svg # any other file, next to a generated page that shows it
|
|
46
57
|
```
|
|
47
58
|
|
|
59
|
+
`fling <path>` is short for `fling deploy <path>` when the path exists, so `fling ./dist` works.
|
|
60
|
+
An existing path wins over a command of the same name. Bare `fling` prints help.
|
|
61
|
+
|
|
48
62
|
What you can fling:
|
|
49
63
|
|
|
50
64
|
- **A folder**, as is.
|
|
51
65
|
- **A single `.html`/`.htm` file**, served as the site's `index.html`.
|
|
52
66
|
- **A `.zip`**: extracted (paths that would escape the folder are refused), `__MACOSX/` and dotfiles
|
|
53
|
-
skipped, and a single top-level folder unwrapped.
|
|
67
|
+
skipped (dotfiles such as `.env` are listed), and a single top-level folder unwrapped.
|
|
54
68
|
- **Any other file** (`.pdf`, `.svg`, `.png`, `.md`…), served next to a small generated `index.html`
|
|
55
69
|
that shows it (images, PDF, video, audio) or links to it.
|
|
56
70
|
|
|
57
71
|
A file's default site name comes from its name, without the extension or a browser's ` (1)`
|
|
58
72
|
duplicate suffix: `Pitch Deck (1).html` → `pitch-deck`. Folders use the naming rules below.
|
|
59
73
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
`~/Documents/Claude`, `~/Claude` and Claude Desktop's output folders, and says where it found it:
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
$ fling Pitch-Deck.html
|
|
66
|
-
fling Found in Downloads: /Users/me/Downloads/Pitch-Deck.html
|
|
67
|
-
```
|
|
74
|
+
The path must exist where you give it. The CLI doesn't look for files elsewhere (the MCP server
|
|
75
|
+
does; see below).
|
|
68
76
|
|
|
69
77
|
- Re-fling to update. Identical content is a no-op, and content you deployed before is restored
|
|
70
78
|
instantly without uploading.
|
|
71
|
-
-
|
|
79
|
+
- **Fling never publishes dotfiles, gitignored files, secret files (keys, certs, credentials) or
|
|
80
|
+
files that contain secrets; it stops and tells you which file and line.** There is no flag to
|
|
81
|
+
override this, and the server enforces it too.
|
|
82
|
+
- Dotfiles and dot-folders (`.env`, `.dev.vars`, `.npmrc`, `.git/`, `.well-known/`…) are skipped,
|
|
83
|
+
and the output lists what was skipped (`skipped` in `--json`).
|
|
84
|
+
- Gitignored files are skipped. When the folder you fling is itself gitignored (the usual
|
|
85
|
+
`dist/` or `build/`), only the `.gitignore` files inside it apply.
|
|
86
|
+
- Secret files by name (`*.pem`, `*.key`, `*.p12`, `*.pfx`, `*.jks`, `*.keystore`, `id_rsa`…,
|
|
87
|
+
`credentials(.json)`, `*service-account*.json`, `*.tfstate`, `*.tfvars`, `secrets.json/yml`,
|
|
88
|
+
`*.kdbx`, `wp-config.php`) stop the fling.
|
|
89
|
+
- Files that contain a secret (private keys, AWS / GitHub / npm / Slack / Stripe / OpenAI /
|
|
90
|
+
Anthropic / SendGrid / Azure keys and tokens, Google OAuth client secrets, database URLs with a
|
|
91
|
+
password) stop the fling with the file, line and kind of secret (never the secret itself).
|
|
92
|
+
Remove the secret (and rotate it if it was ever shared), or add the file to `.flingignore`.
|
|
93
|
+
- `node_modules` and anything listed in a `.flingignore` (gitignore syntax) are skipped too.
|
|
72
94
|
Symlinks pointing outside the folder are never followed.
|
|
73
95
|
- Limits are 25 MB per file, 100 MB per deploy and 5,000 files.
|
|
74
96
|
- Absolute asset paths (`/assets/x.js`) work because each site has its own subdomain.
|
|
@@ -144,7 +166,7 @@ Global options: `--json` prints machine-readable output, and `--server <url>` po
|
|
|
144
166
|
server. Exit codes are `0` ok, `1` error, `2` not logged in and `3` forbidden.
|
|
145
167
|
|
|
146
168
|
Environment: `FLING_API_KEY`, `FLING_URL`, `FLING_CONFIG_DIR`, `FLING_DEBUG`, `FLING_DOWNLOADS_DIR`
|
|
147
|
-
(where files given by name
|
|
169
|
+
(where the MCP server looks for files given by name first), `FLING_NO_WAIT=1` (after a deploy or a new share
|
|
148
170
|
link, don't wait the few seconds it takes to reach every edge).
|
|
149
171
|
|
|
150
172
|
## Claude Code plugin and MCP
|
|
@@ -152,6 +174,12 @@ link, don't wait the few seconds it takes to reach every edge).
|
|
|
152
174
|
The Fling plugin gives Claude a `fling` skill plus an MCP server (`fling mcp`), so you can say
|
|
153
175
|
"fling the dist folder and give me a share link":
|
|
154
176
|
|
|
177
|
+
```sh
|
|
178
|
+
fling setup
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Or install it by hand in Claude Code:
|
|
182
|
+
|
|
155
183
|
```
|
|
156
184
|
/plugin marketplace add nearform/fling
|
|
157
185
|
/plugin install fling@fling
|