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

Enhance dev container #2226

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

klinkin
Copy link

@klinkin klinkin commented Jan 30, 2025

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (refactoring and improving code)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Description

This PR improves the Dev Container configuration and post-create.sh script to enhance reliability, maintainability, and developer experience.

Key Improvements

Dev Container Configuration (devcontainer.json)

  • Added postCreateCommand to automatically execute the enhanced post-create.sh script.
  • Ensured zsh is set as the default terminal profile in VS Code.
  • Improved the list of extensions to enhance productivity:
    • Added shellcheck, prettier, git-graph for better shell scripting, formatting, and Git visualization.
    • Refined settings for auto-saving files and formatting on save.

Post-Create Script (post-create.sh)

  • Fixed nvm availability issue by ensuring it is sourced properly before use.
  • Introduced idempotency by checking for existing dependencies before installing them.
  • Wrapped Zsh plugin installation in a function to reduce redundancy and improve maintainability.
  • Added informative logging using echo statements for better debugging and execution visibility.
  • Ensured better error handling by adding set -e to stop execution on failures.

Additional context

This update ensures a more robust and developer-friendly Dev Container setup by minimizing redundant installations, improving shell experience, and providing a more consistent development environment. 🚀

Mihail Klimin added 2 commits January 30, 2025 17:45
- Add error handling with 'set -e'
- Ensure Node.js version check before installation
- Improve idempotency for dependencies
- Add logging for script execution
- Introduce modular Zsh plugin installation
 - onCreateCommand: Added Git configuration for user name and email, which is a useful setup for contributors.
 - postCreateCommand: Added installation of jekyll and bundler gems, which are necessary for building Jekyll sites.

VSCode Settings:
 - files.autoSave: Configures auto-save behavior when the window focus changes.
 - editor.formatOnSave: Ensures code is automatically formatted when saving files.
 - workbench.colorTheme: Uses the "Dark+" theme for consistency with many developers' preferences.
 - ruby.rubyPath: Ensures Ruby tools work with the correct Ruby version.

Extensions:
 - Added Ruby and YAML extensions to support Jekyll and configuration files.
 - Added GitLens for enhanced Git experience, and Git Graph for visualization of Git repositories.
 - Integrated several tools such as ShellCheck and Prettier for better shell scripting and code formatting.
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.

1 participant