@tschk/moonshine-deploy-bun 0.3.7 → 0.4.1
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 +7 -7
- package/src/index.ts +8 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tschk/moonshine-deploy-bun",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"test": "bun test"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@tschk/moonshine-
|
|
19
|
-
"@tschk/moonshine-
|
|
20
|
-
"@tschk/moonshine-
|
|
21
|
-
"@tschk/moonshine-
|
|
22
|
-
"@tschk/moonshine-server": "^0.3.6"
|
|
18
|
+
"@tschk/moonshine-compiler": "^0.4.1",
|
|
19
|
+
"@tschk/moonshine-framework": "^0.4.1",
|
|
20
|
+
"@tschk/moonshine-react": "^0.4.1",
|
|
21
|
+
"@tschk/moonshine-server": "^0.4.1"
|
|
23
22
|
},
|
|
24
23
|
"devDependencies": {
|
|
25
24
|
"@types/bun": "1.3.14",
|
|
26
|
-
"typescript": "7.0.2"
|
|
25
|
+
"typescript": "7.0.2",
|
|
26
|
+
"@tschk/moonshine-adapter-conformance": "^0.4.1"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"src"
|
package/src/index.ts
CHANGED
|
@@ -3,12 +3,10 @@ import { dirname, isAbsolute, resolve } from "node:path";
|
|
|
3
3
|
import {
|
|
4
4
|
type DeploymentAdapter,
|
|
5
5
|
type MoonshineManifest,
|
|
6
|
-
} from "@tschk/moonshine-framework";
|
|
7
|
-
import { tryServeStatic } from "@tschk/moonshine-server";
|
|
8
|
-
import {
|
|
9
6
|
type Harness,
|
|
10
7
|
type HarnessFactory,
|
|
11
|
-
} from "@tschk/moonshine-
|
|
8
|
+
} from "@tschk/moonshine-framework";
|
|
9
|
+
import { tryServeStatic } from "@tschk/moonshine-server";
|
|
12
10
|
|
|
13
11
|
export type BunServerOptions = {
|
|
14
12
|
fetch: (request: Request) => Promise<Response>;
|
|
@@ -82,11 +80,12 @@ export const bunAdapter: DeploymentAdapter = {
|
|
|
82
80
|
capabilities: ["streaming", "islands", "revalidation"],
|
|
83
81
|
build: async (manifest, outDir) => {
|
|
84
82
|
await mkdir(outDir, { recursive: true });
|
|
85
|
-
const assets: MoonshineManifest["assets"] =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
const assets: MoonshineManifest["assets"] = await Promise.all(
|
|
84
|
+
manifest.assets.map(async (asset) => {
|
|
85
|
+
const file = await copyAsset(asset, outDir);
|
|
86
|
+
return { ...asset, file };
|
|
87
|
+
}),
|
|
88
|
+
);
|
|
90
89
|
const builtManifest: MoonshineManifest = { ...manifest, assets };
|
|
91
90
|
await writeFile(
|
|
92
91
|
resolve(outDir, "manifest.json"),
|
|
@@ -124,7 +123,6 @@ const server = createBunServer({
|
|
|
124
123
|
port: Number(process.env.PORT) || 0,
|
|
125
124
|
staticDir: import.meta.dir + "/public",
|
|
126
125
|
});
|
|
127
|
-
console.log(server.url.origin);
|
|
128
126
|
`;
|
|
129
127
|
await writeFile(resolve(outDir, "server.ts"), entry);
|
|
130
128
|
},
|