honox 0.1.33 → 0.1.35

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 CHANGED
@@ -650,37 +650,12 @@ Like the followings:
650
650
 
651
651
  ### Using Tailwind CSS
652
652
 
653
- Given that HonoX is Vite-centric, if you wish to utilize [Tailwind CSS](https://tailwindcss.com/), simply adhere to the official instructions.
653
+ Given that HonoX is Vite-centric, if you wish to utilize [Tailwind CSS](https://tailwindcss.com/), basically adhere to [the official instructions](https://tailwindcss.com/docs/installation/using-vite).
654
654
 
655
- Prepare `tailwind.config.js` and `postcss.config.js`:
656
-
657
- ```js
658
- // tailwind.config.js
659
- export default {
660
- content: ['./app/**/*.tsx'],
661
- theme: {
662
- extend: {},
663
- },
664
- plugins: [],
665
- }
666
- ```
667
-
668
- ```js
669
- // postcss.config.js
670
- export default {
671
- plugins: {
672
- tailwindcss: {},
673
- autoprefixer: {},
674
- },
675
- }
676
- ```
677
-
678
- Write `app/style.css`:
655
+ Write `app/style.css`, you must set the base path for source detection explicitly:
679
656
 
680
657
  ```css
681
- @tailwind base;
682
- @tailwind components;
683
- @tailwind utilities;
658
+ @import "tailwindcss" source("../app");
684
659
  ```
685
660
 
686
661
  Import it in a renderer file. Using the `Link` component will refer to the correct CSS file path after it is built.
@@ -710,6 +685,7 @@ Finally, add `vite.config.ts` configuration to output assets for the production.
710
685
  import honox from 'honox/vite'
711
686
  import { defineConfig } from 'vite'
712
687
  import build from '@hono/vite-build/cloudflare-pages'
688
+ import tailwindcss from '@tailwindcss/vite'
713
689
 
714
690
  export default defineConfig({
715
691
  plugins: [
@@ -719,6 +695,7 @@ export default defineConfig({
719
695
  },
720
696
  }),
721
697
  build(),
698
+ tailwindcss(),
722
699
  ],
723
700
  })
724
701
  ```
@@ -1,5 +1,5 @@
1
1
  import { Fragment, jsx } from "hono/jsx/jsx-runtime";
2
- import { ensureTrailngSlash } from "../utils/path";
2
+ import { ensureTrailngSlash } from "../utils/path.js";
3
3
  const Link = (options) => {
4
4
  let { href, prod, manifest, ...rest } = options;
5
5
  if (href) {
@@ -101,8 +101,12 @@ const createApp = (options) => {
101
101
  }
102
102
  if (typeof routeDefault === "function") {
103
103
  subApp.get(path, setInnerMeta);
104
- subApp.get(path, (c) => {
105
- return c.render(routeDefault(c), route);
104
+ subApp.get(path, async (c) => {
105
+ const result = await routeDefault(c);
106
+ if (result instanceof Response) {
107
+ return result;
108
+ }
109
+ return c.render(result, route);
106
110
  });
107
111
  }
108
112
  }
@@ -1,6 +1,6 @@
1
1
  import { Plugin } from 'vite';
2
2
 
3
- declare const transformJsxTags: (contents: string, componentName: string) => string | undefined;
3
+ declare const transformJsxTags: (contents: string, componentName: string) => any;
4
4
  type IsIsland = (id: string) => boolean;
5
5
  type IslandComponentsOptions = {
6
6
  /**
@@ -64,6 +64,7 @@ const transformJsxTags = (contents, componentName) => {
64
64
  if (ast) {
65
65
  let isTransformed = false;
66
66
  traverse(ast, {
67
+ // @ts-expect-error path is not typed
67
68
  ExportNamedDeclaration(path2) {
68
69
  if (path2.node.declaration?.type === "FunctionDeclaration") {
69
70
  const name = path2.node.declaration.id?.name;
@@ -109,6 +110,7 @@ const transformJsxTags = (contents, componentName) => {
109
110
  specifier.local.name = wrappedFunctionId.name;
110
111
  }
111
112
  },
113
+ // @ts-expect-error path is not typed
112
114
  ExportDefaultDeclaration(path2) {
113
115
  const declarationType = path2.node.declaration.type;
114
116
  if (declarationType === "FunctionDeclaration" || declarationType === "FunctionExpression" || declarationType === "ArrowFunctionExpression" || declarationType === "Identifier") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "honox",
3
- "version": "0.1.33",
3
+ "version": "0.1.35",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -113,7 +113,7 @@
113
113
  "@babel/parser": "7.25.6",
114
114
  "@babel/traverse": "7.25.6",
115
115
  "@babel/types": "7.25.6",
116
- "@hono/vite-dev-server": "0.18.0",
116
+ "@hono/vite-dev-server": "0.18.2",
117
117
  "jsonc-parser": "3.3.1",
118
118
  "precinct": "12.1.2"
119
119
  },
@@ -130,14 +130,12 @@
130
130
  "@hono/eslint-config": "^1.0.2",
131
131
  "@mdx-js/rollup": "^3.0.0",
132
132
  "@playwright/test": "^1.42.0",
133
- "@types/babel__generator": "^7",
134
- "@types/babel__traverse": "^7",
135
133
  "@types/node": "^20.10.5",
136
134
  "eslint": "^9.10.0",
137
135
  "glob": "^10.3.10",
138
136
  "happy-dom": "^15.11.6",
139
137
  "hono": "4.4.13",
140
- "np": "7.7.0",
138
+ "np": "^10.2.0",
141
139
  "prettier": "^3.1.1",
142
140
  "publint": "^0.2.7",
143
141
  "tsup": "^8.1.0",