GitbookIO / gitbook-cli

GitBook's command line interface
717 stars 212 forks source link

Plugin manager will not install plugins from a scoped repository #106

Open johnnygf opened 4 years ago

johnnygf commented 4 years ago

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?