Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,30 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm run lint
- run: npm test
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: pnpm install --frozen-lockfile
- run: pnpm run lint
- run: pnpm test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
/bower_components/
/node_modules/

# pnpm
.pnpm-debug.log*
.pnpm-store/

# misc
/.env*
/.pnp*
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Make sure your app's `moudlePrefix` is equal to your Sentry `appName`, and your

1. Install Sentry:

`npm i @sentry/browser @sentry/integrations`
`pnpm add @sentry/ember`

2. Add sentry config to `config/environment.js` file

Expand All @@ -88,8 +88,7 @@ Make sure your app's `moudlePrefix` is equal to your Sentry `appName`, and your
```js
// app/sentry.js

import * as Sentry from '@sentry/browser';
import { Ember } from '@sentry/integrations/esm/ember';
import * as Sentry from '@sentry/ember';
import config from 'web-app/config/environment';

const sentryConfig = config.sentry || {};
Expand All @@ -98,8 +97,7 @@ export function startSentry() {
Sentry.init({
environment: config.environment,
release: `${config.modulePrefix}@${config.APP.version}`,
...sentryConfig,
integrations: [new Ember()]
...sentryConfig
});
}
```
Expand Down
29 changes: 22 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,25 @@ module.exports = {
},

url: "",

injectDebugIds: true,
},

requiredConfig: ["appName", "orgName", "authToken"],

didBuild() {
if (!this.readConfig("injectDebugIds")) {
this.log("SENTRY: Debug ID injection disabled, skipping...");
return;
}

const assetsDir = this.readConfig("assetsDir");

this.log("SENTRY: Injecting Debug IDs...");
this.sentryCliExec("sourcemaps", `inject "${assetsDir}"`);
this.log("SENTRY: Debug IDs injected!");
},

didPrepare() {
const releaseName = `${this.readConfig("appName")}@${this.readConfig(
"revisionKey"
Expand All @@ -58,13 +73,13 @@ module.exports = {
this.log("SENTRY: Assigning commits...");
this.sentryCliExec(
"releases",
`set-commits "${releaseName}" --auto --ignore-missing --ignore-empty`
`set-commits "${releaseName}" --auto --ignore-missing`
);

this.log("SENTRY: Uploading source maps...");
this.sentryCliExec(
"releases",
`files "${releaseName}" upload-sourcemaps --rewrite ${assetsDir} ${urlPrefix}`
"sourcemaps",
`upload --release "${releaseName}" --rewrite ${assetsDir} ${urlPrefix}`
);

this.log("SENTRY: Finalizing release...");
Expand All @@ -80,8 +95,8 @@ module.exports = {

this.log("SENTRY: Deploying release...");
this.sentryCliExec(
"releases",
`deploys "${releaseName}" new -e ${environment}`
"deploys",
`new --release "${releaseName}" -e ${environment}`
);
this.log("SENTRY: Deployed!");
},
Expand All @@ -104,13 +119,13 @@ module.exports = {
return this._exec(
[
sentryCliAbsoluteBinLocation,
url ? `--url ${url}` : "",
url ? `--url ${url}` : null,
`--auth-token ${authToken}`,
command,
`--org ${orgName}`,
`--project ${appName}`,
subCommand,
].join(" ")
].filter(Boolean).join(" ")
);
},

Expand Down
Loading