Skip to content

Commit 83322da

Browse files
committed
Fix npm package metadata and add classic script browser build
- Whitelist published files (dist, src) so tarballs no longer ship test/ and tsconfig.json; react-native now ships src for its source maps - Mark @exceptionless/angularjs as side-effectful since importing it registers the Angular module - Drop node's unpkg/jsdelivr fields that pointed at a file its build never produces - Add types conditions to exports and type the react-native expo-plugin subpath - Use git+https repository URLs with package directories and add homepage - Add an IIFE build of @exceptionless/browser (dist/index.global[.min].js) exposing a global exceptionless object, with docs and a jsdom test - Version CDN snippets (@3) and add LICENSE to vue - Add lint:packages (publint + attw) root script
1 parent 54ac83f commit 83322da

17 files changed

Lines changed: 905 additions & 34 deletions

File tree

‎.agents/skills/exceptionless-javascript/references/client-angularjs.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ npm install @exceptionless/angularjs --save
1313
CDN or bundled script:
1414

1515
```html
16-
<script type="module" src="https://unpkg.com/@exceptionless/angularjs"></script>
16+
<script type="module" src="https://unpkg.com/@exceptionless/angularjs@3"></script>
1717
```
1818

1919
## Configure

‎.agents/skills/exceptionless-javascript/references/client-browser.md‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,21 @@ CDN:
1414

1515
```html
1616
<script type="module">
17-
import { Exceptionless } from "https://unpkg.com/@exceptionless/browser";
17+
import { Exceptionless } from "https://unpkg.com/@exceptionless/browser@3";
1818
1919
await Exceptionless.startup("API_KEY_HERE");
2020
</script>
2121
```
2222

23+
Classic script tag (no ES modules): `dist/index.global.min.js` (or unminified `dist/index.global.js`) exposes the package exports on a global `exceptionless` object. The `unpkg`/`jsdelivr` package defaults remain the ESM bundle, so name the file explicitly:
24+
25+
```html
26+
<script src="https://unpkg.com/@exceptionless/browser@3/dist/index.global.min.js"></script>
27+
<script>
28+
exceptionless.Exceptionless.startup("API_KEY_HERE");
29+
</script>
30+
```
31+
2332
## Configure
2433

2534
```js

‎README.md‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ The definition of the word exceptionless is: to be without exception. Exceptionl
99
## Browser
1010

1111
You can install the npm package via `npm install @exceptionless/browser --save`
12-
or via cdn [`https://unpkg.com/@exceptionless/browser`](https://unpkg.com/@exceptionless/browser).
12+
or via cdn [`https://unpkg.com/@exceptionless/browser@3`](https://unpkg.com/@exceptionless/browser@3).
1313
Next, you just need to call startup during your app's startup to automatically
1414
capture unhandled errors.
1515

1616
```js
17-
import { Exceptionless } from "https://unpkg.com/@exceptionless/browser";
17+
import { Exceptionless } from "https://unpkg.com/@exceptionless/browser@3";
1818

1919
await Exceptionless.startup((c) => {
2020
c.apiKey = "API_KEY_HERE";
@@ -103,14 +103,25 @@ Add the following script tag at the very beginning of your page:
103103

104104
```html
105105
<script type="module">
106-
import { Exceptionless } from "https://unpkg.com/@exceptionless/browser";
106+
import { Exceptionless } from "https://unpkg.com/@exceptionless/browser@3";
107107
108108
await Exceptionless.startup((c) => {
109109
c.apiKey = "API_KEY_HERE";
110110
});
111111
</script>
112112
```
113113

114+
For pages that can't use ES modules, load the classic script build. It exposes the package exports on a global `exceptionless` object:
115+
116+
```html
117+
<script src="https://unpkg.com/@exceptionless/browser@3/dist/index.global.min.js"></script>
118+
<script>
119+
exceptionless.Exceptionless.startup((c) => {
120+
c.apiKey = "API_KEY_HERE";
121+
});
122+
</script>
123+
```
124+
114125
##### npm
115126

116127
1. Install the package by running `npm install @exceptionless/browser --save`.

0 commit comments

Comments
 (0)