Skip to content

Commit e878e28

Browse files
author
farfromrefug
committed
readme/doc
1 parent 8b1c801 commit e878e28

27 files changed

+2143
-1
lines changed

README.md

Lines changed: 132 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1-
[![npm](https://img.shields.io/npm/v/@nativescript-community/sentry.svg)](https://www.npmjs.com/package/@nativescript-community/sentry)
1+
<!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->[![npm](https://img.shields.io/npm/v/@nativescript-community/sentry.svg)](https://www.npmjs.com/package/@nativescript-community/sentry)
22
[![npm](https://img.shields.io/npm/dt/@nativescript-community/sentry.svg?label=npm%20downloads)](https://www.npmjs.com/package/@nativescript-community/sentry)
33
[![GitHub forks](https://img.shields.io/github/forks/nativescript-community/sentry.svg)](https://github.com/nativescript-community/sentry/network)
44
[![GitHub stars](https://img.shields.io/github/stars/nativescript-community/sentry.svg)](https://github.com/nativescript-community/sentry/stargazers)
55

6+
7+
[](#installation)
8+
69
# Installation
710

811
* `tns plugin add @nativescript-community/sentry`
912

1013
Be sure to run a new build after adding plugins to avoid any issues.
1114

15+
16+
[](#configuration)
17+
1218
# Configuration
1319

20+
21+
[](#webpack-)
22+
1423
## Webpack
1524

1625
You will need to add something like this to your webpack config so that the source maps gets uploaded. I dont set `auth` or `project` in the options as i use a `.sentryclirc` config file.
@@ -62,6 +71,9 @@ nsWebpack.chainWebpack(config=>{
6271
});
6372
```
6473

74+
75+
[](#fastlane)
76+
6577
## Fastlane
6678

6779
If you use fastlane you can use it to create release and upload dsyms
@@ -94,6 +106,9 @@ sentry_create_release(
94106
sentry_upload_dsym
95107
```
96108

109+
110+
[](#usage-in-the-app)
111+
97112
# Usage in the app
98113

99114
```typescript
@@ -110,11 +125,17 @@ Sentry.init({
110125
});
111126
```
112127

128+
129+
[](#reporting-nativescript-errors)
130+
113131
## Reporting NativeScript errors
114132

115133
The `onerror` method ensures all unhandled NativeScript errors will be caught by Sentry in production, using a [custom error handler](https://docs.nativescript.org/core-concepts/error-handling).
116134

117135

136+
137+
[](#reporting-handled-errors)
138+
118139
## Reporting handled errors
119140

120141
If you would like to send a handled error to Bugsnag, you can pass any Error object to Sentry notify method:
@@ -127,6 +148,9 @@ try {
127148
}
128149
```
129150

151+
152+
[](#reporting-promise-rejections)
153+
130154
## Reporting promise rejections
131155

132156
To report a promise rejection, use notify() as a part of the catch block:
@@ -142,6 +166,9 @@ new Promise(function(resolve, reject) {
142166
});
143167
```
144168

169+
170+
[](#sending-diagnostic-data)
171+
145172
## Sending diagnostic data
146173

147174
### Automatically captured diagnostics
@@ -157,6 +184,9 @@ Bugsnag will automatically capture and attach the following diagnostic data:
157184
* A device- and vendor-specific identifier
158185

159186

187+
188+
[](#identifying-users)
189+
160190
## Identifying users
161191

162192
In order to correlate errors with customer reports, or to see a list of users who experienced each error, it is helpful to capture and display user information. Information set on the Bugsnag client is sent with each error report:
@@ -165,6 +195,9 @@ In order to correlate errors with customer reports, or to see a list of users wh
165195
Sentry.setUser({"email": "[email protected]"});
166196
```
167197

198+
199+
[](#logging-breadcrumbs)
200+
168201
## Logging breadcrumbs
169202

170203
In order to understand what happened in your application before each crash, it can be helpful to leave short log statements that we call breadcrumbs. The last several breadcrumbs are attached to a crash to help diagnose what events lead to the error.
@@ -194,3 +227,101 @@ Sentry.addBreadcrumb({
194227
level: 'info'
195228
});
196229
```
230+
231+
232+
[](#demos-and-development)
233+
234+
## Demos and Development
235+
236+
237+
### Repo Setup
238+
239+
The repo uses submodules. If you did not clone with ` --recursive` then you need to call
240+
```
241+
git submodule update --init
242+
```
243+
244+
The package manager used to install and link dependencies must be `pnpm` or `yarn`. `npm` wont work.
245+
246+
To develop and test:
247+
if you use `yarn` then run `yarn`
248+
if you use `pnpm` then run `pnpm i`
249+
250+
**Interactive Menu:**
251+
252+
To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.
253+
254+
### Build
255+
256+
```bash
257+
npm run build.all
258+
```
259+
WARNING: it seems `yarn build.all` wont always work (not finding binaries in `node_modules/.bin`) which is why the doc explicitly uses `npm run`
260+
261+
### Demos
262+
263+
```bash
264+
npm run demo.[ng|react|svelte|vue].[ios|android]
265+
266+
npm run demo.svelte.ios # Example
267+
```
268+
269+
Demo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in `demo-[ng|react|svelte|vue]`
270+
Instead you work in `demo-snippets/[ng|react|svelte|vue]`
271+
You can start from the `install.ts` of each flavor to see how to register new demos
272+
273+
274+
[](#contributing)
275+
276+
## Contributing
277+
278+
### Update repo
279+
280+
You can update the repo files quite easily
281+
282+
First update the submodules
283+
284+
```bash
285+
npm run update
286+
```
287+
288+
Then commit the changes
289+
Then update common files
290+
291+
```bash
292+
npm run sync
293+
```
294+
Then you can run `yarn|pnpm`, commit changed files if any
295+
296+
### Update readme
297+
```bash
298+
npm run readme
299+
```
300+
301+
### Update doc
302+
```bash
303+
npm run doc
304+
```
305+
306+
### Publish
307+
308+
The publishing is completely handled by `lerna` (you can add `-- --bump major` to force a major release)
309+
Simply run
310+
```shell
311+
npm run publish
312+
```
313+
314+
### modifying submodules
315+
316+
The repo uses https:// for submodules which means you won't be able to push directly into the submodules.
317+
One easy solution is t modify `~/.gitconfig` and add
318+
```
319+
[url "ssh://[email protected]/"]
320+
pushInsteadOf = https://github.com/
321+
```
322+
323+
[](#questions)
324+
325+
## Questions
326+
327+
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).

docs/assets/highlight.css

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
:root {
2+
--light-hl-0: #AF00DB;
3+
--dark-hl-0: #C586C0;
4+
--light-hl-1: #000000;
5+
--dark-hl-1: #D4D4D4;
6+
--light-hl-2: #001080;
7+
--dark-hl-2: #9CDCFE;
8+
--light-hl-3: #0000FF;
9+
--dark-hl-3: #569CD6;
10+
--light-hl-4: #795E26;
11+
--dark-hl-4: #DCDCAA;
12+
--light-hl-5: #A31515;
13+
--dark-hl-5: #CE9178;
14+
--light-hl-6: #EE0000;
15+
--dark-hl-6: #D7BA7D;
16+
--light-hl-7: #000000FF;
17+
--dark-hl-7: #D4D4D4;
18+
--light-hl-8: #0070C1;
19+
--dark-hl-8: #4FC1FF;
20+
--light-hl-9: #811F3F;
21+
--dark-hl-9: #D16969;
22+
--light-hl-10: #D16969;
23+
--dark-hl-10: #CE9178;
24+
--light-hl-11: #000000;
25+
--dark-hl-11: #D7BA7D;
26+
--light-hl-12: #098658;
27+
--dark-hl-12: #B5CEA8;
28+
--light-hl-13: #008000;
29+
--dark-hl-13: #6A9955;
30+
--light-hl-14: #267F99;
31+
--dark-hl-14: #4EC9B0;
32+
--light-hl-15: #000000;
33+
--dark-hl-15: #C8C8C8;
34+
--light-code-background: #FFFFFF;
35+
--dark-code-background: #1E1E1E;
36+
}
37+
38+
@media (prefers-color-scheme: light) { :root {
39+
--hl-0: var(--light-hl-0);
40+
--hl-1: var(--light-hl-1);
41+
--hl-2: var(--light-hl-2);
42+
--hl-3: var(--light-hl-3);
43+
--hl-4: var(--light-hl-4);
44+
--hl-5: var(--light-hl-5);
45+
--hl-6: var(--light-hl-6);
46+
--hl-7: var(--light-hl-7);
47+
--hl-8: var(--light-hl-8);
48+
--hl-9: var(--light-hl-9);
49+
--hl-10: var(--light-hl-10);
50+
--hl-11: var(--light-hl-11);
51+
--hl-12: var(--light-hl-12);
52+
--hl-13: var(--light-hl-13);
53+
--hl-14: var(--light-hl-14);
54+
--hl-15: var(--light-hl-15);
55+
--code-background: var(--light-code-background);
56+
} }
57+
58+
@media (prefers-color-scheme: dark) { :root {
59+
--hl-0: var(--dark-hl-0);
60+
--hl-1: var(--dark-hl-1);
61+
--hl-2: var(--dark-hl-2);
62+
--hl-3: var(--dark-hl-3);
63+
--hl-4: var(--dark-hl-4);
64+
--hl-5: var(--dark-hl-5);
65+
--hl-6: var(--dark-hl-6);
66+
--hl-7: var(--dark-hl-7);
67+
--hl-8: var(--dark-hl-8);
68+
--hl-9: var(--dark-hl-9);
69+
--hl-10: var(--dark-hl-10);
70+
--hl-11: var(--dark-hl-11);
71+
--hl-12: var(--dark-hl-12);
72+
--hl-13: var(--dark-hl-13);
73+
--hl-14: var(--dark-hl-14);
74+
--hl-15: var(--dark-hl-15);
75+
--code-background: var(--dark-code-background);
76+
} }
77+
78+
:root[data-theme='light'] {
79+
--hl-0: var(--light-hl-0);
80+
--hl-1: var(--light-hl-1);
81+
--hl-2: var(--light-hl-2);
82+
--hl-3: var(--light-hl-3);
83+
--hl-4: var(--light-hl-4);
84+
--hl-5: var(--light-hl-5);
85+
--hl-6: var(--light-hl-6);
86+
--hl-7: var(--light-hl-7);
87+
--hl-8: var(--light-hl-8);
88+
--hl-9: var(--light-hl-9);
89+
--hl-10: var(--light-hl-10);
90+
--hl-11: var(--light-hl-11);
91+
--hl-12: var(--light-hl-12);
92+
--hl-13: var(--light-hl-13);
93+
--hl-14: var(--light-hl-14);
94+
--hl-15: var(--light-hl-15);
95+
--code-background: var(--light-code-background);
96+
}
97+
98+
:root[data-theme='dark'] {
99+
--hl-0: var(--dark-hl-0);
100+
--hl-1: var(--dark-hl-1);
101+
--hl-2: var(--dark-hl-2);
102+
--hl-3: var(--dark-hl-3);
103+
--hl-4: var(--dark-hl-4);
104+
--hl-5: var(--dark-hl-5);
105+
--hl-6: var(--dark-hl-6);
106+
--hl-7: var(--dark-hl-7);
107+
--hl-8: var(--dark-hl-8);
108+
--hl-9: var(--dark-hl-9);
109+
--hl-10: var(--dark-hl-10);
110+
--hl-11: var(--dark-hl-11);
111+
--hl-12: var(--dark-hl-12);
112+
--hl-13: var(--dark-hl-13);
113+
--hl-14: var(--dark-hl-14);
114+
--hl-15: var(--dark-hl-15);
115+
--code-background: var(--dark-code-background);
116+
}
117+
118+
.hl-0 { color: var(--hl-0); }
119+
.hl-1 { color: var(--hl-1); }
120+
.hl-2 { color: var(--hl-2); }
121+
.hl-3 { color: var(--hl-3); }
122+
.hl-4 { color: var(--hl-4); }
123+
.hl-5 { color: var(--hl-5); }
124+
.hl-6 { color: var(--hl-6); }
125+
.hl-7 { color: var(--hl-7); }
126+
.hl-8 { color: var(--hl-8); }
127+
.hl-9 { color: var(--hl-9); }
128+
.hl-10 { color: var(--hl-10); }
129+
.hl-11 { color: var(--hl-11); }
130+
.hl-12 { color: var(--hl-12); }
131+
.hl-13 { color: var(--hl-13); }
132+
.hl-14 { color: var(--hl-14); }
133+
.hl-15 { color: var(--hl-15); }
134+
pre, code { background: var(--code-background); }

docs/assets/main.js

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/navigation.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/search.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)