Skip to content

Commit

Permalink
🚀 pnpm
Browse files Browse the repository at this point in the history
Fixes #159
  • Loading branch information
TheKnarf committed Feb 1, 2024
1 parent 878b353 commit 06170d5
Show file tree
Hide file tree
Showing 17 changed files with 14,277 additions and 15,805 deletions.
23 changes: 4 additions & 19 deletions .github/actions/yarn-install/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,10 @@ runs:
with:
node-version: 20

- name: 'Getting yarn cache directory path'
id: yarn-cache-dir-path
working-directory: ./client
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
shell: bash

- uses: actions/cache@v3
id: yarn-cache
- uses: pnpm/action-setup@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
version: 8

- name: 'Installing Dependencies'
working-directory: ./client
run: yarn install --immutable --inline-builds
- name: Install dependencies
shell: bash
env:
YARN_ENABLE_GLOBAL_CACHE: 'false'
YARN_NM_MODE: 'hardlinks-local'
HUSKY: '0'
run: pnpm install
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build And Run Frontend Tests
name: CI

on:
workflow_call:
Expand All @@ -18,7 +18,7 @@ concurrency:

jobs:
typecheck:
name: 'Typechecking and linting'
name: 'Typechecking & linting'
runs-on: ubuntu-latest
permissions:
actions: read
Expand All @@ -34,15 +34,13 @@ jobs:
uses: ./.github/actions/yarn-install

- name: 'Doing the typecheck'
working-directory: ./client
run: yarn typecheck
run: pnpm turbo typecheck

- name: 'Running Eslint'
working-directory: ./client
run: yarn lint
- name: 'Running lint'
run: pnpm turbo lint

test:
name: 'Running Unit Tests'
name: 'Tests'
runs-on: ubuntu-latest
steps:
- name: 'Checking Out Code'
Expand All @@ -54,11 +52,10 @@ jobs:
uses: ./.github/actions/yarn-install

- name: 'Running Unit Tests'
working-directory: ./client
run: yarn test
run: pnpm turbo test

build:
name: 'Building Static Files'
name: 'Builds'
runs-on: ubuntu-latest
steps:
- name: 'Checking Out Code'
Expand All @@ -70,5 +67,4 @@ jobs:
uses: ./.github/actions/yarn-install

- name: 'Building'
working-directory: ./client
run: yarn build
run: pnpm turbo build
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use an official Node.js runtime as a parent image
FROM node:20 as frontend
FROM node:18 as frontend

# Set the working directory in the container
WORKDIR /app
Expand All @@ -8,7 +8,7 @@ WORKDIR /app
COPY ./client/package*.json ./client/yarn.lock ./

# Install client dependencies
RUN yarn install --frozen-lockfile --production=false
RUN yarn install --production=false

# Copy the rest of the client application code to the container
COPY ./client ./
Expand All @@ -20,7 +20,7 @@ RUN yarn build
RUN find . -maxdepth 1 -type f ! -path "./dist/*" -delete

# Create a new image based on the "bff-node" project
FROM node:20
FROM node:18

# Set the working directory in the container
WORKDIR /app
Expand All @@ -30,10 +30,10 @@ COPY --from=frontend /app/dist ./src/public
COPY ./bff-node/package*.json ./bff-node/yarn.lock ./

# Install "bff-node" project dependencies (assuming you have a package.json file in "bff-node" folder)
RUN yarn install --frozen-lockfile
RUN yarn install

COPY ./bff-node ./
EXPOSE 80

# Start the "bff-node" server (modify the startup command as needed)
CMD ["yarn", "start"]
CMD ["yarn", "start"]
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

- Install Docker. We recommend to use OrbStack if you're using Mac or Windows for development, on Linux you can install Docker directly.


- Install pnpm. On macOS you can do that with `brew install pnpm`.
3 changes: 3 additions & 0 deletions bff-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"@azure/app-configuration": "^1.4.1",
"@azure/identity": "^4.0.0",
"@azure/keyvault-keys": "^4.7.2",
"@types/body-parser": "^1.19.5",
"applicationinsights": "^2.9.0",
"axios": "^1.6.2",
"azure-app-configuration": "^0.0.1-security.3",
"body-parser": "^1.20.2",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
Expand All @@ -31,6 +33,7 @@
"scripts": {
"start": "ts-node src/index.ts",
"build": "tsc",
"typecheck": "tsc --noEmit",
"typeorm": "typeorm-ts-node-commonjs",
"typeormold": "typeorm-ts-node-commonjs -r tsconfig-paths/register ./node_modules/typeorm/cli.js -d src/data-source.ts",
"typeorm:local": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js -d src/data-source.local.ts",
Expand Down
Loading

0 comments on commit 06170d5

Please sign in to comment.