Skip to content

Commit 2564cd4

Browse files
committed
Merge remote-tracking branch 'v3/dev' into dev
2 parents f0c77cf + 9a5f5da commit 2564cd4

File tree

856 files changed

+165239
-13452
lines changed

Some content is hidden

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

856 files changed

+165239
-13452
lines changed

.coderabbit.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
language: 'en-US'
3+
early_access: false
4+
reviews:
5+
auto_review:
6+
enabled: true
7+
base_branches: ['dev', 'main']
8+
sequence_diagrams: false
9+
chat:
10+
auto_reply: true

.devcontainer/devcontainer.json

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
13
{
2-
"name": "zenstack",
3-
"dockerComposeFile": [
4-
"./docker-compose.yml"
5-
],
6-
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",
7-
"workspaceFolder": "/workspace",
8-
"service": "workspace",
9-
"shutdownAction": "stopCompose",
10-
"postCreateCommand": "npm i -g pnpm@9.15.9 && pnpm install && pnpm build && pnpm test-scaffold",
11-
"remoteUser": "node",
12-
"customizations": {
13-
"vscode": {
14-
"extensions": [
15-
"langium.langium-vscode",
16-
"firsttris.vscode-jest-runner"
17-
]
18-
}
19-
}
20-
}
4+
"name": "Node.js & TypeScript",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
7+
"features": {
8+
"ghcr.io/devcontainers/features/git-lfs:1": {
9+
"autoPull": true,
10+
"version": "latest"
11+
},
12+
"ghcr.io/itsmechlark/features/postgresql:1": {
13+
"version": "latest"
14+
}
15+
},
16+
17+
// Use 'postCreateCommand' to run commands after the container is created.
18+
"postCreateCommand": "pnpm install"
19+
}

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for more information:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
# https://containers.dev/guide/dependabot
6+
7+
version: 2
8+
updates:
9+
- package-ecosystem: "devcontainers"
10+
directory: "/"
11+
schedule:
12+
interval: weekly
13+
14+
- package-ecosystem: "npm"
15+
directory: "/"
16+
schedule:
17+
interval: weekly
18+
19+
target-branch: dev
20+

.github/workflows/build-test.yml

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3-
4-
name: CI
5-
6-
env:
7-
TELEMETRY_TRACKING_TOKEN: ${{ secrets.TELEMETRY_TRACKING_TOKEN }}
8-
DO_NOT_TRACK: '1'
1+
name: Build and Test
92

