@errio/cli
v0.1.0
Published
Errio command-line tools
Maintainers
Readme
@errio/cli
Command-line tooling for Errio. The first command uploads private Node/Webpack source maps so the dashboard and remediation worker can resolve generated stack frames without storing source code.
Upload source maps
Create a dedicated project API key with the write:source_maps scope, then run this in CI after the production bundle is built and before build artifacts are deleted:
export ERRIO_SOURCEMAP_API_KEY='ak_...'
export ERRIO_ENDPOINT='https://errio.mosaicwellness.in'
export ERRIO_RELEASE="${GIT_SHA}"
npx @errio/cli sourcemaps upload \
--bundle-dir apps/aria-service/dist \
--repo mosaic-wellness/aria \
--commit "${GIT_SHA}" \
--service aria-service \
--environment production \
--release "${ERRIO_RELEASE}"Set the same ERRIO_RELEASE, ERRIO_SERVICE_NAME, and ERRIO_ENVIRONMENT on the running application. In slim/container images without .git, also set ERRIO_REPO_FULL_NAME and ERRIO_COMMIT_SHA to the exact --repo and --commit values above. @errio/node adds that deployment identity to captured events.
The uploader accepts regular and sectioned v3 maps, uploads at most four files concurrently, and is safe to retry. It rejects:
- inline or missing maps
- maps without their generated
.js,.cjs, or.mjsbundle - malformed, empty, non-v3, or partial artifact sets
- more than 500 maps, 20 MiB per map, or 250 MiB per release
Any sourcesContent embedded by the bundler is removed recursively before the map is hashed, compressed, or uploaded; source remains in GitHub.
Webpack
Generate hidden external maps without sources:
const webpack = require('webpack');
module.exports = {
devtool: false,
plugins: [
new webpack.SourceMapDevToolPlugin({
filename: '[file].map',
append: false,
noSources: true,
}),
],
};esbuild
esbuild src/index.ts --bundle --platform=node --sourcemap=external --sources-content=false --outdir=dist