Skip to content

Commit

Permalink
🚀 Migrate to Bun
Browse files Browse the repository at this point in the history
  • Loading branch information
siguici committed Oct 6, 2023
1 parent 2f550e5 commit 7e853f0
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 2,602 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
matrix:
operating-system: [ubuntu-latest]
php-version: [8.1, 8.2]
node-version: [18.0, 20.0]
bun-version: [1.0.4]
dependency-version: [prefer-lowest, prefer-stable]
name: 👷 CI PHP-${{ matrix.php-version }} ${{ matrix.dependency-version }} with Node-${{ matrix.node-version }} on ${{ matrix.operating-system }}
name: 👷 CI PHP-${{ matrix.php-version }} ${{ matrix.dependency-version }} with Bun-${{ matrix.bun-version }} on ${{ matrix.operating-system }}

steps:
- name: Checkout
Expand Down Expand Up @@ -80,23 +80,22 @@ jobs:
- name: Optimize Stuffs
run: set -e && php artisan optimize:clear --env=ci

- name: Setup Node.js
uses: actions/setup-node@v3
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
node-version: ${{ matrix.node-version }}
bun-version: ${{ matrix.bun-version }}

- name: Install JavaScript dependencies
run: |
corepack enable
pnpm install
pnpm e2e.install
bun install
bun run e2e.install
- name: 🍱 Compile assets
run: pnpm build
run: bun run build

- name: 🧹 Check code lint
run: |
pnpm check
bun run check
composer check
- name: ⚗️ Run static analysis
Expand All @@ -107,13 +106,13 @@ jobs:
run: |
php artisan optimize --env=ci
set -e && php artisan serve --env=ci > /dev/null 2>&1 &
pnpm test
bun run test
composer test
- name: 🚀 Execute end-to-end testing
run: pnpm e2e
run: bun run e2e

- name: 🧪 Test the whole application
run: |
composer debug
pnpm debug
bun run debug
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ composer install
Install JS / TS dependencies:

```shell
pnpm install
bun install
```

🍱 Build assets

The production build will generate client and server modules by running both client and server build commands:

```shell
pnpm build
bun run build
```

