Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docsy.dev/.lycheecache
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ https://github.com/google/docsy/pull/2700,200,1786106543
https://github.com/google/docsy/pull/2712,200,1786305687
https://github.com/google/docsy/pull/2714,200,1786628621
https://github.com/google/docsy/pull/2724,200,1787076569
https://github.com/google/docsy/pull/2726,200,1787137876
https://github.com/google/docsy/pull/941,200,1782498225
https://github.com/google/docsy/pulls,200,1782563369
https://github.com/google/docsy/releases,200,1782563368
Expand Down
4 changes: 4 additions & 0 deletions docsy.dev/content/en/project/about/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ For the full list of changes, see the [0.16.1][] or [0.17.0][] release page.
- Renamed the full test-suite entry point: `ci:test` → `test:full`, with
`_test:full:pre`/`_test:full:common` phases; the freed `ci:*` names retire. A
repo clone now installs via `npm run install:safe` ([#2712][]).
- Inlined npm `pre*`/`post*` run-hooks into their parent scripts, so
`check:links` still builds the site under user-level `ignore-scripts`
([#2726][]).
- Moved the default Mermaid version to `theme/hugo.yaml`
`params.mermaid.version`, guarded by the repo test suite (`test:repo`). See
[Default Mermaid version][mermaid-version-notes].
Expand All @@ -198,6 +201,7 @@ For the full list of changes, see the [0.16.1][] or [0.17.0][] release page.
[#2712]: https://github.com/google/docsy/pull/2712
[#2714]: https://github.com/google/docsy/pull/2714
[#2724]: https://github.com/google/docsy/pull/2724
[#2726]: https://github.com/google/docsy/pull/2726
[0.16.1]: https://github.com/google/docsy/releases/latest?FIXME=v0.16.1
[0.17.0]: https://github.com/google/docsy/releases/latest?FIXME=v0.17.0
[footer copyright docs]: /docs/content/lookandfeel/#footer-copyright
Expand Down
15 changes: 5 additions & 10 deletions docsy.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,18 @@
"_serve": "npm run _hugo-dev -- serve --disableFastRender --renderToMemory",
"_test:base": "npm run check:format && npm run _check:links",
"_update:goldens": "npm run update:md-goldens && npm run update:favicon-goldens",
"build:preview": "cross-env npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-http://localhost}\"",
"build:production": "npm run _hugo -- --minify",
"build:preview": "cross-env npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-http://localhost}\" && npm run _postbuild",
"build:production": "npm run _hugo -- --minify && npm run _postbuild",
"build": "cross-env npm run _build -- --baseURL \"${BASE_URL:-http://localhost}\"",
"check:format": "npm run _check:format || (echo '[help] Run: npm run fix:format'; exit 1)",
"check:links:internal": "npm run _check:links -- --offline",
"check:links": "npm run _check:links --",
"check:links:internal": "npm run build && npm run _check:links -- --offline",
"check:links": "npm run build && npm run _check:links --",
"clean": "rm -Rf public",
"ccr": "cross-env HUGO_PARAMS_TD_CHROME=shared npm run",
"fix:format": "npm run _check:format -- --write",
"fix:refcache": "npm run check:links",
"fix": "npm run fix:format",
"make:public": "git init -b main public",
"postbuild:preview": "npm run _postbuild",
"postbuild:production": "npm run _postbuild",
"precheck:links:internal": "npm run build",
"precheck:links": "npm run build",
"preupdate:goldens": "npm run build",
"refcache": "refcache",
"seq": "bash -c 'for cmd in \"$@\"; do npm run $cmd || exit 1; done' - ",
"serve": "npm run _serve -- --minify",
Expand All @@ -45,7 +40,7 @@
"test": "npm run seq -- test:base test:extra",
"update:dep": "npm run -s update:hugo",
"update:favicon-goldens": "node tests/favicons/update-goldens.mjs",
"update:goldens": "npm run _update:goldens",
"update:goldens": "npm run build && npm run _update:goldens",
"update:hugo": "npm install --save-exact -D hugo-extended@latest",
"update:md-goldens": "node tests/md-output/update-goldens.mjs",
"update:packages": "npm-check-updates -u"
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@
"install:theme-deps": "npm ci --prefix theme --ignore-scripts --omit=dev --omit=peer --no-audit --no-fund",
"install:browser": "node node_modules/puppeteer/install.mjs",
"is:clean": "bash -c 'o=$(git status --porcelain -uall); echo \"$o\"; [ -z \"$o\" ]'",
"post-update": "echo; echo 'IMPORTANT! Run the following in case the ScrollSpy patch needs to be updated:\n npm run _prepare'; echo",
"postupdate:dep": "npm run -s post-update",
"postupdate:packages": "npm run -s post-update",
"refcache": "npm run -C docsy.dev refcache --",
"seq": "bash -c 'for cmd in \"$@\"; do npm run $cmd || exit 1; done' - ",
"serve": "npm run -C docsy.dev serve --",
Expand All @@ -78,12 +75,13 @@
"test:visual": "node --test 'tests/visual/*.test.mjs'",
"test:website": "npm run -C docsy.dev test",
"test": "npm run fix-and-test",
"update:dep": "npm install --save-exact @fortawesome/fontawesome-free@latest bootstrap@latest",
"update::post": "echo; echo 'IMPORTANT! Run the following in case the ScrollSpy patch needs to be updated:\n npm run _prepare'; echo",
"update:dep": "npm install --save-exact @fortawesome/fontawesome-free@latest bootstrap@latest && npm run -s update::post",
"update:goldens": "npm run -C docsy.dev update:goldens && npm run update:markup-goldens",
"update:markup-goldens": "node tests/fixture-site/update-markup-goldens.mjs",
"update:packages:all": "npm run update:packages --workspaces --include-workspace-root",
"update:packages:not-hugo": "npm run update:packages -- -x hugo-extended",
"update:packages": "npm-check-updates -u",
"update:packages": "bash -c 'npm-check-updates -u \"$@\" && npm run -s update::post' -",
"update:visual-goldens": "UPDATE_VISUAL_GOLDENS=1 npm run test:visual",
"update:visual-goldens:linux": "node tests/visual/update-goldens-linux.mjs",
"wt": "HUGO_THEME=$(basename \"$PWD\")/theme npm run",
Expand Down
43 changes: 19 additions & 24 deletions tests/test-wiring.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -156,30 +156,25 @@ test('manifests: own-suite scripts resolve their test files', () => {
}
});

// npm wraps every script in implicit pre<name>/post<name> hooks: a hook
// sibling on a check-lane script runs unreviewed code inside the pinned CI
// chain — e.g. rewriting goldens in its own env before test:visual
// compares. Install-path hooks are the supply-chain audit's subject; these
// are check-execution.
test('manifests: check-lane scripts carry no lifecycle hook siblings', () => {
const { scripts } = JSON.parse(
fs.readFileSync(path.join(repoRoot, 'package.json'), 'utf8'),
);
for (const name of [
'test:visual',
'test:repo',
'test:lychee',
'is:clean',
'update:visual-goldens',
'update:visual-goldens:linux',
'update:markup-goldens',
]) {
for (const hook of [`pre${name}`, `post${name}`]) {
assert.equal(
scripts[hook],
undefined,
`${hook} stays absent, so ${name} runs exactly as pinned`,
);
test('manifests: no script has a lifecycle hook sibling', () => {
const manifests = [
'package.json',
'docsy.dev/package.json',
'theme/package.json',
];
for (const manifest of manifests) {
const { scripts } = JSON.parse(
fs.readFileSync(path.join(repoRoot, manifest), 'utf8'),
);
const names = Object.keys(scripts);
assert.ok(names.length > 0, `${manifest} declares scripts`);
for (const name of names) {
for (const hook of [`pre${name}`, `post${name}`]) {
assert.ok(
!names.includes(hook),
`${manifest}: ${hook} stays absent, so ${name} runs exactly as pinned`,
);
}
}
}
});
Loading