Skip to content

Commit

Permalink
chore(internal): Switch to Bun
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianWendelborn committed Jul 18, 2024
1 parent adf819f commit cfe87b5
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 675 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,16 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4 # npm is required for provenance support
- uses: oven-sh/setup-bun@v1
- run: bun install --frozen-lockfile

- uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- run: yarn install --frozen-lockfile

# update npm for provenance support
- run: npm --version && npm install -g npm && npm --version

- name: vitest
run: yarn run vitest --run
- name: test
run: bun test

- name: build
run: yarn run build
run: bun run build

- name: dry-publish
run: npm publish --provenance --dry-run
20 changes: 6 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,15 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- run: yarn install --frozen-lockfile

# update npm for provenance support
- run: npm --version && npm install -g npm && npm --version
- uses: actions/checkout@v4
- uses: actions/setup-node@v4 # npm is required for provenance support
- uses: oven-sh/setup-bun@v1
- run: bun install --frozen-lockfile

# make sure this publish doesn’t break anything
- run: yarn run vitest --run
- run: bun run test

- run: yarn run build
- run: bun run build

- run: npm publish --provenance
env:
Expand Down
Binary file added bun.lockb
Binary file not shown.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"author": "Florian Wendelborn <[email protected]>",
"devDependencies": {
"prettier": "^2.8.7",
"typescript": "^5.0.4",
"vitest": "^0.30.0"
"@types/bun": "^1.1.6",
"prettier": "^3.3.3",
"typescript": "^5.5.3"
},
"files": [
"dist",
Expand All @@ -29,9 +29,9 @@
"repository": "[email protected]:FlorianWendelborn/nullish-math.git",
"sideEffects": false,
"scripts": {
"build": "yarn run clean && tsc -p tsconfig.build.json",
"build": "bun run clean && tsc -p tsconfig.build.json",
"clean": "rm -rf dist",
"test": "vitest"
"test": "bun test"
},
"types": "dist/index.d.ts",
"version": "0.0.6"
Expand Down
13 changes: 12 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
To install `nullish-math`, use one of the following commands:

```sh
yarn add nullish-math
bun add nullish-math
npm install nullish-math
pnpm add nullish-math
yarn add nullish-math
```

## Usage
Expand Down Expand Up @@ -80,3 +82,12 @@ Returns a new instance of `NullishMath` with the quotient of the current value a
#### `end(): number | null`

Returns the final value of the `NullishMath` instance. If any of the values passed to the math operation methods are `null` or `undefined`, the final value will be `null`.

## Development

`nullish-math` uses [`bun`](https://bun.sh)

```sh
bun install
# bun run test
```
Loading

0 comments on commit cfe87b5

Please sign in to comment.