fish conf dir, justfile

This commit is contained in:
Dylan Knutson
2024-12-18 18:29:37 +00:00
parent 3eb9be47bc
commit 8051c86bb4
7 changed files with 51 additions and 13 deletions

View File

@@ -48,20 +48,11 @@ RUN \
libvips42 \
libyaml-dev \
patch \
# rbenv \
iputils-ping \
rustc \
uuid-dev \
zlib1g-dev
# USER vscode
# ENV PATH=/home/vscode/.rbenv/shims:$PATH
# ENV CONFIGURE_OPTS="--disable-install-rdoc"
# RUN git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
# RUN rbenv install 3.2.0
# RUN rbenv global 3.2.0
COPY --from=native-gems /usr/src/app/gems/xdiff-rb /gems/xdiff-rb
COPY --from=native-gems /usr/src/app/gems/rb-bsdiff /gems/rb-bsdiff
@@ -70,12 +61,14 @@ ENV RAILS_ENV development
# [Optional] Uncomment this line to install additional gems.
RUN su vscode -c "gem install bundler -v '2.4.1'" && \
su vscode -c "gem install rake -v '13.0.6'" && \
su vscode -c "gem install ruby-lsp -v '0.22.1'" && \
su vscode -c "gem install rubocop -v '1.69.2'"
su vscode -c "gem install ruby-lsp -v '0.22.1'"
# install exo
RUN su vscode -c "curl -sL https://exo.deref.io/install | bash"
ENV PATH "/home/vscode/.exo/bin:$PATH"
# install just (command runner)
RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install 18 && nvm use 18 && npm install -g yarn" 2>&1
ENV PATH /usr/local/share/nvm/current/bin:$PATH

View File

@@ -1,4 +1,4 @@
version: '3'
version: "3"
services:
app:
@@ -8,6 +8,7 @@ services:
volumes:
- ../..:/workspaces:cached
- ./fish-shell-conf-d:/home/vscode/.config/fish/conf.d
- devcontainer-redux-gem-cache:/usr/local/rvm/gems
# Overrides default command so things don't shut down after the process ends.

View File

@@ -0,0 +1 @@
complete -f -c just -a (just --summary)

View File

@@ -0,0 +1,17 @@
function fish_prompt -d "Write out the prompt"
# This shows up as USER@HOST /home/user/ >, with the directory colored
# $USER and $hostname are set by fish, so you can just use them
# instead of using `whoami` and `hostname`
printf '%s %s%s> ' \
(printf '%s%s%s' (set_color -d grey) $USER (set_color normal)) \
(printf '%s%s%s' (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)) \
(fish_git_prompt)
end
function fish_right_prompt -d "Write out the right prompt"
set_color red
if [ $RAILS_ENV = "development" ]
set_color -d green
end
printf '%s%s' (echo $RAILS_ENV) (set_color normal)
end

14
justfile Normal file
View File

@@ -0,0 +1,14 @@
default:
@just --list
[private]
changed-ruby-files:
@git diff --name-only | \
(grep -v 'db/schema.rb' || true) | \
(grep -E '(\.(rb|rake|erb)|Rakefile)$' || true)
format-changed:
just changed-ruby-files | xargs -I{} bash -c "stree format {} > {}.tmp && mv {}.tmp {}"
format-all:
find . -name '*.rb' -type f -exec sh -c 'stree format "$1" > "$1.tmp" && mv "$1.tmp" "$1"' sh {} \;

View File

@@ -19,9 +19,9 @@
"mini-css-extract-plugin": "^2.7.5",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react_ujs": "^2.6.2",
"react-dom": "^18.2.0",
"react-on-rails": "13.3.3",
"react_ujs": "^2.6.2",
"shakapacker": "6.6.0",
"style-loader": "^3.3.2",
"terser-webpack-plugin": "5",
@@ -39,8 +39,10 @@
],
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@prettier/plugin-ruby": "^4.0.4",
"@types/lodash": "^4.14.192",
"@types/react": "^18.0.33",
"prettier": "^3.4.2",
"react-refresh": "^0.14.0",
"typescript": "^5.0.3",
"webpack": "5",

View File

@@ -1102,6 +1102,11 @@
schema-utils "^3.0.0"
source-map "^0.7.3"
"@prettier/plugin-ruby@^4.0.4":
version "4.0.4"
resolved "https://registry.yarnpkg.com/@prettier/plugin-ruby/-/plugin-ruby-4.0.4.tgz#73d85fc2a1731a3f62b57ac3116cf1c234027cb6"
integrity sha512-lCpvfS/dQU5WrwN3AQ5vR8qrvj2h5gE41X08NNzAAXvHdM4zwwGRcP2sHSxfu6n6No+ljWCVx95NvJPFTTjCTg==
"@sinclair/typebox@^0.25.16":
version "0.25.24"
resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.24.tgz"
@@ -3628,6 +3633,11 @@ postcss@^8.4.19, postcss@^8.4.21:
picocolors "^1.0.0"
source-map-js "^1.0.2"
prettier@^3.4.2:
version "3.4.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.4.2.tgz#a5ce1fb522a588bf2b78ca44c6e6fe5aa5a2b13f"
integrity sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==
process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz"