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

Added devcontainer.json #2319

Merged
merged 4 commits into from May 11, 2024
Merged

Added devcontainer.json #2319

merged 4 commits into from May 11, 2024

Conversation

okineadev
Copy link
Sponsor Contributor

I've added a devcontainer.json to quickly start development on GitHub Codespaces so that dependencies are automatically installed when the Codespace is created.

What's special about Codespaces is that you can instantly start development on any project

But in this case it won't be instant, because it has to install dependencies before opening, and that takes time, so I advise you to enable prebuilds for Codespaces in the repository settings, this will allow developers to skip installing dependencies and start development in a completely ready-to-use environment, including with previously installed vscode extensions

Also, I strongly recommend adding the "Svg Preview" extension to the pre-installation list, which helps a lot with icon previews

So I suggest you take a look at this PR and discuss how we can improve it

Copy link
Owner

@PKief PKief left a comment

Choose a reason for hiding this comment

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

Thanks for the suggestion. I think adding of the devcontainer.json file is fine for me. I was wondering if you can also start debugging the extension inside of codespaces? I mean the same thing that happens if you press "F5" key in your keyboard so that a new instance of VS Code opens to demonstrate the icons (as shown in 5. on https://github.com/PKief/vscode-material-icon-theme/blob/main/CONTRIBUTING.md#debug-extension-locally)?

"Enable prebuilds for Codespaces" can lead to it costing me money if it's overused, right? I'm not sure if it's worth it for me, as I only use Codespaces very rarely at the moment.

As SVG preview extension I'd rather recommend this one as it's more maintained and provides more features:
https://marketplace.visualstudio.com/items?itemName=jock.svg

Feel free to add it to the list.

@okineadev
Copy link
Sponsor Contributor Author

I was wondering if you can also start debugging the extension inside of codespaces?

It is possible, because I myself worked with my PR from Codespaces

"Enable prebuilds for Codespaces" can lead to it costing me money if it's overused, right? I'm not sure if it's worth it for me, as I only use Codespaces very rarely at the moment.

In this case, it is better to change "onCreateCommand" to "postCreateCommand"

This is so that the editor opens first, and then the connections are already installed, otherwise the developer would have to wait until Codespace is created, and at that time nothing can be done, just wait, and with this fix you can not wait and immediately start doing something, but debug the extension will fail until the dependencies are installed. The download will take place in the background

As SVG preview extension I'd rather recommend this one as it's more maintained and provides more features:
marketplace.visualstudio.com/items?itemName=jock.svg

And the truth, I will add to the list

@okineadev
Copy link
Sponsor Contributor Author

Done

Copy link
Owner

@PKief PKief left a comment

Choose a reason for hiding this comment

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

Thanks for updating it.

@PKief PKief merged commit f6deebc into PKief:main May 11, 2024
2 checks passed
Copy link

Merge Successful

Thanks for your contribution! 🎉

The changes will be part of the upcoming update on the marketplace.

@PKief
Copy link
Owner

PKief commented May 11, 2024

@okineadev I just enabled a prebuild for codespaces.
https://github.com/PKief/vscode-material-icon-theme/actions/runs/9042550531/job/24849214247

Right now it can only be triggered by updating the devcontainer file and it's only available in region Europe West:

image

Hopefully, that's ok for you.

@okineadev
Copy link
Sponsor Contributor Author

okineadev commented May 11, 2024

No, it won't work like that, if you've already activated prebuilds, then we need to change "postCreateCommand" to "onCreateCommand", otherwise prebuilds won't make any sense

PKief added a commit that referenced this pull request May 11, 2024
* Added `devcontainer.json`

* Changed `"onCreateCommand"` to `"postCreateCommand"`

* Added `jock.svg` to preinstalled extensions

---------

Co-authored-by: Philipp Kief <philipp.kief@gmx.de>
PKief added a commit that referenced this pull request May 11, 2024
* Added `devcontainer.json`

* Changed `"onCreateCommand"` to `"postCreateCommand"`

* Added `jock.svg` to preinstalled extensions

---------

Co-authored-by: Philipp Kief <philipp.kief@gmx.de>
@PKief
Copy link
Owner

PKief commented May 11, 2024

@okineadev ok I've updated it :)

7acb299

@PKief
Copy link
Owner

PKief commented May 11, 2024

Can you give me feedback if it's working?

@okineadev
Copy link
Sponsor Contributor Author

image
image

@PKief
Copy link
Owner

PKief commented May 13, 2024

image image

What does that message mean? Can I do something to make it possible or is it a budget limitation of your account?

@okineadev
Copy link
Sponsor Contributor Author

I just maxed out my Codespaces usage limit

@okineadev
Copy link
Sponsor Contributor Author

@PKief, I can confirm that everything works fine, pre-installed NodeJS packages are available, extensions can also be debugged in the browser 👌

image

@PKief
Copy link
Owner

PKief commented May 14, 2024

@PKief, I can confirm that everything works fine, pre-installed NodeJS packages are available, extensions can also be debugged in the browser 👌

image

I'm glad to hear. Thank you for the feedback 🙂

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

Successfully merging this pull request may close these issues.

None yet

2 participants