@rtorcato/repo-tooling 3.2.1 → 3.2.3

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.
@@ -1,8 +1,22 @@
1
1
  import path from 'node:path';
2
2
  import fs from 'fs-extra';
3
+ import selfPackageJson from '../../../package.json' with { type: 'json' };
3
4
  import { copyPreset, PRESETS } from '../utils/copy-preset.js';
4
5
  import { buildBadgeRow, parseRepository } from './badges.js';
5
6
  import { inferSubpathsFromExports } from './treeshake.js';
7
+ /**
8
+ * What a scaffolded docs site should depend on for *this* CLI — read from the
9
+ * running version rather than written down, because a literal here goes stale
10
+ * silently. It had drifted to `^2.47.0`, two majors behind, so every site
11
+ * scaffolded since was handed a pre-rename version predating the peer-dependency
12
+ * split.
13
+ *
14
+ * The floor is the exact running version, not `^<major>.0.0`: the config being
15
+ * generated is the one this version emits, and claiming compatibility back to
16
+ * the start of the major would be the same over-wide-range problem doctor's
17
+ * `Config schema versions` check exists to catch (#330).
18
+ */
19
+ const SELF_RANGE = `^${selfPackageJson.version}`;
6
20
  /**
7
21
  * Docs-site (Docusaurus) generator — the Phase 2 counterpart to the shared
8
22
  * assets shipped in #54. Scaffolds a working Docusaurus site under `apps/docs`,
@@ -179,8 +193,12 @@ ${typedocPlugins} [
179
193
  ],
180
194
  copyright: \`Copyright © \${new Date().getFullYear()} ${meta.title}. Built with Docusaurus.\`,
181
195
  },
196
+ // \`theme\` is the LIGHT-mode Prism theme and \`darkTheme\` the dark one. Both
197
+ // were vsDark here, which is why the shared stylesheet had to pin fenced
198
+ // blocks dark in light mode too (#324). Keep this pairing and the CSS in
199
+ // step — vsDark tokens on a light surface are unreadable.
182
200
  prism: {
183
- theme: prismThemes.vsDark,
201
+ theme: prismThemes.vsLight,
184
202
  darkTheme: prismThemes.vsDark,
185
203
  additionalLanguages: ['bash', 'json', 'typescript'],
186
204
  },
@@ -222,7 +240,7 @@ const TSCONFIG = `// Improves IDE type-checking; not used by \`docusaurus start/
222
240
  `;
223
241
  function customCss(accent) {
224
242
  // Import the shared tokens, then override only the accent (per #54's model).
225
- return `/* Site theme: shared @rtorcato tokens + this project's accent. */
243
+ return `/* Site theme: the shared design tokens + this project's accent. */
226
244
  @import "./_jt-tokens.css";
227
245
 
228
246
  :root {
@@ -239,7 +257,7 @@ function customCss(accent) {
239
257
  function docsPackageJson(meta, typedoc) {
240
258
  const typedocDevDeps = typedoc
241
259
  ? {
242
- '@rtorcato/repo-tooling': '^2.47.0',
260
+ '@rtorcato/repo-tooling': SELF_RANGE,
243
261
  'docusaurus-plugin-typedoc': '^1.4.0',
244
262
  typedoc: '^0.28.0',
245
263
  'typedoc-plugin-markdown': '^4.9.0',
@@ -278,7 +296,7 @@ function docsPackageJson(meta, typedoc) {
278
296
  '@docusaurus/tsconfig': '^3.8.1',
279
297
  '@docusaurus/types': '^3.10.2',
280
298
  '@playwright/test': '^1.49.0',
281
- '@rtorcato/repo-tooling': '^2.47.0',
299
+ '@rtorcato/repo-tooling': SELF_RANGE,
282
300
  '@types/react': '^19.0.0',
283
301
  typescript: '~5.6.3',
284
302
  ...typedocDevDeps,
@@ -12,7 +12,7 @@ jobs:
12
12
  steps:
13
13
  - uses: actions/checkout@v7
14
14
  - uses: pnpm/action-setup@v6
15
- - uses: actions/setup-node@v6
15
+ - uses: actions/setup-node@v7
16
16
  with:
17
17
  node-version: 22
18
18
  cache: pnpm
@@ -15,7 +15,7 @@ const SETUP_STEPS = ` - name: 📦 Checkout repository
15
15
  uses: actions/checkout@v7
16
16
 
17
17
  - name: 📦 Setup Node.js
18
- uses: actions/setup-node@v6
18
+ uses: actions/setup-node@v7
19
19
  with:
20
20
  node-version-file: .nvmrc
