Skip to content

Include sourcemaps in npm tarballs #3978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 8, 2025

Conversation

manzt
Copy link
Contributor

@manzt manzt commented Mar 18, 2025

Sourcemaps are not currently published to npm due to the omission of
*.map under "files" in package.json. This leads to many downstream
challenges with editors and developers tools that expect these files
(since they are linked to the source .d.ts and .js files).

To illustrate:

yarn build
cd packages/base
npm pack

before

npm notice
npm notice 📦  @jupyter-widgets/base@6.0.10
npm notice Tarball Contents
npm notice 1.0kB css/index.css
npm notice 203B lib/backbone-patch.d.ts
npm notice 4.6kB lib/backbone-patch.js
npm notice 468B lib/errorwidget.d.ts
npm notice 2.8kB lib/errorwidget.js
npm notice 325B lib/index.d.ts
npm notice 426B lib/index.js
npm notice 4.9kB lib/manager.d.ts
npm notice 149B lib/manager.js
npm notice 1.4kB lib/nativeview.d.ts
npm notice 5.5kB lib/nativeview.js
npm notice 1.1kB lib/registry.d.ts
npm notice 335B lib/registry.js
npm notice 6.2kB lib/services-shim.d.ts
npm notice 7.8kB lib/services-shim.js
npm notice 4.1kB lib/utils.d.ts
npm notice 8.6kB lib/utils.js
npm notice 142B lib/version.d.ts
npm notice 227B lib/version.js
npm notice 2.4kB lib/viewlist.d.ts
npm notice 3.9kB lib/viewlist.js
npm notice 926B lib/widget_layout.d.ts
npm notice 3.5kB lib/widget_layout.js
npm notice 1.1kB lib/widget_style.d.ts
npm notice 3.7kB lib/widget_style.js
npm notice 12.9kB lib/widget.d.ts
npm notice 36.8kB lib/widget.js
npm notice 2.6kB package.json
npm notice Tarball Details
npm notice name: @jupyter-widgets/base
npm notice version: 6.0.10
npm notice filename: jupyter-widgets-base-6.0.10.tgz
npm notice package size: 30.3 kB
npm notice unpacked size: 118.2 kB
npm notice shasum: 87223c07f6e1f9321cbee063f211c5c4cf4a7daa
npm notice integrity: sha512-oF09hEiOTGr0j[...]r0pGFdcDc2K6A==
npm notice total files: 28
npm notice
jupyter-widgets-base-6.0.10.tgz

after

npm notice
npm notice 📦  @jupyter-widgets/base@6.0.10
npm notice Tarball Contents
npm notice 1.0kB css/index.css
npm notice 203B lib/backbone-patch.d.ts
npm notice 309B lib/backbone-patch.d.ts.map
npm notice 4.6kB lib/backbone-patch.js
npm notice 2.6kB lib/backbone-patch.js.map
npm notice 468B lib/errorwidget.d.ts
npm notice 486B lib/errorwidget.d.ts.map
npm notice 2.8kB lib/errorwidget.js
npm notice 2.5kB lib/errorwidget.js.map
npm notice 325B lib/index.d.ts
npm notice 318B lib/index.d.ts.map
npm notice 426B lib/index.js
npm notice 342B lib/index.js.map
npm notice 4.9kB lib/manager.d.ts
npm notice 2.0kB lib/manager.d.ts.map
npm notice 149B lib/manager.js
npm notice 130B lib/manager.js.map
npm notice 1.4kB lib/nativeview.d.ts
npm notice 728B lib/nativeview.d.ts.map
npm notice 5.5kB lib/nativeview.js
npm notice 3.7kB lib/nativeview.js.map
npm notice 1.1kB lib/registry.d.ts
npm notice 713B lib/registry.d.ts.map
npm notice 335B lib/registry.js
npm notice 253B lib/registry.js.map
npm notice 6.2kB lib/services-shim.d.ts
npm notice 3.1kB lib/services-shim.d.ts.map
npm notice 7.8kB lib/services-shim.js
npm notice 4.4kB lib/services-shim.js.map
npm notice 4.1kB lib/utils.d.ts
npm notice 1.6kB lib/utils.d.ts.map
npm notice 8.6kB lib/utils.js
npm notice 5.2kB lib/utils.js.map
npm notice 142B lib/version.d.ts
npm notice 172B lib/version.d.ts.map
npm notice 227B lib/version.js
npm notice 216B lib/version.js.map
npm notice 2.4kB lib/viewlist.d.ts
npm notice 1.1kB lib/viewlist.d.ts.map
npm notice 3.9kB lib/viewlist.js
npm notice 2.2kB lib/viewlist.js.map
npm notice 926B lib/widget_layout.d.ts
npm notice 570B lib/widget_layout.d.ts.map
npm notice 3.5kB lib/widget_layout.js
npm notice 2.8kB lib/widget_layout.js.map
npm notice 1.1kB lib/widget_style.d.ts
npm notice 726B lib/widget_style.d.ts.map
npm notice 3.7kB lib/widget_style.js
npm notice 3.2kB lib/widget_style.js.map
npm notice 12.9kB lib/widget.d.ts
npm notice 6.4kB lib/widget.d.ts.map
npm notice 36.8kB lib/widget.js
npm notice 24.6kB lib/widget.js.map
npm notice 2.7kB package.json
npm notice Tarball Details
npm notice name: @jupyter-widgets/base
npm notice version: 6.0.10
npm notice filename: jupyter-widgets-base-6.0.10.tgz
npm notice package size: 45.4 kB
npm notice unpacked size: 188.6 kB
npm notice shasum: c7436f7bface4b92e483197fc0a04f5377b68d12
npm notice integrity: sha512-OC6OkpnLmcvtX[...]LbJo267ryfang==
npm notice total files: 54
npm notice
jupyter-widgets-base-6.0.10.tgz

Copy link

Binder 👈 Launch a binder notebook on branch manzt/ipywidgets/manzt/sourcemaps

@manzt
Copy link
Contributor Author

manzt commented Mar 18, 2025

CI seems to be failing because of an outdate GH Action.

@fcollonval
Copy link
Contributor

Hey @manzt could catch!

I guess you should also add the Typescript src files as in JupyterLab: https://github.com/jupyterlab/jupyterlab/blob/85c82eba1caa7e28a0d818c0840e13756c1b1256/packages/apputils/package.json#L34

@manzt
Copy link
Contributor Author

manzt commented Mar 26, 2025

Done!

manzt added 2 commits April 8, 2025 12:04
Sourcemaps are not currently published to npm due to the omission of
`*.map` under `"files"` in `package.json`. This leads to many downstream
challenges with editors and developers tools that expect these files
(since they are linked to the source `.d.ts` and `.js` files).
Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

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

Thanks! I just rebased from the UI

@martinRenou martinRenou merged commit 4268105 into jupyter-widgets:main Apr 8, 2025
22 checks passed
@manzt manzt deleted the manzt/sourcemaps branch April 9, 2025 23:12
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