flypod 0.19.1 → 0.20.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 CHANGED
@@ -238,6 +238,24 @@ naming the limit and the largest files, and, when a few files are the
238
238
  difference, the `.flypodignore` lines that would leave them out. A self-hosted server sets its own
239
239
  limits (`UPLOAD_MAX_*`) and enforces them itself.
240
240
 
241
+ **The free plan.** flypod.dev is for hobby use, and everyone is on the free
242
+ plan (a Pro plan with higher limits is planned). Per person (the signed-in
243
+ account, or for anonymous use the network you deploy from):
244
+
245
+ | Limit | Free |
246
+ |-------|------|
247
+ | Deploys (new sites and updates) | 100 a month; any one site also at most 100 updates a month |
248
+ | New sites | 10 a month |
249
+ | Sites an account can own | 10 (delete one at flypod.dev/account to make another) |
250
+ | Requests a site may serve | 5,000 a day, then a "back at midnight UTC" page until the day ends |
251
+ | Versions a site keeps | 10, and non-live ones for seven days |
252
+ | Deploys a minute | 10 per network |
253
+
254
+ A spent monthly limit fails with `quota_exceeded` (exit 1, not retryable),
255
+ naming the limit and `resets_at`; months and days are UTC. No limit deletes a
256
+ site. A self-hosted server meters none of this. Full list:
257
+ [flypod.dev/limits](https://flypod.dev/limits).
258
+
241
259
  To skip the package runner:
242
260
 
243
261
  ```sh
@@ -276,7 +294,9 @@ Re-deploying byte-identical content resolves to the **same version id** and adds
276
294
  nothing to the history — the CLI just reports that version as live. Earlier
277
295
  versions stay stored, which is what makes rollback instant — for seven days: a
278
296
  version that is not live is deleted seven days after it was deployed, so
279
- rollback reaches back about a week. The live version lasts as long as the site.
297
+ rollback reaches back about a week, and on flypod.dev a site keeps at most 10
298
+ versions (the live one and the 9 newest others). The live version lasts as
299
+ long as the site.
280
300
 
281
301
  **How `update` knows which site.** On the first deploy, flypod records the
282
302
  folder → site mapping in its own config dir (`projects.json`, next to the
@@ -469,6 +489,8 @@ found, or the path given does not exist), `no_files`, `no_site` (with a
469
489
  `not_signed_in`, `unauthorized`, `token_rejected`, `site_gone`,
470
490
  `invalid_upload`, `too_large` (checked before uploading too, naming the limit
471
491
  and the largest files), `blocked`, `challenge_required`, `rate_limited`,
492
+ `quota_exceeded` (a free-plan limit is spent: `limit` says which,
493
+ `resets_at` when it comes back; exit 1, because retrying fails until then),
472
494
  `server_error` (a 5xx; `flypod update` has already retried it once, since an
473
495
  update is safe to repeat, and an error from flypod itself carries `request_id`
474
496
  to quote), `network` (the server could not be reached, or a proxy or
@@ -613,7 +635,7 @@ The way a static export expects, with nothing to configure:
613
635
  attempt with the fifth without anyone rolling back. `flypod versions`
614
636
  prints the compare link, and the account page has the same switch. It is off
615
637
  by default because it makes replaced versions public. Versions that are
616
- not live are kept for seven days.
638
+ not live are kept for seven days, and at most 10 per site.
617
639
  - **Dead links.** An address with no site shows a browser a short page saying
618
640
  that previews last 14 days and how the owner keeps one.
619
641
  - **Read-only.** A site answers `GET` and `HEAD`; anything else gets a `405`.
@@ -47,7 +47,7 @@ import {
47
47
  unauthorizedFor,
48
48
  unexpectedError,
49
49
  uploadLimitsFor
50
- } from "../cli-qtqg73w5.js";
50
+ } from "../cli-g4k4wwmw.js";
51
51
 
52
52
  // bin/deploy.ts
53
53
  import { readFile as readFile4, stat as stat4 } from "node:fs/promises";
@@ -387,7 +387,8 @@ async function readServerMessage(res) {
387
387
  json: true,
388
388
  ...typeof body.fix === "string" && body.fix ? { fix: body.fix } : {},
389
389
  ...typeof body.limit === "string" ? { limit: body.limit } : {},
390
- ...typeof body.request_id === "string" && body.request_id ? { requestId: body.request_id } : {}
390
+ ...typeof body.request_id === "string" && body.request_id ? { requestId: body.request_id } : {},
391
+ ...typeof body.resets_at === "string" ? { resetsAt: body.resets_at } : {}
391
392
  };
392
393
  } catch {
393
394
  const cfError = cloudflareErrorNumber(text);
@@ -422,6 +423,18 @@ function classifyParsed(res, said, ctx) {
422
423
  const status = res.status;
423
424
  const site = ctx.siteId ? ` ${ctx.siteId}` : "";
424
425
  const base = { status, error: message };
426
+ if (serverCode === "quota_exceeded") {
427
+ return {
428
+ ...base,
429
+ code: "quota_exceeded",
430
+ error: message,
431
+ fix: "See https://flypod.dev/limits for the free plan's limits.",
432
+ extra: {
433
+ ...said.limit ? { limit: said.limit } : {},
434
+ ...said.resetsAt ? { resets_at: said.resetsAt } : {}
435
+ }
436
+ };
437
+ }
425
438
  if (serverCode === "token_rejected") {
426
439
  return {
427
440
  ...base,
@@ -690,7 +703,21 @@ is a no-op: same hash, same version, no new entry in the history. A redundant
690
703
 
691
704
  The live version stays as long as the site does. Any other version is deleted
692
705
  seven days after it was deployed, so \`flypod rollback\` can reach back about a
693
- week; \`flypod versions\` shows what is still there.
706
+ week; a site also keeps at most 10 versions. \`flypod versions\` shows what is
707
+ still there.
708
+
709
+ ## Free plan limits
710
+
711
+ flypod.dev is for hobby use. Per person (the signed-in account, or the network
712
+ an anonymous deploy comes from): 100 deploys a month (new sites and updates;
713
+ any one site at most 100 updates a month), 10 new sites a month, 10 sites owned
714
+ by an account, and 10 deploys a minute. Each site may serve 5,000 requests a
715
+ day, then shows a "back at midnight UTC" page. Months and days are UTC.
716
+
717
+ Do not redeploy on a timer or use a site as a live data feed: every update
718
+ spends the month's deploys. Batch your changes and deploy when they are done.
719
+ A spent limit is \`quota_exceeded\` (exit 1). Do not retry it: tell the human
720
+ which limit (\`limit\`) and when it resets (\`resets_at\`).
694
721
 
695
722
  ## Typical loop
696
723
 
@@ -867,7 +894,7 @@ var troubleshootingReference = {
867
894
  | Code | Meaning |
868
895
  | --- | --- |
869
896
  | \`0\` | success |
870
- | \`1\` | runtime error you can act on — no build folder, site gone, upload rejected or blocked |
897
+ | \`1\` | runtime error you can act on — no build folder, site gone, upload rejected or blocked, a free-plan limit spent (\`quota_exceeded\`) |
871
898
  | \`2\` | usage error — unknown flag or bad arguments, or a login that needs a browser |
872
899
  | \`3\` | auth — not signed in, credential refused (\`unauthorized\`, \`token_rejected\`), no manage token held (\`no_token\`), sign-in denied |
873
900
  | \`4\` | retryable — rate limited, server 5xx, network failure (including a proxy refusing the request), sign-in still pending |
@@ -883,7 +910,11 @@ Branch on \`code\` (stable), never on \`error\` (prose). \`fix\` is the literal
883
910
  step when there is one; \`status\` is the HTTP status when a server answered. Codes you will meet: \`no_build_dir\`, \`no_files\`,
884
911
  \`no_site\`, \`not_signed_in\`, \`unauthorized\`, \`token_rejected\`, \`site_gone\`,
885
912
  \`invalid_upload\`, \`too_large\`, \`blocked\`, \`challenge_required\`,
886
- \`rate_limited\`, \`server_error\`, \`network\`, \`unknown_flag\`, \`usage\`.
913
+ \`rate_limited\`, \`quota_exceeded\`, \`server_error\`, \`network\`, \`unknown_flag\`, \`usage\`.
914
+
915
+ \`rate_limited\` means wait a minute and retry. \`quota_exceeded\` is different: a
916
+ monthly free-plan limit is spent, and the same command fails until \`resets_at\`.
917
+ Do not retry it; tell the human the \`limit\` and the date.
887
918
 
888
919
  \`flypod update\` has already retried a \`server_error\` or \`network\` failure once
889
920
  before reporting it, so do not loop on it: wait a minute before one more try.
@@ -1,4 +1,4 @@
1
- export type ApiErrorCode = "bad_request" | "invalid_upload" | "too_large" | "unauthorized" | "login_required" | "token_rejected" | "invalid_origin" | "forbidden" | "challenge_required" | "blocked" | "not_found" | "unknown_version" | "already_claimed" | "invalid_claim" | "expired" | "taken_down" | "rate_limited" | "server_error";
1
+ export type ApiErrorCode = "bad_request" | "invalid_upload" | "too_large" | "unauthorized" | "login_required" | "token_rejected" | "invalid_origin" | "forbidden" | "challenge_required" | "blocked" | "not_found" | "unknown_version" | "already_claimed" | "invalid_claim" | "expired" | "taken_down" | "rate_limited" | "quota_exceeded" | "server_error";
2
2
  export declare function apiError(status: number, code: ApiErrorCode, message: string, extra?: Record<string, unknown>): Response;
3
3
  /** The code a bare HTTP status implies, for errors raised with a status only. */
4
4
  export declare function codeForStatus(status: number): ApiErrorCode;
@@ -66,6 +66,8 @@ export declare function readServerMessage(res: Response): Promise<{
66
66
  requestId?: string;
67
67
  /** Cloudflare's own error number (1101, 1102, …) from a page the platform wrote. */
68
68
  cfError?: number;
69
+ /** When a spent quota comes back (ISO 8601), from a `quota_exceeded` answer. */
70
+ resetsAt?: string;
69
71
  }>;
70
72
  /**
71
73
  * The number on an error page Cloudflare wrote itself: `error code: 1102` (the
@@ -1,4 +1,4 @@
1
- export declare const CLI_ERROR_CODES: readonly ["usage", "unknown_command", "unknown_flag", "no_build_dir", "no_files", "no_site", "no_token", "not_signed_in", "unauthorized", "token_rejected", "not_found", "no_such_version", "site_gone", "already_claimed", "invalid_upload", "too_large", "blocked", "challenge_required", "rate_limited", "server_error", "bad_request", "network", "interactive_login_required", "authorization_pending", "login_denied", "login_expired", "login_timeout", "unexpected"];
1
+ export declare const CLI_ERROR_CODES: readonly ["usage", "unknown_command", "unknown_flag", "no_build_dir", "no_files", "no_site", "no_token", "not_signed_in", "unauthorized", "token_rejected", "not_found", "no_such_version", "site_gone", "already_claimed", "invalid_upload", "too_large", "blocked", "challenge_required", "rate_limited", "quota_exceeded", "server_error", "bad_request", "network", "interactive_login_required", "authorization_pending", "login_denied", "login_expired", "login_timeout", "unexpected"];
2
2
  /**
3
3
  * The verbs a failure report may name: `SUBCOMMANDS` in bin/deploy.ts, which
4
4
  * already includes `deploy`. Copied rather than imported for the same reason
package/dist/src/cli.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  collectFiles,
8
8
  deploySite,
9
9
  resolveDeployDir
10
- } from "../cli-qtqg73w5.js";
10
+ } from "../cli-g4k4wwmw.js";
11
11
  export {
12
12
  BUILD_DIR_CANDIDATES,
13
13
  DEFAULT_IGNORES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flypod",
3
- "version": "0.19.1",
3
+ "version": "0.20.0",
4
4
  "description": "Zero-auth deploy primitive. Turns any folder into a live URL in one command. For AI agents and humans.",
5
5
  "module": "./dist/src/cli.js",
6
6
  "types": "./dist/src/cli.d.ts",