Repository navigation
ecs-architecture 0.6.0: main composes the app; plugins list their own layer's systems; load order, private folders and test features checked - #281
Merged
Conversation
… layer's systems; load order, private folders and test features checked
- features/main and its sub-features may import any layer, and nothing outside main imports it (imports-main).
- A plugin lists only its own layer's systems and its sub-features' plugins of the same layer (plugin-foreign-systems), and no two plugins share a name (plugin-name-clash).
- A function called as a module loads can't read what is declared beneath the call (used-before-declared).
- A component's folders are internal/, its parts, or part components (private-folder).
- unused-export-ok also keeps a system nothing runs yet; export-first allows what fills a value the export reads; test features reach private files as tests do; src/index.ts may be export {}.
- The settings 0.5 removed (apps, systems) say where they went, and the README has an upgrade from 0.4.
Fixes #280.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ons and var Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fixes come from moving a 1,900-file app (55 features, 88 systems lists, five samples, node benchmarks and tools) from 0.4 to 0.5. Each point below is something that app hit. Fixes #280.
The checker
maincomposes the app.features/mainand its sub-features may import any layer of any feature, their own sub-features included. A page that starts views and ports both had no layer it could live in, sinceviewmay not importportsandportsmay not importview(ecs-architecture: main's page entry can't start both view and ports plugins (no layer may import both) #280). The module bans still apply inmain's layers. Anything outsidemainthat imports it is now a violation (imports-main); the standard said so, but nothing checked it.plugin-foreign-systems). A ports plugin that listed its model's systems now only connects, and is started beside its model's plugin.plugin-name-clash). A plugin is named for its feature's folder, so two nested features with one name exported the same identifier. That surfaced only when both were imported together, inmain.unused-export-okalso keeps a system nothing runs yet, such as one public for a feature still to come. Before, a public export could be marked but an unreached system couldn't.used-before-declared). A function declared beneath and called as the module loads, reading aconstdeclared beneath the call, throws as the module loads. TypeScript doesn't see that through a hoisted function.internal/shared. A test feature's owninternal/is still checked.internal/, its parts, or part components (private-folder). Oldshared/andsystems/folders passed without a warning.src/index.tsmay beexport {};for an app with no public API, as a layer holding only entries already may.appsandsystemsnamefeatures/mainand the plugins, and point to the README's new "Upgrading to 0.5" section.Docs
standard.md, the agent rules and the README cover each change. The README has a step-by-step upgrade from 0.4. The agent rules inecs/are regenerated, and all five sample apps pass.Checks
Run from the root with every
*.tsbuildinfodeleted first:check:workspaceandbuildpass, and everyecs/package's suite passes (@adobe/ecs1992 tests,ecs-architecture130, the samples, the guide).@adobe/ecs'sloop.test.ts("a back-to-back driver ticks as fast as tasks run") failed once in the root run on a heavily loaded machine. It passed three times in a row run alone, and again in the fullecs/run. Nothing here touches that package.🤖 Generated with Claude Code