-
Notifications
You must be signed in to change notification settings - Fork 0
Chore/clean git history #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8473a9d
bfd7334
71e8d4e
793a58b
c116dc7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,72 +1,64 @@ | ||
| name: CI | ||
| name: 🧪 Continuous Integration | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - master | ||
| branches-ignore: [master] | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - master | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| linting: | ||
| name: Biome linting and formatting | ||
| test: | ||
| name: 🧪 Test Suite | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| - name: 📥 Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Cache bun | ||
| uses: actions/cache@v3 | ||
| id: bun-cache | ||
| - name: 🟢 Setup Bun | ||
| uses: oven-sh/setup-bun@v1 | ||
| with: | ||
| path: ~/.bun/bin | ||
| key: bun-v1.2.16 | ||
|
|
||
| - name: Install Bun v1.2.16 | ||
| if: steps.bun-cache.outputs.cache-hit != 'true' | ||
| run: | | ||
| curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.16" | ||
|
|
||
| - name: Add bun to PATH | ||
| run: echo "$HOME/.bun/bin" >> $GITHUB_PATH | ||
| bun-version: latest | ||
|
|
||
| - name: Install dependencies | ||
| - name: 📦 Install dependencies | ||
| run: bun install | ||
|
|
||
| - name: Run Biome checks | ||
| run: bunx biome check | ||
| - name: 🧪 Run tests | ||
| run: bun test | ||
|
|
||
| bun-tests: | ||
| name: Bun test suite | ||
| runs-on: ubuntu-latest | ||
| - name: 🔍 Lint and format check | ||
| run: bun run check | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| - name: 🏗️ Test build | ||
| run: bun run build | ||
|
|
||
| - name: Cache bun | ||
| uses: actions/cache@v3 | ||
| id: bun-cache | ||
| with: | ||
| path: ~/.bun/bin | ||
| key: bun-v1.2.16 | ||
|
|
||
| - name: Install Bun v1.2.16 | ||
| if: steps.bun-cache.outputs.cache-hit != 'true' | ||
| - name: 📏 Check bundle size | ||
| run: | | ||
| curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.16" | ||
| - name: Add bun to PATH | ||
| run: echo "$HOME/.bun/bin" >> $GITHUB_PATH | ||
| BUNDLE_SIZE=$(du -sh dist/ | cut -f1) | ||
| echo "📦 Bundle size: $BUNDLE_SIZE" | ||
| echo "bundle-size=$BUNDLE_SIZE" >> $GITHUB_OUTPUT | ||
|
|
||
| compatibility: | ||
| name: 🌐 Compatibility Test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 📥 Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Verify Bun | ||
| run: bun --version | ||
| - name: 🟢 Setup Bun | ||
| uses: oven-sh/setup-bun@v1 | ||
|
|
||
| - name: Install dependencies | ||
| - name: 📦 Install dependencies | ||
| run: bun install | ||
|
|
||
| - name: Run tests | ||
| run: bun test | ||
| - name: 🏗️ Build package | ||
| run: bun run build | ||
|
|
||
| - name: 🧪 Test package installation | ||
| run: | | ||
| # Test local package installation | ||
| npm pack | ||
| PACKAGE=$(ls *.tgz) | ||
| mkdir test-install && cd test-install | ||
| npm init -y | ||
| npm install ../$PACKAGE | ||
| echo "✅ Package installation test passed" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| name: 🚀 Publish to NPM | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| test: | ||
| name: 🧪 Test & Quality Check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 📥 Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: 🟢 Setup Bun | ||
| uses: oven-sh/setup-bun@v1 | ||
| with: | ||
| bun-version: latest | ||
|
|
||
| - name: 📦 Install dependencies | ||
| run: bun install | ||
|
|
||
| - name: 🧪 Run tests | ||
| run: bun test | ||
|
|
||
| - name: 🔍 Run linting and formatting checks | ||
| run: bun run check | ||
|
|
||
| - name: 🏗️ Test build | ||
| run: bun run build | ||
|
|
||
| - name: 📊 Upload coverage reports | ||
| if: success() | ||
| run: echo "✅ All quality checks passed" | ||
|
|
||
| publish: | ||
| name: 📦 Publish to NPM | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| if: github.ref == 'refs/heads/master' && github.event_name == 'push' | ||
| steps: | ||
| - name: 📥 Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: 🟢 Setup Bun | ||
| uses: oven-sh/setup-bun@v1 | ||
| with: | ||
| bun-version: latest | ||
|
|
||
| - name: 📦 Install dependencies | ||
| run: bun install | ||
|
|
||
| - name: 🏗️ Build package | ||
| run: bun run build | ||
|
|
||
| - name: 🔖 Determine version bump | ||
| id: version | ||
| run: | | ||
| # Get the last commit message | ||
| COMMIT_MSG=$(git log -1 --pretty=%B) | ||
| echo "Commit message: $COMMIT_MSG" | ||
|
|
||
| # Determine version bump based on conventional commits | ||
| if echo "$COMMIT_MSG" | grep -q "BREAKING CHANGE\|!:"; then | ||
| echo "bump=major" >> $GITHUB_OUTPUT | ||
| echo "🔥 Major version bump detected" | ||
| elif echo "$COMMIT_MSG" | grep -q "^feat"; then | ||
| echo "bump=minor" >> $GITHUB_OUTPUT | ||
| echo "✨ Minor version bump detected" | ||
| elif echo "$COMMIT_MSG" | grep -q "^fix\|^perf\|^refactor"; then | ||
| echo "bump=patch" >> $GITHUB_OUTPUT | ||
| echo "🐛 Patch version bump detected" | ||
| else | ||
| echo "bump=patch" >> $GITHUB_OUTPUT | ||
| echo "📝 Default patch version bump" | ||
| fi | ||
|
|
||
| - name: 🔖 Bump version | ||
| run: | | ||
| npm version ${{ steps.version.outputs.bump }} --no-git-tag-version | ||
| NEW_VERSION=$(node -p "require('./package.json').version") | ||
| echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV | ||
| echo "📈 Version bumped to $NEW_VERSION" | ||
|
|
||
| - name: 🏷️ Create Git tag | ||
| run: | | ||
| git config --local user.email "action@github.com" | ||
| git config --local user.name "GitHub Action" | ||
| git add package.json | ||
| git commit -m "🔖 chore: bump version to $NEW_VERSION [skip ci]" | ||
| git tag "v$NEW_VERSION" | ||
| git push origin master --tags | ||
|
|
||
| - name: 📦 Publish to NPM | ||
| run: | | ||
| echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | ||
| npm publish --access public | ||
| env: | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
|
||
| - name: 📝 Create GitHub Release | ||
| uses: actions/create-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag_name: v${{ env.NEW_VERSION }} | ||
| release_name: Release v${{ env.NEW_VERSION }} | ||
| body: | | ||
| ## 🎉 What's Changed | ||
|
|
||
| This release was automatically generated from the latest changes in master. | ||
|
|
||
| ### 📦 Installation | ||
| ```bash | ||
| npm install mini-react@${{ env.NEW_VERSION }} | ||
| ``` | ||
|
|
||
| ### 🔗 NPM Package | ||
| https://www.npmjs.com/package/mini-react/v/${{ env.NEW_VERSION }} | ||
| draft: false | ||
| prerelease: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Source files (we publish compiled dist/) | ||
| src/ | ||
| index.ts | ||
|
|
||
| # Build configuration | ||
| tsconfig.json | ||
| tsconfig.build.json | ||
| biome.json | ||
| bunfig.toml | ||
|
|
||
| # Tests and examples | ||
| tests/ | ||
| example/ | ||
| *.test.ts | ||
| *.test.tsx | ||
| *.test.js | ||
| *.test.jsx | ||
|
|
||
| # Development files | ||
| .gitignore | ||
| .cursor | ||
| .vscode/ | ||
| .idea/ | ||
|
|
||
| # Logs and caches | ||
| *.log | ||
| .cache | ||
| .DS_Store | ||
| coverage/ | ||
| .nyc_output/ | ||
|
|
||
| # Lock files and package managers | ||
| bun.lock | ||
| yarn.lock | ||
| package-lock.json | ||
| .pnpm-debug.log* | ||
|
|
||
| # Build artifacts not needed | ||
| *.tsbuildinfo | ||
| .rpt2_cache/ | ||
| .rts2_cache_cjs/ | ||
| .rts2_cache_es/ | ||
| .rts2_cache_umd/ | ||
|
|
||
| # Environment files | ||
| .env* |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||||||||||||
| { | ||||||||||||||||
| "extends": "./tsconfig.json", | ||||||||||||||||
| "compilerOptions": { | ||||||||||||||||
| "outDir": "./dist", | ||||||||||||||||
| "rootDir": "./", | ||||||||||||||||
| "declaration": true, | ||||||||||||||||
|
Comment on lines
+4
to
+6
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion rootDir set to “./” is a little too YOLO - "rootDir": "./",
+ "rootDir": "./src",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| "declarationMap": true, | ||||||||||||||||
| "sourceMap": true, | ||||||||||||||||
| "noEmit": false, | ||||||||||||||||
| "emitDeclarationOnly": false, | ||||||||||||||||
| "skipLibCheck": true, | ||||||||||||||||
| "moduleResolution": "node", | ||||||||||||||||
| "allowImportingTsExtensions": false, | ||||||||||||||||
| "verbatimModuleSyntax": false | ||||||||||||||||
| }, | ||||||||||||||||
| "include": ["src/**/*", "index.ts"], | ||||||||||||||||
| "exclude": [ | ||||||||||||||||
| "tests/**/*", | ||||||||||||||||
| "example/**/*", | ||||||||||||||||
| "**/*.test.ts", | ||||||||||||||||
| "**/*.test.tsx", | ||||||||||||||||
| "dist/**/*", | ||||||||||||||||
| "node_modules/**/*" | ||||||||||||||||
| ] | ||||||||||||||||
| } | ||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Step writes an output nobody can read – missing
idtagYou’re echo-ing
bundle-sizeto$GITHUB_OUTPUT, but withoutid: bundle(or similar) the value can’t be referenced later. Either add anidor ditch the output entirely.📝 Committable suggestion
🤖 Prompt for AI Agents