@farbenmeer/bunny 0.3.3 → 0.3.5
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 +60 -11
- package/boilerplate.tar.gz +0 -0
- package/dist/cli/build.d.ts.map +1 -1
- package/dist/cli/build.js +48 -25
- package/dist/cli/build.js.map +1 -1
- package/dist/cli/dev.d.ts.map +1 -1
- package/dist/cli/dev.js +31 -10
- package/dist/cli/dev.js.map +1 -1
- package/dist/cli/generate-server.d.ts +4 -1
- package/dist/cli/generate-server.d.ts.map +1 -1
- package/dist/cli/generate-server.js +8 -4
- package/dist/cli/generate-server.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +35 -14
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/start.d.ts.map +1 -1
- package/dist/cli/start.js +6 -0
- package/dist/cli/start.js.map +1 -1
- package/dist/server.d.ts +6 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +15 -3
- package/dist/server.js.map +1 -1
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -1,28 +1,77 @@
|
|
|
1
1
|
# @farbenmeer/bunny
|
|
2
2
|
|
|
3
|
-
This is a web framework based on [
|
|
3
|
+
This is a web framework based on [Tapi](https://www.npmjs.com/package/@farbenmeer/tapi) and React.
|
|
4
4
|
|
|
5
5
|
## Start a project
|
|
6
6
|
|
|
7
7
|
To scaffold a new project run:
|
|
8
8
|
```bash
|
|
9
|
-
|
|
9
|
+
pnpx @farbenmeer/bunny@latest init my-cool-project
|
|
10
|
+
```
|
|
11
|
+
or if you prefer another package manager:
|
|
12
|
+
```bash
|
|
13
|
+
npx @farbenmeer/bunny@latest init my-cool-project
|
|
14
|
+
bunx @farbenmeer/bunny@latest init my-cool-project
|
|
15
|
+
```
|
|
16
|
+
or even explicitly specify the package manager:
|
|
17
|
+
```bash
|
|
18
|
+
npx @farbenmeer/bunny@latest init --use yarn my-cool-project
|
|
10
19
|
```
|
|
11
20
|
|
|
12
|
-
|
|
21
|
+
it will create a new directory called `my-cool-project` with a basic bunny setup.
|
|
13
22
|
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
* `
|
|
17
|
-
* `
|
|
18
|
-
* `
|
|
19
|
-
* `
|
|
23
|
+
## CLI
|
|
24
|
+
The bunny CLI provides the following commands:
|
|
25
|
+
* `bunny dev` to start the development server
|
|
26
|
+
* `bunny build` to build the project for production
|
|
27
|
+
* `bunny start` to start the production server after building
|
|
28
|
+
* `bunny build --standalone` to build a standalone version with all dependencies bundled
|
|
20
29
|
|
|
21
30
|
## Project Structure
|
|
22
31
|
|
|
23
32
|
The main entry points to the project are
|
|
24
33
|
* `src/index.html` for the client side application. Set up static tags for the favicon and the site title and optionally add some loading UI while the react bundle is being loaded.
|
|
25
|
-
* `src/index.tsx` as the react-entrypoint. This sets up the react application and renders it into the DOM.
|
|
34
|
+
* `src/index.tsx` as the react-entrypoint. This sets up the react application and renders it into the DOM. It imports the `App` component that contains the main frontend logic.
|
|
26
35
|
* `src/main.css` for global styles (mainly tailwindcss-setup)
|
|
27
36
|
* `src/api.ts` for the API entrypoint (using Tapi's `defineApi`). See [Tapi's documentation](https://www.npmjs.com/package/@farbenmeer/tapi) for more information.
|
|
28
|
-
|
|
37
|
+
|
|
38
|
+
## What is bunny?
|
|
39
|
+
Bunny is a minimalistic web framework. The idea is that the frontend is really just a classic react-SPA and the backend is basically just a REST API built on Node.js.
|
|
40
|
+
|
|
41
|
+
There are no directives, no server components or server actions, there is no custom compiler and no filesystem routing.
|
|
42
|
+
|
|
43
|
+
Instead, Bunny uses TApi to create a typed client for the API that is ergonomic to use with modern react. It relies on the Suspense and transition APIs for loading states and Error Boundaries for error handling.
|
|
44
|
+
|
|
45
|
+
## How does it work?
|
|
46
|
+
Bunny bundles the frontend with [Vite](https://vitejs.dev/) and you can directly extend the vite configuration with the `vite` option in `bunny.config.ts`:
|
|
47
|
+
```ts
|
|
48
|
+
import { defineConfig } from '@farbenmeer/bunny';
|
|
49
|
+
|
|
50
|
+
export default defineConfig({
|
|
51
|
+
vite: {
|
|
52
|
+
// Add your custom Vite configuration here
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For the backend, you define your API routes with [TApi](https://www.npmjs.com/package/@farbenmeer/tapi). Bunny uses [connect](https://www.npmjs.com/package/connect) to chain middleware for the node server. Your backend code is bundled with [esbuild](https://esbuild.github.io/) and bunny implements basic hot reloading for the server-side code.
|
|
58
|
+
|
|
59
|
+
That is all there is to it. It really does nothing more.
|
|
60
|
+
|
|
61
|
+
## Packages
|
|
62
|
+
|
|
63
|
+
If you need additional functionality, the boilerplate (as generated by `bunny init`) includes a directory 'instructions' that has markdown documents with instructions on how to add various common packages. You can also find them [on GitHub](https://github.com/farbenmeer/tapi/tree/main/packages/4-bunny-boilerplate/instructions).
|
|
64
|
+
|
|
65
|
+
## Why the name?
|
|
66
|
+
|
|
67
|
+
Originally, bunny was intended to be built on [bun](https://bun.sh/). Bun makes it easy to run typescript code, it provides a convenient server that has routing and hot reloading built in and it automatically builds server-side _and_ client-side code. That seemed like a great starting point for building a framework on top.
|
|
68
|
+
|
|
69
|
+
While bun has a lot (probably a few too many) of cool features, it also has some rough edges that turned out to be deal-breakers along the way so I decided to go back to node and deal with its slightly dated APIs in exchange for stability instead.
|
|
70
|
+
|
|
71
|
+
## Development
|
|
72
|
+
If you feel like contributing to the project, you can find the source code on [GitHub](https://github.com/farbenmeer/tapi).
|
|
73
|
+
|
|
74
|
+
Feel free to open [issues](https://github.com/farbenmeer/tapi/issues), submit [pull requests](https://github.com/farbenmeer/tapi/pulls) or open a [discussion](https://github.com/farbenmeer/tapi/discussions).
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
This project is licensed under the MIT License.
|
|
Binary file
|
package/dist/cli/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/cli/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/cli/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,eAAO,MAAM,KAAK,SAyFd,CAAC"}
|
package/dist/cli/build.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { generateOpenAPISchema } from "@farbenmeer/tapi/server";
|
|
2
1
|
import { Command } from "commander";
|
|
3
2
|
import esbuild from "esbuild";
|
|
4
3
|
import { existsSync } from "node:fs";
|
|
5
|
-
import { mkdir, readFile, rm
|
|
4
|
+
import { mkdir, readFile, rm } from "node:fs/promises";
|
|
6
5
|
import path from "node:path";
|
|
7
6
|
import * as vite from "vite";
|
|
8
7
|
import viteTsconfigPaths from "vite-tsconfig-paths";
|
|
9
|
-
import { generateServer } from "./generate-server.js";
|
|
10
8
|
import { loadEnv } from "../load-env.js";
|
|
9
|
+
import { generateServer } from "./generate-server.js";
|
|
11
10
|
import { readConfig } from "./read-config.js";
|
|
12
11
|
export const build = new Command()
|
|
13
12
|
.name("build")
|
|
@@ -40,30 +39,54 @@ export const build = new Command()
|
|
|
40
39
|
},
|
|
41
40
|
plugins: [...(config.vite?.plugins ?? []), viteTsconfigPaths()],
|
|
42
41
|
});
|
|
43
|
-
await esbuild.build({
|
|
44
|
-
entryPoints: [path.join(srcDir, "api.ts")],
|
|
45
|
-
bundle: true,
|
|
46
|
-
outdir: bunnyDir,
|
|
47
|
-
sourcemap: options.sourcemap,
|
|
48
|
-
platform: "node",
|
|
49
|
-
target: "node24",
|
|
50
|
-
outExtension: {
|
|
51
|
-
".js": ".cjs",
|
|
52
|
-
},
|
|
53
|
-
packages: options.standalone ? "bundle" : "external",
|
|
54
|
-
});
|
|
55
|
-
const { api } = await import(path.join(bunnyDir, "api.cjs"));
|
|
56
|
-
const wellKnownDir = path.join(bunnyDir, "dist", ".well-known");
|
|
57
42
|
const packageJson = JSON.parse(await readFile(path.join(process.cwd(), "package.json"), "utf8"));
|
|
58
|
-
await mkdir(wellKnownDir);
|
|
59
|
-
await writeFile(path.join(wellKnownDir, "openapi.json"), JSON.stringify(await generateOpenAPISchema(api, {
|
|
60
|
-
info: {
|
|
61
|
-
title: packageJson.name,
|
|
62
|
-
version: packageJson.version,
|
|
63
|
-
},
|
|
64
|
-
})));
|
|
65
43
|
if (options.standalone) {
|
|
66
|
-
await
|
|
44
|
+
const serverBuild = await esbuild.build({
|
|
45
|
+
stdin: {
|
|
46
|
+
contents: generateServer(path.join(srcDir, "api.ts"), {
|
|
47
|
+
title: packageJson.name,
|
|
48
|
+
version: packageJson.version,
|
|
49
|
+
}),
|
|
50
|
+
sourcefile: path.join(bunnyDir, "virtual", "server.js"),
|
|
51
|
+
resolveDir: bunnyDir,
|
|
52
|
+
},
|
|
53
|
+
bundle: true,
|
|
54
|
+
outdir: bunnyDir,
|
|
55
|
+
sourcemap: options.sourcemap,
|
|
56
|
+
platform: "node",
|
|
57
|
+
target: "node24",
|
|
58
|
+
entryNames: "server",
|
|
59
|
+
packages: "bundle",
|
|
60
|
+
metafile: true,
|
|
61
|
+
});
|
|
62
|
+
const serverMeta = serverBuild.metafile.outputs[".bunny/prod/server.cjs"];
|
|
63
|
+
console.log("Bunny: Built Standalone Server");
|
|
64
|
+
if (serverMeta) {
|
|
65
|
+
console.log("Total Modules:", Object.keys(serverMeta?.inputs).length);
|
|
66
|
+
console.log("User Modules:", Object.keys(serverMeta?.inputs).filter((key) => key.startsWith("src")));
|
|
67
|
+
console.log("Output Size:", Math.round(serverMeta.bytes / 1000), "kiB");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const apiBuild = await esbuild.build({
|
|
72
|
+
entryPoints: [path.join(srcDir, "api.ts")],
|
|
73
|
+
bundle: true,
|
|
74
|
+
outdir: bunnyDir,
|
|
75
|
+
sourcemap: options.sourcemap,
|
|
76
|
+
platform: "node",
|
|
77
|
+
target: "node24",
|
|
78
|
+
outExtension: {
|
|
79
|
+
".js": ".cjs",
|
|
80
|
+
},
|
|
81
|
+
packages: "external",
|
|
82
|
+
metafile: true,
|
|
83
|
+
});
|
|
84
|
+
const apiMeta = apiBuild.metafile.outputs[".bunny/prod/api.cjs"];
|
|
85
|
+
console.log("Bunny: Built API");
|
|
86
|
+
if (apiMeta) {
|
|
87
|
+
console.log("User Modules:", Object.keys(apiMeta?.inputs));
|
|
88
|
+
console.log("Output Size:", Math.round(apiMeta.bytes / 1000), "kiB");
|
|
89
|
+
}
|
|
67
90
|
}
|
|
68
91
|
});
|
|
69
92
|
//# sourceMappingURL=build.js.map
|
package/dist/cli/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/cli/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/cli/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,OAAO,EAAE;KAC/B,IAAI,CAAC,OAAO,CAAC;KACb,MAAM,CAAC,aAAa,EAAE,qBAAqB,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AE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,eAAO,MAAM,GAAG,SAuIZ,CAAC"}
|
package/dist/cli/dev.js
CHANGED
|
@@ -33,13 +33,14 @@ export const dev = new Command()
|
|
|
33
33
|
...config.vite?.server,
|
|
34
34
|
},
|
|
35
35
|
plugins: [...(config.vite?.plugins ?? []), viteTsconfigPaths()],
|
|
36
|
+
clearScreen: false,
|
|
36
37
|
});
|
|
37
38
|
const app = connect();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const { api } = await import(
|
|
42
|
-
apiRequestHandler = createRequestHandler(api, {
|
|
39
|
+
const tapi = {};
|
|
40
|
+
async function reload(entryPoint) {
|
|
41
|
+
console.log("Loading", entryPoint);
|
|
42
|
+
const { api } = await import(entryPoint);
|
|
43
|
+
tapi.apiRequestHandler = createRequestHandler(api, {
|
|
43
44
|
basePath: "/api",
|
|
44
45
|
hooks: {
|
|
45
46
|
error: (error) => {
|
|
@@ -55,7 +56,7 @@ export const dev = new Command()
|
|
|
55
56
|
version: packageJson.version,
|
|
56
57
|
},
|
|
57
58
|
});
|
|
58
|
-
openAPISchema = JSON.stringify(schema);
|
|
59
|
+
tapi.openAPISchema = JSON.stringify(schema);
|
|
59
60
|
}
|
|
60
61
|
const esbuildContext = await esbuild.context({
|
|
61
62
|
entryPoints: [path.resolve(srcDir, "api.ts")],
|
|
@@ -64,13 +65,33 @@ export const dev = new Command()
|
|
|
64
65
|
outdir: bunnyDir,
|
|
65
66
|
platform: "node",
|
|
66
67
|
target: "node24",
|
|
68
|
+
entryNames: "[name]-[hash]",
|
|
67
69
|
outExtension: { ".js": ".cjs" },
|
|
70
|
+
metafile: true,
|
|
68
71
|
plugins: [
|
|
69
72
|
{
|
|
70
73
|
name: "bunny-hot-reload",
|
|
71
74
|
setup(build) {
|
|
72
|
-
build.onEnd(async () => {
|
|
73
|
-
|
|
75
|
+
build.onEnd(async (result) => {
|
|
76
|
+
console.log("Bunny: Hot-Reload Server");
|
|
77
|
+
result.warnings.forEach((warning) => {
|
|
78
|
+
console.warn("Bunny Server:", warning);
|
|
79
|
+
});
|
|
80
|
+
result.errors.forEach((error) => {
|
|
81
|
+
console.error("Bunny Server:", error);
|
|
82
|
+
});
|
|
83
|
+
if (!result.metafile)
|
|
84
|
+
throw new Error("Metafile not found");
|
|
85
|
+
const entryPoint = Object.keys(result.metafile?.outputs)[0];
|
|
86
|
+
if (!entryPoint)
|
|
87
|
+
throw new Error("Entry point not found");
|
|
88
|
+
const apiMeta = result.metafile?.outputs[entryPoint];
|
|
89
|
+
if (!apiMeta)
|
|
90
|
+
throw new Error("Api Metadata not found");
|
|
91
|
+
console.log("Bunny: Built API");
|
|
92
|
+
console.log("User Modules:", Object.keys(apiMeta.inputs));
|
|
93
|
+
console.log("Output Size:", Math.round(apiMeta.bytes / 1000), "kiB");
|
|
94
|
+
await reload(path.join(process.cwd(), entryPoint));
|
|
74
95
|
});
|
|
75
96
|
},
|
|
76
97
|
},
|
|
@@ -85,7 +106,7 @@ export const dev = new Command()
|
|
|
85
106
|
const url = new URL(req.url, `http://${host}`);
|
|
86
107
|
if (/^\/api(\/|$)/.test(url.pathname)) {
|
|
87
108
|
const request = toRequest(req, url);
|
|
88
|
-
const response = await apiRequestHandler(request);
|
|
109
|
+
const response = await tapi.apiRequestHandler(request);
|
|
89
110
|
if (response.status < 300) {
|
|
90
111
|
console.info(`Bunny: ${request.method} ${url.pathname} ${response.status} ${response.statusText}`);
|
|
91
112
|
}
|
|
@@ -97,7 +118,7 @@ export const dev = new Command()
|
|
|
97
118
|
}
|
|
98
119
|
if (url.pathname === "/.well-known/openapi.json") {
|
|
99
120
|
res.setHeader("Content-Type", "application/json");
|
|
100
|
-
res.write(openAPISchema);
|
|
121
|
+
res.write(tapi.openAPISchema);
|
|
101
122
|
res.end();
|
|
102
123
|
return;
|
|
103
124
|
}
|
package/dist/cli/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,OAAO,EAAE;KAC7B,IAAI,CAAC,KAAK,CAAC;KACX,WAAW,CAAC,0BAA0B,CAAC;KACvC,MAAM,CAAC,eAAe,EAAE,mBAAmB,EAAE,MAAM,CAAC;KACpD,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IACzB,MAAM,MAAM,GAAG,MAAM,UAAU,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,CAAC;IACxD,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAA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rF,CAAC;YACJ,CAAC;YACD,MAAM,YAAY,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YAClC,OAAO;QACT,CAAC;QACD,IAAI,GAAG,CAAC,QAAQ,KAAK,2BAA2B,EAAE,CAAC;YACjD,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;YAClD,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC9B,GAAG,CAAC,GAAG,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QACD,IAAI,EAAE,CAAC;IACT,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAEhC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/B,OAAO,CAAC,GAAG,CAAC,8BAA8B,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-server.d.ts","sourceRoot":"","sources":["../../src/cli/generate-server.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,
|
|
1
|
+
{"version":3,"file":"generate-server.d.ts","sourceRoot":"","sources":["../../src/cli/generate-server.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,UAc5C"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
export function generateServer() {
|
|
1
|
+
export function generateServer(apiPath, apiInfo) {
|
|
2
2
|
return `
|
|
3
|
-
|
|
3
|
+
const { createBunnyApp } = require("@farbenmeer/bunny/server")
|
|
4
4
|
|
|
5
5
|
createBunnyApp({
|
|
6
|
-
api: () => import("
|
|
7
|
-
dist:
|
|
6
|
+
api: () => import("${apiPath}"),
|
|
7
|
+
dist: __dirname + "/dist",
|
|
8
|
+
apiInfo: {
|
|
9
|
+
title: "${apiInfo.title}",
|
|
10
|
+
version: "${apiInfo.version}",
|
|
11
|
+
}
|
|
8
12
|
}).listen(3000);
|
|
9
13
|
`;
|
|
10
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-server.js","sourceRoot":"","sources":["../../src/cli/generate-server.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc;
|
|
1
|
+
{"version":3,"file":"generate-server.js","sourceRoot":"","sources":["../../src/cli/generate-server.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,OAA2C;IAE3C,OAAO;;;;uBAIc,OAAO;;;cAGhB,OAAO,CAAC,KAAK;gBACX,OAAO,CAAC,OAAO;;;CAG9B,CAAC;AACF,CAAC"}
|
package/dist/cli/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBpC,eAAO,MAAM,IAAI,SAgFb,CAAC"}
|
package/dist/cli/init.js
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { exec } from "node:child_process";
|
|
3
|
-
import { access, constants, mkdir, readdir, readFile } from "node:fs/promises";
|
|
3
|
+
import { access, constants, mkdir, readdir, readFile, writeFile, } from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
5
6
|
import { promisify } from "node:util";
|
|
6
|
-
import
|
|
7
|
-
import { exit } from "node:process";
|
|
7
|
+
import * as tar from "tar";
|
|
8
8
|
const $ = promisify(exec);
|
|
9
9
|
export const init = new Command()
|
|
10
10
|
.name("init")
|
|
11
11
|
.description("Initialize a new project")
|
|
12
12
|
.argument("[name]", "Name of the project")
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
exit(1);
|
|
13
|
+
.option("--use <packageManager>", "Package manager to use")
|
|
14
|
+
.action(async (name, options) => {
|
|
16
15
|
console.info("Initializing project...");
|
|
17
16
|
if (name) {
|
|
18
17
|
const dirPath = path.join(process.cwd(), name);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
try {
|
|
19
|
+
if ((await readdir(dirPath, { recursive: true })).length > 0) {
|
|
20
|
+
console.error(`Directory ${name} already exists and contains files.`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
await mkdir(dirPath, { recursive: true });
|
|
25
|
+
}
|
|
22
26
|
}
|
|
23
|
-
|
|
27
|
+
catch {
|
|
24
28
|
await mkdir(dirPath, { recursive: true });
|
|
25
29
|
}
|
|
26
30
|
process.chdir(dirPath);
|
|
@@ -34,12 +38,29 @@ export const init = new Command()
|
|
|
34
38
|
}
|
|
35
39
|
catch { }
|
|
36
40
|
}
|
|
37
|
-
|
|
41
|
+
console.info("Project directory:", process.cwd());
|
|
42
|
+
const boilerplatePath = path.join(fileURLToPath(import.meta.url), "../../../boilerplate.tar.gz");
|
|
43
|
+
await tar.extract({
|
|
44
|
+
file: boilerplatePath,
|
|
45
|
+
cwd: process.cwd(),
|
|
46
|
+
stripComponents: 1,
|
|
47
|
+
});
|
|
48
|
+
console.info("Extracted:", await readdir(process.cwd()));
|
|
49
|
+
const pm = (options.use ||
|
|
50
|
+
process.env.npm_config_user_agent?.match(/^(pnpm|yarn|npm|bun)/)?.[1]) ??
|
|
38
51
|
"npm";
|
|
39
|
-
const packageJson = JSON.parse(await readFile(path.join(process.cwd(), "
|
|
52
|
+
const packageJson = JSON.parse(await readFile(path.join(process.cwd(), "package.json"), "utf8"));
|
|
40
53
|
packageJson.name = path.basename(process.cwd());
|
|
41
|
-
packageJson.
|
|
42
|
-
await
|
|
54
|
+
packageJson.version = "0.1.0";
|
|
55
|
+
await writeFile(path.join(process.cwd(), "package.json"), JSON.stringify(packageJson, null, 2));
|
|
56
|
+
let dockerfile = await readFile(path.join(process.cwd(), "Dockerfile"), "utf8");
|
|
57
|
+
dockerfile = dockerfile
|
|
58
|
+
.replace(/\{\{INSTALL_COMMAND\}\}/g, pm === "npm" ? "npm ci" : `${pm} install --frozen-lockfile`)
|
|
59
|
+
.replace(/\{\{BUILD_COMMAND\}\}/g, `${pm} run build --standalone`);
|
|
60
|
+
await writeFile(path.join(process.cwd(), "Dockerfile"), dockerfile);
|
|
61
|
+
const result = await $(`${pm} install`);
|
|
62
|
+
console.log(result.stdout);
|
|
63
|
+
console.error(result.stderr);
|
|
43
64
|
console.log("Project initialized successfully!");
|
|
44
65
|
});
|
|
45
66
|
//# sourceMappingURL=init.js.map
|
package/dist/cli/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,S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E,cAAc,CAAC,EACxC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CACrC,CAAC;IAEF,IAAI,UAAU,GAAG,MAAM,QAAQ,CAC7B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,EACtC,MAAM,CACP,CAAC;IAEF,UAAU,GAAG,UAAU;SACpB,OAAO,CACN,0BAA0B,EAC1B,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,4BAA4B,CAC5D;SACA,OAAO,CAAC,wBAAwB,EAAE,GAAG,EAAE,yBAAyB,CAAC,CAAC;IAErE,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,EAAE,UAAU,CAAC,CAAC;IAEpE,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAE7B,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC"}
|
package/dist/cli/start.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/cli/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/cli/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,KAAK,SAmBd,CAAC"}
|
package/dist/cli/start.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { createBunnyApp } from "../server.js";
|
|
4
5
|
export const start = new Command()
|
|
@@ -7,10 +8,15 @@ export const start = new Command()
|
|
|
7
8
|
.option("--port <number>", "Port number", "3000")
|
|
8
9
|
.action(async (options) => {
|
|
9
10
|
const bunnyDir = path.join(process.cwd(), ".bunny", "prod");
|
|
11
|
+
const packageJson = JSON.parse(await readFile(path.join(process.cwd(), "package.json"), "utf-8"));
|
|
10
12
|
process.env.NODE_ENV = "production";
|
|
11
13
|
createBunnyApp({
|
|
12
14
|
api: () => import(path.join(bunnyDir, "api.cjs")),
|
|
13
15
|
dist: path.join(bunnyDir, "dist"),
|
|
16
|
+
apiInfo: {
|
|
17
|
+
title: packageJson.name,
|
|
18
|
+
version: packageJson.version,
|
|
19
|
+
},
|
|
14
20
|
}).listen(parseInt(options.port, 10));
|
|
15
21
|
});
|
|
16
22
|
//# sourceMappingURL=start.js.map
|
package/dist/cli/start.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/cli/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,OAAO,EAAE;KAC/B,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,yBAAyB,CAAC;KACtC,MAAM,CAAC,iBAAiB,EAAE,aAAa,EAAE,MAAM,CAAC;KAChD,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO,CAAC,GA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,OAAO,EAAE;YACP,KAAK,EAAE,WAAW,CAAC,IAAI;YACvB,OAAO,EAAE,WAAW,CAAC,OAAO;SAC7B;KACF,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export * from "@farbenmeer/tapi/server";
|
|
2
|
-
import connect from "connect";
|
|
3
2
|
import type { ApiDefinition } from "@farbenmeer/tapi/server";
|
|
3
|
+
import connect from "connect";
|
|
4
4
|
interface BunnyServerOptions {
|
|
5
5
|
api: () => Promise<{
|
|
6
6
|
api: ApiDefinition<any>;
|
|
7
7
|
}>;
|
|
8
8
|
dist: string;
|
|
9
|
+
apiInfo: {
|
|
10
|
+
title: string;
|
|
11
|
+
version: string;
|
|
12
|
+
};
|
|
9
13
|
}
|
|
10
|
-
export declare function createBunnyApp({ api, dist }: BunnyServerOptions): connect.Server;
|
|
14
|
+
export declare function createBunnyApp({ api, dist, apiInfo }: BunnyServerOptions): connect.Server;
|
|
11
15
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK7D,OAAO,OAAO,MAAM,SAAS,CAAC;AAK9B,UAAU,kBAAkB;IAC1B,GAAG,EAAE,MAAM,OAAO,CAAC;QAAE,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC,CAAC;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C;AAED,wBAAgB,cAAc,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,kBAAkB,kBA4DxE"}
|
package/dist/server.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from "@farbenmeer/tapi/server";
|
|
2
|
-
import { createRequestHandler } from "@farbenmeer/tapi/server";
|
|
2
|
+
import { createRequestHandler, generateOpenAPISchema, } from "@farbenmeer/tapi/server";
|
|
3
3
|
import connect from "connect";
|
|
4
4
|
import serveStatic from "serve-static";
|
|
5
|
-
import { fromResponse, toRequest } from "./node-http-adapter.js";
|
|
6
5
|
import { loadEnv } from "./load-env.js";
|
|
7
|
-
|
|
6
|
+
import { fromResponse, toRequest } from "./node-http-adapter.js";
|
|
7
|
+
export function createBunnyApp({ api, dist, apiInfo }) {
|
|
8
8
|
loadEnv("production");
|
|
9
9
|
const app = connect();
|
|
10
10
|
const apiRequestHandler = api().then(({ api }) => createRequestHandler(api, {
|
|
@@ -16,6 +16,7 @@ export function createBunnyApp({ api, dist }) {
|
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
}));
|
|
19
|
+
let openApiJson;
|
|
19
20
|
app.use(async (req, res, next) => {
|
|
20
21
|
if (!req.url)
|
|
21
22
|
return next();
|
|
@@ -34,6 +35,17 @@ export function createBunnyApp({ api, dist }) {
|
|
|
34
35
|
await fromResponse(res, response);
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
38
|
+
if (url.pathname === "/.well-known/openapi.json") {
|
|
39
|
+
if (!openApiJson) {
|
|
40
|
+
openApiJson = JSON.stringify(await generateOpenAPISchema((await api()).api, {
|
|
41
|
+
info: apiInfo,
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
res.setHeader("Content-Type", "application/json");
|
|
45
|
+
res.write(openApiJson);
|
|
46
|
+
res.end();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
37
49
|
next();
|
|
38
50
|
});
|
|
39
51
|
app.use(serveStatic(dist));
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AAExC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAQjE,MAAM,UAAU,cAAc,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAsB;IACvE,OAAO,CAAC,YAAY,CAAC,CAAC;IACtB,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IACtB,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAC/C,oBAAoB,CAAC,GAAG,EAAE;QACxB,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE;YACL,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;gBACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACrB,OAAO,KAAK,CAAC;YACf,CAAC;SACF;KACF,CAAC,CACH,CAAC;IACF,IAAI,WAA+B,CAAC;IAEpC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC/B,IAAI,CAAC,GAAG,CAAC,GAAG;YAAE,OAAO,IAAI,EAAE,CAAC;QAC5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CAAC;YACJ,CAAC;YACD,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;YAClD,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACvB,GAAG,CAAC,GAAG,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QAED,IAAI,EAAE,CAAC;IACT,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IAE3B,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farbenmeer/bunny",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Michel Smola",
|
|
6
6
|
"email": "michel.smola@farbenmeer.de"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
19
|
-
"boilerplate"
|
|
19
|
+
"boilerplate.tar.gz"
|
|
20
20
|
],
|
|
21
21
|
"bin": {
|
|
22
22
|
"bunny": "./cli.js",
|
|
@@ -41,11 +41,12 @@
|
|
|
41
41
|
"connect": "^3.7.0",
|
|
42
42
|
"esbuild": "^0.27.2",
|
|
43
43
|
"serve-static": "^2.2.1",
|
|
44
|
+
"tar": "^7.5.4",
|
|
44
45
|
"vite": "^7.3.0",
|
|
45
46
|
"vite-tsconfig-paths": "^6.0.3",
|
|
46
|
-
"@farbenmeer/react-tapi": "^
|
|
47
|
-
"@farbenmeer/router": "^0.
|
|
48
|
-
"@farbenmeer/tapi": "^0.
|
|
47
|
+
"@farbenmeer/react-tapi": "^6.0.0",
|
|
48
|
+
"@farbenmeer/router": "^0.6.0",
|
|
49
|
+
"@farbenmeer/tapi": "^0.7.0"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@types/connect": "^3.4.38",
|
|
@@ -54,9 +55,9 @@
|
|
|
54
55
|
"@types/react-dom": "^19",
|
|
55
56
|
"@types/serve-static": "^2.2.0",
|
|
56
57
|
"node-mocks-http": "^1.17.2",
|
|
57
|
-
"vitest": "^4.0.16",
|
|
58
58
|
"react": "^19.2.3",
|
|
59
|
-
"react-dom": "^19"
|
|
59
|
+
"react-dom": "^19",
|
|
60
|
+
"vitest": "^4.0.16"
|
|
60
61
|
},
|
|
61
62
|
"peerDependencies": {
|
|
62
63
|
"react": "^19.2.3",
|