GitbookIO / gitbook-cli

GitBook's command line interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugin manager will not install plugins from a scoped repository

johnnygf opened this issue · comments

It was discovered when a version of a private gitbook plugin that had a new version that was scoped was not being used in the gitbook and the old version that was not scoped was being used.

That is: @foo/gitbook-plugin-theme-awesome was specified in our gitbook's package.json, but book.json had theme-awesome and the gitbook installer would only prepend gitbook-plugin, so even though npm/yarn had installed @foo/gitbook-plugin-theme-awesome gitbook's plugin installer looked for gitbook-plugin-theme-awesome, didn't find it locally and installed the old version of gitbook-plugin-theme-awesome.

Obviously there is a workaround that involves moving the scoped version up to node_modules and renaming it in its package.json as part of the install/build script, but is there some other solution whereby book.json could refer to the plugin's full npm name instead of the gitbook plugin installer only prepending gitbook-plugin- to the short name?