kiliman / remix-flat-routes

Remix package to define routes using the flat-routes convention
MIT License
640 stars 22 forks source link

Route _xyzzy+/a._b.c.tsx does not nest correctly #83

Open lpsinger opened 8 months ago

lpsinger commented 8 months ago

In Remix's route module convention, the following three route module filenames are interpreted as an ordinary route, a pathless layout route, and another ordinary route, each containing the next:

a.tsx
a._b.tsx
a._b.c.tsx

However, with remix-flat-routes, this does not work as expected if the modules are contained within a folder, like this:

_xyzzy+/a.tsx
_xyzzy+/a._b.tsx
_xyzzy+/a._b.c.tsx

Add a (currently failing) unit test to demonstrate this bug.

Note: update Jest to 28.x because that version introduced test.failing.

socket-security[bot] commented 8 months ago

New and updated dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
jest-environment-jsdom 29.7.0 eval +47 4.54 MB simenb
jest 27.5.1...28.1.3 None +69/-95 3.33 MB simenb
babel-jest 27.5.1...28.1.3 environment +13/-14 744 kB simenb
ts-jest 27.1.4...28.0.8 None +70/-97 3.59 MB kul
@types/jest 27.4.1...28.1.8 None +17/-6 974 kB types
socket-security[bot] commented 8 months ago

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Issue Package Version Note Source
Invalid package.json @jest/globals 28.1.3
Invalid package.json jest-watcher 28.1.3

Next steps

What is an invalid package.json?

Package has an invalid package.json and can cause installation problems if you try to use it.

Fix syntax errors in the invalid package.json and publish a new version with a valid package.json. Consumers can use npm overrides to force a version that does not have this problem if one exists.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore @jest/globals@28.1.3
  • @SocketSecurity ignore jest-watcher@28.1.3
lpsinger commented 8 months ago

These lines are the culprit:

https://github.com/kiliman/remix-flat-routes/blob/aadb03ae670493e888488086ddb1bfa364452c54/src/index.ts#L418-L425

kiliman commented 8 months ago

Thanks! I'll take a look.