Skip to content

Fix npm package metadata and add classic script browser build - #222

Draft
ejsmith wants to merge 3 commits into
mainfrom
fix/package-metadata
Draft

ejsmith wants to merge 3 commits into
mainfrom
fix/package-metadata

Conversation

@ejsmith

@ejsmith ejsmith commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Packaging fixes for the SDK packages. All changes are non-breaking for 3.x consumers. The packages stay ESM-only; no CommonJS or IIFE output is added.

  • files whitelist (dist, src). Tarballs no longer ship test/ or tsconfig.json. src is kept because the tsc sourceMap/declarationMap output points to ../src. react-native already had a files list but left out src, so its maps were broken; it now includes src.
  • angularjs sideEffects: true: importing it registers the exceptionless Angular module, so bundlers must not drop the import. The other packages only create a client instance when imported, so false stays correct for them.
  • node: removed the unpkg/jsdelivr fields. They pointed at dist/index.bundle.min.js, which the node build never produces (publint reported this as an error).
  • exports: added types/default conditions; main/types are kept. The react-native ./expo-plugin subpath now has types (expo-plugin/index.d.cts), which fixes attw's UntypedResolution error.
  • Docs: CDN snippets now use @3.
  • Metadata: repository is now git+https with directory, homepage is added, and vue gets a LICENSE file.
  • npm run lint:packages: runs publint --strict and attw --pack . --profile esm-only on each SDK package after a build. Both new devDependencies have no install scripts, and the set of npm audit findings is the same as before. This isn't in CI yet; it should be added after the workflow-hardening PR lands.

Tarball file counts (npm pack --dry-run; the "before" numbers match the published 3.2.1):

package before after
core 225 207
browser 51 47 (−test/tsconfig)
angularjs 13 12
node 52 50
react 19 17
react-native 59 72 (+src for source maps, +expo-plugin types)
vue 12 12 (−tsconfig, +LICENSE)

Verification:

  • npm ci, all SDK package builds, npm test (348 passed), npm run lint and npm run lint:packages pass.
  • The root npm run build still fails at the Next.js example with the known SecurityFatalError for next@16.4.1. That's not caused by this PR; the open Dependabot PR fixes it.

- 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
Copilot AI balanced review requested due to automatic review settings December 2, 2026 01:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T01:08:02.574200Z 83322da PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are identified for the packaging and browser-bundle changes.

No open issues 🎉

What changed in this PR

Improves npm packaging across the Exceptionless SDKs and adds a classic-script browser build alongside the existing ES module bundles.

Changes:

  • Standardizes package metadata, published files, and type exports.
  • Adds browser global bundles, startup tests, and CDN documentation.
  • Introduces package validation with publint and Are the Types Wrong.
File Description
README.md Documents classic scripts and versioned CDN URLs.
packages/​vue/​package.json Updates metadata, exports, and published files.
packages/​vue/​LICENSE Adds the Apache 2.0 license.
packages/​react/​package.json Updates metadata, exports, and published files.
packages/​react-native/​package.json Includes sources and Expo plugin type exports.
packages/​react-native/​expo-plugin/​index.d.cts Declares Expo plugin types.
packages/​node/​package.json Updates packaging and removes invalid CDN targets.
packages/​core/​package.json Updates metadata, exports, and published files.
packages/​browser/​test/​global-bundle.test.ts Tests both classic bundles and client startup.
packages/​browser/​README.md Documents classic-script installation.
packages/​browser/​package.json Adds global builds and updates packaging.
packages/​angularjs/​README.md Pins the CDN example to major version 3.
packages/​angularjs/​package.json Preserves registration side effects and updates packaging.
package.json Adds package-validation tooling and command.
package-lock.json Locks new validation dependencies.
.agents/​skills/​exceptionless-javascript/​references/​client-browser.md Documents classic builds and versioned CDN usage.
.agents/​skills/​exceptionless-javascript/​references/​client-angularjs.md Pins the CDN example to major version 3.

Review effort: Balanced

npm test on a fresh checkout failed because the test reads dist. CI
still runs it and fails if the bundle is missing.
Comment thread packages/browser/package.json Outdated
},
"scripts": {
"build": "tsc -p tsconfig.json && esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=esm --outfile=dist/index.bundle.js && esbuild src/index.ts --bundle --minify --sourcemap --target=es2022 --format=esm --outfile=dist/index.bundle.min.js",
"build": "tsc -p tsconfig.json && esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=esm --outfile=dist/index.bundle.js && esbuild src/index.ts --bundle --minify --sourcemap --target=es2022 --format=esm --outfile=dist/index.bundle.min.js && esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=iife --global-name=exceptionless --outfile=dist/index.global.js && esbuild src/index.ts --bundle --minify --sourcemap --target=es2022 --format=iife --global-name=exceptionless --outfile=dist/index.global.min.js",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should NOT be supporting cjs in 2026, every single javascript runtime is fully ESM compatible including tooling to take this lib and make an iffy bundle. Also we should ditch the legacy angular package it's not supported, if anything update it to be latest angular which would be esm.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Removed the IIFE build, its test and the script-tag docs in cb10d05. The packages stay ESM-only (attw runs with --profile esm-only). Dropping AngularJS and adding a modern Angular package is a 4.0 change, so it goes in its own PR rather than this one.

@ejsmith
ejsmith marked this pull request as draft December 2, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants