This is a 2-part project:
packages/cli
:collect-package-metadata
npm package that goes over your frontend packages and collects some metadatapackages/api
:serverless
backend that holds on to this metadata and lets you fetch it later
install from yarn yarn add collect-package-metadata
and run the following script:
const collectPackageMetadata = require('collect-package-metadata')
collectPackageMetadata({
root, // absolute path to the directory with packages
revision, // git sha
projectId, // there is currently no way to create new projects
secret,
})
// this script will go over the `root` directory
// in search of `package.json`s and other metadata
// and upload its findings onto server under this project's `projectId` and `revision`
// if `secret` matches what's in the database
This is a serverless backend that stores metadata.
- You can use my deployment: https://4r8pobcqh9.execute-api.us-east-1.amazonaws.com/dev
- Or you can set up serverless locally and
cd sevice; serverless deploy
and then set up the PACKAGE_ANALYZER_BACKEND
environment variable.
Get latest metadata by calling GET https://4r8pobcqh9.execute-api.us-east-1.amazonaws.com/dev/metadata/:projectId
.
Or if you want to see metadata at a certain revision, call GET https://4r8pobcqh9.execute-api.us-east-1.amazonaws.com/dev/metadata/:projectId/:revision
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.