tw-framework 2.0.4 → 2.0.5
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 +56 -0
- package/dist/testing.cjs +452 -189
- package/dist/tw-server.mjs +422 -158
- package/dist/tw.mjs +845 -475
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,62 @@ Notable changes to TW Framework. The format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/), and the project uses
|
|
5
5
|
[Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [2.0.5]
|
|
8
|
+
|
|
9
|
+
A patch release on top of 2.0.4. Two features that were blocked by bugs, and a
|
|
10
|
+
run of stylesheet fixes.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Page-level imports reach `server { }` blocks.** A page may now import from
|
|
15
|
+
`lib/` and use the binding inside a server block:
|
|
16
|
+
|
|
17
|
+
```tw
|
|
18
|
+
import { getApps } from "lib/data"
|
|
19
|
+
server { const apps = await getApps() }
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The import is resolved only when a block actually references it, and
|
|
23
|
+
block-local imports keep precedence. Use the same name in markup and it is
|
|
24
|
+
still `TW1007`, because that would have to reach the browser.
|
|
25
|
+
- **`@tw/client-safe`.** A module inside `lib/` opts out of the server-only
|
|
26
|
+
default with `import "@tw/client-safe"`. `@tw/server-only` marks a module
|
|
27
|
+
anywhere. A client-safe module that pulls in a server-only dependency still
|
|
28
|
+
fails, with the whole import chain in the message.
|
|
29
|
+
- **`TW125`** reports an import whose local name is also a server-block
|
|
30
|
+
built-in (`query`, `params`, `fetch`, …). Those bindings were silently
|
|
31
|
+
replaced by the built-in, so the block ran against the wrong value.
|
|
32
|
+
- **`notFound()` in a static block.** The build skips that page and the host
|
|
33
|
+
serves a real 404, instead of a 200 with a "not found" body that crawlers
|
|
34
|
+
index.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- **TSS multi-line blocks.** A nested `@media`, `@container`, `@keyframes` or
|
|
39
|
+
`@layer` produced invalid CSS — a selector-less rule, or one copy of the
|
|
40
|
+
at-rule per inner rule so `@keyframes` lost frames. Custom properties
|
|
41
|
+
(`--main`) and vendor prefixes (`-webkit-transform`) written on their own
|
|
42
|
+
line were pasted into the previous declaration's value.
|
|
43
|
+
- **TSS strings.** A `;` or `}` inside a quoted string split the declaration and
|
|
44
|
+
broke the block.
|
|
45
|
+
- **TSS statement at-rules.** `@import`, `@charset` and `@layer a, b;` came out
|
|
46
|
+
as `* { @import: url(...) }` — the stylesheet imported nothing.
|
|
47
|
+
- **TSS shorthands.** Nine documented shorthands (`br-tl`, `br-tr`, `br-bl`,
|
|
48
|
+
`br-br`, `fl`, `cl`, `dir`, `ww`, `va`) were never implemented, so
|
|
49
|
+
`br-tl 4px` emitted the literal property `br-tl` and the corner stayed square.
|
|
50
|
+
- **TSS output shape.** A multi-line value printed across several lines; a
|
|
51
|
+
property with no value swallowed the next declaration; empty blocks emitted
|
|
52
|
+
empty rules.
|
|
53
|
+
- **Documentation.** `TW108` and `docs/client-modules.md` still described the
|
|
54
|
+
old rules for `notFound()` and for importing `lib/` into a page.
|
|
55
|
+
|
|
56
|
+
### Notes
|
|
57
|
+
|
|
58
|
+
- `TW124` was already documented for a private-folder check, so the new
|
|
59
|
+
collision diagnostic is `TW125`.
|
|
60
|
+
- Applying this needs `bun install`: `packages/client-safe` is a new workspace
|
|
61
|
+
package.
|
|
62
|
+
|
|
7
63
|
## [2.0.4]
|
|
8
64
|
|
|
9
65
|
A patch release on top of 2.0.3. Bug fixes plus one deliberate behaviour change
|