standard / semistandard

:icecream: All the goodness of `standard/standard` with semicolons sprinkled on top.
MIT License
1.41k stars 123 forks source link

Error on install #5

Closed brandonhorst closed 9 years ago

brandonhorst commented 9 years ago

If standard is already installed in a package, npm's deduping will not install it to the expected location for the postinstall script.

That's a pretty janky implementation strategy - perhaps we should switch to a proper fork instead.

node-osa> npm install semistandard --save-dev
> semistandard@2.4.1 postinstall /Users/brandonhorst/projects/node-osa/node_modules/semistandard
> node postinstall.js

fs.js:691
  return binding.lstat(pathModule._makeLong(path));
                 ^
Error: ENOENT, no such file or directory '/Users/brandonhorst/projects/node-osa/node_modules/semistandard/node_modules/standard/rc/.eslintrc'
    at Object.fs.lstatSync (fs.js:691:18)
    at replacizeFileSync (/Users/brandonhorst/projects/node-osa/node_modules/semistandard/node_modules/replace/replace.js:121:22)
    at module.exports (/Users/brandonhorst/projects/node-osa/node_modules/semistandard/node_modules/replace/replace.js:64:13)
    at Object.<anonymous> (/Users/brandonhorst/projects/node-osa/node_modules/semistandard/postinstall.js:4:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
Flet commented 9 years ago

Indeed, its janktastic :)

The joke has gone too far, time to make it better.

What @dcposch describes in his pull request is probably what we should start doing:

Every time feross/standard publishes a new version,

  • reset --hard to the parent of this commit
  • Copy over everything from feross/standard: rm -rf * && cp ../standard/* . -r
  • git commit -am "Copying standard <x.x.x>"
  • Cherry-pick this commit
  • Update the version to match feross/standard and amend
  • Run npm test
  • Boom, done. Republish

I'd like it to be automated to where something similar to above happens and the current README (and package.json?) is retained.

Also, the way standard runs tests now is by checking out several repos and running against them to ensure no errors. This would need to be considered/ignored/changed to semistandard repos.

dcposch commented 9 years ago

where something similar to above happens and the current README (and package.json?) is retained.

Also, the way standard runs tests now is by checking out several repos and running against them to ensure no errors. This would need to be considered/ignored/changed to semistandard repos.

That one commit (that we have to rebase each time standard updates) does all of those things. It updates the code, the readme, the package.json, and the tests.

Flet commented 9 years ago

Thanks @dcposch I merged your commit, I also created a script for updating things automagically via npm run sync. This should make it simple to keep this sucker synced.

@brandonhorst can you give the latest a try?

brandonhorst commented 9 years ago

Works great, thanks!