@rtorcato/repo-tooling 3.2.1 → 3.2.2
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.
|
|
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
|
|
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':
|
|
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':
|
|
299
|
+
'@rtorcato/repo-tooling': SELF_RANGE,
|
|
282
300
|
'@types/react': '^19.0.0',
|
|
283
301
|
typescript: '~5.6.3',
|
|
284
302
|
...typedocDevDeps,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rtorcato/repo-tooling",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
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.
|
|
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",
|
|
@@ -185,10 +185,15 @@ body,
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
/* ---------- Code ----------
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
|
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
|
-
|
|
217
|
+
/* Base colour for anything Prism does not tokenise. */
|
|
218
|
+
color: var(--jt-text);
|
|
212
219
|
}
|
|
213
220
|
div[class*="codeBlockTitle"] {
|
|
214
|
-
background:
|
|
215
|
-
color:
|
|
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:
|
|
233
|
+
border-color: var(--jt-border2);
|
|
222
234
|
box-shadow: 0 8px 24px -18px rgba(12, 18, 28, 0.5);
|
|
223
235
|
}
|
|
224
236
|
|