-
-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
190 additions
and
145 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
*.js |
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,2 @@ | ||
tsconfig.json | ||
*.ts |
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 |
---|---|---|
@@ -1,25 +1,23 @@ | ||
"use strict"; | ||
|
||
const npmPackagesExists = require("@webpack-cli/utils/npm-packages-exists"); | ||
const defaultGenerator = require("@webpack-cli/generators/init-generator"); | ||
const modifyConfigHelper = require("@webpack-cli/utils/modify-config-helper"); | ||
import defaultGenerator from "@webpack-cli/generators/init-generator"; | ||
import modifyConfigHelper from "@webpack-cli/utils/modify-config-helper"; | ||
import npmPackagesExists from "@webpack-cli/utils/npm-packages-exists"; | ||
|
||
/** | ||
* | ||
* First function to be called after running the init flag. This is a check, | ||
* if we are running the init command with no arguments or if we got dependencies | ||
* | ||
* @param {Array} args - array of arguments such as | ||
* @param {String[]} args - array of arguments such as | ||
* packages included when running the init command | ||
* @returns {Function} creator/npmPackagesExists - returns an installation of the package, | ||
* followed up with a yeoman instance of that if there's packages. If not, it creates a defaultGenerator | ||
*/ | ||
|
||
module.exports = function initializeInquirer(...args) { | ||
const packages = args.slice(3); | ||
export default function initializeInquirer(...args: string[]): Function { | ||
const packages: string[] = args.slice(3); | ||
|
||
if (packages.length === 0) { | ||
return modifyConfigHelper("init", defaultGenerator); | ||
} | ||
return npmPackagesExists(packages); | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.