In liferay-portal we really only have two places that we can put source code:
- "src": production source that will be compiled into a JAR file
- "test": everything else
The fact that the "everything else" category is named "test" even though it may in fact contain other, non-test, things isn't ideal, but it is the historical convention that we've been operating under.
An example of where we've worked around this in the past has been with Storybook files, which we keep under "test/stories/" and which we configure Jest to ignore:
In Commerce, we have some source that does not conform to this pattern:
- In commerce-frontend-js we have a "dev" folder that contains helpers to enable development outside of a running liferay-portal instance
- We have "dev" code intermingled with production code elsewhere.
I don't think we want to open the floodgates to more and more top-level folders because that causes problems elsewhere (eg. we have to configure our linting and formatting code to know about these additional locations); and what should these other top-level folders be called, and how many should there be?
As such, I'd propose that we deal with the immediate problems in commerce by restructuring things under "test". The existing "src"
vs"test" distinction isn't perfect, but it is working reasonably well. We can do some local Jest configuration to stop the tests from running against the non-test files, and if other projects beyond commerce show a need for the same, then we can make it official and bake it into the defaults.