Skip to content
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

chore: exclude TS source files from publishing #342

Merged
merged 1 commit into from
Apr 24, 2022

Conversation

JKRhb
Copy link
Member

@JKRhb JKRhb commented Apr 23, 2022

At the moment, we also publish the Typescript source files when uploading to npm which increases the bundle size. This PR would exclude them from publishing. However, also including the source files potentially makes debugging easier for users of the library.

Do you think we should remove the source files? Then we could simply merge this PR. Or should we keep them?

@coveralls
Copy link

coveralls commented Apr 23, 2022

Pull Request Test Coverage Report for Build 2216186100

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 91.749%

Totals Coverage Status
Change from base Build 2216151827: 0.0%
Covered Lines: 2821
Relevant Lines: 3033

💛 - Coveralls

@Apollon77
Copy link
Collaborator

What about examples dir? Or some of the *.md? What should be in the package?

@JKRhb
Copy link
Member Author

JKRhb commented Apr 24, 2022

Running npm publish --dry-run, it seems that the Markdown files are included but not the examples folder with the current settings. The examples could also be included, though. The main question would probably be if users would benefit more from the additional .ts source files, or if they add unwanted overhead.

$ npm publish --dry-run

> coap@1.0.7 prepublishOnly
> npm run build


> coap@1.0.7 build
> tsc -b

