Skip to content

Commit

Permalink
Remove yarn and use npm
Browse files Browse the repository at this point in the history
  • Loading branch information
albus522 committed Aug 1, 2024
1 parent 389cf05 commit 1a8d6ad
Show file tree
Hide file tree
Showing 9 changed files with 222 additions and 168 deletions.
11 changes: 6 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,32 @@ jobs:
PGHOST: localhost
PGUSER: buildlight
RAILS_ENV: test
- image: postgres:10.1-alpine
- image: postgres:16-alpine
environment:
POSTGRES_USER: buildlight
POSTGRES_DB: buildlight_test
POSTGRES_PASSWORD: ""
POSTGRES_PASSWORD: "correcthorsebatterystaple"
steps:
- checkout
- run: echo -e "export RAILS_ENV=test\nexport RACK_ENV=test" >> $BASH_ENV
- run: 'bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
--jobs=4 --retry=3 '
- run:
name: Install Yarn Dependencies
command: yarn install --cache-folder ~/.yarn-cache
name: Install NPM Dependencies
command: npm install
- run: |-
mkdir -p config && echo 'test:
database: buildlight_test
adapter: postgresql
encoding: unicode
pool: 15
username: buildlight
password: correcthorsebatterystaple
host: localhost
' > config/database.yml
- run:
command: bundle exec bin/setup
- run:
command: yarn build:css
command: npm run build:css
- run:
command: bundle exec rake
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ jobs:
with:
bundler-cache: true

- uses: actions/cache@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
path: ~/.yarn-cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn Install
run: yarn install --cache-folder ~/.yarn-cache
node-version-file: 'package.json'
cache: 'npm'

- name: NPM Install
run: npm ci

- name: App Setup
run: bin/setup

- name: Build CSS
run: yarn build:css
run: npm run build:css

- name: Standard
run: bundle exec rake standard
Expand Down
5 changes: 0 additions & 5 deletions .yarnrc

This file was deleted.

8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,17 @@ RUN apk update && \

FROM prebuild as node

# Install JavaScript dependencies
# Install Node.js
ARG NODE_VERSION=22.4.0
ARG YARN_VERSION=1.22.19
ENV PATH=/usr/local/node/bin:$PATH
RUN curl -sL https://unofficial-builds.nodejs.org/download/release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64-musl.tar.gz | tar xz -C /tmp/ && \
mkdir /usr/local/node && \
cp -rp /tmp/node-v${NODE_VERSION}-linux-x64-musl/* /usr/local/node/ && \
npm install -g yarn@$YARN_VERSION && \
rm -rf /tmp/node-v${NODE_VERSION}-linux-x64-musl

# Install node modules
COPY --link package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY --link package.json ./
RUN npm install


FROM prebuild as build
Expand Down
2 changes: 1 addition & 1 deletion Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: bin/rails server -p 3000
css: yarn build:css --watch
css: npm run build:css -- --watch
11 changes: 0 additions & 11 deletions bin/yarn

This file was deleted.

199 changes: 199 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"name": "app",
"private": "true",
"dependencies": {
"sass": "^1.77.8",
"yarn": "^1.22.22"
"sass": "^1.77.8"
},
"engines": {
"node": "^22.0.0"
},
"scripts": {
"build:css": "sass ./app/assets/stylesheets/application.sass.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules"
},
"packageManager": "yarn@1.22.19"
}
}
Loading

0 comments on commit 1a8d6ad

Please sign in to comment.