Skip to content

Commit cd8939e

Browse files
authored
Merge pull request #10 from reearth/chore/repo-maintenance-dec-25
chore: Repo Maintenance - Dec2025
2 parents a9549bd + 7f56d96 commit cd8939e

21 files changed

Lines changed: 4347 additions & 3112 deletions

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.yml

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

.github/RELEASE.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Release Process
2+
3+
This project uses GitHub Actions to automate the release process.
4+
5+
## Creating a New Release
6+
7+
### 1. Trigger the Release Workflow
8+
9+
1. Go to the **Actions** tab in GitHub
10+
2. Select the **Release** workflow from the left sidebar
11+
3. Click **Run workflow**
12+
4. Choose the version bump type:
13+
- **patch**: Bug fixes and minor updates (2.2.2 → 2.2.3)
14+
- **minor**: New features, backward compatible (2.2.2 → 2.3.0)
15+
- **major**: Breaking changes (2.2.2 → 3.0.0)
16+
5. Click **Run workflow**
17+
18+
### 2. Review the Release PR
19+
20+
The workflow will automatically:
21+
- Bump the version in `package.json`
22+
- Generate a changelog from git commits since the last release
23+
- Update `CHANGELOG.md` with the new version entry
24+
- Create a Pull Request with all changes
25+
26+
Review the PR carefully:
27+
- Check that the version bump is correct
28+
- Review the generated changelog
29+
- Verify all changes look good
30+
31+
### 3. Merge the Release PR
32+
33+
Once satisfied, merge the PR to the main branch.
34+
35+
### 4. Create a GitHub Release
36+
37+
After merging:
38+
1. Go to the **Releases** page
39+
2. Click **Draft a new release**
40+
3. Create a new tag matching the version (e.g., `v2.3.0`)
41+
4. Use the changelog from the merged PR as the release notes
42+
5. Publish the release
43+
44+
### 5. Publish to npm
45+
46+
After creating the GitHub release:
47+
48+
```bash
49+
# Ensure you're on the main branch with latest changes
50+
git checkout main
51+
git pull origin main
52+
53+
# Build the package
54+
yarn build
55+
56+
# Publish to npm (requires npm authentication)
57+
npm publish
58+
```
59+
60+
## Manual Release (Alternative)
61+
62+
If you prefer to do releases manually:
63+
64+
```bash
65+
# Bump version
66+
yarn version --patch # or --minor, --major
67+
68+
# Update CHANGELOG.md manually
69+
70+
# Commit changes
71+
git add package.json CHANGELOG.md
72+
git commit -m "chore: bump version to vX.Y.Z"
73+
74+
# Create tag
75+
git tag vX.Y.Z
76+
77+
# Push changes and tag
78+
git push origin main --tags
79+
80+
# Build and publish
81+
yarn build
82+
npm publish
83+
```
84+
85+
## Changelog Format
86+
87+
The automated workflow generates changelog entries from git commit messages. For best results, use conventional commit format:
88+
89+
- `feat:` - New features
90+
- `fix:` - Bug fixes
91+
- `chore:` - Maintenance tasks
92+
- `docs:` - Documentation changes
93+
- `refactor:` - Code refactoring
94+
- `test:` - Test updates
95+
96+
Example:
97+
```
98+
feat: add dark mode support
99+
fix: resolve memory leak in GridWrapper
100+
chore: update dependencies
101+
```

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
name: Test & Build
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [20.x, 22.x]
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'yarn'
27+
28+
- name: Install dependencies
29+
run: yarn install --frozen-lockfile
30+
31+
- name: Run linter
32+
run: yarn lint
33+
34+
- name: Run type check
35+
run: yarn type
36+
37+
- name: Run tests
38+
run: yarn test --run
39+
40+
- name: Build package
41+
run: yarn build
42+
43+
- name: Install example dependencies
44+
working-directory: ./example
45+
run: yarn install --frozen-lockfile
46+
47+
- name: Build example
48+
working-directory: ./example
49+
run: yarn build
50+
51+
- name: Check for security vulnerabilities
52+
run: yarn audit --level moderate
53+
continue-on-error: true

