mozilla / testpilot-metrics

Metrics broker library for Test Pilot experiments. Pings Google Analytics and Mozilla metrics servers
Mozilla Public License 2.0
3 stars 7 forks source link

Audit files in npm package #11

Closed pdehaan closed 7 years ago

pdehaan commented 7 years ago

We probably want to limit the number of files in the published npm module. I only have testpilot-metrics installed, but the ./node_modules/ directory is ~480K.

We probably don't need to distribute the *.MD files, or the /examples/ and /test/ directories.

$ cat package.json
{
  "name": "testpilot-metrics-npm",
  "version": "1.0.0",
  "description": "",
  "author": "Peter deHaan <peter@deseloper.com> (https://about.me/peterdehaan)",
  "license": "WTFPL",
  "devDependencies": {
    "testpilot-metrics": "1.0.0"
  }
}
$ du -sh node_modules
480K    node_modules

$ ls -lashR node_modules

node_modules/testpilot-metrics/:
    15B  .npmignore
   4.1K  API.md
   8.9K  README.md
   2.7K  package.json
    11K  testpilot-metrics.js

node_modules/testpilot-metrics/examples/sdk/:
    56B  .npmignore
   1.1K  README.md
   186K  ga-screenshot.png
   505B  index.js
   483B  package.json

node_modules/testpilot-metrics/examples/sdk/data/:
   1.6K  icon-16.png
   3.4K  icon-32.png
   8.4K  icon-64.png

node_modules/testpilot-metrics/examples/webextension/:
    21B  .npmignore
   1.5K  README.md
   356B  background.js
   186K  ga-screenshot.png
   503B  manifest.json

node_modules/testpilot-metrics/test/:
    11K  test.js
$ tree node_modules
node_modules
└── testpilot-metrics
    ├── API.md
    ├── README.md
    ├── examples/
    │   ├── sdk/
    │   │   ├── README.md
    │   │   ├── data/
    │   │   │   ├── icon-16.png
    │   │   │   ├── icon-32.png
    │   │   │   └── icon-64.png
    │   │   ├── ga-screenshot.png
    │   │   ├── index.js
    │   │   └── package.json
    │   └── webextension/
    │       ├── README.md
    │       ├── background.js
    │       ├── ga-screenshot.png
    │       └── manifest.json
    ├── package.json
    ├── test/
    │   └── test.js
    └── testpilot-metrics.js

6 directories, 16 files
pdehaan commented 7 years ago

Ref: #12, we'll also want to figure out if we should include the 16KB LICENSE file in the published npm module.

pdehaan commented 7 years ago

After doing some skillfull rm -rf action on some files, it looks like we can get the module down to 11-20KB:

$ du -sh node_modules
 20K    node_modules

$ ls -lashR node_modules

node_modules/testpilot-metrics:
 8 -rw-r--r--  1 pdehaan  staff    15B Jan 23 22:48 .npmignore
 8 -rw-r--r--  1 pdehaan  staff   2.7K Jan 26 12:40 package.json
24 -rw-r--r--  1 pdehaan  staff    11K Jan 25 23:47 testpilot-metrics.js
jaredhirsch commented 7 years ago

Nope, we're going to distribute everything together

jaredhirsch commented 7 years ago

The installation docs make it pretty clear that all you need to use the module is the js file that has no dependencies. I want to keep the rest of the docs there for experiment authors to lean on.

But...maybe I'm being too rash in closing this. Reopen if I am :-)