create-backtick-app 0.2.3 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-backtick-app",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Creates a Backtick app: React Native, React or Solid, with screens from your server on Node or Bun",
5
5
  "keywords": [
6
6
  "backtick",
@@ -11,10 +11,10 @@
11
11
  "format:check": "prettier --check --ignore-unknown ."
12
12
  },
13
13
  "dependencies": {
14
- "@backtickjs/bundler": "^0.2.3",
15
- "@backtickjs/core": "^0.2.3",
16
- "@backtickjs/node-plugin": "^0.2.3",
17
- "@backtickjs/jsx-react": "^0.2.3",
14
+ "@backtickjs/bundler": "^0.2.5",
15
+ "@backtickjs/core": "^0.2.5",
16
+ "@backtickjs/node-plugin": "^0.2.5",
17
+ "@backtickjs/jsx-react": "^0.2.5",
18
18
  "@hono/node-server": "^2.1.4",
19
19
  "hono": "^4.13.13",
20
20
  "react": "19.2.3",
@@ -22,8 +22,8 @@
22
22
  "typescript": "^6.0.3"
23
23
  },
24
24
  "devDependencies": {
25
- "@backtickjs/prettier-plugin": "^0.2.3",
26
- "@backtickjs/tsc": "^0.2.3",
25
+ "@backtickjs/prettier-plugin": "^0.2.5",
26
+ "@backtickjs/tsc": "^0.2.5",
27
27
  "@types/node": "^25.9.1",
28
28
  "@types/react": "19.2.18",
29
29
  "@types/react-dom": "19.2.7",
@@ -16,11 +16,12 @@
16
16
  "format:check": "prettier --check --ignore-unknown ."
17
17
  },
18
18
  "dependencies": {
19
- "@backtickjs/bundler": "^0.2.3",
20
- "@backtickjs/core": "^0.2.3",
21
- "@backtickjs/expo": "^0.2.3",
22
- "@backtickjs/node-plugin": "^0.2.3",
23
- "@backtickjs/jsx-react": "^0.2.3",
19
+ "@backtickjs/bundler": "^0.2.5",
20
+ "@backtickjs/core": "^0.2.5",
21
+ "@backtickjs/expo": "^0.2.5",
22
+ "@backtickjs/hono": "^0.2.5",
23
+ "@backtickjs/node-plugin": "^0.2.5",
24
+ "@backtickjs/jsx-react": "^0.2.5",
24
25
  "@hono/node-server": "^2.1.4",
25
26
  "expo": "~57.0.26",
26
27
  "expo-constants": "~57.0.20",
@@ -34,8 +35,8 @@
34
35
  "typescript": "^6.0.3"
35
36
  },
36
37
  "devDependencies": {
37
- "@backtickjs/prettier-plugin": "^0.2.3",
38
- "@backtickjs/tsc": "^0.2.3",
38
+ "@backtickjs/prettier-plugin": "^0.2.5",
39
+ "@backtickjs/tsc": "^0.2.5",
39
40
  "@testing-library/react": "^16.3.3",
40
41
  "@testing-library/user-event": "^14.6.7",
41
42
  "@types/node": "^25.9.1",
@@ -1,18 +1,21 @@
1
1
  import { reloadExpo } from "@backtickjs/expo/server";
2
+ import { backtick } from "@backtickjs/hono";
2
3
  import { serve } from "@hono/node-server";
3
4
  import { Hono } from "hono";
4
5
  import { cors } from "hono/cors";
5
6
  import { Home } from "./Home.js";
6
- import { screen } from "./screen.js";
7
7
 
8
8
  const app = new Hono();
9
9
 
10
10
  // `npm run web` serves the app from another origin.
11
11
  app.use(cors({ origin: "*", allowHeaders: ["x-backtick-modules"] }));
12
12
 
13
+ // `context.render(element)` answers with the screen, bundled for the app.
14
+ app.use(backtick());
15
+
13
16
  // Your app's screens: add a route, and the app can fetch it. A path can
14
17
  // take parameters, `/stories/:id`, read with `context.req.param("id")`.
15
- app.get("/", (context) => screen(context, <Home />));
18
+ app.get("/", (context) => context.render(<Home />));
16
19
 
17
20
  // Answered rather than crashed on, so the app can show why.
18
21
  app.onError((error, context) => {
@@ -11,18 +11,18 @@
11
11
  "format:check": "prettier --check --ignore-unknown ."
12
12
  },
13
13
  "dependencies": {
14
- "@backtickjs/bundler": "^0.2.3",
15
- "@backtickjs/core": "^0.2.3",
16
- "@backtickjs/node-plugin": "^0.2.3",
17
- "@backtickjs/jsx-solid": "^0.2.3",
14
+ "@backtickjs/bundler": "^0.2.5",
15
+ "@backtickjs/core": "^0.2.5",
16
+ "@backtickjs/node-plugin": "^0.2.5",
17
+ "@backtickjs/jsx-solid": "^0.2.5",
18
18
  "@hono/node-server": "^2.1.4",
19
19
  "hono": "^4.13.13",
20
20
  "solid-js": "1.9.17",
21
21
  "typescript": "^6.0.3"
22
22
  },
23
23
  "devDependencies": {
24
- "@backtickjs/prettier-plugin": "^0.2.3",
25
- "@backtickjs/tsc": "^0.2.3",
24
+ "@backtickjs/prettier-plugin": "^0.2.5",
25
+ "@backtickjs/tsc": "^0.2.5",
26
26
  "@types/node": "^25.9.1",
27
27
  "agent-device": "^0.21.27",
28
28
  "nodemon": "^3.1.14",
@@ -1,15 +0,0 @@
1
- import { bundler } from "@backtickjs/bundler";
2
- import type { JSX } from "@backtickjs/jsx-react/jsx-runtime";
3
- import type { Context } from "hono";
4
-
5
- /**
6
- * `element` as the response to a request from your app, bundled for the
7
- * modules the requesting build carries, as client/moduleMap.ts offers them
8
- * at its packages' versions.
9
- */
10
- export async function screen(context: Context, element: JSX.Element) {
11
- const modules = JSON.parse(context.req.header("x-backtick-modules") ?? "{}");
12
- const bundle = await bundler.build({ input: element, modules });
13
- const { code } = bundle.generate({ format: "cjs" });
14
- return context.body(code, 200, { "content-type": "text/javascript" });
15
- }