.github/workflows/release.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version bump type'
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
15+
jobs:
16+
create-release-pr:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
pull-requests: write
21+
# Ensure this workflow only runs from the main branch
22+
if: github.ref == 'refs/heads/main'
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
cache: 'yarn'
35+
36+
- name: Install dependencies
37+
run: yarn install --frozen-lockfile
38+
39+
- name: Configure git
40+
run: |
41+
git config user.name "github-actions[bot]"
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
44+
- name: Get current version
45+
id: current_version
46+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
47+
48+
- name: Bump version
49+
id: bump_version
50+
run: |
51+
yarn version --${{ github.event.inputs.version }} --no-git-tag-version
52+
NEW_VERSION=$(node -p "require('./package.json').version")
53+
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
54+
echo "Bumped version from ${{ steps.current_version.outputs.version }} to $NEW_VERSION"
55+
56+
- name: Generate changelog
57+
id: changelog
58+
run: |
59+
# Get the latest tag
60+
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
61+
62+
if [ -z "$LATEST_TAG" ]; then
63+
echo "No previous tag found, generating changelog from first commit"
64+
COMMIT_RANGE=$(git rev-list --max-parents=0 HEAD)..HEAD
65+
else
66+
echo "Latest tag: $LATEST_TAG"
67+
COMMIT_RANGE=$LATEST_TAG..HEAD
68+
fi
69+
70+
# Generate changelog
71+
CHANGELOG=$(git log $COMMIT_RANGE --pretty=format:"- %s (%h)" --no-merges)
72+
73+
# Save to file for PR body
74+
cat > /tmp/changelog.md <<EOF
75+
## Changes in v${{ steps.bump_version.outputs.new_version }}
76+
77+
$CHANGELOG
78+
EOF
79+
80+
# Output for use in PR
81+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
82+
cat /tmp/changelog.md >> $GITHUB_OUTPUT
83+
echo "EOF" >> $GITHUB_OUTPUT
84+
85+
- name: Update CHANGELOG.md
86+
run: |
87+
# Create or update CHANGELOG.md
88+
if [ ! -f CHANGELOG.md ]; then
89+
echo "# Changelog" > CHANGELOG.md
90+
echo "" >> CHANGELOG.md
91+
echo "All notable changes to this project will be documented in this file." >> CHANGELOG.md
92+
echo "" >> CHANGELOG.md
93+
fi
94+
95+
# Prepare new entry
96+
cat > /tmp/new_entry.md <<EOF
97+
## [v${{ steps.bump_version.outputs.new_version }}] - $(date +%Y-%m-%d)
98+
99+
EOF
100+
101+
cat /tmp/changelog.md | tail -n +3 >> /tmp/new_entry.md
102+
echo "" >> /tmp/new_entry.md
103+
104+
# Insert after the header
105+
sed -i '1,/^All notable/r /tmp/new_entry.md' CHANGELOG.md || {
106+
# If sed fails (no header found), just prepend
107+
cat /tmp/new_entry.md CHANGELOG.md > /tmp/new_changelog.md
108+
mv /tmp/new_changelog.md CHANGELOG.md
109+
}
110+
111+
- name: Create Pull Request
112+
uses: peter-evans/create-pull-request@v6
113+
with:
114+
token: ${{ secrets.GITHUB_TOKEN }}
115+
branch: release/v${{ steps.bump_version.outputs.new_version }}
116+
commit-message: "chore: bump version to v${{ steps.bump_version.outputs.new_version }}"
117+
title: "Release v${{ steps.bump_version.outputs.new_version }}"
118+
body: |
119+
## Release v${{ steps.bump_version.outputs.new_version }}
120+
121+
This PR bumps the version from **v${{ steps.current_version.outputs.version }}** to **v${{ steps.bump_version.outputs.new_version }}**.
122+
123+
${{ steps.changelog.outputs.changelog }}
124+
125+
---
126+
127+
### Release Checklist
128+
- [ ] Review changelog and version bump
129+
- [ ] Merge this PR to main
130+
- [ ] Create a GitHub release from main with tag `v${{ steps.bump_version.outputs.new_version }}`
131+
- [ ] Run `yarn build` locally
132+
- [ ] Run `npm publish` to publish to npm registry
133+
134+
---
135+
*This PR was automatically generated by the release workflow*
136+
labels: |
137+
release
138+
automated

eslint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import reearth from "eslint-config-reearth";
2+
3+
export default [
4+
...reearth("react-align", { reactRecommended: false }),
5+
{
6+
ignores: ["**/dist/", "**/node_modules/", "**/*.min.js"],
7+
},
8+
];

example/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# React Align Example
2+
3+
This example demonstrates the usage of react-align library.
4+
5+
## Important Notes
6+
7+
- This example uses **Vite 3.x** to demonstrate compatibility with older tooling
8+
- The example imports from the built library rather than source code
9+
- The main package is built with Vite 7, but the library itself is compatible with projects using older Vite versions
10+
11+
## Running the Example
12+
13+
```bash
14+
yarn install
15+
yarn dev
16+
```
17+
18+
## Known Issues
19+
20+
- `react-beautiful-dnd` is deprecated and may have compatibility warnings with React 18
21+
- The library continues to work but you may see console warnings about `defaultProps`

example/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"react-dom": "^18.2.0"
1515
},
1616
"devDependencies": {
17-
"@types/react": "^18.0.24",
18-
"@types/react-dom": "^18.0.8",
19-
"@vitejs/plugin-react": "^2.2.0",
17+
"@types/react": "^18.0.17",
18+
"@types/react-dom": "^18.0.6",
19+
"@vitejs/plugin-react": "^2.1.0",
2020
"typescript": "^4.8.4",
2121
"vite": "^3.2.1"
2222
}

example/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"useDefineForClassFields": true,
55
"lib": ["DOM", "DOM.Iterable", "ESNext"],
66
"allowJs": false,
7-
"skipLibCheck": false,
7+
"skipLibCheck": true,
88
"esModuleInterop": false,
99
"allowSyntheticDefaultImports": true,
1010
"strict": true,
@@ -16,5 +16,6 @@
1616
"noEmit": true,
1717
"jsx": "react-jsx"
1818
},
19-
"include": ["./src"]
19+
"include": ["./src"],
20+
"exclude": ["node_modules", "dist"]
2021
}

0 commit comments

Comments
 (0)