New: Static docs builds without app startup (fixes #47)#48
Merged
Conversation
Replace App.instance with StaticAppContext that scans the filesystem for module configs, routes, schemas, errors and permissions. Docs can now be built with `node bin/docgen.js --rootDir <path>` without starting the full authoring tool.
Refactor the static docs build to use plain exported functions in lib/docsData.js instead of a class that mimics App.instance. docgen.js now calls the helpers directly and assembles the app object inline.
Swagger reads app.routerTree, app.schemas, app.permissions directly instead of going through waitForModule/dependencyloader. The app object assembled in docgen.js no longer needs onReady or dependencyloader. A temporary waitForModule shim remains for the jsonschema docs plugin.
The errors plugin expects { code, statusCode, meta: { description } }
matching the runtime AdaptError instances. Transform raw JSON error
definitions into this shape so the errors doc plugin works correctly.
github-actions Bot
pushed a commit
that referenced
this pull request
Feb 27, 2026
# [1.4.0](v1.3.1...v1.4.0) (2026-02-27) ### Chore * Change workflow name ([ce313e9](ce313e9)) ### Fix * bump adapt-authoring-core dependency to ^2.0.0 ([6dd4e6f](6dd4e6f)) * remove lockfile and peerDependenciesMeta, add .npmrc ([d86d8eb](d86d8eb)) ### New * Static docs builds without app startup (fixes #47) (#48) ([c676054](c676054)), closes [#47](#47) [#48](#48)
|
🎉 This PR is included in version 1.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
New
StaticAppContextclass (lib/StaticAppContext.js) that replacesApp.instanceby scanning the filesystem for module configs, routes, schemas, errors and permissions — enabling docs to be built without starting the full appUpdate
bin/docgen.jsto useStaticAppContextinstead ofApp, accepting--rootDirand--outputDirCLI argsbin/docserve.jsto accept--outputDir,--port, and--openCLI args without requiring the app to startadapt-authoring-corefrompeerDependenciestodependencies(still usesloadDependencyFilesandreadJsonutilities)path-to-regexpdependency (for building permission route regexes)Testing
cd docs && npm test— all 70 tests pass (25 new + 45 existing)node bin/docgen.js --rootDir /path/to/adapt-authoring --outputDir /tmp/docs-test— builds all docs without starting the appnode bin/docserve.js --outputDir /tmp/docs-test— serves docs on port 9000npx standard— linting passes