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

Reduce published to npm files #328

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kravetsone
Copy link

Problem

Many files such as .ts, tests and etc. published to npm but not used anywhere

Changes

npm publish --dry-run run output before/after change

Before

npm notice
npm notice 📦  [email protected]
npm notice Tarball Contents
npm notice 9.4kB CHANGELOG.md
npm notice 151B CONTRIBUTING.md
npm notice 257B README.md
npm notice 89B index.ts
npm notice 95.0kB lib/index.cjs.js
npm notice 223.6kB lib/index.cjs.js.map
npm notice 23.5kB lib/index.d.ts
npm notice 94.8kB lib/index.esm.js
npm notice 223.5kB lib/index.esm.js.map
npm notice 261B lib/posthog-core/src/eventemitter.d.ts
npm notice 9.7kB lib/posthog-core/src/index.d.ts
npm notice 378B lib/posthog-core/src/lz-string.d.ts
npm notice 270B lib/posthog-core/src/storage-memory.d.ts
npm notice 5.0kB lib/posthog-core/src/types.d.ts
npm notice 620B lib/posthog-core/src/utils.d.ts
npm notice 7.9kB lib/posthog-core/src/vendor/uuidv7.d.ts
npm notice 91B lib/posthog-node/index.d.ts
npm notice 2.7kB lib/posthog-node/src/extensions/sentry-integration.d.ts
npm notice 3.6kB lib/posthog-node/src/feature-flags.d.ts
npm notice 611B lib/posthog-node/src/fetch.d.ts
npm notice 3.8kB lib/posthog-node/src/posthog-node.d.ts
npm notice 9.4kB lib/posthog-node/src/types.d.ts
npm notice 352B lib/posthog-node/test/test-utils.d.ts
npm notice 832B package.json
npm notice 6.8kB src/extensions/sentry-integration.ts
npm notice 24.7kB src/feature-flags.ts
npm notice 1.6kB src/fetch.ts
npm notice 15.5kB src/posthog-node.ts
npm notice 9.2kB src/types.ts
npm notice 597B src/types/rusha.d.ts
npm notice 5.0kB test/extensions/sentry-integration.spec.ts
npm notice 118.0kB test/feature-flags.spec.ts
npm notice 41.5kB test/posthog-node.spec.ts
npm notice 1.8kB test/test-utils.ts
npm notice 187B tsconfig.json
npm notice Tarball Details
npm notice name: posthog-node
npm notice version: 4.3.2
npm notice filename: posthog-node-4.3.2.tgz
npm notice package size: 180.7 kB
npm notice unpacked size: 940.8 kB
npm notice shasum: ec8484831b68a189f8e72e63d0b727f003c80541
npm notice integrity: sha512-UhJmKwha8RLQN[...]Wrd8/xgUEgtXw==
npm notice total files: 35
npm notice

After

npm notice 📦  [email protected]
npm notice Tarball Contents
npm notice 257B README.md
npm notice 95.0kB lib/index.cjs.js
npm notice 223.6kB lib/index.cjs.js.map
npm notice 23.5kB lib/index.d.ts
npm notice 94.8kB lib/index.esm.js
npm notice 223.5kB lib/index.esm.js.map
npm notice 871B package.json
npm notice Tarball Details
npm notice name: posthog-node
npm notice version: 4.3.2
npm notice filename: posthog-node-4.3.2.tgz
npm notice package size: 141.1 kB
npm notice unpacked size: 661.6 kB
npm notice shasum: 5c28b75eb94e1717a860f21da1a042376cf1a1d3
npm notice integrity: sha512-mQZT0b9EQ2BSB[...]ibqF7r6Eu4p1g==
npm notice total files: 7

Release info Sub-libraries affected

Bump level

  • Major
  • Minor
  • Patch

Libraries affected

  • All of them
  • posthog-web
  • posthog-node
  • posthog-react-native

Changelog notes

@kravetsone
Copy link
Author

Do i need to bump and add info to changelog?

@kravetsone
Copy link
Author

and do we really need the source map files? The library code is simple enough that their absence will not interfere with debugging problems

@marandaneto
Copy link
Member

@kravetsone is the reason only to download fewer files or to reduce bundle size?

@kravetsone
Copy link
Author

kravetsone commented Dec 17, 2024

@kravetsone is the reason only to download fewer files or to reduce bundle size?

Do you talk about my sourcemap question or about PR in general?

We can keep sourcemaps if it useful it okay

My PR aims to reduce download size of package

For now developers forced to download files which never will be used such as tests/source TypeScript files and other useless at npm stuff

Like e18e.dev initiative

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.

2 participants