Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci pnpm #509

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,49 @@ jobs:
name: Build and Test
timeout-minutes: 15
runs-on: ubuntu-latest

# To use Remote Caching, uncomment the next lines and follow the steps below.
# env:
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
# TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
# TURBO_REMOTE_ONLY: true

steps:
- name: Check out code
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Setup Node.js environment
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version-file: "package.json"

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: npm install
run: pnpm install

- name: Build
run: npm run build
run: |
pnpm run -C ./db/prisma/ prisma:generate
pnpm run -r build

# - name: Test
# run: npm run test
24 changes: 24 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Disable `workspace:*` syntax for defining workspace package dependencies.
#
# See: https://pnpm.io/npmrc#save-workspace-protocol
save-workspace-protocol=false

# Link locally available packages to `node_modules` instead of downloading
# from registry.
#
# See: https://pnpm.io/npmrc#link-workspace-packages
link-workspace-packages=true

# Prefer workspace packages over packages on the registry even if there is
# a newer version of the workspace package is available on registry.
#
# Note: Only useful if `save-workspace-protocol=false`, otherwise
# `workspace:*` syntax will handle this case anyway.
#
# See: https://pnpm.io/npmrc#prefer-workspace-packages
prefer-workspace-packages=true

# see https://turbo.build/repo/docs/handbook/tools/prisma#2-add-a-new-database-package
public-hoist-pattern[]=*prisma*

shamefully-hoist=true
2 changes: 2 additions & 0 deletions apps/kampus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
"extends": "../../package.json"
},
"devDependencies": {
"@kampus/ui-next": "*",
"@kampus/tailwind": "*",
"@types/react-relay": "14.1.4",
"relay-compiler": "15.0.0"
},
"dependencies": {
"@kampus/next-auth": "*",
"@kampus/relay": "*",
"@kampus/ui-next": "*",
"react-relay": "15.0.0",
"znv": "0.3.2",
"zod": "3.21.4"
Expand Down
2 changes: 2 additions & 0 deletions apps/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"extends": "../../package.json"
},
"devDependencies": {
"@kampus/kampus": "*",
"@kampus/tailwind": "*",
"@kampus/ui-next": "*",
Comment on lines +18 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why UI package needs these APPs ?
Package should never need an App from the workspace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the @kampus/kampus and @kampus/ui-next imports exist under apps/ui/ (see here).

these imports were working without issues with npm but they need to be defined as dependencies with pnpm as otherwise the imports will fail (due to how pnpm stores packages under node_modules)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine @Ketcap

apps/ui is our storybook application.
packages/ui is the kampus-ui package.

"@storybook/addon-a11y": "^7.0.20",
"@storybook/addon-essentials": "^7.0.20",
"@storybook/addon-interactions": "^7.0.20",
Expand Down
Loading