flingit 0.0.46 → 0.0.48
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/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/dev.js +21 -14
- package/dist/cli/commands/dev.js.map +1 -1
- package/dist/cli/commands/launch.d.ts.map +1 -1
- package/dist/cli/commands/launch.js +8 -6
- package/dist/cli/commands/launch.js.map +1 -1
- package/dist/cli/commands/push.d.ts.map +1 -1
- package/dist/cli/commands/push.js +13 -1
- package/dist/cli/commands/push.js.map +1 -1
- package/dist/cli/commands/signup.d.ts.map +1 -1
- package/dist/cli/commands/signup.js +10 -0
- package/dist/cli/commands/signup.js.map +1 -1
- package/dist/cli/commands/whoami.d.ts.map +1 -1
- package/dist/cli/commands/whoami.js +13 -0
- package/dist/cli/commands/whoami.js.map +1 -1
- package/dist/cli/deploy/bundler.d.ts +5 -0
- package/dist/cli/deploy/bundler.d.ts.map +1 -1
- package/dist/cli/deploy/bundler.js +7 -3
- package/dist/cli/deploy/bundler.js.map +1 -1
- package/dist/cli/utils/email.js +1 -1
- package/dist/cli/utils/email.js.map +1 -1
- package/dist/runtime/email.d.ts.map +1 -1
- package/dist/runtime/email.js +2 -1
- package/dist/runtime/email.js.map +1 -1
- package/dist/worker-runtime/entry-extract.d.ts.map +1 -1
- package/dist/worker-runtime/entry-extract.js +3 -2
- package/dist/worker-runtime/entry-extract.js.map +1 -1
- package/dist/worker-runtime/index.d.ts +9 -0
- package/dist/worker-runtime/index.d.ts.map +1 -1
- package/dist/worker-runtime/index.js +13 -1
- package/dist/worker-runtime/index.js.map +1 -1
- package/package.json +3 -3
- package/templates/default/dot-claude/settings.local.json +1 -1
- package/templates/default/dot-claude/skills/fling/.hash +1 -1
- package/templates/default/dot-claude/skills/fling/SKILL.md +47 -45
- package/templates/default/dot-claude/skills/fling/references/API.md +13 -13
- package/templates/default/dot-claude/skills/fling/references/DISCORD.md +6 -6
- package/templates/default/dot-claude/skills/fling/references/EMAIL-INBOUND.md +111 -0
- package/templates/default/dot-claude/skills/fling/references/FEEDBACK.md +3 -3
- package/templates/default/dot-claude/skills/fling/references/GH-ACTION.md +1 -1
- package/templates/default/dot-claude/skills/fling/references/SLACK.md +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/runtime/email.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAIlE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/runtime/email.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAIlE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAOnD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,YAAY,GAAG,IAAI,CAErD"}
|
package/dist/runtime/email.js
CHANGED
|
@@ -29,7 +29,8 @@ let emailHandler = null;
|
|
|
29
29
|
*/
|
|
30
30
|
export function onEmail(handler) {
|
|
31
31
|
if (emailHandler) {
|
|
32
|
-
|
|
32
|
+
console.warn("Warning: onEmail() called multiple times. Only one handler is allowed — using the first one.");
|
|
33
|
+
return;
|
|
33
34
|
}
|
|
34
35
|
emailHandler = handler;
|
|
35
36
|
console.log("[email] Handler registered");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/runtime/email.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,IAAI,YAAY,GAAwB,IAAI,CAAC;AAE7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,OAAO,CAAC,OAAqB;IAC3C,IAAI,YAAY,EAAE,CAAC;QACjB,
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/runtime/email.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,IAAI,YAAY,GAAwB,IAAI,CAAC;AAE7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,OAAO,CAAC,OAAqB;IAC3C,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,8FAA8F,CAAC,CAAC;QAC7G,OAAO;IACT,CAAC;IACD,YAAY,GAAG,OAAO,CAAC;IACvB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-extract.d.ts","sourceRoot":"","sources":["../../src/worker-runtime/entry-extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAwFH;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"entry-extract.d.ts","sourceRoot":"","sources":["../../src/worker-runtime/entry-extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAwFH;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BxF"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
|
-
import { __initEnv, __getCronMetadata } from "./index.js";
|
|
14
|
+
import { __initEnv, __getCronMetadata, __getEmailMetadata } from "./index.js";
|
|
15
15
|
import { getAllPluginMetadata } from "./plugin-registry.js";
|
|
16
16
|
/**
|
|
17
17
|
* Create a stub D1 database that returns empty results for all operations.
|
|
@@ -115,7 +115,8 @@ export async function extractMetadata(loadUserApp) {
|
|
|
115
115
|
// Collect metadata from all sources
|
|
116
116
|
const cronSchedules = __getCronMetadata();
|
|
117
117
|
const plugins = getAllPluginMetadata();
|
|
118
|
-
const
|
|
118
|
+
const email = __getEmailMetadata();
|
|
119
|
+
const metadata = { cronSchedules, plugins, email };
|
|
119
120
|
// Output with marker so the CLI can parse it from potentially noisy stdout
|
|
120
121
|
const json = JSON.stringify(metadata);
|
|
121
122
|
process.stdout.write(`__FLING_METADATA_START__${json}\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-extract.js","sourceRoot":"","sources":["../../src/worker-runtime/entry-extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"entry-extract.js","sourceRoot":"","sources":["../../src/worker-runtime/entry-extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;GAIG;AACH,SAAS,YAAY;IACnB,SAAS,mBAAmB;QAC1B,MAAM,IAAI,GAAwB;YAChC,IAAI,CAAC,GAAG,KAAgB,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC;YAC1C,KAAK,CAAC,KAAK,KAAK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,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;IACJ,CAAC;IAED,oCAAoC;IACpC,MAAM,aAAa,GAAG,iBAAiB,EAAE,CAAC;IAC1C,MAAM,OAAO,GAAG,oBAAoB,EAAE,CAAC;IACvC,MAAM,KAAK,GAAG,kBAAkB,EAAE,CAAC;IAEnC,MAAM,QAAQ,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAEnD,2EAA2E;IAC3E,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACtC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,IAAI,IAAI,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -66,6 +66,15 @@ export declare function onEmail(handler: EmailHandler): void;
|
|
|
66
66
|
* Get the registered email handler (internal use by generated worker code).
|
|
67
67
|
*/
|
|
68
68
|
export declare function __getEmailHandler(): EmailHandler | null;
|
|
69
|
+
/**
|
|
70
|
+
* Get email metadata for extraction.
|
|
71
|
+
* Returns the number of onEmail() calls detected.
|
|
72
|
+
*
|
|
73
|
+
* @internal Used by the extraction entry point during `fling push`.
|
|
74
|
+
*/
|
|
75
|
+
export declare function __getEmailMetadata(): {
|
|
76
|
+
handlerCount: number;
|
|
77
|
+
};
|
|
69
78
|
export type { InboundEmail } from "../types/email.js";
|
|
70
79
|
/**
|
|
71
80
|
* Cron handler type. Handlers can optionally return a JSON-serializable result.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/worker-runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EAMX,MAAM,YAAY,CAAC;AAKpB;;;;;;GAMG;AACH,wBAAgB,SAAS,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Handler = null;
|
|
51
|
+
let emailCallCount = 0;
|
|
51
52
|
/**
|
|
52
53
|
* Register an inbound email handler.
|
|
53
54
|
*
|
|
@@ -67,8 +68,10 @@ let emailHandler = null;
|
|
|
67
68
|
* ```
|
|
68
69
|
*/
|
|
69
70
|
export function onEmail(handler) {
|
|
71
|
+
emailCallCount++;
|
|
70
72
|
if (emailHandler) {
|
|
71
|
-
|
|
73
|
+
console.warn("Warning: onEmail() called multiple times. Only one handler is allowed — using the first one.");
|
|
74
|
+
return;
|
|
72
75
|
}
|
|
73
76
|
emailHandler = handler;
|
|
74
77
|
}
|
|
@@ -78,6 +81,15 @@ export function onEmail(handler) {
|
|
|
78
81
|
export function __getEmailHandler() {
|
|
79
82
|
return emailHandler;
|
|
80
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Get email metadata for extraction.
|
|
86
|
+
* Returns the number of onEmail() calls detected.
|
|
87
|
+
*
|
|
88
|
+
* @internal Used by the extraction entry point during `fling push`.
|
|
89
|
+
*/
|
|
90
|
+
export function __getEmailMetadata() {
|
|
91
|
+
return { handlerCount: emailCallCount };
|
|
92
|
+
}
|
|
81
93
|
const cronHandlers = new Map();
|
|
82
94
|
/**
|
|
83
95
|
* Register a cron job.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/worker-runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAY5B,iDAAiD;AACjD,IAAI,SAAS,GAAqB,IAAI,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,GAA4B;IACpD,SAAS,GAAG,GAAgB,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ;IACtB,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,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,EAAE,GAAG,WAAW,EAAE,CAAC;QACzB,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAA4B;QACrC,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,UAAU,GAAsB;YACpC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;YACxC,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B,CAAC;QACF,IAAI,MAAM,CAAC,MAAM;YAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACrD,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flingit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.48",
|
|
4
4
|
"description": "Small Software Platform - Build and deploy personal tools through conversation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"croner": "^9.1.0",
|
|
77
77
|
"dotenv": "^17.2.3",
|
|
78
78
|
"esbuild": "^0.27.2",
|
|
79
|
-
"hono": "^4.12.
|
|
79
|
+
"hono": "^4.12.2",
|
|
80
80
|
"postal-mime": "^2.7.3",
|
|
81
81
|
"tsx": "^4.19.0",
|
|
82
|
-
"zod": "^
|
|
82
|
+
"zod": "^4"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@cloudflare/workers-types": "^4.0.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
a5c764a9c788db763d5ef39e11e5041f
|
|
@@ -13,7 +13,7 @@ Fling handles all of this automatically. When the user asks you to build somethi
|
|
|
13
13
|
1. Write backend code in `src/worker/index.ts` using the Fling API
|
|
14
14
|
2. Write frontend code in `src/react-app/` using React
|
|
15
15
|
3. Run `npm start` to test it locally (you have bash access - run commands yourself!)
|
|
16
|
-
4. When it works, run `
|
|
16
|
+
4. When it works, run `npx fling it` to deploy
|
|
17
17
|
|
|
18
18
|
## When to Send Feedback
|
|
19
19
|
|
|
@@ -28,7 +28,7 @@ Proactively offer to send feedback in these situations:
|
|
|
28
28
|
|
|
29
29
|
## Core Concepts
|
|
30
30
|
|
|
31
|
-
Fling provides
|
|
31
|
+
Fling provides these primitives that work identically in local development and production:
|
|
32
32
|
|
|
33
33
|
1. **HTTP** - Expose endpoints via Hono
|
|
34
34
|
2. **Database** - SQLite locally, D1 in production
|
|
@@ -36,8 +36,9 @@ Fling provides seven primitives that work identically in local development and p
|
|
|
36
36
|
4. **Migrations** - Version your database schema
|
|
37
37
|
5. **Cron** - Scheduled tasks that run on a schedule
|
|
38
38
|
6. **Storage** - File system locally, R2 in production
|
|
39
|
-
7. **
|
|
40
|
-
8. **
|
|
39
|
+
7. **Inbound Email** - Handle emails sent to `<project-slug>@flingit.run` with `onEmail` — see `references/EMAIL-INBOUND.md`
|
|
40
|
+
8. **Discord** and **Slack** - Chat bot integration — see `references/DISCORD.md` and `references/SLACK.md`
|
|
41
|
+
9. **WASM** - WebAssembly modules for compute-intensive tasks
|
|
41
42
|
|
|
42
43
|
## Project Structure
|
|
43
44
|
|
|
@@ -132,36 +133,37 @@ function App() {
|
|
|
132
133
|
|
|
133
134
|
## CLI Commands
|
|
134
135
|
|
|
135
|
-
Always use `
|
|
136
|
+
Always use `npx` to run the project's installed Fling (not global).
|
|
136
137
|
|
|
137
138
|
**Important:** The CLI must be called without a TTY (e.g., with stdout redirected), or with the `--cli` flag. When both stdin and stdout are a TTY and `--cli` is not passed, the CLI launches an interactive mode instead of executing commands. If you are running from an environment where a TTY may be present, always pass `--cli`:
|
|
138
139
|
|
|
139
140
|
```bash
|
|
140
|
-
|
|
141
|
+
npx fling -- --cli push # Safe from any environment
|
|
141
142
|
```
|
|
142
143
|
|
|
143
144
|
```bash
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
145
|
+
npx fling dev # Start local server (API + Vite)
|
|
146
|
+
npx fling db sql "SELECT * FROM users" # Query local SQLite
|
|
147
|
+
npx fling db reset # Wipe local database
|
|
148
|
+
npx fling db sql "SELECT 1" # Query local SQLite
|
|
149
|
+
npx fling secret set KEY=value
|
|
150
|
+
npx fling secret list
|
|
151
|
+
npx fling secret remove KEY
|
|
152
|
+
npx fling logs # View local logs
|
|
153
|
+
npx fling it # Build and deploy to Cloudflare Workers
|
|
154
|
+
npx fling project slug # Show current project slug and URL
|
|
155
|
+
npx fling project slug:set <new-slug> # Change project slug (affects URL)
|
|
156
|
+
npx fling project takedown # Delete project and all data
|
|
157
|
+
npx fling cron list # List registered cron jobs
|
|
158
|
+
npx fling cron history <name> # View invocation history
|
|
159
|
+
npx fling cron trigger <name> --port BE-PORT # Manually trigger a cron job
|
|
160
|
+
npx fling storage list # List storage objects
|
|
161
|
+
npx fling storage put <key> <file> # Upload file to storage
|
|
162
|
+
npx fling storage get <key> [output] # Download object (stdout if no output)
|
|
163
|
+
npx fling storage delete <key> --yes # Delete object
|
|
164
|
+
npx fling storage info # Show storage stats
|
|
165
|
+
npx fling tunnel 3000 # Expose localhost:3000 via public URL
|
|
166
|
+
npx fling whoami # Show user info and available features (entitlements)
|
|
165
167
|
```
|
|
166
168
|
|
|
167
169
|
### Debugging Cron Jobs in Production
|
|
@@ -170,13 +172,13 @@ Each cron invocation logs "Running cron job <name>" at the start. To see all log
|
|
|
170
172
|
|
|
171
173
|
1. **Find the invocation** by searching for the cron job name:
|
|
172
174
|
```bash
|
|
173
|
-
|
|
175
|
+
npx fling -- --prod logs --search "Running cron job daily-cleanup"
|
|
174
176
|
```
|
|
175
177
|
This shows log entries with Ray IDs like `[ray:abc12345]`.
|
|
176
178
|
|
|
177
179
|
2. **Filter by that Ray ID** to see all logs from that invocation:
|
|
178
180
|
```bash
|
|
179
|
-
|
|
181
|
+
npx fling -- --prod logs --ray abc12345
|
|
180
182
|
```
|
|
181
183
|
|
|
182
184
|
### Local vs Production (`--prod`)
|
|
@@ -185,17 +187,17 @@ Commands default to local environment. Use `--prod` for production:
|
|
|
185
187
|
|
|
186
188
|
```bash
|
|
187
189
|
# Local (default)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
npx fling secret list # Local secrets
|
|
191
|
+
npx fling logs # Local logs
|
|
192
|
+
npx fling db sql "SELECT 1" # Local SQLite
|
|
193
|
+
npx fling storage list # Local storage
|
|
192
194
|
|
|
193
195
|
# Production (requires login)
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
npx fling -- --prod secret list # Deployed secrets
|
|
197
|
+
npx fling -- --prod logs # Deployed logs
|
|
198
|
+
npx fling -- --prod db sql "SELECT 1" # Deployed D1
|
|
199
|
+
npx fling -- --prod storage list # R2 storage
|
|
200
|
+
npx fling -- --prod cron list # Deployed cron jobs
|
|
199
201
|
```
|
|
200
202
|
|
|
201
203
|
**Note:** Production logs have a delay of ~10 seconds or more before they appear.
|
|
@@ -221,7 +223,7 @@ Just edit and save - changes appear immediately.
|
|
|
221
223
|
When you've completed the user's request and verified that the app works locally, EXPLICITLY OFFER to deploy it, but also tell them that they can try it locally first. If their app has a backend and no secure authorization method, you MUST make it VERY CLEAR to them that the deployed app will be visible on the internet, and explicitly ask them if they want to proceed!
|
|
222
224
|
|
|
223
225
|
To deploy:
|
|
224
|
-
**Run `
|
|
226
|
+
**Run `npx fling it` directly** - you have bash access, don't ask the user to run commands.
|
|
225
227
|
|
|
226
228
|
After each deploy, tell the user what the deployed URL is. With Fling, to deploy is also called "to fling it"!
|
|
227
229
|
|
|
@@ -230,7 +232,7 @@ After each deploy, tell the user what the deployed URL is. With Fling, to deplo
|
|
|
230
232
|
After your first `fling push`, consider asking the user if they want a custom URL.
|
|
231
233
|
Their project was auto-assigned a slug like `proj-abc123`.
|
|
232
234
|
|
|
233
|
-
To change it: `
|
|
235
|
+
To change it: `npx fling project slug:set my-custom-slug`
|
|
234
236
|
|
|
235
237
|
Slugs must be:
|
|
236
238
|
- More than 4 characters
|
|
@@ -243,12 +245,12 @@ If the user isn't logged in (no token stored), help them authenticate:
|
|
|
243
245
|
|
|
244
246
|
**New user:** Sign up with email and name:
|
|
245
247
|
```bash
|
|
246
|
-
|
|
248
|
+
npx fling -- --cli signup --email user@example.com --name "User Name"
|
|
247
249
|
```
|
|
248
250
|
|
|
249
251
|
**Existing user:** Log in via magic link email:
|
|
250
252
|
```bash
|
|
251
|
-
|
|
253
|
+
npx fling -- --cli login --email user@example.com
|
|
252
254
|
```
|
|
253
255
|
After running login, tell the user to check their email and click the login link.
|
|
254
256
|
The CLI will wait until the link is clicked, then complete login automatically.
|
|
@@ -317,7 +319,7 @@ This gives collaborators:
|
|
|
317
319
|
|
|
318
320
|
3. **Bundle size limit (10MB)** - Cloudflare Workers have a 10MB bundle size limit. Choose lightweight packages to stay under this limit. For example, use `pdf-lib` for PDF generation instead of heavier alternatives like `jspdf`. Avoid packages that bundle large dependencies.
|
|
319
321
|
|
|
320
|
-
4. **Feature scope** - Fling supports frontend, backend, database, cron jobs, file storage (R2), and Discord
|
|
322
|
+
4. **Feature scope** - Fling supports frontend, backend, database, cron jobs, file storage (R2), inbound email, and Slack/Discord integrations.
|
|
321
323
|
|
|
322
324
|
5. **Database operations cannot be at module top-level** - They must be inside route handlers or functions called by them.
|
|
323
325
|
|
|
@@ -383,7 +385,7 @@ This approach:
|
|
|
383
385
|
|
|
384
386
|
**For large assets:** Serve them from the frontend (`public/` folder) instead.
|
|
385
387
|
|
|
386
|
-
See `references/API.md` for detailed API reference, `references/EXAMPLES.md` for common patterns, `references/FEEDBACK.md` for collecting user feedback, and `references/GH-ACTION.md` for setting up automatic deployments with GitHub Actions.
|
|
388
|
+
See `references/API.md` for detailed API reference, `references/EMAIL-INBOUND.md` for inbound email handlers and payload fields, `references/EXAMPLES.md` for common patterns, `references/FEEDBACK.md` for collecting user feedback, and `references/GH-ACTION.md` for setting up automatic deployments with GitHub Actions.
|
|
387
389
|
|
|
388
390
|
## Updates
|
|
389
391
|
|
|
@@ -391,6 +393,6 @@ When the fling CLI mentions that there is a new version available, strongly sugg
|
|
|
391
393
|
|
|
392
394
|
```bash
|
|
393
395
|
npm install flingit@latest
|
|
394
|
-
|
|
396
|
+
npx fling upgrade # to upgrade this skill if needed
|
|
395
397
|
|
|
396
398
|
```
|
|
@@ -370,9 +370,9 @@ Cron expressions: `minute hour day-of-month month day-of-week`
|
|
|
370
370
|
|
|
371
371
|
Manage cron jobs with CLI:
|
|
372
372
|
```bash
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
373
|
+
npx fling cron list # List all cron jobs
|
|
374
|
+
npx fling cron history <name> # View invocation history
|
|
375
|
+
npx fling cron trigger <name> # Manually trigger a job
|
|
376
376
|
```
|
|
377
377
|
|
|
378
378
|
## Storage (R2)
|
|
@@ -556,24 +556,24 @@ app.get("/files/:key", async (c) => {
|
|
|
556
556
|
|
|
557
557
|
```bash
|
|
558
558
|
# List objects
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
559
|
+
npx fling storage list # Local storage
|
|
560
|
+
npx fling -- --prod storage list # Production R2
|
|
561
|
+
npx fling storage list images/ # Filter by prefix
|
|
562
562
|
|
|
563
563
|
# Upload file
|
|
564
|
-
|
|
565
|
-
|
|
564
|
+
npx fling storage put images/logo.png ./logo.png
|
|
565
|
+
npx fling storage put data.json - < data.json # From stdin
|
|
566
566
|
|
|
567
567
|
# Download file
|
|
568
|
-
|
|
569
|
-
|
|
568
|
+
npx fling storage get images/logo.png ./output.png
|
|
569
|
+
npx fling storage get data.json # Output to stdout
|
|
570
570
|
|
|
571
571
|
# Delete object
|
|
572
|
-
|
|
572
|
+
npx fling storage delete old-file.txt --yes
|
|
573
573
|
|
|
574
574
|
# Storage info
|
|
575
|
-
|
|
576
|
-
|
|
575
|
+
npx fling storage info # Local stats
|
|
576
|
+
npx fling -- --prod storage info # Production R2 stats
|
|
577
577
|
```
|
|
578
578
|
|
|
579
579
|
### Important Notes
|
|
@@ -7,8 +7,8 @@ Build Discord chatops bots with Fling. Handle slash commands, send messages, and
|
|
|
7
7
|
Discord requires a one-time setup before use:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
npx fling plugin install discord # Connect Discord account + add bot to a server (opens browser)
|
|
11
|
+
npx fling it # Deploy code
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
Run these commands yourself — you have bash access.
|
|
@@ -284,16 +284,16 @@ discord.onCommand("info", "Show context info", async (interaction) => {
|
|
|
284
284
|
|
|
285
285
|
```bash
|
|
286
286
|
# Setup
|
|
287
|
-
|
|
287
|
+
npx fling plugin install discord # Connect Discord (OAuth), auto-claims server
|
|
288
288
|
|
|
289
289
|
# Status
|
|
290
|
-
|
|
290
|
+
npx fling plugin permissions discord # Show connection status + servers
|
|
291
291
|
|
|
292
292
|
# Deployment
|
|
293
|
-
|
|
293
|
+
npx fling it
|
|
294
294
|
|
|
295
295
|
# Teardown
|
|
296
|
-
|
|
296
|
+
npx fling plugin remove discord # Disconnect, release all servers
|
|
297
297
|
```
|
|
298
298
|
|
|
299
299
|
## How It Works
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Inbound Email (`onEmail`)
|
|
2
|
+
|
|
3
|
+
Fling supports inbound email handlers in user workers.
|
|
4
|
+
|
|
5
|
+
**Note:** Email receiving is not enabled by default. Run `fling whoami` to check whether it is available for your account.
|
|
6
|
+
|
|
7
|
+
If an email is sent to:
|
|
8
|
+
|
|
9
|
+
`<project-slug>@flingit.run`
|
|
10
|
+
|
|
11
|
+
the platform parses the message and dispatches it to your worker's internal email endpoint, which invokes your registered `onEmail` handler.
|
|
12
|
+
|
|
13
|
+
Only one `onEmail` handler can be registered.
|
|
14
|
+
|
|
15
|
+
## Basic Usage
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { onEmail } from "flingit";
|
|
19
|
+
|
|
20
|
+
onEmail(async (email) => {
|
|
21
|
+
console.log("From:", email.from.address);
|
|
22
|
+
console.log("Subject:", email.subject);
|
|
23
|
+
|
|
24
|
+
// Example: only process emails with text content
|
|
25
|
+
if (!email.text) return;
|
|
26
|
+
|
|
27
|
+
// Your processing logic here
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## `InboundEmail` Fields
|
|
32
|
+
|
|
33
|
+
`onEmail` receives this payload shape:
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
type InboundEmail = {
|
|
37
|
+
from: { name: string; address: string };
|
|
38
|
+
to: string;
|
|
39
|
+
cc: Array<{ name: string; address: string }>;
|
|
40
|
+
replyTo: Array<{ name: string; address: string }>;
|
|
41
|
+
subject: string;
|
|
42
|
+
text: string | null;
|
|
43
|
+
html: string | null;
|
|
44
|
+
date: string | null;
|
|
45
|
+
messageId: string | null;
|
|
46
|
+
inReplyTo: string | null;
|
|
47
|
+
references: string | null;
|
|
48
|
+
headers: Record<string, string>;
|
|
49
|
+
attachments: Array<{
|
|
50
|
+
filename: string | null;
|
|
51
|
+
mimeType: string;
|
|
52
|
+
size: number;
|
|
53
|
+
content: string; // base64
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Field notes:
|
|
59
|
+
|
|
60
|
+
- `from`: Sender display name + email address.
|
|
61
|
+
- `to`: Full envelope recipient (for example, `my-project@flingit.run`).
|
|
62
|
+
- `cc`: Parsed CC recipients.
|
|
63
|
+
- `replyTo`: Parsed Reply-To addresses.
|
|
64
|
+
- `subject`: Email subject (empty string if missing).
|
|
65
|
+
- `text`: Plain text body when available.
|
|
66
|
+
- `html`: HTML body when available.
|
|
67
|
+
- `date`: ISO 8601 date string when available.
|
|
68
|
+
- `messageId`: Parsed Message-ID header.
|
|
69
|
+
- `inReplyTo`: Parsed In-Reply-To header.
|
|
70
|
+
- `references`: Parsed References header.
|
|
71
|
+
- `headers`: Selected useful headers as a lowercase-key map.
|
|
72
|
+
- `attachments`: Attachments with base64 content and metadata.
|
|
73
|
+
|
|
74
|
+
## Which Headers Are Included?
|
|
75
|
+
|
|
76
|
+
`headers` includes selected keys (when present), not every raw header:
|
|
77
|
+
|
|
78
|
+
- `message-id`
|
|
79
|
+
- `in-reply-to`
|
|
80
|
+
- `references`
|
|
81
|
+
- `reply-to`
|
|
82
|
+
- `list-unsubscribe`
|
|
83
|
+
- `list-id`
|
|
84
|
+
- `x-mailer`
|
|
85
|
+
- `content-type`
|
|
86
|
+
|
|
87
|
+
## Example: Store Incoming Emails
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
import { db, migrate, onEmail } from "flingit";
|
|
91
|
+
|
|
92
|
+
migrate("001_create_received_emails", async () => {
|
|
93
|
+
await db.prepare(`
|
|
94
|
+
CREATE TABLE IF NOT EXISTS received_emails (
|
|
95
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
96
|
+
from_address TEXT NOT NULL,
|
|
97
|
+
subject TEXT NOT NULL,
|
|
98
|
+
body_text TEXT,
|
|
99
|
+
received_at TEXT DEFAULT CURRENT_TIMESTAMP
|
|
100
|
+
)
|
|
101
|
+
`).run();
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
onEmail(async (email) => {
|
|
105
|
+
await db.prepare(
|
|
106
|
+
"INSERT INTO received_emails (from_address, subject, body_text) VALUES (?, ?, ?)"
|
|
107
|
+
)
|
|
108
|
+
.bind(email.from.address, email.subject, email.text ?? "")
|
|
109
|
+
.run();
|
|
110
|
+
});
|
|
111
|
+
```
|
|
@@ -36,13 +36,13 @@ Should I submit this?"
|
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
38
|
# Simple feedback (single line)
|
|
39
|
-
|
|
39
|
+
npx fling feedback "Your feedback message here"
|
|
40
40
|
|
|
41
41
|
# Interactive mode (for longer, multi-line feedback)
|
|
42
|
-
|
|
42
|
+
npx fling feedback -i
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
The user must be logged in (`
|
|
45
|
+
The user must be logged in (`npx fling login`) for feedback to work.
|
|
46
46
|
|
|
47
47
|
## Writing Good Feedback
|
|
48
48
|
|