103
on:
114
pull_request:
125
branches:
136
- main
147
- dev
15-
- release/*
8+
9+
env:
10+
TELEMETRY_TRACKING_TOKEN: ${{ secrets.TELEMETRY_TRACKING_TOKEN }}
11+
DO_NOT_TRACK: '1'
1612

1713
permissions:
1814
contents: read
@@ -25,7 +21,7 @@ jobs:
2521
postgres:
2622
image: postgres
2723
env:
28-
POSTGRES_PASSWORD: abc123
24+
POSTGRES_PASSWORD: postgres
2925
# Set health checks to wait until postgres has started
3026
options: >-
3127
--health-cmd pg_isready
@@ -35,25 +31,44 @@ jobs:
3531
ports:
3632
- 5432:5432
3733

34+
mysql:
35+
image: mysql:8.4
36+
env:
37+
MYSQL_ROOT_PASSWORD: mysql
38+
ports:
39+
- 3306:3306
40+
# Set health checks to wait until mysql has started
41+
options: >-
42+
--health-cmd="mysqladmin ping --silent"
43+
--health-interval=10s
44+
--health-timeout=5s
45+
--health-retries=3
46+
3847
strategy:
3948
matrix:
40-
node-version: [20.x]
49+
node-version: [22.x]
50+
provider: [sqlite, postgresql, mysql]
4151

4252
steps:
4353
- name: Checkout
44-
uses: actions/checkout@v3
54+
uses: actions/checkout@v4
4555

4656
- name: Install pnpm
4757
uses: pnpm/action-setup@v2
4858
with:
49-
version: 9.15.9
59+
version: 10.12.1
5060

5161
- name: Use Node.js ${{ matrix.node-version }}
5262
uses: buildjet/setup-node@v3
5363
with:
5464
node-version: ${{ matrix.node-version }}
5565
cache: 'pnpm'
5666

67+
- name: Use Bun
68+
uses: oven-sh/setup-bun@v2
69+
with:
70+
bun-version: latest
71+
5772
- name: Get pnpm store directory
5873
id: pnpm-cache
5974
shell: bash
@@ -71,29 +86,17 @@ jobs:
7186
- name: Install dependencies
7287
run: pnpm install --frozen-lockfile
7388

74-
- name: Gradle Wrapper Validation
75-
uses: gradle/wrapper-validation-action@v1.1.0
76-
77-
- name: Setup Java
78-
uses: actions/setup-java@v4
79-
with:
80-
distribution: zulu
81-
java-version: 17
82-
83-
- name: Setup Gradle
84-
uses: gradle/gradle-build-action@v2.4.2
85-
with:
86-
gradle-home-cache-cleanup: true
87-
8889
- name: Build
89-
run: DEFAULT_NPM_TAG=latest pnpm run build-ci
90+
run: |
91+
pnpm run build
92+
pnpm tsx packages/cli/scripts/post-build.ts
9093
9194
- name: Lint
92-
run: pnpm lint
95+
run: pnpm run lint
9396

94-
# install again for internal dependencies
95-
- name: Install internal dependencies
96-
run: pnpm install --frozen-lockfile
97+
- name: Set MySQL max_connections
98+
run: |
99+
mysql -h 127.0.0.1 -uroot -pmysql -e "SET GLOBAL max_connections=500;"
97100
98101
- name: Test
99-
run: pnpm run test-scaffold && pnpm run test-ci
102+
run: TEST_DB_PROVIDER=${{ matrix.provider }} pnpm run test

.github/workflows/bump-version.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Bump Version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_type:
7+
description: 'Version type to bump'
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
jobs:
19+
bump-version:
20+
runs-on: ubuntu-latest
21+
if: github.ref == 'refs/heads/dev'
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
with:
27+
ref: dev
28+
29+
- name: Install pnpm
30+
uses: pnpm/action-setup@v2
31+
with:
32+
version: 10.12.1
33+
34+
- name: Use Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: 22.x
38+
cache: 'pnpm'
39+
40+
- name: Install dependencies
41+
run: pnpm install --frozen-lockfile
42+
43+
- name: Bump version
44+
id: bump
45+
run: npx tsx scripts/bump-version.ts ${{ inputs.version_type }}
46+
47+
- name: Create PR
48+
uses: peter-evans/create-pull-request@v7
49+
with:
50+
commit-message: 'chore: bump version ${{ steps.bump.outputs.new_version }}'
51+
title: '[CI] Bump version ${{ steps.bump.outputs.new_version }}'
52+
body: Automated changes for bumping version
53+
branch: chore/ci-bump-version
54+
branch-suffix: timestamp
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Claude Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
# Optional: Only run on specific file changes
7+
# paths:
8+
# - "src/**/*.ts"
9+
# - "src/**/*.tsx"
10+
# - "src/**/*.js"
11+
# - "src/**/*.jsx"
12+
13+
jobs:
14+
claude-review:
15+
# Optional: Filter by PR author
16+
# if: |
17+
# github.event.pull_request.user.login == 'external-contributor' ||
18+
# github.event.pull_request.user.login == 'new-developer' ||
19+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20+
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
pull-requests: write
25+
issues: read
26+
id-token: write
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Run Claude Code Review
35+
id: claude-review
36+
uses: anthropics/claude-code-action@beta
37+
with:
38+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
40+
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
41+
# model: "claude-opus-4-20250514"
42+
43+
# Direct prompt for automated review (no @claude mention needed)
44+
direct_prompt: |
45+
Please review this pull request and provide feedback on:
46+
- Code quality and best practices
47+
- Potential bugs or issues
48+
- Performance considerations
49+
- Security concerns
50+
- Test coverage
51+
52+
Be constructive and helpful in your feedback.
53+
54+
# Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
55+
# use_sticky_comment: true
56+
57+
# Optional: Customize review based on file types
58+
# direct_prompt: |
59+
# Review this PR focusing on:
60+
# - For TypeScript files: Type safety and proper interface usage
61+
# - For API endpoints: Security, input validation, and error handling
62+
# - For React components: Performance, accessibility, and best practices
63+
# - For tests: Coverage, edge cases, and test quality
64+
65+
# Optional: Different prompts for different authors
66+
# direct_prompt: |
67+
# ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
68+
# 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
69+
# 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
70+
71+
# Optional: Add specific tools for running tests or linting
72+
# allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
73+
74+
# Optional: Skip review for certain conditions
75+
# if: |
76+
# !contains(github.event.pull_request.title, '[skip-review]') &&
77+
# !contains(github.event.pull_request.title, '[WIP]')

.github/workflows/claude.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
pull-requests: write
24+
issues: read
25+
id-token: write
26+
actions: read # Required for Claude to read CI results on PRs
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Run Claude Code
34+
id: claude
35+
uses: anthropics/claude-code-action@beta
36+
with:
37+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38+
39+
# This is an optional setting that allows Claude to read CI results on PRs
40+
additional_permissions: |
41+
actions: read
42+
43+
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
44+
# model: "claude-opus-4-20250514"
45+
46+
# Optional: Customize the trigger phrase (default: @claude)
47+
# trigger_phrase: "/claude"
48+
49+
# Optional: Trigger when specific user is assigned to an issue
50+
# assignee_trigger: "claude-bot"
51+
52+
# Optional: Allow Claude to run specific commands
53+
# allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
54+
55+
# Optional: Add custom instructions for Claude to customize its behavior for your project
56+
# custom_instructions: |
57+
# Follow our coding standards
58+
# Ensure all new code has tests
59+
# Use TypeScript for new files
60+
61+
# Optional: Custom environment variables for Claude
62+
# claude_env: |
63+
# NODE_ENV: test

0 commit comments

Comments
 (0)