Skip to content

Instantly share code, notes, and snippets.

View othiym23's full-sized avatar
💭
what is this thing you call, "architecture"

Forrest L Norvell othiym23

💭
what is this thing you call, "architecture"
  • Ellation / Crunchyroll / VRV
  • San Francisco
View GitHub Profile
@othiym23
othiym23 / 0-package.json
Last active November 15, 2015 21:02
improper dependency unhoisting?
{
"name": "packard",
"version": "2.2.1",
"author": "Forrest L Norvell <ogd@aoaioxxysz.net>",
"description": "many music files onto few devices",
"main": "lib/packer.js",
"bin": "lib/cli.js",
"scripts": {
"transpile": "babel src -d lib",
"prepublish": "npm run transpile",

Hello, everybody!

So, a brief content warning before I get started: I talk about burnout and stress a lot in this talk, because I’ve spent most of the last couple years working on getting better about both of those things. Right now, things are actually going really well both for me and my team. We’re OK! If you’ve been dealing with these issues yourself, my hope is that you’ll be able to relate without getting bummed out, but if you want to take a pass on hearing about other people’s stress because it triggers your own, I won’t be offended.

That said, hi! I’m Forrest Lehwalder Norvell, and I’m the team lead for the npm command-line interface. If you don’t know what that is, the short version that one of the Bens here came up with yesterday is that npm is a cupboard on the internet where developers cram all the crap that they or somebody else might want to use again someday. The important thing is that it’s a very popular open-source product, and it has a large and enthusiastic community. I have now finishe

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'i' ]
2 info using npm@3.3.6
3 info using node@v4.1.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly install normalizeTree
8 silly loadCurrentTree Finishing
9 silly loadIdealTree Starting
@othiym23
othiym23 / 11
Created September 22, 2015 03:25
> sails@0.11.0 preinstall /Users/ogd/Documents/projects/test-bad-shrinkwrap/node_modules/.staging/sails-4ec73f30af0d5e42eeaa772eb908660b
> node ./lib/preinstall_npmcheck.js
Sails.js Installation: Checking npm-version successful
npm WARN prefer global grunt-cli@0.1.13 should be installed with -g
npm WARN prefer global voc@0.5.0 should be installed with -g
> buffertools@2.1.3 install /Users/ogd/Documents/projects/test-bad-shrinkwrap/node_modules/buffertools
> node-gyp rebuild
@othiym23
othiym23 / 11
Created September 22, 2015 03:21
> sails@0.11.0 preinstall /Users/ogd/Documents/projects/test-bad-shrinkwrap/node_modules/.staging/sails-4ec73f30af0d5e42eeaa772eb908660b
> node ./lib/preinstall_npmcheck.js
Sails.js Installation: Checking npm-version successful
> buffertools@2.1.3 install /Users/ogd/Documents/projects/test-bad-shrinkwrap/node_modules/buffertools
> node-gyp rebuild
CXX(target) Release/obj.target/buffertools/buffertools.o
{
"name": "projects",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Forrest L Norvell <ogd@aoaioxxysz.net>",

grab bag o' goals:

  • as much as possible, have a package tree produced with just the facts – no linting, only warnings or errors because there's stuff in there that's flat-out wrong
  • follow the Node module resolution algorithm's rules for determining what looks like a module (which may end up including things that aren't packages)
  • produce the list of warnings about the state of the package tree and the printable tree for npm ls during a single pass through the code
  • split apart normative and descriptive scans of the package tree
  • unify read-package-json and normalize-package-data because the split between them is more an accident of history than a consequence of design
  • split validation / linting checks in unified read-package-json + normalize-package-data out into an independent package that operates on a realized tree
  • use the above to support an npm lint command
  • get closer to having a standalone npm-install package
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/iojs', '/usr/local/bin/npm', 'i' ]
2 info using npm@3.3.2
3 info using node@v2.5.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly install normalizeTree
8 silly loadCurrentTree Finishing
9 silly loadIdealTree Starting
bauchelain% cd ../nothingness-level/
bauchelain% n ls
@nothingness/level@0.0.1 /Users/ogd/Documents/projects/nothingness-level
├─┬ babel@5.8.20
│ ├─┬ babel-core@5.8.20
│ │ ├── babel-plugin-constant-folding@1.0.1
│ │ ├── babel-plugin-dead-code-elimination@1.0.2
│ │ ├── babel-plugin-eval@1.0.1
│ │ ├── babel-plugin-inline-environment-variables@1.0.1
│ │ ├── babel-plugin-jscript@1.0.4
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/iojs',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'i',
1 verbose cli '-D',
1 verbose cli 'tap',
1 verbose cli '--node-gyp=pangyp' ]
2 info using npm@3.3.2
3 info using node@v2.5.0
4 silly loadCurrentTree Starting