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

devcontainer #370

Merged
merged 1 commit into from
Feb 24, 2023
Merged

devcontainer #370

merged 1 commit into from
Feb 24, 2023

Conversation

abernier
Copy link
Collaborator

@abernier abernier commented Feb 14, 2023

This PR aims at enhancing the developer experience, by allowing anyone to have the project up-and-running in a Codespace in one click, right from his browser:

image

This PR add a .devcontainer to the repository, that:

  • runs a linux machine (with enough memory)
  • with node 18
  • automatically being pre-npm ci
  • starts build-watching the dist/ folder and start serveing the examples/ folder to http://localhost:3000
  • opens a preview http://localhost:3000 within vscode
  • pre-installs eslint extension

NB: It also works locally with Dev Containers extension


  • let @yomotsu runs this devcontainer abernier:devcontainer branch on Codespace: by clicking on Open in GitHub Codespaces

@abernier abernier force-pushed the devcontainer branch 2 times, most recently from 158f386 to 6fd2efc Compare February 14, 2023 14:25
@@ -0,0 +1 @@
../dist
Copy link
Collaborator Author

@abernier abernier Feb 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a dist symlink in order the static server to serve the examples/ folder as root (to fake that dist/ is inside examples/, see #370 (review))

@@ -16,7 +16,7 @@

<script src="https://unpkg.com/three@0.149.0/build/three.min.js"></script>
<script src="https://unpkg.com/gsap@3.10.4/dist/gsap.min.js"></script>
<script src="../dist/camera-controls.js"></script>
<script src="dist/camera-controls.js"></script>
Copy link
Collaborator Author

@abernier abernier Feb 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just update with the dist symlink here and for the other examples/*.html files

@@ -27,7 +28,7 @@
"three": ">=0.126.1"
},
"scripts": {
"dev": "rollup --config --watch",
"dev": "rollup --config --watch & serve -S -p 3000 examples/ && kill $!",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm run dev now rollup --watch and serve the examples folder at the same time

@abernier abernier marked this pull request as ready for review February 19, 2023 22:56
@@ -23,6 +23,7 @@
"husky": "^8.0.3",
"lint-staged": "^13.1.2",
"rollup": "^3.10.1",
"serve": "^14.2.0",
Copy link
Owner

@yomotsu yomotsu Feb 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nice!
I didn't think this can be possible with only one additional dependency.
and I would like to add this regardless of this PR anyway since non-es-module three.js will be deprecated.

(Actually, I didn't use a local server and opened with file://, but es-module doesn't accept this anymore...)

@yomotsu
Copy link
Owner

yomotsu commented Feb 24, 2023

Thanks!
It seems to work nicely with my favorite vscode extensions which were synced automatically from my local.
Let me merge this.
Screenshot 2023-02-24 at 23 33 00

@yomotsu yomotsu merged commit 83cdf41 into yomotsu:dev Feb 24, 2023
@abernier abernier deleted the devcontainer branch February 24, 2023 15:06
@github-actions
Copy link

🎉 This PR is included in version 2.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants