rojects/workspace/history/2026/07-July/12-Sunday/index.html

139 lines
6.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Session Summary — 12 July 2026</title>
<link rel="stylesheet" href="../../../../_assets_/styles.css">
<link rel="stylesheet" href="../../../../_assets_/nav.css">
</head>
<body>
<div class="page">
<header>
<p class="date">Sunday, 12 July 2026</p>
<h1>Roject — Session Summary</h1>
<p class="subtitle">
Full project directory restructure — source/, build/app/, build/data/,
source/pages/ with a copy-pages build step.
</p>
</header>
<section>
<h2>What we built</h2>
<div class="card">
<h3>Directory restructure</h3>
<p>
The project root was reorganised into two top-level directories that
cleanly separate source from build artefacts and runtime data:
</p>
<ul style="line-height:1.9;margin-top:0.75rem">
<li><code>source/</code> — all TypeScript source (components, editor, server, rojos, locales, library-ts submodule) plus locale data and HTML pages</li>
<li><code>build/app/</code> — compiled frontend output (was <code>public/</code>)</li>
<li><code>build/data/db/</code> — JSON user/project data (was <code>data/</code>)</li>
<li><code>build/data/storage/</code> — project files, sessions, layouts (was <code>storage/</code>)</li>
</ul>
<p style="margin-top:0.75rem">
The git submodule (<code>library-ts</code>) was moved with <code>git mv</code>
so <code>.gitmodules</code> stayed in sync automatically. The entire
<code>build/</code> tree is gitignored; <code>source/</code> is fully tracked.
</p>
<div class="tags">
<span class="tag">source/</span>
<span class="tag">build/app/</span>
<span class="tag">build/data/</span>
<span class="tag">git mv</span>
</div>
</div>
<div class="card">
<h3>source/pages/ + copy-pages build step</h3>
<p>
HTML pages (<code>editor.html</code>, <code>dashboard.html</code>, etc.)
moved from <code>build/app/</code> into <code>source/pages/</code> so they
are tracked in git as source files. A new <code>scripts/copy-pages.js</code>
(plain Node.js, no extra dependencies) copies them to <code>build/app/</code>
as the second step of <code>npm run build</code>:
</p>
<pre style="margin-top:0.75rem"><code>tsc --build tsconfig.client.json &amp;&amp; node scripts/copy-pages.js</code></pre>
<div class="tags">
<span class="tag">source/pages/</span>
<span class="tag">scripts/copy-pages.js</span>
<span class="tag">npm run build</span>
</div>
</div>
</section>
<section>
<h2>Key Decisions</h2>
<div class="decision">
<strong>Two locale directories: source/locales/ vs source/locale-data/</strong>
<p>
<code>src/locales/</code> (TypeScript locale management code) moved to
<code>source/locales/</code>. The root <code>locales/</code> (raw locale
data files — <code>en/</code>) moved to <code>source/locale-data/</code>.
Merging them into one directory would have mixed TypeScript source with data
files; keeping them separate makes each directory's purpose unambiguous.
</p>
</div>
<div class="decision">
<strong>build/ fully gitignored, source/pages/ tracked</strong>
<p>
The old setup had <code>public/</code> gitignored with a <code>!public/*.html</code>
exception that never actually tracked the files. The new setup is cleaner:
all hand-written HTML pages live in <code>source/pages/</code> (tracked),
<code>build/</code> is entirely ignored, and the copy step bridges the two
at build time.
</p>
</div>
<div class="decision">
<strong>Plain Node.js copy script, no npm dependency</strong>
<p>
<code>scripts/copy-pages.js</code> uses only <code>fs</code> and
<code>path</code> from the Node.js standard library. Adding a package like
<code>copyfiles</code> or <code>cpx</code> for a four-line operation would
be unnecessary complexity.
</p>
</div>
</section>
<section>
<h2>Structural Changes</h2>
<div class="card">
<p>
<code>src/</code><code>source/</code> (git mv, including library-ts submodule)<br>
<code>server/</code><code>source/server/</code> (git mv)<br>
<code>locales/</code><code>source/locale-data/</code> (git mv)<br>
<code>public/</code><code>build/app/</code> (filesystem move, gitignored)<br>
<code>data/</code><code>build/data/db/</code> (filesystem move, gitignored)<br>
<code>storage/</code><code>build/data/storage/</code> (filesystem move, gitignored)<br>
<code>source/pages/</code> — new: hand-written HTML pages (tracked)<br>
<code>scripts/copy-pages.js</code> — new: copies pages to build/app/ on build<br>
<code>tsconfig.client.json</code> — rootDir, outDir, include, exclude, references updated<br>
<code>tsconfig.json</code> — include updated<br>
<code>tsconfig.ts-node.json</code> — include updated<br>
<code>source/library-ts/browser/tsconfig.roject.json</code> — outDir updated<br>
<code>package.json</code> — main and build script updated<br>
<code>.gitignore</code> — replaced data/, storage/, public/ with build/<br>
<code>source/server/</code> — all __dirname paths and library-ts imports updated
</p>
</div>
</section>
<footer>
Roject &mdash; session log &mdash; 12 July 2026
</footer>
</div>
<script>var NAV_ROOT = '../../../../';</script>
<script src="../../../../_assets_/nav-data.js"></script>
<script src="../../../../_assets_/nav.js"></script>
</body>
</html>