Skip to content

Split projects.osl into one file per concern - #70

Merged
Mistium merged 2 commits into
mainfrom
split-projects
Nov 1, 2026
Merged

Mistium merged 2 commits into
mainfrom
split-projects

Conversation

@Mistium

@Mistium Mistium commented Nov 1, 2026

Copy link
Copy Markdown
Member

Stacked on #69.

src/projects/projects.osl was 3,962 lines. It's now one file per concern:

File Lines Owns
project-access.osl 180 roles, canEditProject, canViewProject, view keys, private-only rules
project-response.osl 286 the project JSON returned to clients, version history and donation analytics
project-quota.osl 210 storage details, quotas and pending upload reservations
project-create.osl 124 creating projects and owned-slot counting
upload-parts.osl 392 staged and chunked upload parts
project-upload.osl 951 uploads, project.json inspection, history bootstrap, thumbnails
project-snapshots.osl 187 R2 snapshots, staging, flushing and orphaned storage keys
project-read.osl 88 reading a project, its editor view, trusted extensions, project.json
project-vanity.osl 113 vanity URLs and their lapse loop
project-update.osl 492 updating project settings
project-trash.osl 256 delete, trash, restore and purge
project-publishing.osl 224 publish, unpublish, views and reactions
project-discovery.osl 212 explore, random, related, featured, sitemap and leaderboard
project-remix.osl 311 remixes, the remix tree and forking

It's a pure move. Every non-blank line is unchanged, checked by comparing the line sets before and after. Sibling files in a directory share private names, so nothing new is exported. Each file's export block lists only the names it defines that other directories use. Caches and constants moved with the code that uses them. A second commit fixes the indentation of one line that sat at column 0 inside a function.

Next. handleUploadProjectLocked (about 565 lines) and handleUpdateProjectLocked (about 490) are still single functions. They're the next step, together with record types and result errors once osl/.go#51 is available.

Checks:

  • osl lsp check main.osl reports no diagnostics, and osl test passes 45/45.
  • osl compile builds.
  • The offline smoke run (scripts/e2e_smoke.py) returns responses matching the previous build across all 29 steps.

There is no visible change.

projects.osl was 3,962 lines covering access checks, responses, quotas, create, chunked
uploads, upload and history, storage snapshots, reads, vanity URLs, update, trash,
publishing, discovery and remixes. Each is now its own file in src/projects, and every
file's export block lists only the names it defines that other directories use.

This is a pure move: every non-blank line is unchanged, sibling files share private
names as before, the route dump is identical, tests pass and the offline smoke run
matches the previous build.
@Mistium
Mistium changed the base branch from src-layout to main November 1, 2026 07:17
@Mistium
Mistium merged commit e21b971 into main Nov 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant