@adamhl8/configs 1.2.0 → 1.3.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
|
@@ -177,6 +177,18 @@ jobs:
|
|
|
177
177
|
uses: adamhl8/configs/.github/workflows/ci.yml@main
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
+
The `just 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.
|
|
181
|
+
|
|
182
|
+
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.
|
|
183
|
+
|
|
184
|
+
```yaml
|
|
185
|
+
jobs:
|
|
186
|
+
ci:
|
|
187
|
+
uses: adamhl8/configs/.github/workflows/ci.yml@main
|
|
188
|
+
secrets:
|
|
189
|
+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
190
|
+
```
|
|
191
|
+
|
|
180
192
|
### Update dependencies
|
|
181
193
|
|
|
182
194
|
Needs the `CI_TOKEN` secret (see [Secrets](#secrets)).
|
|
@@ -220,6 +232,7 @@ Configure these on each repo that uses the workflows (Settings -> Secrets and va
|
|
|
220
232
|
| Secret | Used by | What it is |
|
|
221
233
|
| ---------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
222
234
|
| `CI_TOKEN` | `update-deps.yml` | PAT with `contents` and `pull-requests` write, so the opened PR triggers CI |
|
|
235
|
+
| `GH_TOKEN` | `ci.yml` | Optional. PAT for a build that calls the GitHub API. Reaches the build as `GITHUB_TOKEN`. Unset, the build falls back to the automatic token. |
|
|
223
236
|
| `NPM_CI_TOKEN` | `release.yml` | npm automation token with publish access |
|
|
224
237
|
| `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. |
|
|
225
238
|
|
|
@@ -8,6 +8,9 @@ export PATH := justfile_directory() + "/node_modules/.bin:" + env("PATH")
|
|
|
8
8
|
# runs cmd if the condition command succeeds, echoing cmd only when it runs
|
|
9
9
|
run-when(cmd, condition) := f"if {{condition}}; then echo {{style("command", cmd)}}; {{cmd}}; fi"
|
|
10
10
|
|
|
11
|
+
# run if not in CI, the repo has a root module, and the aws profile exists on this machine
|
|
12
|
+
tofu-run-condition := '[ -z "${CI:-}" ] && ls *.tofu >/dev/null 2>&1 && aws configure list-profiles 2>/dev/null | grep -qx adamhl8'
|
|
13
|
+
|
|
11
14
|
# public recipes are thin wrappers over private _recipes so an override can still call the original
|
|
12
15
|
# e.g. `prepare: _prepare` + extra lines
|
|
13
16
|
|
|
@@ -17,6 +20,7 @@ _prepare:
|
|
|
17
20
|
adamhl8-gitignore
|
|
18
21
|
adamhl8-bunfig
|
|
19
22
|
oxfmt bunfig.toml
|
|
23
|
+
@{{ run-when("tofu init -upgrade", tofu-run-condition) }}
|
|
20
24
|
|
|
21
25
|
bump-deps: _bump-deps
|
|
22
26
|
_bump-deps:
|
|
@@ -27,8 +31,7 @@ _bump-deps:
|
|
|
27
31
|
|
|
28
32
|
tofu-check: _tofu-check
|
|
29
33
|
_tofu-check:
|
|
30
|
-
|
|
31
|
-
@{{ run-when("tofu plan -detailed-exitcode -concise -compact-warnings", '[ -z "${CI:-}" ] && ls *.tofu >/dev/null 2>&1 && aws configure list-profiles 2>/dev/null | grep -qx adamhl8') }}
|
|
34
|
+
@{{ run-when("tofu plan -detailed-exitcode -concise -compact-warnings", tofu-run-condition) }}
|
|
32
35
|
|
|
33
36
|
lint: _lint
|
|
34
37
|
_lint:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdown.base.d.ts","names":[],"sources":["../../src/configs/tsdown.base.ts"],"mappings":";;;;KAOK,mBAAmB,YAAY;cAE9B;;;;;;;;;;aAUF;
|
|
1
|
+
{"version":3,"file":"tsdown.base.d.ts","names":[],"sources":["../../src/configs/tsdown.base.ts"],"mappings":";;;;KAOK,mBAAmB,YAAY;cAE9B;;;;;;;;;;aAUF;aACA;aACA;;;aAGA;;;aAGA;aACA;;;;;cAkBS,cAAc,cAAc,yBAAyB;cAIrD,iBAAe,sBAAA;;;;;;aA1BxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdown.base.js","names":[],"sources":["../../src/configs/tsdown.base.ts"],"sourcesContent":["import type { UserConfig } from \"tsdown\"\nimport type { SetRequired } from \"type-fest\"\n\nimport type { MergeConfigFn } from \"#utils.ts\"\nimport { createMergeConfigFn } from \"#utils.ts\"\n\n// Force projects to specify platform\ntype StrictUserConfig = SetRequired<UserConfig, \"platform\">\n\nconst baseConfig = {\n entry: [\"./src/index.ts\"],\n platform: \"neutral\",\n target: false,\n unbundle: true,\n sourcemap: true,\n minify: \"dce-only\",\n fixedExtension: false,\n hash: false,\n dts: {\n newContext: true,\n
|
|
1
|
+
{"version":3,"file":"tsdown.base.js","names":[],"sources":["../../src/configs/tsdown.base.ts"],"sourcesContent":["import type { UserConfig } from \"tsdown\"\nimport type { SetRequired } from \"type-fest\"\n\nimport type { MergeConfigFn } from \"#utils.ts\"\nimport { createMergeConfigFn } from \"#utils.ts\"\n\n// Force projects to specify platform\ntype StrictUserConfig = SetRequired<UserConfig, \"platform\">\n\nconst baseConfig = {\n entry: [\"./src/index.ts\"],\n platform: \"neutral\",\n target: false,\n unbundle: true,\n sourcemap: true,\n minify: \"dce-only\",\n fixedExtension: false,\n hash: false,\n dts: {\n newContext: true,\n tsgo: true,\n sourcemap: true,\n },\n deps: {\n neverBundle: [\"bun\"],\n },\n attw: {\n level: \"error\",\n profile: \"esm-only\",\n },\n publint: true,\n failOnWarn: true,\n} as const satisfies StrictUserConfig\n\nconst binConfig = {\n ...baseConfig,\n entry: [],\n platform: \"node\",\n unbundle: false,\n sourcemap: false,\n outExtensions: () => ({ js: \"\" }) as const,\n dts: false,\n attw: false,\n} as const satisfies UserConfig\n\n// Annotated as the non-optional MergeConfigFn so projects must pass a config (platform is required)\nexport const tsdownConfig: MergeConfigFn<StrictUserConfig, typeof baseConfig> = createMergeConfigFn<\n StrictUserConfig,\n typeof baseConfig\n>(baseConfig)\nexport const tsdownBinConfig = createMergeConfigFn<UserConfig, typeof binConfig>(binConfig)\n"],"mappings":";;AASA,MAAM,aAAa;CACjB,OAAO,CAAC,gBAAgB;CACxB,UAAU;CACV,QAAQ;CACR,UAAU;CACV,WAAW;CACX,QAAQ;CACR,gBAAgB;CAChB,MAAM;CACN,KAAK;EACH,YAAY;EACZ,MAAM;EACN,WAAW;CACb;CACA,MAAM,EACJ,aAAa,CAAC,KAAK,EACrB;CACA,MAAM;EACJ,OAAO;EACP,SAAS;CACX;CACA,SAAS;CACT,YAAY;AACd;AAEA,MAAM,YAAY;CAChB,GAAG;CACH,OAAO,CAAC;CACR,UAAU;CACV,UAAU;CACV,WAAW;CACX,sBAAsB,EAAE,IAAI,GAAG;CAC/B,KAAK;CACL,MAAM;AACR;AAGA,MAAa,eAAmE,oBAG9E,UAAU;AACZ,MAAa,kBAAkB,oBAAkD,SAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamhl8/configs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "My shared configs for TS projects",
|
|
5
5
|
"homepage": "https://github.com/adamhl8/configs",
|
|
6
6
|
"bugs": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"oxlint-tsgolint": "^0.24.0",
|
|
70
70
|
"publint": "^0.3.21",
|
|
71
71
|
"release-it": "^20.2.1",
|
|
72
|
-
"tsdown": "^0.22.
|
|
72
|
+
"tsdown": "^0.22.5",
|
|
73
73
|
"typescript": "^7.0.2"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|