21
21
 
@@ -23,7 +23,7 @@ const SETUP_STEPS = ` - name: 📦 Checkout repository
23
23
  uses: pnpm/action-setup@v6
24
24
 
25
25
  - name: 📦 Restore dependencies cache
26
- uses: actions/cache@v5
26
+ uses: actions/cache@v6
27
27
  with:
28
28
  path: |
29
29
  ~/.pnpm-store
@@ -38,7 +38,7 @@ const DEPENDENCIES_JOB = {
38
38
  uses: actions/checkout@v7
39
39
 
40
40
  - name: 📦 Setup Node.js
41
- uses: actions/setup-node@v6
41
+ uses: actions/setup-node@v7
42
42
  with:
43
43
  node-version-file: .nvmrc
44
44
 
@@ -50,7 +50,7 @@ const DEPENDENCIES_JOB = {
50
50
  run: echo "key=\${{ runner.os }}-pnpm-\${{ hashFiles('**/pnpm-lock.yaml') }}" >> $GITHUB_OUTPUT
51
51
 
52
52
  - name: 📦 Cache dependencies
53
- uses: actions/cache@v5
53
+ uses: actions/cache@v6
54
54
  with:
55
55
  path: |
56
56
  ~/.pnpm-store
@@ -164,7 +164,7 @@ ${attw}${publint}
164
164
  token: \${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
165
165
 
166
166
  - name: 📦 Setup Node.js
167
- uses: actions/setup-node@v6
167
+ uses: actions/setup-node@v7
168
168
  with:
169
169
  node-version-file: .nvmrc
170
170
  registry-url: 'https://registry.npmjs.org'
@@ -173,7 +173,7 @@ ${attw}${publint}
173
173
  uses: pnpm/action-setup@v6
174
174
 
175
175
  - name: 📦 Restore dependencies cache
176
- uses: actions/cache@v5
176
+ uses: actions/cache@v6
177
177
  with:
178
178
  path: |
179
179
  ~/.pnpm-store
@@ -45,7 +45,7 @@ const XCODE_SETUP = ` - name: 📦 Checkout repository
45
45
  * to rebuild; key on Package.resolved so the cache invalidates with the graph.
46
46
  */
