The admin ui assets are built via a github workflow and published as
github a artifact. The artifact can be downloaded, avoiding the need to
build the assets again locally, and eliminating the need for front-end
build tools like yarn and npm.
This updates the `build-ui` target to use a new script that will attempt
to download the pre-built assets. Note that this script requires that
the `gh` cli is installed since an authenticated request is necessary to
download the workflow artifacts. If the artifact cannot be downloaded
either due to the lack of `gh` or because the artifact cannot be found,
it will fallback to using `git clone` (and will require yarn to build
the assets).
See:
https://cli.github.com/https://docs.github.com/en/rest/actions/artifactshttps://github.com/actions/upload-artifact/issues/51
This puts it more in line with other upcoming options that use "dir"
instead of "directory" (plus it's easier to type), and makes it clear
that this directory and the passthrough behavior is related to the UI as
opposed to other upcoming items.
* Update ui build to use 'admin' folder instead of 'core'
Post release of v0.1.2, ui/core folder has been renamed to ui/admin.
Update ui build scripts to be aware of the path change.
* Update packagespec to reflect "admin" ui folder change
* Add mechanism for bundling UI assets.
The scripts/uigen.sh script will check out the UI repo, build assets,
create a static assets file, and clean up.
The dev Makefile target has been modified to run this script if no
assets file is found. There is also a build-ui target that will
unilaterally update (the dev target only builds if the file isn't found,
but doesn't update).
The handler has been updated to add the default org ID as a header if
the request path is "/".
Co-authored-by: Randall Morey <randall@randallmorey.com>