@adamhl8/configs 0.28.0 → 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
|
-
|
|
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:
|
|
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)"
|
|
@@ -6,7 +6,7 @@ declare const knipConfig: OptionalMergeConfigFn<KnipConfig, {
|
|
|
6
6
|
readonly project: ["**/*"];
|
|
7
7
|
readonly entry: ["./src/index.ts"];
|
|
8
8
|
readonly ignoreBinaries: ["just"];
|
|
9
|
-
readonly ignoreDependencies: ["@adamhl8/eslint-plugin-clean-modules"
|
|
9
|
+
readonly ignoreDependencies: ["@adamhl8/eslint-plugin-clean-modules"];
|
|
10
10
|
}>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { knipConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip.base.d.ts","names":[],"sources":["../../src/configs/knip.base.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"knip.base.d.ts","names":[],"sources":["../../src/configs/knip.base.ts"],"mappings":";;;;cAoBa,UAAA,EAAU,qBAAA,CAAA,UAAA;EAAA"}
|
|
@@ -6,11 +6,7 @@ const knipConfig = createMergeConfigFn({
|
|
|
6
6
|
project: ["**/*"],
|
|
7
7
|
entry: ["./src/index.ts"],
|
|
8
8
|
ignoreBinaries: IGNORE_BINARIES,
|
|
9
|
-
ignoreDependencies: [
|
|
10
|
-
"@adamhl8/eslint-plugin-clean-modules",
|
|
11
|
-
"release-it",
|
|
12
|
-
"markdown-toc"
|
|
13
|
-
]
|
|
9
|
+
ignoreDependencies: ["@adamhl8/eslint-plugin-clean-modules"]
|
|
14
10
|
});
|
|
15
11
|
//#endregion
|
|
16
12
|
export { IGNORE_BINARIES, knipConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip.base.js","names":[],"sources":["../../src/configs/knip.base.ts"],"sourcesContent":["import type { KnipConfig } from \"knip\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\n/** Knip sees `just` in the `prepare` script and the release-it hooks, but it isn't a package.json dependency */\nexport const IGNORE_BINARIES = [\"just\"] as const satisfies string[]\n\n/**\n * - Knip resolves `@adamhl8/eslint-plugin-clean-modules` via the oxlint config, but we don't need to install it directly\n * in the consuming project, so it shows as unlisted\n
|
|
1
|
+
{"version":3,"file":"knip.base.js","names":[],"sources":["../../src/configs/knip.base.ts"],"sourcesContent":["import type { KnipConfig } from \"knip\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\n/** Knip sees `just` in the `prepare` script and the release-it hooks, but it isn't a package.json dependency */\nexport const IGNORE_BINARIES = [\"just\"] as const satisfies string[]\n\n/**\n * - Knip resolves `@adamhl8/eslint-plugin-clean-modules` via the oxlint config, but we don't need to install it directly\n * in the consuming project, so it shows as unlisted\n */\nconst IGNORE_DEPENDENCIES = [\"@adamhl8/eslint-plugin-clean-modules\"] as const satisfies string[]\n\nconst baseConfig = {\n project: [\"**/*\"],\n entry: [\"./src/index.ts\"],\n ignoreBinaries: IGNORE_BINARIES,\n ignoreDependencies: IGNORE_DEPENDENCIES,\n} as const satisfies KnipConfig\n\nexport const knipConfig = createMergeConfigFn<KnipConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";;;AAKA,MAAa,kBAAkB,CAAC,MAAM;AAetC,MAAa,aAAa,oBAAmD;CAN3E,SAAS,CAAC,MAAM;CAChB,OAAO,CAAC,gBAAgB;CACxB,gBAAgB;CAChB,oBAAoB,CANO,sCAMW;AAGqC,CAAU"}
|