diff --git a/.github/workflows/buddy-bot.yml b/.github/workflows/buddy-bot.yml index 4ed077f..acbf3ad 100644 --- a/.github/workflows/buddy-bot.yml +++ b/.github/workflows/buddy-bot.yml @@ -130,7 +130,7 @@ jobs: - name: Setup PHP and Composer (if needed) if: ${{ hashFiles('composer.json') != '' }} - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@2.35.5 with: php-version: '8.4' tools: composer @@ -248,7 +248,7 @@ jobs: - name: Setup PHP and Composer (if needed) if: ${{ hashFiles('composer.json') != '' }} - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@2.35.5 with: php-version: '8.4' tools: composer diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index faea563..83b44e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,10 +21,10 @@ jobs: - uses: actions/checkout@v4 - name: Install Bun - uses: oven-sh/setup-bun@v2 + uses: oven-sh/setup-bun@v2.0.2 - name: Use cached node_modules - uses: actions/cache@v4 + uses: actions/cache@v4.3.0 with: path: node_modules key: node-modules-${{ hashFiles('**/bun.lock') }} @@ -44,10 +44,10 @@ jobs: - uses: actions/checkout@v4 - name: Install Bun - uses: oven-sh/setup-bun@v2 + uses: oven-sh/setup-bun@v2.0.2 - name: Use cached node_modules - uses: actions/cache@v4 + uses: actions/cache@v4.3.0 with: path: node_modules key: node-modules-${{ hashFiles('**/bun.lock') }} @@ -67,10 +67,10 @@ jobs: - uses: actions/checkout@v4 - name: Install Bun - uses: oven-sh/setup-bun@v2 + uses: oven-sh/setup-bun@v2.0.2 - name: Use cached node_modules - uses: actions/cache@v4 + uses: actions/cache@v4.3.0 with: path: node_modules key: node-modules-${{ hashFiles('**/bun.lock') }} @@ -90,10 +90,10 @@ jobs: - uses: actions/checkout@v4 - name: Install Bun - uses: oven-sh/setup-bun@v2 + uses: oven-sh/setup-bun@v2.0.2 - name: Use cached node_modules - uses: actions/cache@v4 + uses: actions/cache@v4.3.0 with: path: node_modules key: node-modules-${{ hashFiles('**/bun.lock') }} @@ -107,4 +107,4 @@ jobs: run: bun run build - name: Publish Commit - run: bunx pkg-pr-new publish + run: bunx pkg-pr-new publish "./packages/besting" "./packages/very-happy-dom" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b681139..d5fb7a4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,10 +16,14 @@ jobs: fetch-depth: 0 - name: Install Bun - uses: oven-sh/setup-bun@v2 + uses: oven-sh/setup-bun@v2.0.2 + # env: + # BUN_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + with: + bun-version: latest - name: Use cached node_modules - uses: actions/cache@v4 + uses: actions/cache@v4.3.0 with: path: node_modules key: node-modules-${{ hashFiles('**/bun.lock') }} @@ -30,23 +34,18 @@ jobs: run: bun install - name: Publish to npm - run: bun publish --access public + run: ./scripts/publish.sh env: BUN_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - name: Create GitHub release - run: bunx changelogithub - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - - name: Attach Binaries - uses: stacksjs/action-releaser@v1.0.0 + - name: Create GitHub Release + uses: stacksjs/action-releaser@v1.2.6 with: files: | - bin/besting-linux-x64 - bin/besting-linux-arm64 - bin/besting-windows-x64.exe - bin/besting-darwin-x64 - bin/besting-darwin-arm64 + packages/besting/bin/besting-linux-x64.zip + packages/besting/bin/besting-linux-arm64.zip + packages/besting/bin/besting-windows-x64.zip + packages/besting/bin/besting-darwin-x64.zip + packages/besting/bin/besting-darwin-arm64.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/deps.yaml b/deps.yaml new file mode 100644 index 0000000..8b4957e --- /dev/null +++ b/deps.yaml @@ -0,0 +1,2 @@ +dependencies: + bun.sh: ^1.2.23 diff --git a/package.json b/package.json index 25269f6..f8cee9f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { "name": "besting", "type": "module", - "version": "0.0.4", + "version": "0.0.9", + "private": true, "description": "A Bun test framework.", "author": "Chris Breuer ", "license": "MIT", @@ -19,80 +20,36 @@ "test", "framework" ], - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js" - }, - "./*": { - "import": "./dist/*" - } - }, - "module": "./dist/index.js", - "types": "./dist/index.d.ts", - "bin": { - "besting": "./dist/bin/cli.js" - }, - "files": [ - "README.md", - "dist" - ], "scripts": { - "build": "bun --bun build.ts && bun run compile", - "compile": "bun build ./bin/cli.ts --compile --minify --outfile bin/besting", - "compile:all": "bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:windows-x64 && bun run compile:darwin-x64 && bun run compile:darwin-arm64", - "compile:linux-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64 --outfile bin/besting-linux-x64", - "compile:linux-arm64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64 --outfile bin/besting-linux-arm64", - "compile:windows-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-windows-x64 --outfile bin/besting-windows-x64.exe", - "compile:darwin-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-darwin-x64 --outfile bin/besting-darwin-x64", - "compile:darwin-arm64": "bun build ./bin/cli.ts --compile --minify --target=bun-darwin-arm64 --outfile bin/besting-darwin-arm64", - "zip": "bun run zip:all", - "zip:all": "bun run zip:linux-x64 && bun run zip:linux-arm64 && bun run zip:windows-x64 && bun run zip:darwin-x64 && bun run zip:darwin-arm64", - "zip:linux-x64": "zip -j bin/besting-linux-x64.zip bin/besting-linux-x64", - "zip:linux-arm64": "zip -j bin/besting-linux-arm64.zip bin/besting-linux-arm64", - "zip:windows-x64": "zip -j bin/besting-windows-x64.zip bin/besting-windows-x64.exe", - "zip:darwin-x64": "zip -j bin/besting-darwin-x64.zip bin/besting-darwin-x64", - "zip:darwin-arm64": "zip -j bin/besting-darwin-arm64.zip bin/besting-darwin-arm64", + "build": "cd packages/besting && bun run build && cd ../very-happy-dom && bun run build && cd ../", "fresh": "bunx rimraf node_modules/ bun.lock && bun i", - "prepublishOnly": "bun --bun run build && bun run compile:all && bun run zip", "lint": "bunx --bun eslint .", "lint:fix": "bunx --bun eslint . --fix", "changelog": "bunx logsmith --verbose", "changelog:generate": "bunx logsmith --output CHANGELOG.md", - "release": "bun run changelog:generate && bunx bumpx prompt --recursive", - "postinstall": "bunx git-hooks", + "release": "bun run changelog:generate && bunx --bun bumpx prompt --recursive", + "bench": "bun packages/benchmarks/dom-performance.bench.ts", + "bench:dom": "bun packages/benchmarks/dom-performance.bench.ts", + "bench:compare": "bun packages/benchmarks/competitive-comparison.bench.ts", + "bench:very-happy-dom": "bun packages/benchmarks/lib/very-happy-dom.test.ts", "test": "bun test", - "test:custom": "bun run src/bin.ts", - "test:standard": "bun test", - "test:debug": "BESTING_DEBUG=true bun test", - "test:core": "bun test test/index.test.ts", - "test:stress": "bun test test/stress.test.ts", - "test:errors": "bun test test/error-handling.test.ts", - "test:all": "bun test:core && bun test:stress && bun test:errors", "dev:docs": "bun --bun vitepress dev docs", "build:docs": "bun --bun vitepress build docs", "preview:docs": "bun --bun vitepress preview docs", "typecheck": "bun --bun tsc --noEmit" }, - "dependencies": { - "cac": "^6.7.14" - }, "devDependencies": { - "@stacksjs/bumpx": "^0.1.13", + "@stacksjs/bumpx": "^0.2.4", "@stacksjs/docs": "^0.70.23", - "@stacksjs/eslint-config": "^4.10.2-beta.3", + "@stacksjs/eslint-config": "^4.14.0-beta.3", "@stacksjs/gitlint": "^0.1.5", - "@stacksjs/logsmith": "^0.1.8", - "@types/bun": "^1.2.11", - "buddy-bot": "^0.8.8", - "bumpp": "^10.1.0", - "bun-git-hooks": "^0.2.19", - "bun-plugin-dtsx": "^0.21.9", - "bunfig": "^0.8.4", - "changelogen": "^0.6.1", - "lint-staged": "^15.5.1", - "simple-git-hooks": "^2.13.0", - "typescript": "^5.8.3" + "@stacksjs/logsmith": "^0.2.1", + "@types/bun": "^1.3.2", + "buddy-bot": "^0.9.11", + "bun-git-hooks": "^0.3.1", + "bun-plugin-dtsx": "0.9.9", + "bunfig": "^0.15.6", + "typescript": "^5.9.3" }, "overrides": { "unconfig": "0.3.10" @@ -100,9 +57,12 @@ "git-hooks": { "pre-commit": { "staged-lint": { - "*.{js,ts,json,yaml,yml,md}": "bun lint:fix" + "*.{js,ts,json,yaml,yml,md}": "bunx --bun eslint --fix" } }, - "commit-msg": "bunx gitlint --edit $1" - } + "commit-msg": "bunx gitlint --edit .git/COMMIT_EDITMSG" + }, + "workspaces": [ + "packages/*" + ] } diff --git a/packages/benchmarks/package.json b/packages/benchmarks/package.json new file mode 100644 index 0000000..c1104e0 --- /dev/null +++ b/packages/benchmarks/package.json @@ -0,0 +1,48 @@ +{ + "name": "@besting/benchmarks", + "type": "module", + "version": "0.0.9", + "private": true, + "description": "Benchmarks for the `besting` library.", + "author": "Chris Breuer ", + "license": "MIT", + "homepage": "https://github.com/stacksjs/besting#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/stacksjs/besting.git" + }, + "bugs": { + "url": "https://github.com/stacksjs/besting/issues" + }, + "keywords": [ + "besting", + "happy-dom", + "bun" + ], + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/src/index.js" + }, + "./*": { + "import": "./dist/*" + } + }, + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "build": "bun --bun build.ts", + "lint": "bunx --bun eslint .", + "lint:fix": "bunx --bun eslint . --fix", + "prepublishOnly": "bun --bun run build", + "test": "bun test" + }, + "devDependencies": { + "happy-dom": "^20.0.10", + "jsdom": "^25.0.1", + "mitata": "^1.0.34" + } +} diff --git a/pkgx.yaml b/pkgx.yaml index 03bf2f9..4655bab 100644 --- a/pkgx.yaml +++ b/pkgx.yaml @@ -1,2 +1,2 @@ dependencies: - bun.sh: ^1.2.10 + bun.sh: ^1.2.20