pf2e icon indicating copy to clipboard operation
pf2e copied to clipboard

Add support for Github codespaces and Vscode devcontainers

Open BCNelson opened this issue 3 years ago • 11 comments

I have found that it is extremely helpful dev particularity new devs to have reproducible dev environments. Github code spaces and devcontainers are a great way of supporting this.

In my fork I have gone the new dev work flow down to.

  1. clone the repo
  2. open in vscode and edit the .env.example file to include your foundry username and password rename to .env
  3. hit the popup to reopen in a container
  4. wait for the container to build
  5. run npm run build
  6. open foundry on http://localhost:30001 and enter admin password pf2edev

BCNelson avatar Aug 20 '22 22:08 BCNelson

Sorry, maybe you could help me understand your request. Are you wanting Foundry run from a codespaces container?

stwlam avatar Aug 20 '22 23:08 stwlam

I think in the almost entire year I've been devving, not one issue stemmed from differing dev environments (outside of failing builds because someone didn't npm ci), outside of users running an older version of something. Any dev environment conflicts didn't come from the runtime, but from using a web browser on mac vs a web browser on windows.

CarlosFdez avatar Aug 20 '22 23:08 CarlosFdez

In general devcontainers allow for better dev environment management. In my case I develop on a low power computer by running the containers on a more powerful remote server. That is a pretty niche use case a more common one is GitHub Codespaces. Or developing on a Chromebook. Along with this flexibility it also allows for a lower beerier to entry for new contributors, especially one who are not comfortable setting up a dev environment.

If that website does not adequately explain it let me know and I can provide more resources.

BCNelson avatar Aug 21 '22 02:08 BCNelson

Sorry, we're not going to be able to host a functioning dev container anywhere.

stwlam avatar Aug 21 '22 02:08 stwlam

@stwlam I think you are misunderstanding the purpose of devcontainers. The project hosts nothing.

BCNelson avatar Aug 21 '22 02:08 BCNelson

there are just a few changes to the repo required. you can take a look at my fork for the necessary changes.

BCNelson avatar Aug 21 '22 02:08 BCNelson

Where would the container live? You've set one up on your own, and that didn't require any changes to the project.

stwlam avatar Aug 21 '22 02:08 stwlam

The changes to the repo are config files that inform IDE's how to create containerized dev environments. In the most basic case you clone the repo and your IDE asks if you would like it to setup the necessary container locally on your computer.

In this case it starts a container with node installed. and then the official foundry docker container and configure them to share the outputs of the build.

BCNelson avatar Aug 21 '22 02:08 BCNelson

That's fine to do, but the project isn't going to have committed configuration files for every IDE.

stwlam avatar Aug 21 '22 02:08 stwlam

I agree that committing files for every IDE is an awful idea, that is not what I'm suggesting. Development Containers are an open standard and have tight integration with Github, this projects repository and continuous integration provider of choice.

The point of this is to lower the barrier for entry to new contributors. I think that it is hard for you to see all of the benefits as you have been working on this project regularly for a very long time. As such you are very comfortable with the current flow.

Ether way it is not a big deal for me. I can continue to use my fork with the necessary configuration changes.

BCNelson avatar Aug 21 '22 02:08 BCNelson

Go ahead and make a PR, and we'll look it over.

stwlam avatar Aug 21 '22 02:08 stwlam