@tschk/moonshine-cli 0.4.4 → 0.4.49

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tschk/moonshine-cli",
3
- "version": "0.4.4",
3
+ "version": "0.4.49",
4
4
  "description": "Bun CLI for moonshine — new, dev, build, preview, inspect, compile",
5
5
  "license": "ISC",
6
6
  "type": "module",
@@ -19,14 +19,14 @@
19
19
  "crepus"
20
20
  ],
21
21
  "dependencies": {
22
- "@tschk/moonshine-compiler": "^0.4.4",
23
- "@tschk/moonshine-deploy-bun": "^0.4.4",
24
- "@tschk/moonshine-framework": "^0.4.4",
25
- "@tschk/moonshine-next": "^0.4.4",
26
- "@tschk/moonshine-react-router": "^0.4.4",
27
- "@tschk/moonshine-server": "^0.4.4",
28
- "@tschk/moonshine-tanstack": "^0.4.4",
29
- "@tschk/moonshine-waku": "^0.4.4"
22
+ "@tschk/moonshine-compiler": "^0.4.48",
23
+ "@tschk/moonshine-deploy-bun": "^0.4.48",
24
+ "@tschk/moonshine-framework": "^0.4.48",
25
+ "@tschk/moonshine-next": "^0.4.48",
26
+ "@tschk/moonshine-react-router": "^0.4.48",
27
+ "@tschk/moonshine-server": "^0.4.48",
28
+ "@tschk/moonshine-tanstack": "^0.4.48",
29
+ "@tschk/moonshine-waku": "^0.4.48"
30
30
  },
31
31
  "scripts": {
32
32
  "format": "bunx prettier --check .",
@@ -35,10 +35,10 @@
35
35
  "test": "bun test"
36
36
  },
37
37
  "peerDependencies": {
38
- "@tschk/moonshine-react": "^0.4.4",
39
- "@tschk/crepus-moonshine": "^0.4.4",
38
+ "@tschk/moonshine-react": "^0.4.48",
39
+ "@tschk/crepus-moonshine": "^0.4.48",
40
40
  "@tschk/crepuscularity-wasm": "^0.1.3",
41
- "@tschk/moonshine-solid": "^0.4.4"
41
+ "@tschk/moonshine-solid": "^0.4.48"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "@tschk/moonshine-react": {
package/src/build.ts CHANGED
@@ -77,11 +77,18 @@ export async function buildCommand(args: string[]): Promise<MoonshineManifest> {
77
77
  );
78
78
  }
79
79
 
80
+ if (config.dataRequests && unsupportedServerTarget) {
81
+ throw new Error(
82
+ "Route data requests support only matching Bun or Node deployment adapters/runtimes",
83
+ );
84
+ }
85
+
80
86
  const manifest = await buildProject({
81
87
  projectDir: resolvedDir,
82
88
  runtime,
83
89
  renderer: config.renderer,
84
90
  requestContext: config.requestContext,
91
+ dataRequests: config.dataRequests,
85
92
  mode: config.mode,
86
93
  programmatic: config.routes,
87
94
  ...(config.routesDir && {
@@ -43,8 +43,11 @@ export async function startNativeServer(
43
43
  "Request context runner missing from server bundle; rebuild the project",
44
44
  );
45
45
  const staticDir = resolve(options.projectDir, ".moonshine", PUBLIC_DIR);
46
+ const makeHandler = manifest.dataRequests
47
+ ? (await import("@tschk/moonshine-server/data-http")).createRequestHandler
48
+ : createRequestHandler;
46
49
  const server = createBunServer({
47
- fetch: createRequestHandler({
50
+ fetch: makeHandler({
48
51
  manifest,
49
52
  modules: bundle.modules ?? {},
50
53
  renderer: bundle.renderer,
package/src/preview.ts CHANGED
@@ -150,7 +150,10 @@ export async function startPreview(options: {
150
150
  throw new Error(
151
151
  "Request context runner missing from server bundle; rebuild the project",
152
152
  );
153
- const fetch = createRequestHandler({
153
+ const makeHandler = raw.dataRequests
154
+ ? (await import("@tschk/moonshine-server/data-http")).createRequestHandler
155
+ : createRequestHandler;
156
+ const fetch = makeHandler({
154
157
  manifest,
155
158
  modules,
156
159
  renderer,