Skip to content

Commit d1f51bd

Browse files
authored
Merge pull request #13 from objectstack-ai/copilot/switch-to-pnpm
2 parents e714107 + 50ee81b commit d1f51bd

File tree

10 files changed

+181
-88
lines changed

10 files changed

+181
-88
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
version: 2
22
updates:
3-
# Enable version updates for npm dependencies
3+
# Enable version updates for pnpm dependencies
4+
# Note: Dependabot uses "npm" ecosystem for pnpm projects
45
- package-ecosystem: "npm"
56
directory: "/"
67
schedule:
78
interval: "weekly"
89
day: "monday"
9-
open-pull-requests-limit: 5
10+
open-pull-requests-limit: 10
1011
reviewers:
1112
- "hotlong"
1213
assignees:
@@ -17,46 +18,6 @@ updates:
1718
labels:
1819
- "dependencies"
1920
- "automated"
20-
21-
# Core package dependencies
22-
- package-ecosystem: "npm"
23-
directory: "/packages/core"
24-
schedule:
25-
interval: "weekly"
26-
day: "monday"
27-
open-pull-requests-limit: 5
28-
reviewers:
29-
- "hotlong"
30-
assignees:
31-
- "hotlong"
32-
commit-message:
33-
prefix: "chore"
34-
prefix-development: "chore"
35-
include: "scope"
36-
labels:
37-
- "dependencies"
38-
- "core"
39-
- "automated"
40-
41-
# Examples package dependencies
42-
- package-ecosystem: "npm"
43-
directory: "/packages/examples"
44-
schedule:
45-
interval: "weekly"
46-
day: "monday"
47-
open-pull-requests-limit: 5
48-
reviewers:
49-
- "hotlong"
50-
assignees:
51-
- "hotlong"
52-
commit-message:
53-
prefix: "chore"
54-
prefix-development: "chore"
55-
include: "scope"
56-
labels:
57-
- "dependencies"
58-
- "examples"
59-
- "automated"
6021

6122
# GitHub Actions
6223
- package-ecosystem: "github-actions"

.github/workflows/ci.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,48 @@ jobs:
2525
uses: actions/setup-node@v4
2626
with:
2727
node-version: ${{ matrix.node-version }}
28-
cache: 'npm'
28+
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v4
31+
with:
32+
version: 9
33+
34+
- name: Get pnpm store directory
35+
shell: bash
36+
run: |
37+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
38+
39+
- name: Setup pnpm cache
40+
uses: actions/cache@v4
41+
with:
42+
path: ${{ env.STORE_PATH }}
43+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
44+
restore-keys: |
45+
${{ runner.os }}-pnpm-store-
2946
3047
- name: Install dependencies
31-
run: npm ci
48+
run: pnpm install --frozen-lockfile
3249

3350
- name: Type check
34-
run: npm run type-check
51+
run: pnpm run type-check
3552

3653
- name: Build all packages
37-
run: npm run build
54+
run: pnpm run build
3855

3956
- name: Run basic example
40-
run: npm run example:basic
57+
run: pnpm run example:basic
4158

4259
- name: Run e-commerce example
43-
run: npm run example:ecommerce
60+
run: pnpm run example:ecommerce
4461

4562
- name: Run blog example
46-
run: npm run example:blog
63+
run: pnpm run example:blog
4764

4865
- name: Run CRM example
49-
run: npm run example:crm
66+
run: pnpm run example:crm
5067

5168
- name: Run comprehensive CRM example
52-
run: npm run example:crm-comprehensive
69+
run: pnpm run example:crm-comprehensive
5370

5471
- name: Archive build artifacts
5572
if: matrix.node-version == '20.x'

.github/workflows/code-quality.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,35 @@ jobs:
1919
uses: actions/setup-node@v4
2020
with:
2121
node-version: '20.x'
22-
cache: 'npm'
22+
23+
- name: Setup pnpm
24+
uses: pnpm/action-setup@v4
25+
with:
26+
version: 9
27+
28+
- name: Get pnpm store directory
29+
shell: bash
30+
run: |
31+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
32+
33+
- name: Setup pnpm cache
34+
uses: actions/cache@v4
35+
with:
36+
path: ${{ env.STORE_PATH }}
37+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
38+
restore-keys: |
39+
${{ runner.os }}-pnpm-store-
2340
2441
- name: Install dependencies
25-
run: npm ci
42+
run: pnpm install --frozen-lockfile
2643

2744
- name: Type check all packages
28-
run: npm run type-check
45+
run: pnpm run type-check
2946

3047
- name: Check for TypeScript errors
3148
run: |
3249
echo "Checking for TypeScript compilation errors..."
33-
npm run build 2>&1 | tee build.log
50+
pnpm run build 2>&1 | tee build.log
3451
if grep -i "error TS" build.log; then
3552
echo "TypeScript errors found!"
3653
exit 1
@@ -49,6 +66,6 @@ jobs:
4966
- name: Verify examples can run
5067
run: |
5168
echo "Testing if examples can execute..."
52-
npm run build
53-
npm run example:basic
69+
pnpm run build
70+
pnpm run example:basic
5471
echo "Examples verified successfully."

.github/workflows/release.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,30 @@ jobs:
2323
uses: actions/setup-node@v4
2424
with:
2525
node-version: '20.x'
26-
cache: 'npm'
26+
27+
- name: Setup pnpm
28+
uses: pnpm/action-setup@v4
29+
with:
30+
version: 9
31+
32+
- name: Get pnpm store directory
33+
shell: bash
34+
run: |
35+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
36+
37+
- name: Setup pnpm cache
38+
uses: actions/cache@v4
39+
with:
40+
path: ${{ env.STORE_PATH }}
41+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
restore-keys: |
43+
${{ runner.os }}-pnpm-store-
2744
2845
- name: Install dependencies
29-
run: npm ci
46+
run: pnpm install --frozen-lockfile
3047

3148
- name: Build all packages
32-
run: npm run build
49+
run: pnpm run build
3350

3451
- name: Create Release
3552
uses: softprops/action-gh-release@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ yarn-debug.log*
55
yarn-error.log*
66
pnpm-debug.log*
77
package-lock.json
8+
yarn.lock
89

910
# Build outputs
1011
dist/

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ git clone https://github.com/objectstack-ai/objectstack-starter.git
1616
cd objectstack-starter
1717

1818
# Install dependencies (installs all workspace packages)
19-
npm install
19+
pnpm install
2020

2121
# Build all packages
22-
npm run build
22+
pnpm run build
2323
```
2424

2525
### Running Examples
@@ -28,36 +28,36 @@ This template includes multiple example applications demonstrating different use
2828

2929
```bash
3030
# Run the basic example (core objects)
31-
npm run example:basic
31+
pnpm run example:basic
3232

3333
# Run the e-commerce example
34-
npm run example:ecommerce
34+
pnpm run example:ecommerce
3535

3636
# Run the blog example
37-
npm run example:blog
37+
pnpm run example:blog
3838

3939
# Run the CRM example
40-
npm run example:crm
40+
pnpm run example:crm
4141

4242
# Run the comprehensive CRM example (All core modules)
43-
npm run example:crm-comprehensive
43+
pnpm run example:crm-comprehensive
4444
```
4545

4646
### Development
4747

4848
```bash
4949
# Watch mode - automatically rebuild all packages on changes
50-
npm run dev
50+
pnpm run dev
5151

5252
# Build specific package
53-
npm run build:core
54-
npm run build:examples
53+
pnpm run build:core
54+
pnpm run build:examples
5555

5656
# Type checking
57-
npm run type-check
57+
pnpm run type-check
5858

5959
# Clean build artifacts
60-
npm run clean
60+
pnpm run clean
6161
```
6262

6363
## 📦 What's Included
@@ -297,7 +297,7 @@ This repository includes comprehensive automation workflows:
297297

298298
## 🌟 Features
299299

300-
- ✅ Monorepo structure with npm workspaces
300+
- ✅ Monorepo structure with pnpm workspaces
301301
- ✅ Multiple packages: core and examples
302302
- ✅ TypeScript support with strict type checking
303303
- ✅ Based on the latest @objectstack/spec (v0.3.3)

package.json

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,18 @@
44
"description": "ObjectStack Starter Template - A metadata-driven low-code platform starter (Multi-package Monorepo)",
55
"type": "module",
66
"private": true,
7-
"workspaces": [
8-
"packages/*"
9-
],
107
"scripts": {
11-
"build": "npm run build --workspaces",
12-
"build:core": "npm run build -w @objectstack-starter/core",
13-
"build:examples": "npm run build -w @objectstack-starter/examples",
14-
"dev": "npm run dev --workspaces --if-present",
15-
"clean": "npm run clean --workspaces --if-present",
16-
"type-check": "npm run type-check --workspaces",
17-
"example:basic": "npm run example:basic -w @objectstack-starter/examples",
18-
"example:ecommerce": "npm run example:ecommerce -w @objectstack-starter/examples",
19-
"example:blog": "npm run example:blog -w @objectstack-starter/examples",
20-
"example:crm": "npm run example:crm -w @objectstack-starter/examples",
21-
"example:crm-comprehensive": "npm run example:crm-comprehensive -w @objectstack-starter/examples"
8+
"build": "pnpm -r run build",
9+
"build:core": "pnpm --filter @objectstack-starter/core run build",
10+
"build:examples": "pnpm --filter @objectstack-starter/examples run build",
11+
"dev": "pnpm -r run dev",
12+
"clean": "pnpm -r run clean",
13+
"type-check": "pnpm -r run type-check",
14+
"example:basic": "pnpm --filter @objectstack-starter/examples run example:basic",
15+
"example:ecommerce": "pnpm --filter @objectstack-starter/examples run example:ecommerce",
16+
"example:blog": "pnpm --filter @objectstack-starter/examples run example:blog",
17+
"example:crm": "pnpm --filter @objectstack-starter/examples run example:crm",
18+
"example:crm-comprehensive": "pnpm --filter @objectstack-starter/examples run example:crm-comprehensive"
2219
},
2320
"devDependencies": {
2421
"@types/node": "^25.0.10",

packages/examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"dependencies": {
2020
"@objectstack/spec": "^0.3.3",
21-
"@objectstack-starter/core": "*"
21+
"@objectstack-starter/core": "workspace:*"
2222
},
2323
"devDependencies": {
2424
"@types/node": "^25.0.10",

0 commit comments

Comments
 (0)