flingit 0.0.70 → 0.0.71

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.
Files changed (185) hide show
  1. package/dist/cli/commands/cron.d.ts +1 -1
  2. package/dist/cli/commands/cron.d.ts.map +1 -1
  3. package/dist/cli/commands/cron.js +2 -2
  4. package/dist/cli/commands/cron.js.map +1 -1
  5. package/dist/cli/commands/dev.js.map +1 -1
  6. package/dist/cli/commands/email.d.ts +23 -1
  7. package/dist/cli/commands/email.d.ts.map +1 -1
  8. package/dist/cli/commands/email.js +123 -17
  9. package/dist/cli/commands/email.js.map +1 -1
  10. package/dist/cli/commands/feedback.d.ts +1 -1
  11. package/dist/cli/commands/feedback.d.ts.map +1 -1
  12. package/dist/cli/commands/feedback.js.map +1 -1
  13. package/dist/cli/commands/launch.js.map +1 -1
  14. package/dist/cli/commands/login.d.ts +1 -1
  15. package/dist/cli/commands/login.d.ts.map +1 -1
  16. package/dist/cli/commands/login.js +33 -19
  17. package/dist/cli/commands/login.js.map +1 -1
  18. package/dist/cli/commands/logout.js.map +1 -1
  19. package/dist/cli/commands/logs.d.ts +3 -4
  20. package/dist/cli/commands/logs.d.ts.map +1 -1
  21. package/dist/cli/commands/logs.js.map +1 -1
  22. package/dist/cli/commands/plugin.d.ts +2 -2
  23. package/dist/cli/commands/plugin.d.ts.map +1 -1
  24. package/dist/cli/commands/plugin.js +14 -5
  25. package/dist/cli/commands/plugin.js.map +1 -1
  26. package/dist/cli/commands/project.d.ts +20 -1
  27. package/dist/cli/commands/project.d.ts.map +1 -1
  28. package/dist/cli/commands/project.js +41 -17
  29. package/dist/cli/commands/project.js.map +1 -1
  30. package/dist/cli/commands/push.d.ts +2 -1
  31. package/dist/cli/commands/push.d.ts.map +1 -1
  32. package/dist/cli/commands/push.js +249 -87
  33. package/dist/cli/commands/push.js.map +1 -1
  34. package/dist/cli/commands/secret.d.ts.map +1 -1
  35. package/dist/cli/commands/secret.js +18 -3
  36. package/dist/cli/commands/secret.js.map +1 -1
  37. package/dist/cli/commands/signup.js.map +1 -1
  38. package/dist/cli/commands/verify.d.ts.map +1 -1
  39. package/dist/cli/commands/verify.js +8 -3
  40. package/dist/cli/commands/verify.js.map +1 -1
  41. package/dist/cli/commands/whoami.d.ts.map +1 -1
  42. package/dist/cli/commands/whoami.js +11 -2
  43. package/dist/cli/commands/whoami.js.map +1 -1
  44. package/dist/cli/commands/workflow.d.ts +1 -1
  45. package/dist/cli/commands/workflow.d.ts.map +1 -1
  46. package/dist/cli/commands/workflow.js +2 -2
  47. package/dist/cli/commands/workflow.js.map +1 -1
  48. package/dist/cli/deploy/bundler.d.ts +5 -0
  49. package/dist/cli/deploy/bundler.d.ts.map +1 -1
  50. package/dist/cli/deploy/bundler.js +29 -0
  51. package/dist/cli/deploy/bundler.js.map +1 -1
  52. package/dist/cli/index.d.ts +51 -1
  53. package/dist/cli/index.d.ts.map +1 -1
  54. package/dist/cli/index.js +71 -10
  55. package/dist/cli/index.js.map +1 -1
  56. package/dist/cli/utils/cli-io-impl.d.ts.map +1 -1
  57. package/dist/cli/utils/cli-io-impl.js +1 -1
  58. package/dist/cli/utils/cli-io-impl.js.map +1 -1
  59. package/dist/cli/utils/cli-io.d.ts +15 -5
  60. package/dist/cli/utils/cli-io.d.ts.map +1 -1
  61. package/dist/cli/utils/config.d.ts +22 -0
  62. package/dist/cli/utils/config.d.ts.map +1 -1
  63. package/dist/cli/utils/config.js +26 -0
  64. package/dist/cli/utils/config.js.map +1 -1
  65. package/dist/cli/utils/create-project.d.ts +58 -0
  66. package/dist/cli/utils/create-project.d.ts.map +1 -0
  67. package/dist/cli/utils/create-project.js +77 -0
  68. package/dist/cli/utils/create-project.js.map +1 -0
  69. package/dist/cli/utils/environment.d.ts +1 -1
  70. package/dist/cli/utils/environment.d.ts.map +1 -1
  71. package/dist/cli/utils/format.js.map +1 -1
  72. package/dist/cli/utils/node-version.js.map +1 -1
  73. package/dist/cli/utils/project-name.js.map +1 -1
  74. package/dist/cli/utils/prompt-new-project.d.ts +2 -2
  75. package/dist/cli/utils/prompt-new-project.d.ts.map +1 -1
  76. package/dist/cli/utils/prompt-new-project.js.map +1 -1
  77. package/dist/cli/utils/retry.d.ts +20 -2
  78. package/dist/cli/utils/retry.d.ts.map +1 -1
  79. package/dist/cli/utils/retry.js +37 -12
  80. package/dist/cli/utils/retry.js.map +1 -1
  81. package/dist/repo-shared/constants.d.ts.map +1 -1
  82. package/dist/repo-shared/cost.d.ts +13 -0
  83. package/dist/repo-shared/cost.d.ts.map +1 -1
  84. package/dist/repo-shared/cost.js.map +1 -1
  85. package/dist/repo-shared/deploy-protocol.d.ts +34 -0
  86. package/dist/repo-shared/deploy-protocol.d.ts.map +1 -0
  87. package/dist/repo-shared/deploy-protocol.js +168 -0
  88. package/dist/repo-shared/deploy-protocol.js.map +1 -0
  89. package/dist/repo-shared/package-metadata.js +1 -1
  90. package/dist/repo-shared/package-metadata.js.map +1 -1
  91. package/dist/repo-shared/slug-validation.d.ts.map +1 -1
  92. package/dist/repo-shared/slug-validation.js +7 -0
  93. package/dist/repo-shared/slug-validation.js.map +1 -1
  94. package/dist/runtime/auth.d.ts.map +1 -1
  95. package/dist/runtime/auth.js +2 -1
  96. package/dist/runtime/auth.js.map +1 -1
  97. package/dist/runtime/db.d.ts.map +1 -1
  98. package/dist/runtime/discord.d.ts.map +1 -1
  99. package/dist/runtime/email-send.d.ts.map +1 -1
  100. package/dist/runtime/entry.js.map +1 -1
  101. package/dist/runtime/log.d.ts.map +1 -1
  102. package/dist/runtime/log.js.map +1 -1
  103. package/dist/runtime/secrets.d.ts.map +1 -1
  104. package/dist/runtime/slack.d.ts.map +1 -1
  105. package/dist/runtime/storage.js +1 -1
  106. package/dist/runtime/storage.js.map +1 -1
  107. package/dist/shared/non-json-response.d.ts +90 -0
  108. package/dist/shared/non-json-response.d.ts.map +1 -0
  109. package/dist/shared/non-json-response.js +211 -0
  110. package/dist/shared/non-json-response.js.map +1 -0
  111. package/dist/worker-runtime/auth.d.ts.map +1 -1
  112. package/dist/worker-runtime/auth.js +59 -18
  113. package/dist/worker-runtime/auth.js.map +1 -1
  114. package/dist/worker-runtime/d1-event-store.d.ts.map +1 -1
  115. package/dist/worker-runtime/discord.d.ts.map +1 -1
  116. package/dist/worker-runtime/email-send.d.ts.map +1 -1
  117. package/dist/worker-runtime/entry-extract.d.ts +38 -6
  118. package/dist/worker-runtime/entry-extract.d.ts.map +1 -1
  119. package/dist/worker-runtime/entry-extract.js +30 -18
  120. package/dist/worker-runtime/entry-extract.js.map +1 -1
  121. package/dist/worker-runtime/entry.d.ts +1 -0
  122. package/dist/worker-runtime/entry.d.ts.map +1 -1
  123. package/dist/worker-runtime/entry.js +89 -1
  124. package/dist/worker-runtime/entry.js.map +1 -1
  125. package/dist/worker-runtime/index.d.ts.map +1 -1
  126. package/dist/worker-runtime/slack.d.ts.map +1 -1
  127. package/dist/worker-runtime/types.d.ts +2 -0
  128. package/dist/worker-runtime/types.d.ts.map +1 -1
  129. package/dist/workflow/runtime.d.ts +22 -1
  130. package/dist/workflow/runtime.d.ts.map +1 -1
  131. package/dist/workflow/runtime.js +25 -16
  132. package/dist/workflow/runtime.js.map +1 -1
  133. package/node_modules/better-sqlite3/deps/defines.gypi +1 -0
  134. package/node_modules/better-sqlite3/deps/download.sh +2 -1
  135. package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.c +7696 -4295
  136. package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.h +482 -103
  137. package/node_modules/better-sqlite3/deps/sqlite3/sqlite3ext.h +10 -1
  138. package/node_modules/better-sqlite3/package.json +3 -3
  139. package/node_modules/better-sqlite3/src/better_sqlite3.cpp +1 -1
  140. package/node_modules/better-sqlite3/src/util/helpers.cpp +1 -1
  141. package/node_modules/better-sqlite3/src/util/macros.cpp +8 -1
  142. package/node_modules/flingflow/biome.json +15 -0
  143. package/node_modules/flingflow/dist/backoff.js +1 -1
  144. package/node_modules/flingflow/dist/backoff.js.map +1 -1
  145. package/node_modules/flingflow/dist/engine.js +0 -1
  146. package/node_modules/flingflow/dist/engine.js.map +1 -1
  147. package/node_modules/flingflow/dist/store-memory.js +0 -1
  148. package/node_modules/flingflow/dist/store-memory.js.map +1 -1
  149. package/node_modules/flingflow/dist/store-sqlite.js +0 -1
  150. package/node_modules/flingflow/dist/store-sqlite.js.map +1 -1
  151. package/node_modules/flingflow/dist/stress.js +7 -8
  152. package/node_modules/flingflow/dist/stress.js.map +1 -1
  153. package/node_modules/flingflow/dist/transitions.js.map +1 -1
  154. package/node_modules/flingflow/package.json +7 -10
  155. package/node_modules/flingflow/src/backoff.ts +1 -1
  156. package/node_modules/flingflow/src/engine.ts +1 -2
  157. package/node_modules/flingflow/src/store-memory.ts +0 -1
  158. package/node_modules/flingflow/src/store-sqlite.ts +0 -1
  159. package/node_modules/flingflow/src/stress.ts +9 -10
  160. package/node_modules/flingflow/test/engine.test.ts +16 -15
  161. package/node_modules/flingflow/test/recovery.test.ts +5 -4
  162. package/node_modules/flingflow/test/simulation.test.ts +21 -20
  163. package/node_modules/flingflow/test/store-conformance.ts +25 -21
  164. package/node_modules/flingflow/tsconfig.typecheck.json +1 -1
  165. package/node_modules/semver/README.md +22 -6
  166. package/node_modules/semver/bin/semver.js +15 -11
  167. package/node_modules/semver/classes/range.js +24 -4
  168. package/node_modules/semver/classes/semver.js +19 -2
  169. package/node_modules/semver/functions/diff.js +1 -1
  170. package/node_modules/semver/functions/truncate.js +48 -0
  171. package/node_modules/semver/index.js +2 -0
  172. package/node_modules/semver/internal/re.js +3 -3
  173. package/node_modules/semver/package.json +4 -4
  174. package/node_modules/semver/range.bnf +5 -4
  175. package/node_modules/semver/ranges/subset.js +3 -3
  176. package/package.json +36 -32
  177. package/templates/default/dot-claude/skills/fling/.hash +1 -1
  178. package/templates/default/dot-claude/skills/fling/SKILL.md +0 -1
  179. package/templates/default/package.json +9 -9
  180. package/dist/cli/commands/tunnel.d.ts +0 -41
  181. package/dist/cli/commands/tunnel.d.ts.map +0 -1
  182. package/dist/cli/commands/tunnel.js +0 -211
  183. package/dist/cli/commands/tunnel.js.map +0 -1
  184. package/node_modules/flingflow/eslint.config.js +0 -94
  185. package/node_modules/flingflow/tsconfig.lint.json +0 -5
