diff --git a/.gitignore b/.gitignore index 4001da4..d963f40 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,4 @@ node_modules/ -data/ -storage/ -public/ -!public/*.html +build/ tsconfig.client.tsbuildinfo .claude/ diff --git a/.gitmodules b/.gitmodules index d9f728f..a6e310a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "src/library-ts"] - path = src/library-ts + path = source/library-ts url = git@development.rokojori.com:Josef/library-ts.git diff --git a/package.json b/package.json index fc794d1..e83d052 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "roject", "version": "1.0.0", - "main": "server/index.ts", + "main": "source/server/index.ts", "scripts": { - "start": "npm run build && ts-node --project tsconfig.ts-node.json server/index.ts", - "build": "tsc --build tsconfig.client.json" + "start": "npm run build && ts-node --project tsconfig.ts-node.json source/server/index.ts", + "build": "tsc --build tsconfig.client.json && node scripts/copy-pages.js" }, "dependencies": { "@langchain/core": "^1.2.2", diff --git a/scripts/copy-pages.js b/scripts/copy-pages.js new file mode 100644 index 0000000..0784303 --- /dev/null +++ b/scripts/copy-pages.js @@ -0,0 +1,13 @@ +const fs = require('fs'); +const path = require('path'); + +const src = path.join(__dirname, '..', 'source', 'pages'); +const dest = path.join(__dirname, '..', 'build', 'app'); + +fs.mkdirSync(dest, { recursive: true }); + +for (const file of fs.readdirSync(src)) { + if (file.endsWith('.html')) { + fs.copyFileSync(path.join(src, file), path.join(dest, file)); + } +} diff --git a/src/commands/Command.ts b/source/commands/Command.ts similarity index 100% rename from src/commands/Command.ts rename to source/commands/Command.ts diff --git a/src/commands/CommandAssignments.ts b/source/commands/CommandAssignments.ts similarity index 100% rename from src/commands/CommandAssignments.ts rename to source/commands/CommandAssignments.ts diff --git a/src/commands/CommandContext.ts b/source/commands/CommandContext.ts similarity index 100% rename from src/commands/CommandContext.ts rename to source/commands/CommandContext.ts diff --git a/src/commands/CommandManager.ts b/source/commands/CommandManager.ts similarity index 100% rename from src/commands/CommandManager.ts rename to source/commands/CommandManager.ts diff --git a/src/commands/file-tree-commands/AddFile.ts b/source/commands/file-tree-commands/AddFile.ts similarity index 100% rename from src/commands/file-tree-commands/AddFile.ts rename to source/commands/file-tree-commands/AddFile.ts diff --git a/src/commands/file-tree-commands/FileTreeCommands.ts b/source/commands/file-tree-commands/FileTreeCommands.ts similarity index 100% rename from src/commands/file-tree-commands/FileTreeCommands.ts rename to source/commands/file-tree-commands/FileTreeCommands.ts diff --git a/src/components/app-nav/app-nav.ts b/source/components/app-nav/app-nav.ts similarity index 100% rename from src/components/app-nav/app-nav.ts rename to source/components/app-nav/app-nav.ts diff --git a/src/components/code-panel/code-panel.ts b/source/components/code-panel/code-panel.ts similarity index 100% rename from src/components/code-panel/code-panel.ts rename to source/components/code-panel/code-panel.ts diff --git a/src/components/confirm-dialog/confirm-dialog.ts b/source/components/confirm-dialog/confirm-dialog.ts similarity index 100% rename from src/components/confirm-dialog/confirm-dialog.ts rename to source/components/confirm-dialog/confirm-dialog.ts diff --git a/src/components/context-menu/context-menu.ts b/source/components/context-menu/context-menu.ts similarity index 100% rename from src/components/context-menu/context-menu.ts rename to source/components/context-menu/context-menu.ts diff --git a/src/components/editor-shell/editor-shell.ts b/source/components/editor-shell/editor-shell.ts similarity index 100% rename from src/components/editor-shell/editor-shell.ts rename to source/components/editor-shell/editor-shell.ts diff --git a/src/components/file-tree-panel/file-tree-panel.ts b/source/components/file-tree-panel/file-tree-panel.ts similarity index 100% rename from src/components/file-tree-panel/file-tree-panel.ts rename to source/components/file-tree-panel/file-tree-panel.ts diff --git a/src/components/group-editor/group-editor.ts b/source/components/group-editor/group-editor.ts similarity index 100% rename from src/components/group-editor/group-editor.ts rename to source/components/group-editor/group-editor.ts diff --git a/src/components/html-editor-panel/html-editor-panel.ts b/source/components/html-editor-panel/html-editor-panel.ts similarity index 100% rename from src/components/html-editor-panel/html-editor-panel.ts rename to source/components/html-editor-panel/html-editor-panel.ts diff --git a/src/components/login-form/login-form.ts b/source/components/login-form/login-form.ts similarity index 100% rename from src/components/login-form/login-form.ts rename to source/components/login-form/login-form.ts diff --git a/src/components/project-editor/project-editor.ts b/source/components/project-editor/project-editor.ts similarity index 100% rename from src/components/project-editor/project-editor.ts rename to source/components/project-editor/project-editor.ts diff --git a/src/components/register-form/register-form.ts b/source/components/register-form/register-form.ts similarity index 100% rename from src/components/register-form/register-form.ts rename to source/components/register-form/register-form.ts diff --git a/src/components/rojo-chat-panel/rojo-chat-panel.ts b/source/components/rojo-chat-panel/rojo-chat-panel.ts similarity index 100% rename from src/components/rojo-chat-panel/rojo-chat-panel.ts rename to source/components/rojo-chat-panel/rojo-chat-panel.ts diff --git a/src/components/tab-container/tab-container.ts b/source/components/tab-container/tab-container.ts similarity index 100% rename from src/components/tab-container/tab-container.ts rename to source/components/tab-container/tab-container.ts diff --git a/src/editor/Editor.ts b/source/editor/Editor.ts similarity index 100% rename from src/editor/Editor.ts rename to source/editor/Editor.ts diff --git a/src/editor/FileEditorRegistry.ts b/source/editor/FileEditorRegistry.ts similarity index 100% rename from src/editor/FileEditorRegistry.ts rename to source/editor/FileEditorRegistry.ts diff --git a/src/library-ts b/source/library-ts similarity index 100% rename from src/library-ts rename to source/library-ts diff --git a/locales/en/commands/file-tree-commands/add-file.txt b/source/locale-data/en/commands/file-tree-commands/add-file.txt similarity index 100% rename from locales/en/commands/file-tree-commands/add-file.txt rename to source/locale-data/en/commands/file-tree-commands/add-file.txt diff --git a/locales/en/greeting.txt b/source/locale-data/en/greeting.txt similarity index 100% rename from locales/en/greeting.txt rename to source/locale-data/en/greeting.txt diff --git a/src/locales/LocaleManager.ts b/source/locales/LocaleManager.ts similarity index 100% rename from src/locales/LocaleManager.ts rename to source/locales/LocaleManager.ts diff --git a/src/locales/Locales.ts b/source/locales/Locales.ts similarity index 100% rename from src/locales/Locales.ts rename to source/locales/Locales.ts diff --git a/src/locales/generated/Locales.ts b/source/locales/generated/Locales.ts similarity index 100% rename from src/locales/generated/Locales.ts rename to source/locales/generated/Locales.ts diff --git a/src/locales/generated/commands/Commands.ts b/source/locales/generated/commands/Commands.ts similarity index 100% rename from src/locales/generated/commands/Commands.ts rename to source/locales/generated/commands/Commands.ts diff --git a/src/locales/generated/commands/file-tree-commands/FileTreeCommands.ts b/source/locales/generated/commands/file-tree-commands/FileTreeCommands.ts similarity index 100% rename from src/locales/generated/commands/file-tree-commands/FileTreeCommands.ts rename to source/locales/generated/commands/file-tree-commands/FileTreeCommands.ts diff --git a/source/pages/dashboard.html b/source/pages/dashboard.html new file mode 100644 index 0000000..065ef23 --- /dev/null +++ b/source/pages/dashboard.html @@ -0,0 +1,20 @@ + + +
+ + +Sunday, 12 July 2026
++ Full project directory restructure — source/, build/app/, build/data/, + source/pages/ with a copy-pages build step. +
++ The project root was reorganised into two top-level directories that + cleanly separate source from build artefacts and runtime data: +
+source/ — all TypeScript source (components, editor, server, rojos, locales, library-ts submodule) plus locale data and HTML pagesbuild/app/ — compiled frontend output (was public/)build/data/db/ — JSON user/project data (was data/)build/data/storage/ — project files, sessions, layouts (was storage/)
+ The git submodule (library-ts) was moved with git mv
+ so .gitmodules stayed in sync automatically. The entire
+ build/ tree is gitignored; source/ is fully tracked.
+
+ HTML pages (editor.html, dashboard.html, etc.)
+ moved from build/app/ into source/pages/ so they
+ are tracked in git as source files. A new scripts/copy-pages.js
+ (plain Node.js, no extra dependencies) copies them to build/app/
+ as the second step of npm run build:
+
tsc --build tsconfig.client.json && node scripts/copy-pages.js
+
+
+ src/locales/ (TypeScript locale management code) moved to
+ source/locales/. The root locales/ (raw locale
+ data files — en/) moved to source/locale-data/.
+ Merging them into one directory would have mixed TypeScript source with data
+ files; keeping them separate makes each directory's purpose unambiguous.
+
+ The old setup had public/ gitignored with a !public/*.html
+ exception that never actually tracked the files. The new setup is cleaner:
+ all hand-written HTML pages live in source/pages/ (tracked),
+ build/ is entirely ignored, and the copy step bridges the two
+ at build time.
+
+ scripts/copy-pages.js uses only fs and
+ path from the Node.js standard library. Adding a package like
+ copyfiles or cpx for a four-line operation would
+ be unnecessary complexity.
+
+ src/ → source/ (git mv, including library-ts submodule)
+ server/ → source/server/ (git mv)
+ locales/ → source/locale-data/ (git mv)
+ public/ → build/app/ (filesystem move, gitignored)
+ data/ → build/data/db/ (filesystem move, gitignored)
+ storage/ → build/data/storage/ (filesystem move, gitignored)
+ source/pages/ — new: hand-written HTML pages (tracked)
+ scripts/copy-pages.js — new: copies pages to build/app/ on build
+ tsconfig.client.json — rootDir, outDir, include, exclude, references updated
+ tsconfig.json — include updated
+ tsconfig.ts-node.json — include updated
+ source/library-ts/browser/tsconfig.roject.json — outDir updated
+ package.json — main and build script updated
+ .gitignore — replaced data/, storage/, public/ with build/
+ source/server/ — all __dirname paths and library-ts imports updated
+
Full directory restructure — source/, build/app/, build/data/db/, build/data/storage/, source/pages/ with copy-pages build step.
+nginx reverse proxy on Server A — Gitea moved to a local HTTP port, TLS termination handed to nginx, development.rokojori.com restored. Project directory restructure planned.
diff --git a/workspace/outline/index.html b/workspace/outline/index.html index 55b264e..c620bfc 100644 --- a/workspace/outline/index.html +++ b/workspace/outline/index.html @@ -279,11 +279,13 @@
Vanilla HTML, raw CSS (no Tailwind, no framework). Every UI component is a
custom element with its own .ts and .css file in
- src/components/<name>/. CSS uses the element tag as root
+ source/components/<name>/. CSS uses the element tag as root
selector with display: block. TypeScript compiles to
- public/components/ via tsconfig.client.json
+ build/app/components/ via tsconfig.client.json
(module: ESNext, moduleResolution: bundler, no
- bundler). HTML pages load components with
+ bundler). HTML pages live in source/pages/ and are copied to
+ build/app/ by scripts/copy-pages.js as part of the
+ build. HTML pages load components with
<script type="module">. Shared state uses a module-level
singleton (editor-state.ts) rather than globals.
Build with npm run build.
@@ -301,16 +303,16 @@
A personal TypeScript library lives as a git submodule at
- src/library-ts/. It has two parts: browser/
+ source/library-ts/. It has two parts: browser/
(DOM-capable) and node/ (Node.js only). The browser part is
compiled separately via TypeScript project references
- (src/library-ts/browser/tsconfig.roject.json, strict: false)
- into public/library-ts/browser/. The node part is included by
+ (source/library-ts/browser/tsconfig.roject.json, strict: false)
+ into build/app/library-ts/browser/. The node part is included by
tsconfig.ts-node.json (extends server config, strictNullChecks: false).