Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "ayfkm", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "All Your Files Kept Minimal", | ||
"dependencies": { | ||
"assert-plus": "*", | ||
"assert-plus": "~0", | ||
"dashdash": "~1", | ||
"findit": "^2.0.0", | ||
"glob": "^4.3.2", | ||
"rimraf": "^2.2.8" | ||
"du": "~0", | ||
"glob": "~4", | ||
"rimraf": "~2" | ||
}, | ||
"homepage": "https://github.com/trentm/ayfkm" | ||
} |
134
README.md
@@ -1,59 +0,112 @@ | ||
All Your Files Kept Minimal. | ||
Run `ayfkm` after `npm install` to trim out cruft. | ||
*All Your Files Kept Minimal.* | ||
Put this in your package.json `devDependencies`: | ||
Run `ayfkm` after `npm install` to trim out cruft. Here "cruft" means any | ||
files that aren't required for *running* your node module dependencies. | ||
Default (hopefully reasonable) cruft patterns are included. Customize | ||
with a ".ayfkm" file in your repo. | ||
"ayfkm": "*" | ||
# Status | ||
then run this: | ||
Some basic parts working. The docs and current implementation don't yet agree. | ||
Come back later please! | ||
npm install && ./node_modules/.bin/ayfkm | ||
# Install | ||
# Status | ||
npm install -g ayfkm | ||
Not yet functional. Come back later please! | ||
See below if installing globally isn't your thing. | ||
# Install | ||
# Usage | ||
npm install ayfkm | ||
First, create a ".ayfkm" config file for your project as follows. This will | ||
include the [default cruft patterns](./skel/ayfkm) (patterns use | ||
[glob](https://www.npmjs.com/package/glob) syntax and are implicitly for paths | ||
under "./node\_modules"). | ||
ayfkm --init | ||
# TODO | ||
Then you can clean out the cruft with: | ||
- warning: this deletes files with default call. That seems bad. | ||
- basic functionality | ||
- default (from cruft): example, examples, test, tests, doc, man | ||
**/example | ||
**/examples | ||
**/test | ||
**/tests | ||
**/doc | ||
**/man | ||
**/.travis.yml | ||
ayfkm | ||
how about this: | ||
$ cat .ayfkm | ||
dashdash/examples | ||
jsprim/deps | ||
.bin/m* | ||
**/tst | ||
Here is an example run (use `-v,--verbose` to list every file being removed): | ||
how to get *options* in there if need? a pragma: | ||
# this is a comment, next is a pragma (syntax a la Go) | ||
# +pragma: aggressive | ||
$ ayfkm --init | ||
"/Users/trentm/tm/node-bunyan/.ayfkm" created with default patterns | ||
$ ayfkm | ||
75 files/dirs removed under "/Users/trentm/tm/node-bunyan/node_modules" | ||
3209616 bytes -> 2496922 bytes (22%) | ||
## I don't want a '.ayfkm' file in my project | ||
As long as you only want/need the default cruft patterns, then you can clean | ||
cruft without a config file with: | ||
ayfkm -f # or `ayfkm --force` | ||
There are a couple reasons `-f,--force` or a config file is required: | ||
1. The default `ayfkm` behaviour is to delete files. That's dangerous and | ||
invasive. Requiring the config file is an "opt-in". | ||
2. Creating a config file allows the default cruft patterns to be explicitly | ||
listed. Explicit is good and it also makes adding extra cruft patterns | ||
clearer. | ||
## I don't want to install `ayfkm` globally | ||
`npm install -g ...` might not be your thing. However adding a dependency on | ||
`ayfkm` when the point is to reduce the size of your deps is ironic. The | ||
answer is | ||
[devDependencies](https://docs.npmjs.com/files/package.json#devdependencies) | ||
and, optionally, the `rm-self` ayfkm pragma. | ||
Put this in your "package.json": | ||
... | ||
"devDependencies": { | ||
"ayfkm": "*" | ||
}, | ||
... | ||
and this somewhere in your ".ayfkm": | ||
# +pragma: rm-self | ||
# ".ayfkm" config file syntax | ||
XXX | ||
TODO: Doc the best practice of blank-line-separated and comment-preceded | ||
sections. | ||
# TODO | ||
- -f,--force | ||
- 'rm-self' pragma | ||
- XXXs in docs | ||
- support dir handling: | ||
ayfkm # $projDir/node_modules/ | ||
ayfkm . # Error out if not a "node_modules" dir or subdir | ||
ayfkm ./path/to/foo # same error out | ||
ayfkm foo # -> $projDir/node_modules/foo | ||
- dashdash cruft removal | ||
- discussion of that ticket and my view... near the top. I don't want the name | ||
to misrepresent my opinion | ||
- patterns/ dir with docs on how to PR to add more: | ||
patterns/re/restify@2 <--- or something usable with semver there | ||
(make sure to exclude this dir in .npmignore!) | ||
And 'import' support: | ||
ayfkm --import [<package-name> ...] | ||
ayfkm --import # for every package name in package.json#dependencies | ||
ayfkm --import foo bar | ||
- add more defaults from my imgadm Makefile? | ||
- .ayfkm.json support (or perhaps flat file? see ^^ | ||
- https://www.npmjs.com/package/minimatch ? glob | ||
- docs | ||
- remove dirs made empty | ||
- `ayfkm ./dir/path/to/node_modules` | ||
- `ayfkm foo` for "./node_modules/foo" clean out | ||
- dashdash cruft removal | ||
- pragma aggressive: README.md, drop npm server-added fields to package.json, | ||
license files okay? | ||
- crowdsource .ayfkm directives for npm modules? website, mirrors npm modules, | ||
tied to module major version?, `ayfkm --import foo` | ||
- remove dirs made empty | ||
@@ -63,2 +116,5 @@ | ||
- [A npm/npm issue discussing minimal package | ||
installs.](https://github.com/npm/npm/issues/5264) | ||
- [`npm install cruft`](https://github.com/timoxley/cruft) |
Sorry, the diff of this file is not supported yet
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
10850
6
1
120
+ Addeddu@~0
+ Addedassert-plus@0.2.0(transitive)
+ Addedasync@0.1.22(transitive)
+ Addeddu@0.1.1(transitive)
- Removedfindit@^2.0.0
- Removedfindit@2.0.0(transitive)
Updatedassert-plus@~0
Updatedglob@~4
Updatedrimraf@~2