Open renkei opened 1 year ago
I've found out that downgrading glob from version 10 to 7 also fixes the issue. Currently, package express-openapi
comes with a "glob": "*"
dependency, changing this into "glob": "7"
would also solve the issue. Anyway, I still prefer this PR to be independent of the format returned by glob.
I've updated my PR because I've probably found a more elegant solution. Instead of calling replace(/\\/, '/')
to get rid of backslashes for routes on Windows, we can use the glob option posix: true
that was introduced with glob 10.1.0, this I've found in the glob changelog
Add posix: true option to return / delimited paths, even on Windows.
I've also updated package.json and package-lock.json to request the latest glob version >= 10.2.7
would love to see this merged. hope this project isnt abandoned - long time no update...
Would also love this merged. I tested this on Windows and it fixes the issues I was having using {id}.js
file formatting (Using the curly braces).
.sync(options.glob, { cwd: dir, posix: true })
Setting that posix: true
works.
Please merge this!
I've found out that downgrading glob from version 10 to 7 also fixes the issue. Currently, package
express-openapi
comes with a"glob": "*"
dependency, changing this into"glob": "7"
would also solve the issue. Anyway, I still prefer this PR to be independent of the format returned by glob.
Can you please elaborate how you done this? I tried to set the following in my package.json in a project referencing express-openapi
:
"overrides": {
"express-openapi": {
"glob": "7"
}
},
But to no avail. Might be because I am using a somewhat complex monorepo with npm modules and maybe the resolution does not work as I expect.
Fixes #868 and #871. It fixes the issue at an early stage of the scan-path-for-routes-procedure. Because fs-routes is responsible for resolving routes it should take care that routes are well-formed. This ensures that consuming packages don't need to care about this.