@yannosay/sinth 4.1.0 → 5.1.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 +83 -0
- package/DOCS.md +1359 -0
- package/README.md +83 -74
- package/bin/sinth.js +2 -1
- package/dist/cli/args.d.ts +11 -0
- package/dist/cli/args.js +74 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +437 -0
- package/dist/cli/templates.d.ts +10 -0
- package/dist/cli/templates.js +193 -0
- package/dist/cli/ui.d.ts +28 -0
- package/dist/cli/ui.js +61 -0
- package/dist/cli/update-check.d.ts +2 -0
- package/dist/cli/update-check.js +124 -0
- package/dist/compiler/ast.d.ts +315 -0
- package/dist/compiler/ast.js +4 -0
- package/dist/compiler/codegen.d.ts +143 -0
- package/dist/compiler/codegen.js +1326 -0
- package/dist/compiler/diagnostics.d.ts +36 -0
- package/dist/compiler/diagnostics.js +142 -0
- package/dist/compiler/elements.d.ts +14 -0
- package/dist/compiler/elements.js +78 -0
- package/dist/compiler/globals.d.ts +2 -0
- package/dist/compiler/globals.js +27 -0
- package/dist/compiler/html.d.ts +37 -0
- package/dist/compiler/html.js +152 -0
- package/dist/compiler/lexer.d.ts +42 -0
- package/dist/compiler/lexer.js +404 -0
- package/dist/compiler/parser.d.ts +95 -0
- package/dist/compiler/parser.js +1374 -0
- package/dist/compiler/prerender.d.ts +72 -0
- package/dist/compiler/prerender.js +910 -0
- package/dist/compiler/script-analysis.d.ts +6 -0
- package/dist/compiler/script-analysis.js +106 -0
- package/dist/compiler/style.d.ts +39 -0
- package/dist/compiler/style.js +463 -0
- package/dist/deploy/cloudflare.d.ts +9 -0
- package/dist/deploy/cloudflare.js +111 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +23 -0
- package/dist/project/build.d.ts +31 -0
- package/dist/project/build.js +425 -0
- package/dist/project/config.d.ts +33 -0
- package/dist/project/config.js +142 -0
- package/dist/project/project.d.ts +74 -0
- package/dist/project/project.js +535 -0
- package/dist/runtime/index.d.ts +68 -0
- package/dist/runtime/index.js +912 -0
- package/dist/server/client.d.ts +1 -0
- package/dist/server/client.js +112 -0
- package/dist/server/dev.d.ts +8 -0
- package/dist/server/dev.js +244 -0
- package/dist/server/preview.d.ts +6 -0
- package/dist/server/preview.js +106 -0
- package/dist/server/static.d.ts +10 -0
- package/dist/server/static.js +136 -0
- package/lib/ui/index.sinth +436 -0
- package/package.json +33 -15
- package/schema/sinth.config.schema.json +54 -0
- package/dist/browser/compile.js +0 -63
- package/dist/cli.js +0 -509
- package/dist/core/builtins.js +0 -117
- package/dist/core/cli-compiler.js +0 -705
- package/dist/core/compiler.js +0 -1489
- package/dist/core/expr.js +0 -129
- package/dist/core/head-builder.js +0 -130
- package/dist/core/lexer.js +0 -410
- package/dist/core/parser.js +0 -1646
- package/dist/core/runtime/custom-element.js +0 -81
- package/dist/core/runtime/functions.js +0 -99
- package/dist/core/runtime/helpers.js +0 -347
- package/dist/core/runtime/render.js +0 -136
- package/dist/core/style-processor.js +0 -317
- package/dist/core/types.js +0 -93
- package/dist/resolver.js +0 -175
- package/dist/server.js +0 -174
- package/dist/update-check.js +0 -109
- package/dist/utils.js +0 -80
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 5.1.0
|
|
4
|
+
|
|
5
|
+
### Routing
|
|
6
|
+
|
|
7
|
+
- **No more `page` keyword.** Every `.sinth` file in `pages/` is a page. Files and folders starting with `_` are skipped, and files that only declare components or functions are treated as modules. Without a `pages/` folder, root files with markup are pages. `page` is still accepted.
|
|
8
|
+
- **Dynamic routes.** `pages/blog/[slug].sinth` with `paths = posts.map((p) => p.slug)` generates one prerendered page per item, with route params available as constants, in metadata and at runtime. Several params per route are supported (`pages/[lang]/[page].sinth`).
|
|
9
|
+
- **Computed metadata.** `title`, `descr` and other metadata can be expressions evaluated at build time (constants, imported JSON, route params).
|
|
10
|
+
- Clearer `E0802` message when no pages are found, and new errors E0701 and E0710 to E0714 for metadata and dynamic routes.
|
|
11
|
+
|
|
12
|
+
### CLI
|
|
13
|
+
|
|
14
|
+
- `sinth build` lists at most 30 pages on large sites; `--verbose` lists all.
|
|
15
|
+
|
|
16
|
+
### Editors
|
|
17
|
+
|
|
18
|
+
- Templates, snippets and the VS Code extension no longer add `page`; `paths` has completions and hover docs.
|
|
19
|
+
|
|
20
|
+
## 5.0.0
|
|
21
|
+
|
|
22
|
+
Sinth 5 is a ground-up rewrite of the compiler, runtime and toolchain. Most Sinth 4 code compiles unchanged; see [Migrating from Sinth 4](./DOCS.md#35-migrating-from-sinth-4).
|
|
23
|
+
|
|
24
|
+
### Language
|
|
25
|
+
|
|
26
|
+
- New parser with full operator precedence (`**`, `??`, `?.`, compound assignment, `typeof`, `await`, `new`), arrow functions, spread, f-strings and template literals.
|
|
27
|
+
- Compile-time checks: unknown names and components (with suggestions), missing or extra function arguments, named arguments, type mismatches, num/str comparisons, read-only parameters/constants/computed values, missing required component parameters, reserved words, circular imports.
|
|
28
|
+
- `computed`, `const` and `persist var` declarations.
|
|
29
|
+
- `watch`, `onMount` and `onDestroy`.
|
|
30
|
+
- Typed functions with defaults, named arguments, `async`, and `-> ui` functions that render markup.
|
|
31
|
+
- Components with reactive parameters, `bind` (two-way) parameters, callback parameters, attribute fallthrough, named slots with fallbacks, local state and functions.
|
|
32
|
+
- Loops with index, key, inline filters, `key` expressions and `else` blocks; objects and Maps; `range()`.
|
|
33
|
+
- `if` modifiers: `persist`, `delay(ms)`, `transition("name")`.
|
|
34
|
+
- Event modifiers: `prevent`, `stop`, `once`, `self`, `capture`, `passive`, key and system-key filters.
|
|
35
|
+
- `ref`, `show`, `hide`, `delay`, `html`, object/array `class` and object `style` attributes.
|
|
36
|
+
- Shared stores: top-level variables and functions in modules are shared between pages.
|
|
37
|
+
- `extern` declarations for browser globals.
|
|
38
|
+
|
|
39
|
+
### Styling
|
|
40
|
+
|
|
41
|
+
- New style compiler: camelCase properties, nesting with `&`, element-name selectors, pseudo shorthands, `media(...)` and `dark`/`mobile`/... shorthands, all CSS at-rules.
|
|
42
|
+
- Component styles are scoped automatically; `style global` and `:global()` opt out.
|
|
43
|
+
- Style values can use parameters and variables and update reactively.
|
|
44
|
+
- SCSS support for style blocks and imported files.
|
|
45
|
+
|
|
46
|
+
### Imports
|
|
47
|
+
|
|
48
|
+
- Named, default, namespace and side-effect imports for `.sinth` modules.
|
|
49
|
+
- npm packages, local JS/TS modules, CSS/SCSS, JSON, Google Fonts and external scripts.
|
|
50
|
+
- `sinth:ui`: a built-in, themeable component library (Button, Card, Badge, Alert, Content, Columns, Inline, VStack, Field, Toggle, Modal, Avatar, Spinner, Navbar, Divider).
|
|
51
|
+
- npm packages can ship Sinth components via a `"sinth"` field.
|
|
52
|
+
|
|
53
|
+
### Runtime and output
|
|
54
|
+
|
|
55
|
+
- Fine-grained DOM updates with keyed list reconciliation; no `innerHTML` re-rendering.
|
|
56
|
+
- Build-time prerendering of every page; static pages ship no JavaScript.
|
|
57
|
+
- esbuild-powered bundling with code splitting, hashed assets, module preloading and minification.
|
|
58
|
+
- Standalone custom element bundles (`dist/elements/<tag>.js`).
|
|
59
|
+
- `_headers` with Content Security Policy and caching rules, `sitemap.xml` and `robots.txt`.
|
|
60
|
+
- Automatic SEO tags (Open Graph, Twitter) from page metadata.
|
|
61
|
+
|
|
62
|
+
### Tooling
|
|
63
|
+
|
|
64
|
+
- New CLI: `create`, `dev`, `build`, `preview`, `deploy`, `check` (with `--json`), `new`, `info`.
|
|
65
|
+
- Dev server with hot module replacement that preserves state, CSS hot swapping and an error overlay.
|
|
66
|
+
- Cloudflare Pages deployment via Wrangler, with project creation and preview deployments.
|
|
67
|
+
- Clear diagnostics with codes, code frames and hints.
|
|
68
|
+
- JSON schema for `sinth.config.json`.
|
|
69
|
+
|
|
70
|
+
### Security
|
|
71
|
+
|
|
72
|
+
- Fixed a path traversal in the dev server that exposed files outside the project.
|
|
73
|
+
- Fixed unescaped compiler errors in the dev error page.
|
|
74
|
+
- Fixed shell command injection through `cloudflare.projectName` in `sinth deploy`.
|
|
75
|
+
- Event handlers no longer use inline attributes; strict CSP is supported.
|
|
76
|
+
- Dynamic URLs are sanitized; dynamic text is never interpreted as HTML.
|
|
77
|
+
- The dev server binds to localhost by default.
|
|
78
|
+
- `sinth build` no longer deletes output folders it did not create.
|
|
79
|
+
|
|
80
|
+
### Removed
|
|
81
|
+
|
|
82
|
+
- `sharedRuntime`, `inlineJS` and `inlineCSS` options (accepted and ignored).
|
|
83
|
+
- The `fullscreen` and `fullscreenSync` attributes.
|