Examples folder organisation
We have moved to one js file per example structure with example-name.js files. That's great. But now we also have non-example-file.js there like build.js or helpers.js. It's a bit confusing as you need to read the source to find it is it example or not. It additionally breaks sketchbook-cli (multi file budo-like runner).
Proposal:
- Move
examples/build.jstoexamples/scripts/build.js - Move
examples/helpers.jstoexamples/helpers/index.jsorexamples/lib/helpers.js - The
examples/examples.jsbecomes then unnecessary as you can just dofs.readdirand filter all js files that we now know are only example files. examples/index.htmlcan be then generated too
Missing
common.jsindex.js
Or even better we could contribute to sketchbook-cli as gallery export in on wishlist there.
helpers.js -> that should be in pex-renderer core or pex-helpers build.js -> that has been replaced by webpack.config.js examples.js -> that has been replaced by index.js index.html -> i guess we need that for design
@dmnsgn any feedback on this? Is there current setup messy for you? Can we live with one webpack js file or should we move sources to /src or build scripts to /lib ?
Ideal examples structure:
- webpack.config.js
- index.js: entry to allow serving examples with dynamic imports
- index.html: design and serve the build/main.js
- one file per example
- asset/screenshots/scripts folders
We're close to that, we just need to move helpers. Scripts could be in their own packages as well, as it would be nice to unify pex-renderer/context/gui/gl examples workflow.
Can we live with one webpack js file or should we move sources to /src or build scripts to /lib ?
Are you still talking about the examples here or pex-renderer lib? If the latter, we could have a single file at root folder with two entries:
- generate UMD/ESM build
- serve examples
So i guess the next step is to implement https://github.com/pex-gl/pex-renderer/issues/72 and remove helpers