Skip to content

Commit

Permalink
feat(dev): support vscode devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed May 31, 2024
1 parent f4c5b24 commit 7d5a0e1
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 4 deletions.
20 changes: 20 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Jekyll",
"image": "mcr.microsoft.com/devcontainers/jekyll:2-bullseye",
"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"postCreateCommand": "bash .devcontainer/post-create.sh",
"customizations": {
"vscode": {
"extensions": [
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"foxundermoon.shell-format",
"killalau.vscode-liquid-snippets",
"mhutchie.git-graph",
"Shopify.theme-check-vscode",
"stylelint.vscode-stylelint",
"yzhang.markdown-all-in-one"
]
}
}
}
10 changes: 10 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

npm_buid() {
bash -i -c "nvm install --lts"
npm i && npm run build
}

[[ -d _sass/dist && -d assets/js/dist ]] || npm_buid

exec zsh
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ updates:
- "major"
schedule:
interval: "weekly"
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package-lock.json

# IDE configurations
.idea
.vscode
.vscode/*
!.vscode/settings.json
!.vscode/extensions.json

Expand Down
5 changes: 4 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
// Liquid syntax highlighting and formatting
"Shopify.theme-check-vscode",
// Common formatter
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"foxundermoon.shell-format",
"stylelint.vscode-stylelint",
"yzhang.markdown-all-in-one"
"yzhang.markdown-all-in-one",
// DevContainer
"ms-vscode-remote.remote-containers"
]
}
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"scss.validate": false,
"less.validate": false,
// Stylint extension settings
"stylelint.snippet": ["css", "less", "postcss", "scss"],
"stylelint.validate": ["css", "less", "postcss", "scss"]
"stylelint.snippet": ["css", "scss"],
"stylelint.validate": ["css", "scss"]
}

0 comments on commit 7d5a0e1

Please sign in to comment.