@yannosay/sinth 5.2.1 → 5.2.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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.2.3
4
+
5
+ - `script { }` and `style { }` blocks are now recognized on the line after a statement that ends in `)` or `]`, such as `var data = JSON.parse(text)`. Before, this failed with a confusing syntax error.
6
+
7
+ ## 5.2.2
8
+
9
+ - Documentation: clearer README and package description, working links for the VS Code extension and Sinth IDE.
10
+
3
11
  ## 5.2.1
4
12
 
5
13
  - The E0104 hint now covers projects without a `pages/` folder, where root files are pages.
@@ -13,7 +21,6 @@
13
21
 
14
22
  - Dynamic routes and page detection now work when the project path contains a symlink or junction (macOS temp folders, linked workspaces).
15
23
  - Dev server logs use forward slashes on Windows.
16
- - CI: ESLint runs on Node 22 only.
17
24
 
18
25
  ## 5.1.0
19
26
 
package/DOCS.md CHANGED
@@ -77,7 +77,7 @@ Main {
77
77
  When you are ready:
78
78
 
79
79
  ```bash
80
- npm run build # optimized static site in dist/
80
+ npm run build # optimized production build in dist/
81
81
  npm run preview # serve dist/ locally with production headers
82
82
  npm run deploy # deploy to Cloudflare Pages
83
83
  ```
@@ -1038,7 +1038,7 @@ component Counter(num start = 0, str label = "Count") as <sinth-counter> {
1038
1038
  ## 25. Rendering model and performance
1039
1039
 
1040
1040
  - **Prerendering**: every page is rendered to static HTML at build time, so content is visible immediately and indexable by search engines.
1041
- - **Zero JavaScript for static pages**: if a page has no events, bindings, scripts, watchers or values that can only be known in the browser, Sinth ships no JavaScript at all for it.
1041
+ - **No JavaScript when none is needed**: if a page has no events, bindings, scripts, watchers or values that can only be known in the browser, Sinth ships no JavaScript at all for it.
1042
1042
  - **Fine-grained updates**: interactive pages mount a ~5 kB runtime. Each binding is updated only when its value actually changes. Text, attributes and keyed lists are patched in place; nothing is re-rendered with `innerHTML`.
1043
1043
  - **Code splitting**: shared code across pages is split into cached chunks, and `<link rel="modulepreload">` tags are added automatically.
1044
1044
  - **Static subtrees**: purely static markup inside interactive pages is created from cached templates.
@@ -1178,7 +1178,7 @@ dist/
1178
1178
  └─ contents of public/ and static folders
1179
1179
  ```
1180
1180
 
1181
- The output is a plain static site. It works on Cloudflare Pages, Netlify, Vercel, GitHub Pages, S3, nginx or any static host. Pages are written as `about.html`; most hosts serve them at `/about` (on GitHub Pages and nginx, links to `/about.html` or a rewrite rule may be needed).
1181
+ The output is standard HTML, CSS and JavaScript with no server runtime, so it runs on Cloudflare Pages, Netlify, Vercel, GitHub Pages, S3, nginx or any static host. Pages are written as `about.html`; most hosts serve them at `/about` (on GitHub Pages and nginx, links to `/about.html` or a rewrite rule may be needed).
1182
1182
 
1183
1183
  The build prints every page with its size and whether it ships JavaScript:
1184
1184
 
@@ -1238,8 +1238,8 @@ Run `sinth build` and upload `dist/`. On Netlify the `_headers` file is used aut
1238
1238
 
1239
1239
  ## 32. Editor support
1240
1240
 
1241
- - **VS Code**: the official extension provides syntax highlighting, completions for elements, attributes, events, modifiers, metadata keys and sinth:ui components, hover documentation, snippets, error checking with `sinth check`, and commands to run the dev server, build and check.
1242
- - **Sinth IDE**: a desktop editor with Sinth highlighting, completions, inline diagnostics on save, an integrated terminal, one-click dev/build/deploy actions and managed compiler versions.
1241
+ - **VS Code**: the official extension provides syntax highlighting, completions for elements, attributes, events, modifiers, metadata keys, your own components and sinth:ui (with auto-import), hover documentation, go to definition, snippets, error checking with `sinth check`, and commands to run the dev server, build, preview and deploy. Download `sinth-vscode-*.vsix` from the [latest release](https://github.com/Yannosay/sinth/releases/latest) and run **Extensions: Install from VSIX**.
1242
+ - **Sinth IDE**: a desktop editor for Windows, macOS and Linux with Sinth highlighting, completions, inline diagnostics on save, a Problems list, an integrated terminal, one-click Run/Build/Preview/Deploy and automatic updates. Download it from [Sinth IDE releases](https://github.com/Yannosay/sinth-ide/releases/latest).
1243
1243
  - **Other editors**: run `sinth check --json` for diagnostics in any tool.
1244
1244
 
1245
1245
  ## 33. Programmatic API
@@ -1336,7 +1336,7 @@ Run `sinth check` after upgrading. It reports every incompatibility with its loc
1336
1336
  ## 36. FAQ
1337
1337
 
1338
1338
  **Does Sinth need a framework or runtime on the server?**
1339
- No. The output is static HTML, CSS and JavaScript.
1339
+ No. The output is HTML, CSS and JavaScript that any web host can serve.
1340
1340
 
1341
1341
  **Can I use npm packages?**
1342
1342
  Yes. Install them and import them. They are bundled and tree-shaken.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@yannosay/sinth?color=a855f7&label=npm&style=for-the-badge)](https://www.npmjs.com/package/@yannosay/sinth) [![downloads](https://img.shields.io/npm/dt/@yannosay/sinth?color=c084fc&label=downloads&style=for-the-badge)](https://www.npmjs.com/package/@yannosay/sinth) [![CI](https://img.shields.io/github/actions/workflow/status/Yannosay/sinth/ci.yml?branch=main&label=CI&style=for-the-badge)](https://github.com/Yannosay/sinth/actions) [![license](https://img.shields.io/npm/l/@yannosay/sinth?color=a78bfa&style=for-the-badge)](./LICENSE)
4
4
 
5
- **Sinth is a reactive language for building websites and web apps of any size, from a landing page to a large multi-page product.** Write pages and components in one readable syntax. The compiler type-checks your whole project and turns it into static-first HTML, CSS and JavaScript, with no framework to learn.
5
+ **Sinth is a reactive language for building websites and web apps of any size, from a landing page to a large multi-page product.** Write pages and components in one readable syntax. The compiler type-checks your whole project and produces fast, secure HTML, CSS and JavaScript, with no framework to learn.
6
6
 
7
7
  ```sinth
8
8
  title = "Counter"
@@ -20,7 +20,7 @@ Main {
20
20
  - **Easy to read, easy to learn.** Markup, state, logic and styles live together in one file with no boilerplate.
21
21
  - **Reactive by default.** Change a variable and exactly the affected parts of the page update.
22
22
  - **Built to scale.** File-based routing with dynamic routes (`pages/blog/[slug].sinth` generates one page per post), shared layouts and components, project-wide type checking, code splitting and cached chunks. Thousands of pages build in seconds.
23
- - **Static first.** Every page is prerendered to HTML. Pages without interactivity ship zero JavaScript; interactive ones load a ~5 kB runtime.
23
+ - **Fast by default.** Every page is rendered at build time, so it appears instantly and is fully indexable by search engines. Interactivity runs on a ~5 kB runtime with fine-grained updates, and pages that need no JavaScript load none.
24
24
  - **Catches mistakes before the browser does.** Unknown names, missing arguments, wrong types and missing component props are compile errors with "did you mean" hints.
25
25
  - **Secure by default.** No `eval`, escaped output, no inline handlers, strict CSP and security headers out of the box.
26
26
  - **Batteries included.** Dev server with hot reload that keeps state, scoped CSS, a component library (`sinth:ui`), npm packages, SCSS, JSON imports, Google Fonts, custom elements, sitemaps and one-command Cloudflare deploys.
@@ -94,7 +94,8 @@ component TodoList(str title = "Todos") {
94
94
  - **[Full reference (DOCS.md)](./DOCS.md)**: every feature, option and error code
95
95
  - [Website](https://sinth.yannosay.com)
96
96
  - [Changelog](./CHANGELOG.md)
97
- - [VS Code extension](https://marketplace.visualstudio.com/items?itemName=YannosayProductions.sinth-vscode)
97
+ - [VS Code extension](https://github.com/Yannosay/sinth/releases/latest): download `sinth-vscode-*.vsix` from the latest release and run **Extensions: Install from VSIX**
98
+ - [Sinth IDE](https://github.com/Yannosay/sinth-ide/releases/latest): the desktop editor for Sinth (Windows, macOS, Linux)
98
99
 
99
100
  ## Community
100
101
 
@@ -181,8 +181,12 @@ class Lexer {
181
181
  return true;
182
182
  if (prev.kind === "raw")
183
183
  return true;
184
- if (prev.kind === "punct")
185
- return prev.value === "{" || prev.value === "}" || prev.value === ";";
184
+ if (prev.kind === "punct") {
185
+ if (prev.value === "{" || prev.value === "}" || prev.value === ";")
186
+ return true;
187
+ // `var x = f()` or `var xs = [1]` followed by a block on the next line.
188
+ return this.sawNewline && (prev.value === ")" || prev.value === "]");
189
+ }
186
190
  return this.sawNewline && (prev.kind === "string" || prev.kind === "number" || prev.kind === "ident" || prev.kind === "template");
187
191
  }
188
192
  readNumber(loc, start) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yannosay/sinth",
3
- "version": "5.2.1",
4
- "description": "A declarative, reactive UI language that compiles to fast, secure, static-first HTML, CSS and JavaScript.",
3
+ "version": "5.2.3",
4
+ "description": "A reactive language for websites and web apps of any size: type-checked components, file-based and dynamic routing, prerendered pages and one-command deploys.",
5
5
  "author": "Yannosay Productions",
6
6
  "license": "AGPL-3.0",
7
7
  "homepage": "https://sinth.yannosay.com",
@@ -16,14 +16,17 @@
16
16
  "sinth",
17
17
  "language",
18
18
  "compiler",
19
- "ui",
19
+ "web-framework",
20
20
  "reactive",
21
- "declarative",
22
- "static-site",
21
+ "components",
22
+ "ui",
23
+ "routing",
24
+ "ssg",
25
+ "prerendering",
26
+ "typescript-alternative",
23
27
  "html",
24
28
  "css",
25
29
  "web",
26
- "components",
27
30
  "cloudflare-pages"
28
31
  ],
29
32
  "bin": {