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
19 changes: 6 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,25 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Determine Yarn Cache Path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v5
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
bun-version: latest

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}

- name: Install Packages
run: yarn install --frozen-lockfile
run: bun install --frozen-lockfile

- name: Build
run: yarn build
run: bun run build
env:
CI: true

- name: Test
run: yarn run test:ci
run: bun run test:ci
env:
CI: true
13 changes: 9 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,35 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup Node.js to publish to npmjs.org
uses: actions/setup-node@v6
with:
node-version: "24.x"
registry-url: "https://registry.npmjs.org"

- name: Install Packages
run: yarn install --frozen-lockfile
run: bun install --frozen-lockfile

- name: Build
run: yarn build
run: bun run build
env:
CI: true

- name: Test
run: yarn run test:ci
run: bun run test:ci
env:
CI: true

- name: Generate Release Body
run: npx extract-changelog-release > RELEASE_BODY.md

- name: Publish to NPM
run: yarn publish --non-interactive
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ bower_components

*.sublime-*
dist/
/test/yarn.lock
# bun lockfile (test/ subproject) is committed
yarn.lock
pnpm-lock.yaml
package-lock.json
.yarnrc
.env.local

.idea
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion .mocharc.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require: blanket,should,spec,ts-node/register
require: blanket,should,spec
recursive: true
2,112 changes: 1,109 additions & 1,003 deletions bun.lock

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
},
"scripts": {
"compile": "tsdown && tsc --emitDeclarationOnly --outDir dist",
"build": "npm run lint && npm run compile",
"build": "bun run compile",
"watch": "tsdown --watch",
"lint": "eslint ./src/*.ts ./src/**/*.ts",
"---------------": "",
"pretest": "cd ./test/ && yarn install && cd ..",
"test": "yarn run test:target",
"test:src": "cross-env TEST_TARGET=src yarn run test",
"test:dist": "cross-env TEST_TARGET=dist yarn run test",
"pretest": "cd ./test && bun install && cd ..",
"test": "bun run test:target",
"test:src": "cross-env TEST_TARGET=src mocha --recursive \"./test/tests\" --require ts-node/register",
"test:dist": "cross-env TEST_TARGET=dist mocha --recursive \"./test/tests\"",
"benchmark": "node ./test/benchmark/compare.mjs",
"--------------- ": "",
"clean": "npx rimraf ./dist/",
"clean:global": "yarn run clean && npx rimraf yarn.lock test/yarn.lock test/node_modules node_modules",
"reset": "yarn run clean:global && yarn install && yarn build",
"clean:global": "bun run clean && rm -rf test/node_modules node_modules",
"reset": "bun run clean:global && bun install && bun run build",
"--------------- ": "",
"test:target": "mocha --recursive \"./test/tests\"",
"test:ci": "cd test && yarn install && cd .. && cross-env TEST_TARGET=dist yarn run test:target",
"posttest": "yarn run benchmark",
"prepare": "npm run build",
"test:target": "mocha --recursive \"./test/tests\" --require blanket --require should --require spec",
"test:ci": "cd test && bun install && cd .. && cross-env TEST_TARGET=dist bun run test:target",
"posttest": "bun run benchmark",
"prepare": "bun run compile",
"release": "standard-version && git push --follow-tags origin main"
},
"keywords": [
Expand Down Expand Up @@ -92,8 +92,7 @@
"ts-node": "^10.9.1",
"tsdown": "^0.22.3",
"@typescript/native": "npm:typescript@^7.0.2",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"yarn": "^1.22.22"
"typescript": "npm:@typescript/typescript6@^6.0.2"
},
"config": {
"blanket": {
Expand All @@ -117,5 +116,6 @@
"url": "https://github.com/taoqf/node-fast-html-parser/issues"
},
"homepage": "https://github.com/taoqf/node-fast-html-parser",
"sideEffects": false
"sideEffects": false,
"packageManager": "bun@1.3.14"
}
Loading