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

feat: add nix flake and .devcontainer.json #594

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

feat: add nix flake and .devcontainer.json #594

wants to merge 8 commits into from

Conversation

lajp
Copy link
Member

@lajp lajp commented Jan 9, 2025

Description

  • add nix flake and .devcontainer.json to make setting up the development environment trivial

Before submitting the PR, please make sure you do the following

  • If your PR is related to a previously discussed issue, please link to it here.
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Make sure the commit history is linear, up-to-date with main branch and does not contain any erroneous changes

Formatting and linting

  • Format code with pnpm format and lint the project with pnpm lint

@lajp lajp added enhancement New feature or request Nice to have labels Jan 9, 2025
@lajp lajp requested a review from kahlstrm January 9, 2025 17:48
@lajp lajp requested a review from MikaelSiidorow January 9, 2025 18:07
kahlstrm and others added 2 commits January 9, 2025 20:48
This fixes an issue with the ESLint server within the dev container.
Copy link
Collaborator

@MikaelSiidorow MikaelSiidorow left a comment

Choose a reason for hiding this comment

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

Didn't quite work first try, but restarting VSCode twice it seems to now work. No config needed.

First try failed during initializing devcontainer, but automatically prompted to retry
Second try it didn't find node or pnpm and couldn't start the dev server, didn't prompt a restart and I did it manually
Third try pnpm dev worked fine and everything seems to work

Nix Node version is a bit behind what we have in pkg.json and it gives a warning, but doesn't seem to break anything.

Should we also add some of the tasks to VSCode config? For dev, lint etc 🤔 Though it might be a good idea to still force using the terminal for learning

Copy link
Collaborator

@MikaelSiidorow MikaelSiidorow left a comment

Choose a reason for hiding this comment

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

There also seems to be some trouble loading the tsserver from the workspace. It doesn't have typescript in node_modules 👀

The second problem not finding node or pnpm seems to be a sort of race condition, second time I rebuilt the devcontainer it worked simply after waiting a few seconds

@lajp
Copy link
Member Author

lajp commented Jan 12, 2025

Tasks could be a good idea, I also considered using devenv processes to start the db and pnpm dev automatically, but I think it is in our interest to keep the instructions for developing with and without a dev container the same.

@MikaelSiidorow
Copy link
Collaborator

There's a race condition with the ESLint extension and loading Node.js in the devcontainer atm. Node doesn't exist when eslint extension is trying to access it, and it doesn't seem to work even with restarts

@lajp
Copy link
Member Author

lajp commented Jan 12, 2025

There's a race condition with the ESLint extension and loading Node.js in the devcontainer atm. Node doesn't exist when eslint extension is trying to access it, and it doesn't seem to work even with restarts

This is something that should be handled by the direnv extension. I'll look into it at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Nice to have
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants