Skip to content

Commit 6281df4

Browse files
authored
refactor: restructure project for monorepo setup (#6)
* refactor: restructure project for monorepo setup and update ESLint configuration * rename project to cursor-api-monorepo * update ESLint configuration to include packages directory * remove package-lock.json and add pnpm workspace configuration * add initial setup for cursor-api and cursor-cli packages * update CI workflows to use pnpm for dependency management * chore: integrate Changesets for versioning and release management * add Changesets configuration and README for documentation * update release workflow to utilize Changesets for automated versioning * remove semantic-release references from package scripts in cursor-api and cursor-cli * chore: update changeset * chore: update token validator * chore: update readme * chore: update package manager and add protobuf dependency * set package manager to pnpm@10.12.2 in package.json * add @bufbuild/protobuf dependency in devDependencies * update CI workflows to use pnpm version 10 for consistency
1 parent bee1661 commit 6281df4

64 files changed

Lines changed: 8185 additions & 15131 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/brown-frogs-live.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'cursor-api': major
3+
'cursor-cli': major
4+
---
5+
6+
refactor: restructure project for monorepo setup and update ESLint configuration

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/ci.yml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main, develop ]
5+
branches: [ main, dev ]
66
pull_request:
77
branches: [ main ]
88

@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node-version: [18, 22, 24]
18+
node-version: [18, 20, 22]
1919

2020
steps:
2121
- uses: actions/checkout@v4
@@ -24,23 +24,27 @@ jobs:
2424
uses: actions/setup-node@v4
2525
with:
2626
node-version: ${{ matrix.node-version }}
27-
cache: 'npm'
27+
28+
- name: Install pnpm
29+
uses: pnpm/action-setup@v4
30+
with:
31+
version: 10
2832

2933
- name: Install dependencies
30-
run: npm ci
34+
run: pnpm install
3135

3236
- name: Run linting
33-
run: npm run lint
37+
run: pnpm run lint
3438

3539
- name: Run type checking
36-
run: npm run type-check
40+
run: pnpm run type-check
3741

3842
- name: Run tests
39-
run: npm run test:coverage
43+
run: pnpm run test:coverage
4044

4145
- name: Upload coverage to Codecov
4246
if: matrix.node-version == 22
43-
uses: codecov/codecov-action@v5
47+
uses: codecov/codecov-action@v4
4448
with:
4549
token: ${{ secrets.CODECOV_TOKEN }}
4650
slug: xwartz/cursor-api
@@ -56,26 +60,30 @@ jobs:
5660
uses: actions/setup-node@v4
5761
with:
5862
node-version: 22
59-
cache: 'npm'
63+
64+
- name: Install pnpm
65+
uses: pnpm/action-setup@v4
66+
with:
67+
version: 9.5.0
6068

6169
- name: Install dependencies
62-
run: npm ci
70+
run: pnpm install
6371

6472
- name: Build package
65-
run: npm run build
73+
run: pnpm run build
6674

6775
- name: Upload build artifacts
6876
uses: actions/upload-artifact@v4
6977
with:
7078
name: dist
71-
path: dist/
79+
path: packages/cursor-api/dist/
7280

7381
e2e-test:
7482
runs-on: ubuntu-latest
7583
needs: build
7684
strategy:
7785
matrix:
78-
node-version: [18, 22, 24]
86+
node-version: [18, 20, 22]
7987

8088
steps:
8189
- uses: actions/checkout@v4
@@ -84,16 +92,20 @@ jobs:
8492
uses: actions/setup-node@v4
8593
with:
8694
node-version: ${{ matrix.node-version }}
87-
cache: 'npm'
95+
96+
- name: Install pnpm
97+
uses: pnpm/action-setup@v4
98+
with:
99+
version: 9.5.0
88100

89101
- name: Download build artifacts
90102
uses: actions/download-artifact@v4
91103
with:
92104
name: dist
93-
path: dist/
105+
path: packages/cursor-api/dist/
94106

95107
- name: Install dependencies
96-
run: npm ci
108+
run: pnpm install
97109

98110
- name: Run E2E tests
99-
run: npm run test:e2e
111+
run: pnpm run test:e2e

.github/workflows/release.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,40 @@ env:
1010

1111
jobs:
1212
release:
13+
name: Release
1314
runs-on: ubuntu-latest
14-
if: ${{ !contains(github.event.head_commit.message, 'skip ci') }}
1515
permissions:
1616
contents: write
17-
issues: write
1817
pull-requests: write
1918
id-token: write
20-
2119
steps:
22-
- uses: actions/checkout@v4
23-
with:
24-
fetch-depth: 0
25-
token: ${{ secrets.GITHUB_TOKEN }}
26-
persist-credentials: true
27-
28-
- name: Use Node.js 22
29-
uses: actions/setup-node@v4
30-
with:
31-
node-version: 22
32-
cache: 'npm'
33-
registry-url: 'https://registry.npmjs.org'
34-
35-
- name: Install dependencies
36-
run: npm ci
37-
38-
- name: Run tests
39-
run: npm run test
40-
41-
- name: Build package
42-
run: npm run build
43-
44-
- name: Release
45-
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
48-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
49-
run: npm run release
20+
- name: Checkout Repo
21+
uses: actions/checkout@v4
22+
with:
23+
# This is important for semantic-release to be able to determine the last release
24+
fetch-depth: 0
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 22
30+
registry-url: 'https://registry.npmjs.org'
31+
32+
- name: Install pnpm
33+
uses: pnpm/action-setup@v4
34+
with:
35+
version: 10
36+
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile
39+
40+
- name: Create Release Pull Request or Publish to npm
41+
id: changesets
42+
uses: changesets/action@v1
43+
with:
44+
# This will run `pnpm run release` if a release should be published
45+
publish: pnpm run release
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
49+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dist/
1010
build/
1111
.next/
1212
out/
13+
bin/
1314

1415
# Environment variables
1516
.env

.releaserc.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)