Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples folder organisation #161

Closed
vorg opened this issue Mar 20, 2019 · 5 comments
Closed

Examples folder organisation #161

vorg opened this issue Mar 20, 2019 · 5 comments
Labels
needs-review type/docs Documentation only changes

Comments

@vorg
Copy link
Member

vorg commented Mar 20, 2019

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.js to examples/scripts/build.js
  • Move examples/helpers.js to examples/helpers/index.js or examples/lib/helpers.js
  • The examples/examples.js becomes then unnecessary as you can just do fs.readdir and filter all js files that we now know are only example files.
  • examples/index.html can be then generated too

Missing

  • common.js
  • index.js
@vorg
Copy link
Member Author

vorg commented Mar 20, 2019

Or even better we could contribute to sketchbook-cli as gallery export in on wishlist there.

@vorg
Copy link
Member Author

vorg commented Sep 9, 2019

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 ?

@dmnsgn
Copy link
Member

dmnsgn commented Sep 9, 2019

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

@vorg
Copy link
Member Author

vorg commented Sep 9, 2019

So i guess the next step is to implement #72 and remove helpers

@dmnsgn dmnsgn added type/docs Documentation only changes and removed enhancement labels Jul 5, 2022
@dmnsgn
Copy link
Member

dmnsgn commented May 5, 2023

v4: helpers are in core now, esm and snowdev usage means no build step.

@dmnsgn dmnsgn closed this as completed May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review type/docs Documentation only changes
Projects
None yet
Development

No branches or pull requests

2 participants