### 🗃️ Manage Database
Expand Down Expand Up @@ -159,7 +159,7 @@ Then visit [http://my-app.local:8000/](http://my-app.local:8000/)
- with **Rome**:

```shell
pnpm check
bun run check
```

- with **Pint**:
Expand All @@ -181,7 +181,7 @@ composer analyse
- using **Vitest**:

```shell
pnpm test
bun run test
```

- using **PEST**:
Expand All @@ -193,15 +193,15 @@ composer test
🚀 Execute end-to-end testing with **Playwright**:

```shell
pnpm e2e
bun run e2e
```

#### 🐛 Check all code bugs

- Frontend:

```shell
pnpm debug
bun run debug

- Backend:

Expand All @@ -212,9 +212,8 @@ composer debug
## 📋 Requirements

> - **Requires [PHP 8.1+](https://php.net/releases/)** (at least 8.1.21 recommended to avoid potential bugs).
> - **Requires [Node JS 18.16+](https://nodejs.org/)** (at least 18.16.1 recommended to avoid potential bugs).
> - **Requires [Bun 1.0+](https://bun.sh/)** (at least 1.0.4 recommended to avoid potential bugs).
> - **Requires [Composer >=2.5.8](https://getcomposer.org/)** to manage [PHP][php-link] dependencies.
> - **Requires [pnpm@^8.0.0](https://pnpm.io/)** to manage [JS][javascript-link] and [TS][typescript-link] dependencies.
> - **Requires [Git ~2.40.0](https://git-scm.com/)** to manage source code versions.

## 📖 Documentation
Expand Down
Binary file added bun.lockb
Binary file not shown.
3 changes: 3 additions & 0 deletions bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[test]
root = "./specs"
coverage = true
135 changes: 67 additions & 68 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,70 +1,69 @@
{
"private": true,
"type": "module",
"engines": {
"node": ">=18.18.0",
"pnpm": ">=8.8.0",
"npm": "prefer using pnpm",
"yarn": "prefer using pnpm"
},
"packageManager": "[email protected]",
"publishConfig": {
"access": "public"
},
"homepage": "https://sikessem.com",
"author": {
"name": "SIGUI Kessé Emmanuel",
"email": "[email protected]",
"url": "https://sigui.ci"
},
"scripts": {
"build": "vite build",
"check": "biome ci .",
"check.format": "biome format .",
"check.lint": "biome check .",
"debug": "pnpm check && pnpm test && pnpm e2e",
"dev": "concurrently \"vite\" \"vitest\"",
"e2e": "playwright test",
"e2e.install": "playwright install --with-deps",
"e2e.report": "playwright show-report",
"e2e.ui": "playwright test --ui",
"fix": "pnpm lint && pnpm format",
"format": "biome format --write .",
"inspect": "node --inspect-brk ./node_modules/vite/bin/vite.js --force",
"lint": "biome check --apply-unsafe .",
"test": "vitest run",
"test.ui": "vitest --ui",
"test.cov": "vitest run --coverage",
"start": "vite"
},
"devDependencies": {
"@alpinejs/focus": "^3.13.1",
"@biomejs/biome": "1.2.2",
"@playwright/test": "^1.38.1",
"@tailwindcss/forms": "^0.5.6",
"@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
"@tailwindcss/typography": "^0.5.10",
"@types/alpinejs": "^3.13.2",
"@types/alpinejs__focus": "^3.13.1",
"@types/node": "^20.8.2",
"@types/node-fetch": "^2.6.6",
"@vitest/coverage-v8": "^0.34.6",
"alpinejs": "^3.13.1",
"autoprefixer": "^10.4.16",
"axios": "^1.5.1",
"concurrently": "^8.2.1",
"cssnano": "^6.0.1",
"laravel-vite-plugin": "^0.8.1",
"node-fetch": "3.3.2",
"postcss": "^8.4.31",
"postcss-import": "^15.1.0",
"postcss-load-config": "^4.0.1",
"postcss-nested": "^6.0.1",
"tailwindcss": "^3.3.3",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^4.4.11",
"vite-tsconfig-paths": "4.2.1",
"vitest": "^0.34.6"
}
"private": true,
"type": "module",
"engines": {
"bun": ">=1.0.0",
"bun run": "prefer using bun",
"npm": "prefer using bun",
"yarn": "prefer using bun"
},
"packageManager": "[email protected]",
"publishConfig": {
"access": "public"
},
"homepage": "https://sikessem.com",
"author": {
"name": "SIGUI Kessé Emmanuel",
"email": "[email protected]",
"url": "https://sigui.ci"
},
"scripts": {
"build": "vite build",
"check": "biome ci .",
"check.format": "biome format .",
"check.lint": "biome check .",
"debug": "bun run check && bun run test && bun run e2e",
"dev": "vite",
"e2e": "playwright test",
"e2e.install": "playwright install --with-deps",
"e2e.report": "playwright show-report",
"e2e.ui": "playwright test --ui",
"fix": "bun run lint && bun run format",
"format": "biome format --write .",
"inspect": "bun --inspect-brk ./node_modules/vite/bin/vite.js --force",
"lint": "biome check --apply-unsafe .",
"test": "bun test",
"test.cov": "bun test --coverage",
"test.hot": "bun test --hot",
"test.watch": "bun test --watch",
"start": "vite --open"
},
"devDependencies": {
"@alpinejs/focus": "^3.13.1",
"@biomejs/biome": "1.2.2",
"@playwright/test": "^1.38.1",
"@tailwindcss/forms": "^0.5.6",
"@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
"@tailwindcss/typography": "^0.5.10",
"@types/alpinejs": "^3.13.2",
"@types/alpinejs__focus": "^3.13.1",
"@types/node": "^20.8.2",
"@types/node-fetch": "^2.6.6",
"alpinejs": "^3.13.1",
"autoprefixer": "^10.4.16",
"axios": "^1.5.1",
"concurrently": "^8.2.1",
"cssnano": "^6.0.1",
"laravel-vite-plugin": "^0.8.1",
"node-fetch": "3.3.2",
"postcss": "^8.4.31",
"postcss-import": "^15.1.0",
"postcss-load-config": "^4.0.1",
"postcss-nested": "^6.0.1",
"tailwindcss": "^3.3.3",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^4.4.11",
"vite-tsconfig-paths": "4.2.1"
}
}
Loading

0 comments on commit 7e853f0

Please sign in to comment.