@granite-js/plugin-sentry 0.1.34 → 1.0.0

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 CHANGED
@@ -1,259 +1,13 @@
1
1
  # @granite-js/plugin-sentry
2
2
 
3
- ## 0.1.34
3
+ ## 1.0.0
4
4
 
5
- ### Patch Changes
6
-
7
- - Updated dependencies [9c39997]
8
- - @granite-js/plugin-core@0.1.34
9
- - @granite-js/utils@0.1.34
10
-
11
- ## 0.1.33
12
-
13
- ### Patch Changes
14
-
15
- - @granite-js/plugin-core@0.1.33
16
- - @granite-js/utils@0.1.33
17
-
18
- ## 0.1.32
19
-
20
- ### Patch Changes
21
-
22
- - 7572713: bump version up babel
23
- - Updated dependencies [7572713]
24
- - @granite-js/plugin-core@0.1.32
25
- - @granite-js/utils@0.1.32
26
-
27
- ## 0.1.31
28
-
29
- ### Patch Changes
30
-
31
- - Updated dependencies [9bf8b50]
32
- - Updated dependencies [e957833]
33
- - @granite-js/plugin-core@0.1.31
34
- - @granite-js/utils@0.1.31
35
-
36
- ## 0.1.30
37
-
38
- ### Patch Changes
39
-
40
- - @granite-js/plugin-core@0.1.30
41
- - @granite-js/utils@0.1.30
42
-
43
- ## 0.1.29
44
-
45
- ### Patch Changes
46
-
47
- - Updated dependencies [ed4cdbf]
48
- - @granite-js/plugin-core@0.1.29
49
- - @granite-js/utils@0.1.29
50
-
51
- ## 0.1.28
52
-
53
- ### Patch Changes
54
-
55
- - 1d958cc: ci: provenance
56
- - Updated dependencies [1d958cc]
57
- - @granite-js/plugin-core@0.1.28
58
- - @granite-js/utils@0.1.28
59
-
60
- ## 0.1.27
61
-
62
- ### Patch Changes
63
-
64
- - e32b020: ci: oidc
65
- - Updated dependencies [e32b020]
66
- - @granite-js/plugin-core@0.1.27
67
- - @granite-js/utils@0.1.27
68
-
69
- ## 0.1.26
70
-
71
- ### Patch Changes
72
-
73
- - @granite-js/plugin-core@0.1.26
74
- - @granite-js/utils@0.1.26
75
-
76
- ## 0.1.25
77
-
78
- ### Patch Changes
79
-
80
- - @granite-js/plugin-core@0.1.25
81
- - @granite-js/utils@0.1.25
82
-
83
- ## 0.1.24
84
-
85
- ### Patch Changes
86
-
87
- - Updated dependencies [6e42c3d]
88
- - @granite-js/plugin-core@0.1.24
89
- - @granite-js/utils@0.1.24
90
-
91
- ## 0.1.23
92
-
93
- ### Patch Changes
94
-
95
- - @granite-js/plugin-core@0.1.23
96
- - @granite-js/utils@0.1.23
97
-
98
- ## 0.1.22
99
-
100
- ### Patch Changes
101
-
102
- - @granite-js/plugin-core@0.1.22
103
- - @granite-js/utils@0.1.22
104
-
105
- ## 0.1.21
106
-
107
- ### Patch Changes
108
-
109
- - @granite-js/plugin-core@0.1.21
110
- - @granite-js/utils@0.1.21
111
-
112
- ## 0.1.20
113
-
114
- ### Patch Changes
115
-
116
- - @granite-js/plugin-core@0.1.20
117
- - @granite-js/utils@0.1.20
118
-
119
- ## 0.1.19
120
-
121
- ### Patch Changes
122
-
123
- - Updated dependencies [e9a3daf]
124
- - @granite-js/plugin-core@0.1.19
125
- - @granite-js/utils@0.1.19
126
-
127
- ## 0.1.18
128
-
129
- ### Patch Changes
130
-
131
- - @granite-js/plugin-core@0.1.18
132
- - @granite-js/utils@0.1.18
133
-
134
- ## 0.1.17
135
-
136
- ### Patch Changes
137
-
138
- - 9c415df: supports dynamic plugin config
139
- - 7a81746: fix wrong metadata
140
- - Updated dependencies [9c415df]
141
- - @granite-js/plugin-core@0.1.17
142
- - @granite-js/utils@0.1.17
143
-
144
- ## 0.1.16
145
-
146
- ### Patch Changes
147
-
148
- - c9b4fff: replace .js to .hbc
149
- - @granite-js/plugin-core@0.1.16
150
- - @granite-js/utils@0.1.16
151
-
152
- ## 0.1.15
153
-
154
- ### Patch Changes
155
-
156
- - d16ee87: Add useInitialProps, useInitialSearchParams hook.
157
- - Updated dependencies [d16ee87]
158
- - @granite-js/plugin-core@0.1.15
159
- - @granite-js/utils@0.1.15
160
-
161
- ## 0.1.14
162
-
163
- ### Patch Changes
164
-
165
- - @granite-js/plugin-core@0.1.14
166
- - @granite-js/utils@0.1.14
167
-
168
- ## 0.1.13
169
-
170
- ### Patch Changes
171
-
172
- - @granite-js/plugin-core@0.1.13
173
- - @granite-js/utils@0.1.13
174
-
175
- ## 0.1.12
176
-
177
- ### Patch Changes
178
-
179
- - d1e6585: fix module resolutions
180
- - Updated dependencies [d1e6585]
181
- - Updated dependencies [1e99fe1]
182
- - @granite-js/plugin-core@0.1.12
183
- - @granite-js/utils@0.1.12
184
-
185
- ## 0.1.11
186
-
187
- ### Patch Changes
188
-
189
- - Updated dependencies [d3a2b58]
190
- - @granite-js/plugin-core@0.1.11
191
- - @granite-js/utils@0.1.11
192
-
193
- ## 0.1.10
194
-
195
- ### Patch Changes
196
-
197
- - Updated dependencies [9438be5]
198
- - @granite-js/plugin-core@0.1.10
199
- - @granite-js/utils@0.1.10
200
-
201
- ## 0.1.9
202
-
203
- ### Patch Changes
204
-
205
- - Updated dependencies [935bb36]
206
- - @granite-js/plugin-core@0.1.9
207
- - @granite-js/utils@0.1.9
208
-
209
- ## 0.1.8
210
-
211
- ### Patch Changes
212
-
213
- - Updated dependencies [b69366c]
214
- - @granite-js/plugin-core@0.1.8
215
- - @granite-js/utils@0.1.8
216
-
217
- ## 0.1.7
218
-
219
- ### Patch Changes
220
-
221
- - @granite-js/plugin-core@0.1.7
222
- - @granite-js/utils@0.1.7
223
-
224
- ## 0.1.6
225
-
226
- ### Patch Changes
227
-
228
- - 24571e5: read bundle content before extracting debug ID
229
- - @granite-js/plugin-core@0.1.6
230
- - @granite-js/utils@0.1.6
231
-
232
- ## 0.1.5
233
-
234
- ### Patch Changes
235
-
236
- - @granite-js/plugin-core@0.1.5
237
- - @granite-js/utils@0.1.5
238
-
239
- ## 0.1.4
240
-
241
- ### Patch Changes
242
-
243
- - @granite-js/plugin-core@0.1.4
244
- - @granite-js/utils@0.1.4
245
-
246
- ## 0.1.3
247
-
248
- ### Patch Changes
249
-
250
- - @granite-js/plugin-core@0.1.3
251
- - @granite-js/utils@0.1.3
5
+ ### Major Changes
252
6
 
253
- ## 0.1.2
7
+ - 260daab: feat: introduce support react native 0.84
254
8
 
255
9
  ### Patch Changes
256
10
 
257
- - 9a2e43f: impl sentry plugin
258
- - @granite-js/plugin-core@0.1.2
259
- - @granite-js/utils@0.1.2
11
+ - Updated dependencies [260daab]
12
+ - @granite-js/plugin-core@1.0.0
13
+ - @granite-js/utils@1.0.0
package/dist/index.cjs CHANGED
@@ -1,4 +1,5 @@
1
- //#region rolldown:runtime
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ //#region \0rolldown/runtime.js
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -6,12 +7,16 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __getProtoOf = Object.getPrototypeOf;
7
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
9
  var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
- key = keys[i];
11
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
- get: ((k) => from[k]).bind(null, key),
13
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
- });
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) {
14
+ __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ }
15
20
  }
16
21
  return to;
17
22
  };
@@ -23,13 +28,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
28
  //#endregion
24
29
  let fs_promises = require("fs/promises");
25
30
  fs_promises = __toESM(fs_promises);
26
- let __granite_js_plugin_core = require("@granite-js/plugin-core");
31
+ let _granite_js_plugin_core = require("@granite-js/plugin-core");
27
32
  let es_toolkit = require("es-toolkit");
28
33
  let crypto = require("crypto");
29
34
  let fs = require("fs");
30
35
  fs = __toESM(fs);
31
- let __sentry_cli = require("@sentry/cli");
32
- __sentry_cli = __toESM(__sentry_cli);
36
+ let _sentry_cli = require("@sentry/cli");
37
+ _sentry_cli = __toESM(_sentry_cli);
33
38
 
34
39
  //#region src/snippets.ts
35
40
  const SENTRY_DEBUG_ID_HOLDER = "SENTRY_DEBUG_ID";
@@ -66,7 +71,7 @@ function getSentryDebugIdSnippets() {
66
71
  //#endregion
67
72
  //#region src/extractSentryDebugId.ts
68
73
  function extractSentryDebugId(bundleContent) {
69
- return bundleContent.match(/* @__PURE__ */ new RegExp(`${SENTRY_DEBUG_ID_HOLDER}=([\\w-]+)`))?.[1];
74
+ return bundleContent.match(new RegExp(`${SENTRY_DEBUG_ID_HOLDER}=([\\w-]+)`))?.[1];
70
75
  }
71
76
 
72
77
  //#endregion
@@ -110,12 +115,12 @@ function uploadSourcemap(context, { bundlePath, sourcemapPath }) {
110
115
  //#region src/sentryClientActions.ts
111
116
  function createClientActions(options) {
112
117
  if (options.enabled === false || options.useClient === false) return { uploadSourcemap: es_toolkit.asyncNoop };
113
- const client = new __sentry_cli.default(null, options);
114
- return { uploadSourcemap: async (context, options$1) => {
118
+ const client = new _sentry_cli.default(null, options);
119
+ return { uploadSourcemap: async (context, options) => {
115
120
  await uploadSourcemap({
116
121
  client,
117
122
  ...context
118
- }, options$1);
123
+ }, options);
119
124
  } };
120
125
  }
121
126
 
@@ -132,7 +137,7 @@ const sentryPlugin = ({ enabled = true, ...options } = {}) => {
132
137
  order: "post",
133
138
  handler: async function(config) {
134
139
  const sentryResults = [];
135
- const files = config.buildResults.filter(__granite_js_plugin_core.isBuildSuccess).map(({ outfile, sourcemapOutfile }) => ({
140
+ const files = config.buildResults.filter(_granite_js_plugin_core.isBuildSuccess).map(({ outfile, sourcemapOutfile }) => ({
136
141
  bundle: outfile,
137
142
  sourcemap: sourcemapOutfile
138
143
  }));
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import * as fs from "fs/promises";
1
+ import * as fs$1 from "fs/promises";
2
2
  import { isBuildSuccess } from "@granite-js/plugin-core";
3
3
  import { asyncNoop, noop } from "es-toolkit";
4
4
  import { randomUUID } from "crypto";
5
- import * as fs$1 from "fs";
5
+ import * as fs from "fs";
6
6
  import SentryCLI from "@sentry/cli";
7
7
 
8
8
  //#region src/snippets.ts
@@ -40,17 +40,17 @@ function getSentryDebugIdSnippets() {
40
40
  //#endregion
41
41
  //#region src/extractSentryDebugId.ts
42
42
  function extractSentryDebugId(bundleContent) {
43
- return bundleContent.match(/* @__PURE__ */ new RegExp(`${SENTRY_DEBUG_ID_HOLDER}=([\\w-]+)`))?.[1];
43
+ return bundleContent.match(new RegExp(`${SENTRY_DEBUG_ID_HOLDER}=([\\w-]+)`))?.[1];
44
44
  }
45
45
 
46
46
  //#endregion
47
47
  //#region src/injectSentryDebugId.ts
48
48
  async function writeDebugIdInjectedSourcemap(sourcemapPath, debugId) {
49
49
  const sourcemapObject = await injectSentryDebugId(sourcemapPath, debugId);
50
- await fs.writeFile(sourcemapPath, JSON.stringify(sourcemapObject, null, 2), "utf-8");
50
+ await fs$1.writeFile(sourcemapPath, JSON.stringify(sourcemapObject, null, 2), "utf-8");
51
51
  }
52
52
  async function injectSentryDebugId(sourcemapPath, debugId) {
53
- const sourcemapContent = await fs.readFile(sourcemapPath, "utf-8");
53
+ const sourcemapContent = await fs$1.readFile(sourcemapPath, "utf-8");
54
54
  const sourcemapObject = JSON.parse(sourcemapContent);
55
55
  sourcemapObject.debugId = debugId;
56
56
  return sourcemapObject;
@@ -60,7 +60,7 @@ async function injectSentryDebugId(sourcemapPath, debugId) {
60
60
  //#region src/resolveHermesBundle.ts
61
61
  function tryResolveHermesBundle(jsBundlePath) {
62
62
  const lookupPath = jsBundlePath.replace(/\.js$/, ".hbc");
63
- return fs$1.existsSync(lookupPath) ? {
63
+ return fs.existsSync(lookupPath) ? {
64
64
  hbc: lookupPath,
65
65
  sourcemap: `${lookupPath}.map`
66
66
  } : null;
@@ -85,11 +85,11 @@ function uploadSourcemap(context, { bundlePath, sourcemapPath }) {
85
85
  function createClientActions(options) {
86
86
  if (options.enabled === false || options.useClient === false) return { uploadSourcemap: asyncNoop };
87
87
  const client = new SentryCLI(null, options);
88
- return { uploadSourcemap: async (context, options$1) => {
88
+ return { uploadSourcemap: async (context, options) => {
89
89
  await uploadSourcemap({
90
90
  client,
91
91
  ...context
92
- }, options$1);
92
+ }, options);
93
93
  } };
94
94
  }
95
95
 
@@ -112,7 +112,7 @@ const sentryPlugin = ({ enabled = true, ...options } = {}) => {
112
112
  }));
113
113
  for (const file of files) {
114
114
  const { bundle, sourcemap } = file;
115
- const debugId = await extractSentryDebugId(await fs.readFile(bundle, "utf-8"));
115
+ const debugId = await extractSentryDebugId(await fs$1.readFile(bundle, "utf-8"));
116
116
  if (debugId == null) {
117
117
  console.error("Cannot find Sentry Debug ID");
118
118
  continue;
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.34",
4
+ "version": "1.0.0",
5
5
  "description": "Plugin for integrating Sentry with Granite applications",
6
6
  "scripts": {
7
7
  "prepack": "yarn build",
@@ -35,13 +35,13 @@
35
35
  ],
36
36
  "devDependencies": {
37
37
  "@vitest/coverage-v8": "^4.0.12",
38
- "tsdown": "^0.16.5",
39
- "typescript": "^5.8.3",
38
+ "tsdown": "0.20.3",
39
+ "typescript": "5.9.3",
40
40
  "vitest": "^4.0.12"
41
41
  },
42
42
  "dependencies": {
43
- "@granite-js/plugin-core": "0.1.34",
44
- "@granite-js/utils": "0.1.34",
43
+ "@granite-js/plugin-core": "1.0.0",
44
+ "@granite-js/utils": "1.0.0",
45
45
  "@sentry/cli": "^2.45.0",
46
46
  "es-toolkit": "^1.39.8",
47
47
  "execa": "^5"