Skip to content

Commit 42688fa

Browse files
committed
chore: readme
1 parent 9f4bcdb commit 42688fa

File tree

2 files changed

+40
-28
lines changed

2 files changed

+40
-28
lines changed

README.md

+21-9
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ if (!!sentry && !!uploadSentry) {
5252
}
5353
```
5454

55+
###debug
56+
57+
For debug mode to work correctly you will need to add this to your webpack (see demo app)
58+
59+
```js
60+
nsWebpack.chainWebpack(config=>{
61+
config.entry('bundle').prepend('@nativescript-community/sentry/process');
62+
});
63+
```
64+
5565
## Fastlane
5666

5767
If you use fastlane you can use it to create release and upload dsyms
@@ -88,18 +98,20 @@ sentry_upload_dsym
8898

8999
```typescript
90100
import * as Sentry from '@nativescript-community/sentry';
91-
import { getBuildNumber } from '@nativescript-community/extendedinfo';
101+
import { getAppId, getBuildNumber, getVersionName } from 'nativescript-extendedinfo';
92102

93103
const buildNumber = await getBuildNumber();
94-
// setting the platform in dist allows to have
95-
// android and ios dist inside the same release
96-
const dist = `${buildNumber}.${global.isAndroid ? 'android' : 'ios'}`;
104+
const versionName = await getVersionName();
105+
const buildNumber = await getBuildNumber();
106+
const appId = await getAppId();
97107
Sentry.init({
98-
dsn: "__DSN__",
99-
// SENTRY_PREFIX is the same as the one you use in webpack config
100-
appPrefix: SENTRY_PREFIX,
101-
dist
102-
});
108+
dsn: SENTRY_DSN,
109+
debug: true,
110+
enableAutoPerformanceTracking: true,
111+
appPrefix: SENTRY_PREFIX,
112+
release: `${appId}@${versionName}+${buildNumber}`,
113+
dist: `${buildNumber}.${__ANDROID__ ? 'android' : 'ios'}`
114+
});
103115
```
104116

105117
## Reporting NativeScript errors

demo-vue/webpack.config.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,24 @@ module.exports = (env, params = {}) => {
3838
buildNumber = plistData.match(/<key>CFBundleVersion<\/key>[\s\n]*<string>([0-9]*)<\/string>/)[1];
3939
}
4040
config.resolve.symlinks = false;
41-
// config.devtool = false;
42-
// config.plugins.push(
43-
// new webpack.SourceMapDevToolPlugin({
44-
// append: `\n//# sourceMappingURL=${SENTRY_PREFIX}[file].map`,
45-
// filename: join(SOURCEMAP_REL_DIR, '[file].map')
46-
// })
47-
// );
48-
// config.plugins.push(
49-
// new SentryCliPlugin({
50-
// release: appVersion,
51-
// urlPrefix: SENTRY_PREFIX,
52-
// rewrite: true,
53-
// cleanArtifacts: true,
54-
// release: `${nconfig.id}@${appVersion}+${buildNumber}`,
55-
// dist: `${buildNumber}.${platform}`,
56-
// ignoreFile: '.sentrycliignore',
57-
// include: [dist, join(dist, SOURCEMAP_REL_DIR)]
58-
// })
59-
// );
41+
config.devtool = false;
42+
config.plugins.push(
43+
new webpack.SourceMapDevToolPlugin({
44+
append: `\n//# sourceMappingURL=${SENTRY_PREFIX}[file].map`,
45+
filename: join(SOURCEMAP_REL_DIR, '[file].map')
46+
})
47+
);
48+
config.plugins.push(
49+
new SentryCliPlugin({
50+
release: appVersion,
51+
urlPrefix: SENTRY_PREFIX,
52+
rewrite: true,
53+
cleanArtifacts: true,
54+
release: `${nconfig.id}@${appVersion}+${buildNumber}`,
55+
dist: `${buildNumber}.${platform}`,
56+
ignoreFile: '.sentrycliignore',
57+
include: [dist, join(dist, SOURCEMAP_REL_DIR)]
58+
})
59+
);
6060
return config;
6161
};

0 commit comments

Comments
 (0)