@opsydyn/astro-foldkit 1.0.0-next.1 → 1.0.0-next.2

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.0](https://github.com/opsydyn/fold-kit-experiments/compare/astro-foldkit-v1.1.1...astro-foldkit-v1.2.0) (2026-11-29)
4
+
5
+ ### Features
6
+
7
+ - **astro-foldkit:** forward the renderer's island runtime entry ([#254](https://github.com/opsydyn/fold-kit-experiments/issues/254)) ([e612e4d](https://github.com/opsydyn/fold-kit-experiments/commit/e612e4d3f6156f0a72c6a4671f3a47ef7099de98))
8
+
9
+ ## [1.1.1](https://github.com/opsydyn/fold-kit-experiments/compare/astro-foldkit-v1.1.0...astro-foldkit-v1.1.1) (2026-11-29)
10
+
11
+ ### Bug Fixes
12
+
13
+ - **astro-foldkit:** depend on the renderer that has runtime modules and slots ([#245](https://github.com/opsydyn/fold-kit-experiments/issues/245)) ([45edcab](https://github.com/opsydyn/fold-kit-experiments/commit/45edcab0fd0aa7b7bf3a80e063e5f48731c7215f))
14
+
3
15
  ## [1.1.0](https://github.com/opsydyn/fold-kit-experiments/compare/astro-foldkit-v1.0.0...astro-foldkit-v1.1.0) (2026-11-28)
4
16
 
5
17
  ### Features
package/README.md CHANGED
@@ -1,40 +1,150 @@
1
- # Astro package migration
1
+ # @opsydyn/astro-foldkit
2
2
 
3
- `@opsydyn/astro-foldkit` 1.x forwards the integration and component adapter
4
- from `@opsydyn/astro-effect-ui`. Both import paths use the same renderer.
5
- This branch uses the `1.0.0-next.0` archives for local qualification.
3
+ The earlier name of the Astro integration for Effect UI. From 1.x this package forwards
4
+ to [`@opsydyn/astro-effect-ui`](https://www.npmjs.com/package/@opsydyn/astro-effect-ui),
5
+ which holds the renderer and its documentation.
6
+
7
+ **Starting a new project? Install `@opsydyn/astro-effect-ui` instead.** This package
8
+ exists so that a project already installing `@opsydyn/astro-foldkit` keeps working.
9
+
10
+ ## Why there are two packages
11
+
12
+ `@opsydyn/astro-foldkit` 0.x rendered FoldKit apps in Astro. When the components moved
13
+ to [Effect UI](https://github.com/Effect-TS/ui), the renderer was rewritten as a package
14
+ named for what it renders: `@opsydyn/astro-effect-ui`.
15
+
16
+ Rather than leave the old name behind, 1.x of this package became a forwarder. It has no
17
+ renderer of its own. It re-exports the renderer's three entry points and depends on it at
18
+ one exact version, so both import paths run the same code.
19
+
20
+ | | `@opsydyn/astro-effect-ui` | `@opsydyn/astro-foldkit` |
21
+ | ---------------------------- | -------------------------------------- | -------------------------------------------- |
22
+ | What it is | The renderer | The earlier name, forwarding to the renderer |
23
+ | Start a new project with it | Yes | No |
24
+ | Integration, `/component` | Yes | Yes, re-exported |
25
+ | `/runtime` (`defineIslands`) | Yes | Yes, re-exported from `1.2.0` |
26
+ | Versions | `1.0.0-next.*`, on `next` and `latest` | `1.x` forwards; `0.x` is the FoldKit runtime |
27
+
28
+ ## Which version is which
29
+
30
+ | `@opsydyn/astro-foldkit` | Renders | Renderer it depends on |
31
+ | ------------------------ | --------- | --------------------------------------------- |
32
+ | `1.2.0`, `1.1.1` | Effect UI | `@opsydyn/astro-effect-ui@1.0.0-next.1` |
33
+ | `1.1.0`, `1.0.0` | Effect UI | `@opsydyn/astro-effect-ui@1.0.0-next.0` |
34
+ | `0.x` | FoldKit | None. The FoldKit runtime, still installable. |
35
+
36
+ Islands that fail visibly, `client:interaction` preloading, runtime modules and slots
37
+ arrived in renderer `1.0.0-next.1`, so they need `1.1.1` or later of this package.
38
+ `1.1.0` lists them in its changelog but depends on the renderer from before them.
39
+ `/runtime` is forwarded from `1.2.0`.
40
+
41
+ ## Install
42
+
43
+ ```sh
44
+ npm install @opsydyn/astro-foldkit effect@4.1.6 https://pkg.pr.new/Effect-TS/ui/@effect/ui@1b89db4
45
+ ```
46
+
47
+ `astro` (`>=5.0.0 <8`) and `effect` (`~4.1.0`) are peer dependencies. So is `@effect/ui`,
48
+ through the renderer: Effect UI has no npm releases yet, so your project installs the
49
+ snapshot it wants, and `1b89db4` is the one this release was tested with.
50
+
51
+ ## What this package exports
52
+
53
+ Everything here is the renderer's own export under another path. The
54
+ [renderer's README](https://www.npmjs.com/package/@opsydyn/astro-effect-ui) documents
55
+ each in full.
56
+
57
+ ### `@opsydyn/astro-foldkit`
58
+
59
+ | Export | Same as |
60
+ | -------------------- | ------------------------------------------------- |
61
+ | `effectUi` (default) | The default export of `@opsydyn/astro-effect-ui` |
62
+ | `effectUi` (named) | The same function |
63
+ | `EffectUiOptions` | `EffectUiOptions` from `@opsydyn/astro-effect-ui` |
6
64
 
7
65
  ```ts
66
+ // astro.config.ts
8
67
  import { defineConfig } from 'astro/config';
9
- import effectUi from '@opsydyn/astro-effect-ui';
68
+ import effectUi from '@opsydyn/astro-foldkit';
10
69
 
11
70
  export default defineConfig({ integrations: [effectUi()] });
12
71
  ```
13
72
 
14
- Define a component with Effect UI's `Html.component(...)`, then expose it
15
- to Astro from a normal TypeScript module.
73
+ The options are the renderer's, all of them:
74
+
75
+ | Option | Type | Default | Meaning |
76
+ | ---------------- | --------- | ------- | ----------------------------------------------------------------------------- |
77
+ | `interaction` | `boolean` | `true` | `false` registers neither the `client:interaction` directive nor its type. |
78
+ | `runtime.server` | `string` | none | Path from the project root to a module that default-exports a server runtime. |
79
+ | `runtime.client` | `string` | none | The same for the browser. |
80
+
81
+ ### `@opsydyn/astro-foldkit/component`
82
+
83
+ | Export | Same as |
84
+ | ---------------- | ---------------------------------------------------------- |
85
+ | `astroComponent` | `astroComponent` from `@opsydyn/astro-effect-ui/component` |
86
+ | `IslandProps` | `IslandProps` from `@opsydyn/astro-effect-ui/component` |
16
87
 
17
88
  ```ts
18
- import { astroComponent } from '@opsydyn/astro-effect-ui/component';
89
+ import { astroComponent } from '@opsydyn/astro-foldkit/component';
90
+
19
91
  import { Counter } from './counter';
20
92
 
21
93
  export default astroComponent(Counter);
22
94
  ```
23
95
 
24
- Use the component as a normal Astro import. Astro renders its markup on
25
- the server. Choose `client:load`, `client:idle`, `client:visible` or
26
- `client:interaction` when it needs a browser runtime. For browser-only
27
- components use `client:only="astro-effect-ui"`.
96
+ ### `@opsydyn/astro-foldkit/runtime`
97
+
98
+ From `1.2.0`.
99
+
100
+ | Export | Same as |
101
+ | -------------------------------------- | ------------------------------------------------------- |
102
+ | `defineIslands` | `defineIslands` from `@opsydyn/astro-effect-ui/runtime` |
103
+ | `ServerRuntime`, `ClientRuntime` | The same types |
104
+ | `IslandFailure`, `IslandFallback` | The same types |
105
+ | `AnyServerRuntime`, `AnyClientRuntime` | The same types |
106
+
107
+ ```ts
108
+ // src/islands.ts
109
+ import { defineIslands } from '@opsydyn/astro-foldkit/runtime';
110
+
111
+ export const islands = defineIslands<DeleteTodo | Flags>();
112
+ ```
113
+
114
+ `islands.astroComponent`, `islands.serverRuntime` and `islands.clientRuntime` then work
115
+ as the renderer's README describes, and `effectUi({ runtime: { server, client } })` takes
116
+ the two modules.
117
+
118
+ ### What is not forwarded
119
+
120
+ The rest of `/component`: `AstroComponent`, `Accepted`, `IslandRendererError`,
121
+ `IslandComponent`, `asIslandComponent` and `toAstro`. An app rarely names them. One that
122
+ does imports them from `@opsydyn/astro-effect-ui/component`, after installing the
123
+ renderer at the version this package depends on (see the table above), so the project
124
+ has one renderer.
125
+
126
+ ## Moving to the renderer's name
127
+
128
+ Nothing behaves differently. Change the dependency and the import paths:
129
+
130
+ | From | To |
131
+ | ---------------------------------- | ------------------------------------ |
132
+ | `@opsydyn/astro-foldkit` | `@opsydyn/astro-effect-ui` |
133
+ | `@opsydyn/astro-foldkit/component` | `@opsydyn/astro-effect-ui/component` |
134
+ | `@opsydyn/astro-foldkit/runtime` | `@opsydyn/astro-effect-ui/runtime` |
135
+
136
+ `client:only="astro-effect-ui"` already names the renderer under both packages.
137
+
138
+ ## Moving from 0.x
139
+
140
+ 0.x rendered FoldKit apps and had a different API. 1.x renders Effect UI components.
28
141
 
29
- | 0.x import or option | 1.x migration |
142
+ | 0.x import or option | 1.x |
30
143
  | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
31
- | Default integration from `@opsydyn/astro-foldkit` | Use the default integration from `@opsydyn/astro-effect-ui`. The previous package name also forwards to it. |
144
+ | Default integration from `@opsydyn/astro-foldkit` | The same import still works and now registers the Effect UI renderer. |
32
145
  | `/define-app`, `lazyApp`, `defineApp`, or `prerender` option | Move the model, messages and view to `Html.component` and wrap it with `astroComponent` from `/component`. |
33
146
  | `/define-page`, Flags, or the `/server` document resolver | Resolve request data, page metadata and layouts in Astro. Pass only public, serializable props into the component. |
34
147
  | Build IDs and navigation messages | Use Astro's navigation and the Effect UI island scope. |
35
- | Slots into an island | Compose the markup in an Astro layout or inside the component tree. |
148
+ | Slots into an island | Declare `slots` on the component and pass content from Astro, as the renderer's README shows. |
36
149
 
37
- Consumers still running FoldKit can pin the published 0.x integration.
38
- The standalone renderer's release artifact is staged in
39
- `packages/astro-effect-ui/dist`. Rehearse both archives together because
40
- the forwarding archive declares the exact standalone version.
150
+ A project still on FoldKit can stay on the published 0.x releases.
@@ -0,0 +1,6 @@
1
+ import { AnyClientRuntime, AnyServerRuntime, ClientRuntime, IslandFailure, IslandFallback, ServerRuntime, defineIslands as defineIslands$1 } from "@opsydyn/astro-effect-ui/runtime";
2
+
3
+ //#region src/runtime.d.ts
4
+ declare const defineIslands: typeof defineIslands$1;
5
+ //#endregion
6
+ export { type AnyClientRuntime, type AnyServerRuntime, type ClientRuntime, type IslandFailure, type IslandFallback, type ServerRuntime, defineIslands };
@@ -0,0 +1,5 @@
1
+ import { defineIslands as defineIslands$1 } from "@opsydyn/astro-effect-ui/runtime";
2
+ //#region src/runtime.ts
3
+ const defineIslands = defineIslands$1;
4
+ //#endregion
5
+ export { defineIslands };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opsydyn/astro-foldkit",
3
- "version": "1.0.0-next.1",
3
+ "version": "1.0.0-next.2",
4
4
  "description": "Compatibility entry point for the standalone Astro Effect UI renderer.",
5
5
  "keywords": [
6
6
  "astro",
@@ -31,6 +31,9 @@
31
31
  "*": {
32
32
  "component": [
33
33
  "./dist/component.d.mts"
34
+ ],
35
+ "runtime": [
36
+ "./dist/runtime.d.mts"
34
37
  ]
35
38
  }
36
39
  },
@@ -42,6 +45,10 @@
42
45
  "./component": {
43
46
  "types": "./dist/component.d.mts",
44
47
  "import": "./dist/component.mjs"
48
+ },
49
+ "./runtime": {
50
+ "types": "./dist/runtime.d.mts",
51
+ "import": "./dist/runtime.mjs"
45
52
  }
46
53
  },
47
54
  "publishConfig": {
@@ -60,7 +67,7 @@
60
67
  "compat:astro": "bun ../../tools/astro-compat.ts"
61
68
  },
62
69
  "dependencies": {
63
- "@opsydyn/astro-effect-ui": "1.0.0-next.1"
70
+ "@opsydyn/astro-effect-ui": "1.0.0-next.2"
64
71
  },
65
72
  "devDependencies": {
66
73
  "@types/node": "^22.0.0",