Skip to content

Commit

Permalink
chore: migrate to bun
Browse files Browse the repository at this point in the history
  • Loading branch information
Dabolus committed Mar 8, 2024
1 parent 0b94e87 commit ddeb8cd
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 9,016 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run Static Code Analysis
uses: codacy/codacy-analysis-cli-action@master
- name: Use Node.js 18
uses: actions/setup-node@v3
- name: Use Bun 1.0.30
uses: oven-sh/setup-bun@v1
with:
node-version: 18
bun-version: 1.0.30
- name: Install deps
run: yarn install --immutable
run: |
bun install --frozen-lockfile
bun x playwright install
- name: Lint
run: yarn lint
run: bun run lint
- name: Build
run: yarn build
run: bun run build
- name: Test
run: yarn test --coverage
run: bun run test --coverage
- name: Upload coverage on Codacy
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage/lcov.info
env:
Expand Down
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,3 @@ node_modules/
/targets/*
*.log
coverage/
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
541 changes: 0 additions & 541 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.1.cjs

This file was deleted.

7 changes: 0 additions & 7 deletions .yarnrc.yml

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ experience of the native one.
npm i share-menu
# or
yarn add share-menu
# or
bun i share-menu
```

## Without npm/yarn
## Without npm/yarn/bun

If you just want to directly include the script without installing it as a dependency, use the `unpkg` CDN:

Expand Down
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

Binary file added bun.lockb
Binary file not shown.
32 changes: 14 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,22 @@
"types": "share-menu.d.ts",
"type": "module",
"scripts": {
"start": "run-p watch serve",
"watch": "rollup -w -c rollup.config.ts --configPlugin @rollup/plugin-typescript",
"serve": "wds --node-resolve --port 8080 --watch --app-index 'demo/index.html'",
"build": "NODE_ENV=production rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript",
"lint:src": "eslint --ext .ts 'src/**/*.{js,ts}'",
"lint:test": "eslint --ext .ts 'test/**/*.{js,ts}' --config .eslintrc.test",
"lint": "run-p lint:src lint:test",
"format:src": "yarn lint:src -- --fix",
"format:test": "yarn lint:test -- --fix",
"format": "run-p format:src format:test",
"prepublishOnly": "yarn build",
"test": "wtr",
"test:watch": "yarn test --watch"
"start": "concurrently bun:watch bun:serve",
"watch": "bun run --bun rollup -w -c rollup.config.ts",
"serve": "bun run --bun wds --node-resolve --port 8080 --watch --app-index 'demo/index.html'",
"build": "NODE_ENV=production bun run --bun rollup -c rollup.config.ts",
"lint:src": "bun run eslint --ext .ts 'src/**/*.{js,ts}'",
"lint:test": "bun run eslint --ext .ts 'test/**/*.{js,ts}' --config .eslintrc.test",
"lint": "concurrently bun:lint:src bun:lint:test",
"format:src": "bun run lint:src -- --fix",
"format:test": "bun run lint:test -- --fix",
"format": "concurrently bun:format:src bun:format:test",
"prepublishOnly": "bun run build",
"test": "bun run --bun wtr"
},
"devDependencies": {
"@babel/preset-typescript": "^7.22.5",
"@esm-bundle/chai-as-promised": "^7.1.1",
"@open-wc/testing": "^3.2.0",
"@rollup/plugin-typescript": "^11.1.2",
"@types/chai-as-promised": "^7.1.5",
"@types/facebook-js-sdk": "^3.3.6",
"@types/glob": "^8.1.0",
Expand All @@ -37,11 +34,11 @@
"@web/test-runner": "^0.17.0",
"@web/test-runner-commands": "^0.8.0",
"@web/test-runner-playwright": "^0.10.1",
"concurrently": "^8.2.2",
"eslint": "^8.46.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"glob": "^10.3.3",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.1",
"rollup": "^3.27.2",
"rollup-plugin-filesize": "^10.0.0",
Expand Down Expand Up @@ -79,6 +76,5 @@
"targets",
"package.json",
"README.md"
],
"packageManager": "[email protected]"
]
}
6 changes: 4 additions & 2 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default defineConfig({
plugins: [
...(prod
? [
(minifyHtml as unknown as { default: typeof minifyHtml }).default({
minifyHtml({
options: {
shouldMinify: (template) =>
template.parts[0].text.startsWith('<!-- html -->'),
Expand Down Expand Up @@ -68,7 +68,9 @@ export default defineConfig({
? [
filesize({
showMinifiedSize: false,
showBrotliSize: true,
// TODO: set this to true as soon as Bun gets support for Brotli in its zlib implementation
// See: https://github.com/oven-sh/bun/issues/267
showBrotliSize: false,
}),
]
: []),
Expand Down
Loading

0 comments on commit ddeb8cd

Please sign in to comment.