Skip to content

Commit 917eab0

Browse files
committed
Rename to maculate-java and add fork infrastructure
Rename the npm package from prettier-plugin-java to maculate-java. Add GitHub Actions workflows, mise configuration, justfile, npm publishing configuration, and local testing infrastructure.
1 parent 29fa518 commit 917eab0

19 files changed

Lines changed: 1234 additions & 12 deletions

β€Ž.github/README.mdβ€Ž

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# πŸ”§ GitHub Configuration
2+
3+
This directory contains GitHub-specific configuration for the Maculate Java project.
4+
5+
## πŸ“ Structure
6+
7+
```
8+
.github/
9+
β”œβ”€β”€ workflows/ # GitHub Actions workflows
10+
β”‚ β”œβ”€β”€ comprehensive-ci.yml # Comprehensive CI (multi-OS, coverage)
11+
β”‚ β”œβ”€β”€ release.yml # Production release workflow
12+
β”‚ β”œβ”€β”€ prerelease.yml # Automatic pre-releases
13+
β”‚ └── pr-validation.yml # Pull request validation
14+
β”œβ”€β”€ dependabot.yml # Automated dependency updates
15+
└── labeler.yml # Auto-labeling configuration
16+
```
17+
18+
## πŸš€ Workflows
19+
20+
### Comprehensive CI (comprehensive-ci.yml)
21+
- Runs on every push to main and on pull requests
22+
- Tests on multiple OS (Ubuntu, macOS, Windows) and Node versions (18, 20, 22)
23+
- Runs linting, formatting checks, and tests
24+
- Generates coverage reports
25+
26+
### Release (release.yml)
27+
- Manual trigger via GitHub Actions UI
28+
- Supports patch, minor, major, and pre-release versions
29+
- Automatically publishes to npm
30+
- Creates GitHub releases with release notes
31+
32+
### Pre-release (prerelease.yml)
33+
- Automatically triggered on pushes to develop/next/beta/alpha branches
34+
- Creates and publishes pre-release versions to npm
35+
- Uses branch-specific dist-tags (dev, next, beta, alpha)
36+
37+
### PR Validation (pr-validation.yml)
38+
- Validates PR title follows conventional commits format
39+
- Auto-labels PRs based on changed files
40+
41+
## πŸ”‘ Required Secrets
42+
43+
Configure these in Settings β†’ Secrets β†’ Actions:
44+
45+
- `NPM_TOKEN`: npm authentication token for publishing packages
46+
- `CODECOV_TOKEN`: (Optional) For uploading coverage reports
47+
48+
## 🏷️ Labels
49+
50+
The labeler automatically adds labels based on:
51+
- **File paths**: maculate-java, website, documentation, tests, ci, dependencies
52+
- **Branch names**: feature, bugfix, breaking-change
53+
54+
## πŸ“¦ Dependabot
55+
56+
Configured to:
57+
- Check for updates weekly (Mondays)
58+
- Group related dependencies (prettier, testing, linting, types)
59+
- Use semantic commit prefixes (⬆️ deps, ⬆️ deps-dev)
60+
- Auto-label PRs with "dependencies"

β€Ž.github/dependabot.ymlβ€Ž

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,42 @@
11
version: 2
22
updates:
3-
- package-ecosystem: 'npm'
4-
directory: '/'
3+
# πŸ“¦ Keep npm dependencies up to date
4+
- package-ecosystem: "npm"
5+
directory: "/"
56
schedule:
6-
interval: weekly
7+
interval: "weekly"
8+
day: "monday"
79
open-pull-requests-limit: 10
10+
groups:
11+
prettier:
12+
patterns:
13+
- "prettier*"
14+
testing:
15+
patterns:
16+
- "*chai*"
17+
- "*mocha*"
18+
- "*sinon*"
19+
linting:
20+
patterns:
21+
- "*eslint*"
22+
types:
23+
patterns:
24+
- "@types/*"
25+
commit-message:
26+
prefix: "⬆️ deps"
27+
prefix-development: "⬆️ deps-dev"
28+
labels:
29+
- "dependencies"
30+
- "javascript"
831

9-
- package-ecosystem: 'github-actions'
10-
directory: '/'
32+
# πŸ”§ Keep GitHub Actions up to date
33+
- package-ecosystem: "github-actions"
34+
directory: "/"
1135
schedule:
12-
interval: 'weekly'
13-
open-pull-requests-limit: 5
36+
interval: "weekly"
37+
day: "monday"
38+
commit-message:
39+
prefix: "⬆️ ci"
40+
labels:
41+
- "ci"
42+
- "github-actions"

