From d465afab88357af671089820f2780ed585aff7a2 Mon Sep 17 00:00:00 2001 From: Sean Barag Date: Thu, 21 Sep 2023 09:52:33 -0700 Subject: [PATCH] packaging: be more specific about files distributed in packed .tgz We previously included a few unnecessary files the ui-components .tgz file. They weren't dangerous, but weren't really appropriate for distribution. For example: * .parcel-cache * .sassrc.json * .eslint.json * .yarnrc Use package.json's 'files' array (an allowlist) instead of .npmignore (a denylist) to more carefully control what's included. Besides removing those extra files, CSS and JS source-maps are now included in the .tgz file distributed by NPM, which should make things easier for consumers. Since this is an open-source project, there's no significant drawback to including those maps. --- packages/ui-components/.npmignore | 19 ------------------- packages/ui-components/package.json | 6 ++++++ 2 files changed, 6 insertions(+), 19 deletions(-) delete mode 100644 packages/ui-components/.npmignore diff --git a/packages/ui-components/.npmignore b/packages/ui-components/.npmignore deleted file mode 100644 index a08ca8553..000000000 --- a/packages/ui-components/.npmignore +++ /dev/null @@ -1,19 +0,0 @@ -# this file -.npmignore - -# all things git -.git* - -# source -src/ - -# source maps -*/**/*.js.map - -# eslint -.eslintignore -.eslintrc - -# project configs -*.config.js -tsconfig.json diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index bd777df01..7f0b39dc3 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -10,6 +10,12 @@ "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "types": "dist/types/index.d.ts", + "files": [ + "dist/", + "package.json", + "README.md", + "LICENSE" + ], "scripts": { "build": "npm-run-all build:typescript build:bundle", "build:bundle": "parcel build",