@tschk/moonshine-astro 0.4.49 → 0.4.80
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/README.md +63 -18
- package/package.json +17 -5
- package/src/actions.ts +556 -0
- package/src/assets.ts +710 -0
- package/src/config.ts +269 -0
- package/src/container.ts +560 -0
- package/src/content.ts +1523 -0
- package/src/context.ts +756 -0
- package/src/env.ts +361 -0
- package/src/i18n.ts +420 -0
- package/src/index.ts +264 -0
- package/src/loaders.ts +888 -0
- package/src/middleware.ts +206 -0
- package/src/routing.ts +239 -0
- package/src/ssr.ts +208 -2
- package/src/transitions.ts +496 -0
package/README.md
CHANGED
|
@@ -14,11 +14,23 @@ This requirement does not apply to the signal-only `@tschk/moonshine` core entry
|
|
|
14
14
|
import { fromMoonshineSignal, crepusRenderer } from "@tschk/moonshine-astro";
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
| Entry
|
|
18
|
-
|
|
|
19
|
-
| `.`
|
|
20
|
-
| `./
|
|
21
|
-
| `./
|
|
17
|
+
| Entry | Provides |
|
|
18
|
+
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| `.` | Native signal bridges, lazy native renderer, and host-free runtime helpers |
|
|
20
|
+
| `./actions` | Independent Astro Actions (`defineAction`, `ActionError`, `ActionInputError`, `getActionContext`, `serializeActionResult`, `deserializeActionResult`, `z`) |
|
|
21
|
+
| `./assets` | Independent Astro Assets (`Image`, `Picture`, `getImage`, `getImageSync`, `inferImageDimensions`, `inferRemoteSize`, `configureAssets`) |
|
|
22
|
+
| `./compiler` | Legacy Astro compiler re-exports |
|
|
23
|
+
| `./config` | Independent Astro configuration (`defineConfig`, `mergeConfig`, `validateConfig`, `passthroughImageService`, `sharpImageService`, `squooshImageService`, `envField`) |
|
|
24
|
+
| `./container` | Independent Astro Container API (`AstroContainer`, `experimental_AstroContainer`, `renderToString`, `renderToResponse`, `insertPageRoute`) |
|
|
25
|
+
| `./content` | Independent Content Collections & Live Content Layer (`defineCollection`, `getCollection`, `getEntry`, `getEntries`, `glob`, `file`, `reference`, `render`, `z`) |
|
|
26
|
+
| `./context` | Independent `AstroCookies`, `AstroSession`, `AstroSlots`, `createAstroGlobal`, `withAstroContext`, `useAstro`, `recordAstroActionResult`, `clearAstroSessions` |
|
|
27
|
+
| `./env` | Independent `astro:env` schema validation (`envField`, `validateEnv`, `getSecret`, `setEnvSource`) |
|
|
28
|
+
| `./i18n` | Independent `astro:i18n` locale routing (`getRelativeLocaleUrl`, `getAbsoluteLocaleUrl`, `redirectToDefaultLocale`, `i18nMiddleware`) |
|
|
29
|
+
| `./loaders` | Independent `astro/loaders` Content Layer loaders (`glob`, `file`, `parseFrontmatter`, `parseSimpleYaml`, `parseSimpleToml`, `parseSimpleCsv`, `matchGlobPattern`) |
|
|
30
|
+
| `./middleware` | Independent `astro:middleware` (`defineMiddleware`, `sequence`, `createContext`, `trySerializeLocals`) |
|
|
31
|
+
| `./routing` | Independent static path pagination & endpoint types (`paginate`, `createPaginate`, `Page`, `GetStaticPaths`, `InferGetStaticParamsType`, `APIRoute`) |
|
|
32
|
+
| `./ssr` | Independent synchronous Astro source factories (`sourceComponent`, `sourceServerIsland`, `sourceSlot`, `sourceHasSlot`, `sourceRenderSlot`), and `useAstro` / `withAstroContext` re-exports |
|
|
33
|
+
| `./transitions` | Independent View Transitions & prefetching (`ClientRouter`, `ViewTransitions`, `fade`, `slide`, `none`, `navigate`, `swapFunctions`, `prefetch`, `init`) |
|
|
22
34
|
|
|
23
35
|
`crepusRenderer` preserves its compatibility name but renders native server
|
|
24
36
|
factories, escaped metadata, API JSON and SPA shells. Install
|
|
@@ -46,7 +58,7 @@ path. Parsing and lowering stay in Crepuscularity.
|
|
|
46
58
|
|
|
47
59
|
This remains a bounded source slice: top-level await, dynamic imports,
|
|
48
60
|
client directives, script/style blocks, runtime exports, async children, and
|
|
49
|
-
Astro globals
|
|
61
|
+
unsupported Astro globals (such as `Astro.glob`) are rejected. Hydration and arbitrary
|
|
50
62
|
host-compiled output are unsupported. Use the legacy compiler explicitly for
|
|
51
63
|
applications requiring the full Astro compiler contract.
|
|
52
64
|
|
|
@@ -112,17 +124,21 @@ are omitted. Component factories omit an empty normalized class-list prop while
|
|
|
112
124
|
retaining an explicitly supplied empty ordinary `class` prop.
|
|
113
125
|
|
|
114
126
|
Local authored slot lowering now supports default and nonempty literal named
|
|
115
|
-
slots, grouping of same-name children, named
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
slot
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
127
|
+
slots, grouping of same-name children, named `<Fragment slot="...">` (including
|
|
128
|
+
`<Fragment set:html={...} />` and `<Fragment set:text={...} />`), `is:raw` literal
|
|
129
|
+
curlies in authored templates, and forwarding through imported layouts. An explicit
|
|
130
|
+
empty slot suppresses fallback; whitespace-only ordinary component content supplies
|
|
131
|
+
no slot. Projected HTML loses the marker, while projected components retain their
|
|
132
|
+
ordinary `slot` prop. Dynamic/empty outlet names and misplaced markers reject
|
|
133
|
+
explicitly. `Astro.slots.has(name)` and synchronous `Astro.slots.render(name, args?)`
|
|
134
|
+
(with optional callback argument arrays via `sourceRenderSlot`) are supported in
|
|
135
|
+
frontmatter and template expressions; bare `Astro.slots` bag access, method extraction,
|
|
136
|
+
computed/optional access and unrelated Astro globals remain unsupported.
|
|
137
|
+
|
|
138
|
+
Local source now supports ordinary `Astro.slots.has(nameExpression)` and
|
|
139
|
+
synchronous `Astro.slots.render(nameExpression, argsExpression?)` calls in
|
|
140
|
+
frontmatter and template expressions (usable with or without `await`), including
|
|
141
|
+
dynamic strings, parameterized slot callbacks, and nested `Astro.props` reads. For example:
|
|
126
142
|
|
|
127
143
|
```astro
|
|
128
144
|
---
|
|
@@ -148,7 +164,7 @@ or timing comparison. A no-slot control bundle is byte-identical before/after
|
|
|
148
164
|
the helper addition. Compiler changes remain local and unpublished.
|
|
149
165
|
|
|
150
166
|
Generated calls use the compiler-facing `sourceComponent` / `sourceSlot` /
|
|
151
|
-
`sourceHasSlot` contract. Slot values stay outside ordinary props, including `children` and
|
|
167
|
+
`sourceHasSlot` / `sourceRenderSlot` contract. Slot values stay outside ordinary props, including `children` and
|
|
152
168
|
`slots`. Props and template interpolations capture when the parent constructs
|
|
153
169
|
its template; component frontmatter runs during serialization, once per
|
|
154
170
|
invocation. Unused slot content stays lazy, repeated outlets render it again,
|
|
@@ -158,3 +174,32 @@ inside `renderToString(() => ...)`; ordinary public `h` invocation is unchanged.
|
|
|
158
174
|
This compiler integration is local and unpublished. The companion runtime
|
|
159
175
|
helpers are available in SDK 0.4.22. This is not Astro's compiled component ABI;
|
|
160
176
|
async rendering, hydration and full slot/source coverage remain incomplete.
|
|
177
|
+
|
|
178
|
+
Local `.astro` compilation also rewrites `astro:actions`, `astro:assets`,
|
|
179
|
+
`astro:content`, `astro:schema`, `astro/zod`, `astro:env` (`astro:env/client`,
|
|
180
|
+
`astro:env/server`, `astro:env/setup`), `astro:i18n`, `astro:middleware`,
|
|
181
|
+
`astro:prefetch`, `astro:transitions` (`astro:transitions/client`),
|
|
182
|
+
`astro/config`, and `astro/loaders` imports onto `@tschk/moonshine-astro/*`,
|
|
183
|
+
lowers `<Astro.self>` and `Astro.self` to recursive component factory
|
|
184
|
+
references, lowers Astro 5 `<Component server:defer>` Server Islands (with
|
|
185
|
+
`<slot name="fallback">` / `slot="fallback"`) to `sourceServerIsland` in
|
|
186
|
+
`@tschk/moonshine-astro/ssr` (supporting both eager synchronous SSR and deferred
|
|
187
|
+
`<astro-server-island>` placeholder shells resolved via
|
|
188
|
+
`astro.resolveServerIsland(id)` / `astro.resolveAllServerIslands(html)` when
|
|
189
|
+
`deferServerIslands: true` is set on `withAstroContext`), and lowers
|
|
190
|
+
`Astro.url`, `Astro.request`, `Astro.params`, `Astro.locals`, `Astro.cookies`,
|
|
191
|
+
`Astro.session`, `Astro.site`, `Astro.generator`, `Astro.clientAddress`,
|
|
192
|
+
`Astro.response`, `Astro.originPathname`, `Astro.routePattern`,
|
|
193
|
+
`Astro.isPrerendered`, `Astro.preferredLocale`, `Astro.preferredLocaleList`,
|
|
194
|
+
`Astro.currentLocale`, `Astro.redirect`, `Astro.rewrite`, `Astro.callAction`,
|
|
195
|
+
and `Astro.getActionResult` in frontmatter and template expressions to
|
|
196
|
+
`useAstro()` from `@tschk/moonshine-astro/ssr`.
|
|
197
|
+
On HTML elements, `define:vars={{ ... }}` and `transition:name` merge into
|
|
198
|
+
`style` via `mergeDefineVars` (`defineStyleVars`), while `transition:animate`,
|
|
199
|
+
`transition:persist`, and `transition:persist-props` lower to
|
|
200
|
+
`data-astro-transition-scope`, `data-astro-transition-persist`, and
|
|
201
|
+
`data-astro-transition-persist-props` via `transitionAnimateValue`,
|
|
202
|
+
`transitionPersistValue`, and `transitionPersistPropsValue`.
|
|
203
|
+
`<Image>` and `<Picture>` in `@tschk/moonshine-astro/assets` and `<ClientRouter>`
|
|
204
|
+
/ `<ViewTransitions>` in `@tschk/moonshine-astro/transitions` render synchronous
|
|
205
|
+
server HTML without Astro host packages.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tschk/moonshine-astro",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.80",
|
|
4
4
|
"description": "Native signal bridges and rendering with optional legacy astro entries",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"type": "module",
|
|
@@ -8,19 +8,31 @@
|
|
|
8
8
|
"types": "./src/index.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": "./src/index.ts",
|
|
11
|
+
"./actions": "./src/actions.ts",
|
|
12
|
+
"./assets": "./src/assets.ts",
|
|
11
13
|
"./compiler": "./src/compiler.ts",
|
|
12
|
-
"./
|
|
14
|
+
"./config": "./src/config.ts",
|
|
15
|
+
"./container": "./src/container.ts",
|
|
16
|
+
"./content": "./src/content.ts",
|
|
17
|
+
"./context": "./src/context.ts",
|
|
18
|
+
"./env": "./src/env.ts",
|
|
19
|
+
"./i18n": "./src/i18n.ts",
|
|
20
|
+
"./loaders": "./src/loaders.ts",
|
|
21
|
+
"./middleware": "./src/middleware.ts",
|
|
22
|
+
"./routing": "./src/routing.ts",
|
|
23
|
+
"./ssr": "./src/ssr.ts",
|
|
24
|
+
"./transitions": "./src/transitions.ts"
|
|
13
25
|
},
|
|
14
26
|
"dependencies": {
|
|
15
|
-
"@tschk/moonshine": "^0.4.
|
|
16
|
-
"@tschk/moonshine-dom": "^0.4.
|
|
27
|
+
"@tschk/moonshine": "^0.4.80",
|
|
28
|
+
"@tschk/moonshine-dom": "^0.4.80"
|
|
17
29
|
},
|
|
18
30
|
"devDependencies": {
|
|
19
31
|
"typescript": "7.0.2"
|
|
20
32
|
},
|
|
21
33
|
"peerDependencies": {
|
|
22
34
|
"astro": ">=4",
|
|
23
|
-
"@tschk/moonshine-framework": "^0.4.
|
|
35
|
+
"@tschk/moonshine-framework": "^0.4.80"
|
|
24
36
|
},
|
|
25
37
|
"peerDependenciesMeta": {
|
|
26
38
|
"astro": {
|