@adamhl8/configs 0.28.1 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,6 +16,17 @@ import "node_modules/@adamhl8/configs/dist/configs/justfile.base.just"
16
16
 
17
17
  It provides `lint`, `build`, `test`, `bump-deps`, `release`, `release-run`, and `prepare`. Run `just` to list them. `build` only runs `tsdown` if the project has a `tsdown.config.ts`, so projects without a build step can use it as-is.
18
18
 
19
+ To customize a recipe, redefine it in your `justfile`. Each public recipe is a thin wrapper over a private `_recipe` that holds the actual body, so an override can still run the original instead of copying it:
20
+
21
+ ```just
22
+ # add steps after the original: dependencies run first, then the body
23
+ prepare: _prepare
24
+ tsdown
25
+
26
+ # add steps before and after: deps before `&&` run first, deps after run last
27
+ bump-deps: my-setup _bump-deps && my-cleanup
28
+ ```
29
+
19
30
  The only script left in `package.json` is `prepare`, which hands off to just:
20
31
 
21
32
  ```json
@@ -2,41 +2,48 @@
2
2
  set unstable
3
3
  set default-list
4
4
  set allow-duplicate-recipes
5
- set lazy
6
5
 
7
6
  export PATH := justfile_directory() + "/node_modules/.bin:" + env("PATH")
8
7
 
9
8
  # runs cmd if the [ ] condition holds, echoing cmd only when it runs
10
9
  run-when(cmd, condition) := f"if [ {{condition}} ]; then echo {{style("command", cmd)}}; {{cmd}}; fi"
11
10
 
12
- current_repo := `basename -s .git $(git remote get-url origin)`
11
+ # public recipes are thin wrappers over private _recipes so an override can still call the original
12
+ # e.g. `prepare: _prepare` + extra lines
13
13
 
14
- prepare:
14
+ prepare: _prepare
15
+ _prepare:
15
16
  lefthook install
16
- @{{ run-when("tsdown", f"{{current_repo}} = configs") }}
17
17
 
18
- bump-deps:
18
+ bump-deps: _bump-deps
19
+ _bump-deps:
19
20
  nub update -L
20
21
  rm -f lock.yaml
21
22
  nub i --no-frozen-lockfile
22
23
  oxfmt lock.yaml
23
24
 
24
- lint:
25
+ lint: _lint
26
+ _lint:
25
27
  markdown-toc -i --bullets '-' --maxdepth 3 ./README.md
26
28
  oxlint --fix --fix-suggestions --fix-dangerously
27
29
  oxfmt
28
30
  knip
29
31
  @{{ run-when("just test", "-f vitest.config.ts") }}
30
32
 
31
- build: lint
33
+ build: _build
34
+ _build: lint
32
35
  @{{ run-when("tsdown", "-f tsdown.config.ts") }}
33
36
 
34
- test:
37
+ test: _test
38
+ _test:
35
39
  vitest run
36
40
 
37
- release:
41
+ release: _release
42
+ _release:
38
43
  gh workflow run release.yml
39
44
 
40
45
  [private]
41
- release-run:
46
+ release-run: _release-run
47
+
48
+ _release-run:
42
49
  release-it --ci -i "$(adamhl8-cliff --bumped-version)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamhl8/configs",
3
- "version": "0.28.1",
3
+ "version": "0.29.0",
4
4
  "homepage": "https://github.com/adamhl8/configs",
5
5
  "bugs": {
6
6
  "url": "https://github.com/adamhl8/configs/issues"