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

Idea: remove dist from the repo #5

Closed
trusktr opened this issue May 18, 2020 · 9 comments
Closed

Idea: remove dist from the repo #5

trusktr opened this issue May 18, 2020 · 9 comments

Comments

@trusktr
Copy link
Contributor

trusktr commented May 18, 2020

It is an annoyance for most people to have to see diffs that also include the dist/ folder. Three.js includes the build/ folder, but the vast majority of all JavaScript project don't do it.

We can build dist/ for when we publish to NPM (or GitHub releases). People can get the built files from unpkg.com.

@trusktr
Copy link
Contributor Author

trusktr commented May 18, 2020

Oh wait, it looks like build/ is the build output folder. Most projects use dist/ as the output folder (a convention in the JS community).

If dist/ is not a built output folder, we can rename it to something else (not sure what yet), and build/ can be renamed to dist/ (but not committed to the repo).

@felixmariotto
Copy link
Owner

Yes I would like to ignore the dist folder when pushing to github, but on another hand I need my local git repo to update this folder because I push the app to heroku, this is the examples page. I'm sure there is a way to do that cleanly, I will look into this.

We can build dist/ for when we publish to NPM (or GitHub releases). People can get the built files from unpkg.com.

This sounds like the right solution, I want to make the bundled app available somehow, for those who include libraries with script tags.

@Zetaphor
Copy link

This sounds like the right solution, I want to make the bundled app available somehow, for those who include libraries with script tags.

Github now has actions and workflows, you can easily automate builds and releases triggered by a tag push

@trusktr
Copy link
Contributor Author

trusktr commented May 28, 2020

I love GitHub Actions. Super easy to set up CI, automated tests, etc!

@felixmariotto
Copy link
Owner

This has been done.
Dist is not pushed in the repo anymore, but is still accessible from NPM, and from unpkg.
I've added a section in the readme explaining the different import options.

@FredericBriolet
Copy link

Hi all,

This library looks cool! However I'm afraid the build file is not accessible at all:

@felixmariotto felixmariotto reopened this Dec 1, 2020
@felixmariotto
Copy link
Owner

Sorry I messed up last time I published, the last patch fixes this :
https://unpkg.com/three-mesh-ui@4.4.4/dist/three-mesh-ui.js

@FredericBriolet
Copy link

Hi @felixmariotto, thanks for the update, it works! Just for info in my case the CommonJS require() doesn't work the way it's written in the README.

This doesn't work, I get an empty object:

const ThreeMeshUI = require('three-mesh-ui/dist/three-mesh-ui.js');
console.log(ThreeMeshUI); // returns {}

This works:

require('three-mesh-ui/dist/three-mesh-ui.js');
console.log(ThreeMeshUI); // usable object

@felixmariotto
Copy link
Owner

felixmariotto commented Dec 8, 2020

@FredericBriolet thank you for pointing this out !
I finally found a good piece of documentation for this, so now the lib is importable the following ways :

const ThreeMeshUI = require('three-mesh-ui')

import ThreeMeshUI from 'three-mesh-ui'

<script src='https://unpkg.com/three-mesh-ui'></script>

I also updated the README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants