Skip to content

Commit

Permalink
refactor(other): use pnpm
Browse files Browse the repository at this point in the history
Motivation
----------
`pnpm` itself has a number of advantages, two are very relevant for our repository:
* De-duplication of node modules
* Run commands across packages

This will also setup `dotenvx` to read .env files (for unique port numbers).

It will also make local development with `docker compose` obsolete for our nodejs projects.

How to test
-----------
1. `pnpm install`
2. `pnpm run -r dev`

commits:
  * fix unique ports and environments
  * fix: extraneous import
  * remove obsolete `package-lock.json`
  * run `pnpm install`
  * run `corepack use pnpm@latest`
  • Loading branch information
roschaefer committed Jul 2, 2024
1 parent 455706c commit 03bb007
Show file tree
Hide file tree
Showing 23 changed files with 24,883 additions and 107,510 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/admin.deploy.chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: './.tool-versions'
cache: 'pnpm'
- run: pnpm install
- name: Admin | Build
run: npm install && npm run chromatic -- --exit-zero-on-changes
working-directory: ./admin
run: pnpm run --filter dreammall-admin chromatic -- --exit-zero-on-changes
30 changes: 20 additions & 10 deletions .github/workflows/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: './.tool-versions'
cache: 'pnpm'
- run: pnpm install
- name: Admin | Build
run: npm install && npm run build
working-directory: ./admin
run: pnpm run --filter dreammall-admin build

docker-production:
if: needs.files-changed.outputs.admin == 'true'
Expand Down Expand Up @@ -65,12 +67,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: './.tool-versions'
cache: 'pnpm'
- run: pnpm install
- name: Admin | Build Docs
run: npm install && npm run docs:build
working-directory: ./admin
run: pnpm run --filter dreammall-admin docs:build

storybook:
if: needs.files-changed.outputs.admin == 'true'
Expand All @@ -79,12 +83,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: './.tool-versions'
cache: 'pnpm'
- run: pnpm install
- name: Admin | Build Storybook
run: npm install && npm run storybook:build
working-directory: ./admin
run: pnpm run --filter dreammall-admin storybook:build

lint:
if: needs.files-changed.outputs.admin == 'true'
Expand All @@ -93,12 +99,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: './.tool-versions'
cache: 'pnpm'
- run: pnpm install
- name: Admin | Lint
run: npm install && npm run test:lint
working-directory: ./admin
run: pnpm run --filter dreammall-admin test:lint

unit:
if: needs.files-changed.outputs.admin == 'true'
Expand All @@ -107,9 +115,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: './.tool-versions'
cache: 'pnpm'
- run: pnpm install
- name: Admin | Unit
run: npm install && npm run test:unit
working-directory: ./admin
run: pnpm run --filter dreammall-admin test:unit
5 changes: 4 additions & 1 deletion admin/.env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
PUBLIC_ENV__META__BASE_URL="http://localhost:3000"
PUBLIC_ENV__META__DEFAULT_AUTHOR="IT Team 4 Change"
PUBLIC_ENV__META__DEFAULT_DESCRIPTION="IT4C Frontend Boilerplate"
PUBLIC_ENV__META__DEFAULT_TITLE="IT4C"
PUBLIC_ENV__META__DEFAULT_TITLE="IT4C"

PORT=3002
PORT_HMR=24680
Loading

0 comments on commit 03bb007

Please sign in to comment.