Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bright-dingos-wish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-component-mocker": patch
---

replace npm with bun
13 changes: 6 additions & 7 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: 'Setup Node.js and dependencies'
description: 'Common setup steps for Node.js projects'
name: 'Setup Bun and dependencies'
description: 'Common setup steps for Bun projects'

runs:
using: 'composite'
steps:
- name: Use Node.js
uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
bun-version: '1.2.17'

- name: Install dependencies
run: npm install
run: bun install
shell: bash
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Node.js and dependencies
- name: Setup Bun and dependencies
uses: ./.github/actions/setup

- name: Run all checks
run: npm run check:all
run: bun run check:all
10 changes: 5 additions & 5 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js and dependencies
- name: Setup Bun and dependencies
uses: ./.github/actions/setup

- name: Run all checks
run: npm run check:all
run: bun run check:all

- name: Check for changesets
run: |
if [ ! -d ".changeset" ] || [ -z "$(find .changeset -name '*.md' -not -name 'README.md' -not -name 'config.json')" ]; then
echo "⚠️ No changesets found!"
echo "Run 'npm run release:prepare' and commit the changeset first"
echo "Run 'bun run release:prepare' and commit the changeset first"
echo "Then run this workflow again"
exit 1
fi
Expand All @@ -35,9 +35,9 @@ jobs:
id: version
run: |
# update package.json just to get a new version
npx changeset version
bunx changeset version

NEXT_VERSION=$(node -p "require('./package.json').version")
NEXT_VERSION=$(bun -e "console.log(require('./package.json').version)")

echo "next_version=$NEXT_VERSION" >> $GITHUB_OUTPUT
echo "📦 Next version: v$NEXT_VERSION"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ jobs:
- name: Setup .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Setup Node.js and dependencies
- name: Setup Bun and dependencies
uses: ./.github/actions/setup

- name: Run all checks
run: npm run check:all
run: bun run check:all

- name: Publish to NPM
uses: changesets/action@v1
with:
publish: npm run release:publish
publish: bun run release:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ Thanks for your interest in contributing to react-component-mocker!
```bash
git clone https://github.com/malininss/react-component-mocker.git
cd react-component-mocker
npm install
bun install
```

### Commands
```bash
npm run dev # Compile TypeScript to dist/ in watch mode
npm run build # Compile TypeScript to dist/
npm run test # Run tests
npm run check:all # Run all checks (build, format, exports, tests)
npm run check:format # Check code formatting with Biome
npm run fix:format # Fix formatting issues
bun run dev # Compile TypeScript to dist/ in watch mode
bun run build # Compile TypeScript to dist/
bun run test # Run tests
bun run check:all # Run all checks (build, format, exports, tests)
bun run check:biome # Check code with Biome
bun run fix:biome # Fix code issues
```

## Making Changes

1. Fork the repository
2. Create a feature branch: `git checkout -b feature/your-feature`
3. Make your changes in `src/`
4. Run `npm run release:prepare` to describe your changes
5. Run `npm run check:all` to ensure everything works
4. Run `bun run release:prepare` to describe your changes
5. Run `bun run check:all` to ensure everything works
6. Commit and push to your fork (including the changeset file)
7. Open a Pull Request

Expand Down
1,275 changes: 1,275 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

Loading