Skip to content

Commit 7e6629f

Browse files
refactor: restructure monorepo to organize packages by language
- Move TypeScript packages to packages/ts/ (sdk, mcp, ai-sdk) - Update pnpm workspace to use packages/ts/* - Update GitHub Actions workflows for new paths - Update package.json repository directory fields - Add Python-specific entries to .gitignore This prepares the monorepo structure for adding Python SDK at packages/py/
1 parent d65c580 commit 7e6629f

Some content is hidden

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

47 files changed

+37
-13
lines changed

.github/workflows/ecr-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
id: build-push
3535
uses: docker/build-push-action@v6
3636
with:
37-
context: packages/mcp
38-
file: packages/mcp/Dockerfile
37+
context: packages/ts/mcp
38+
file: packages/ts/mcp/Dockerfile
3939
platforms: linux/amd64
4040
push: true
4141
tags: |

.github/workflows/publish-mcp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
# Remove 'v' prefix if it exists
3232
VERSION="${VERSION#v}"
3333
else
34-
VERSION=$(node -p "require('./packages/mcp/package.json').version")
34+
VERSION=$(node -p "require('./packages/ts/mcp/package.json').version")
3535
fi
3636
echo "VERSION=$VERSION" >> $GITHUB_ENV
3737
echo "Publishing version: $VERSION"

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ jobs:
6565
if: steps.check-mcp.outputs.mcp_published == 'true'
6666
run: |
6767
VERSION="${{ steps.check-mcp.outputs.mcp_version }}"
68-
sed -i "s/version: \"[0-9]*\.[0-9]*\.[0-9]*\"/version: \"$VERSION\"/" packages/mcp/src/index.ts
68+
sed -i "s/version: \"[0-9]*\.[0-9]*\.[0-9]*\"/version: \"$VERSION\"/" packages/ts/mcp/src/index.ts
6969
git config user.name "github-actions[bot]"
7070
git config user.email "github-actions[bot]@users.noreply.github.com"
71-
git add packages/mcp/src/index.ts
71+
git add packages/ts/mcp/src/index.ts
7272
git commit -m "chore: update MCP version in source to $VERSION" || true
7373
git push || true
7474

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,20 @@ prompt.txt
182182
reports
183183
reports-old
184184
src/test/questions*
185+
186+
# Python
187+
__pycache__/
188+
*.py[cod]
189+
*$py.class
190+
*.so
191+
.Python
192+
.venv/
193+
venv/
194+
ENV/
195+
.mypy_cache/
196+
.ruff_cache/
197+
.pytest_cache/
198+
*.egg-info/
199+
dist/
200+
build/
201+
uv.lock

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "1.0.0",
55
"description": "Context7 monorepo - Documentation tools and SDKs",
66
"workspaces": [
7-
"packages/*"
7+
"packages/ts/*"
88
],
99
"scripts": {
1010
"build": "pnpm -r run build",
@@ -18,7 +18,14 @@
1818
"format": "pnpm -r run format",
1919
"format:check": "pnpm -r run format:check",
2020
"release": "pnpm build && changeset publish",
21-
"release:snapshot": "changeset version --snapshot canary && pnpm build && changeset publish --tag canary --no-git-tag"
21+
"release:snapshot": "changeset version --snapshot canary && pnpm build && changeset publish --tag canary --no-git-tag",
22+
"py:install": "cd packages/py && uv sync --all-packages",
23+
"py:test": "cd packages/py && uv run pytest sdk/tests -v",
24+
"py:lint": "cd packages/py && uv run ruff check .",
25+
"py:format": "cd packages/py && uv run ruff format .",
26+
"py:typecheck": "cd packages/py && uv run mypy sdk/src/context7",
27+
"py:build": "cd packages/py/sdk && uv build",
28+
"py:clean": "rm -rf packages/py/.venv packages/py/uv.lock packages/py/sdk/dist"
2229
},
2330
"repository": {
2431
"type": "git",

0 commit comments

Comments
 (0)