Skip to content

Commit 7a45388

Browse files
Delete docs.ps1: it is an installed file, not a committed one (#14)
Resolves W-D6 for docs.ps1. The repository was carrying a hand-written copy of a file the documentation tooling generates. The item was filed under a wrong premise and correcting it is what resolved it. docs.ps1, docs/Dockerfile and docs/.dockerignore all date from the initial commit -- before the template was installed in W0, which wrote only build/ and .config/ -- so they were never stale vendored copies. And setup-docs.ps1 rewrites docs.ps1 with four substitutions, so the installed form never matches the raw template and the byte-comparison that flagged this was never valid. docs.ps1 is therefore a generated file, and committing a hand-written substitute meant carrying a permanent invisible fork of something the tooling owns. Invoke-SetupDocs writes the real one. Checked rather than assumed: nothing under .github/workflows executes it; all seventeen references are prose or absolute URLs so no relative link resolves to it; and upstream's parameter set is a superset of the deleted one, so every documented command still works once the installer runs. README.md therefore needed no edit, which also avoided regenerating docs/src/pages/index.md by hand. The gain is the one flagged when this was filed: the installed docs.ps1 regenerates the README-derived site root every run, retiring the by-hand replication needed because there is no pwsh in the agent environment. The cost, recorded in CLAUDE.md and the contributor guide: until the next installer run, ./docs.ps1 does not exist in a fresh checkout. docs/Dockerfile and docs/.dockerignore are retained -- they are the Docker build context the preview depends on, so removing them would leave no way to build the site locally at all.
1 parent 4f600fa commit 7a45388

4 files changed

Lines changed: 53 additions & 88 deletions

File tree

CLAUDE.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ build context:
101101
- `docs/Dockerfile` — extends `ghcr.io/the-running-dev/docs-template` and `COPY . .`
102102
overlays the above onto `/template`.
103103

104-
Run it with **`docs.ps1`** (repo root; needs Docker Desktop running):
104+
Run it with **`docs.ps1`** (repo root; needs Docker Desktop running). **It is installed by
105+
`Invoke-SetupDocs`, not committed** — the installer rewrites it for this project's paths and
106+
tag, so it is generated rather than vendored. A hand-written copy predating the template used
107+
to be committed here and was deleted; if the file is missing, run the installer. The installed
108+
version also regenerates `docs/src/pages/index.md` from `README.md` on every run, which
109+
retires doing that by hand:
105110

106111
| Command | Does |
107112
|---|---|

docs.ps1

Lines changed: 0 additions & 84 deletions
This file was deleted.

docs/docs/guide/documentation-site.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ image. This page covers building and checking it.
1818
| `./docs.ps1 -Live` | Same, but bind-mounts `docs/` so edits hot-reload |
1919
| `./docs.ps1 -BuildOnly` | Build the image only |
2020

21+
> **`docs.ps1` is installed, not committed.** It comes from the documentation template
22+
> along with `build/` and `.config/`, and is written by `Invoke-SetupDocs` — which rewrites
23+
> it for this project's paths and image tag, so it is a *generated* file rather than a
24+
> vendored one. If it is not present in your checkout, run the installer.
25+
>
26+
> It was previously committed here in a hand-written form that predated the template and
27+
> had drifted from it; the installed version additionally regenerates the README-derived
28+
> site root on every run, which is why the local copy was dropped rather than reconciled.
29+
2130
## What is authored, and what is generated
2231

2332
Everything under `docs/docs/` is authored directly. **Exactly one page on the site is

plans/05-docs-site-information-architecture.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ filed and merged upstream afterwards, and the vendored gate re-synced to pick it
1111
| W-D3 site links | Done for `src/engine/` and `docs.ps1` via two new `guide/` pages; the two companion-repository links stay on the code host, which is correct |
1212
| W-D4 upstream gap | Done — filed and merged upstream as [#56](https://github.com/The-Running-Dev/Docusaurus-Template/pull/56), then vendored back |
1313
| W-D5 gate sync | Done — vendored gate is byte-identical to upstream again |
14-
| W-D6 preview toolchain | **Open** `docs.ps1`, `docs/Dockerfile`, `docs/.dockerignore` are well behind upstream; found while doing W-D5, deliberately not folded into it |
14+
| W-D6 preview toolchain | Done for `docs.ps1` — deleted, since it is an *installed* file the repository should not have been carrying. `docs/Dockerfile` and `docs/.dockerignore` retained; see below |
1515
| W-D7 nested parentheses | Done — fixed upstream as [#57](https://github.com/The-Running-Dev/Docusaurus-Template/pull/57) with a scanner, then vendored back |
1616

1717
**Scope:** How the published site is organised and linked, plus the vendored-tooling debt
@@ -213,10 +213,45 @@ local overrides and are not in scope.
213213
correctness fix with no behaviour change here; these three change how the site is previewed
214214
and built locally, and `docs.ps1`'s own header prose is repo-specific — it may be locally
215215
authored rather than a stale vendor copy, which has to be established before overwriting it.
216-
Worth noting that upstream's `docs.ps1` would remove a real pain: the homepage regeneration
217-
this repository currently does by replicating the generator's logic by hand, because there is
216+
217+
### Resolution — `docs.ps1` deleted
218+
219+
**It was locally authored, and that was the defect.** All three files date from the initial
220+
commit, *before* the template was installed in W0 — which wrote only `build/` and `.config/`.
221+
So they were never stale vendored copies, and the byte-comparison that first flagged them was
222+
never a valid test: `setup-docs.ps1` **rewrites** `docs.ps1` with four substitutions (script
223+
directory, config directory, image tag, base image), so the installed form never matches the
224+
raw template anyway.
225+
226+
That reframes the item. `docs.ps1` is a **generated** file — the installer's output — and
227+
committing a hand-written substitute meant the repository carried a permanent, invisible fork
228+
of a file the tooling owns. Deleting it is the fix; `Invoke-SetupDocs` writes the real one.
229+
230+
Deletion is safe and was checked rather than assumed:
231+
232+
- **No CI dependency.** Nothing in `.github/workflows/` executes it; the only `docs.ps1`
233+
mention in `docs-ci.yml` is a comment about `setup-docs.ps1`.
234+
- **No broken links.** Its seventeen references are prose or absolute URLs — no relative
235+
markdown link resolves to it, so neither the gate nor the Docusaurus build is affected.
236+
- **The references stay true.** Upstream's parameter set is a superset of the deleted one —
237+
same `-Live`, `-BuildOnly`, `-Port`, `-Tag`, `-BaseImage`, plus `-NoHomepage` — so every
238+
documented command still works once the installer runs. `README.md` therefore needed no
239+
edit, which also avoided regenerating `docs/src/pages/index.md` by hand.
240+
241+
**The gain is the one flagged when this was filed:** the installed `docs.ps1` regenerates the
242+
README-derived site root on every run, retiring the by-hand replication of
243+
`ConvertTo-DocumentationHomepage.ps1`'s logic that this repository has needed because there is
218244
no `pwsh` in the agent environment.
219245

246+
**The cost, stated plainly:** between this change and the next `Invoke-SetupDocs` run, `./docs.ps1`
247+
does not exist in a fresh checkout. `CLAUDE.md` and the contributor guide now say so and say
248+
what to run.
249+
250+
**`docs/Dockerfile` and `docs/.dockerignore` are retained.** They are also installer outputs,
251+
but they are the Docker *build context* the preview depends on, and deleting them would leave
252+
no way to build the site locally at all until the installer runs. Their drift is recorded
253+
above and is not causing a problem; revisit if the installer is re-run for another reason.
254+
220255
Also worth reporting, though not ours to fix:
221256
`docs/getting-started/installing-the-docs-system.md` upstream went stale with #52 — it still
222257
tells non-`/` consumers to add `docs/src/pages/index.md` by hand and calls

0 commit comments

Comments
 (0)