npm notice 
npm notice 📦  coap@1.0.7
npm notice === Tarball Contents ===
npm notice 1.2kB  LICENSE.md
npm notice 25.1kB README.md
npm notice 1.4kB  dist/index.d.ts
npm notice 4.9kB  dist/index.js
npm notice 2.6kB  dist/index.js.map
npm notice 1.5kB  dist/lib/agent.d.ts
npm notice 20.1kB dist/lib/agent.js
npm notice 17.2kB dist/lib/agent.js.map
npm notice 577B   dist/lib/block.d.ts
npm notice 2.6kB  dist/lib/block.js
npm notice 2.3kB  dist/lib/block.js.map
npm notice 708B   dist/lib/cache.d.ts
npm notice 3.1kB  dist/lib/cache.js
npm notice 2.3kB  dist/lib/cache.js.map
npm notice 2.4kB  dist/lib/helpers.d.ts
npm notice 8.1kB  dist/lib/helpers.js
npm notice 6.4kB  dist/lib/helpers.js.map
npm notice 725B   dist/lib/incoming_message.d.ts
npm notice 1.2kB  dist/lib/incoming_message.js
npm notice 912B   dist/lib/incoming_message.js.map
npm notice 564B   dist/lib/middlewares.d.ts
npm notice 3.4kB  dist/lib/middlewares.js
npm notice 2.7kB  dist/lib/middlewares.js.map
npm notice 536B   dist/lib/observe_read_stream.d.ts
npm notice 2.1kB  dist/lib/observe_read_stream.js
npm notice 1.6kB  dist/lib/observe_read_stream.js.map
npm notice 823B   dist/lib/observe_write_stream.d.ts
npm notice 2.3kB  dist/lib/observe_write_stream.js
npm notice 2.1kB  dist/lib/observe_write_stream.js.map
npm notice 735B   dist/lib/option_converter.d.ts
npm notice 7.0kB  dist/lib/option_converter.js
npm notice 5.9kB  dist/lib/option_converter.js.map
npm notice 1.3kB  dist/lib/outgoing_message.d.ts
npm notice 3.2kB  dist/lib/outgoing_message.js
npm notice 2.7kB  dist/lib/outgoing_message.js.map
npm notice 262B   dist/lib/parameters.d.ts
npm notice 5.8kB  dist/lib/parameters.js
npm notice 2.5kB  dist/lib/parameters.js.map
npm notice 646B   dist/lib/retry_send.d.ts
npm notice 2.8kB  dist/lib/retry_send.js
npm notice 2.4kB  dist/lib/retry_send.js.map
npm notice 866B   dist/lib/segmentation.d.ts
npm notice 3.5kB  dist/lib/segmentation.js
npm notice 3.0kB  dist/lib/segmentation.js.map
npm notice 2.5kB  dist/lib/server.d.ts
npm notice 25.3kB dist/lib/server.js
npm notice 18.8kB dist/lib/server.js.map
npm notice 3.1kB  dist/models/models.d.ts
npm notice 369B   dist/models/models.js
npm notice 125B   dist/models/models.js.map
npm notice 12B    dist/test/agent.d.ts
npm notice 17.5kB dist/test/agent.js
npm notice 14.9kB dist/test/agent.js.map
npm notice 12B    dist/test/blockwise.d.ts
npm notice 17.1kB dist/test/blockwise.js
npm notice 14.5kB dist/test/blockwise.js.map
npm notice 12B    dist/test/cache.d.ts
npm notice 3.7kB  dist/test/cache.js
npm notice 4.0kB  dist/test/cache.js.map
npm notice 45B    dist/test/common.d.ts
npm notice 503B   dist/test/common.js
npm notice 220B   dist/test/common.js.map
npm notice 12B    dist/test/end-to-end.d.ts
npm notice 14.1kB dist/test/end-to-end.js
npm notice 13.5kB dist/test/end-to-end.js.map
npm notice 12B    dist/test/helpers.d.ts
npm notice 4.8kB  dist/test/helpers.js
npm notice 4.8kB  dist/test/helpers.js.map
npm notice 12B    dist/test/ipv6.d.ts
npm notice 4.4kB  dist/test/ipv6.js
npm notice 3.6kB  dist/test/ipv6.js.map
npm notice 12B    dist/test/parameters.d.ts
npm notice 2.0kB  dist/test/parameters.js
npm notice 1.7kB  dist/test/parameters.js.map
npm notice 12B    dist/test/proxy.d.ts
npm notice 10.0kB dist/test/proxy.js
npm notice 8.2kB  dist/test/proxy.js.map
npm notice 12B    dist/test/request.d.ts
npm notice 58.9kB dist/test/request.js
npm notice 55.0kB dist/test/request.js.map
npm notice 12B    dist/test/retry_send.d.ts
npm notice 1.6kB  dist/test/retry_send.js
npm notice 1.1kB  dist/test/retry_send.js.map
npm notice 12B    dist/test/segmentation.d.ts
npm notice 5.1kB  dist/test/segmentation.js
npm notice 4.9kB  dist/test/segmentation.js.map
npm notice 12B    dist/test/server.d.ts
npm notice 47.2kB dist/test/server.js
npm notice 45.8kB dist/test/server.js.map
npm notice 12B    dist/test/share-socket.d.ts
npm notice 14.9kB dist/test/share-socket.js
npm notice 14.4kB dist/test/share-socket.js.map
npm notice 1.8kB  package.json
npm notice === Tarball Details ===
npm notice name:          coap
npm notice version:       1.0.7
npm notice filename:      coap-1.0.7.tgz
npm notice package size:  91.8 kB
npm notice unpacked size: 604.5 kB
npm notice shasum:        dd234a87da6526073c703344d28ffb305b5977c1
npm notice integrity:     sha512-E4GqOa7VtX+Zs[...]skWdnJM5SSMRA==
npm notice total files:   93
npm notice
+ coap@1.0.7

@Apollon77
Copy link
Collaborator

ts is "github only" in my eyes, but I would include the examples

@JKRhb JKRhb force-pushed the exclude-src-files branch from b25faea to 7e174b6 Compare April 24, 2022 16:37
@JKRhb
Copy link
Member Author

JKRhb commented Apr 24, 2022

ts is "github only" in my eyes, but I would include the examples

Alright :) I added the examples now but excluded the tests which should also reduce the bundle size.

@JKRhb
Copy link
Member Author

JKRhb commented Apr 24, 2022

Dry run now looks like this:

$ npm publish --dry-run

> coap@1.0.7 prepublishOnly
> npm run build


> coap@1.0.7 build
> tsc -b

