Skip to content

Commit

Permalink
Replace yarn with npm (#537)
Browse files Browse the repository at this point in the history
* Replace yarn with npm

* Fix validation workflow

* Oops, also swap yarn here.

* Add package lock
  • Loading branch information
MelissaAutumn authored Jul 11, 2024
1 parent 30e94c2 commit 732e803
Show file tree
Hide file tree
Showing 10 changed files with 8,419 additions and 4,438 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ jobs:
node-version: '20.x'

- name: Install dependencies
run: cd frontend && yarn install
run: cd frontend && npm install

- name: Build stage frontend
run: |
cp frontend/.env.stage.example frontend/.env.stage
cd frontend && yarn build --mode ${{ vars.APP_ENV }}
cd frontend && npm run build -- --mode ${{ vars.APP_ENV }}
- name: install opentofu
uses: opentofu/setup-opentofu@v1
Expand Down Expand Up @@ -324,12 +324,12 @@ jobs:
node-version: '20.x'

- name: Install dependencies
run: cd frontend && yarn install
run: cd frontend && npm install

- name: Build prod frontend
run: |
cp frontend/.env.prod.example frontend/.env.prod
cd frontend && yarn build --mode ${{ vars.APP_ENV }}
cd frontend && npm run build -- --mode ${{ vars.APP_ENV }}
zip ../frontend.zip dist
- name: download ecr tag
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: 'frontend/yarn.lock'
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'

- name: Install dependencies
run: |
cd ./frontend
yarn install
npm install
- name: Test with vitest
run: |
cd ./frontend && yarn test --run
cd ./frontend && npm run test -- --run
3 changes: 2 additions & 1 deletion frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
browser: true,
es2021: true,
},
parser: '@typescript-eslint/parser',
parser: 'vue-eslint-parser',
extends: [
'plugin:vue/vue3-essential',
'plugin:tailwindcss/recommended',
Expand All @@ -15,6 +15,7 @@ module.exports = {
],
overrides: [],
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 'latest',
sourceType: 'module',
},
Expand Down
4 changes: 2 additions & 2 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ pnpm-debug.log*
# Sentry Config File
.env.sentry-build-plugin

# npm lock
package-lock.json
# yarn lock
yarn.lock
2 changes: 1 addition & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ ENV PATH /app/node_modules/.bin:$PATH
RUN apk add --no-cache git

COPY . .
RUN yarn install
RUN npm install

CMD vite dev --port 8080
12 changes: 6 additions & 6 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ Copy the [.env.example](.env.example) as `.env`.
Then simply run:

```bash
yarn install
npm install
```

### Compiles and hot-reloads for development

```bash
yarn run serve
npm run serve
```

### Compiles and minifies for production

```bash
yarn run build
npm run build
```

### Post-CSS
Expand All @@ -42,14 +42,14 @@ We use post-css to enhance our css. Any post-css that isn't in a SFC must be in
Frontend is formatted using ESlint with airbnb rules.

```bash
yarn run lint
yarn run lint --fix
npm run lint
npm run lint -- --fix
```

### Run tests

```bash
yarn run test
npm run test
```

### Customize configuration
Expand Down
6 changes: 2 additions & 4 deletions frontend/deploy.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesourc
RUN apt-get update
RUN apt-get install -y nodejs

RUN npm install --global yarn

# Build site
RUN cd /build/frontend && yarn install
RUN cd /build/frontend && yarn build --mode stage
RUN cd /build/frontend && npm install
RUN cd /build/frontend && npm run build -- --mode stage

# Use our custom nginx config
RUN rm /etc/nginx/conf.d/default.conf
Expand Down
Loading

0 comments on commit 732e803

Please sign in to comment.