β€Ž.github/labeler.ymlβ€Ž

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# 🏷️ Auto-labeling configuration for pull requests
2+
3+
maculate-java:
4+
- changed-files:
5+
- any-glob-to-any-file:
6+
- src/**
7+
- src/*
8+
9+
website:
10+
- changed-files:
11+
- any-glob-to-any-file:
12+
- website/**
13+
- website/*
14+
15+
documentation:
16+
- changed-files:
17+
- any-glob-to-any-file:
18+
- '**/*.md'
19+
- docs/**
20+
21+
tests:
22+
- changed-files:
23+
- any-glob-to-any-file:
24+
- '**/test/**'
25+
- '**/*.test.ts'
26+
- '**/*.spec.ts'
27+
- '**/*-spec.ts'
28+
29+
ci:
30+
- changed-files:
31+
- any-glob-to-any-file:
32+
- .github/**
33+
- .github/workflows/**
34+
35+
dependencies:
36+
- changed-files:
37+
- any-glob-to-any-file:
38+
- '**/package.json'
39+
- '**/yarn.lock'
40+
- .npmrc
41+
42+
breaking-change:
43+
- head-branch:
44+
- '^breaking\/.+$'
45+
- '^major\/.+$'
46+
47+
feature:
48+
- head-branch:
49+
- '^feat\/.+$'
50+
- '^feature\/.+$'
51+
52+
bugfix:
53+
- head-branch:
54+
- '^fix\/.+$'
55+
- '^bug\/.+$'
56+
- '^hotfix\/.+$'

β€Ž.github/workflows/README.mdβ€Ž

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# GitHub Actions Workflows
2+
3+
This directory contains automated workflows for the Maculate Java project.
4+
5+
## Workflows
6+
7+
### πŸ”„ sync-upstream.yml
8+
9+
Automatically syncs changes from the upstream prettier-java repository.
10+
11+
- **Schedule**: Runs every Monday at 9 AM UTC
12+
- **Manual trigger**: Can be triggered manually with custom branch selection
13+
- **Features**:
14+
- Fetches latest changes from upstream
15+
- Creates a new branch with merged changes
16+
- Opens a Pull Request automatically
17+
- Detects and reports merge conflicts
18+
- Creates issues for conflicts requiring manual resolution
19+
20+
### πŸ“Š monitor-upstream.yml
21+
22+
Monitors the upstream repository for activity and new releases.
23+
24+
- **Schedule**: Runs daily at 8 AM UTC
25+
- **Manual trigger**: Can be triggered manually
26+
- **Features**:
27+
- Checks for new releases and creates tracking issues
28+
- Monitors commit activity over the last 7 days
29+
- Creates weekly summary reports for high-activity periods
30+
- Helps maintain awareness of upstream development
31+
32+
## Configuration
33+
34+
Both workflows use the default `GITHUB_TOKEN` and require the following repository permissions:
35+
- `contents: write` - For creating branches and pushing changes
36+
- `pull-requests: write` - For creating pull requests
37+
- `issues: write` - For creating issues and summaries
38+
39+
## Usage
40+
41+
### Manual Sync
42+
43+
To manually trigger a sync:
44+
1. Go to Actions tab
45+
2. Select "Sync with Upstream"
46+
3. Click "Run workflow"
47+
4. Optionally specify a different branch to sync from
48+
5. Click "Run workflow"
49+
50+
### Handling Conflicts
51+
52+
When conflicts are detected:
53+
1. A PR will be created with partial changes
54+
2. An issue will be created highlighting the conflicts
55+
3. Check out the branch locally to resolve conflicts
56+
4. Push resolved changes back to the PR
57+
5. Merge when ready
58+
59+
## Upstream Repository
60+
61+
These workflows sync with: https://github.com/jhipster/prettier-java
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: πŸ§ͺ CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
paths-ignore:
7+
- '**.md'
8+
- 'docs/**'
9+
- 'website/**'
10+
- 'logo/**'
11+
pull_request:
12+
branches: [main, master]
13+
paths-ignore:
14+
- '**.md'
15+
- 'docs/**'
16+
- 'website/**'
17+
- 'logo/**'
18+
19+
jobs:
20+
test:
21+
name: πŸ§ͺ Test
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
matrix:
25+
os: [ubuntu-latest, macos-latest, windows-latest]
26+
node-version: [18, 20, 22]
27+
steps:
28+
- name: πŸ“₯ Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: πŸ“¦ Setup Node.js ${{ matrix.node-version }}
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
cache: 'yarn'
36+
37+
- name: πŸ“š Install dependencies
38+
run: yarn install --frozen-lockfile
39+
40+
- name: πŸ—οΈ Build packages
41+
run: yarn build
42+
43+
- name: πŸ§ͺ Run unit tests
44+
run: yarn test
45+
46+
- name: πŸ” Run linting
47+
run: yarn lint
48+
49+
- name: πŸ“‹ Check formatting
50+
run: yarn format:validate
51+
52+
coverage:
53+
name: πŸ“Š Coverage
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: πŸ“₯ Checkout code
57+
uses: actions/checkout@v4
58+
59+
- name: πŸ“¦ Setup Node.js
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version-file: '.mise.toml'
63+
cache: 'yarn'
64+
65+
- name: β˜• Setup Java
66+
uses: actions/setup-java@v4
67+
with:
68+
distribution: 'temurin'
69+
java-version: '17'
70+
71+
- name: πŸ“š Install dependencies
72+
run: yarn install --frozen-lockfile
73+
74+
- name: πŸ—οΈ Build packages
75+
run: yarn build
76+
77+
- name: πŸ§ͺ Run all tests with coverage
78+
run: yarn ci:all
79+
continue-on-error: true
80+
81+
- name: πŸ“ˆ Upload coverage reports
82+
uses: codecov/codecov-action@v4
83+
if: always()
84+
with:
85+
token: ${{ secrets.CODECOV_TOKEN }}
86+
fail_ci_if_error: false

0 commit comments

Comments
Β (0)