npm notice
npm notice 📦  coap@1.0.7
npm notice === Tarball Contents === 
npm notice 1.2kB  LICENSE.md
npm notice 25.1kB README.md
npm notice 1.4kB  dist/index.d.ts
npm notice 4.9kB  dist/index.js
npm notice 2.6kB  dist/index.js.map
npm notice 1.5kB  dist/lib/agent.d.ts
npm notice 20.1kB dist/lib/agent.js
npm notice 17.2kB dist/lib/agent.js.map
npm notice 577B   dist/lib/block.d.ts
npm notice 2.6kB  dist/lib/block.js
npm notice 2.3kB  dist/lib/block.js.map
npm notice 708B   dist/lib/cache.d.ts
npm notice 3.1kB  dist/lib/cache.js
npm notice 2.3kB  dist/lib/cache.js.map
npm notice 2.4kB  dist/lib/helpers.d.ts
npm notice 8.1kB  dist/lib/helpers.js
npm notice 6.4kB  dist/lib/helpers.js.map
npm notice 725B   dist/lib/incoming_message.d.ts      
npm notice 1.2kB  dist/lib/incoming_message.js
npm notice 912B   dist/lib/incoming_message.js.map
npm notice 564B   dist/lib/middlewares.d.ts
npm notice 3.4kB  dist/lib/middlewares.js
npm notice 2.7kB  dist/lib/middlewares.js.map
npm notice 536B   dist/lib/observe_read_stream.d.ts
npm notice 2.1kB  dist/lib/observe_read_stream.js
npm notice 1.6kB  dist/lib/observe_read_stream.js.map
npm notice 823B   dist/lib/observe_write_stream.d.ts
npm notice 2.3kB  dist/lib/observe_write_stream.js
npm notice 2.1kB  dist/lib/observe_write_stream.js.map
npm notice 735B   dist/lib/option_converter.d.ts
npm notice 7.0kB  dist/lib/option_converter.js        
npm notice 5.9kB  dist/lib/option_converter.js.map
npm notice 1.3kB  dist/lib/outgoing_message.d.ts
npm notice 3.2kB  dist/lib/outgoing_message.js
npm notice 2.7kB  dist/lib/outgoing_message.js.map
npm notice 262B   dist/lib/parameters.d.ts
npm notice 5.8kB  dist/lib/parameters.js
npm notice 2.5kB  dist/lib/parameters.js.map
npm notice 646B   dist/lib/retry_send.d.ts
npm notice 2.8kB  dist/lib/retry_send.js
npm notice 2.4kB  dist/lib/retry_send.js.map
npm notice 866B   dist/lib/segmentation.d.ts
npm notice 3.5kB  dist/lib/segmentation.js
npm notice 3.0kB  dist/lib/segmentation.js.map
npm notice 2.5kB  dist/lib/server.d.ts
npm notice 25.3kB dist/lib/server.js
npm notice 18.8kB dist/lib/server.js.map
npm notice 3.1kB  dist/models/models.d.ts
npm notice 369B   dist/models/models.js
npm notice 125B   dist/models/models.js.map
npm notice 3.7kB  examples/blockwise_put.js
npm notice 855B   examples/blockwise.js
npm notice 363B   examples/client_and_server.js       
npm notice 165B   examples/client.js
npm notice 1.0kB  examples/delayed_response.js
npm notice 988B   examples/json.js
npm notice 735B   examples/multicast_client_server.js
npm notice 161B   examples/observe_client.js
npm notice 449B   examples/observe_server.js
npm notice 2.2kB  examples/proxy.js
npm notice 554B   examples/req_with_payload.js
npm notice 228B   examples/server.js
npm notice 2.0kB  package.json
npm notice === Tarball Details ===
npm notice name:          coap
npm notice version:       1.0.7
npm notice filename:      coap-1.0.7.tgz
npm notice package size:  52.4 kB
npm notice unpacked size: 227.7 kB
npm notice shasum:        0a160719c7cad1e36287c9f4429422211d4f1f6d
npm notice integrity:     sha512-ggajskmxH0SBu[...]+hzbDtA+F591w==
npm notice total files:   63
npm notice
+ coap@1.0.7

@Apollon77 Apollon77 merged commit bd09444 into coapjs:master Apr 24, 2022
@Apollon77
Copy link
Collaborator

I did not checked that "dist" is containing anything needed.

@JKRhb JKRhb deleted the exclude-src-files branch April 24, 2022 16:51
JKRhb added a commit to JKRhb/node-coap that referenced this pull request May 17, 2022
JKRhb added a commit to JKRhb/node-coap that referenced this pull request May 17, 2022
JKRhb added a commit to JKRhb/node-coap that referenced this pull request May 17, 2022
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