Docpad auto-reinstalls livereload? #744

Closed
alanguir opened this Issue Dec 19, 2013 · 7 comments

Projects

None yet

3 participants

@alanguir

Livereload is buggy for me, and I'd rather not use it. Every time I uninstall it with docpad uninstall livereload it seems to reinstall it the next time I ctrl+c and docpad run.

@greduan
Contributor
greduan commented Dec 19, 2013

@alanguir That is certainly a problem!

Could you please copy paste the output you're getting from the command line over this process? Thanks!

@alanguir

After a closer look it actually seems like installing any other plugin reinstates livereload:

Alans-MacBook-Air-2:resourceverb Alan$ docpad uninstall livereload
info: Welcome to DocPad v6.58.2 (local installation: /Users/ApigeeCorporation/github/resourceverb/node_modules/docpad)
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, less, livereload, marked, partials, related, text
info: Environment: development
info: npm uninstall docpad-plugin-livereload --save
unbuild docpad-plugin-livereload@2.5.4
info: The action completed successfully
info: Shutting down... cya next time!

Later:

Alans-MacBook-Air-2:resourceverb Alan$ docpad install services
info: Welcome to DocPad v6.59.0 (local installation: /Users/ApigeeCorporation/github/resourceverb/node_modules/docpad)
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, less, marked, partials, related, text
info: Environment: development
info: npm install docpad-plugin-services@2 --save

Once all the relevant registries are pulled in, npm install gets run again as a blanket to make all the docpad plugin dependencies work:

docpad-plugin-services@2.5.0 node_modules/docpad-plugin-services
├── extendr@2.1.0 (typechecker@2.0.8)
└── projectz@0.2.10 (eachr@2.0.2, caterpillar-filter@2.0.3, commander@2.1.0, typechecker@2.0.8, caterpillar-human@2.1.1, safefs@3.0.6, taskgroup@3.3.6, caterpillar@2.0.7, cson@1.4.5, getcontributors@1.3.4)
info: npm install
npm http GET https://registry.npmjs.org/docpad-plugin-livereload
npm http 304 https://registry.npmjs.org/docpad-plugin-livereload

SO, the issue looks like it actually might be that docpad uninstall livereload doesn't actually remove a reference to the plugin from package.json

Here's the package file before running docpad uninstall livereload

  "dependencies": {
    "docpad": "~6.59.0",
    "docpad-plugin-cleanurls": "~2.6.0",
    "docpad-plugin-coffeescript": "~2.2.3",
    "docpad-plugin-eco": "~2.0.3",
    "docpad-plugin-marked": "~2.1.2",
    "docpad-plugin-partials": "~2.8.1",
    "docpad-plugin-related": "~2.2.2",
    "docpad-plugin-text": "~2.3.2",
    "docpad-plugin-less": "~2.3.0",
    "docpad-plugin-services": "~2.5.0"
  },
  "devDependencies": {
    "docpad-plugin-livereload": "~2.5.4"
  },

And it's still in there immediately after rerunning docpad uninstall livereload:

  "devDependencies": {
    "docpad-plugin-livereload": "~2.5.4"
  },
@alanguir

Pulling livereload out of devDependencies does the trick, but one would expect this to be done automatically with the uninstall command.

docpad-plugin-services@2.5.0 node_modules/docpad-plugin-services
├── extendr@2.1.0 (typechecker@2.0.8)
└── projectz@0.2.10 (eachr@2.0.2, caterpillar-filter@2.0.3, commander@2.1.0, typechecker@2.0.8, caterpillar-human@2.1.1, safefs@3.0.6, taskgroup@3.3.6, cson@1.4.5, caterpillar@2.0.7, getcontributors@1.3.4)
info: npm install
info: The action completed successfully
info: Shutting down... cya next time!
Alans-MacBook-Air-2:resourceverb Alan$ docpad run
info: Welcome to DocPad v6.59.0 (local installation: /Users/ApigeeCorporation/github/resourceverb/node_modules/docpad)
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, less, marked, partials, related, services, text
info: Environment: development
@greduan
Contributor
greduan commented Dec 19, 2013

What docpad uninstall livereload is doing is basically npm uninstall docpad-plugin-livereload --save.

That doesn't include --saveDev of course, so it is removing it from the dependencies but not from the dev dependencies.

Since you've found the problem I think this is solved(?) but from now on, to avoid this kind of problem I sugggest you run the npm (un)install --save(Dev) docpad-plugin-pluginname yourself. To be in total control of what goes on. :)

@balupton
Member

Thanks everyone for looking into this.

I've applied a fix in v6.59.3. Now when your run docpad uninstall blah, it will include both the --save and --save-dev flags automatically, rather than just the --save flag.

@balupton balupton closed this Dec 20, 2013
@balupton balupton added a commit that referenced this issue Dec 20, 2013
@balupton balupton v6.59.3. Bugfix.
- v6.59.3 December 20, 2013
	- Fixed uninstalled dev dependency plugins (e.g. livereload), from
being reinstalled on the next install
		- Thanks to [Alan Languirand](https://github.com/alanguir), [Eduán
Lávaque](https://github.com/Greduan) for [issue
#744](#744)
8264603
@greduan
Contributor
greduan commented Dec 20, 2013

Thanks @balupton! Now I know it's save-dev not saveDev. :)

@alanguir

Awesome - cool to see that you're very responsive to this stuff. Happy
holidays! I'll let you know if I spot anything else when I get back to
building on docpad after the Christmas/New Years.

Alan Languirand
@13protons

Sent from my iPhone

On Dec 19, 2013, at 7:13 PM, "Eduán Lávaque" notifications@github.com
wrote:

Thanks @balupton https://github.com/balupton! Now I know it's save-devnot
saveDev. :)


Reply to this email directly or view it on
GitHubhttps://github.com/bevry/docpad/issues/744#issuecomment-30979286
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment