@granite-js/plugin-sentry 0.1.33 → 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,251 +1,13 @@
1
1
  # @granite-js/plugin-sentry
2
2
 
3
- ## 0.1.33
3
+ ## 1.0.0
4
4
 
5
- ### Patch Changes
6
-
7
- - @granite-js/plugin-core@0.1.33
8
- - @granite-js/utils@0.1.33
9
-
10
- ## 0.1.32
11
-
12
- ### Patch Changes
13
-
14
- - 7572713: bump version up babel
15
- - Updated dependencies [7572713]
16
- - @granite-js/plugin-core@0.1.32
17
- - @granite-js/utils@0.1.32
18
-
19
- ## 0.1.31
20
-
21
- ### Patch Changes
22
-
23
- - Updated dependencies [9bf8b50]
24
- - Updated dependencies [e957833]
25
- - @granite-js/plugin-core@0.1.31
26
- - @granite-js/utils@0.1.31
27
-
28
- ## 0.1.30
29
-
30
- ### Patch Changes
31
-
32
- - @granite-js/plugin-core@0.1.30
33
- - @granite-js/utils@0.1.30
34
-
35
- ## 0.1.29
36
-
37
- ### Patch Changes
38
-
39
- - Updated dependencies [ed4cdbf]
40
- - @granite-js/plugin-core@0.1.29
41
- - @granite-js/utils@0.1.29
42
-
43
- ## 0.1.28
44
-
45
- ### Patch Changes
46
-
47
- - 1d958cc: ci: provenance
48
- - Updated dependencies [1d958cc]
49
- - @granite-js/plugin-core@0.1.28
50
- - @granite-js/utils@0.1.28
51
-
52
- ## 0.1.27
53
-
54
- ### Patch Changes
55
-
56
- - e32b020: ci: oidc
57
- - Updated dependencies [e32b020]
58
- - @granite-js/plugin-core@0.1.27
59
- - @granite-js/utils@0.1.27
60
-
61
- ## 0.1.26
62
-
63
- ### Patch Changes
64
-
65
- - @granite-js/plugin-core@0.1.26
66
- - @granite-js/utils@0.1.26
67
-
68
- ## 0.1.25
69
-
70
- ### Patch Changes
71
-
72
- - @granite-js/plugin-core@0.1.25
73
- - @granite-js/utils@0.1.25
74
-
75
- ## 0.1.24
76
-
77
- ### Patch Changes
78
-
79
- - Updated dependencies [6e42c3d]
80
- - @granite-js/plugin-core@0.1.24
81
- - @granite-js/utils@0.1.24
82
-
83
- ## 0.1.23
84
-
85
- ### Patch Changes
86
-
87
- - @granite-js/plugin-core@0.1.23
88
- - @granite-js/utils@0.1.23
89
-
90
- ## 0.1.22
91
-
92
- ### Patch Changes
93
-
94
- - @granite-js/plugin-core@0.1.22
95
- - @granite-js/utils@0.1.22
96
-
97
- ## 0.1.21
98
-
99
- ### Patch Changes
100
-
101
- - @granite-js/plugin-core@0.1.21
102
- - @granite-js/utils@0.1.21
103
-
104
- ## 0.1.20
105
-
106
- ### Patch Changes
107
-
108
- - @granite-js/plugin-core@0.1.20
109
- - @granite-js/utils@0.1.20
110
-
111
- ## 0.1.19
112
-
113
- ### Patch Changes
114
-
115
- - Updated dependencies [e9a3daf]
116
- - @granite-js/plugin-core@0.1.19
117
- - @granite-js/utils@0.1.19
118
-
119
- ## 0.1.18
120
-
121
- ### Patch Changes
122
-
123
- - @granite-js/plugin-core@0.1.18
124
- - @granite-js/utils@0.1.18
125
-
126
- ## 0.1.17
127
-
128
- ### Patch Changes
129
-
130
- - 9c415df: supports dynamic plugin config
131
- - 7a81746: fix wrong metadata
132
- - Updated dependencies [9c415df]
133
- - @granite-js/plugin-core@0.1.17
134
- - @granite-js/utils@0.1.17
135
-
136
- ## 0.1.16
137
-
138
- ### Patch Changes
139
-
140
- - c9b4fff: replace .js to .hbc
141
- - @granite-js/plugin-core@0.1.16
142
- - @granite-js/utils@0.1.16
143
-
144
- ## 0.1.15
145
-
146
- ### Patch Changes
147
-
148
- - d16ee87: Add useInitialProps, useInitialSearchParams hook.
149
- - Updated dependencies [d16ee87]
150
- - @granite-js/plugin-core@0.1.15
151
- - @granite-js/utils@0.1.15
152
-
153
- ## 0.1.14
154
-
155
- ### Patch Changes
156
-
157
- - @granite-js/plugin-core@0.1.14
158
- - @granite-js/utils@0.1.14
159
-
160
- ## 0.1.13
161
-
162
- ### Patch Changes
163
-
164
- - @granite-js/plugin-core@0.1.13
165
- - @granite-js/utils@0.1.13
166
-
167
- ## 0.1.12
168
-
169
- ### Patch Changes
170
-
171
- - d1e6585: fix module resolutions
172
- - Updated dependencies [d1e6585]
173
- - Updated dependencies [1e99fe1]
174
- - @granite-js/plugin-core@0.1.12
175
- - @granite-js/utils@0.1.12
176
-
177
- ## 0.1.11
178
-
179
- ### Patch Changes
180
-
181
- - Updated dependencies [d3a2b58]
182
- - @granite-js/plugin-core@0.1.11
183
- - @granite-js/utils@0.1.11
184
-
185
- ## 0.1.10
186
-
187
- ### Patch Changes
188
-
189
- - Updated dependencies [9438be5]
190
- - @granite-js/plugin-core@0.1.10
191
- - @granite-js/utils@0.1.10
192
-
193
- ## 0.1.9
194
-
195
- ### Patch Changes
196
-
197
- - Updated dependencies [935bb36]
198
- - @granite-js/plugin-core@0.1.9
199
- - @granite-js/utils@0.1.9
200
-
201
- ## 0.1.8
202
-
203
- ### Patch Changes
204
-
205
- - Updated dependencies [b69366c]
206
- - @granite-js/plugin-core@0.1.8
207
- - @granite-js/utils@0.1.8
208
-
209
- ## 0.1.7
210
-
211
- ### Patch Changes
212
-
213
- - @granite-js/plugin-core@0.1.7
214
- - @granite-js/utils@0.1.7
215
-
216
- ## 0.1.6
217
-
218
- ### Patch Changes
219
-
220
- - 24571e5: read bundle content before extracting debug ID
221
- - @granite-js/plugin-core@0.1.6
222
- - @granite-js/utils@0.1.6
223
-
224
- ## 0.1.5
225
-
226
- ### Patch Changes
227
-
228
- - @granite-js/plugin-core@0.1.5
229
- - @granite-js/utils@0.1.5
230
-
231
- ## 0.1.4
232
-
233
- ### Patch Changes
234
-
235
- - @granite-js/plugin-core@0.1.4
236
- - @granite-js/utils@0.1.4
237
-
238
- ## 0.1.3
239
-
240
- ### Patch Changes
241
-
242
- - @granite-js/plugin-core@0.1.3
243
- - @granite-js/utils@0.1.3
5
+ ### Major Changes
244
6
 
245
- ## 0.1.2
7
+ - 260daab: feat: introduce support react native 0.84
246
8
 
247
9
  ### Patch Changes
248
10
 
249
- - 9a2e43f: impl sentry plugin
250
- - @granite-js/plugin-core@0.1.2
251
- - @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.33",
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.33",
44
- "@granite-js/utils": "0.1.33",
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"