Skip to content

Commit

Permalink
fix: from yarn to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
DevNono committed Sep 17, 2023
1 parent 83d05e1 commit 99f2187
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 13,470 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# production
/build
yarn-error.log
pnpm-error.log

# misc
.DS_Store
Expand Down
30 changes: 15 additions & 15 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# React dotenv

NODE_ENV=development
PORT=8081

# Pour désactiver l'ouverture dans un nouvel onglet
BROWSER=none


# App dotenv. These variables are used DURING react build.
# For this reason, the values below will only be used with
# `yarn dev`. For values used along with `yarn build`, check
# the Dockerfile (docker build arguments)

REACT_APP_API_URI=http://localhost:3001
# React dotenv

NODE_ENV=development
PORT=8081

# Pour désactiver l'ouverture dans un nouvel onglet
BROWSER=none


# App dotenv. These variables are used DURING react build.
# For this reason, the values below will only be used with
# `pnpm dev`. For values used along with `pnpm build`, check
# the Dockerfile (docker build arguments)

REACT_APP_API_URI=http://localhost:3001
REACT_APP_API_TIMEOUT=5000
38 changes: 26 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,36 @@ on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn lint
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm lint

build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn build
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm build
52 changes: 26 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# CRA Typescript file generated
src/*.d.ts

TODO.txt
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env

# debug
npm-debug.log*
pnpm-debug.log*
pnpm-error.log*

# CRA Typescript file generated
src/*.d.ts

TODO.txt
bouffe-captures/
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16
FROM node:18

ENV NODE_ENV=production

Expand All @@ -10,21 +10,23 @@ ENV REACT_APP_API_TIMEOUT $API_TIMEOUT

WORKDIR /srv/app

RUN npm install -g pnpm

RUN chown node:node .

USER node

# Node has the uid 1000
COPY --chown=node:node package.json yarn.lock ./
COPY --chown=node:node package.json pnpm-lock.yaml ./

RUN yarn --frozen-lockfile --production=false
RUN pnpm install --frozen-lockfile

COPY --chown=node:node ./ ./

# Build api
RUN yarn build
RUN pnpm build

# Prunes devDependencies
RUN yarn install --production --ignore-scripts --prefer-offline
RUN pnpm install --production --ignore-scripts --prefer-offline

CMD yarn start
CMD pnpm start
74 changes: 37 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# UA Bouffe API
[![Build Status](https://travis-ci.org/ungdev/UA-bouffe.svg?branch=master)](https://travis-ci.org/ungdev/UA-bouffe)

Console de vente de l'UTT Arena

## Installation

### Prérequis

- NodeJS
- Yarn

### Installation de l'application
```
git clone https://github.com/ungdev/UA-bouffe
cp .env.example .env
yarn
```
## Développement

### Démarrer l'API en développement
```
yarn dev
```
### Avant de commit
Afin de garder une certaine cohérence dans le code, on utilise EsLint et Prettier. Il faut donc bien lint le code avant de commit
```
yarn lint-fix
```

### Démarrer l'API en production
```
yarn build
yarn start
```
### Licence
Le code est sous licence MIT.
# UA Bouffe API
[![Build Status](https://travis-ci.org/ungdev/UA-bouffe.svg?branch=master)](https://travis-ci.org/ungdev/UA-bouffe)

Console de vente de l'UTT Arena

## Installation

### Prérequis

- NodeJS
- Pnpm

### Installation de l'application
```
git clone https://github.com/ungdev/UA-bouffe
cp .env.example .env
pnpm
```
## Développement

### Démarrer l'API en développement
```
pnpm dev
```
### Avant de commit
Afin de garder une certaine cohérence dans le code, on utilise EsLint et Prettier. Il faut donc bien lint le code avant de commit
```
pnpm lint-fix
```

### Démarrer l'API en production
```
pnpm build
pnpm start
```
### Licence
Le code est sous licence MIT.
Loading

0 comments on commit 99f2187

Please sign in to comment.