-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Load latest versions from package in
create-hint
templates
- Loading branch information
1 parent
93322e5
commit e84e4c9
Showing
4 changed files
with
37 additions
and
21 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
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,16 @@ | ||
import { packages } from '@hint/utils'; | ||
|
||
const { findPackageRoot } = packages; | ||
|
||
/** Returns an object that represents the `package.json` version of `create-hint` */ | ||
export const loadCreateHintPackage = () => { | ||
// webpack will embed the package.json | ||
/* istanbul ignore if */ | ||
if (process.env.webpack) { // eslint-disable-line no-process-env | ||
return require('../package.json'); | ||
} | ||
|
||
const pkgRoot = findPackageRoot(__dirname, 'package.json'); | ||
|
||
return require(`${pkgRoot}/package.json`); | ||
}; |