Skip to content
Merged
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
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Build All Packages"

on:
pull_request:
push:
branches:
- "dev"
- "main"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3

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

- name: Install Dependencies
run: pnpm install
Comment on lines +26 to +30

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Use pnpm/action-setup and enable dependency caching.

Installing pnpm via npm doesn't pin the version and misses out on built-in caching. The official pnpm/action-setup action provides version pinning from package.json and integrates with GitHub Actions cache.

Apply this diff:

-      - name: Install pnpm
-        run: npm install -g pnpm
+      - name: Install pnpm
+        uses: pnpm/action-setup@v4
+        with:
+          run_install: false
 
       - name: Install Dependencies
         run: pnpm install

Additionally, add caching for dependencies between the Node.js setup and pnpm install:

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 22.x
          cache: 'pnpm'

This will significantly reduce CI execution time on subsequent runs.

🤖 Prompt for AI Agents
.github/workflows/build.yml around lines 26 to 30: the workflow installs pnpm
globally via npm and runs pnpm install which neither pins pnpm version nor uses
Actions' dependency caching; replace the two steps with the official
pnpm/action-setup action (configured to read the pnpm version from package.json
or a pinned version) and ensure caching by using actions/setup-node@v4 with
with: node-version: 22.x and cache: 'pnpm' before running pnpm install so
dependencies are cached between runs.


- name: Clean and rebuild native modules
run: |
# Remove any pre-built binaries that might be incompatible
find node_modules -name "*.node" -delete 2>/dev/null || true
# Rebuild all native modules
pnpm rebuild

- name: Build All Packages
run: pnpm build

25 changes: 14 additions & 11 deletions platforms/blabsy/src/components/user/user-follow-stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,20 @@ export function UserFollowStats({
{[
['Following', currentFollowing],
['Follower', currentFollowers]
].map(([title, stats], index) => (
<div
key={title}
className='mt-0.5 mb-[3px] flex h-4 items-center gap-1 pointer-events-none'
>
<p className='font-bold text-light-primary dark:text-dark-primary'>
{stats}
</p>
<p>{index === 1 && stats > 1 ? `${title}s` : title}</p>
</div>
))}
].map(([title, stats], index) => {
const statsValue = typeof stats === 'number' ? stats : 0;
return (
<div
key={title}
className='mt-0.5 mb-[3px] flex h-4 items-center gap-1 pointer-events-none'
>
<p className='font-bold text-light-primary dark:text-dark-primary'>
{stats}
</p>
<p>{index === 1 && statsValue > 1 ? `${title}s` : title}</p>
</div>
);
})}
</div>
);
}
Expand Down
Loading