@@ -28,6 +28,7 @@ const gte = require('./functions/gte')
28
28
  const lte = require('./functions/lte')
29
29
  const cmp = require('./functions/cmp')
30
30
  const coerce = require('./functions/coerce')
31
+ const truncate = require('./functions/truncate')
31
32
  const Comparator = require('./classes/comparator')
32
33
  const Range = require('./classes/range')
33
34
  const satisfies = require('./functions/satisfies')
@@ -66,6 +67,7 @@ module.exports = {
66
67
  lte,
67
68
  cmp,
68
69
  coerce,
70
+ truncate,
69
71
  Comparator,
70
72
  Range,
71
73
  satisfies,
@@ -78,8 +78,8 @@ createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
78
78
 
79
79
  // ## Pre-release Version Identifier
80
80
  // A numeric identifier, or a non-numeric identifier.
81
- // Non-numberic identifiers include numberic identifiers but can be longer.
82
- // Therefore non-numberic identifiers must go first.
81
+ // Non-numeric identifiers include numeric identifiers but can be longer.
82
+ // Therefore non-numeric identifiers must go first.
83
83
 
84
84
  createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
85
85
  }|${src[t.NUMERICIDENTIFIER]})`)
@@ -136,7 +136,7 @@ createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)
136
136
  createToken('GTLT', '((?:<|>)?=?)')
137
137
 
138
138
  // Something like "2.*" or "1.2.x".
139
- // Note that "x.x" is a valid xRange identifer, meaning "any version"
139
+ // Note that "x.x" is a valid xRange identifier, meaning "any version"
140
140
  // Only the first item is strictly required.
141
141
  createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
142
142
  createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semver",
3
- "version": "7.7.3",
3
+ "version": "7.8.5",
4
4
  "description": "The semantic version parser used by npm.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,8 +14,8 @@
14
14
  "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
15
15
  },
16
16
  "devDependencies": {
17
- "@npmcli/eslint-config": "^5.0.0",
18
- "@npmcli/template-oss": "4.25.1",
17
+ "@npmcli/eslint-config": "^7.0.0",
18
+ "@npmcli/template-oss": "5.0.0",
19
19
  "benchmark": "^2.1.4",
20
20
  "tap": "^16.0.0"
21
21
  },
@@ -52,7 +52,7 @@
52
52
  "author": "GitHub Inc.",
53
53
  "templateOSS": {
54
54
  "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
55
- "version": "4.25.1",
55
+ "version": "5.0.0",
56
56
  "engines": ">=10",
57
57
  "distPaths": [
58
58
  "classes/",
@@ -10,7 +10,8 @@ nr ::= '0' | [1-9] ( [0-9] ) *
10
10
  tilde ::= '~' partial
11
11
  caret ::= '^' partial
12
12
  qualifier ::= ( '-' pre )? ( '+' build )?
13
- pre ::= parts
14
- build ::= parts
15
- parts ::= part ( '.' part ) *
16
- part ::= nr | [-0-9A-Za-z]+
13
+ pre ::= prepart ( '.' prepart ) *
14
+ prepart ::= nr | alphanumid
15
+ build ::= buildid ( '.' buildid ) *
16
+ alphanumid ::= ( [0-9] ) * [A-Za-z-] [-0-9A-Za-z] *
17
+ buildid ::= [-0-9A-Za-z]+
@@ -38,7 +38,7 @@ const compare = require('../functions/compare.js')
38
38
  // - If LT
39
39
  // - If LT.semver is greater than any < or <= comp in C, return false
40
40
  // - If LT is <=, and LT.semver does not satisfy every C, return false
41
- // - If GT.semver has a prerelease, and not in prerelease mode
41
+ // - If LT.semver has a prerelease, and not in prerelease mode
42
42
  // - If no C has a prerelease and the LT.semver tuple, return false
43
43
  // - Else return true
44
44
 
@@ -174,7 +174,7 @@ const simpleSubset = (sub, dom, options) => {
174
174
  if (higher === c && higher !== gt) {
175
175
  return false
176
176
  }
177
- } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
177
+ } else if (gt.operator === '>=' && !c.test(gt.semver)) {
178
178
  return false
179
179
  }
180
180
  }
@@ -192,7 +192,7 @@ const simpleSubset = (sub, dom, options) => {
192
192
  if (lower === c && lower !== lt) {
193
193
  return false
194
194
  }
195
- } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
195
+ } else if (lt.operator === '<=' && !c.test(lt.semver)) {
196
196
  return false
197
197
  }
198
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flingit",
3
- "version": "0.0.70",
3
+ "version": "0.0.71",
4
4
  "description": "Small Software Platform - Build and deploy personal tools through conversation",
5
5
  "type": "module",
6
6
  "engines": {
@@ -69,53 +69,48 @@
69
69
  "cli": "npm run build && node dist/cli/index.js",
70
70
  "cli-admin": "npm run build && node dist/cli-admin/index.js",
71
71
  "cli-infra": "npm run build && node dist/cli-infra/index.js",
72
- "typecheck": "tsc -p tsconfig.shared.json --emitDeclarationOnly && tsc --noEmit",
73
- "lint": "eslint src/ platform/",
74
- "lint:fix": "eslint src/ platform/ --fix",
72
+ "typecheck": "tsc -p tsconfig.shared.json --emitDeclarationOnly && tsc --noEmit && tsc -p tsconfig.shared.test.json && tsc -p tsconfig.test.json && npm run typecheck:scripts && npm run typecheck:platform",
73
+ "typecheck:scripts": "tsc -p scripts/tsconfig.json",
74
+ "typecheck:platform": "bash scripts/typecheck-platform.sh",
75
+ "lint": "biome lint src/ platform/ shared/ scripts/",
76
+ "lint:fix": "biome lint --write src/ platform/ shared/ scripts/",
75
77
  "check": "npm run typecheck && npm run lint",
76
78
  "clean": "rm -rf dist",
77
79
  "test": "vitest",
78
80
  "test:run": "vitest run",
79
- "test:coverage": "vitest run --coverage",
81
+ "test:coverage": "vitest run --coverage && tsx scripts/coverage-ratchet.ts",
80
82
  "test:pack": "bash scripts/test-pack.sh",
81
83
  "prepublishOnly": "npm run lint && npm run typecheck && npm run build:hash && npm run build && npm run test:run",
82
84
  "prepare": "husky"
83
85
  },
84
86
  "dependencies": {
85
87
  "@clack/prompts": "^0.11.0",
86
- "determined": "^0.1.0",
87
- "@hono/node-server": "^2.0.1",
88
- "@hono/zod-validator": "^0.7.6",
88
+ "@hono/node-server": "^2.1.5",
89
+ "@hono/zod-validator": "^0.9.1",
89
90
  "aws4fetch": "^1.0.20",
90
- "better-sqlite3": "^12.6.2",
91
- "cloudflared": "^0.7.1",
92
- "commander": "^14.0.2",
91
+ "better-sqlite3": "^12.11.1",
92
+ "commander": "^14.0.3",
93
93
  "croner": "^9.1.0",
94
- "dotenv": "^17.2.3",
95
- "esbuild": "^0.27.2",
94
+ "determined": "^0.1.0",
95
+ "dotenv": "^18.0.9",
96
+ "esbuild": "^0.28.2",
96
97
  "flingflow": "*",
98
+ "hono": "^4.13.13",
97
99
  "neverthrow": "^8.2.0",
98
- "hono": "^4.12.18",
99
- "postal-mime": "^2.7.3",
100
- "tsx": "^4.19.0",
101
- "zod": "^4"
100
+ "postal-mime": "^2.7.6",
101
+ "tsx": "^4.23.15",
102
+ "zod": "^4.6.7"
102
103
  },
103
- "bundledDependencies": [
104
- "flingflow"
105
- ],
106
104
  "devDependencies": {
107
- "@cloudflare/workers-types": "^4.0.0",
108
- "@eslint/js": "^9.39.2",
109
- "@types/better-sqlite3": "^7.6.12",
110
- "@types/node": "^24.10.9",
111
- "@vitest/coverage-v8": "^4.1.8",
112
- "eslint": "^9.39.2",
113
- "eslint-plugin-import-x": "^4.16.1",
105
+ "@biomejs/biome": "^2.5.5",
106
+ "@cloudflare/workers-types": "^5.20261024.1",
107
+ "@types/better-sqlite3": "^9.6.0",
108
+ "@types/node": "^24.19.2",
109
+ "@vitest/coverage-v8": "^4.1.12",
114
110
  "husky": "^9.1.7",
115
- "typescript": "^5.7.0",
116
- "typescript-eslint": "^8.53.0",
117
- "vitest": "^4.1.8",
118
- "wrangler": "^4.97.0"
111
+ "typescript": "^7.0.2",
112
+ "vitest": "^4.1.12",
113
+ "wrangler": "^4.152.0"
119
114
  },
120
115
  "workspaces": [
121
116
  "packages/*"
@@ -126,5 +121,14 @@
126
121
  "platform",
127
122
  "cloudflare",
128
123
  "workers"
129
- ]
124
+ ],
125
+ "bundleDependencies": [
126
+ "flingflow"
127
+ ],
128
+ "overrides": {
129
+ "esbuild": "$esbuild",
130
+ "miniflare": {
131
+ "undici": "7.30.1"
132
+ }
133
+ }
130
134
  }
@@ -1 +1 @@
1
- ebfc9d9d449a1e9fca9c2bce6e2d2978
1
+ 45e281a4d35574dc4e7bc44551901410
@@ -172,7 +172,6 @@ npx fling storage put <key> <file> # Upload file to storage
172
172
  npx fling storage get <key> [output] # Download object (stdout if no output)
173
173
  npx fling storage delete <key> --yes # Delete object
174
174
  npx fling storage info # Show storage stats
175
- npx fling tunnel 3000 # Expose localhost:3000 via public URL
176
175
  npx fling whoami # Show user info and available features (entitlements)
177
176
  ```
178
177
 
@@ -9,16 +9,16 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "react": "^19.2.4",
13
- "react-dom": "^19.2.4"
12
+ "react": "^19.3.1",
13
+ "react-dom": "^19.3.1"
14
14
  },
15
15
  "devDependencies": {
16
- "vite": "^7.3.1",
17
- "@vitejs/plugin-react": "^5.1.4",
18
- "@tailwindcss/vite": "^4",
19
- "tailwindcss": "^4",
20
- "@types/react": "^19.2.14",
21
- "@types/react-dom": "^19.2.3",
22
- "typescript": "~5.9.3"
16
+ "@tailwindcss/vite": "^4.3.3",
17
+ "@types/react": "^19.3.0",
18
+ "@types/react-dom": "^19.3.0",
19
+ "@vitejs/plugin-react": "^6.1.2",
20
+ "tailwindcss": "^4.3.3",
21
+ "typescript": "~5.9.3",
22
+ "vite": "^8.3.5"
23
23
  }
24
24
  }
@@ -1,41 +0,0 @@
1
- /**
2
- * fling tunnel - Expose local development server via Cloudflare Tunnel
3
- *
4
- * Uses cloudflared (Cloudflare's tunnel daemon) for high-performance,
5
- * concurrent request handling. The platform provisions tunnel credentials
6
- * and DNS records; the CLI runs cloudflared with the provided token.
7
- *
8
- * Usage:
9
- * fling tunnel 3000 # Tunnel localhost:3000
10
- */
11
- import { Command } from "commander";
12
- import { type PlatformFetchFn } from "../utils/config.js";
13
- import { type ConsoleIO, type ProcessIOWithSignals, type FileIO, type SpawnFn } from "../utils/cli-io.js";
14
- /**
15
- * Cloudflared module interface.
16
- */
17
- export interface CloudflaredModule {
18
- bin: string;
19
- install(binPath: string): Promise<string>;
20
- }
21
- /**
22
- * Combined dependencies for tunnel command.
23
- */
24
- export interface TunnelDeps {
25
- console: ConsoleIO;
26
- process: ProcessIOWithSignals;
27
- file: FileIO;
28
- spawn: SpawnFn;
29
- getToken: () => string | null;
30
- getProjectName: (cwd?: string) => string;
31
- platformFetch: PlatformFetchFn;
32
- importCloudflared: () => Promise<CloudflaredModule>;
33
- }
34
- export declare const defaultTunnelDeps: TunnelDeps;
35
- /**
36
- * Run the tunnel command.
37
- * Exported for testing with injected dependencies.
38
- */
39
- export declare function runTunnel(port: number, deps?: TunnelDeps): Promise<void>;
40
- export declare const tunnelCommand: Command;
41
- //# sourceMappingURL=tunnel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/tunnel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEnF,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,oBAAoB,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAoB,MAAM,oBAAoB,CAAC;AAQ5H;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAC9B,cAAc,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,aAAa,EAAE,eAAe,CAAC;IAC/B,iBAAiB,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACrD;AAMD,eAAO,MAAM,iBAAiB,EAAE,UAS/B,CAAC;AAqJF;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,UAA8B,GACnC,OAAO,CAAC,IAAI,CAAC,CAwDf;AAED,eAAO,MAAM,aAAa,SAoCtB,CAAC"}
@@ -1,211 +0,0 @@
1
- /**
2
- * fling tunnel - Expose local development server via Cloudflare Tunnel
3
- *
4
- * Uses cloudflared (Cloudflare's tunnel daemon) for high-performance,
5
- * concurrent request handling. The platform provisions tunnel credentials
6
- * and DNS records; the CLI runs cloudflared with the provided token.
7
- *
8
- * Usage:
9
- * fling tunnel 3000 # Tunnel localhost:3000
10
- */
11
- import { Command } from "commander";
12
- import { platformFetch, getToken } from "../utils/config.js";
13
- import { getProjectName } from "../utils/project-name.js";
14
- import { consoleIO, processIO, fileIO, spawnFn, projectNameFileDeps } from "../utils/cli-io-impl.js";
15
- import { NOT_LOGGED_IN_MESSAGE } from "./auth-shared.js";
16
- // ═══════════════════════════════════════════════════════
17
- // DEFAULT IMPLEMENTATIONS
18
- // ═══════════════════════════════════════════════════════
19
- export const defaultTunnelDeps = {
20
- console: consoleIO,
21
- process: processIO,
22
- file: fileIO,
23
- spawn: spawnFn,
24
- getToken,
25
- getProjectName: (cwd) => getProjectName(projectNameFileDeps, () => process.cwd(), cwd),
26
- platformFetch,
27
- importCloudflared: async () => import("cloudflared"),
28
- };
29
- // ═══════════════════════════════════════════════════════
30
- // CORE FUNCTIONS (with DI)
31
- // ═══════════════════════════════════════════════════════
32
- /**
33
- * Ensure cloudflared binary is installed.
34
- * Uses the 'cloudflared' npm package which handles platform-specific downloads.
35
- */
36
- async function ensureCloudflared(deps) {
37
- try {
38
- const cloudflared = await deps.importCloudflared();
39
- if (!deps.file.exists(cloudflared.bin)) {
40
- deps.console.log("Installing cloudflared...");
41
- await cloudflared.install(cloudflared.bin);
42
- deps.console.log("cloudflared installed successfully");
43
- }
44
- return cloudflared.bin;
45
- }
46
- catch (error) {
47
- deps.console.error(`Failed to install cloudflared: ${error instanceof Error ? error.message : String(error)}`);
48
- return null;
49
- }
50
- }
51
- /**
52
- * Request tunnel credentials from the platform.
53
- */
54
- async function startTunnel(projectName, localPort, deps) {
55
- try {
56
- const response = await deps.platformFetch(`/project/${encodeURIComponent(projectName)}/tun/start`, {
57
- method: "POST",
58
- headers: { "Content-Type": "application/json" },
59
- body: JSON.stringify({ localPort }),
60
- });
61
- if (!response.ok) {
62
- const error = await response.json().catch(() => ({}));
63
- deps.console.error(`Error: Failed to start tunnel: ${error.error ?? response.statusText}`);
64
- return null;
65
- }
66
- return (await response.json());
67
- }
68
- catch (error) {
69
- deps.console.error(`Error: Failed to connect to platform: ${error instanceof Error ? error.message : String(error)}`);
70
- return null;
71
- }
72
- }
73
- /**
74
- * Notify platform that tunnel is stopping.
75
- */
76
- async function stopTunnel(projectName, deps) {
77
- try {
78
- await deps.platformFetch(`/project/${encodeURIComponent(projectName)}/tun/stop`, { method: "DELETE" });
79
- }
80
- catch {
81
- // Ignore errors on cleanup
82
- }
83
- }
84
- /**
85
- * Run cloudflared with the provided token.
86
- */
87
- function runCloudflared(bin, tunnelToken, localPort, deps) {
88
- const args = [
89
- "tunnel",
90
- "--no-autoupdate",
91
- "run",
92
- "--token",
93
- tunnelToken,
94
- "--url",
95
- `http://localhost:${localPort}`,
96
- ];
97
- const child = deps.spawn(bin, args, {
98
- stdio: ["ignore", "pipe", "pipe"],
99
- });
100
- // Forward cloudflared output (stdout and stderr are piped, so they're non-null)
101
- child.stdout?.on("data", (data) => {
102
- const lines = data.toString().split("\n").filter(Boolean);
103
- for (const line of lines) {
104
- // Filter out noisy logs, show important ones
105
- if (line.includes("error") ||
106
- line.includes("failed") ||
107
- line.includes("connected") ||
108
- line.includes("Registered")) {
109
- deps.console.log(`[cloudflared] ${line}`);
110
- }
111
- }
112
- });
113
- child.stderr?.on("data", (data) => {
114
- const lines = data.toString().split("\n").filter(Boolean);
115
- for (const line of lines) {
116
- // cloudflared logs to stderr by default
117
- if (line.includes("ERR") ||
118
- line.includes("error") ||
119
- line.includes("failed")) {
120
- deps.console.error(`[cloudflared] ${line}`);
121
- }
122
- else if (line.includes("INF") &&
123
- (line.includes("connect") ||
124
- line.includes("Registered") ||
125
- line.includes("serving"))) {
126
- deps.console.log(`[cloudflared] ${line}`);
127
- }
128
- }
129
- });
130
- return child;
131
- }
132
- /**
133
- * Run the tunnel command.
134
- * Exported for testing with injected dependencies.
135
- */
136
- export async function runTunnel(port, deps = defaultTunnelDeps) {
137
- const token = deps.getToken();
138
- if (!token) {
139
- deps.console.error(`Error: ${NOT_LOGGED_IN_MESSAGE}`);
140
- deps.process.exit(1);
141
- }
142
- // Get project name from package.json (defaults to "default" for backwards compatibility)
143
- const projectName = deps.getProjectName();
144
- deps.console.log(`Starting tunnel to localhost:${port}...`);
145
- // Ensure cloudflared is installed
146
- const cloudflaredBin = await ensureCloudflared(deps);
147
- if (!cloudflaredBin) {
148
- deps.process.exit(1);
149
- }
150
- // Request tunnel credentials from platform
151
- const tunResponse = await startTunnel(projectName, port, deps);
152
- if (!tunResponse) {
153
- deps.process.exit(1);
154
- }
155
- deps.console.log(`\nTunnel URL: ${tunResponse.tunnelUrl}`);
156
- deps.console.log(`Forwarding to: http://localhost:${port}`);
157
- deps.console.log("\nPress Ctrl+C to disconnect\n");
158
- // Run cloudflared with the token
159
- const cloudflaredProcess = runCloudflared(cloudflaredBin, tunResponse.token, port, deps);
160
- // Handle graceful shutdown
161
- const cleanup = async () => {
162
- deps.console.log("\nDisconnecting tunnel...");
163
- cloudflaredProcess.kill("SIGTERM");
164
- // Stop tunnel on platform
165
- await stopTunnel(projectName, deps);
166
- deps.process.exit(0);
167
- };
168
- deps.process.on("SIGINT", () => void cleanup());
169
- deps.process.on("SIGTERM", () => void cleanup());
170
- // Wait for cloudflared to exit
171
- cloudflaredProcess.on("exit", (code) => {
172
- if (code !== 0 && code !== null) {
173
- deps.console.error(`cloudflared exited with code ${code}`);
174
- }
175
- deps.process.exit(code ?? 0);
176
- });
177
- }
178
- export const tunnelCommand = new Command("tunnel")
179
- .description("Expose local server via Cloudflare Tunnel")
180
- .argument("<port>", "Local port to tunnel")
181
- .addHelpText("after", `
182
- What it does:
183
- Creates a Cloudflare Tunnel from the internet to your local development server.
184
- External requests to the tunnel URL are forwarded to localhost:<port>.
185
-
186
- This uses cloudflared (Cloudflare's tunnel daemon) which provides:
187
- - Full concurrent request handling (no serialization)
188
- - Native Cloudflare edge integration
189
- - Automatic TLS termination
190
-
191
- Examples:
192
- fling tunnel 3000 Tunnel localhost:3000
193
-
194
- The tunnel URL will be displayed when connected. Keep the command running
195
- to maintain the tunnel. Press Ctrl+C to disconnect.
196
-
197
- Prerequisites:
198
- - Must be logged in (fling login)
199
- - Local server must be running on the specified port
200
-
201
- Note: cloudflared will be automatically downloaded on first use.
202
- `)
203
- .action(async (portArg) => {
204
- const port = parseInt(portArg, 10);
205
- if (isNaN(port) || port < 1 || port > 65535) {
206
- console.error("Error: Port must be a number between 1 and 65535");
207
- process.exit(1);
208
- }
209
- await runTunnel(port);
210
- });
211
- //# sourceMappingURL=tunnel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tunnel.js","sourceRoot":"","sources":["../../../src/cli/commands/tunnel.ts"],"names":[],"mappings":"AAAA;;;;;;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AE,GAAG,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;IAChD,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;IAEjD,+BAA+B;IAC/B,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QACrC,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAChC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,gCAAgC,IAAI,EAAE,CAAC,CAAC;QAC7D,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,2CAA2C,CAAC;KACxD,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;KAC1C,WAAW,CACV,OAAO,EACP;;;;;;;;;;;;;;;;;;;;;CAqBH,CACE;KACA,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,EAAE;IAChC,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACnC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,KAAK,EAAE,CAAC;QAC5C,OAAO,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QAClE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC,CAAC,CAAC"}
@@ -1,94 +0,0 @@
1
- import tseslint from "typescript-eslint";
2
-
3
- export default tseslint.config(
4
- {
5
- ignores: ["dist/**", "node_modules/**", "eslint.config.js"],
6
- },
7
- ...tseslint.configs.strictTypeChecked,
8
- ...tseslint.configs.stylisticTypeChecked,
9
- {
10
- languageOptions: {
11
- parserOptions: {
12
- project: "tsconfig.lint.json",
13
- tsconfigRootDir: import.meta.dirname,
14
- },
15
- },
16
- rules: {
17
- // Non-null assertions are forbidden — use `defined()` from @glideapps/ts-necessities
18
- "@typescript-eslint/no-non-null-assertion": "error",
19
-
20
- // Strictness
21
- "@typescript-eslint/no-explicit-any": "error",
22
- "@typescript-eslint/no-unsafe-argument": "error",
23
- "@typescript-eslint/no-unsafe-assignment": "error",
24
- "@typescript-eslint/no-unsafe-call": "error",
25
- "@typescript-eslint/no-unsafe-member-access": "error",
26
- "@typescript-eslint/no-unsafe-return": "error",
27
- "@typescript-eslint/explicit-function-return-type": ["error", {
28
- allowExpressions: true,
29
- allowTypedFunctionExpressions: true,
30
- }],
31
- "@typescript-eslint/explicit-module-boundary-types": "error",
32
- "@typescript-eslint/no-floating-promises": "error",
33
- "@typescript-eslint/no-misused-promises": "error",
34
- "@typescript-eslint/await-thenable": "error",
35
- "@typescript-eslint/require-await": "error",
36
- "@typescript-eslint/no-unnecessary-condition": "error",
37
- "@typescript-eslint/strict-boolean-expressions": ["error", {
38
- allowNullableBoolean: true,
39
- }],
40
- "@typescript-eslint/switch-exhaustiveness-check": "error",
41
- "@typescript-eslint/consistent-type-imports": ["error", {
42
- prefer: "type-imports",
43
- }],
44
- "@typescript-eslint/no-import-type-side-effects": "error",
45
- "@typescript-eslint/no-unused-vars": ["error", {
46
- argsIgnorePattern: "^_",
47
- }],
48
- "@typescript-eslint/prefer-nullish-coalescing": "error",
49
- "@typescript-eslint/prefer-optional-chain": "error",
50
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
51
- "@typescript-eslint/no-redundant-type-constituents": "error",
52
- "@typescript-eslint/restrict-template-expressions": ["error", {
53
- allowNumber: true,
54
- allowBoolean: true,
55
- }],
56
-
57
- // Core ESLint
58
- "eqeqeq": ["error", "always"],
59
- "no-eval": "error",
60
- "no-implied-eval": "off",
61
- "@typescript-eslint/no-implied-eval": "error",
62
- "no-var": "error",
63
- "prefer-const": "error",
64
- "no-throw-literal": "off",
65
- "@typescript-eslint/only-throw-error": "error",
66
- "no-constant-condition": "error",
67
- "no-debugger": "error",
68
- "no-duplicate-imports": "error",
69
- },
70
- },
71
- // Relaxed rules for tests
72
- {
73
- files: ["test/**/*.ts"],
74
- rules: {
75
- "@typescript-eslint/no-non-null-assertion": "off",
76
- "@typescript-eslint/no-explicit-any": "off",
77
- "@typescript-eslint/no-unsafe-argument": "off",
78
- "@typescript-eslint/no-unsafe-assignment": "off",
79
- "@typescript-eslint/no-unsafe-call": "off",
80
- "@typescript-eslint/no-unsafe-member-access": "off",
81
- "@typescript-eslint/no-unsafe-return": "off",
82
- "@typescript-eslint/no-floating-promises": "off",
83
- "@typescript-eslint/strict-boolean-expressions": "off",
84
- "@typescript-eslint/explicit-function-return-type": "off",
85
- "@typescript-eslint/explicit-module-boundary-types": "off",
86
- "@typescript-eslint/no-empty-function": "off",
87
- "@typescript-eslint/require-await": "off",
88
- "@typescript-eslint/no-unused-vars": ["error", {
89
- argsIgnorePattern: "^_",
90
- varsIgnorePattern: "^_",
91
- }],
92
- },
93
- },
94
- );
@@ -1,5 +0,0 @@
1
- {
2
- "extends": "./tsconfig.typecheck.json",
3
- "include": ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"],
4
- "exclude": ["node_modules", "dist"]
5
- }