Skip to content

Commit

Permalink
switch to bun
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbrinkman committed Apr 20, 2024
1 parent a527392 commit 634e060
Show file tree
Hide file tree
Showing 25 changed files with 86 additions and 8,542 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,10 @@ jobs:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [19.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: yarn install
- run: yarn lint
- run: yarn test
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun fmt --check
- run: bun lint
- run: bun export
13 changes: 1 addition & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
# Yarn #
########
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Cache #
#########
coverage
Expand All @@ -18,10 +8,9 @@ tsconfig.tsbuildinfo
# Artifacts #
#############
dist
bundle

# Testing #
###########
test.mjs
test.js
cache.json
token.txt
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.1.1.cjs

This file was deleted.

Empty file removed .yarn/versions/181e3029.yml
Empty file.
Empty file removed .yarn/versions/190798fe.yml
Empty file.
Empty file removed .yarn/versions/2d3fdd6c.yml
Empty file.
Empty file removed .yarn/versions/37a0481e.yml
Empty file.
Empty file removed .yarn/versions/8b75546e.yml
Empty file.
Empty file removed .yarn/versions/a5b885ce.yml
Empty file.
Empty file removed .yarn/versions/c0a955fa.yml
Empty file.
Empty file removed .yarn/versions/d0f1eaa3.yml
Empty file.
Empty file removed .yarn/versions/eb93b2d8.yml
Empty file.
1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

Binary file added bun.lockb
Binary file not shown.
4 changes: 0 additions & 4 deletions eslint.config.mjs → eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// @ts-check

import eslint from "@eslint/js";
import configPrettier from "eslint-config-prettier";
import jest from "eslint-plugin-jest";
import spellcheck from "eslint-plugin-spellcheck";
import tsdoc from "eslint-plugin-tsdoc";
import tseslint from "typescript-eslint";
Expand All @@ -13,7 +10,6 @@ export default tseslint.config(
...tseslint.configs.recommendedTypeChecked,
{
plugins: {
jest,
spellcheck,
tsdoc,
},
Expand Down
55 changes: 9 additions & 46 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,19 @@
"keywords": [
"remarkable"
],
"types": "./dist/index.d.ts",
"module": "bundle/rmapi-js.esm.min.js",
"main": "bundle/rmapi-js.cjs.min.js",
"unpkg": "bundle/rmapi-js.iife.min.js",
"type": "module",
"types": "dist/index.d.ts",
"module": "dist/rmapi-js.esm.min.js",
"files": [
"./bundle/*.js",
"./dist/**/*.js",
"./dist/**/*.d.ts"
],
"packageManager": "yarn@4.1.1",
"scripts": {
"doc": "pnpify typedoc",
"fmt": "pnpify prettier --cache --write 'src/*.ts' '*.json' eslint.config.mjs",
"lint:es": "pnpify eslint --cache 'src/*.ts'",
"lint:doc": "pnpify typedoc --emit none",
"lint": "pnpify tsc && yarn lint:es && yarn lint:doc",
"test": "jest --coverage",
"build": "pnpify tsc -p tsconfig.build.json && esbuild src/index.ts --bundle --minify --platform=node --outfile=bundle/rmapi-js.cjs.min.js && yarn esbuild src/index.ts --bundle --minify --platform=browser --outfile=bundle/rmapi-js.iife.min.js && yarn esbuild src/index.ts --bundle --minify --platform=neutral --outfile=bundle/rmapi-js.esm.min.js --main-fields=module,main",
"prepack": "yarn lint && yarn test && yarn build"
"doc": "typedoc",
"fmt": "prettier --cache --write 'src/*.ts' '*.{js,json}'",
"lint": "tsc && eslint --cache 'src/*.ts' && typedoc --emit none",
"export": "tsc -p tsconfig.build.json && bun build src/index.ts --minify --outfile dist/rmapi-js.esm.min.js",
"prepack": "bun lint && bun test --coverage && bun export"
},
"dependencies": {
"ajv": "^8.12.0",
Expand All @@ -36,49 +30,18 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@babel/preset-env": "^7.24.4",
"@babel/preset-typescript": "^7.24.1",
"@eslint/js": "^9.0.0",
"@types/babel__core": "^7.20.5",
"@types/babel__preset-env": "^7.9.6",
"@types/jest": "^29.5.12",
"@types/bun": "^1.1.0",
"@types/json-stable-stringify": "^1.0.36",
"@types/node": "^20.12.7",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"@yarnpkg/pnpify": "^4.0.1",
"babel-jest": "^29.7.0",
"esbuild": "^0.20.2",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.2.0",
"eslint-plugin-spellcheck": "^0.0.20",
"eslint-plugin-tsdoc": "^0.2.17",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
"typedoc": "^0.25.13",
"typescript": "^5.4.5",
"typescript-eslint": "^7.6.0"
},
"prettier": {
"plugins": [
"prettier-plugin-organize-imports"
]
},
"babel": {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
],
"@babel/preset-typescript"
]
}
}
3 changes: 3 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
plugins: ["prettier-plugin-organize-imports"],
};

0 comments on commit 634e060

Please sign in to comment.