Skip to content

Commit

Permalink
Upgrade dependencies, use Bun instead of Node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-si committed Jun 3, 2024
1 parent 4d64340 commit 2a2e3d5
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 21,415 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
- name: Setup Pages
uses: actions/configure-pages@v2

- name: Setup Node
uses: actions/setup-node@v3
- name: Setup Bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: npm ci
run: bun install

- name: Install Cargo
uses: dtolnay/rust-toolchain@stable
Expand Down
4 changes: 2 additions & 2 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ By simply running `make` it will also print a short list of them.
Build and run:

```shell
npx spago run --exec-args 'balance test/test.yaml'
bun x spago run --exec-args 'balance test/test.yaml'
```

Make `transity` executable available in your path:
Expand All @@ -29,7 +29,7 @@ will now be available via the linked `transity` executable.
Generate and serve the Pursuit documentation with:

```sh
npx spago docs
bun x spago docs
cd generated-docs/html
python3 -m http.server 1222
```
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
# TODO: This somehow makes it use nodejs_18
# inputsFrom = builtins.attrValues self.packages.${system};
buildInputs = with pkgs; [
bun
nodejs_20
watchexec

Expand Down
51 changes: 26 additions & 25 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ all: changelog.md readme.md index.js docs output

.PHONY: build
build: | node_modules
npx spago build
bun x spago build


changelog.md: .git | node_modules
# git config changelog.format '- %s (%h)'
# git changelog
npx conventional-changelog \
bun x conventional-changelog \
--infile $@ \
--same-file \
--output-unreleased


srcFiles := $(shell find src -type f -name "*.purs")
index.js: $(srcFiles) spago.yaml | node_modules
npx spago bundle \
bun x spago bundle \
--platform node \
--minify

Expand All @@ -33,7 +33,7 @@ bundle: index.js

# The specified target is configured in package.json
docs: output | node_modules
npx parcel build webapp/index.html \
bun x parcel build webapp/index.html \
--public-url /Transity \
--no-source-maps \
--target $@
Expand All @@ -43,54 +43,54 @@ docs: output | node_modules
# Use e.g. Vercel's "serve" like this: `serve docs-dev`.
# The specified target is configured in package.json.
docs-dev: output index.js | node_modules
npx parcel build webapp/index.html \
bun x parcel build webapp/index.html \
--no-source-maps \
--target $@



output: src spago.yaml | node_modules
npx spago build
bun x spago build


node_modules: package.json package-lock.json
if test ! -d $@; then npm install; fi
node_modules: package.json
if test ! -d $@; then bun install; fi


readme.md: | node_modules
npx markdown-toc -i $@
bun x markdown-toc -i $@


##### TESTING ######

.PHONY: lint-js
lint-js: | node_modules
npx eslint \
bun x eslint \
--max-warnings 0 \
--ignore-path .gitignore \
--ignore-pattern .gitignore \
scripts


.PHONY: test-spago
test-spago: | node_modules
npx spago test
bun x spago test


.PHONY: test-cli
test-cli: | node_modules
npx spago run -- \
bun x spago run -- \
balance examples/journal.yaml \
> /dev/null

npx spago run -- \
bun x spago run -- \
balance examples/journal.yaml examples/journal-only-transactions.yaml \
> /dev/null

npx spago run -- \
bun x spago run -- \
unused-files examples/receipts examples/journal.yaml \
2> /dev/null

npx spago run -- \
bun x spago run -- \
unused-files \
examples/receipts \
examples/journal.yaml \
Expand All @@ -106,16 +106,17 @@ test: test-spago test-cli lint-js
test-watch: | node_modules
watchexec \
--exts purs \
'npx spago test'
'bun x spago test'


.PHONY: clean
clean:
-rm -rf \
.parcel-cache \
.spago \
docs \
docs-dev \
index.js \
node_modules \
output
-rm -f bun.lockb
-rm -f index.js
-rm -f package-lock.json
-rm -rf .parcel-cache
-rm -rf .spago
-rm -rf docs
-rm -rf docs-dev
-rm -rf node_modules
-rm -rf output
Loading

0 comments on commit 2a2e3d5

Please sign in to comment.