1. Do not check for updates if a check has been done in last 60 seconds
2. Use stored etag from techdocs_metadata.json instead of in-memory storage
3. Enable re-building docs when in a mix of basic and recommended setup i.e. local builder with external storage
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
Encode thrown errors in the backend as a JSON payload using a facility in that package, and render helpful frontend displays of those errors.
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
We aren't supposed to import from '.' or '../..' etc; point to the actual node being imported instead. I did allow e.g. '../../bigfolder' however. Going all the way to the individual file could be done too, but is a matter of taste perhaps.
Also ran Organize Imports on all the touched files :)
No changeset since there are no functional changes at all - only the imports changed
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
* Add TechdocsMetadata type in backend plugin endpoint
* Introduce TechDocsMetadata type in frontend
* Add changeset
* Remove old thennable metadata resp
* Address PR feedback
- Remove explicit type annotation on TechDocsMetadata
- Reintroduce res.send instead of throwing an error
- Change logger info to logger error
* Add TechDocsMetadata type in frontend plugin
* Commit yarn.lock
* Introduce JSON5 and remove parsing in local pub
Signed-off-by: Matei David <matei.david.35@gmail.com>
This caching makes it usable experience, so that docs are not built on every load.
In future readTree will support a method to fetch the timestamp of the latest HEAD. And
it should be used to invalidate the cache.
The creation of temporary directories and their clean up should be handled on its own. techdocs-cli already has a fixed input output dir requirement. It makes that generator accepts these values as requirements.
When a new Backstage app is setup, the techdocs backend file contains all the preparers (dir, github, gitlab, etc.) and same for generators. While this providers added customizibility, it comes with a cost of complexity in setting up the app backend. New preparers' updates would need users to update their app's techdocs backend file.
Scaffolder backend has already moved to this proposed pattern.
Plus
1. Introduce ncessary configs to connect with storage
2. Introduce config to prefer CI build of docs, or techdocs-backend to build and publish them.
3. Write guide how to use Google Cloud Storage with TechDocs
4. Add a TechDocs Configuration reference page in docucmentation