@adamhl8/configs 2.8.2 → 3.0.1
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 +32 -25
- package/dist/configs/bask.base.d.ts +12 -0
- package/dist/configs/bask.base.d.ts.map +1 -0
- package/dist/configs/bask.base.js +77 -0
- package/dist/configs/bask.base.js.map +1 -0
- package/dist/configs/knip.base.d.ts +1 -2
- package/dist/configs/knip.base.d.ts.map +1 -1
- package/dist/configs/knip.base.js +1 -2
- package/dist/configs/knip.base.js.map +1 -1
- package/dist/configs/lefthook.base.yaml +1 -1
- package/dist/configs/oxlint.base.d.ts +6 -0
- package/dist/configs/oxlint.base.d.ts.map +1 -1
- package/dist/configs/oxlint.base.js +7 -0
- package/dist/configs/oxlint.base.js.map +1 -1
- package/dist/configs/release-it.base.d.ts +1 -1
- package/dist/configs/release-it.base.js +1 -1
- package/dist/configs/release-it.base.js.map +1 -1
- package/package.json +8 -2
- package/dist/configs/justfile.base.just +0 -87
package/README.md
CHANGED
|
@@ -27,36 +27,43 @@ const config = oxlintConfig(
|
|
|
27
27
|
|
|
28
28
|
The second config works at any depth: only the arrays you provide are replaced, sibling keys still merge normally, and a key in both objects gets the second object's value. Required keys (e.g. `platform` for `tsdownConfig`) must be provided in the first object.
|
|
29
29
|
|
|
30
|
-
###
|
|
30
|
+
### bask
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Tasks live in a shared [bask](https://github.com/adamhl8/bask) tasks module instead of being copied into every project's `package.json`. Install `@adamhl8/bask` as a dev dependency, then re-export the tasks from your `bask.ts`:
|
|
33
33
|
|
|
34
|
-
```
|
|
35
|
-
|
|
34
|
+
```ts
|
|
35
|
+
export * from "@adamhl8/configs/bask"
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
It provides `lint`, `build`, `test`, `bump-deps`, `release`, `release-run
|
|
38
|
+
It provides `lint`, `build`, `test`, `bump-deps`, `release`, `release-run` (hidden, run by the release workflow), `tofu-check`, `commit-types`, and `prepare`. Run `bunx bask` to list them along with the allowed commit types. The tasks degrade gracefully so projects can use them as-is: `build` only runs `tsdown` if the project has a `tsdown.config.ts`, `test` (`bun test`) passes when there are no tests, and `tofu-check` (a `tofu plan` drift check, which `build` also runs) skips itself unless run locally in a project with `.tofu` files.
|
|
39
|
+
|
|
40
|
+
To customize a task, add hooks to it from your `bask.ts`. A hook also runs when another base task calls that task, so extending `lint` extends `build` too:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { task } from "@adamhl8/bask"
|
|
44
|
+
import { bumpDeps, lint } from "@adamhl8/configs/bask"
|
|
39
45
|
|
|
40
|
-
|
|
46
|
+
export * from "@adamhl8/configs/bask"
|
|
41
47
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
tsdown
|
|
48
|
+
export const astroSync = task(async ({ sh }) => {
|
|
49
|
+
await sh`bun astro sync`
|
|
50
|
+
})
|
|
46
51
|
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
lint.before(astroSync)
|
|
53
|
+
bumpDeps.after(async ({ sh }) => {
|
|
54
|
+
await sh`bun prisma generate`
|
|
55
|
+
})
|
|
49
56
|
```
|
|
50
57
|
|
|
51
|
-
The only script left in `package.json` is `prepare`, which hands off to
|
|
58
|
+
The only script left in `package.json` is `prepare`, which hands off to bask:
|
|
52
59
|
|
|
53
60
|
```json
|
|
54
61
|
"scripts": {
|
|
55
|
-
"prepare": "
|
|
62
|
+
"prepare": "bunx bask prepare"
|
|
56
63
|
}
|
|
57
64
|
```
|
|
58
65
|
|
|
59
|
-
|
|
66
|
+
Scripts, git hooks, and the workflows run `bunx bask` rather than `bun bask`, because `bun bask` runs `bask.ts` instead of the bask bin.
|
|
60
67
|
|
|
61
68
|
### tsconfig
|
|
62
69
|
|
|
@@ -152,7 +159,7 @@ Preview the next version or the unreleased changelog section with `release-it --
|
|
|
152
159
|
|
|
153
160
|
### lefthook
|
|
154
161
|
|
|
155
|
-
`lefthook.base.yaml` runs `
|
|
162
|
+
`lefthook.base.yaml` runs `bunx bask build` on pre-commit and `commitlint` on commit-msg. Extend it from your `lefthook.yaml`:
|
|
156
163
|
|
|
157
164
|
```yaml
|
|
158
165
|
# lefthook.yaml
|
|
@@ -160,11 +167,11 @@ extends:
|
|
|
160
167
|
- node_modules/@adamhl8/configs/dist/configs/lefthook.base.yaml
|
|
161
168
|
```
|
|
162
169
|
|
|
163
|
-
`lefthook install` (the base
|
|
170
|
+
`lefthook install` (the base `prepare` task runs it) sets up the hooks. `prepare` skips it in CI (when `CI` is set), so commits made by the workflows don't run the hooks.
|
|
164
171
|
|
|
165
172
|
### bunfig
|
|
166
173
|
|
|
167
|
-
bun has no extends mechanism for `bunfig.toml`, so shared settings are synced into the project's `bunfig.toml`. The base
|
|
174
|
+
bun has no extends mechanism for `bunfig.toml`, so shared settings are synced into the project's `bunfig.toml`. The base `prepare` task runs the `adamhl8-bunfig` bin, which merges the shared base config (`bunfig.base.toml`) with the project's `bunfig.toml` and writes the result back. The project's values win over the base's, and a project without a `bunfig.toml` gets the base config as-is.
|
|
168
175
|
|
|
169
176
|
The base config turns on coverage for `bun test` (showing only failures), runs `**/*.test.ts` files concurrently, ignores `fixtures/` directories, uses the isolated install linker, and makes `bun run` run scripts with bun instead of node.
|
|
170
177
|
|
|
@@ -172,7 +179,7 @@ Since the file is regenerated from the merged config, comments in `bunfig.toml`
|
|
|
172
179
|
|
|
173
180
|
### gitignore
|
|
174
181
|
|
|
175
|
-
git has no include mechanism for `.gitignore`, so shared entries are synced into the project's `.gitignore`. The base
|
|
182
|
+
git has no include mechanism for `.gitignore`, so shared entries are synced into the project's `.gitignore`. The base `prepare` task runs the `adamhl8-gitignore` bin, which keeps the shared list at the top of the file above a marker line: the first run prepends it, later runs replace everything above the marker with the current shared list, so changes propagate on package updates:
|
|
176
183
|
|
|
177
184
|
```gitignore
|
|
178
185
|
node_modules/
|
|
@@ -205,7 +212,7 @@ export const env = parseEnv({
|
|
|
205
212
|
|
|
206
213
|
## GitHub Actions
|
|
207
214
|
|
|
208
|
-
This repo hosts three reusable workflows you can call from other projects instead of copy/pasting them. The calling project must use `bun`, have a `
|
|
215
|
+
This repo hosts three reusable workflows you can call from other projects instead of copy/pasting them. The calling project must use `bun`, have a `bask.ts` that re-exports the base tasks (see [bask](#bask)), and have a commitlint config (e.g. via these configs). The workflows set up bun themselves.
|
|
209
216
|
|
|
210
217
|
- `ci.yml`: runs `build` (build + lint) on pushes/PRs and lints commit messages with commitlint
|
|
211
218
|
- `update-deps.yml`: weekly `bump-deps` run that opens a dependency-update PR
|
|
@@ -227,7 +234,7 @@ jobs:
|
|
|
227
234
|
uses: adamhl8/configs/.github/workflows/ci.yml@main
|
|
228
235
|
```
|
|
229
236
|
|
|
230
|
-
The `
|
|
237
|
+
The `bunx bask build` step runs with `GITHUB_TOKEN` set, for builds that call the GitHub API. It comes from the optional `GH_TOKEN` secret (see [Secrets](#secrets)): the names differ because Actions secrets can't be named `GITHUB_*`, so a build reading `GITHUB_TOKEN` can't be fed by a secret of the same name.
|
|
231
238
|
|
|
232
239
|
When the secret is unset it falls back to the workflow's auto-provisioned token, so fork PRs (which receive no secrets) still build. To supply your own token, pass it. Prefer naming it over `secrets: inherit` here: CI runs on every PR, so it shouldn't be handed the release and deploy secrets it never uses.
|
|
233
240
|
|
|
@@ -258,9 +265,9 @@ jobs:
|
|
|
258
265
|
|
|
259
266
|
### Release
|
|
260
267
|
|
|
261
|
-
Manually dispatched. `release-it` uses git-cliff (via `release-it-git-cliff`, see [release-it](#release-it)) to compute the next version from the commits, then bumps `package.json`, regenerates the changelog, commits and tags (both SSH-signed), publishes to npm, and cuts a GitHub release. There is no automatic trigger, so run it when a release is ready (the `release`
|
|
268
|
+
Manually dispatched. `release-it` uses git-cliff (via `release-it-git-cliff`, see [release-it](#release-it)) to compute the next version from the commits, then bumps `package.json`, regenerates the changelog, commits and tags (both SSH-signed), publishes to npm, and cuts a GitHub release. There is no automatic trigger, so run it when a release is ready (the `release` task just does `gh workflow run release.yml`). A dispatch with no releasable commits fails fast because the plugin finds nothing to release.
|
|
262
269
|
|
|
263
|
-
Needs the `NPM_CI_TOKEN` and `CI_SIGNING_KEY` secrets (see [Secrets](#secrets)). The workflow installs git-cliff and runs the base
|
|
270
|
+
Needs the `NPM_CI_TOKEN` and `CI_SIGNING_KEY` secrets (see [Secrets](#secrets)). The workflow installs git-cliff and runs the base `release-run` task: `release-it --ci`.
|
|
264
271
|
|
|
265
272
|
```yaml
|
|
266
273
|
# .github/workflows/release.yml
|
|
@@ -312,6 +319,6 @@ Configure these on each repo that uses the workflows (Settings -> Secrets and va
|
|
|
312
319
|
|
|
313
320
|
## Notes
|
|
314
321
|
|
|
315
|
-
The `prepare` script is `"prepare": "
|
|
322
|
+
The `prepare` script is `"prepare": "bunx bask prepare"`, which runs the base `prepare` task (`lefthook install` outside CI, the `.gitignore` sync, and the `bunfig.toml` sync).
|
|
316
323
|
|
|
317
|
-
bun links a dependency's `package.json` bin executables into the local `node_modules/.bin`, but not the bins of the package being developed itself. This repo depends on itself (`"@adamhl8/configs": "file:."`) so that its own bins can be run directly, e.g. `adamhl8-bunfig` instead of `src/adamhl8-bunfig/index.ts`. That's also why this repo
|
|
324
|
+
bun links a dependency's `package.json` bin executables into the local `node_modules/.bin`, but not the bins of the package being developed itself. This repo depends on itself (`"@adamhl8/configs": "file:."`) so that its own bins can be run directly, e.g. `adamhl8-bunfig` instead of `src/adamhl8-bunfig/index.ts`. That's also why this repo's `bask.ts` runs `tsdown` before the `prepare` task: the bins point at `dist/`, so those builds need to be available.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/configs/bask.base.d.ts
|
|
2
|
+
export declare const tofuCheck: import("@adamhl8/bask").Task;
|
|
3
|
+
export declare const prepare: import("@adamhl8/bask").Task;
|
|
4
|
+
export declare const bumpDeps: import("@adamhl8/bask").Task;
|
|
5
|
+
export declare const test: import("@adamhl8/bask").Task;
|
|
6
|
+
export declare const lint: import("@adamhl8/bask").Task;
|
|
7
|
+
export declare const build: import("@adamhl8/bask").Task;
|
|
8
|
+
export declare const release: import("@adamhl8/bask").Task;
|
|
9
|
+
export declare const releaseRun: import("@adamhl8/bask").Task;
|
|
10
|
+
export declare const commitTypes: import("@adamhl8/bask").Task;
|
|
11
|
+
//#endregion
|
|
12
|
+
//# sourceMappingURL=bask.base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bask.base.d.ts","names":[],"sources":["../../src/configs/bask.base.ts"],"mappings":";qBAuBa,mCAAS;qBAIT,iCAAO;qBASP,kCAAQ;qBAOR,8BAAI;qBAIJ,8BAAI;qBAmBJ,+BAAK;qBAYL,iCAAO;qBAIP,oCAAU;qBAIV,qCAAW"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { list, task } from "@adamhl8/bask";
|
|
3
|
+
import bun, { $, Glob } from "bun";
|
|
4
|
+
//#region src/configs/bask.base.ts
|
|
5
|
+
const inCi = Boolean(process.env["CI"]);
|
|
6
|
+
/** Lists tracked and untracked files matching the pathspecs, skipping gitignored ones. */
|
|
7
|
+
const lsFiles = async (pathspecs) => {
|
|
8
|
+
return (await $`git ls-files -z --cached --others --exclude-standard -- ${pathspecs}`.quiet().text()).split("\0").filter(Boolean);
|
|
9
|
+
};
|
|
10
|
+
/** Checks that we're not in CI, the repo has a root tofu module, and the aws profile exists on this machine. */
|
|
11
|
+
const canRunTofu = async () => {
|
|
12
|
+
if (inCi) return false;
|
|
13
|
+
if ((await Array.fromAsync(new Glob("*.tofu").scan())).length === 0) return false;
|
|
14
|
+
return (await $`aws configure list-profiles`.nothrow().quiet().text()).split("\n").includes("adamhl8");
|
|
15
|
+
};
|
|
16
|
+
const tofuCheck = task(async ({ sh }) => {
|
|
17
|
+
if (await canRunTofu()) await sh`tofu plan -detailed-exitcode -concise -compact-warnings`;
|
|
18
|
+
});
|
|
19
|
+
const prepare = task(async ({ sh }) => {
|
|
20
|
+
if (!inCi) await sh`lefthook install`;
|
|
21
|
+
await sh`bun adamhl8-gitignore`;
|
|
22
|
+
await sh`bun adamhl8-bunfig`;
|
|
23
|
+
await sh`bun oxfmt bunfig.toml`;
|
|
24
|
+
if (await canRunTofu()) await sh`tofu init -upgrade`;
|
|
25
|
+
});
|
|
26
|
+
const bumpDeps = task(async ({ sh }) => {
|
|
27
|
+
await sh`bunx npm-check-updates --upgrade --format group`;
|
|
28
|
+
await sh`rm -f bun.lock`;
|
|
29
|
+
await sh`rm -rf node_modules/`;
|
|
30
|
+
await sh`bun install --no-summary --no-cache`;
|
|
31
|
+
});
|
|
32
|
+
const test = task(async () => {
|
|
33
|
+
await $`bun test --pass-with-no-tests`;
|
|
34
|
+
});
|
|
35
|
+
const lint = task(async ({ sh }) => {
|
|
36
|
+
await sh`bun markdown-toc -i --bullets - --maxdepth 3 ./README.md`;
|
|
37
|
+
await sh`bun oxlint --fix --fix-suggestions --fix-dangerously`;
|
|
38
|
+
await sh`bun oxfmt`;
|
|
39
|
+
const tofuFiles = await lsFiles([
|
|
40
|
+
":(glob)**/*.tf",
|
|
41
|
+
":(glob)**/*.tofu",
|
|
42
|
+
":(glob)**/*.tfvars",
|
|
43
|
+
":(glob)**/*.tftest.hcl",
|
|
44
|
+
":(glob)**/*.tofutest.hcl"
|
|
45
|
+
]);
|
|
46
|
+
if (tofuFiles.length > 0) await sh`tofu fmt ${tofuFiles}`;
|
|
47
|
+
await sh`bun knip-bun`;
|
|
48
|
+
if (existsSync(".github/workflows")) await sh`actionlint`;
|
|
49
|
+
await test();
|
|
50
|
+
});
|
|
51
|
+
const build = task(async ({ sh }) => {
|
|
52
|
+
await lint();
|
|
53
|
+
if (await bun.file("tsdown.config.ts").exists()) await sh`bun tsdown`;
|
|
54
|
+
if (inCi) {
|
|
55
|
+
await sh`git add --intent-to-add --all`;
|
|
56
|
+
await sh`git diff --exit-code`;
|
|
57
|
+
}
|
|
58
|
+
await tofuCheck();
|
|
59
|
+
});
|
|
60
|
+
const release = task(async ({ sh }) => {
|
|
61
|
+
await sh`gh workflow run release.yml`;
|
|
62
|
+
});
|
|
63
|
+
const releaseRun = task({ hidden: true }, async ({ sh }) => {
|
|
64
|
+
await sh`bun release-it -VV --ci`;
|
|
65
|
+
});
|
|
66
|
+
const commitTypes = task(async () => {
|
|
67
|
+
const { 2: types } = (await $`bun commitlint --print-config json`.quiet().json()).rules["type-enum"];
|
|
68
|
+
console.log(`Commit types:\n ${types.join("\n ")}`);
|
|
69
|
+
});
|
|
70
|
+
list.after(async () => {
|
|
71
|
+
console.log();
|
|
72
|
+
await commitTypes();
|
|
73
|
+
});
|
|
74
|
+
//#endregion
|
|
75
|
+
export { build, bumpDeps, commitTypes, lint, prepare, release, releaseRun, test, tofuCheck };
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=bask.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bask.base.js","names":[],"sources":["../../src/configs/bask.base.ts"],"sourcesContent":["import { existsSync } from \"node:fs\"\n\nimport { list, task } from \"@adamhl8/bask\"\nimport bun, { $, Glob } from \"bun\"\n\n// oxlint-disable-next-line node/no-process-env\nconst inCi = Boolean(process.env[\"CI\"])\n\n/** Lists tracked and untracked files matching the pathspecs, skipping gitignored ones. */\nconst lsFiles = async (pathspecs: string[]) => {\n const output = await $`git ls-files -z --cached --others --exclude-standard -- ${pathspecs}`.quiet().text()\n return output.split(\"\\0\").filter(Boolean)\n}\n\n/** Checks that we're not in CI, the repo has a root tofu module, and the aws profile exists on this machine. */\nconst canRunTofu = async () => {\n if (inCi) return false\n const tofuFiles = await Array.fromAsync(new Glob(\"*.tofu\").scan())\n if (tofuFiles.length === 0) return false\n const profiles = await $`aws configure list-profiles`.nothrow().quiet().text()\n return profiles.split(\"\\n\").includes(\"adamhl8\")\n}\n\nexport const tofuCheck = task(async ({ sh }) => {\n if (await canRunTofu()) await sh`tofu plan -detailed-exitcode -concise -compact-warnings`\n})\n\nexport const prepare = task(async ({ sh }) => {\n // Skip `lefthook install` in CI so commits made by the workflows don't run the hooks.\n if (!inCi) await sh`lefthook install`\n await sh`bun adamhl8-gitignore`\n await sh`bun adamhl8-bunfig`\n await sh`bun oxfmt bunfig.toml`\n if (await canRunTofu()) await sh`tofu init -upgrade`\n})\n\nexport const bumpDeps = task(async ({ sh }) => {\n await sh`bunx npm-check-updates --upgrade --format group`\n await sh`rm -f bun.lock`\n await sh`rm -rf node_modules/`\n await sh`bun install --no-summary --no-cache`\n})\n\nexport const test = task(async () => {\n await $`bun test --pass-with-no-tests`\n})\n\nexport const lint = task(async ({ sh }) => {\n await sh`bun markdown-toc -i --bullets - --maxdepth 3 ./README.md`\n await sh`bun oxlint --fix --fix-suggestions --fix-dangerously`\n await sh`bun oxfmt`\n\n const tofuFiles = await lsFiles([\n \":(glob)**/*.tf\",\n \":(glob)**/*.tofu\",\n \":(glob)**/*.tfvars\",\n \":(glob)**/*.tftest.hcl\",\n \":(glob)**/*.tofutest.hcl\",\n ])\n if (tofuFiles.length > 0) await sh`tofu fmt ${tofuFiles}`\n\n await sh`bun knip-bun`\n if (existsSync(\".github/workflows\")) await sh`actionlint`\n await test()\n})\n\nexport const build = task(async ({ sh }) => {\n await lint()\n if (await bun.file(\"tsdown.config.ts\").exists()) await sh`bun tsdown`\n // Fail in CI if the build changed or created any files, because lint fixes and formatting are applied in place.\n // `--intent-to-add` makes untracked files show up in the diff.\n if (inCi) {\n await sh`git add --intent-to-add --all`\n await sh`git diff --exit-code`\n }\n await tofuCheck()\n})\n\nexport const release = task(async ({ sh }) => {\n await sh`gh workflow run release.yml`\n})\n\nexport const releaseRun = task({ hidden: true }, async ({ sh }) => {\n await sh`bun release-it -VV --ci`\n})\n\nexport const commitTypes = task(async () => {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n const config = (await $`bun commitlint --print-config json`.quiet().json()) as {\n rules: { \"type-enum\": [number, string, string[]] }\n }\n const { 2: types } = config.rules[\"type-enum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AAM,EAAE,YAAY;CAE9C,MAAM,EAAE;CACR,IAAI,WAAW,mBAAmB,GAAG,MAAM,EAAE;CAC7C,MAAM,KAAK;AACb,CAAC;AAED,MAAa,QAAQ,KAAK,OAAO,EAAE,SAAS;CAC1C,MAAM,KAAK;CACX,IAAI,MAAM,IAAI,KAAK,kBAAkB,CAAC,CAAC,OAAO,GAAG,MAAM,EAAE;CAGzD,IAAI,MAAM;EACR,MAAM,EAAE;EACR,MAAM,EAAE;CACV;CACA,MAAM,UAAU;AAClB,CAAC;AAED,MAAa,UAAU,KAAK,OAAO,EAAE,SAAS;CAC5C,MAAM,EAAE;AACV,CAAC;AAED,MAAa,aAAa,KAAK,EAAE,QAAQ,KAAK,GAAG,OAAO,EAAE,SAAS;CACjE,MAAM,EAAE;AACV,CAAC;AAED,MAAa,cAAc,KAAK,YAAY;CAK1C,MAAM,EAAE,GAAG,WAAU,MAHC,CAAC,qCAAqC,MAAM,CAAC,CAAC,KAAK,EAAA,CAG7C,MAAM;CAClC,QAAQ,IAAI,sBAAsB,MAAM,KAAK,QAAQ,GAAG;AAC1D,CAAC;AAED,KAAK,MAAM,YAAY;CACrB,QAAQ,IAAI;CACZ,MAAM,YAAY;AACpB,CAAC"}
|
|
@@ -3,9 +3,8 @@ import { KnipConfig } from "knip";
|
|
|
3
3
|
//#region src/configs/knip.base.d.ts
|
|
4
4
|
export declare const knipConfig: OptionalMergeConfigFn<KnipConfig, {
|
|
5
5
|
readonly project: ["**/*"];
|
|
6
|
-
readonly ignoreBinaries: ["just"];
|
|
7
6
|
readonly bun: {
|
|
8
|
-
readonly entry: ["**/*.test.ts"];
|
|
7
|
+
readonly entry: ["**/*.test.ts", "bask.ts"];
|
|
9
8
|
};
|
|
10
9
|
}>;
|
|
11
10
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip.base.d.ts","names":["_$_merge_config_merge_config_ts0.OptionalMergeConfigFn"],"sources":["../../src/configs/knip.base.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"knip.base.d.ts","names":["_$_merge_config_merge_config_ts0.OptionalMergeConfigFn"],"sources":["../../src/configs/knip.base.ts"],"mappings":";;;qBAaa,YAAUA,sBAAA;;;aAJnB"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { createMergeConfigFn } from "../merge-config/merge-config.js";
|
|
2
2
|
const knipConfig = createMergeConfigFn({
|
|
3
3
|
project: ["**/*"],
|
|
4
|
-
|
|
5
|
-
bun: { entry: ["**/*.test.ts"] }
|
|
4
|
+
bun: { entry: ["**/*.test.ts", "bask.ts"] }
|
|
6
5
|
});
|
|
7
6
|
//#endregion
|
|
8
7
|
export { 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 \"#merge-config/merge-config.ts\"\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 \"#merge-config/merge-config.ts\"\n\nconst baseConfig = {\n project: [\"**/*\"],\n bun: {\n // List `bask.ts` because bask loads it by path and nothing imports it.\n // Add it here because a top-level `entry` replaces knip's default entries.\n entry: [\"**/*.test.ts\", \"bask.ts\"],\n },\n} as const satisfies KnipConfig\n\nexport const knipConfig = createMergeConfigFn<KnipConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";AAaA,MAAa,aAAa,oBAAmD;CAR3E,SAAS,CAAC,MAAM;CAChB,KAAK,EAGH,OAAO,CAAC,gBAAgB,SAAS,EACnC;AAG2E,CAAU"}
|
|
@@ -23,6 +23,12 @@ export declare const oxlintConfig: OptionalMergeConfigFn<OxlintConfig, {
|
|
|
23
23
|
readonly rules: {
|
|
24
24
|
readonly "import/no-default-export": "off";
|
|
25
25
|
};
|
|
26
|
+
}, {
|
|
27
|
+
readonly files: ["bask.ts"];
|
|
28
|
+
readonly rules: {
|
|
29
|
+
readonly "clean-modules/require-direct-exports": "off";
|
|
30
|
+
readonly "import/export": "off";
|
|
31
|
+
};
|
|
26
32
|
}, {
|
|
27
33
|
readonly files: [".release-it.ts"];
|
|
28
34
|
readonly rules: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.base.d.ts","names":["_$_merge_config_merge_config_ts0.OptionalMergeConfigFn"],"sources":["../../src/configs/oxlint.base.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"oxlint.base.d.ts","names":["_$_merge_config_merge_config_ts0.OptionalMergeConfigFn"],"sources":["../../src/configs/oxlint.base.ts"],"mappings":";;;qBAgKa,cAAYA,sBAAA;;aAzJrB;aACA;aACA;;;aAIA;aACA;aACA;aACA;aACA;aACA;aACA;;;;;;;eAkCI;;;;;eAMA;eACA;;;;;eAMA;;;;;;;mBAMqD;;;;;;aAMjB;aACG;aACF;;;;eAIe;eAA4B;eAAiB;;;eAClD;;;;iBAItC;iBAAiB;;;;;;aAKN;aACX;aACU;aACC;aACG;aACD;aACE;aACG;aACC;aACX;aACE;aACE;aACD;aACX;aACa;aACR;aACJ;aACC;aACS;aACF;aACF;aACL;aACD;aACF;aACI;aACK;aACV;aACa;aACR;aACW;aAChB;aACW;aACM;aACK;aACD;aACA;aACT;aACE;aACG;aACX;aACD;aACH;aACmB;aACY;aACC;aACC;aACL;aACF;aACE;aACH;aACX;aACI;aACD;aACX;aACmB;aACG;aACN;aACO;aACT;aACJ;aACC;aACP;aACQ"}
|
|
@@ -45,6 +45,13 @@ const baseConfig = {
|
|
|
45
45
|
],
|
|
46
46
|
rules: { "import/no-default-export": "off" }
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
files: ["bask.ts"],
|
|
50
|
+
rules: {
|
|
51
|
+
"clean-modules/require-direct-exports": "off",
|
|
52
|
+
"import/export": "off"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
48
55
|
{
|
|
49
56
|
files: [".release-it.ts"],
|
|
50
57
|
rules: { "no-template-curly-in-string": "off" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.base.js","names":[],"sources":["../../src/configs/oxlint.base.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\"\n\nimport { createMergeConfigFn } from \"#merge-config/merge-config.ts\"\nimport { resolvePackagePath } from \"#utils.ts\"\n\nconst baseConfig = {\n options: {\n reportUnusedDisableDirectives: \"error\",\n typeAware: true,\n typeCheck: true,\n },\n\n categories: {\n correctness: \"error\",\n nursery: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n restriction: \"error\",\n style: \"error\",\n suspicious: \"error\",\n },\n\n plugins: [\n \"eslint\",\n \"react\",\n \"unicorn\",\n \"typescript\",\n \"oxc\",\n \"import\",\n \"jsdoc\",\n \"vitest\",\n \"jsx-a11y\",\n \"react-perf\",\n \"promise\",\n \"node\",\n ],\n\n // Resolve to an absolute path so consumers load it from this package's own deps.\n jsPlugins: [resolvePackagePath(\"@adamhl8/eslint-plugin-clean-modules\")],\n\n overrides: [\n {\n files: [\n \".release-it.ts\",\n \"astro.config.ts\",\n \"commitlint.config.ts\",\n \"knip.ts\",\n \"oxfmt.config.ts\",\n \"oxlint.config.ts\",\n \"prisma.config.ts\",\n \"tsdown.config.ts\",\n ],\n rules: {\n \"import/no-default-export\": \"off\",\n },\n },\n {\n files: [\".release-it.ts\"],\n rules: {\n \"no-template-curly-in-string\": \"off\",\n },\n },\n {\n files: [\"**/*.tsx\"],\n rules: {\n \"func-style\": [\"error\", \"expression\", { overrides: { namedExports: \"ignore\" } }],\n },\n },\n ],\n\n rules: {\n \"clean-modules/require-direct-exports\": \"error\",\n \"clean-modules/require-import-extensions\": \"error\",\n \"clean-modules/require-subpath-imports\": \"error\",\n\n curly: [\"error\", \"multi-or-nest\"],\n \"func-style\": [\"error\", \"expression\"],\n \"react/jsx-curly-brace-presence\": [\"error\", { children: \"never\", propElementValues: \"always\", props: \"never\" }],\n \"require-unicode-regexp\": [\"error\", { requireFlag: \"v\" }],\n \"unicorn/filename-case\": [\n \"error\",\n {\n cases: { kebabCase: true, pascalCase: true },\n },\n ],\n \"unicorn/no-useless-undefined\": [\"error\", { checkArguments: false }],\n\n \"capitalized-comments\": \"off\",\n \"id-length\": \"off\",\n \"import/exports-last\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/max-dependencies\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"import/no-unassigned-import\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"init-declarations\": \"off\",\n \"jsdoc/require-param\": \"off\",\n \"jsdoc/require-returns\": \"off\",\n \"max-classes-per-file\": \"off\",\n \"max-lines\": \"off\",\n \"max-lines-per-function\": \"off\",\n \"max-statements\": \"off\",\n \"no-console\": \"off\",\n \"no-continue\": \"off\",\n \"no-duplicate-imports\": \"off\",\n \"no-inline-comments\": \"off\",\n \"no-magic-numbers\": \"off\",\n \"no-plusplus\": \"off\",\n \"no-ternary\": \"off\",\n \"no-undef\": \"off\",\n \"no-undefined\": \"off\",\n \"no-useless-return\": \"off\",\n \"no-void\": \"off\",\n \"node/callback-return\": \"off\",\n \"node/no-sync\": \"off\",\n \"node/no-top-level-await\": \"off\",\n \"one-var\": \"off\",\n \"oxc/no-async-await\": \"off\",\n \"oxc/no-optional-chaining\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"react/forbid-component-props\": \"off\",\n \"react/jsx-filename-extension\": \"off\",\n \"react/jsx-max-depth\": \"off\",\n \"react/jsx-no-literals\": \"off\",\n \"react/react-in-jsx-scope\": \"off\",\n \"require-await\": \"off\",\n \"sort-imports\": \"off\",\n \"sort-keys\": \"off\",\n \"typescript/consistent-return\": \"off\",\n \"typescript/explicit-function-return-type\": \"off\",\n \"typescript/explicit-module-boundary-types\": \"off\",\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"typescript/strict-boolean-expressions\": \"off\",\n \"unicorn/no-array-callback-reference\": \"off\",\n \"unicorn/no-array-method-this-argument\": \"off\",\n \"unicorn/no-await-expression-member\": \"off\",\n \"unicorn/no-process-exit\": \"off\",\n \"unicorn/number-literal-case\": \"off\",\n \"unicorn/switch-case-braces\": \"off\",\n \"vitest/no-hooks\": \"off\",\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/prefer-describe-function-title\": \"off\",\n \"vitest/prefer-expect-assertions\": \"off\",\n \"vitest/prefer-importing-vitest-globals\": \"off\",\n \"vitest/prefer-lowercase-title\": \"off\",\n \"vitest/prefer-to-be-falsy\": \"off\",\n \"vitest/prefer-to-be-truthy\": \"off\",\n \"vitest/require-hook\": \"off\", // reenable when false positives are fixed?\n \"vitest/require-test-timeout\": \"off\",\n },\n} as const satisfies OxlintConfig\n\nexport const oxlintConfig = createMergeConfigFn<OxlintConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";;;AAKA,MAAM,aAAa;CACjB,SAAS;EACP,+BAA+B;EAC/B,WAAW;EACX,WAAW;CACb;CAEA,YAAY;EACV,aAAa;EACb,SAAS;EACT,UAAU;EACV,MAAM;EACN,aAAa;EACb,OAAO;EACP,YAAY;CACd;CAEA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CAGA,WAAW,CAAC,mBAAmB,sCAAsC,CAAC;CAEtE,WAAW;EACT;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,OAAO,EACL,4BAA4B,MAC9B;EACF;EACA;GACE,OAAO,CAAC,gBAAgB;GACxB,OAAO,EACL,+BAA+B,MACjC;EACF;EACA;GACE,OAAO,CAAC,UAAU;GAClB,OAAO,EACL,cAAc;IAAC;IAAS;IAAc,EAAE,WAAW,EAAE,cAAc,SAAS,EAAE;GAAC,EACjF;EACF;CACF;CAEA,OAAO;EACL,wCAAwC;EACxC,2CAA2C;EAC3C,yCAAyC;EAEzC,OAAO,CA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BAAqD,UAAU"}
|
|
1
|
+
{"version":3,"file":"oxlint.base.js","names":[],"sources":["../../src/configs/oxlint.base.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\"\n\nimport { createMergeConfigFn } from \"#merge-config/merge-config.ts\"\nimport { resolvePackagePath } from \"#utils.ts\"\n\nconst baseConfig = {\n options: {\n reportUnusedDisableDirectives: \"error\",\n typeAware: true,\n typeCheck: true,\n },\n\n categories: {\n correctness: \"error\",\n nursery: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n restriction: \"error\",\n style: \"error\",\n suspicious: \"error\",\n },\n\n plugins: [\n \"eslint\",\n \"react\",\n \"unicorn\",\n \"typescript\",\n \"oxc\",\n \"import\",\n \"jsdoc\",\n \"vitest\",\n \"jsx-a11y\",\n \"react-perf\",\n \"promise\",\n \"node\",\n ],\n\n // Resolve to an absolute path so consumers load it from this package's own deps.\n jsPlugins: [resolvePackagePath(\"@adamhl8/eslint-plugin-clean-modules\")],\n\n overrides: [\n {\n files: [\n \".release-it.ts\",\n \"astro.config.ts\",\n \"commitlint.config.ts\",\n \"knip.ts\",\n \"oxfmt.config.ts\",\n \"oxlint.config.ts\",\n \"prisma.config.ts\",\n \"tsdown.config.ts\",\n ],\n rules: {\n \"import/no-default-export\": \"off\",\n },\n },\n {\n files: [\"bask.ts\"],\n rules: {\n \"clean-modules/require-direct-exports\": \"off\",\n \"import/export\": \"off\",\n },\n },\n {\n files: [\".release-it.ts\"],\n rules: {\n \"no-template-curly-in-string\": \"off\",\n },\n },\n {\n files: [\"**/*.tsx\"],\n rules: {\n \"func-style\": [\"error\", \"expression\", { overrides: { namedExports: \"ignore\" } }],\n },\n },\n ],\n\n rules: {\n \"clean-modules/require-direct-exports\": \"error\",\n \"clean-modules/require-import-extensions\": \"error\",\n \"clean-modules/require-subpath-imports\": \"error\",\n\n curly: [\"error\", \"multi-or-nest\"],\n \"func-style\": [\"error\", \"expression\"],\n \"react/jsx-curly-brace-presence\": [\"error\", { children: \"never\", propElementValues: \"always\", props: \"never\" }],\n \"require-unicode-regexp\": [\"error\", { requireFlag: \"v\" }],\n \"unicorn/filename-case\": [\n \"error\",\n {\n cases: { kebabCase: true, pascalCase: true },\n },\n ],\n \"unicorn/no-useless-undefined\": [\"error\", { checkArguments: false }],\n\n \"capitalized-comments\": \"off\",\n \"id-length\": \"off\",\n \"import/exports-last\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/max-dependencies\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"import/no-unassigned-import\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"init-declarations\": \"off\",\n \"jsdoc/require-param\": \"off\",\n \"jsdoc/require-returns\": \"off\",\n \"max-classes-per-file\": \"off\",\n \"max-lines\": \"off\",\n \"max-lines-per-function\": \"off\",\n \"max-statements\": \"off\",\n \"no-console\": \"off\",\n \"no-continue\": \"off\",\n \"no-duplicate-imports\": \"off\",\n \"no-inline-comments\": \"off\",\n \"no-magic-numbers\": \"off\",\n \"no-plusplus\": \"off\",\n \"no-ternary\": \"off\",\n \"no-undef\": \"off\",\n \"no-undefined\": \"off\",\n \"no-useless-return\": \"off\",\n \"no-void\": \"off\",\n \"node/callback-return\": \"off\",\n \"node/no-sync\": \"off\",\n \"node/no-top-level-await\": \"off\",\n \"one-var\": \"off\",\n \"oxc/no-async-await\": \"off\",\n \"oxc/no-optional-chaining\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"react/forbid-component-props\": \"off\",\n \"react/jsx-filename-extension\": \"off\",\n \"react/jsx-max-depth\": \"off\",\n \"react/jsx-no-literals\": \"off\",\n \"react/react-in-jsx-scope\": \"off\",\n \"require-await\": \"off\",\n \"sort-imports\": \"off\",\n \"sort-keys\": \"off\",\n \"typescript/consistent-return\": \"off\",\n \"typescript/explicit-function-return-type\": \"off\",\n \"typescript/explicit-module-boundary-types\": \"off\",\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"typescript/strict-boolean-expressions\": \"off\",\n \"unicorn/no-array-callback-reference\": \"off\",\n \"unicorn/no-array-method-this-argument\": \"off\",\n \"unicorn/no-await-expression-member\": \"off\",\n \"unicorn/no-process-exit\": \"off\",\n \"unicorn/number-literal-case\": \"off\",\n \"unicorn/switch-case-braces\": \"off\",\n \"vitest/no-hooks\": \"off\",\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/prefer-describe-function-title\": \"off\",\n \"vitest/prefer-expect-assertions\": \"off\",\n \"vitest/prefer-importing-vitest-globals\": \"off\",\n \"vitest/prefer-lowercase-title\": \"off\",\n \"vitest/prefer-to-be-falsy\": \"off\",\n \"vitest/prefer-to-be-truthy\": \"off\",\n \"vitest/require-hook\": \"off\", // reenable when false positives are fixed?\n \"vitest/require-test-timeout\": \"off\",\n },\n} as const satisfies OxlintConfig\n\nexport const oxlintConfig = createMergeConfigFn<OxlintConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";;;AAKA,MAAM,aAAa;CACjB,SAAS;EACP,+BAA+B;EAC/B,WAAW;EACX,WAAW;CACb;CAEA,YAAY;EACV,aAAa;EACb,SAAS;EACT,UAAU;EACV,MAAM;EACN,aAAa;EACb,OAAO;EACP,YAAY;CACd;CAEA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CAGA,WAAW,CAAC,mBAAmB,sCAAsC,CAAC;CAEtE,WAAW;EACT;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,OAAO,EACL,4BAA4B,MAC9B;EACF;EACA;GACE,OAAO,CAAC,SAAS;GACjB,OAAO;IACL,wCAAwC;IACxC,iBAAiB;GACnB;EACF;EACA;GACE,OAAO,CAAC,gBAAgB;GACxB,OAAO,EACL,+BAA+B,MACjC;EACF;EACA;GACE,OAAO,CAAC,UAAU;GAClB,OAAO,EACL,cAAc;IAAC;IAAS;IAAc,EAAE,WAAW,EAAE,cAAc,SAAS,EAAE;GAAC,EACjF;E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6B;EAC7B,8BAA8B;EAC9B,uBAAuB;EACvB,+BAA+B;CACjC;AACF;AAEA,MAAa,eAAe,oBAAqD,UAAU"}
|
|
@@ -7,7 +7,7 @@ type ReleaseItConfig = Config & {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const releaseItConfig: OptionalMergeConfigFn<ReleaseItConfig, {
|
|
9
9
|
readonly hooks: {
|
|
10
|
-
readonly "before:init": "
|
|
10
|
+
readonly "before:init": "bunx bask build";
|
|
11
11
|
readonly "after:release-it-git-cliff:beforeRelease": "bun oxfmt CHANGELOG.md";
|
|
12
12
|
};
|
|
13
13
|
readonly plugins: {
|
|
@@ -3,7 +3,7 @@ import { configFilePath } from "../utils.js";
|
|
|
3
3
|
//#region src/configs/release-it.base.ts
|
|
4
4
|
const baseConfig = {
|
|
5
5
|
hooks: {
|
|
6
|
-
"before:init": "
|
|
6
|
+
"before:init": "bunx bask build",
|
|
7
7
|
"after:release-it-git-cliff:beforeRelease": "bun oxfmt CHANGELOG.md"
|
|
8
8
|
},
|
|
9
9
|
plugins: { "release-it-git-cliff": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-it.base.js","names":[],"sources":["../../src/configs/release-it.base.ts"],"sourcesContent":["// oxlint-disable no-template-curly-in-string\nimport type { Config } from \"release-it\"\n\nimport { createMergeConfigFn } from \"#merge-config/merge-config.ts\"\nimport { configFilePath } from \"#utils.ts\"\n\n// release-it's `Hooks` type only lists the hooks of its built-in plugins.\ntype PluginHooks = Partial<Record<`${\"before\" | \"after\"}:${string}`, string | string[]>>\ntype ReleaseItConfig = Config & { hooks?: PluginHooks }\n\nconst baseConfig = {\n hooks: {\n \"before:init\": \"
|
|
1
|
+
{"version":3,"file":"release-it.base.js","names":[],"sources":["../../src/configs/release-it.base.ts"],"sourcesContent":["// oxlint-disable no-template-curly-in-string\nimport type { Config } from \"release-it\"\n\nimport { createMergeConfigFn } from \"#merge-config/merge-config.ts\"\nimport { configFilePath } from \"#utils.ts\"\n\n// release-it's `Hooks` type only lists the hooks of its built-in plugins.\ntype PluginHooks = Partial<Record<`${\"before\" | \"after\"}:${string}`, string | string[]>>\ntype ReleaseItConfig = Config & { hooks?: PluginHooks }\n\nconst baseConfig = {\n hooks: {\n \"before:init\": \"bunx bask build\",\n \"after:release-it-git-cliff:beforeRelease\": \"bun oxfmt CHANGELOG.md\",\n },\n plugins: {\n \"release-it-git-cliff\": {\n config: configFilePath(\"cliff.base.toml\"),\n output: \"CHANGELOG.md\",\n },\n },\n git: {\n commitMessage: \"release: ${tagName}\",\n // Set the `v` explicitly because release-it only detects it from an existing tag.\n tagName: \"v${version}\",\n tagAnnotation: \"release ${tagName}\",\n addUntrackedFiles: true,\n },\n github: {\n release: true,\n releaseName: \"${tagName}\",\n },\n npm: {\n publishPackageManager: \"bun\",\n publishPath: \"\",\n publishArgs: [\"--ignore-scripts\"],\n },\n} as const satisfies ReleaseItConfig\n\nexport const releaseItConfig = createMergeConfigFn<ReleaseItConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";;;AAUA,MAAM,aAAa;CACjB,OAAO;EACL,eAAe;EACf,4CAA4C;CAC9C;CACA,SAAS,EACP,wBAAwB;EACtB,QAAQ,eAAe,iBAAiB;EACxC,QAAQ;CACV,EACF;CACA,KAAK;EACH,eAAe;EAEf,SAAS;EACT,eAAe;EACf,mBAAmB;CACrB;CACA,QAAQ;EACN,SAAS;EACT,aAAa;CACf;CACA,KAAK;EACH,uBAAuB;EACvB,aAAa;EACb,aAAa,CAAC,kBAAkB;CAClC;AACF;AAEA,MAAa,kBAAkB,oBAAwD,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamhl8/configs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "My shared configs for TS projects",
|
|
5
5
|
"homepage": "https://github.com/adamhl8/configs",
|
|
6
6
|
"bugs": {
|
|
@@ -36,13 +36,17 @@
|
|
|
36
36
|
"./env": {
|
|
37
37
|
"types": "./dist/env/index.d.ts",
|
|
38
38
|
"import": "./dist/env/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./bask": {
|
|
41
|
+
"types": "./dist/configs/bask.base.d.ts",
|
|
42
|
+
"import": "./dist/configs/bask.base.js"
|
|
39
43
|
}
|
|
40
44
|
},
|
|
41
45
|
"publishConfig": {
|
|
42
46
|
"access": "public"
|
|
43
47
|
},
|
|
44
48
|
"scripts": {
|
|
45
|
-
"prepare": "
|
|
49
|
+
"prepare": "bunx bask prepare"
|
|
46
50
|
},
|
|
47
51
|
"dependencies": {
|
|
48
52
|
"@adamhl8/eslint-plugin-clean-modules": "^0.1.5",
|
|
@@ -55,6 +59,7 @@
|
|
|
55
59
|
"type-fest": "^5.10.0"
|
|
56
60
|
},
|
|
57
61
|
"devDependencies": {
|
|
62
|
+
"@adamhl8/bask": "^0.1.0",
|
|
58
63
|
"@adamhl8/configs": "file:.",
|
|
59
64
|
"@arethetypeswrong/core": "^0.18.5",
|
|
60
65
|
"@commitlint/cli": "^21.2.3",
|
|
@@ -71,6 +76,7 @@
|
|
|
71
76
|
"typescript": "^7.0.2"
|
|
72
77
|
},
|
|
73
78
|
"peerDependencies": {
|
|
79
|
+
"@adamhl8/bask": ">=0.1",
|
|
74
80
|
"@arethetypeswrong/core": ">=0.18",
|
|
75
81
|
"@commitlint/cli": ">=21",
|
|
76
82
|
"@commitlint/config-conventional": ">=21",
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# user-defined functions are unstable as of just 1.52
|
|
2
|
-
set unstable
|
|
3
|
-
set allow-duplicate-recipes
|
|
4
|
-
|
|
5
|
-
print-command(cmd) := f"echo {{ quote(style("command", cmd)) }}"
|
|
6
|
-
# runs cmd if the condition command succeeds, echoing cmd only when it runs
|
|
7
|
-
run-when(cmd, condition) := f"if {{ condition }}; then {{ print-command(cmd) }}; {{ cmd }}; fi"
|
|
8
|
-
|
|
9
|
-
in-ci := '[ -n "${CI:-}" ]'
|
|
10
|
-
not-in-ci := '[ -z "${CI:-}" ]'
|
|
11
|
-
|
|
12
|
-
# lists tracked and untracked files as NUL-separated paths, skipping gitignored ones
|
|
13
|
-
ls-files := 'git ls-files -z --cached --others --exclude-standard'
|
|
14
|
-
|
|
15
|
-
# run if not in CI, the repo has a root module, and the aws profile exists on this machine
|
|
16
|
-
tofu-run-condition := not-in-ci + ' && ls *.tofu >/dev/null 2>&1 && aws configure list-profiles 2>/dev/null | grep -qx adamhl8'
|
|
17
|
-
|
|
18
|
-
# public recipes are thin wrappers over private _recipes so an override can still call the original
|
|
19
|
-
# e.g. `prepare: _prepare` + extra lines
|
|
20
|
-
|
|
21
|
-
prepare: _prepare
|
|
22
|
-
_prepare:
|
|
23
|
-
@{{ run-when("lefthook install", not-in-ci) }}
|
|
24
|
-
bun adamhl8-gitignore
|
|
25
|
-
bun adamhl8-bunfig
|
|
26
|
-
bun oxfmt bunfig.toml
|
|
27
|
-
@{{ run-when("tofu init -upgrade", tofu-run-condition) }}
|
|
28
|
-
|
|
29
|
-
bump-deps: _bump-deps
|
|
30
|
-
_bump-deps:
|
|
31
|
-
bunx npm-check-updates --upgrade --format group
|
|
32
|
-
rm -f bun.lock
|
|
33
|
-
rm -rf node_modules/
|
|
34
|
-
bun install --no-summary --no-cache
|
|
35
|
-
|
|
36
|
-
tofu-check: _tofu-check
|
|
37
|
-
_tofu-check:
|
|
38
|
-
@{{ run-when("tofu plan -detailed-exitcode -concise -compact-warnings", tofu-run-condition) }}
|
|
39
|
-
|
|
40
|
-
lint: _lint
|
|
41
|
-
_lint:
|
|
42
|
-
bun markdown-toc -i --bullets '-' --maxdepth 3 ./README.md
|
|
43
|
-
bun oxlint --fix --fix-suggestions --fix-dangerously
|
|
44
|
-
bun oxfmt
|
|
45
|
-
|
|
46
|
-
@# format all justfiles, excluding ones that are gitignored
|
|
47
|
-
@{{ ls-files }} ':(glob)**/[Jj]ustfile' ':(glob)**/.justfile' ':(glob)**/*.just' | xargs -0 -r -n1 just --fmt --justfile
|
|
48
|
-
@{{ print-command("just --fmt") }}
|
|
49
|
-
|
|
50
|
-
@# format all tofu files, excluding ones that are gitignored
|
|
51
|
-
@{{ ls-files }} ':(glob)**/*.tf' ':(glob)**/*.tofu' ':(glob)**/*.tfvars' ':(glob)**/*.tftest.hcl' ':(glob)**/*.tofutest.hcl' | xargs -0 -r tofu fmt
|
|
52
|
-
@{{ print-command("tofu fmt") }}
|
|
53
|
-
|
|
54
|
-
bun knip-bun
|
|
55
|
-
@{{ run-when("actionlint", "[ -d .github/workflows ]") }}
|
|
56
|
-
@just test
|
|
57
|
-
|
|
58
|
-
build: _build
|
|
59
|
-
# lint fixes and formatting are applied in place, so in CI fail if the build changed or created any files
|
|
60
|
-
# --intent-to-add makes untracked files show up in the diff
|
|
61
|
-
_build: lint && tofu-check
|
|
62
|
-
@{{ run-when("bun tsdown", "[ -f tsdown.config.ts ]") }}
|
|
63
|
-
@{{ run-when("git add --intent-to-add --all && git diff --exit-code", in-ci) }}
|
|
64
|
-
|
|
65
|
-
test: _test
|
|
66
|
-
_test:
|
|
67
|
-
@bun test --pass-with-no-tests
|
|
68
|
-
|
|
69
|
-
release: _release
|
|
70
|
-
_release:
|
|
71
|
-
gh workflow run release.yml
|
|
72
|
-
|
|
73
|
-
[private]
|
|
74
|
-
release-run: _release-run
|
|
75
|
-
|
|
76
|
-
_release-run:
|
|
77
|
-
bun release-it -VV --ci
|
|
78
|
-
|
|
79
|
-
commit-types: _commit-types
|
|
80
|
-
_commit-types:
|
|
81
|
-
@bun commitlint --print-config json | bun -e 'console.log("Commit types:\n " + (await Bun.stdin.json()).rules["type-enum"][2].join("\n "))'
|
|
82
|
-
|
|
83
|
-
[default]
|
|
84
|
-
_default:
|
|
85
|
-
@{{ just_executable() }} --list
|
|
86
|
-
@echo
|
|
87
|
-
@{{ just_executable() }} commit-types
|