Skip to content

Commit 057bcb3

Browse files
Merge pull request #554 from Automattic/simplify-justfile
build: use `just`-native dependency resolution
2 parents 9d04335 + 16b73cb commit 057bcb3

File tree

2 files changed

+14
-36
lines changed

2 files changed

+14
-36
lines changed

justfile

+10-36
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ format:
44
cd "{{justfile_directory()}}/packages"; yarn prettier -w .
55

66
# Build the WebAssembly for a specific target (usually either `web` or `bundler`)
7-
build-wasm target:
8-
cd "{{justfile_directory()}}/harper-wasm" && wasm-pack build --target {{target}}
7+
build-wasm:
8+
cd "{{justfile_directory()}}/harper-wasm" && wasm-pack build --target web
99

1010
# Build `harper.js` with all size optimizations available.
11-
build-harperjs:
11+
build-harperjs: build-wasm
1212
#! /bin/bash
1313
set -eo pipefail
14-
just build-wasm web
1514

1615
# Removes a duplicate copy of the WASM binary if Vite is left to its devices.
1716
perl -pi -e 's/new URL\(.*\)/new URL()/g' "{{justfile_directory()}}/harper-wasm/pkg/harper_wasm.js"
@@ -23,10 +22,9 @@ build-harperjs:
2322
# Generate API reference
2423
./docs.sh
2524

26-
test-harperjs:
25+
test-harperjs: build-harperjs
2726
#!/bin/bash
2827
set -eo pipefail
29-
just build-harperjs
3028

3129
cd "{{justfile_directory()}}/packages/harper.js"
3230
yarn install -f
@@ -50,22 +48,19 @@ dev-web:
5048
yarn dev
5149

5250
# Build the Harper website.
53-
build-web:
51+
build-web: build-harperjs
5452
#! /bin/bash
5553
set -eo pipefail
5654

57-
just build-harperjs
58-
5955
cd "{{justfile_directory()}}/packages/web"
6056
yarn install -f
6157
yarn run build
6258

6359
# Build the Harper Obsidian plugin.
64-
build-obsidian:
60+
build-obsidian: build-harperjs
6561
#! /bin/bash
6662
set -eo pipefail
6763

68-
just build-harperjs
6964
cd "{{justfile_directory()}}/packages/obsidian-plugin"
7065

7166
yarn install -f
@@ -169,51 +164,32 @@ check-rust:
169164
cargo clippy -- -Dwarnings -D clippy::dbg_macro -D clippy::needless_raw_string_hashes
170165

171166
# Perform format and type checking.
172-
check:
167+
check: check-rust build-web
173168
#! /bin/bash
174169
set -eo pipefail
175170

176-
just check-rust
177-
178171
cd "{{justfile_directory()}}/packages"
179172
yarn install
180173
yarn prettier --check .
181174
yarn eslint .
182175

183176
# Needed because Svelte has special linters
184177
cd web
185-
just build-web
186178
yarn run check
187179

188180
# Populate build caches and install necessary local tooling (tools callable via `yarn run <tool>`).
189-
setup:
190-
#! /bin/bash
191-
set -eo pipefail
192-
193-
cargo build
194-
just build-harperjs
195-
just build-obsidian
196-
just test-vscode
197-
just test-harperjs
198-
just build-web
181+
setup: build-harperjs build-obsidian test-vscode test-harperjs build-web
199182

200183
# Perform full format and type checking, build all projects and run all tests. Run this before pushing your code.
201-
precommit:
184+
precommit: check test build-harperjs build-obsidian build-web
202185
#! /bin/bash
203186
set -eo pipefail
204187

205-
just check
206-
just test
207-
208188
cargo doc
209189
cargo build
210190
cargo build --release
211191
cargo bench
212192

213-
just build-harperjs
214-
just build-obsidian
215-
just build-web
216-
217193
# Install `harper-cli` and `harper-ls` to your machine via `cargo`
218194
install:
219195
cargo install --path harper-ls
@@ -230,10 +206,8 @@ dogfood:
230206
done
231207

232208
# Test everything.
233-
test:
209+
test: test-vscode test-harperjs
234210
cargo test
235-
just test-vscode
236-
just test-harperjs
237211

238212
# Use `harper-cli` to parse a provided file and print out the resulting tokens.
239213
parse file:

packages/.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ pnpm-lock.yaml
1616
package-lock.json
1717
yarn.lock
1818
dist
19+
20+
markdown
21+
temp
22+
web/static/docs/harperjs/ref

0 commit comments

Comments
 (0)