Feature switches
There is one edition of Developer Assistance Tools. Some tools are grouped into removable feature modules, and a build can leave any of them out. This is how a smaller build, with a smaller audit surface, is produced for a particular deployment.
The file
Section titled “The file”features.json at the repository root has two parts:
disabled: a list of feature names to leave out. It is empty by default.features: the available modules, each with atitle, asummary, thepagesit owns and thefiles(scripts, styles and vendored libraries) only it uses.
Available features
Section titled “Available features”| Key | Title | Pages removed |
|---|---|---|
sql |
SQL Workspace and Schema Designer | tools/data/sql.html, tools/data/schema.html |
api |
API toolkit (OpenAPI and Swagger viewer, HTTP header reference, test payload builder) | tools/api/swagger.html, tools/api/http-headers.html, tools/data/payloads.html |
documents |
Documents and media (PDF tools, compressor, image editor, SVG tools, CSV editor) | tools/media/pdf-tools.html, tools/media/compress.html, tools/media/image-editor.html, tools/media/svg-tools.html, tools/data/csv.html |
code |
Code playgrounds (JavaScript playground, HTML viewer) | tools/dev/editor.html, tools/dev/html-viewer.html |
operations |
Operations toolkit (log analyser, deployment manifest builder, command reference) | tools/data/log-analyzer.html, tools/dev/deploy-manifest.html, tools/text/reference.html |
diagrams |
Diagrams and whiteboard | tools/diagrams/diagrams.html, tools/diagrams/whiteboard.html |
ai |
AI features (prompt workbench) | tools/dev/ai-tools.html |
What a switch removes
Section titled “What a switch removes”When a feature is disabled, the build strips its pages, the vendored libraries only it uses, its catalogue entries and its redirects. Libraries that more than one feature loads (pdf-lib, fontkit and unifont, used by both documents and operations) are not listed under any feature and ship in every build.
How to use it
Section titled “How to use it”-
Add the feature names to
disabledinfeatures.json:"disabled": ["ai", "diagrams"], -
Rebuild the site:
Terminal window node scripts/build/build-pages.mjsThe build writes into
dist/. A self-hosted release built withnode scripts/build/build-container.mjsalso readsfeatures.json, so edit it before building the release; see Self-hosting. -
To bring a feature back, delete its name from
disabledand rebuild.
The switches apply at build time only. They do not change a site that has already been built.