Summary
Please make the AdminForth SPA staging/build directory and the final served dist directory configurable.
Current behavior
In AdminForth 3.13.13, codeInjector.ts:
- Initializes
TMP_DIR from os.tmpdir().
- Builds the SPA in
/tmp/adminforth/<brandSlug>/spa_tmp.
- Uses the AdminForth package location to derive
getServeDir().
- Copies
spa_tmp/dist to that serve directory.
- The Express adapter serves
index.html and assets from codeInjector.getServeDir().
There is currently no documented AdminForth configuration option for either directory.
Setting the standard TMPDIR environment variable can change the temporary root, but it does not make the final served dist directory configurable.
Why this matters
This makes deployments harder in environments where:
/tmp is ephemeral, size-limited, or cleaned between releases;
- build and runtime containers or processes do not share the same
/tmp;
- the application needs build artifacts in an application-owned cache or release directory;
- the installed package directory is immutable or read-only;
- a missing temporary cache causes a runtime rebuild and avoidable startup downtime.
Proposed API
Please consider exposing configuration similar to:
customization: {
spaBuildDir: /var/cache/myapp/adminforth,
spaServeDir: /var/lib/myapp/adminforth/dist,
}
Alternatively, a single configurable AdminForth SPA root could be provided, with the staging and served paths derived from it.
The implementation should ensure that:
- existing defaults remain unchanged;
bundleNow(), source hashes, dependency installation, and i18n output use the configured build directory;
- the generated
dist is copied to the configured serve directory;
- the HTTP adapters serve from the same configured serve directory;
- CI/build-time bundling and runtime startup use identical paths;
- the option is documented.
A stable environment-variable option would also be useful, but it should cover both the build cache and the served output, not only os.tmpdir().
Summary
Please make the AdminForth SPA staging/build directory and the final served
distdirectory configurable.Current behavior
In AdminForth 3.13.13,
codeInjector.ts:TMP_DIRfromos.tmpdir()./tmp/adminforth/<brandSlug>/spa_tmp.getServeDir().spa_tmp/distto that serve directory.index.htmland assets fromcodeInjector.getServeDir().There is currently no documented AdminForth configuration option for either directory.
Setting the standard
TMPDIRenvironment variable can change the temporary root, but it does not make the final serveddistdirectory configurable.Why this matters
This makes deployments harder in environments where:
/tmpis ephemeral, size-limited, or cleaned between releases;/tmp;Proposed API
Please consider exposing configuration similar to:
Alternatively, a single configurable AdminForth SPA root could be provided, with the staging and served paths derived from it.
The implementation should ensure that:
bundleNow(), source hashes, dependency installation, and i18n output use the configured build directory;distis copied to the configured serve directory;A stable environment-variable option would also be useful, but it should cover both the build cache and the served output, not only
os.tmpdir().