47
47
  const SPM_CACHE = ` - name: 📦 Cache SwiftPM
48
- uses: actions/cache@v5
48
+ uses: actions/cache@v6
49
49
  with:
50
50
  path: |
51
51
  .build
@@ -118,7 +118,7 @@ ${pkg.platforms.map((p) => ` - ${p}`).join('\n')}`,
118
118
  steps: `${XCODE_SETUP}
119
119
 
120
120
  - name: 📦 Cache DerivedData
121
- uses: actions/cache@v5
121
+ uses: actions/cache@v6
122
122
  with:
123
123
  path: ~/Library/Developer/Xcode/DerivedData
124
124
  key: \${{ runner.os }}-derived-\${{ matrix.platform }}-\${{ hashFiles('**/Package.resolved') }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtorcato/repo-tooling",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
4
4
  "description": "One CLI to scaffold, audit and fix your repo's whole toolchain — linting, tests, commits, releases & CI.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -277,7 +277,7 @@
277
277
  "vitest": "^4.1.10"
278
278
  },
279
279
  "peerDependencies": {
280
- "@biomejs/biome": "^2.0.0",
280
+ "@biomejs/biome": "^2.5.0",
281
281
  "@commitlint/cli": "^20.0.0 || ^21.0.0",
282
282
  "@commitlint/config-conventional": "^21.2.0",
283
283
  "@commitlint/types": "^21.2.0",
@@ -1,6 +1,16 @@
1
1
  export default {
2
2
  extends: ["@commitlint/config-conventional"],
3
- ignores: [(commit) => commit.includes("[skip ci]")],
3
+ ignores: [
4
+ (commit) => commit.includes("[skip ci]"),
5
+ // Bot commit bodies are machine-written blocks (dependabot's
6
+ // `- dependency-name: …` YAML) that never wrap at 72, so every bot PR
7
+ // failed body-max-line-length. commitlint can't relax a single rule per
8
+ // commit, so skip bot commits wholesale — squash-merge uses the PR
9
+ // title, which is still linted on the merge commit.
10
+ // ponytail: matches the trailer, not a bare "[bot]", so a human commit
11
+ // that merely mentions a bot is still linted.
12
+ (commit) => /^Signed-off-by: .*\[bot\]/m.test(commit),
13
+ ],
4
14
  rules: {
5
15
  // Enforce strict type validation
6
16
  "type-enum": [
@@ -185,10 +185,15 @@ body,
185
185
  }
186
186
 
187
187
  /* ---------- Code ----------
188
- Prism is vsDark in both light & dark mode (to match the navy aesthetic),
189
- so fenced code blocks must stay dark in BOTH themes — otherwise the pale
190
- vsDark tokens wash out on a light background. Inline code (the `code` pills)
191
- keeps the themed --ifm-code-background and stays readable. */
188
+ Every surface and text colour here comes from the theme tokens, which already
189
+ flip between light and dark — the values that used to be hardcoded (#0c111b,
190
+ #dfe5ee, #94a1b4) were simply the dark side of tokens that existed all along.
191
+
192
+ This pairs with `prism.theme: vsLight` / `prism.darkTheme: vsDark` in
193
+ docusaurus.config.ts. The two must move together (#324): vsDark tokens on a
194
+ light surface are pale and unreadable, which is why the background was pinned
195
+ dark in both modes in the first place. If a fenced block still renders dark in
196
+ light mode, that config is the thing to check. */
192
197
  code {
193
198
  background: var(--jt-code-bg);
194
199
  border: 1px solid var(--jt-border);
@@ -202,23 +207,30 @@ div[class*="codeBlockContainer"],
202
207
  pre[class*="language-"] {
203
208
  border: 1px solid var(--jt-border);
204
209
  border-radius: 12px;
205
- background: #0c111b !important;
210
+ /* !important beats the inline background the Prism theme sets on the <pre>. */
211
+ background: var(--jt-code-bg) !important;
206
212
  }
207
213
  .theme-code-block code,
208
214
  pre[class*="language-"] code {
209
215
  background: transparent !important;
210
216
  border: none !important;
211
- color: #dfe5ee;
217
+ /* Base colour for anything Prism does not tokenise. */
218
+ color: var(--jt-text);
212
219
  }
213
220
  div[class*="codeBlockTitle"] {
214
- background: #0a0e16 !important;
215
- color: #94a1b4 !important;
221
+ background: var(--jt-surface2) !important;
222
+ color: var(--jt-muted) !important;
216
223
  border-bottom: 1px solid var(--jt-border);
217
224
  }
225
+ /* In dark the title sits a shade *below* the block; in light there is no token
226
+ darker than --jt-code-bg, so the bottom border does the separating instead. */
227
+ [data-theme="dark"] div[class*="codeBlockTitle"] {
228
+ background: var(--jt-bg) !important;
229
+ }
218
230
  [data-theme="light"] .theme-code-block,
219
231
  [data-theme="light"] div[class*="codeBlockContainer"],
220
232
  [data-theme="light"] pre[class*="language-"] {
221
- border-color: rgba(12, 18, 28, 0.16);
233
+ border-color: var(--jt-border2);
222
234
  box-shadow: 0 8px 24px -18px rgba(12, 18, 28, 0.5);
223
235
  }
224
236
 
@@ -18,10 +18,10 @@ jobs:
18
18
  runs-on: ubuntu-latest
19
19
  steps:
20
20
  - name: Checkout
21
- uses: actions/checkout@v4
21
+ uses: actions/checkout@v7
22
22
 
23
23
  - name: Setup Node.js
24
- uses: actions/setup-node@v4
24
+ uses: actions/setup-node@v7
25
25
  with:
26
26
  node-version-file: .nvmrc
27
27
 
@@ -17,7 +17,7 @@ jobs:
17
17
  runs-on: ubuntu-latest
18
18
  steps:
19
19
  - name: Checkout
20
- uses: actions/checkout@v4
20
+ uses: actions/checkout@v7
21
21
 
22
22
  - name: Set up Docker Buildx
23
23
  uses: docker/setup-buildx-action@v3
@@ -20,10 +20,10 @@ jobs:
20
20
  runs-on: ubuntu-latest
21
21
  steps:
22
22
  - name: Checkout
23
- uses: actions/checkout@v4
23
+ uses: actions/checkout@v7
24
24
 
25
25
  - name: Setup Node.js
26
- uses: actions/setup-node@v4
26
+ uses: actions/setup-node@v7
27
27
  with:
28
28
  node-version-file: .nvmrc
29
29
 
@@ -20,10 +20,10 @@ jobs:
20
20
  runs-on: ubuntu-latest
21
21
  steps:
22
22
  - name: Checkout
23
- uses: actions/checkout@v4
23
+ uses: actions/checkout@v7
24
24
 
25
25
  - name: Setup Node.js
26
- uses: actions/setup-node@v4
26
+ uses: actions/setup-node@v7
27
27
  with:
28
28
  node-version-file: .nvmrc
29
29