Skip to content

Commit 4356348

Browse files
authored
Merge pull request #6173 from Raushan998/feat/migrate_to_npm_from_yarn
feat/migrate to npm from yarn
2 parents 6bb8097 + 14fb2a8 commit 4356348

26 files changed

+18705
-115
lines changed

.dockerignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515

1616
/public/packs
1717
/public/packs-test
18-
/yarn-error.log
19-
yarn-debug.log*
20-
.yarn-integrity
18+
/node_modules
19+
/npm-debug.log
20+
/npm-error.log

.github/labeler.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ erb:
2020

2121
javascript:
2222
- changed-files:
23-
- any-glob-to-any-file: ["**/*.js", "package*.json", "yarn.lock"]
23+
- any-glob-to-any-file: ["**/*.js", "package*.json", "package-lock.json"]
2424

2525
Tests! 🎉💖👏:
2626
- changed-files:
2727
- any-glob-to-any-file: ["app/javascript/__tests__/**.test.js", "spec/**/*_spec.rb"]
2828

2929
dependencies:
3030
- changed-files:
31-
- any-glob-to-any-file: ["Gemfile*", "package*.json", "yarn.lock"]
31+
- any-glob-to-any-file: ["Gemfile*", "package*.json", "package-lock.json"]

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/setup-node@v4
2828
with:
2929
node-version-file: '.nvmrc'
30-
cache: "yarn"
30+
cache: "npm"
3131

3232
rspec_parallel:
3333
needs: [preparation]
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: yarn lint
1+
name: npm lint
22

33
on:
44
push:
@@ -8,7 +8,7 @@ on:
88
- '**/*.js'
99
- '**/*.json'
1010
- '**/*.jsx'
11-
- 'yarn.lock'
11+
- 'package.lock.json'
1212
- '.github/workflows/*.yml'
1313
pull_request:
1414
branches:
@@ -17,12 +17,11 @@ on:
1717
- '**/*.js'
1818
- '**/*.json'
1919
- '**/*.jsx'
20-
- 'yarn.lock'
20+
- 'package.lock.json'
2121
- '.github/workflows/*.yml'
2222

2323
jobs:
24-
yarn_lint:
25-
24+
npm_lint:
2625
runs-on: ubuntu-latest
2726

2827
steps:
@@ -32,6 +31,6 @@ jobs:
3231
with:
3332
node-version-file: '.nvmrc'
3433

35-
- run: yarn
36-
- run: yarn lint
37-
- run: yarn test
34+
- run: npm ci
35+
- run: npm run lint
36+
- run: npm run test

.github/workflows/rspec.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ jobs:
4747
uses: actions/setup-node@v4
4848
with:
4949
node-version-file: '.nvmrc'
50-
cache: "yarn"
51-
- run: yarn
50+
cache: "npm"
51+
- run: npm ci
5252

5353
- name: Install PostgreSQL client
5454
run: |

.github/workflows/rspec_parallel.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ jobs:
6262
uses: actions/setup-node@v4
6363
with:
6464
node-version-file: '.nvmrc'
65-
cache: "yarn"
66-
- run: yarn
65+
cache: "npm"
66+
- run: npm ci
6767

6868
- name: Install PostgreSQL client
6969
run: |

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
ruby 3.3.6
2-
yarn 1.22.22
2+
npm 11.0.0
33
nodejs 22.11.0

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/m
3131
WORKDIR $RAILS_ROOT
3232

3333
COPY . .
34-
RUN npm install --global yarn
35-
RUN yarn install
36-
RUN yarn build && yarn build:css
34+
RUN npm install --global npm
35+
RUN npm install
36+
RUN npm run build && npm run build:css
3737

3838
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
3939

Procfile.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
web: bin/rails server -p 3000 -b 0.0.0.0
2-
js: yarn build --watch
3-
css: yarn build:css --watch
2+
js: npm run build --watch
3+
css: npm run build:css --watch

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ The complete [role description of a CASA volunteer](https://pgcasa.org/volunteer
109109
1. (Recommended) Install [nvm](https://github.com/nvm-sh/nvm#installing-and-updating), which is a **n**ode **v**ersion **m**anager.
110110
- If you use asdf, the node version from `.tool-versions` will be used, but may be out of sync with the codename version in `.nvmrc`. To use the version from `.nvmrc`, see one of these options: [legacy file codename support](https://github.com/asdf-vm/asdf-nodejs?tab=readme-ov-file#partial-and-codename-versions) or [installing via custom script](https://github.com/asdf-vm/asdf-nodejs/issues/382#issuecomment-2258647554).
111111
1. Install a current LTS version of Node. Running `nvm install` from this directory will read the `.nvmrc` file to install the correct version.
112-
1. Install [yarn](https://classic.yarnpkg.com/en/docs/install). On Ubuntu, [make sure you install it from the official Yarn repo instead of cmdtest](https://classic.yarnpkg.com/en/docs/install/#debian-stable).
113112

114113
**PostgreSQL ("postgres")**
115114
1. Make sure that postgres is installed.
@@ -180,7 +179,7 @@ To see local email previews, check out http://localhost:3000/rails/mailers
180179

181180
**Running Tests**
182181
- run the ruby test suite `bin/rails spec`
183-
- run the javascript test suite `yarn test`
182+
- run the javascript test suite `npm run test`
184183

185184
If you have trouble running tests, check out CI scripts in [`.github/workflows/`](.github/workflows/) for sample commands.
186185
Test coverage is run by simplecov on all builds and aggregated by CodeClimate
@@ -191,7 +190,7 @@ Run `bin/lint` to run all linters and fix issues. This will run:
191190

192191
1. `bundle exec standardrb --fix` auto-fix Ruby linting issues [more linter info](https://github.com/testdouble/standard)
193192
1. `bundle exec erblint --lint-all --autocorrect` [ERB linter](https://github.com/Shopify/erb-lint)
194-
1. `yarn lint:fix` to run the [JS linter](https://standardjs.com/index.html) and fix issues
193+
1. `npm run lint:fix` to run the [JS linter](https://standardjs.com/index.html) and fix issues
195194
1. `rake factory_bot:lint` if you have been editing factories and want to find factories and traits which produce invalid objects
196195

197196
If additional work arises from your pull request that is outside the scope of the issue it resolves, please open a new issue.
@@ -216,7 +215,7 @@ Alternatively, every time you pull the main branch, run:
216215
bin/update
217216
```
218217

219-
which will run any database migrations, update gems and yarn packages, and run
218+
which will run any database migrations, update gems and node packages, and run
220219
the after party post-deployment tasks.
221220

222221
# Other Documentation

0 commit comments

Comments
 (0)