Skip to content

Commit

Permalink
feat(manifest): on publish removes devDependencies & scripts (#905)
Browse files Browse the repository at this point in the history
## Description

- on publish removes devDependencies, scripts and other stuff not
necessary to have for runtime dependency-cruiser usage
- also on publish: adds a dummy 'test' script with a message to run
tests etcetera on the ci (and so socket.dev doesn't shows its bogus
warning about missing tests, which shouldn't be on npmjs in the first
place)

## Motivation and Context

- Makes the published package ~10kb smaller

## How Has This Been Tested?

- [x] green ci
- [x] local publish
- [x] publish on npmjs (see
https://www.npmjs.com/package/dependency-cruiser/v/16.1.0-beta-1?activeTab=code),
install as a devDependency on state-machine-cat and run it

## Types of changes

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Documentation only change
- [ ] Refactor (non-breaking change which fixes an issue without
changing functionality)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
  • Loading branch information
sverweij authored Jan 27, 2024
1 parent 263ef24 commit 24b3b2e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"lint:types:tsc": "tsc --project types/tsconfig.json",
"lint:types:lint": "eslint --no-ignore --config types/.eslintrc.json types/*.d.mts",
"lint:types:fix": "eslint --no-ignore --config types/.eslintrc.json --fix types/*.d.mts",
"prepack": "clean-pkg-json --dry --keep overrides --keep resolutions | jq '.scripts = {test: \"echo for test, build and static analysis scripts: see the github repository\"}' > smaller-package.json && mv smaller-package.json package.json",
"prepare": "husky install",
"scm:push": "run-p --aggregate-output scm:push:*",
"scm:push:bitbucket-mirror": "run-p --aggregate-output scm:push:bitbucket-mirror:*",
Expand Down Expand Up @@ -202,6 +203,7 @@
"@typescript-eslint/parser": "6.19.1",
"@vue/compiler-sfc": "3.4.15",
"c8": "9.1.0",
"clean-pkg-json": "1.2.0",
"coffeescript": "2.7.0",
"eslint": "8.56.0",
"eslint-config-moving-meadow": "4.0.2",
Expand Down Expand Up @@ -269,4 +271,4 @@
"vue-template-compiler": ">=2.0.0 <3.0.0",
"@vue/compiler-sfc": ">=3.0.0 <4.0.0"
}
}
}

0 comments on commit 24b3b2e

Please sign in to comment.