+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Methods
+
+
+
+
+
+
+
+ addonGenerator(prompts, templateDir, copyFiles, copyTemplateFiles, templateFn) → {Generator}
+
+
+
+
+
+
+
+ Creates a Yeoman Generator that generates a project conforming
+to webpack-defaults.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ prompts |
+
+
+
+
+
+Array.<any>
+
+
+
+ |
+
+
+
+
+
+ An array of Yeoman prompt objects |
+
+
+
+
+
+
+ templateDir |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ Absolute path to template directory |
+
+
+
+
+
+
+ copyFiles |
+
+
+
+
+
+Array.<string>
+
+
+
+ |
+
+
+
+
+
+ An array of file paths (relative to `./templates`)
+of files to be copied to the generated project. File paths should be of the
+form `path/to/file.js.tpl`. |
+
+
+
+
+
+
+ copyTemplateFiles |
+
+
+
+
+
+Array.<string>
+
+
+
+ |
+
+
+
+
+
+ An array of file paths (relative to
+`./templates`) of files to be copied to the generated project. Template
+file paths should be of the form `path/to/_file.js.tpl`. |
+
+
+
+
+
+
+ templateFn |
+
+
+
+
+
+function
+
+
+
+ |
+
+
+
+
+
+ A function that is passed a generator instance and
+returns an object containing data to be supplied to the template files. |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ A class extending Generator
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Generator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ addOrUpdateConfigObject(j, rootNode, configProperty, key, value) → {Void}
+
+
+
+
+
+
+
+ Adds or updates the value of a key within a root
+webpack configuration property that's of type Object.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ rootNode |
+
+
+
+
+
+Node
+
+
+
+ |
+
+
+
+
+
+ node of root webpack configuration |
+
+
+
+
+
+
+ configProperty |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ key of an Object webpack configuration property |
+
+
+
+
+
+
+ key |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ key within the configuration object to update |
+
+
+
+
+
+
+ value |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+ the value to set for the key |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ addProperty(j, p, key, value, action) → {Node}
+
+
+
+
+
+
+
+ Recursively adds an object/property to a node
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ p |
+
+
+
+
+
+Node
+
+
+
+ |
+
+
+
+
+
+ AST node |
+
+
+
+
+
+
+ key |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ key of a key/val object |
+
+
+
+
+
+
+ value |
+
+
+
+
+
+Any
+
+
+
+ |
+
+
+
+
+
+ Any type of object |
+
+
+
+
+
+
+ action |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ Action to be done on the given ast |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ - the created ast
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Node
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ createIdentifierOrLiteral(j, val) → {Node}
+
+
+
+
+
+
+
+ Creates an appropriate identifier or literal property
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ val |
+
+
+
+
+
+String
+|
+
+Boolean
+|
+
+Number
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Node
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ createLiteral(j, val) → {Node}
+
+
+
+
+
+
+
+ Creates an appropriate literal property
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ val |
+
+
+
+
+
+String
+|
+
+Boolean
+|
+
+Number
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Node
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ createOrUpdatePluginByName(j, rootNodePath, pluginName, options) → {Void}
+
+
+
+
+
+
+
+ Finds or creates a node for a given plugin name string with options object
+If plugin declaration already exist, options are merged.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ rootNodePath |
+
+
+
+
+
+Node
+
+
+
+ |
+
+
+
+
+
+ `plugins: []` NodePath where plugin should be added. See https://github.com/facebook/jscodeshift/wiki/jscodeshift-Documentation#nodepaths |
+
+
+
+
+
+
+ pluginName |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ ex. `webpack.LoaderOptionsPlugin` |
+
+
+
+
+
+
+ options |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+ plugin options |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ createProperty(j, key, value) → {Node}
+
+
+
+
+
+
+
+ Creates an Object's property with a given key and value
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ key |
+
+
+
+
+
+String
+|
+
+Number
+
+
+
+ |
+
+
+
+
+
+ Property key |
+
+
+
+
+
+
+ value |
+
+
+
+
+
+String
+|
+
+Number
+|
+
+Boolean
+
+
+
+ |
+
+
+
+
+
+ Property value |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Node
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ defineTest(dirName, transformName, testFilePrefixopt, transformObject, action) → {Void}
+
+
+
+
+
+
+
+ Handles some boilerplate around defining a simple jest/Jasmine test for a
+jscodeshift transform.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+ Attributes |
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ dirName |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ contains the name of the directory the test is located in. This
+ should normally be passed via __dirname. |
+
+
+
+
+
+
+ transformName |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ contains the filename of the transform being tested,
+ excluding the .js extension. |
+
+
+
+
+
+
+ testFilePrefix |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+ <optional>
+
+
+
+
+
+ |
+
+
+
+
+ Optionally contains the name of the file with the test
+ data. If not specified, it defaults to the same value as `transformName`.
+ This will be suffixed with ".input.js" for the input file and ".output.js"
+ for the expected output. For example, if set to "foo", we will read the
+ "foo.input.js" file, pass this to the transform, and expect its output to
+ be equal to the contents of "foo.output.js". |
+
+
+
+
+
+
+ transformObject |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ Object to be transformed with the transformations |
+
+
+
+
+
+
+ action |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ init, update or remove, decides how to format the AST |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ Jest makes sure to execute the globally defined functions
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ findAndRemovePluginByName(j, node, pluginName) → {Node|Void}
+
+
+
+
+
+
+
+ Finds and removes a node for a given plugin name. If the plugin
+is the last in the plugins array, the array is also removed.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ node |
+
+
+
+
+
+Node
+
+
+
+ |
+
+
+
+
+
+ node to start search from |
+
+
+
+
+
+
+ pluginName |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ name of the plugin to remove |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ - path to the root webpack configuration object if plugin is found
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Node
+|
+
+Void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ findInvocation(j, node, pluginName) → {Boolean}
+
+
+
+
+
+
+
+ Check whether `node` is the invocation of the plugin denoted by `pluginName`
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+ jscodeshift top-level import |
+
+
+
+
+
+
+ node |
+
+
+
+
+
+Node
+
+
+
+ |
+
+
+
+
+
+ ast node to check |
+
+
+
+
+
+
+ pluginName |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ name of the plugin |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ isPluginInvocation - whether `node` is the invocation of the plugin denoted by `pluginName`
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ findPluginsArrayAndRemoveIfEmpty(j, rootNode) → {Node}
+
+
+
+
+
+
+
+ It lookouts for the plugins property and, if the array is empty, it removes it from the AST
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ jscodeshift API |
+
+
+
+
+
+
+ rootNode |
+
+
+
+
+
+Node
+
+
+
+ |
+
+
+
+
+
+ node to start search from |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ rootNode modified AST.
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Node
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ findPluginsByName(j, node, pluginNamesArray) → {Node}
+
+
+
+
+
+
+
+ Find paths that match `new name.space.PluginName()` for a
+given array of plugin names
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ node |
+
+
+
+
+
+Node
+
+
+
+ |
+
+
+
+
+
+ Node to start search from |
+
+
+
+
+
+
+ pluginNamesArray |
+
+
+
+
+
+Array.<String>
+
+
+
+ |
+
+
+
+
+
+ Array of plugin names like `webpack.LoaderOptionsPlugin` |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ Node that has the pluginName
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Node
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ findRootNodesByName(j, node, propName) → {Node}
+
+
+
+
+
+
+
+ Finds the path to the `name: []` node
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ node |
+
+
+
+
+
+Node
+
+
+
+ |
+
+
+
+
+
+ Node to start search from |
+
+
+
+
+
+
+ propName |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ property to search for |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ found node and
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Node
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ findVariableToPlugin(j, rootNode, pluginPackageName) → {String}
+
+
+
+
+
+
+
+ Finds the variable to which a third party plugin is assigned to
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ rootNode |
+
+
+
+
+
+Node
+
+
+
+ |
+
+
+
+
+
+ `plugins: []` Root Node. See https://github.com/facebook/jscodeshift/wiki/jscodeshift-Documentation#nodepaths |
+
+
+
+
+
+
+ pluginPackageName |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ ex. `extract-text-plugin` |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ variable name - ex. 'const s = require(s) gives "s"`
+
+
+
+
+
+ -
+ Type
+
+ -
+
+String
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generatorCopy(generator, templateDir) → {function}
+
+
+
+
+
+
+
+ Takes in a file path in the `./templates` directory. Copies that
+file to the destination, with the `.tpl` extension stripped.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ generator |
+
+
+
+
+
+Generator
+
+
+
+ |
+
+
+
+
+
+ A Yeoman Generator instance |
+
+
+
+
+
+
+ templateDir |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ Absolute path to template directory |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ A curried function that takes a file path and copies it
+
+
+
+
+
+ -
+ Type
+
+ -
+
+function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generatorCopyTpl(generator, templateDir, templateData) → {function}
+
+
+
+
+
+
+
+ Takes in a file path in the `./templates` directory. Copies that
+file to the destination, with the `.tpl` extension and `_` prefix
+stripped. Passes `this.props` to the template.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ generator |
+
+
+
+
+
+Generator
+
+
+
+ |
+
+
+
+
+
+ A Yeoman Generator instance |
+
+
+
+
+
+
+ templateDir |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ Absolute path to template directory |
+
+
+
+
+
+
+ templateData |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ An object containing the data passed to
+the template files. |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ A curried function that takes a file path and copies it
+
+
+
+
+
+ -
+ Type
+
+ -
+
+function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getPackageManager() → {String}
+
+
+
+
+
+
+
+ Returns the name of package manager to use,
+preferring yarn over npm if available
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ - The package manager name
+
+
+
+
+
+ -
+ Type
+
+ -
+
+String
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getPathToGlobalPackages() → {String}
+
+
+
+
+
+
+
+ Returns the path to globally installed
+npm packages, depending on the available
+package manager determined by `getPackageManager`
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ path - Path to global node_modules folder
+
+
+
+
+
+ -
+ Type
+
+ -
+
+String
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getRequire(j, constName, packagePath) → {Node}
+
+
+
+
+
+
+
+ Returns constructed require symbol
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ constName |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ Name of require |
+
+
+
+
+
+
+ packagePath |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ path of required package |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ - the created ast
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Node
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getRootPathModule(dep) → {String}
+
+
+
+
+
+
+
+ Find the path of a given module
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ dep |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+ dependency to find |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ string with given path
+
+
+
+
+
+ -
+ Type
+
+ -
+
+String
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isType(path, type) → {Boolean}
+
+
+
+
+
+
+
+ Returns true if type is given type
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ path |
+
+
+
+
+
+Node
+
+
+
+ |
+
+
+
+
+
+ AST node |
+
+
+
+
+
+
+ type |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ node type |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ loaderCreator() → {void}
+
+
+
+
+
+
+
+ Runs a yeoman generator to create a new webpack loader project
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+ -
+ Type
+
+ -
+
+void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ makeLoaderName(name) → {string}
+
+
+
+
+
+
+
+ Formats a string into webpack loader format
+(eg: 'style-loader', 'raw-loader')
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ name |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ A loader name to be formatted |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ The formatted string
+
+
+
+
+
+ -
+ Type
+
+ -
+
+string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Maps back transforms that needs to be run using the configuration
+provided.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ transformObject |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+ An Object with all transformations |
+
+
+
+
+
+
+ config |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+ Configuration to transform |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ - An Object with the transformations to be run
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Maps back transforms that needs to be run using the configuration
+provided.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ transformObject |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+ An Object with all transformations |
+
+
+
+
+
+
+ config |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+ Configuration to transform |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ - An Object with the transformations to be run
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ parseMerge(j, ast, value, action)
+
+
+
+
+
+
+
+ Transform for merge. Finds the merge property from yeoman and creates a way
+for users to allow webpack-merge in their scaffold
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ ast |
+
+
+
+
+ |
+
+
+
+
+
+ jscodeshift API |
+
+
+
+
+
+
+ value |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ transformation object to scaffold |
+
+
+
+
+
+
+ action |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ action that indicates what to be done to the AST |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ ast - jscodeshift API
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ parseTopScope(j, ast, value, action)
+
+
+
+
+
+
+
+ Get an property named topScope from yeoman and inject it to the top scope of
+the config, outside module.exports
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ j |
+
+
+
+
+ |
+
+
+
+
+
+ — jscodeshift API |
+
+
+
+
+
+
+ ast |
+
+
+
+
+ |
+
+
+
+
+
+ jscodeshift API |
+
+
+
+
+
+
+ value |
+
+
+
+
+
+any
+
+
+
+ |
+
+
+
+
+
+ transformation object to scaffold |
+
+
+
+
+
+
+ action |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ action that indicates what to be done to the AST |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ ast - jscodeshift API
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pluginCreator() → {void}
+
+
+
+
+
+
+
+ Runs a yeoman generator to create a new webpack plugin project
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+ -
+ Type
+
+ -
+
+void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ processPromise(child) → {Promise}
+
+
+
+
+
+
+
+ Attaches a promise to the installation of the package
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ child |
+
+
+
+
+
+function
+
+
+
+ |
+
+
+
+
+
+ The function to attach a promise to |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ promise - Returns a promise to the installation
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Promise
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ replaceAt(string, index, replace) → {String}
+
+
+
+
+
+
+
+ Replaces the string with a substring at the given index
+https://gist.github.com/efenacigiray/9367920
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ string |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ string to be modified |
+
+
+
+
+
+
+ index |
+
+
+
+
+
+Number
+
+
+
+ |
+
+
+
+
+
+ index to replace from |
+
+
+
+
+
+
+ replace |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ string to replace starting from index |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ string - The newly mutated string
+
+
+
+
+
+ -
+ Type
+
+ -
+
+String
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ resolvePackages(pkg) → {function|Error}
+
+
+
+
+
+
+
+ Resolves and installs the packages, later sending them to @creator
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ pkg |
+
+
+
+
+
+Array.<String>
+
+
+
+ |
+
+
+
+
+
+ The dependencies to be installed |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ creator - Builds
+a webpack configuration through yeoman or throws an error
+
+
+
+
+
+ -
+ Type
+
+ -
+
+function
+|
+
+Error
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ runMigration(currentConfigPath, outputConfigPath) → {Promise}
+
+
+
+
+
+
+
+ Runs migration on a given configuration using AST's and promises
+to sequentially transform a configuration file.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ currentConfigPath |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ input path for config |
+
+
+
+
+
+
+ outputConfigPath |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ output path for config |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ Runs the migration using a promise that
+will throw any errors during each transform or output if the
+user decides to abort the migration
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Promise
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Utility function to run a jscodeshift script within a unit test.
+This makes several assumptions about the environment.
+
+Notes:
+- The test should be located in a subdirectory next to the transform itself.
+ Commonly tests are located in a directory called __tests__.
+
+- Test data should be located in a directory called __testfixtures__
+ alongside the transform and __tests__ directory.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+ Attributes |
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ dirName |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ contains the name of the directory the test is located in. This
+ should normally be passed via __dirname. |
+
+
+
+
+
+
+ transformName |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ contains the filename of the transform being tested,
+ excluding the .js extension. |
+
+
+
+
+
+
+ testFilePrefix |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+ <optional>
+
+
+
+
+
+ |
+
+
+
+
+ Optionally contains the name of the file with the test
+ data. If not specified, it defaults to the same value as `transformName`.
+ This will be suffixed with ".input.js" for the input file and ".output.js"
+ for the expected output. For example, if set to "foo", we will read the
+ "foo.input.js" file, pass this to the transform, and expect its output to
+ be equal to the contents of "foo.output.js". |
+
+
+
+
+
+
+ initOptions |
+
+
+
+
+
+Object
+|
+
+Boolean
+|
+
+String
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ TBD |
+
+
+
+
+
+
+ action |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ init, update or remove, decides how to format the AST |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ Function that fires of the transforms
+
+
+
+
+
+ -
+ Type
+
+ -
+
+function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ safeTraverse(obj, paths) → {Any}
+
+
+
+
+
+
+
+ Traverse safely over a path object for array for paths
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ obj |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+ Object on which we traverse |
+
+
+
+
+
+
+ paths |
+
+
+
+
+
+Array
+
+
+
+ |
+
+
+
+
+
+ Array of strings containing the traversal path |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ Value at given traversal path
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Any
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ safeTraverseAndGetType(path) → {String|Boolean}
+
+
+
+
+
+
+
+ Traverse safely and return `type` for path object with value.value property
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ path |
+
+
+
+
+
+Node
+
+
+
+ |
+
+
+
+
+
+ AST node |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ type at given path.
+
+
+
+
+
+ -
+ Type
+
+ -
+
+String
+|
+
+Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ serve(args) → {function}
+
+
+
+
+
+
+
+ Prompts for installing the devServer and running it
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ args |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+ args processed from the CLI |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ invokes the devServer API
+
+
+
+
+
+ -
+ Type
+
+ -
+
+function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ spawnChild(pkg) → {function}
+
+
+
+
+
+
+
+ Spawns a new process that installs the addon/dependency
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ pkg |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ The dependency to be installed |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ spawn - Installs the package
+
+
+
+
+
+ -
+ Type
+
+ -
+
+function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ spawnNPM(pkg, isNew) → {function}
+
+
+
+
+
+
+
+ Spawns a new process using npm
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ pkg |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ The dependency to be installed |
+
+
+
+
+
+
+ isNew |
+
+
+
+
+
+Boolean
+
+
+
+ |
+
+
+
+
+
+ indicates if it needs to be updated or installed |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ spawn - Installs the package
+
+
+
+
+
+ -
+ Type
+
+ -
+
+function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ spawnNPMWithArg(cmd) → {Void}
+
+
+
+
+
+
+
+ Installs WDS using NPM with --save --dev etc
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ cmd |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+ arg to spawn with |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ spawnYarn(pkg, isNew) → {function}
+
+
+
+
+
+
+
+ Spawns a new process using yarn
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ pkg |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ The dependency to be installed |
+
+
+
+
+
+
+ isNew |
+
+
+
+
+
+Boolean
+
+
+
+ |
+
+
+
+
+
+ indicates if it needs to be updated or installed |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ spawn - Installs the package
+
+
+
+
+
+ -
+ Type
+
+ -
+
+function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ spawnYarnWithArg(cmd) → {Void}
+
+
+
+
+
+
+
+ Installs WDS using Yarn with add etc
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ cmd |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+ arg to spawn with |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Transforms a given piece of source code by applying selected transformations to the AST.
+By default, transforms a webpack version 1 configuration file into a webpack version 2
+configuration file.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+ Attributes |
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ source |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ source file contents |
+
+
+
+
+
+
+ transforms |
+
+
+
+
+
+Array.<function()>
+
+
+
+ |
+
+
+
+
+ <optional>
+
+
+
+
+
+ |
+
+
+
+
+ List of transformation functions, defined in the
+order to apply them in. By default, all defined transformations. |
+
+
+
+
+
+
+ options |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+ <optional>
+
+
+
+
+
+ |
+
+
+
+
+ recast formatting options |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ source — transformed source code
+
+
+
+
+
+ -
+ Type
+
+ -
+
+String
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ traverseAndGetProperties(arr, prop) → {Boolean}
+
+
+
+
+
+
+
+ Checks if the given array has a given property
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ arr |
+
+
+
+
+
+Array
+
+
+
+ |
+
+
+
+
+
+ array to check |
+
+
+
+
+
+
+ prop |
+
+
+
+
+
+String
+
+
+
+ |
+
+
+
+
+
+ property to check existence of |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ hasProp - Boolean indicating if the property
+is present
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+