honox 0.1.39 → 0.1.40

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
@@ -46,6 +46,11 @@ Below is a typical project structure for a HonoX application.
46
46
  │   │   ├── _renderer.tsx // renderer definition
47
47
  │   │   ├── about
48
48
  │   │   │   └── [name].tsx // matches `/about/:name`
49
+ │   │   ├── blog
50
+ │   │   │   ├── index.tsx // matches /blog
51
+ │   │   │   └── (content)
52
+ │   │   │      ├── _renderer.tsx // renderer definition for routes inside this directory
53
+ │   │   │      └── [name].tsx // matches `/blog/:name`
49
54
  │   │   └── index.tsx // matches `/`
50
55
  │   └── server.ts // server entry file
51
56
  ├── package.json
@@ -81,7 +81,7 @@ const createApp = (options) => {
81
81
  }
82
82
  });
83
83
  const middlewareFile = Object.keys(MIDDLEWARE_FILE).find((x) => {
84
- const replacedDir = dir.replaceAll("[", "\\[").replace("]", "\\]");
84
+ const replacedDir = dir.replaceAll("[", "\\[").replaceAll("]", "\\]").replaceAll("(", "\\(").replaceAll(")", "\\)");
85
85
  return new RegExp(replacedDir + "/_middleware.tsx?").test(x);
86
86
  });
87
87
  if (middlewareFile) {
@@ -1,5 +1,5 @@
1
1
  const filePathToPath = (filePath) => {
2
- filePath = filePath.replace(/\.tsx?$/g, "").replace(/\.mdx?$/g, "").replace(/^\/?index$/, "/").replace(/\/index$/, "").replace(/\[\.{3}.+\]/, "*").replace(/\[(.+?)\]/g, ":$1");
2
+ filePath = filePath.replace(/\.tsx?$/g, "").replace(/\.mdx?$/g, "").replace(/^\/?index$/, "/").replace(/\/index$/, "").replace(/\[\.{3}.+\]/, "*").replace(/\((.+?)\)/g, "").replace(/\[(.+?)\]/g, ":$1").replace(/\/\//g, "/");
3
3
  return /^\//.test(filePath) ? filePath : "/" + filePath;
4
4
  };
5
5
  const groupByDirectory = (files) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "honox",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "scripts": {