@backtickjs/hono 0.2.7 → 0.2.8

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/dist/index.d.ts CHANGED
@@ -16,7 +16,6 @@ export interface Manifest {
16
16
  }[];
17
17
  theme_color?: string;
18
18
  background_color?: string;
19
- display?: "fullscreen" | "standalone" | "minimal-ui" | "browser";
20
19
  }
21
20
  /**
22
21
  * Hono's renderer for Backtick screens: under it, `context.render(input)`
@@ -31,8 +30,8 @@ export interface Manifest {
31
30
  * without a module the screen needs gets a 426, and any other refusal of the
32
31
  * bundler's a 400, each with `{ name, message }`.
33
32
  *
34
- * `manifest` is the app's web app manifest, at `/manifest.webmanifest` and in
35
- * `x-backtick-manifest` on every screen, so it's as fresh as they are.
33
+ * `manifest` is the app's web app manifest, sent in `x-backtick-manifest` on
34
+ * every screen, so it's as fresh as they are.
36
35
  */
37
36
  export declare function backtick(options?: {
38
37
  manifest?: Manifest;
package/dist/index.js CHANGED
@@ -12,19 +12,13 @@ import { bundler, BundlerError } from "@backtickjs/bundler";
12
12
  * without a module the screen needs gets a 426, and any other refusal of the
13
13
  * bundler's a 400, each with `{ name, message }`.
14
14
  *
15
- * `manifest` is the app's web app manifest, at `/manifest.webmanifest` and in
16
- * `x-backtick-manifest` on every screen, so it's as fresh as they are.
15
+ * `manifest` is the app's web app manifest, sent in `x-backtick-manifest` on
16
+ * every screen, so it's as fresh as they are.
17
17
  */
18
18
  export function backtick(options = {}) {
19
19
  const { manifest } = options;
20
20
  const json = JSON.stringify(manifest);
21
21
  return async (context, next) => {
22
- if (manifest !== undefined &&
23
- context.req.path === "/manifest.webmanifest") {
24
- return context.body(json, 200, {
25
- "content-type": "application/manifest+json",
26
- });
27
- }
28
22
  context.setRenderer(async (input) => {
29
23
  let modules;
30
24
  try {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAA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AAM,IAAI,EAAE,CAAC;IACf,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backtickjs/hono",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Hono routes as Backtick screens: a route's answer is its server components, bundled for the client that asked",
5
5
  "keywords": [
6
6
  "backtick",
@@ -37,8 +37,8 @@
37
37
  "access": "public"
38
38
  },
39
39
  "dependencies": {
40
- "@backtickjs/bundler": "0.2.7",
41
- "@backtickjs/core": "0.2.7"
40
+ "@backtickjs/bundler": "0.2.8",
41
+ "@backtickjs/core": "0.2.8"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "hono": "^4.13.13"
package/src/index.ts CHANGED
@@ -19,7 +19,6 @@ export interface Manifest {
19
19
  icons?: { src: string; sizes?: string; type?: string }[];
20
20
  theme_color?: string;
21
21
  background_color?: string;
22
- display?: "fullscreen" | "standalone" | "minimal-ui" | "browser";
23
22
  }
24
23
 
25
24
  /**
@@ -35,8 +34,8 @@ export interface Manifest {
35
34
  * without a module the screen needs gets a 426, and any other refusal of the
36
35
  * bundler's a 400, each with `{ name, message }`.
37
36
  *
38
- * `manifest` is the app's web app manifest, at `/manifest.webmanifest` and in
39
- * `x-backtick-manifest` on every screen, so it's as fresh as they are.
37
+ * `manifest` is the app's web app manifest, sent in `x-backtick-manifest` on
38
+ * every screen, so it's as fresh as they are.
40
39
  */
41
40
  export function backtick(
42
41
  options: { manifest?: Manifest } = {},
@@ -44,14 +43,6 @@ export function backtick(
44
43
  const { manifest } = options;
45
44
  const json = JSON.stringify(manifest);
46
45
  return async (context, next) => {
47
- if (
48
- manifest !== undefined &&
49
- context.req.path === "/manifest.webmanifest"
50
- ) {
51
- return context.body(json, 200, {
52
- "content-type": "application/manifest+json",
53
- });
54
- }
55
46
  context.setRenderer(async (input) => {
56
47
  let modules: Modules;
57
48
  try {