@yannosay/sinth 5.3.2 → 5.3.3

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 CHANGED
@@ -1,5 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.3.3
4
+
5
+ ### Hosting
6
+
7
+ - **`platform` option** (`sinth.config.json`, or `--platform` on `sinth build` and `sinth deploy`): `cloudflare` (default), `cloudflare-workers`, `vercel`, `netlify`, `github-pages` or `static`. The build writes what the host needs and `sinth deploy` uploads to it.
8
+ - **Cloudflare Workers.** The site is served with Workers Static Assets. Routes in `functions/` are bundled into a Worker that keeps the Pages Functions conventions (`onRequestGet`, `[id]`, `[[path]]`, `_middleware`, `next()`, `env.ASSETS`) and only runs for URLs a function can answer. `sinth deploy` runs `wrangler deploy`, `--preview` uploads a preview version, and your own `wrangler.jsonc` is used when present (for KV, D1, R2 and other bindings).
9
+ - **Vercel.** The build writes `.vercel/output/` (Build Output API) with clean URLs, the security headers and the 404 page; `sinth deploy` runs `vercel deploy --prebuilt`.
10
+ - **Netlify** (`netlify deploy`) and **GitHub Pages** (adds `.nojekyll`, without which GitHub drops the `_sinth/` folder).
11
+ - A `functions/` folder on a platform that cannot run it produces warning W0810.
12
+
13
+ ### Project layout
14
+
15
+ - **Optional `app/` folder**, like Nuxt: when `app/` exists and the root has no `pages/` folder or `.sinth` files, pages, components, libraries and assets are read from `app/`. `public/` and `functions/` stay in the root (`app/public/` also works). The new `srcDir` option sets the folder explicitly. Imports starting with `/` resolve inside it. `sinth new`, `sinth info` and the VS Code extension follow it.
16
+
17
+ ### AI agents
18
+
19
+ - **The Sinth skill** teaches coding agents (Claude Code, Codex, Cursor, Copilot, ...) the syntax, common mistakes and a check-after-every-change workflow. Install it by pasting this prompt into your agent: `Install the Sinth skill: fetch https://sinth.yannosay.com/agents.md and follow its instructions exactly.` The skill also ships in the npm package under `skills/sinth/`.
20
+
21
+ ### Fixes
22
+
23
+ - **Cleanups returned from `onMount`** now run when the component is removed. Before, they were attached to the wrong owner, so intervals and listeners started in a component's `onMount` kept running after it disappeared.
24
+ - **`Select` with `model`** shows the bound value on the first render. Before, it showed the first option until the user changed it, because the value was set before the options existed.
25
+ - **Number fields bound with `model`** can be cleared while typing. Before, the old number came back as soon as the field was empty. Text inputs no longer have their value rewritten while the user types.
26
+ - **Build output no longer contains absolute paths** of the build machine. Unminified CSS and JS had comments like `/* sinth-css:C:\Users\...\pages\index.sinth */`; module names are now relative to the project.
27
+ - **Client navigation** follows server redirects (the address bar shows the final URL), and a malformed `#hash` no longer stops the next page from starting.
28
+ - `range()` with an infinite bound throws instead of hanging, and memoized calls (`$fn(x)`) keep at most 500 results per function.
29
+ - **Clearer errors:** event handlers that are literals (`onClick: 1`) report E0352 instead of "handlers cannot be strings", likely typos in event names (`onClik`) get a suggestion (W0302), and children of void elements such as `Input { "x" }` in static markup are reported (W0331) instead of being dropped silently.
30
+ - `functions/`: a malformed URL escape falls through to the static site instead of failing the request.
31
+
32
+ ### Documentation and website
33
+
34
+ - New pages: [AI agents](https://sinth.yannosay.com/docs/tooling/ai-agents), and a rewritten [Deploying](https://sinth.yannosay.com/docs/production/deploy) covering every platform. Project structure, configuration, CLI and server functions pages describe `app/`, `srcDir` and `platform`.
35
+ - The SEO example for `jsonLd` used the `title` metadata as a variable, which does not compile; it now uses a constant.
36
+ - The home page has a copyable agent prompt; `llms.txt` points agents to the skill.
37
+
3
38
  ## 5.3.2
4
39
 
5
40
  - **`for … else` empty state.** The `else` content of a loop is removed once the list gets items. Before, it stayed on the page after the first item was added to an empty list.
package/README.md CHANGED
@@ -36,9 +36,9 @@ Requires Node.js 18.17 or newer.
36
36
  - **Compile-time checks.** Unknown names, wrong argument counts, missing component parameters and type mismatches the compiler can detect are errors with a code frame and a suggestion.
37
37
  - **Prerendered pages.** Every page is rendered to HTML at build time. Interactive pages then load their code: the runtime is 5.4 kB gzipped at most and only the parts a page uses are bundled.
38
38
  - **Routing.** Files in `pages/` are routes, `pages/blog/[slug].sinth` generates one page per item, and links between pages load without a full reload (2 kB gzipped; `"router": false` turns it off).
39
- - **API routes.** Files in `functions/` handle requests with the standard Fetch API in `sinth dev` and `sinth preview`, and deploy to Cloudflare Pages Functions.
39
+ - **API routes.** Files in `functions/` handle requests with the standard Fetch API in `sinth dev` and `sinth preview`, and deploy to Cloudflare Pages or Workers.
40
40
  - **Components.** Parameters, two-way bindings, slots and scoped styles, plus a built-in component library (`sinth:ui`). Components can be exported as web components for use on other sites.
41
- - **Tooling.** Hot reload that keeps state, npm packages, TypeScript and SCSS imports, security headers and a Content Security Policy without inline scripts, and `sinth deploy` for Cloudflare Pages. The output is static files, so other hosts work too.
41
+ - **Tooling.** Hot reload that keeps state, npm packages, TypeScript and SCSS imports, security headers and a Content Security Policy without inline scripts, and `sinth deploy` for Cloudflare Pages or Workers, Vercel and Netlify. GitHub Pages and any static host work too. Sources can live in the project root or in an `app/` folder.
42
42
 
43
43
  ## A component
44
44
 
@@ -89,7 +89,7 @@ component TodoList(str title = "Todos") {
89
89
  | `sinth dev` | Dev server with hot reload |
90
90
  | `sinth build` | Production build in `dist/` |
91
91
  | `sinth preview` | Serve the build and `functions/` locally |
92
- | `sinth deploy` | Deploy to Cloudflare Pages |
92
+ | `sinth deploy` | Deploy (Cloudflare Pages or Workers, Vercel, Netlify) |
93
93
  | `sinth check` | Check the project without building (`--json` for tools) |
94
94
  | `sinth new page/component` | Add files |
95
95
 
@@ -98,6 +98,16 @@ component TodoList(str title = "Todos") {
98
98
  - VS Code: download `sinth-vscode-*.vsix` from the [latest release](https://github.com/Yannosay/sinth/releases/latest) and run **Extensions: Install from VSIX**.
99
99
  - [Sinth IDE](https://github.com/Yannosay/sinth-ide/releases/latest): a desktop editor for Sinth (Windows, macOS, Linux). Early development.
100
100
 
101
+ ## AI agents
102
+
103
+ Paste this into Claude Code, Codex, Cursor or another coding agent to teach it Sinth:
104
+
105
+ ```text
106
+ Install the Sinth skill: fetch https://sinth.yannosay.com/agents.md and follow its instructions exactly.
107
+ ```
108
+
109
+ The skill is also in this package under [`skills/sinth/`](./skills/sinth). See [AI agents](https://sinth.yannosay.com/docs/tooling/ai-agents).
110
+
101
111
  ## Links
102
112
 
103
113
  Documentation source: [docs/](./docs) · [Changelog](./CHANGELOG.md) · [Discord](https://discord.gg/SUvcrafTQm) · [Issues](https://github.com/Yannosay/sinth/issues) · [Security](./SECURITY.md) · [Contributing](./CONTRIBUTING.md)