Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
fun with bun
Browse files Browse the repository at this point in the history
  • Loading branch information
fubhy committed Sep 15, 2023
1 parent c43d4aa commit 932bb0d
Show file tree
Hide file tree
Showing 83 changed files with 579 additions and 7,449 deletions.
11 changes: 0 additions & 11 deletions .devcontainer.json

This file was deleted.

29 changes: 9 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,19 @@ jobs:
uses: HatsuneMiku3939/direnv-action@v1
with:
direnvVersion: 2.32.2
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Cache pnpm
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: pnpm install
- run: pnpm run build
- run: pnpm run circular
- run: pnpm run test --coverage
- run: pnpm run lint
- run: pnpm run dtslint
- run: pnpm run docs
- run: bun install
- run: bun run build
- run: bun run circular
- run: bun test --coverage
- run: bun run lint
- run: bun run dtslint
- run: bun run docs
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
version: pnpm run version
publish: pnpm exec changeset publish
version: bun run version
publish: bun exec changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
25 changes: 7 additions & 18 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,10 @@ jobs:
uses: HatsuneMiku3939/direnv-action@v1
with:
direnvVersion: 2.32.2
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Cache pnpm
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: pnpm install
- run: pnpm run build
- run: pnpm run circular
- run: pnpm run test --coverage
- run: pnpm run lint
- run: pnpm run dtslint
- run: pnpm run docs
- run: bun install
- run: bun run build
- run: bun run circular
- run: bun test --coverage
- run: bun run lint
- run: bun run dtslint
- run: bun run docs
5 changes: 5 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM gitpod/workspace-full

RUN curl -fsSL https://bun.sh/install | bash
RUN echo 'export BUN_INSTALL="/home/gitpod/.bun"' >> /home/gitpod/.bashrc.d/600-bun | bash && \
echo 'export PATH="$BUN_INSTALL/bin:$PATH"' >> /home/gitpod/.bashrc.d/600-bun | bash
4 changes: 3 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
image:
file: .gitpod.Dockerfile
tasks:
- init: npm install -g pnpm && pnpm install && pnpm build
- init: bun install && bun run build
github:
prebuilds:
addCheck: true
Expand Down
8 changes: 4 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
{
"label": "clean",
"type": "shell",
"command": "direnv exec . pnpm run clean",
"command": "direnv exec . bun run clean",
"isBackground": false,
"problemMatcher": []
},
{
"label": "build-watch",
"type": "shell",
"command": "direnv exec . pnpm run build-watch",
"command": "direnv exec . bun run build-watch",
"problemMatcher": [
"$tsc-watch"
],
Expand All @@ -27,7 +27,7 @@
{
"label": "build",
"type": "shell",
"command": "direnv exec . pnpm run build",
"command": "direnv exec . bun run build",
"problemMatcher": [],
"isBackground": false
},
Expand All @@ -37,7 +37,7 @@
"build-watch"
],
"type": "shell",
"command": "direnv exec . pnpm run test",
"command": "direnv exec . bun test",
"problemMatcher": []
}
]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ We welcome contributions via pull requests! Here are some guidelines to help you

1. Fork the repository and clone it to your local machine.
2. Create a new branch for your changes: `git checkout -b my-new-feature`
3. Install dependencies: `pnpm install` (`[email protected]`)
3. Install dependencies: `bun install`
4. Make your changes and add tests if applicable.
5. Run the tests: `pnpm test`
5. Run the tests: `bu test`
6. Commit your changes: `git commit -am 'Add some feature'`
7. Push your changes to your fork: `git push origin my-new-feature`
8. Open a pull request against our `main` branch.
Expand Down
Binary file added bun.lockb
Binary file not shown.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 1 addition & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,12 @@
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
corepackEnable = pkgs.runCommand "corepack-enable" {} ''
mkdir -p $out/bin
${pkgs.nodejs-18_x}/bin/corepack enable --install-directory $out/bin
'';
in {
formatter = pkgs.alejandra;

devShells = {
default = pkgs.mkShell {
buildInputs = with pkgs; [
nodejs-18_x
corepackEnable
];
buildInputs = with pkgs; [bun];
};
};
});
Expand Down
28 changes: 11 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,22 @@
"functional-programming"
],
"scripts": {
"example": "ts-node --project tsconfig.examples.json",
"version": "changeset version && pnpm install --no-frozen-lockfile && pnpm run docs-update",
"release": "pnpm run build && changeset publish",
"version": "changeset version && bun install && bun run docs-update",
"release": "bun run build && changeset publish",
"clean": "rimraf build tsbuildinfo dist .cache",
"build": "pnpm build-all && pnpm build-pack",
"build": "bun build-all && bun build-pack",
"build-cjs": "babel build/esm --config-file ./.babel.cjs.json --out-dir build/cjs --out-file-extension .js --source-maps",
"build-mjs": "babel build/esm --config-file ./.babel.mjs.json --out-dir build/mjs --out-file-extension .mjs --source-maps",
"build-post": "build-utils pack-v1",
"build-pack": "concurrently \"pnpm build-cjs\" \"pnpm build-mjs\" && pnpm build-post",
"build-pack": "concurrently \"bun build-cjs\" \"bun build-mjs\" && bun build-post",
"build-all": "tsc -b tsconfig.json",
"build-watch": "tsc -b tsconfig.json --watch",
"lint": "eslint src test examples",
"autofix": "pnpm lint --fix",
"autofix": "bun lint --fix",
"tc": "tsc --noEmit",
"docs": "docgen",
"docs-update": "git add --force --all docs/modules || true",
"circular": "madge --ts-config ./tsconfig.madge.json --circular --no-color --no-spinner --warning build/esm",
"test": "vitest",
"coverage": "vitest run --coverage",
"dtslint": "dtslint --expectOnly dtslint"
},
"exports": {
Expand All @@ -56,7 +53,6 @@
"require": "./build/cjs/*.js"
}
},
"packageManager": "[email protected]",
"devDependencies": {
"@babel/cli": "^7.22.10",
"@babel/core": "^7.22.11",
Expand All @@ -75,8 +71,9 @@
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"@vitejs/plugin-react": "^4.0.4",
"@vitest/coverage-v8": "^0.34.3",
"babel-plugin-annotate-pure-calls": "^0.4.0",
"bun": "^1.0.0",
"bun-types": "^1.0.1",
"concurrently": "^8.2.1",
"error-stack-parser": "^2.1.4",
"eslint": "^8.48.0",
Expand All @@ -90,17 +87,14 @@
"madge": "^6.1.0",
"rimraf": "^5.0.1",
"stackframe": "^1.3.4",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vitest": "0.34.3"
"typescript": "^5.2.2"
},
"peerDependencies": {
"@effect/data": "^0.18.5"
},
"config": {
"side": [],
"modules": [],
"global": []
},
"peerDependencies": {
"@effect/data": "^0.18.5"
}
}
Loading

0 comments on commit 932bb0d

Please sign in to comment.