Skip to content

Commit

Permalink
Remove Yarn from dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
aidewoode committed Mar 1, 2024
1 parent 62e1e1d commit d02389a
Show file tree
Hide file tree
Showing 13 changed files with 4,702 additions and 2,931 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- run: yarn install
cache: 'npm'
- run: npm ci
- name: Test and Lint
run: |
sudo apt-get update
Expand Down
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ ENV BUNDLE_FORCE_RUBY_PLATFORM 1

COPY --from=node /usr/local/bin/node /usr/local/bin/node
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node /opt/yarn-* /opt/yarn

RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm

RUN apk add --no-cache tzdata libpq-dev build-base

Expand All @@ -31,8 +29,8 @@ RUN bundle config --local without 'development test' \
COPY . /app

RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile \
&& yarn cache clean \
&& rm -rf node_modules tmp/cache/* /tmp/* yarn.lock log/production.log app/javascript/* app/assets/* storage/*
&& npm cache clean --force \
&& rm -rf node_modules tmp/cache/* /tmp/* package-lock.json log/production.log app/javascript/* app/assets/* storage/*


FROM base
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ gem "turbo-rails", "~> 1.5.0"
gem "stimulus-rails", "~> 1.2.1"

# Bundle and process CSS in Rails
gem "cssbundling-rails", "~> 1.2.0"
gem "cssbundling-rails", "~> 1.4.0"

# Bundle and transpile JavaScript in Rails
gem "jsbundling-rails", "~> 1.1.2"
gem "jsbundling-rails", "~> 1.3.0"

# Use Puma as the app server
gem "puma", "~> 6.4.0"
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ GEM
crack (0.4.5)
rexml
crass (1.0.6)
cssbundling-rails (1.2.0)
cssbundling-rails (1.4.0)
railties (>= 6.0.0)
cuprite (0.14.3)
capybara (~> 3.0)
Expand Down Expand Up @@ -166,7 +166,7 @@ GEM
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
jsbundling-rails (1.1.2)
jsbundling-rails (1.3.0)
railties (>= 6.0.0)
json (2.6.3)
kamal (0.16.1)
Expand Down Expand Up @@ -389,15 +389,15 @@ DEPENDENCIES
browser (~> 5.3.1)
bullet (~> 7.1.0)
capybara (~> 3.39.0)
cssbundling-rails (~> 1.2.0)
cssbundling-rails (~> 1.4.0)
cuprite (~> 0.14.3)
daemons (~> 1.4.0)
debug
erb_lint (~> 0.4.0)
httparty (~> 0.21.0)
image_processing (~> 1.12)
jbuilder (~> 2.11.5)
jsbundling-rails (~> 1.1.2)
jsbundling-rails (~> 1.3.0)
kamal (~> 0.16.1)
listen (~> 3.8.0)
litestack (~> 0.4.2)
Expand Down
6 changes: 3 additions & 3 deletions Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
web: rails s -p 3000
js: yarn build-dev --watch
css: yarn build-dev:css --watch
web: env RUBY_DEBUG_OPEN=true bin/rails server
js: npm run build-dev -- --watch
css: npm run build-dev:css -- --watch
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ $ docker pull ghcr.io/blackcandy-org/blackcandy:edge

- Ruby 3.2
- Node.js 20
- Yarn
- libvips
- FFmpeg

Expand All @@ -154,7 +153,7 @@ bundle install
### Install JavaScript dependencies

```shell
yarn install
npm install
```

### Database Configuration
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<%= csrf_meta_tags %>
<%= favicon_link_tag "link_icon.png", type: "image/png" %>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
<%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>
<%= yield(:head) %>
</head>

Expand Down
4 changes: 2 additions & 2 deletions bin/dev
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env sh

if ! gem list foreman -i --silent; then
if gem list --no-installed --exact --silent foreman; then
echo "Installing foreman..."
gem install foreman
fi

# Default to port 3000 if not specified
export PORT="${PORT:-3000}"

exec foreman start -f Procfile.dev "$@"
exec foreman start -f Procfile.dev "$@"
19 changes: 0 additions & 19 deletions bin/yarn

This file was deleted.

4 changes: 2 additions & 2 deletions lib/tasks/lint.rake
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ unless Rails.env.production?

namespace :lint do
task :js do
abort("rails lint:js failed") unless system("yarn run standard 'app/javascript/**/*.js'")
abort("rails lint:js failed") unless system("npx standard 'app/javascript/**/*.js'")
end

task :css do
abort("rails lint:css failed") unless system("yarn run stylelint 'app/assets/stylesheets/**/*.scss'")
abort("rails lint:css failed") unless system("npx stylelint 'app/assets/stylesheets/**/*.scss'")
end

task :erb do
Expand Down
Loading

0 comments on commit d02389a

Please sign in to comment.