fastscript 0.1.1 → 2.0.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/CHANGELOG.md +31 -2
- package/LICENSE +33 -21
- package/README.md +568 -59
- package/node_modules/@fastscript/core-private/BOUNDARY.json +15 -0
- package/node_modules/@fastscript/core-private/README.md +5 -0
- package/node_modules/@fastscript/core-private/package.json +34 -0
- package/node_modules/@fastscript/core-private/src/asset-optimizer.mjs +67 -0
- package/node_modules/@fastscript/core-private/src/audit-log.mjs +50 -0
- package/node_modules/@fastscript/core-private/src/auth-flows.mjs +29 -0
- package/node_modules/@fastscript/core-private/src/auth.mjs +115 -0
- package/node_modules/@fastscript/core-private/src/bench.mjs +45 -0
- package/node_modules/@fastscript/core-private/src/build.mjs +670 -0
- package/node_modules/@fastscript/core-private/src/cache.mjs +248 -0
- package/node_modules/@fastscript/core-private/src/check.mjs +22 -0
- package/node_modules/@fastscript/core-private/src/cli.mjs +95 -0
- package/node_modules/@fastscript/core-private/src/compat.mjs +128 -0
- package/node_modules/@fastscript/core-private/src/create.mjs +278 -0
- package/node_modules/@fastscript/core-private/src/csp.mjs +26 -0
- package/node_modules/@fastscript/core-private/src/db-cli.mjs +185 -0
- package/node_modules/@fastscript/core-private/src/db-postgres-collection.mjs +110 -0
- package/node_modules/@fastscript/core-private/src/db-postgres.mjs +40 -0
- package/node_modules/@fastscript/core-private/src/db.mjs +103 -0
- package/node_modules/@fastscript/core-private/src/deploy.mjs +662 -0
- package/node_modules/@fastscript/core-private/src/dev.mjs +5 -0
- package/node_modules/@fastscript/core-private/src/docs-search.mjs +35 -0
- package/node_modules/@fastscript/core-private/src/env.mjs +118 -0
- package/node_modules/@fastscript/core-private/src/export.mjs +83 -0
- package/node_modules/@fastscript/core-private/src/fs-diagnostics.mjs +70 -0
- package/node_modules/@fastscript/core-private/src/fs-error-codes.mjs +141 -0
- package/node_modules/@fastscript/core-private/src/fs-formatter.mjs +66 -0
- package/node_modules/@fastscript/core-private/src/fs-linter.mjs +274 -0
- package/node_modules/@fastscript/core-private/src/fs-normalize.mjs +91 -0
- package/node_modules/@fastscript/core-private/src/fs-parser.mjs +980 -0
- package/node_modules/@fastscript/core-private/src/generated/docs-search-index.mjs +3182 -0
- package/node_modules/@fastscript/core-private/src/i18n.mjs +25 -0
- package/node_modules/@fastscript/core-private/src/interop.mjs +16 -0
- package/node_modules/@fastscript/core-private/src/jobs.mjs +378 -0
- package/node_modules/@fastscript/core-private/src/logger.mjs +27 -0
- package/node_modules/@fastscript/core-private/src/metrics.mjs +45 -0
- package/node_modules/@fastscript/core-private/src/middleware.mjs +14 -0
- package/node_modules/@fastscript/core-private/src/migrate.mjs +81 -0
- package/node_modules/@fastscript/core-private/src/migration-wizard.mjs +16 -0
- package/node_modules/@fastscript/core-private/src/module-loader.mjs +46 -0
- package/node_modules/@fastscript/core-private/src/oauth-providers.mjs +103 -0
- package/node_modules/@fastscript/core-private/src/observability.mjs +21 -0
- package/node_modules/@fastscript/core-private/src/plugins.mjs +194 -0
- package/node_modules/@fastscript/core-private/src/retention.mjs +57 -0
- package/node_modules/@fastscript/core-private/src/routes.mjs +178 -0
- package/node_modules/@fastscript/core-private/src/scheduler.mjs +104 -0
- package/node_modules/@fastscript/core-private/src/security.mjs +233 -0
- package/node_modules/@fastscript/core-private/src/server-runtime.mjs +849 -0
- package/node_modules/@fastscript/core-private/src/serverless-handler.mjs +20 -0
- package/node_modules/@fastscript/core-private/src/session-policy.mjs +38 -0
- package/node_modules/@fastscript/core-private/src/start.mjs +10 -0
- package/node_modules/@fastscript/core-private/src/storage.mjs +155 -0
- package/node_modules/@fastscript/core-private/src/style-primitives.mjs +538 -0
- package/node_modules/@fastscript/core-private/src/style-system.mjs +461 -0
- package/node_modules/@fastscript/core-private/src/tenant.mjs +55 -0
- package/node_modules/@fastscript/core-private/src/typecheck.mjs +1464 -0
- package/node_modules/@fastscript/core-private/src/validate.mjs +22 -0
- package/node_modules/@fastscript/core-private/src/validation.mjs +88 -0
- package/node_modules/@fastscript/core-private/src/webhook.mjs +81 -0
- package/node_modules/@fastscript/core-private/src/worker.mjs +24 -0
- package/package.json +88 -8
- package/src/asset-optimizer.mjs +67 -0
- package/src/audit-log.mjs +50 -0
- package/src/auth.mjs +1 -115
- package/src/bench.mjs +20 -7
- package/src/build.mjs +1 -222
- package/src/cache.mjs +210 -20
- package/src/cli.mjs +29 -5
- package/src/compat.mjs +7 -1
- package/src/create.mjs +65 -11
- package/src/csp.mjs +26 -0
- package/src/db-cli.mjs +158 -18
- package/src/db-postgres-collection.mjs +110 -0
- package/src/deploy.mjs +1 -65
- package/src/docs-search.mjs +35 -0
- package/src/env.mjs +34 -5
- package/src/fs-diagnostics.mjs +70 -0
- package/src/fs-error-codes.mjs +126 -0
- package/src/fs-formatter.mjs +66 -0
- package/src/fs-linter.mjs +274 -0
- package/src/fs-normalize.mjs +17 -26
- package/src/fs-parser.mjs +1 -0
- package/src/generated/docs-search-index.mjs +3220 -0
- package/src/i18n.mjs +25 -0
- package/src/jobs.mjs +283 -32
- package/src/metrics.mjs +45 -0
- package/src/migration-wizard.mjs +16 -0
- package/src/module-loader.mjs +46 -0
- package/src/oauth-providers.mjs +103 -0
- package/src/plugins.mjs +194 -0
- package/src/retention.mjs +57 -0
- package/src/routes.mjs +178 -0
- package/src/scheduler.mjs +104 -0
- package/src/security.mjs +197 -19
- package/src/server-runtime.mjs +1 -339
- package/src/serverless-handler.mjs +20 -0
- package/src/session-policy.mjs +38 -0
- package/src/storage.mjs +1 -56
- package/src/style-system.mjs +461 -0
- package/src/tenant.mjs +55 -0
- package/src/typecheck.mjs +1 -0
- package/src/validate.mjs +5 -1
- package/src/validation.mjs +14 -5
- package/src/webhook.mjs +1 -71
- package/src/worker.mjs +23 -4
package/README.md
CHANGED
|
@@ -1,102 +1,611 @@
|
|
|
1
1
|
# FastScript
|
|
2
2
|
|
|
3
|
-
FastScript is a JavaScript-first full-stack
|
|
3
|
+
FastScript is a JavaScript-first full-stack language runtime built around a first-class `.fs` file format.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- Faster build and runtime pipeline
|
|
7
|
-
- Compatible with existing JavaScript ecosystem
|
|
8
|
-
- `.fs` first, `.js` always supported
|
|
5
|
+
It is designed to feel easier to read than heavyweight stack combinations while staying compatible with the JavaScript ecosystem developers already use.
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
- Write pages, APIs, middleware, jobs, and database workflows in `.fs`
|
|
8
|
+
- Keep compatibility with normal `.js` packages and modules
|
|
9
|
+
- Compile to optimized JavaScript for production deployment
|
|
10
|
+
- Deploy the same app to Node, Vercel, or Cloudflare
|
|
11
|
+
- Run one quality gate for formatting, linting, typecheck, tests, smoke checks, benchmarks, and interop
|
|
12
|
+
|
|
13
|
+
FastScript v2.0 is built for product teams that want a simpler, faster full-stack pipeline without surrendering compatibility with the ground-level JavaScript platform.
|
|
14
|
+
|
|
15
|
+
## What FastScript Is
|
|
16
|
+
|
|
17
|
+
FastScript combines:
|
|
18
|
+
|
|
19
|
+
1. A source language: `.fs`
|
|
20
|
+
2. A compiler and CLI
|
|
21
|
+
3. A full-stack app runtime
|
|
22
|
+
4. A deployment pipeline for multiple targets
|
|
23
|
+
5. A bridge back to standard JavaScript and TypeScript export paths
|
|
24
|
+
|
|
25
|
+
That means a single project can contain:
|
|
26
|
+
|
|
27
|
+
- UI pages
|
|
28
|
+
- API handlers
|
|
29
|
+
- middleware
|
|
30
|
+
- database migrations
|
|
31
|
+
- seed scripts
|
|
32
|
+
- jobs and workers
|
|
33
|
+
- deploy adapters
|
|
34
|
+
|
|
35
|
+
## Core Positioning
|
|
36
|
+
|
|
37
|
+
FastScript is built to be:
|
|
38
|
+
|
|
39
|
+
- Simpler than stacking TypeScript + framework + glue code everywhere
|
|
40
|
+
- Faster to build and ship than heavier pipeline combinations
|
|
41
|
+
- Compatible with existing JavaScript libraries
|
|
42
|
+
- Friendly to AI-assisted generation because the language surface is smaller and more regular
|
|
43
|
+
- Easy to migrate into and easy to export back out
|
|
44
|
+
|
|
45
|
+
## Current Measured Numbers
|
|
46
|
+
|
|
47
|
+
These are the real measured numbers from the current repo benchmark report:
|
|
48
|
+
|
|
49
|
+
- Build time: `702.98ms`
|
|
50
|
+
- JS first-load gzip: `2.71KB`
|
|
51
|
+
- Routes in benchmark app: `16`
|
|
52
|
+
- API routes in benchmark app: `5`
|
|
53
|
+
- Interop matrix: `13/13` passing
|
|
54
|
+
- Current website deploy target: Node, Vercel, and Cloudflare adapters supported
|
|
55
|
+
|
|
56
|
+
See:
|
|
57
|
+
|
|
58
|
+
- `benchmarks/latest-report.md`
|
|
59
|
+
- `benchmarks/suite-latest.json`
|
|
60
|
+
- `benchmarks/interop-latest.json`
|
|
61
|
+
|
|
62
|
+
## Install
|
|
63
|
+
|
|
64
|
+
### Option 1: npm install
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm install -g fastscript
|
|
68
|
+
fastscript --help
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The published npm package is generated as a self-contained release bundle, so the CLI works without a second private npm package.
|
|
72
|
+
|
|
73
|
+
### Option 2: local repo workflow
|
|
11
74
|
|
|
12
75
|
```bash
|
|
76
|
+
git clone https://github.com/lordolami/fastscript.git
|
|
77
|
+
cd fastscript
|
|
13
78
|
npm install
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Option 3: global CLI link for daily use
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
git clone https://github.com/lordolami/fastscript.git
|
|
85
|
+
cd fastscript
|
|
86
|
+
npm install
|
|
87
|
+
npm link
|
|
88
|
+
fastscript --help
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
This gives you a global `fastscript` command backed by your local clone.
|
|
92
|
+
|
|
93
|
+
The source repos remain split for development, but npm users get a clean self-contained public package.
|
|
94
|
+
|
|
95
|
+
To use the CLI directly during development:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
node ./src/cli.mjs --help
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
If you publish or link the package locally, the command is:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
fastscript
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Quick Start
|
|
108
|
+
|
|
109
|
+
### Create a project
|
|
110
|
+
|
|
111
|
+
```bash
|
|
14
112
|
npm run create
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Or use one of the included templates:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm run create:fullstack
|
|
119
|
+
npm run create:startup-mvp
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Run locally
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npm run dev
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Link the CLI globally from your clone
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
npm link
|
|
132
|
+
fastscript create my-app
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Build for production
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npm run build
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Start the production build
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npm run start
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Run the full quality gate
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npm run qa:all
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## The `.fs` Language At A Glance
|
|
154
|
+
|
|
155
|
+
FastScript keeps normal JavaScript module structure and adds a few core forms:
|
|
156
|
+
|
|
157
|
+
- `fn` for functions
|
|
158
|
+
- `state` for named stateful declarations
|
|
159
|
+
- `~name = ...` for lightweight reactive-style declarations
|
|
160
|
+
- type syntax that can be stripped at compile time
|
|
161
|
+
- file conventions for pages, APIs, and runtime hooks
|
|
162
|
+
|
|
163
|
+
### Example: basic page
|
|
164
|
+
|
|
165
|
+
```fs
|
|
166
|
+
export default fn Page() {
|
|
167
|
+
state title = "FastScript"
|
|
168
|
+
~subtitle = "Write once. Ship anywhere."
|
|
169
|
+
|
|
170
|
+
return `
|
|
171
|
+
<section>
|
|
172
|
+
<h1>${title}</h1>
|
|
173
|
+
<p>${subtitle}</p>
|
|
174
|
+
</section>
|
|
175
|
+
`
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Example: load data for a page
|
|
180
|
+
|
|
181
|
+
```fs
|
|
182
|
+
export async fn load(ctx) {
|
|
183
|
+
const user = await ctx.db.get("users", ctx.params.id)
|
|
184
|
+
if (!user) return { notFound: true }
|
|
185
|
+
return { user }
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export default fn Page({ user }) {
|
|
189
|
+
return `<h1>${user.name}</h1>`
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Example: API route
|
|
194
|
+
|
|
195
|
+
```fs
|
|
196
|
+
export const schemas = {
|
|
197
|
+
POST: { sku: "string", qty: "int" }
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export async fn POST(ctx) {
|
|
201
|
+
const body = await ctx.input.validateBody(schemas.POST)
|
|
202
|
+
const order = { id: Date.now().toString(36), ...body }
|
|
203
|
+
ctx.db.collection("orders").set(order.id, order)
|
|
204
|
+
ctx.queue.enqueue("send-order-email", { orderId: order.id })
|
|
205
|
+
return ctx.helpers.json({ ok: true, order })
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Example: middleware
|
|
210
|
+
|
|
211
|
+
```fs
|
|
212
|
+
export async fn middleware(ctx, next) {
|
|
213
|
+
ctx.state.requestStartedAt = Date.now()
|
|
214
|
+
|
|
215
|
+
if (ctx.url.pathname.startsWith("/private") && !ctx.session?.user) {
|
|
216
|
+
return ctx.helpers.redirect("/")
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return next()
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Example: hydration hook for client behavior
|
|
224
|
+
|
|
225
|
+
```fs
|
|
226
|
+
export function hydrate({ root }) {
|
|
227
|
+
const button = root.querySelector("[data-action]")
|
|
228
|
+
if (!button) return
|
|
229
|
+
|
|
230
|
+
button.addEventListener("click", () => {
|
|
231
|
+
console.log("hydrated")
|
|
232
|
+
})
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Page Contract
|
|
237
|
+
|
|
238
|
+
A FastScript page can export any of the following:
|
|
239
|
+
|
|
240
|
+
- `export default fn Page(...)` or `export default function Page(...)`
|
|
241
|
+
- `export async fn load(ctx)` for server-side data loading
|
|
242
|
+
- `export function hydrate({ root, ...ctx })` for client behavior
|
|
243
|
+
- HTTP method handlers like `POST`, `PUT`, `PATCH`, `DELETE`
|
|
244
|
+
|
|
245
|
+
### Minimal page
|
|
246
|
+
|
|
247
|
+
```fs
|
|
248
|
+
export default fn Page() {
|
|
249
|
+
return `<h1>Hello</h1>`
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Page with loader
|
|
254
|
+
|
|
255
|
+
```fs
|
|
256
|
+
export async fn load(ctx) {
|
|
257
|
+
return { now: new Date().toISOString() }
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export default fn Page({ now }) {
|
|
261
|
+
return `<p>${now}</p>`
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Routing
|
|
266
|
+
|
|
267
|
+
FastScript uses file-based routing under `app/pages`.
|
|
268
|
+
|
|
269
|
+
### Route examples
|
|
270
|
+
|
|
271
|
+
- `app/pages/index.fs` -> `/`
|
|
272
|
+
- `app/pages/blog/index.fs` -> `/blog`
|
|
273
|
+
- `app/pages/blog/[slug].fs` -> `/blog/:slug`
|
|
274
|
+
- `app/pages/docs/[...slug].fs` -> `/docs/:slug*`
|
|
275
|
+
- `app/pages/[[...slug]].fs` -> optional catch-all
|
|
276
|
+
- `app/pages/blog/[id:int].fs` -> typed param route
|
|
277
|
+
- `app/pages/404.fs` -> not-found page
|
|
278
|
+
- `app/pages/_layout.fs` -> global layout wrapper
|
|
279
|
+
|
|
280
|
+
## Full-Stack Surface Area
|
|
281
|
+
|
|
282
|
+
FastScript currently includes first-party support for:
|
|
283
|
+
|
|
284
|
+
- pages
|
|
285
|
+
- layouts
|
|
286
|
+
- API routes
|
|
287
|
+
- middleware
|
|
288
|
+
- auth/session flows
|
|
289
|
+
- database migrations
|
|
290
|
+
- database seed scripts
|
|
291
|
+
- storage and upload handlers
|
|
292
|
+
- jobs and worker runtime
|
|
293
|
+
- deploy targets
|
|
294
|
+
- benchmark and interop reporting
|
|
295
|
+
- docs indexing and API reference generation
|
|
296
|
+
|
|
297
|
+
## Interop Story
|
|
298
|
+
|
|
299
|
+
FastScript is designed to sit on top of the JavaScript ecosystem, not replace it with an isolated wall.
|
|
300
|
+
|
|
301
|
+
### What works
|
|
302
|
+
|
|
303
|
+
- normal `.js` dependencies
|
|
304
|
+
- ESM/CJS compatibility checks
|
|
305
|
+
- export from `.fs` to `.js`
|
|
306
|
+
- export from `.fs` to `.ts`
|
|
307
|
+
- migration tooling from page-based JS/TS apps into `.fs`
|
|
308
|
+
|
|
309
|
+
### Why that matters
|
|
310
|
+
|
|
311
|
+
Developers should be able to:
|
|
312
|
+
|
|
313
|
+
1. migrate into FastScript without rewriting the whole world
|
|
314
|
+
2. use existing libraries
|
|
315
|
+
3. export back out when needed
|
|
316
|
+
4. keep real production optionality
|
|
317
|
+
|
|
318
|
+
## Commands
|
|
319
|
+
|
|
320
|
+
### Main app lifecycle
|
|
321
|
+
|
|
322
|
+
```bash
|
|
15
323
|
npm run dev
|
|
16
324
|
npm run start
|
|
17
325
|
npm run build
|
|
326
|
+
npm run build:ssg
|
|
327
|
+
npm run create
|
|
18
328
|
npm run check
|
|
329
|
+
npm run validate
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### Language and migration
|
|
333
|
+
|
|
334
|
+
```bash
|
|
19
335
|
npm run migrate
|
|
20
|
-
npm run
|
|
336
|
+
npm run wizard:migrate
|
|
21
337
|
npm run export:js
|
|
22
338
|
npm run export:ts
|
|
23
339
|
npm run compat
|
|
24
|
-
npm run
|
|
340
|
+
npm run typecheck
|
|
341
|
+
npm run typecheck:pass
|
|
342
|
+
npm run lint:fs
|
|
343
|
+
npm run lint:fs:pass
|
|
344
|
+
npm run format
|
|
345
|
+
npm run format:check
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Database and data
|
|
349
|
+
|
|
350
|
+
```bash
|
|
25
351
|
npm run db:migrate
|
|
26
352
|
npm run db:seed
|
|
353
|
+
npm run db:rollback
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### Deploy and runtime
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
npm run deploy:node
|
|
360
|
+
npm run deploy:vercel
|
|
361
|
+
npm run deploy:cloudflare
|
|
362
|
+
npm run worker
|
|
363
|
+
npm run worker:replay-dead-letter
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Quality and testing
|
|
367
|
+
|
|
368
|
+
```bash
|
|
27
369
|
npm run smoke:dev
|
|
28
370
|
npm run smoke:start
|
|
29
371
|
npm run test:core
|
|
30
|
-
npm run
|
|
372
|
+
npm run test:conformance
|
|
373
|
+
npm run test:plugins
|
|
374
|
+
npm run test:routes
|
|
375
|
+
npm run test:interop-matrix
|
|
376
|
+
npm run test:vscode-language
|
|
377
|
+
npm run qa:gate
|
|
31
378
|
npm run qa:all
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### Benchmarks, reports, and ops
|
|
382
|
+
|
|
383
|
+
```bash
|
|
384
|
+
npm run bench
|
|
385
|
+
npm run bench:report
|
|
386
|
+
npm run benchmark:suite
|
|
387
|
+
npm run interop:report
|
|
388
|
+
npm run sbom:generate
|
|
389
|
+
npm run proof:publish
|
|
390
|
+
npm run backup:create
|
|
391
|
+
npm run backup:restore
|
|
392
|
+
npm run backup:verify
|
|
393
|
+
npm run retention:sweep
|
|
394
|
+
npm run kpi:track
|
|
395
|
+
npm run deploy:zero-downtime
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Release and tooling
|
|
399
|
+
|
|
400
|
+
```bash
|
|
36
401
|
npm run release:patch
|
|
402
|
+
npm run release:minor
|
|
403
|
+
npm run release:major
|
|
37
404
|
npm run pack:check
|
|
405
|
+
npm run hooks:install
|
|
406
|
+
npm run repo:lock
|
|
407
|
+
npm run plugins:marketplace-sync
|
|
408
|
+
npm run docs:index
|
|
409
|
+
npm run docs:api-ref
|
|
410
|
+
npm run style:generate
|
|
411
|
+
npm run style:check
|
|
38
412
|
```
|
|
39
413
|
|
|
40
|
-
|
|
41
|
-
- `npm run bench`: enforce 3G-oriented gzip budgets on built output
|
|
42
|
-
- `npm run export:js`: export `.fs` app source to plain `.js` project
|
|
43
|
-
- `npm run export:ts`: export `.fs` app source to `.ts` project
|
|
44
|
-
- `npm run compat`: run ESM/CJS/FS interop smoke checks
|
|
45
|
-
- `npm run db:migrate`: run database migrations from `app/db/migrations`
|
|
46
|
-
- `npm run db:seed`: seed database from `app/db/seed.js`
|
|
47
|
-
- `npm run validate`: run full quality gate (check/build/bench/compat/db/export)
|
|
48
|
-
- `npm run smoke:dev`: automated SSR/API/auth/middleware smoke test
|
|
49
|
-
- `npm run smoke:start`: production `fastscript start` smoke test
|
|
50
|
-
- `npm run test:core`: middleware/auth/db/migration round-trip tests
|
|
51
|
-
- `npm run bench:report`: writes benchmark report to `benchmarks/latest-report.md`
|
|
52
|
-
- `npm run qa:all`: full quality sweep in one command
|
|
53
|
-
- `npm run worker`: run queue worker runtime
|
|
54
|
-
- `npm run deploy:*`: generate deploy adapters for node/vercel/cloudflare
|
|
55
|
-
- `npm run release:*`: semver bump + changelog append
|
|
56
|
-
- `npm run pack:check`: npm publish dry-run
|
|
57
|
-
|
|
58
|
-
## Additional Docs
|
|
414
|
+
## Recommended Developer Flow
|
|
59
415
|
|
|
60
|
-
|
|
61
|
-
- `docs/PLUGIN_API_CONTRACT.md`
|
|
62
|
-
- `docs/INCIDENT_PLAYBOOK.md`
|
|
63
|
-
- `docs/DEPLOY_GUIDE.md`
|
|
416
|
+
For normal development:
|
|
64
417
|
|
|
65
|
-
|
|
418
|
+
```bash
|
|
419
|
+
npm install
|
|
420
|
+
npm run dev
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
Before shipping:
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
npm run qa:all
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
For deployment:
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
npm run deploy:cloudflare
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
Or:
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
npm run deploy:node
|
|
439
|
+
npm run deploy:vercel
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
## Project Layout
|
|
66
443
|
|
|
67
444
|
```txt
|
|
68
445
|
app/
|
|
69
|
-
pages/
|
|
70
|
-
_layout.fs
|
|
71
|
-
index.fs
|
|
72
|
-
404.fs
|
|
73
446
|
api/
|
|
74
|
-
|
|
75
|
-
|
|
447
|
+
auth.fs
|
|
448
|
+
docs-search.fs
|
|
449
|
+
hello.fs
|
|
450
|
+
upload.fs
|
|
451
|
+
webhook.fs
|
|
76
452
|
db/
|
|
77
453
|
migrations/
|
|
78
|
-
001_init.
|
|
79
|
-
seed.
|
|
454
|
+
001_init.fs
|
|
455
|
+
seed.fs
|
|
456
|
+
design/
|
|
457
|
+
class-allowlist.json
|
|
458
|
+
tokens.json
|
|
459
|
+
pages/
|
|
460
|
+
_layout.fs
|
|
461
|
+
index.fs
|
|
462
|
+
learn.fs
|
|
463
|
+
examples.fs
|
|
464
|
+
benchmarks.fs
|
|
465
|
+
roadmap.fs
|
|
466
|
+
docs/
|
|
467
|
+
index.fs
|
|
468
|
+
latest.fs
|
|
469
|
+
playground.fs
|
|
470
|
+
search.fs
|
|
471
|
+
v1/
|
|
472
|
+
index.fs
|
|
473
|
+
v1.1/
|
|
474
|
+
index.fs
|
|
475
|
+
blog/
|
|
476
|
+
index.fs
|
|
477
|
+
[slug].fs
|
|
478
|
+
env.schema.fs
|
|
80
479
|
middleware.fs
|
|
81
480
|
styles.css
|
|
481
|
+
styles.generated.css
|
|
482
|
+
src/
|
|
483
|
+
cli.mjs
|
|
484
|
+
build.mjs
|
|
485
|
+
server-runtime.mjs
|
|
486
|
+
examples/
|
|
487
|
+
fullstack/
|
|
488
|
+
startup-mvp/
|
|
489
|
+
spec/
|
|
490
|
+
LANGUAGE_V1_SPEC.md
|
|
491
|
+
MASTER_TODO.md
|
|
82
492
|
```
|
|
83
493
|
|
|
84
|
-
##
|
|
494
|
+
## Example Projects Included
|
|
85
495
|
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
- Optional method actions in page files: `POST/PUT/PATCH/DELETE`
|
|
89
|
-
- `.fs` supports lenient FastScript syntax such as `~state = value`
|
|
90
|
-
- Optional `export function hydrate({ root, ...ctx })` for client hydration
|
|
496
|
+
### `examples/fullstack`
|
|
497
|
+
A production-style full-stack starter with:
|
|
91
498
|
|
|
92
|
-
|
|
499
|
+
- pages
|
|
500
|
+
- API route
|
|
501
|
+
- migration
|
|
502
|
+
- seed script
|
|
503
|
+
- job handler
|
|
504
|
+
- layout
|
|
505
|
+
|
|
506
|
+
### `examples/startup-mvp`
|
|
507
|
+
A more startup-shaped example with:
|
|
508
|
+
|
|
509
|
+
- cart + checkout APIs
|
|
510
|
+
- dashboard page
|
|
511
|
+
- migrations
|
|
512
|
+
- email job flow
|
|
513
|
+
|
|
514
|
+
## Deploy Targets
|
|
515
|
+
|
|
516
|
+
FastScript currently has deploy adapters for:
|
|
517
|
+
|
|
518
|
+
- Node
|
|
519
|
+
- Vercel
|
|
520
|
+
- Cloudflare
|
|
521
|
+
|
|
522
|
+
The long-term direction is one language, many targets:
|
|
523
|
+
|
|
524
|
+
- web
|
|
525
|
+
- server
|
|
526
|
+
- mobile
|
|
527
|
+
- desktop
|
|
528
|
+
|
|
529
|
+
That roadmap is tracked in:
|
|
530
|
+
|
|
531
|
+
- `spec/MULTI_TARGET_APP_PLAN.md`
|
|
532
|
+
- `app/pages/roadmap.fs`
|
|
533
|
+
|
|
534
|
+
## Documentation Map
|
|
535
|
+
|
|
536
|
+
Key docs in this repo:
|
|
537
|
+
|
|
538
|
+
- `spec/LANGUAGE_V1_SPEC.md`
|
|
539
|
+
- `spec/STYLING_V1_SPEC.md`
|
|
540
|
+
- `docs/GOVERNANCE_VERSIONING_POLICY.md`
|
|
541
|
+
- `docs/LANGUAGE_V1_MIGRATION.md`
|
|
542
|
+
- `docs/COMPILER_ERROR_CODES.md`
|
|
543
|
+
- `docs/AI_CONTEXT_PACK_V1.md`
|
|
544
|
+
- `docs/PLUGIN_API_CONTRACT.md`
|
|
545
|
+
- `docs/INCIDENT_PLAYBOOK.md` (public stub; full version lives in private core)
|
|
546
|
+
- `docs/DEPLOY_GUIDE.md`
|
|
547
|
+
- `docs/SUPPORT_MATRIX.md`
|
|
548
|
+
- `docs/RELEASE_PROCESS.md`
|
|
549
|
+
- `docs/TROUBLESHOOTING.md`
|
|
550
|
+
- `docs/ARCHITECTURE_OVERVIEW.md`
|
|
551
|
+
- `docs/KNOWN_LIMITATIONS.md`
|
|
552
|
+
- `docs/CONTRIBUTING.md`
|
|
553
|
+
- `docs/OBSERVABILITY.md` (public stub; full version lives in private core)
|
|
554
|
+
- `docs/ROLLOUT_GUIDE.md` (public stub; full version lives in private core)
|
|
555
|
+
- `SECURITY.md`
|
|
556
|
+
|
|
557
|
+
## Protection, Licensing, and Commercial Use
|
|
558
|
+
|
|
559
|
+
FastScript is being built as the core language layer for a larger AI product. Because of that, the repository is not licensed under a permissive open-source license.
|
|
560
|
+
|
|
561
|
+
What that means in practice:
|
|
562
|
+
|
|
563
|
+
- you can review the repository and evaluate it internally;
|
|
564
|
+
- you cannot commercially use, redistribute, relicense, or build competing products on top of this code without written permission;
|
|
565
|
+
- you cannot use this repository to train, fine-tune, improve, or evaluate a commercial AI product without written permission;
|
|
566
|
+
- trademark rights in the FastScript name, logo, and branding are reserved.
|
|
567
|
+
|
|
568
|
+
If you need commercial use, partnership, integration, or platform rights, contact:
|
|
569
|
+
|
|
570
|
+
- `legal@fastscript.dev`
|
|
571
|
+
|
|
572
|
+
## Contributing
|
|
573
|
+
|
|
574
|
+
FastScript is evolving quickly. If you contribute:
|
|
575
|
+
|
|
576
|
+
1. keep the canonical repo lock intact
|
|
577
|
+
2. run `npm run qa:all`
|
|
578
|
+
3. keep `.fs` and `.js` interop working
|
|
579
|
+
4. avoid unnecessary ecosystem lock-in
|
|
580
|
+
5. preserve the language goal: simpler, faster, still grounded in JavaScript
|
|
581
|
+
|
|
582
|
+
Contribution review does not grant any right to commercially reuse the platform outside the repository license.
|
|
583
|
+
|
|
584
|
+
## Public/Private Boundary
|
|
585
|
+
|
|
586
|
+
This public repository is the developer-facing FastScript surface. Sensitive compiler/runtime/platform materials now live in the protected private repository `https://github.com/lordolami/fastscript-core-private`. The public repo consumes private-core modules through bridge files and tracks the boundary in `docs/PRIVATE_CORE_SPLIT.md`.
|
|
587
|
+
|
|
588
|
+
## Canonical Repo
|
|
589
|
+
|
|
590
|
+
Canonical repo lock:
|
|
591
|
+
|
|
592
|
+
`github.com/lordolami/fastscript`
|
|
593
|
+
|
|
594
|
+
The repo lock script is:
|
|
595
|
+
|
|
596
|
+
```bash
|
|
597
|
+
npm run repo:lock
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
## License
|
|
93
601
|
|
|
94
|
-
|
|
95
|
-
- `app/pages/blog/index.fs` or `index.js` -> `/blog`
|
|
96
|
-
- `app/pages/blog/[slug].fs` or `[slug].js` -> `/blog/:slug`
|
|
97
|
-
- `app/pages/404.fs` or `404.js` -> not found view
|
|
98
|
-
- `app/pages/_layout.fs` or `_layout.js` -> global layout wrapper
|
|
602
|
+
This repository is licensed under the FastScript Source-Available License v1.
|
|
99
603
|
|
|
100
|
-
|
|
604
|
+
See:
|
|
101
605
|
|
|
102
|
-
|
|
606
|
+
- `LICENSE`
|
|
607
|
+
- `SECURITY.md`
|
|
608
|
+
- `app/pages/license.fs`
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sourceOfTruth": true,
|
|
3
|
+
"publicSurfaceRepo": "https://github.com/lordolami/fastscript",
|
|
4
|
+
"privateCoreRepo": "https://github.com/lordolami/fastscript-core-private",
|
|
5
|
+
"exportedModules": [
|
|
6
|
+
"build",
|
|
7
|
+
"deploy",
|
|
8
|
+
"server-runtime",
|
|
9
|
+
"parser",
|
|
10
|
+
"typecheck",
|
|
11
|
+
"auth",
|
|
12
|
+
"storage",
|
|
13
|
+
"webhook"
|
|
14
|
+
]
|
|
15
|
+
}
|