An ember-cli-deploy plugin that uploads your source maps to Honeybadger.
This plugin uploads generated source maps to the Honeybadger API. During upload of the source maps to Honeybadger you must provide source_code
string that will match the error raised in Honeybadger with the same value. To do this, Honeybadger snippet is injected into index.html
after the revision data is generated with revision key as source_code
. After all, the plugin uploads the source maps with the same revision key as injected into index.html
.
You can take a look here how Honeybadger defines its flow with source maps
This library was adapted from @bgentry's ember-cli-deploy-rollbar-sourcemap
A plugin is an addon that can be executed as a part of the ember-cli-deploy pipeline. A plugin will implement one or more of the ember-cli-deploy's pipeline hooks.
For more information on what plugins are and how they work, please refer to the Plugin Documentation.
To get up and running quickly, do the following:
-
Ensure ember-cli-deploy-build is installed and configured
-
Ensure ember-cli-deploy-revision-data is installed and configured
-
Install this plugin
$ ember install ember-cli-deploy-honeybadger-sourcemap
- Enable sourcemaps for all environments in
ember-cli-build.js
:
/* jshint node:true */
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// …
sourcemaps: {
enabled: true, // This allows sourcemaps to be generated in all environments
extensions: ['js']
}
});
- Run the pipeline
$ ember deploy
Run the following command in your terminal:
ember install ember-cli-deploy-honeybadger-sourcemap
For detailed information on what plugin hooks are and how they work, please refer to the Plugin Documentation.
willUpload
(inject Honeybadger snippet)upload
(upload source maps)didDeploy
(send information about deploy to Honeybadger)
For detailed information on how configuration of plugins works, please refer to the Plugin Documentation.
Configure this addon in your deploy.js
ENV
:
'honeybadger-sourcemap': {
apiKey: process.env.Honeybadger_SERVER_ACCESS_TOKEN,
},
Honeybadger server access token to allow uploading source maps to your account.
The fully qualified domain name for your application e.g., https://app.fancy-app.com
Defines internal enabled
Honeybadger config.
Default: true
Alternatives: false
Defines internal environment
Honeybadger config.
Default: environment setting from ember-cli-deploy-build || production
Alternatives: any other env
Defines additional sourcemap files to be uploaded to Honeybadger. Use this if you build .js files other than projectName.js
and vendor.js
.
Set to an array of filenames excluding their extentions. For example in an app that builds exta-functionality.js
and additional-library.js
set to ['exta-functionality', 'additional-library']
.
Default: []
Alternatives: an array of filenames without extensions
The following properties are expected to be present on the deployment context
object:
distDir
(provided by ember-cli-deploy-build)distFiles
(provided by ember-cli-deploy-build)revisionData
(provided by ember-cli-deploy-revision-data)
- You must enable source maps in your
ember-cli-build.js
file, even inproduction
env. However, you don't need to upload them anywhere (they won't be available online) - they are only needed duringupload
phase in deploy pipeline. - If you are using gzipping, make sure that you are not gzipping source maps - Honeybadger will not accept gzipped files.
- If you bump in any other issue in your deployment flow, give me a sign and I'll try to make this addon more flexible for you.
See the Contributing guide for details.
This project is licensed under the MIT License.