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

Use "files" property to publish only dist folder #84

Open
trivikr opened this issue Nov 23, 2024 · 0 comments
Open

Use "files" property to publish only dist folder #84

trivikr opened this issue Nov 23, 2024 · 0 comments

Comments

@trivikr
Copy link

trivikr commented Nov 23, 2024

Is your feature request related to a problem? Please describe.

The package only links to files in the dist folder, but publishes entire repository to npm.

"main": "dist/index.js",
"types": "dist/index.d.ts",

$ npm install @braintree/sanitize-url

$ ls node_modules/@braintree/sanitize-url 
CHANGELOG.md     LICENSE          README.md        dist             package.json     src              tsconfig.json    vitest.config.ts

Describe the solution you'd like

Use package.json "files" to publish only dist folder to npm.

Before

The artifact size unpacked is 23.7 kB

$ npm pack
npm notice
npm notice 📦  @braintree/[email protected]
npm notice Tarball Contents
npm notice 14B .eslintignore
npm notice 80B .eslintrc
npm notice 25B .github/CODEOWNERS
npm notice 307B .github/workflows/ci.yml
npm notice 4B .nvmrc
npm notice 26B .prettierignore
npm notice 2.7kB CHANGELOG.md
npm notice 1.1kB LICENSE
npm notice 1.4kB README.md
npm notice 405B dist/constants.d.ts
npm notice 779B dist/constants.js
npm notice 59B dist/index.d.ts
npm notice 3.0kB dist/index.js
npm notice 1.1kB package.json
npm notice 9.1kB src/__tests__/index.test.ts
npm notice 503B src/constants.ts
npm notice 2.7kB src/index.ts
npm notice 239B tsconfig.json
npm notice 145B vitest.config.ts
npm notice Tarball Details
npm notice name: @braintree/sanitize-url
npm notice version: 7.1.0
npm notice filename: braintree-sanitize-url-7.1.0.tgz
npm notice package size: 6.9 kB
npm notice unpacked size: 23.7 kB
npm notice shasum: 048e48aab4f1460e3121e22aa62459d16653dc85
npm notice integrity: sha512-o+UlMLt49RvtC[...]8Lf05qL/O7KWg==
npm notice total files: 19
npm notice
braintree-sanitize-url-7.1.0.tgz

After

The artifact size unpacked is 7.8 kB

$ npm pack
npm notice
npm notice 📦  @braintree/[email protected]
npm notice Tarball Contents
npm notice 1.1kB LICENSE
npm notice 1.4kB README.md
npm notice 405B dist/constants.d.ts
npm notice 779B dist/constants.js
npm notice 59B dist/index.d.ts
npm notice 3.0kB dist/index.js
npm notice 1.2kB package.json
npm notice Tarball Details
npm notice name: @braintree/sanitize-url
npm notice version: 7.1.0
npm notice filename: braintree-sanitize-url-7.1.0.tgz
npm notice package size: 3.1 kB
npm notice unpacked size: 7.8 kB
npm notice shasum: 0d6bed4cabff72c0eec3d382bd40b36a9f83e47b
npm notice integrity: sha512-ERv+oB6iDDPdP[...]LfpRWoa4igTzA==
npm notice total files: 7
npm notice
braintree-sanitize-url-7.1.0.tgz

Describe alternatives you've considered

N/A

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

No branches or pull requests

1 participant