-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure that `strip-indent@3` is floated to the top of `node_modules` to fix a bug where `docsify-server-renderer` can require that package (which it doesn't have as a declared dependency) and receive version 4 instead, which is an ESM module.
- Loading branch information
1 parent
6361455
commit b32e8ac
Showing
5 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = function create(_gasket, { pkg }) { | ||
// Workaround for https://github.com/docsifyjs/docsify/issues/2345 | ||
pkg.add('dependencies', { | ||
'strip-indent': require('docsify/package.json').dependencies['strip-indent'] | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const { hooks: { create } } = require('../lib'); | ||
const docsifyPackage = require('docsify/package.json'); | ||
|
||
describe('The create hook', () => { | ||
it('adds a strip-indent dependency to work around a docsify bug', function () { | ||
const context = { pkg: { add: jest.fn() } }; | ||
|
||
create({}, context); | ||
|
||
expect(context.pkg.add).toHaveBeenCalledWith( | ||
'dependencies', | ||
{ 'strip-indent': docsifyPackage.dependencies['strip-indent'] } | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters