@granite-js/plugin-sentry 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/index.cjs +9 -2
- package/dist/index.js +9 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @granite-js/plugin-sentry
|
|
2
2
|
|
|
3
|
+
## 0.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 24571e5: read bundle content before extracting debug ID
|
|
8
|
+
- @granite-js/plugin-core@0.1.6
|
|
9
|
+
- @granite-js/utils@0.1.6
|
|
10
|
+
|
|
11
|
+
## 0.1.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- @granite-js/plugin-core@0.1.5
|
|
16
|
+
- @granite-js/utils@0.1.5
|
|
17
|
+
|
|
3
18
|
## 0.1.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -22,10 +22,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
24
24
|
const fs_promises = __toESM(require("fs/promises"));
|
|
25
|
+
const es_toolkit = __toESM(require("es-toolkit"));
|
|
25
26
|
const crypto = __toESM(require("crypto"));
|
|
26
27
|
const fs = __toESM(require("fs"));
|
|
27
28
|
const __sentry_cli = __toESM(require("@sentry/cli"));
|
|
28
|
-
const es_toolkit = __toESM(require("es-toolkit"));
|
|
29
29
|
|
|
30
30
|
//#region src/snippets.ts
|
|
31
31
|
const SENTRY_DEBUG_ID_HOLDER = "SENTRY_DEBUG_ID";
|
|
@@ -129,6 +129,7 @@ const sentryPlugin = ({ enabled = true,...options } = {}) => {
|
|
|
129
129
|
build: {
|
|
130
130
|
order: "post",
|
|
131
131
|
handler: async function(config) {
|
|
132
|
+
const sentryResults = [];
|
|
132
133
|
const files = config.buildResults.map(({ outfile, sourcemapOutfile }) => ({
|
|
133
134
|
bundle: outfile,
|
|
134
135
|
sourcemap: sourcemapOutfile
|
|
@@ -144,12 +145,18 @@ const sentryPlugin = ({ enabled = true,...options } = {}) => {
|
|
|
144
145
|
const hermesBundle = tryResolveHermesBundle(bundle);
|
|
145
146
|
const targetBundle = hermesBundle?.hbc ?? bundle;
|
|
146
147
|
const targetSourcemap = hermesBundle?.sourcemap ?? sourcemap;
|
|
147
|
-
await writeDebugIdInjectedSourcemap(
|
|
148
|
+
await Promise.all([writeDebugIdInjectedSourcemap(sourcemap, debugId), hermesBundle?.sourcemap ? writeDebugIdInjectedSourcemap(hermesBundle?.sourcemap, debugId) : es_toolkit.noop]);
|
|
148
149
|
await sentryActions.uploadSourcemap({ root: config.cwd }, {
|
|
149
150
|
bundlePath: targetBundle,
|
|
150
151
|
sourcemapPath: targetSourcemap
|
|
151
152
|
});
|
|
153
|
+
sentryResults.push({
|
|
154
|
+
bundle,
|
|
155
|
+
sourcemap,
|
|
156
|
+
debugId
|
|
157
|
+
});
|
|
152
158
|
}
|
|
159
|
+
this.meta.sentry = sentryResults;
|
|
153
160
|
}
|
|
154
161
|
},
|
|
155
162
|
config: { esbuild: {
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as fs$2 from "fs/promises";
|
|
2
2
|
import * as fs from "fs/promises";
|
|
3
|
+
import { asyncNoop, noop } from "es-toolkit";
|
|
3
4
|
import { randomUUID } from "crypto";
|
|
4
5
|
import * as fs$1 from "fs";
|
|
5
6
|
import SentryCLI from "@sentry/cli";
|
|
6
|
-
import { asyncNoop } from "es-toolkit";
|
|
7
7
|
|
|
8
8
|
//#region src/snippets.ts
|
|
9
9
|
const SENTRY_DEBUG_ID_HOLDER = "SENTRY_DEBUG_ID";
|
|
@@ -107,6 +107,7 @@ const sentryPlugin = ({ enabled = true,...options } = {}) => {
|
|
|
107
107
|
build: {
|
|
108
108
|
order: "post",
|
|
109
109
|
handler: async function(config) {
|
|
110
|
+
const sentryResults = [];
|
|
110
111
|
const files = config.buildResults.map(({ outfile, sourcemapOutfile }) => ({
|
|
111
112
|
bundle: outfile,
|
|
112
113
|
sourcemap: sourcemapOutfile
|
|
@@ -122,12 +123,18 @@ const sentryPlugin = ({ enabled = true,...options } = {}) => {
|
|
|
122
123
|
const hermesBundle = tryResolveHermesBundle(bundle);
|
|
123
124
|
const targetBundle = hermesBundle?.hbc ?? bundle;
|
|
124
125
|
const targetSourcemap = hermesBundle?.sourcemap ?? sourcemap;
|
|
125
|
-
await writeDebugIdInjectedSourcemap(
|
|
126
|
+
await Promise.all([writeDebugIdInjectedSourcemap(sourcemap, debugId), hermesBundle?.sourcemap ? writeDebugIdInjectedSourcemap(hermesBundle?.sourcemap, debugId) : noop]);
|
|
126
127
|
await sentryActions.uploadSourcemap({ root: config.cwd }, {
|
|
127
128
|
bundlePath: targetBundle,
|
|
128
129
|
sourcemapPath: targetSourcemap
|
|
129
130
|
});
|
|
131
|
+
sentryResults.push({
|
|
132
|
+
bundle,
|
|
133
|
+
sourcemap,
|
|
134
|
+
debugId
|
|
135
|
+
});
|
|
130
136
|
}
|
|
137
|
+
this.meta.sentry = sentryResults;
|
|
131
138
|
}
|
|
132
139
|
},
|
|
133
140
|
config: { esbuild: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@granite-js/plugin-sentry",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6",
|
|
5
5
|
"description": "Plugin for integrating Sentry with Granite applications",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"vitest": "^3.1.4"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@granite-js/plugin-core": "0.1.
|
|
37
|
-
"@granite-js/utils": "0.1.
|
|
36
|
+
"@granite-js/plugin-core": "0.1.6",
|
|
37
|
+
"@granite-js/utils": "0.1.6",
|
|
38
38
|
"@sentry/cli": "^2.45.0",
|
|
39
39
|
"es-toolkit": "^1.38.0",
|
|
40
40
|
"execa": "^5"
|