@tschk/moonshine-astro 0.0.0-stage → 0.4.4
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 +35 -2
- package/package.json +45 -4
- package/src/compiler.ts +1 -0
- package/src/index.ts +36 -0
- package/src/shims.d.ts +5 -0
package/README.md
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@tschk/moonshine-astro`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The root provides native Moonshine signal bridges and a lazy native renderer.
|
|
4
|
+
At runtime, root imports need neither Astro, React, parser WASM nor the optional
|
|
5
|
+
framework peer. Legacy host APIs remain explicit on their existing subpaths.
|
|
6
|
+
|
|
7
|
+
Strict TypeScript checking of the root entry requires installing
|
|
8
|
+
`@tschk/moonshine-framework`, even when importing only a bridge: the root also
|
|
9
|
+
exports `crepusRenderer` with the framework's `Renderer` contract. The framework
|
|
10
|
+
remains optional for runtime imports and bridge-only browser/Bun/Node bundles.
|
|
11
|
+
This requirement does not apply to the signal-only `@tschk/moonshine` core entry.
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { fromMoonshineSignal, crepusRenderer } from "@tschk/moonshine-astro";
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Entry | Provides |
|
|
18
|
+
| ------------ | ---------------------------------------------- |
|
|
19
|
+
| `.` | Native signal bridges and lazy native renderer |
|
|
20
|
+
| `./compiler` | Legacy Astro compiler re-exports |
|
|
21
|
+
|
|
22
|
+
`crepusRenderer` preserves its compatibility name but renders native server
|
|
23
|
+
factories, escaped metadata, API JSON and SPA shells. Install
|
|
24
|
+
`@tschk/moonshine-framework` when invoking this source-file compatibility facade
|
|
25
|
+
under Bun. Bundled deployments use `@tschk/moonshine-dom/framework-native`
|
|
26
|
+
explicitly; the facade intentionally keeps source loading outside the static
|
|
27
|
+
bundle graph. Legacy React/View IR page outputs reject; native island hydration
|
|
28
|
+
is unsupported. The renderer loads only when
|
|
29
|
+
called, so signal bridge consumers do not load server rendering.
|
|
30
|
+
|
|
31
|
+
Legacy entries require their optional host peers: `astro`. They cannot be
|
|
32
|
+
aliased over arbitrary host-compiled output to remove the host.
|
|
33
|
+
|
|
34
|
+
The compiler entry still requires Astro. Native rendering expects compiled Moonshine server factories; it does not execute Astro frontmatter or implement the Astro compiler result shapes.
|
|
35
|
+
Source parsing and compilation belong to Crepuscularity; these root runtime
|
|
36
|
+
changes do not establish full Astro source support.
|
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tschk/moonshine-astro",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.4.4",
|
|
4
|
+
"description": "Native signal bridges and rendering with optional legacy astro entries",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./src/index.ts",
|
|
8
|
+
"types": "./src/index.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./src/index.ts",
|
|
11
|
+
"./compiler": "./src/compiler.ts"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@tschk/moonshine": "^0.4.4",
|
|
15
|
+
"@tschk/moonshine-dom": "^0.4.4"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "7.0.2"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"astro": ">=4",
|
|
22
|
+
"@tschk/moonshine-framework": "^0.4.4"
|
|
23
|
+
},
|
|
24
|
+
"peerDependenciesMeta": {
|
|
25
|
+
"astro": {
|
|
26
|
+
"optional": true
|
|
27
|
+
},
|
|
28
|
+
"@tschk/moonshine-framework": {
|
|
29
|
+
"optional": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"src",
|
|
34
|
+
"README.md"
|
|
35
|
+
],
|
|
36
|
+
"keywords": [
|
|
37
|
+
"moonshine",
|
|
38
|
+
"astro",
|
|
39
|
+
"adapter"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"format": "bunx prettier --check .",
|
|
43
|
+
"lint": "bunx oxlint .",
|
|
44
|
+
"typecheck": "bunx tsc --noEmit",
|
|
45
|
+
"test": "bun test"
|
|
46
|
+
}
|
|
47
|
+
}
|
package/src/compiler.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { transform, parse, convertToTSX } from "astro/compiler";
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Native signal bridges and a lazy native renderer; host APIs remain on legacy subpaths. */
|
|
2
|
+
import {
|
|
3
|
+
createSignal as msCreateSignal,
|
|
4
|
+
type Signal as MsSignal,
|
|
5
|
+
} from "@tschk/moonshine";
|
|
6
|
+
|
|
7
|
+
export type Readable<T> = {
|
|
8
|
+
get: () => T;
|
|
9
|
+
subscribe: (fn: (value: T) => void) => () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function fromMoonshineSignal<T>(signal: MsSignal<T>): Readable<T> {
|
|
13
|
+
return {
|
|
14
|
+
get: () => signal(),
|
|
15
|
+
subscribe: (fn) => {
|
|
16
|
+
fn(signal());
|
|
17
|
+
return signal.subscribe(() => fn(signal()));
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function createBridgedReadable<T>(initial: T): Readable<T> {
|
|
23
|
+
return fromMoonshineSignal(msCreateSignal(initial));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { msCreateSignal as createMoonshineSignal };
|
|
27
|
+
export type { MsSignal as MoonshineSignal };
|
|
28
|
+
export {
|
|
29
|
+
createResource,
|
|
30
|
+
createSignal as createMsSignal,
|
|
31
|
+
createMemo,
|
|
32
|
+
batch,
|
|
33
|
+
untrack,
|
|
34
|
+
} from "@tschk/moonshine";
|
|
35
|
+
export type { Resource, ResourceStatus } from "@tschk/moonshine";
|
|
36
|
+
export { crepusRenderer } from "@tschk/moonshine-dom/framework-lazy";
|