npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-cli-deploy-sentry

v0.7.0

Published

Ember CLI Deploy plugin to upload javascript sourcemaps to sentry.

Downloads

1,291

Readme

Ember-cli-deploy-sentry Circle CI

An ember-cli-deploy-plugin to upload javascript sourcemaps to Sentry.

What is an ember-cli-deploy plugin?

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.

Quick Start

To get up and running quickly, do the following:

$ ember install ember-cli-deploy-sentry
  • For hosted accounts, generate your bearer/api key here: https://sentry.io/api/
  • Place the following configuration into config/deploy.js
ENV.sentry = {
  // the URL or CDN your js assets are served from
  publicUrl: 'https://your.awesome.site',
  // the sentry install you're using, https://sentry.io for hosted accounts
  sentryUrl: 'https://sentry.your.awesome.site',
  sentryOrganizationSlug: 'AwesomeOrg',
  sentryProjectSlug: 'AwesomeProject',
  
  // One of:
  sentryApiKey: 'awesomeApiKey',
  // or
  sentryBearerApiKey: 'awesomeApiKey'
}

Install ember-cli-sentry but import the raven service from ember-cli-deploy-sentry/services/raven, which will automatically handle setting up the release version for you. Sentry needs this to find the correct sourcemap for an error that occurs.

If you don't want to use ember-cli-sentry but set raven-js up manually see Manual integration with raven-js.

  • Build sourcemaps in production environment

ember-cli builds sourcemaps only in development environment by default. In order to build them always, just add the following to your EmberApp options.

sourcemaps: {
  enabled: true,
  extensions: ['js']
}

See also: ember-cli documentation

  • Run the pipeline
$ ember deploy

Installation

Run the following command in your terminal:

ember install ember-cli-deploy-sentry

For general information on how to setup Sentry and raven-js you probably want to check out the official Sentry Documentation especially on Sourcemaps.

ember-cli-deploy Hooks Implemented

For detailed information on what plugin hooks are and how they work, please refer to the Plugin Documentation.

  • configure
  • upload
  • didDeploy

Configuration Options

For detailed information on how configuration of plugins works, please refer to the Plugin Documentation.

publicUrl

The public url to the root of where your assets are stored. For instance, if your assets are stored on Cloudfront, it would be https://xxxx.cloudfront.net.

Required

sentryUrl

The url of the sentry installation that ember-cli-deploy-sentry shall upload sourcemaps and javascript files to. If you are deploying in your local network, keep in mind you might need to use the local hostname/IP address.

Required

sentryOrganizationSlug

The slug of the organization you want to upload sourcemaps for. You can specify this in organization settings in sentry.

Required

sentryProjectSlug

The slug of the project you want to upload sourcemaps for. You can specify this in project settings in sentry.

Required

apiKey or bearerApiKey

Either an HTTP Basic Auth username, or a bearer token. If you are uploading to the current Sentry API, use the latter. Use the former if you are using an older API.

You can create the api key in your organization settings. Make sure it has the project:write privilege.

Required

distDir

The root directory that all files matching the filePattern will be uploaded from. By default, this option will use the distDir property of the deployment context.

Default: context.distDir

filePattern

minimatch expression that is used to determine which files should be uploaded from the distDir.

Default: /**/*.{js,map}

revisionKey

The revision string that is used to create releases in sentry.

Default:

  revisionKey: function(context) {
    return context.revisionData && context.revisionData.revisionKey;
  }

revisionCommits

An array of revision commits allows us to associate commits with this Sentry release. See the Sentry docs here.

Default:

  revisionCommits: undefined

Examples:

  revisionCommits: function(context) {
    return [{
      repository:"owner-name/repo-name", // required
      id:"2da95dfb052f477380608d59d32b4ab9" // required
    }]
  }

enableRevisionTagging

Enable adding a meta tag with the current revisionKey into the head of your index.html.

Default true

replaceFiles

At deploy-time, the plugin will check your Sentry instance for an existing release under the current revisionKey. If a release is found and this is set to true, all existing files for the matching release will be deleted before the current build's files are uploaded to Sentry. If this is set to false, the files on Sentry will remain untouched and the just-built files will not be uploaded.

Default true

Prerequisites

The following properties are expected to be present on the deployment context object:

Manual integration with raven-js

By default a meta tag with the key name sentry:revision is inserted in your index.html:

<meta name="sentry:revision" content="(revision)">

When you setup raven-js you can retrieve it like this:

Raven.config({
    release: document.querySelector("meta[name='sentry:revision']").content
});

If you only want to use the sourcemap upload functionality of ember-cli-deploy-sentry, you can disable automatic meta tag insertion completely by setting enableRevisionTagging to false.

Last but not least make sure to setup proper exception catching like this.

Running Tests

  • npm test

TODO

  • use context.distFiles from ember-cli-deploy-build instead globbing distDir again?
  • automatically setup raven-js? If you want this, let me know.
  • add revision tagging file pattern
  • make meta name configurable and document service.releaseMetaName

State

It works. We use it in production at Hatchet.