From 568c3215b3ee533ccf42d3e7adfc168869762297 Mon Sep 17 00:00:00 2001 From: Barrett <81570928+btlghrants@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:24:00 -0600 Subject: [PATCH] fix: remove cruft from pub'd package (#503) ## Description Leaves only the essential files in newly pub'd packages. ## Related Issue Fixes #499 ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Other (security config, docs update, etc) ## Checklist before merging - [ ] Test, docs, adr added or updated as needed - [ ] [Contributor Guide Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request) followed --- .npmignore | 5 ----- package.json | 37 ++++++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/.npmignore b/.npmignore index e0d1100..e20e78a 100644 --- a/.npmignore +++ b/.npmignore @@ -7,10 +7,5 @@ tsconfig.json __mocks__ *.config.js .prettierrc -# Exclude all test files -src/**/*.test.ts -dist/**/*.test.ts -dist/**/*.test.js e2e -dist/**/*.test.d.ts* *.tgz diff --git a/package.json b/package.json index 16e15c6..30e25bc 100644 --- a/package.json +++ b/package.json @@ -5,21 +5,6 @@ "bin": "./dist/cli.js", "main": "dist/index.js", "types": "dist/index.d.ts", - "scripts": { - "prebuild": "rm -rf dist", - "build": "tsc", - "semantic-release": "semantic-release", - "test": "jest src --coverage", - "test:e2e": "jest e2e --runInBand", - "test:e2e:prep-crds": "kubectl apply -f test/ && npx ts-node src/cli.ts crd ./test/datastore.crd.yaml e2e && npx ts-node src/cli.ts crd https://raw.githubusercontent.com/defenseunicorns/kubernetes-fluent-client/refs/heads/main/test/webapp.crd.yaml e2e", - "test:e2e:prep-cluster": "k3d cluster create kfc-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system", - "test:e2e:prep-image": "npm run build && npm pack && npm i kubernetes-fluent-client-0.0.0-development.tgz --no-save", - "test:e2e:run": "npm run test:e2e:prep-cluster && npm run test:e2e:prep-crds && npm run test:e2e:prep-image && jest e2e --runInBand && npm run test:e2e:cleanup", - "test:e2e:cleanup": "k3d cluster delete kfc-dev", - "format:check": "eslint src && prettier . --check", - "format:fix": "eslint --fix src && prettier . --write", - "prepare": "if [ \"$NODE_ENV\" != 'production' ]; then husky; fi" - }, "engines": { "node": ">=18.0.0" }, @@ -41,6 +26,28 @@ "url": "https://github.com/defenseunicorns/kubernetes-fluent-client/issues" }, "homepage": "https://github.com/defenseunicorns/kubernetes-fluent-client#readme", + "files": [ + "/src", + "/dist", + "!src/**/*.test.ts", + "!dist/**/*.test.js*", + "!dist/**/*.test.d.ts*" + ], + "scripts": { + "prebuild": "rm -rf dist", + "build": "tsc", + "semantic-release": "semantic-release", + "test": "jest src --coverage", + "test:e2e": "jest e2e --runInBand", + "test:e2e:prep-crds": "kubectl apply -f test/ && npx ts-node src/cli.ts crd ./test/datastore.crd.yaml e2e && npx ts-node src/cli.ts crd https://raw.githubusercontent.com/defenseunicorns/kubernetes-fluent-client/refs/heads/main/test/webapp.crd.yaml e2e", + "test:e2e:prep-cluster": "k3d cluster create kfc-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system", + "test:e2e:prep-image": "npm run build && npm pack && npm i kubernetes-fluent-client-0.0.0-development.tgz --no-save", + "test:e2e:run": "npm run test:e2e:prep-cluster && npm run test:e2e:prep-crds && npm run test:e2e:prep-image && jest e2e --runInBand && npm run test:e2e:cleanup", + "test:e2e:cleanup": "k3d cluster delete kfc-dev", + "format:check": "eslint src && prettier . --check", + "format:fix": "eslint --fix src && prettier . --write", + "prepare": "if [ \"$NODE_ENV\" != 'production' ]; then husky; fi" + }, "dependencies": { "@kubernetes/client-node": "1.0.0-rc7", "fast-json-patch": "3.1.1",