Implements the proposed file naming convention discussed in #4
There may be some goofs here and there (the Remix routing convention doesn't have a tonne of tests to copy). It supports all of the features listed in the Remix documentation.
It can be enabled by renaming the routes folder to res-routes and updating remix.config.js to call the registration function.
One thing to note: We require the registerRoutes.js file to be in a known location and to be using the commonjs module system so it works with Node. We can't guarantee those when it's being used as a dependency by another project as the JS output location and module system is defined by the consumer's bsconfig.json. As a result, we need to generate this file at build time and publish it to npm. There's a postbuild step to copy the file to the correct location.
Also, should I be updating the README for this stuff as part of this PR? Or should we do a documentation pass when this project is a bit more mature (and just show how to use it in the template project for now).
Closes #4
Implements the proposed file naming convention discussed in #4
There may be some goofs here and there (the Remix routing convention doesn't have a tonne of tests to copy). It supports all of the features listed in the Remix documentation.
It can be enabled by renaming the
routes
folder tores-routes
and updatingremix.config.js
to call the registration function.One thing to note: We require the
registerRoutes.js
file to be in a known location and to be using the commonjs module system so it works with Node. We can't guarantee those when it's being used as a dependency by another project as the JS output location and module system is defined by the consumer'sbsconfig.json
. As a result, we need to generate this file at build time and publish it to npm. There's apostbuild
step to copy the file to the correct location.Also, should I be updating the README for this stuff as part of this PR? Or should we do a documentation pass when this project is a bit more mature (and just show how to use it in the template project for now).