@adamhl8/configs 0.24.4 → 0.24.5
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
|
@@ -110,10 +110,11 @@ extends:
|
|
|
110
110
|
|
|
111
111
|
## GitHub Actions
|
|
112
112
|
|
|
113
|
-
This repo hosts
|
|
113
|
+
This repo hosts three reusable workflows you can call from other projects instead of copy/pasting them. The calling project must use `nub` and define `lint` / `bundle` / `bump-deps` / `release:run` scripts and a commitlint config (e.g. via these configs).
|
|
114
114
|
|
|
115
115
|
- `ci.yml`: runs `bundle` (build + lint) on pushes/PRs and lints commit messages with commitlint
|
|
116
116
|
- `update-deps.yml`: weekly `bump-deps` run that opens a dependency-update PR
|
|
117
|
+
- `release.yml`: manually dispatched release where git-cliff sets the version, then publishes to npm and cuts a GitHub release (commit and tag signed)
|
|
117
118
|
|
|
118
119
|
Reference `@main` for latest, or pin to a release tag or commit SHA to update deliberately.
|
|
119
120
|
|
|
@@ -133,7 +134,7 @@ jobs:
|
|
|
133
134
|
|
|
134
135
|
### Update dependencies
|
|
135
136
|
|
|
136
|
-
|
|
137
|
+
Needs the `CI_TOKEN` secret (see [Secrets](#secrets)).
|
|
137
138
|
|
|
138
139
|
```yaml
|
|
139
140
|
# .github/workflows/update-deps.yml
|
|
@@ -148,6 +149,37 @@ jobs:
|
|
|
148
149
|
secrets: inherit
|
|
149
150
|
```
|
|
150
151
|
|
|
152
|
+
### Release
|
|
153
|
+
|
|
154
|
+
Manually dispatched. git-cliff computes the next version from the commits, then `release-it` 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` script just does `gh workflow run release.yml`). A dispatch with no releasable commits fails fast at release-it's `Version not changed`.
|
|
155
|
+
|
|
156
|
+
Needs the `NPM_CI_TOKEN` and `CI_SIGNING_KEY` secrets (see [Secrets](#secrets)). The calling project must define `release` and `release:run` scripts, where `release:run` is `release-it --ci -i "$(adamhl8-cliff --bumped-version)"`.
|
|
157
|
+
|
|
158
|
+
```yaml
|
|
159
|
+
# .github/workflows/release.yml
|
|
160
|
+
name: Release
|
|
161
|
+
on:
|
|
162
|
+
workflow_dispatch: {}
|
|
163
|
+
jobs:
|
|
164
|
+
release:
|
|
165
|
+
permissions:
|
|
166
|
+
contents: write
|
|
167
|
+
uses: adamhl8/configs/.github/workflows/release.yml@main
|
|
168
|
+
secrets: inherit
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Secrets
|
|
172
|
+
|
|
173
|
+
Configure these on each repo that uses the workflows (Settings -> Secrets and variables -> Actions):
|
|
174
|
+
|
|
175
|
+
| Secret | Used by | What it is |
|
|
176
|
+
| ---------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
177
|
+
| `CI_TOKEN` | `update-deps.yml` | PAT with `contents` and `pull-requests` write, so the opened PR triggers CI |
|
|
178
|
+
| `NPM_CI_TOKEN` | `release.yml` | npm automation token with publish access |
|
|
179
|
+
| `CI_SIGNING_KEY` | `release.yml` | Private SSH key that signs the release commit and tag. Add the matching public key to your GitHub account as a Signing Key so the signature verifies as you. Use a dedicated, passphrase-less key, not your personal auth key. |
|
|
180
|
+
|
|
181
|
+
`GITHUB_TOKEN` is provided automatically. The release wrapper grants it `contents: write` to push the release commit and tag and to create the GitHub release.
|
|
182
|
+
|
|
151
183
|
## Notes
|
|
152
184
|
|
|
153
185
|
The `prepare` script looks like: `"prepare": "lefthook install && nub ./patch-knip.ts && tsdown"`
|
|
@@ -5,7 +5,7 @@ import { KnipConfig } from "knip";
|
|
|
5
5
|
declare const baseConfig: {
|
|
6
6
|
readonly project: ["**"];
|
|
7
7
|
readonly entry: ["./src/index.ts", "**/*.test.ts", "./tsdown.config.ts"];
|
|
8
|
-
readonly ignoreBinaries: ["lefthook"];
|
|
8
|
+
readonly ignoreBinaries: ["lefthook", "gh"];
|
|
9
9
|
readonly ignoreDependencies: string[];
|
|
10
10
|
readonly tsdown: false;
|
|
11
11
|
};
|
|
@@ -15,7 +15,7 @@ const IGNORE_DEPENDENCIES = [...["@commitlint/cli"], ...UNLISTED_DEPENDENCIES];
|
|
|
15
15
|
const knipConfig = createMergeConfigFn({
|
|
16
16
|
project: ["**"],
|
|
17
17
|
entry: DEFAULT_ENTRIES,
|
|
18
|
-
ignoreBinaries: ["lefthook"],
|
|
18
|
+
ignoreBinaries: ["lefthook", "gh"],
|
|
19
19
|
ignoreDependencies: IGNORE_DEPENDENCIES,
|
|
20
20
|
tsdown: false
|
|
21
21
|
});
|
|
@@ -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\"\nimport type { OptionalMergeConfigFn } from \"#/utils.ts\"\n\n// Normally, specifying the `./src/index.ts` entry would cause knip to complain about a redundant entry because it gets automatically included via the tsdown plugin.\n// However, in projects that _don't_ use tsdown, the `./src/index.ts` entry would be missing entirely.\n// To handle this, we specify it and disable the tsdown plugin. This makes knip work in both cases.\n\nexport const DEFAULT_ENTRIES = [\"./src/index.ts\", \"**/*.test.ts\", \"./tsdown.config.ts\"] as const satisfies string[]\n\n/**\n * Consuming projects show these transitive dependencies as unlisted. e.g. knip resolves\n * `@adamhl8/eslint-plugin-clean-modules` via the oxlint config, but we don't need to install it directly in the\n * consuming project.\n */\nconst UNLISTED_DEPENDENCIES = [\"@adamhl8/eslint-plugin-clean-modules\"]\n/**\n * Consuming projects show these dependencies as unused. e.g. `@commitlint/cli` can't be found by knip because it's\n * hidden by the fact that we call/extend our GitHub workflows.\n */\nconst UNUSED_DEPENDENCIES = [\"@commitlint/cli\"]\nexport const IGNORE_DEPENDENCIES = [...UNUSED_DEPENDENCIES, ...UNLISTED_DEPENDENCIES]\n\nconst baseConfig = {\n project: [\"**\"],\n entry: DEFAULT_ENTRIES,\n ignoreBinaries: [\"lefthook\"],\n ignoreDependencies: IGNORE_DEPENDENCIES,\n tsdown: false,\n} as const satisfies KnipConfig\n\nexport const knipConfig: OptionalMergeConfigFn<KnipConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";;AASA,MAAa,kBAAkB;CAAC;CAAkB;CAAgB;AAAoB;;;;;;AAOtF,MAAM,wBAAwB,CAAC,sCAAsC;AAMrE,MAAa,sBAAsB,CAAC,GAAG,CADV,iBACU,GAAqB,GAAG,qBAAqB;AAUpF,MAAa,aAAmE,oBAAoB;CAPlG,SAAS,CAAC,IAAI;CACd,OAAO;CACP,gBAAgB,CAAC,
|
|
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\"\nimport type { OptionalMergeConfigFn } from \"#/utils.ts\"\n\n// Normally, specifying the `./src/index.ts` entry would cause knip to complain about a redundant entry because it gets automatically included via the tsdown plugin.\n// However, in projects that _don't_ use tsdown, the `./src/index.ts` entry would be missing entirely.\n// To handle this, we specify it and disable the tsdown plugin. This makes knip work in both cases.\n\nexport const DEFAULT_ENTRIES = [\"./src/index.ts\", \"**/*.test.ts\", \"./tsdown.config.ts\"] as const satisfies string[]\n\n/**\n * Consuming projects show these transitive dependencies as unlisted. e.g. knip resolves\n * `@adamhl8/eslint-plugin-clean-modules` via the oxlint config, but we don't need to install it directly in the\n * consuming project.\n */\nconst UNLISTED_DEPENDENCIES = [\"@adamhl8/eslint-plugin-clean-modules\"]\n/**\n * Consuming projects show these dependencies as unused. e.g. `@commitlint/cli` can't be found by knip because it's\n * hidden by the fact that we call/extend our GitHub workflows.\n */\nconst UNUSED_DEPENDENCIES = [\"@commitlint/cli\"]\nexport const IGNORE_DEPENDENCIES = [...UNUSED_DEPENDENCIES, ...UNLISTED_DEPENDENCIES]\n\nconst baseConfig = {\n project: [\"**\"],\n entry: DEFAULT_ENTRIES,\n ignoreBinaries: [\"lefthook\", \"gh\"],\n ignoreDependencies: IGNORE_DEPENDENCIES,\n tsdown: false,\n} as const satisfies KnipConfig\n\nexport const knipConfig: OptionalMergeConfigFn<KnipConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";;AASA,MAAa,kBAAkB;CAAC;CAAkB;CAAgB;AAAoB;;;;;;AAOtF,MAAM,wBAAwB,CAAC,sCAAsC;AAMrE,MAAa,sBAAsB,CAAC,GAAG,CADV,iBACU,GAAqB,GAAG,qBAAqB;AAUpF,MAAa,aAAmE,oBAAoB;CAPlG,SAAS,CAAC,IAAI;CACd,OAAO;CACP,gBAAgB,CAAC,YAAY,IAAI;CACjC,oBAAoB;CACpB,QAAQ;AAG0F,CAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamhl8/configs",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.5",
|
|
4
4
|
"homepage": "https://github.com/adamhl8/configs",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/adamhl8/configs/issues"
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"lint": "markdown-toc -i --bullets '-' --maxdepth 3 ./README.md && oxfmt && oxlint --fix --fix-suggestions --fix-dangerously && adamhl8-knip",
|
|
41
41
|
"bump-deps": "nub update -L && rm -f lock.yaml && nub i --no-frozen-lockfile && oxfmt lock.yaml",
|
|
42
42
|
"bundle": "nub run lint && tsdown",
|
|
43
|
-
"release": "
|
|
43
|
+
"release": "gh workflow run release.yml",
|
|
44
|
+
"release:run": "release-it --ci -i \"$(adamhl8-cliff --bumped-version)\"",
|
|
44
45
|
"prepare": "lefthook install && nub ./patch-knip.ts && tsdown"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|