From 8115d75e4428376786bfc83a850a2bbd9390cbc4 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Wed, 19 Nov 2025 16:43:05 +0000 Subject: [PATCH] Update api for --- Generator.html | 6036 -------------------------------- Storage.html | 1378 -------- actions_fs.html | 2407 ------------- actions_fs.js.html | 822 ----- actions_help.html | 699 ---- actions_help.js.html | 610 ---- actions_install.html | 1234 ------- actions_install.js.html | 714 ---- actions_package-json.html | 659 ---- actions_package-json.js.html | 556 --- actions_spawn-command.html | 713 ---- actions_spawn-command.js.html | 523 --- actions_user.html | 609 ---- actions_user.js.html | 549 --- global.html | 870 ----- index.html | 767 ---- index.js.html | 2057 ----------- module-promptSuggestion.html | 498 --- util_prompt-suggestion.js.html | 676 ---- util_storage.js.html | 748 ---- 20 files changed, 23125 deletions(-) delete mode 100644 Generator.html delete mode 100644 Storage.html delete mode 100644 actions_fs.html delete mode 100644 actions_fs.js.html delete mode 100644 actions_help.html delete mode 100644 actions_help.js.html delete mode 100644 actions_install.html delete mode 100644 actions_install.js.html delete mode 100644 actions_package-json.html delete mode 100644 actions_package-json.js.html delete mode 100644 actions_spawn-command.html delete mode 100644 actions_spawn-command.js.html delete mode 100644 actions_user.html delete mode 100644 actions_user.js.html delete mode 100644 global.html delete mode 100644 index.html delete mode 100644 index.js.html delete mode 100644 module-promptSuggestion.html delete mode 100644 util_prompt-suggestion.js.html delete mode 100644 util_storage.js.html diff --git a/Generator.html b/Generator.html deleted file mode 100644 index a7818b6d..00000000 --- a/Generator.html +++ /dev/null @@ -1,6036 +0,0 @@ - - - - - Class: Generator | Generator - - - - - - - - - - - -
- -
-
-
-

- - Generator - (args, options, features) - -

- -
-

- The - Generator - class provides the common API shared by all generators. It define - options, arguments, file, prompt, log, API, etc. -

-

- It mixes into its prototype all the methods found in the - actions/ - mixins. -

-

Every generator should extend this base class.

-
-
- -
-
-
-

- new - - Generator - (args, options, features) - - -
- index.js - , - line 141 -
-

-
-
-
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
args - Array.<string> - -

Provide arguments at initialization

-
options - Object - -

Provide options at initialization

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
- customPriorities - - - Array.< - Priority - > - - - <optional> -
-
-

Custom priorities

-
-
features - Object - -

Provide Generator features information

-
-
- -
Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
env - Object - -

the current Environment being run

-
resolved - String - -

the path to the current generator

-
description - String - -

- Used in - --help - output -

-
appname - String - -

The application name

-
config - - Storage - - -

- .yo-rc - config file manager -

-
fs - Object - -

- An instance of - - Mem-fs-editor - -

-
log - function - -

Output content through Interface Adapter

-
uniqueBy - String - -

- The Generator instance unique identifier. The - Environment will ignore duplicated identifiers. -

-
unique - String - -

- uniqueBy calculation method - (undefined/argument/namespace) -

-
tasksMatchingPriority - boolean - -

Only queue methods that matches a priority.

-
taskPrefix - String - -

- Tasks methods starts with prefix. Allows api methods - (non tasks) without prefix. -

-
customInstallTask - boolean - | - - function - -

- Provides a custom install task. Environment >= 3.2.0 - Environment built-in task will not be executed -

-
customCommitTask - boolean - | - - function - -

- Provides a custom commit task. Environment >= 3.2.0 - Environment built-in task will not be executed -

-
- -
-
Mixes In:
- -
- -
-
- -
Example
- -
const Generator = require('yeoman-generator');
-module.exports = class extends Generator {
-  writing() {
-    this.fs.write(this.destinationPath('index.js'), 'const foo = 1;');
-  }
-};
-
-
- -

Extends

- - - -

Members

- -
-
-

- - config - - -
- index.js - , - line 1138 -
-

-
-
-
-

Generator config Storage.

-
- - - -
-
- -
-

- - packageJson - - -
- index.js - , - line 1165 -
-

-
-
-
-

- Package.json Storage resolved to - this.destinationPath('package.json') - . -

-

- Environment watches for package.json changes at - this.env.cwd - , and triggers an package manager install if it has been - committed to disk. If package.json is at a different folder, - like a changed generator root, propagate it to the Environment - like - this.env.cwd = this.destinationPath() - . -

-
- - - -
- -
Example
- -
this.packageJson.merge({
-  scripts: {
-    start: 'webpack --serve',
-  },
-  dependencies: {
-    ...
-  },
-  peerDependencies: {
-    ...
-  },
-});
-
-
- -

Methods

- -
-
-

- - _templateData - (path) - → {Object} - - -

-
-
-
-

Utility method to get a formatted data for templates.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
path - String - -

path to the storage key.

-
-
- -
-
Returns:
- - Object - - - -

data to be passed to the templates.

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - async - - addDependencies - (dependencies) - → {Promise} - - -

-
-
-
-

Add dependencies to the destination the package.json.

-

- Environment watches for package.json changes at - this.env.cwd - , and triggers an package manager install if it has been - committed to disk. If package.json is at a different folder, - like a changed generator root, propagate it to the Environment - like - this.env.cwd = this.destinationPath() - . -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
dependencies - Object - | - - string - | - - Array.<string> -
-
- -
-
Returns:
- - Promise - - - -

a 'packageName: packageVersion' object

-
- -
-
Inherited From:
-
- -
-
-
- -
-

- - async - - addDevDependencies - (dependencies) - → {Promise} - - -

-
-
-
-

Add dependencies to the destination the package.json.

-

- Environment watches for package.json changes at - this.env.cwd - , and triggers an package manager install if it has been - committed to disk. If package.json is at a different folder, - like a changed generator root, propagate it to the Environment - like - this.env.cwd = this.destinationPath() - . -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
dependencies - Object - | - - string - | - - Array.<string> -
-
- -
-
Returns:
- - Promise - - - -

a 'packageName: packageVersion' object

-
- -
-
Inherited From:
-
- -
-
-
- -
-

- - argument - (name, config) - → {this} - -
- index.js - , - line 703 -
-

-
-
-
-

- Adds an argument to the class and creates an attribute getter - for it. -

-

- Arguments are different from options in several aspects. The - first one is how they are parsed from the command line, - arguments are retrieved based on their position. -

-

- Besides, arguments are used inside your code as a property ( - this.argument - ), while options are all kept in a hash ( - this.options - ). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
name - String -

Argument name

config - Object - -

Argument options

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
type - any - -

String, Number, Array, or Object

-
description - string - - <optional> -
-
-

Description for the argument

-
required - boolean - - <optional> -
-
-

required` Boolean whether it is required

-
optional - boolean - - <optional> -
-
-

Boolean whether it is optional

-
default - any - - <optional> -
-
-

Default value for this argument

-
-
-
- -
-
Returns:
- - this - - - -

This generator

-
- -
-
- -
-

- - argumentsHelp - () - → {String} - -
- - actions/help.js - - , - line 93 -
-

-
-
-
-

Get help text for arguments

-
- -
-
Returns:
- - String - - - -

Text of options in formatted table

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - cancelCancellableTasks - () - - -
- index.js - , - line 1176 -
-

-
-
-
-

Ignore cancellable tasks.

-
- -
-
- -
-

- - composeWith - - (generator, args - opt - , options - opt - , immediately - opt - ) - - - → { - Generator - } - - -
- index.js - , - line 1275 -
-

-
-
-
-

Compose this generator with another one.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
generator - String - | - - Object - | - - Array - -

- The path to the generator module or an object (see - examples) -

-
args - Array - - <optional> -
-
-

Arguments passed to the Generator

-
options - Object - - <optional> -
-
-

The options passed to the Generator

-
immediately - boolean - - <optional> -
-
false -

- Boolean whether to queue the Generator immediately -

-
-
- -
-
Returns:
- - - Generator - - - - -

The composed generator

-
- -
- -
Examples
- -

Using a peerDependency generator

- -
this.composeWith('bootstrap', { sass: true });
- -

Using a direct dependency generator

- -
this.composeWith(require.resolve('generator-bootstrap/app/main.js'), { sass: true });
- -

Passing a Generator class

- -
this.composeWith({ Generator: MyGenerator, path: '../generator-bootstrap/app/main.js' }, { sass: true });
-
- -
-

- - copyDestination - (from, to, …args) - → {*} - - -

-
-
-
-

- Copy file from destination folder to another destination - folder. mem-fs-editor method's shortcut, for more information - see - - mem-fs-editor - - . Shortcut for this.fs.copy(this.destinationPath(from), - this.destinationPath(to)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
from - String - -

- absolute file path or relative to destination folder. -

-
to - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - copyTemplate - (from, to, …args) - → {*} - - -

-
-
-
-

- Copy file from templates folder to destination folder. - mem-fs-editor method's shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.copy(this.templatePath(from), - this.destinationPath(to)) -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
from - String - -

- absolute file path or relative to templates folder. -

-
to - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - copyTemplateAsync - (from, to, …args) - → {*} - - -

-
-
-
-

- Copy file from templates folder to destination folder. - mem-fs-editor method's shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.copy(this.templatePath(from), - this.destinationPath(to)) -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
from - String - -

- absolute file path or relative to templates folder. -

-
to - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - createStorage - - (storePath, path - opt - , options - opt - ) - - - → { - Storage - } - - -
- index.js - , - line 1406 -
-

-
-
-
-

Return a storage instance.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
storePath - String - -

The path of the json file

-
path - String - - <optional> -
-
-

The name in which is stored inside the json

-
options - boolean - | - - Object - - <optional> -
-
-

Treat path as an lodash path

-
-
- -
-
Returns:
- - - Storage - - - - -

json storage

-
- -
-
- -
-

- - debug - (…args) - - -
- index.js - , - line 462 -
-

-
-
-
-

Convenience debug method

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
args - any - - <repeatable> -
-
-

parameters to be passed to debug

-
-
- -
-
- -
-

- - deleteDestination - (filepath, …args) - → {*} - - -

-
-
-
-

- Delete file from destination folder mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.delete(this.destinationPath(filepath)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - desc - (description) - - -
- - actions/help.js - - , - line 84 -
-

-
-
-
-

- Simple setter for custom - description - to append on help output. -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
description - String -
-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - destinationPath - (…dest) - → {String} - -
- index.js - , - line 1508 -
-

-
-
-
-

Join a path to the destination root.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
dest - String - - <repeatable> -
-

path parts

-
- -
-
Returns:
- - String - - - -

joined path

-
- -
-
- -
-

- - destinationRoot - (rootPath) - → {String} - -
- index.js - , - line 1457 -
-

-
-
-
-

- Change the generator destination root directory. This path is - used to find storage, when using a file system helper method - (like - this.write - and - this.copy - ) -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
rootPath - String - -

new destination root path

-
-
- -
-
Returns:
- - String - - - -

destination root path

-
- -
-
- -
-

- - determineAppname - () - → {String} - -
- index.js - , - line 1526 -
-

-
-
-
-

Determines the name of the application.

-

- First checks for name in bower.json. Then checks for name in - package.json. Finally defaults to the name of the current - directory. -

-
- -
-
Returns:
- - String - - - -

The name of the application

-
- -
-
- -
-

- - git.email - () - → {String} - -
- - actions/user.js - - , - line 44 -
-

-
-
-
-

- Retrieves user's email from Git in the global scope or the - project scope (it'll take what Git will use in the current - context) -

-
- -
-
Returns:
- - String - - - -

configured git email or undefined

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - existsDestination - (filepath, …args) - → {*} - - -

-
-
-
-

- Exists file on destination folder. mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.exists(this.destinationPath(filepath)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - getFeatures - () - → {Object} - -
- index.js - , - line 332 -
-

-
-
-
-

Specifications for Environment features.

-
- -
-
Returns:
- - Object -
- -
-
- -
-

- - help - () - → {String} - -
- - actions/help.js - - , - line 19 -
-

-
-
-
-

- Tries to get the description from a USAGE file one folder - above the source root otherwise uses a default description -

-
- -
-
Returns:
- - String - - - -

Help message of the generator

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - moveDestination - (from, to) - → {*} - - -

-
-
-
-

- Move file from destination folder to another destination - folder. mem-fs-editor method's shortcut, for more information - see - - mem-fs-editor - - . Shortcut for this.fs.move(this.destinationPath(from), - this.destinationPath(to)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
from - String - -

- absolute file path or relative to destination folder. -

-
to - String - -

- absolute file path or relative to destination folder. -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - git.name - () - → {String} - -
- - actions/user.js - - , - line 22 -
-

-
-
-
-

- Retrieves user's name from Git in the global scope or the - project scope (it'll take what Git will use in the current - context) -

-
- -
-
Returns:
- - String - - - -

configured git name or undefined

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - option - - (name - opt - , config) - - → {this} - -
- index.js - , - line 616 -
-

-
-
-
-

- Adds an option to the set of generator expected options, only - used to generate generator usage. By default, generators get - all the cli options parsed by nopt as a - this.options - hash object. -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
name - String - - <optional> -
-

Option name

config - Object - -

Option options

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
type - any - -

Either Boolean, String or Number

-
description - string - - <optional> -
-
-

Description for the option

-
default - any - - <optional> -
-
-

Default value

-
alias - any - - <optional> -
-
-

- Option name alias (example - -h - and --help`) -

-
hide - any - - <optional> -
-
-

Boolean whether to hide from help

-
storage - - Storage - - - <optional> -
-
-

Storage to persist the option

-
-
-
- -
-
Returns:
- - this - - - -

This generator

-
- -
-
- -
-

- - optionsHelp - () - → {String} - -
- - actions/help.js - - , - - line 111 - -
-

-
-
-
-

Get help text for options

-
- -
-
Returns:
- - String - - - -

Text of options in formatted table

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - prompt - - (questions, storage - opt - ) - - → {Promise} - -
- index.js - , - line 521 -
-

-
-
-
-

- Prompt user to answer questions. The signature of this method - is the same as - - Inquirer.js - -

-

- On top of the Inquirer.js API, you can provide a - {store: true} - property for every question descriptor. When set to true, - Yeoman will store/fetch the user's answers as defaults. -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
questions - object - | - - Array.<object> - -

- Array of question descriptor objects. See - - Documentation - -

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
storage - - Storage - - | - - String - - <optional> -
-
-

- Storage object or name (generator property) to - be used by the question to store/fetch the - response. -

-
-
storage - - Storage - - | - - String - - <optional> -
-
-

- Storage object or name (generator property) to be used - by default to store/fetch responses. -

-
-
- -
-
Returns:
- - Promise - - - -

prompt promise

-
- -
-
- -
-

- - queueMethod - - (method:, methodName - opt - , queueName - opt - , reject - opt - ) - - - -
- index.js - , - line 836 -
-

-
-
-
-

Schedule methods on a run queue.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
method: - function - | - - Object - -

- Method to be scheduled or object with function - properties. -

-
methodName - String - - <optional> -
-
-

Name of the method (task) to be scheduled.

-
queueName - String - - <optional> -
-
-

Name of the queue to be scheduled on.

-
reject - function - - <optional> -
-

Reject callback.

-
- -
-
- -
-

- - queueTask - (task:) - - -
- index.js - , - line 1029 -
-

-
-
-
-

Schedule tasks on a run queue.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
task: - - Task - - -

Task to be queued.

-
-
- -
-
- -
-

- - queueTaskGroup - - (taskGroup:, taskOptions - opt - ) - - - -
- index.js - , - line 871 -
-

-
-
-
-

Schedule tasks from a group on a run queue.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
taskGroup: - Object - -

Object containing tasks.

-
taskOptions - - TaskOptions - - - <optional> -
-

options.

-
- -
-
- -
-

- - queueTasks - () - → {Promise} - -
- index.js - , - line 1213 -
-

-
-
-
-

Queue generator tasks.

-
- -
-
Returns:
- - Promise -
- -
-
- -
-

- - queueTransformStream - (streams, options) - → {this} - -
- index.js - , - line 1550 -
-

-
-
-
-

Add a transform stream to the commit stream.

-

- Most usually, these transform stream will be Gulp plugins. -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
streams - stream.Transform - | - - - Array.<stream.Transform> - - -

An array of Transform stream or a single one.

-
options - any - -

Environment.applyTransforms options parameter

-
-
- -
-
Returns:
- - this - - - -

This generator

-
- -
-
- -
-

- - readDestination - (filepath, …args) - → {*} - - -

-
-
-
-

- Read file from destination folder mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.read(this.destinationPath(filepath)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - readDestinationJSON - (filepath, …args) - → {*} - - -

-
-
-
-

- Read JSON file from destination folder mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for - this.fs.readJSON(this.destinationPath(filepath)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - readTemplate - (filepath, …args) - → {*} - - -

-
-
-
-

- Read file from templates folder. mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.read(this.templatePath(filepath)) -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to templates folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - registerConfigPrompts - (questions) - - -
- index.js - , - line 473 -
-

-
-
-
-

- Register stored config prompts and optional option - alternative. -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
questions - Inquirer - | - - Array.<Inquirer> - -

Inquirer question or questions.

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
exportOption - Object - | - - Boolean - - <optional> -
-
-

- Additional data to export this question as an - option. -

-
-
question.storage - - Storage - - | - - String - - <optional> -
-
this.config -

Storage to store the answers.

-
-
- -
-
- -
-

- - registerPriorities - (priorities) - - -
- index.js - , - line 347 -
-

-
-
-
-

Register priorities for this generator

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
priorities - Array.<Object> - -

Priorities

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
priorityName - String - -

Priority name

-
before - String - - <optional> -
-
-

- The new priority will be queued before the - before - priority. Required for new priorities. -

-
queueName - String - - <optional> -
-
-

Name to be used at grouped-queue

-
edit - boolean - - <optional> -
-
-

Edit a priority

-
skip - boolean - - <optional> -
-
-

Queued manually only

-
args - - Array.<Object> - - | - - function - - <optional> -
-
-

Arguments to pass to tasks

-
-
-
- -
-
- -
-

- - renderTemplate - - (source, destination - opt - , templateData - opt - , templateOptions - opt - , copyOptions - opt - ) - - - - -

-
-
-
-

Copy a template from templates folder to the destination.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
source - String - | - - Array - -

- template file, absolute or relative to templatePath(). -

-
destination - String - | - - Array - - <optional> -
-
-

- destination, absolute or relative to - destinationPath(). -

-
templateData - Object - - <optional> -
-

ejs data

templateOptions - Object - - <optional> -
-

ejs options

copyOptions - Object - - <optional> -
-
-

mem-fs-editor copy options

-
-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - renderTemplateAsync - - (source, destination - opt - , templateData - opt - , templateOptions - opt - , copyOptions - opt - ) - - - - -

-
-
-
-

Copy a template from templates folder to the destination.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
source - String - | - - Array - -

- template file, absolute or relative to templatePath(). -

-
destination - String - | - - Array - - <optional> -
-
-

- destination, absolute or relative to - destinationPath(). -

-
templateData - Object - - <optional> -
-

ejs data

templateOptions - Object - - <optional> -
-

ejs options

copyOptions - Object - - <optional> -
-
-

mem-fs-editor copy options

-
-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - renderTemplates - - (templates, templateData - opt - ) - - - - -

-
-
-
-

Copy templates from templates folder to the destination.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
templates - Array - -

- template file, absolute or relative to templatePath(). -

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
when - function - - <optional> -
-
-

- conditional if the template should be written. - First argument is the templateData, second is - the generator. -

-
source - String - | - - Array - -

- template file, absolute or relative to - templatePath(). -

-
destination - String - | - - Array - - <optional> -
-
-

- destination, absolute or relative to - destinationPath(). -

-
templateOptions - Object - - <optional> -
-
-

ejs options

-
copyOptions - Object - - <optional> -
-
-

mem-fs-editor copy options

-
-
templateData - Object - - <optional> -
-

ejs data

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - renderTemplatesAsync - - (templates, templateData - opt - ) - - - - -

-
-
-
-

Copy templates from templates folder to the destination.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
templates - Array - -

- template file, absolute or relative to templatePath(). -

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
when - function - - <optional> -
-
-

- conditional if the template should be written. - First argument is the templateData, second is - the generator. -

-
source - String - | - - Array - -

- template file, absolute or relative to - templatePath(). -

-
destination - String - | - - Array - - <optional> -
-
-

- destination, absolute or relative to - destinationPath(). -

-
templateOptions - Object - - <optional> -
-
-

ejs options

-
copyOptions - Object - - <optional> -
-
-

mem-fs-editor copy options

-
-
templateData - Object - - <optional> -
-

ejs data

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - rootGeneratorName - () - → {String} - -
- index.js - , - line 1383 -
-

-
-
-
-

- Determine the root generator name (the one who's extending - Generator). -

-
- -
-
Returns:
- - String - - - -

The name of the root generator

-
- -
-
- -
-

- - rootGeneratorVersion - () - → {String} - -
- index.js - , - line 1393 -
-

-
-
-
-

- Determine the root generator version (the one who's extending - Generator). -

-
- -
-
Returns:
- - String - - - -

The version of the root generator

-
- -
-
- -
-

- - run - () - → {Promise} - -
- index.js - , - line 1204 -
-

-
-
-
-

- Runs the generator, scheduling prototype methods on a run - queue. Method names will determine the order each method is - run. Methods without special names will run in the default - queue. -

-

- Any method named - constructor - and any methods prefixed by a - _ - won't be scheduled. -

-
- -
-
Returns:
- - Promise - - - -

Resolved once the process finish

-
- -
-
- -
-

- - setFeatures - (features) - - -
- index.js - , - line 323 -
-

-
-
-
-

Configure Generator behaviours.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
features - Object - -
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
unique - boolean - | - - string - - <optional> -
-
-

- Generates a uniqueBy id for the environment - Accepts 'namespace' or 'true' for one instance - by namespace Accepts 'argument' for one - instance by namespace and 1 argument -

-
-
-
- -
-
- -
-

- - sourceRoot - (rootPath) - → {String} - -
- index.js - , - line 1480 -
-

-
-
-
-

- Change the generator source root directory. This path is used - by multiples file system methods like ( - this.read - and - this.copy - ) -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
rootPath - String - -

new source root path

-
-
- -
-
Returns:
- - String - - - -

source root path

-
- -
-
- -
-

- - spawnCommand - - (command, args, opt - opt - ) - - → {String} - - -

-
-
-
-

- Normalize a command across OS and spawn it (asynchronously). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
command - String - -

program to execute

-
args - Array - -

list of arguments to pass to the program

-
opt - object - - <optional> -
-
-

any cross-spawn options

-
-
- -
-
Returns:
- - String - - - -

spawned process reference

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - spawnCommandSync - - (command, args, opt - opt - ) - - → {String} - - -

-
-
-
-

- Normalize a command across OS and spawn it (synchronously). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
command - String - -

program to execute

-
args - Array - -

list of arguments to pass to the program

-
opt - object - - <optional> -
-
-

any cross-spawn options

-
-
- -
-
Returns:
- - String - - - -

spawn.sync result

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - startOver - - (options - opt - ) - - - -
- index.js - , - line 1189 -
-

-
-
-
-

Start the generator again.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
options - Object - - <optional> -
-

options.

-
- -
-
- -
-

- - templatePath - (…dest) - → {String} - -
- index.js - , - line 1493 -
-

-
-
-
-

Join a path to the source root.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
dest - String - - <repeatable> -
-

path parts

-
- -
-
Returns:
- - String - - - -

joined path

-
- -
-
- -
-

- - usage - () - → {String} - -
- - actions/help.js - - , - line 59 -
-

-
-
-
-

- Output usage information for this given generator, depending - on its arguments or options -

-
- -
-
Returns:
- - String - - - -

Usage information of the generator

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - github.username - () - → {Promise} - -
- - actions/user.js - - , - line 66 -
-

-
-
-
-

Retrieves GitHub's username from the GitHub API

-
- -
-
Returns:
- - Promise - - - -

- Resolved with the GitHub username or rejected if unable to get - the information -

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - writeDestination - (filepath, …args) - → {*} - - -

-
-
-
-

- Write file to destination folder mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.write(this.destinationPath(filepath)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
Mixes In:
- -
- -
-
-
- -
-

- - writeDestinationJSON - (filepath, …args) - → {*} - - -

-
-
-
-

- Write json file to destination folder mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for - this.fs.writeJSON(this.destinationPath(filepath)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
Mixes In:
- -
- -
-
-
-
-
-
-
- - - - - - - - - - diff --git a/Storage.html b/Storage.html deleted file mode 100644 index c546e1cb..00000000 --- a/Storage.html +++ /dev/null @@ -1,1378 +0,0 @@ - - - - - Class: Storage | Generator - - - - - - - - - - - -
- -
-
-
-

- - Storage - - (name - opt - , fs, configPath, options - opt - ) - - -

- -
-

- Storage instances handle a json file where Generator authors can - store data. -

-

- The - Generator - class instantiate the storage named - config - by default. -

-
-
- -
-
-
-

- new - - Storage - - (name - opt - , fs, configPath, options - opt - ) - - - -
- - util/storage.js - - , - line 54 -
-

-
-
-
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
name - String - - <optional> -
-
-

The name of the new storage (this is a namespace)

-
fs - mem-fs-editor - -

A mem-fs editor instance

-
configPath - String - -

The filepath used as a storage.

-
options - Object - - <optional> -
-
-

Storage options.

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
lodashPath - Boolean - - <optional> -
-
false -

Set true to treat name as a lodash path.

-
disableCache - Boolean - - <optional> -
-
false -

Set true to disable json object cache.

-
- disableCacheByFile - - Boolean - - <optional> -
-
false -

- Set true to cleanup cache for every fs change. -

-
sorted - Boolean - - <optional> -
-
false -

Set true to write sorted json.

-
-
-
- -
- -
Example
- -
class extend Generator {
-  writing: function() {
-    this.config.set('coffeescript', false);
-  }
-}
-
-
- -

Methods

- -
-
-

- - createProxy - () - → {Object} - -
- - util/storage.js - - , - - line 260 - -
-

-
-
-
-

Creates a proxy object.

-
- -
-
Returns:
- - Object - - - -

proxy.

-
- -
-
- -
-

- - createStorage - (path) - - → { - Storage - } - - -
- - util/storage.js - - , - - line 251 - -
-

-
-
-
-

Create a child storage.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
path - String - -

- relative path of the key to create a new storage. Some - paths need to be escaped. Eg: - ["dotted.path"] -

-
-
- -
-
Returns:
- - - Storage - - - - -

Returns a new Storage.

-
- -
-
- -
-

- - defaults - (defaults) - → {*} - -
- - util/storage.js - - , - - line 224 - -
-

-
-
-
-

- Setup the store with defaults value and schedule a save. If - keys already exist, the initial value is kept. -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
defaults - Object - -

Key-value object to store.

-
-
- -
-
Returns:
- - * - - - -

val Returns the merged options.

-
- -
-
- -
-

- - delete - (key) - - -
- - util/storage.js - - , - - line 212 - -
-

-
-
-
-

Delete a key from the store and schedule a save.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - String - -

The key under which the value is stored.

-
-
- -
-
- -
-

- - get - (key) - → {*} - -
- - util/storage.js - - , - - line 151 - -
-

-
-
-
-

Get a stored value

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - String - -

The key under which the value is stored.

-
-
- -
-
Returns:
- - * - - - -

The stored value. Any JSON valid type could be returned

-
- -
-
- -
-

- - getAll - () - → {Object} - -
- - util/storage.js - - , - - line 168 - -
-

-
-
-
-

Get all the stored values

-
- -
-
Returns:
- - Object - - - -

key-value object

-
- -
-
- -
-

- - getPath - (path) - → {*} - -
- - util/storage.js - - , - - line 160 - -
-

-
-
-
-

Get a stored value from a lodash path

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
path - String - -

The path under which the value is stored.

-
-
- -
-
Returns:
- - * - - - -

The stored value. Any JSON valid type could be returned

-
- -
-
- -
-

- - merge - (defaults) - → {*} - -
- - util/storage.js - - , - - line 238 - -
-

-
-
-
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
defaults - Object - -

Key-value object to store.

-
-
- -
-
Returns:
- - * - - - -

val Returns the merged object.

-
- -
-
- -
-

- - save - () - - -
- - util/storage.js - - , - - line 142 - -
-

-
-
-
-

Save a new object of values

-
- -
-
- -
-

- - set - (key, val) - → {*} - -
- - util/storage.js - - , - - line 178 - -
-

-
-
-
-

Assign a key to a value and schedule a save.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - String - -

The key under which the value is stored

-
val - * - -

- Any valid JSON type value (String, Number, Array, - Object). -

-
-
- -
-
Returns:
- - * - - - -

val Whatever was passed in as val.

-
- -
-
- -
-

- - setPath - (path, val) - → {*} - -
- - util/storage.js - - , - - line 199 - -
-

-
-
-
-

Assign a lodash path to a value and schedule a save.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
path - String - -

The key under which the value is stored

-
val - * - -

- Any valid JSON type value (String, Number, Array, - Object). -

-
-
- -
-
Returns:
- - * - - - -

val Whatever was passed in as val.

-
- -
-
-
-
-
-
- - - - - - - - - - diff --git a/actions_fs.html b/actions_fs.html deleted file mode 100644 index a6dab42b..00000000 --- a/actions_fs.html +++ /dev/null @@ -1,2407 +0,0 @@ - - - - - Mixin: actions/fs | Generator - - - - - - - - - - - -
- -
-
-
-

actions/fs

-
- -
-
-
-
- -

Methods

- -
-
-

- - static - - _templateData - (path) - → {Object} - - -

-
-
-
-

Utility method to get a formatted data for templates.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
path - String - -

path to the storage key.

-
-
- -
-
Returns:
- - Object - - - -

data to be passed to the templates.

-
- -
-
- -
-

- - static - - copyDestination - (from, to, …args) - → {*} - - -

-
-
-
-

- Copy file from destination folder to another destination - folder. mem-fs-editor method's shortcut, for more information - see - - mem-fs-editor - - . Shortcut for this.fs.copy(this.destinationPath(from), - this.destinationPath(to)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
from - String - -

- absolute file path or relative to destination folder. -

-
to - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
- -
-

- - static - - copyTemplate - (from, to, …args) - → {*} - - -

-
-
-
-

- Copy file from templates folder to destination folder. - mem-fs-editor method's shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.copy(this.templatePath(from), - this.destinationPath(to)) -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
from - String - -

- absolute file path or relative to templates folder. -

-
to - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
- -
-

- - static - - copyTemplateAsync - (from, to, …args) - → {*} - - -

-
-
-
-

- Copy file from templates folder to destination folder. - mem-fs-editor method's shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.copy(this.templatePath(from), - this.destinationPath(to)) -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
from - String - -

- absolute file path or relative to templates folder. -

-
to - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
- -
-

- - static - - deleteDestination - (filepath, …args) - → {*} - - -

-
-
-
-

- Delete file from destination folder mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.delete(this.destinationPath(filepath)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
- -
-

- - static - - existsDestination - (filepath, …args) - → {*} - - -

-
-
-
-

- Exists file on destination folder. mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.exists(this.destinationPath(filepath)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
- -
-

- - static - - moveDestination - (from, to) - → {*} - - -

-
-
-
-

- Move file from destination folder to another destination - folder. mem-fs-editor method's shortcut, for more information - see - - mem-fs-editor - - . Shortcut for this.fs.move(this.destinationPath(from), - this.destinationPath(to)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
from - String - -

- absolute file path or relative to destination folder. -

-
to - String - -

- absolute file path or relative to destination folder. -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
- -
-

- - static - - readDestination - (filepath, …args) - → {*} - - -

-
-
-
-

- Read file from destination folder mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.read(this.destinationPath(filepath)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
- -
-

- - static - - readDestinationJSON - (filepath, …args) - → {*} - - -

-
-
-
-

- Read JSON file from destination folder mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for - this.fs.readJSON(this.destinationPath(filepath)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
- -
-

- - static - - readTemplate - (filepath, …args) - → {*} - - -

-
-
-
-

- Read file from templates folder. mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.read(this.templatePath(filepath)) -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to templates folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
- -
-

- - static - - renderTemplate - - (source, destination - opt - , templateData - opt - , templateOptions - opt - , copyOptions - opt - ) - - - - -

-
-
-
-

Copy a template from templates folder to the destination.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
source - String - | - - Array - -

- template file, absolute or relative to templatePath(). -

-
destination - String - | - - Array - - <optional> -
-
-

- destination, absolute or relative to - destinationPath(). -

-
templateData - Object - - <optional> -
-

ejs data

templateOptions - Object - - <optional> -
-

ejs options

copyOptions - Object - - <optional> -
-
-

mem-fs-editor copy options

-
-
- -
-
- -
-

- - static - - renderTemplateAsync - - (source, destination - opt - , templateData - opt - , templateOptions - opt - , copyOptions - opt - ) - - - - -

-
-
-
-

Copy a template from templates folder to the destination.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
source - String - | - - Array - -

- template file, absolute or relative to templatePath(). -

-
destination - String - | - - Array - - <optional> -
-
-

- destination, absolute or relative to - destinationPath(). -

-
templateData - Object - - <optional> -
-

ejs data

templateOptions - Object - - <optional> -
-

ejs options

copyOptions - Object - - <optional> -
-
-

mem-fs-editor copy options

-
-
- -
-
- -
-

- - static - - renderTemplates - - (templates, templateData - opt - ) - - - - -

-
-
-
-

Copy templates from templates folder to the destination.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
templates - Array - -

- template file, absolute or relative to templatePath(). -

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
when - function - - <optional> -
-
-

- conditional if the template should be written. - First argument is the templateData, second is - the generator. -

-
source - String - | - - Array - -

- template file, absolute or relative to - templatePath(). -

-
destination - String - | - - Array - - <optional> -
-
-

- destination, absolute or relative to - destinationPath(). -

-
templateOptions - Object - - <optional> -
-
-

ejs options

-
copyOptions - Object - - <optional> -
-
-

mem-fs-editor copy options

-
-
templateData - Object - - <optional> -
-

ejs data

-
- -
-
- -
-

- - static - - renderTemplatesAsync - - (templates, templateData - opt - ) - - - - -

-
-
-
-

Copy templates from templates folder to the destination.

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
templates - Array - -

- template file, absolute or relative to templatePath(). -

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
when - function - - <optional> -
-
-

- conditional if the template should be written. - First argument is the templateData, second is - the generator. -

-
source - String - | - - Array - -

- template file, absolute or relative to - templatePath(). -

-
destination - String - | - - Array - - <optional> -
-
-

- destination, absolute or relative to - destinationPath(). -

-
templateOptions - Object - - <optional> -
-
-

ejs options

-
copyOptions - Object - - <optional> -
-
-

mem-fs-editor copy options

-
-
templateData - Object - - <optional> -
-

ejs data

-
- -
-
- -
-

- - static - - writeDestination - (filepath, …args) - → {*} - - -

-
-
-
-

- Write file to destination folder mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for this.fs.write(this.destinationPath(filepath)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
- -
-

- - static - - writeDestinationJSON - (filepath, …args) - → {*} - - -

-
-
-
-

- Write json file to destination folder mem-fs-editor method's - shortcut, for more information see - - mem-fs-editor - - . Shortcut for - this.fs.writeJSON(this.destinationPath(filepath)). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
filepath - String - -

- absolute file path or relative to destination folder. -

-
args - * - - <repeatable> -
-
-

- for more information see - - mem-fs-editor - -

-
-
- -
-
Returns:
- - * - - - -

- for more information see - - mem-fs-editor - -

-
- -
-
-
-
-
-
- - - - - - - - - - diff --git a/actions_fs.js.html b/actions_fs.js.html deleted file mode 100644 index 11ed0b74..00000000 --- a/actions_fs.js.html +++ /dev/null @@ -1,822 +0,0 @@ - - - - - Source: actions/fs.js | Generator - - - - - - - - - - - -
- -
-
-
-
/* eslint max-params: [1, 5] */
-const assert = require('assert');
-
-/**
- * @mixin
- * @alias actions/fs
- */
-const fs = module.exports;
-
-const renderEachTemplate = (template, templateData, context, callback) => {
-  if (template.when && !template.when(templateData, context)) {
-    return;
-  }
-
-  const {source, destination, templateOptions, copyOptions} = template;
-  return callback(
-    source,
-    destination,
-    templateData,
-    templateOptions,
-    copyOptions
-  );
-};
-
-/**
- * Read file from templates folder.
- * mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
- * Shortcut for this.fs.read(this.templatePath(filepath))
- *
- * @param {String} filepath - absolute file path or relative to templates folder.
- * @param {...*} args - for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- * @returns {*} for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- */
-fs.readTemplate = function (filepath, ...args) {
-  return this.fs.read(this.templatePath(filepath), ...args);
-};
-
-/**
- * Copy file from templates folder to destination folder.
- * mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
- * Shortcut for this.fs.copy(this.templatePath(from), this.destinationPath(to))
- *
- * @param {String} from - absolute file path or relative to templates folder.
- * @param {String} to - absolute file path or relative to destination folder.
- * @param {...*} args - for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- * @returns {*} for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- */
-fs.copyTemplate = function (from, to, ...args) {
-  return this.fs.copy(
-    this.templatePath(from),
-    this.destinationPath(to),
-    ...args
-  );
-};
-
-/**
- * Copy file from templates folder to destination folder.
- * mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
- * Shortcut for this.fs.copy(this.templatePath(from), this.destinationPath(to))
- *
- * @param {String} from - absolute file path or relative to templates folder.
- * @param {String} to - absolute file path or relative to destination folder.
- * @param {...*} args - for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- * @returns {*} for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- */
-fs.copyTemplateAsync = function (from, to, ...args) {
-  this.checkEnvironmentVersion('mem-fs-editor', '9.0.0');
-  return this.fs.copyAsync(
-    this.templatePath(from),
-    this.destinationPath(to),
-    ...args
-  );
-};
-
-/**
- * Read file from destination folder
- * mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
- * Shortcut for this.fs.read(this.destinationPath(filepath)).
- *
- * @param {String} filepath - absolute file path or relative to destination folder.
- * @param {...*} args - for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- * @returns {*} for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- */
-fs.readDestination = function (filepath, ...args) {
-  return this.fs.read(this.destinationPath(filepath), ...args);
-};
-
-/**
- * Read JSON file from destination folder
- * mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
- * Shortcut for this.fs.readJSON(this.destinationPath(filepath)).
- *
- * @param {String} filepath - absolute file path or relative to destination folder.
- * @param {...*} args - for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- * @returns {*} for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- */
-fs.readDestinationJSON = function (filepath, ...args) {
-  return this.fs.readJSON(this.destinationPath(filepath), ...args);
-};
-
-/**
- * Write file to destination folder
- * mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
- * Shortcut for this.fs.write(this.destinationPath(filepath)).
- *
- * @param {String} filepath - absolute file path or relative to destination folder.
- * @param {...*} args - for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- * @returns {*} for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- */
-fs.writeDestination = function (filepath, ...args) {
-  return this.fs.write(this.destinationPath(filepath), ...args);
-};
-
-/**
- * Write json file to destination folder
- * mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
- * Shortcut for this.fs.writeJSON(this.destinationPath(filepath)).
- *
- * @param {String} filepath - absolute file path or relative to destination folder.
- * @param {...*} args - for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- * @returns {*} for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- */
-fs.writeDestinationJSON = function (filepath, ...args) {
-  return this.fs.writeJSON(this.destinationPath(filepath), ...args);
-};
-
-/**
- * Delete file from destination folder
- * mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
- * Shortcut for this.fs.delete(this.destinationPath(filepath)).
- *
- * @param {String} filepath - absolute file path or relative to destination folder.
- * @param {...*} args - for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- * @returns {*} for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- */
-fs.deleteDestination = function (filepath, ...args) {
-  return this.fs.delete(this.destinationPath(filepath), ...args);
-};
-
-/**
- * Copy file from destination folder to another destination folder.
- * mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
- * Shortcut for this.fs.copy(this.destinationPath(from), this.destinationPath(to)).
- *
- * @param {String} from - absolute file path or relative to destination folder.
- * @param {String} to - absolute file path or relative to destination folder.
- * @param {...*} args - for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- * @returns {*} for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- */
-fs.copyDestination = function (from, to, ...args) {
-  return this.fs.copy(
-    this.destinationPath(from),
-    this.destinationPath(to),
-    ...args
-  );
-};
-
-/**
- * Move file from destination folder to another destination folder.
- * mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
- * Shortcut for this.fs.move(this.destinationPath(from), this.destinationPath(to)).
- *
- * @param {String} from - absolute file path or relative to destination folder.
- * @param {String} to - absolute file path or relative to destination folder.
- * @returns {*} for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- */
-fs.moveDestination = function (from, to, ...args) {
-  return this.fs.move(
-    this.destinationPath(from),
-    this.destinationPath(to),
-    ...args
-  );
-};
-
-/**
- * Exists file on destination folder.
- * mem-fs-editor method's shortcut, for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}.
- * Shortcut for this.fs.exists(this.destinationPath(filepath)).
- *
- * @param {String} filepath - absolute file path or relative to destination folder.
- * @param {...*} args - for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- * @returns {*} for more information see [mem-fs-editor]{@link https://github.com/SBoudrias/mem-fs-editor}
- */
-fs.existsDestination = function (filepath, ...args) {
-  return this.fs.exists(this.destinationPath(filepath), ...args);
-};
-
-/**
- * Copy a template from templates folder to the destination.
- *
- * @param  {String|Array} source - template file, absolute or relative to templatePath().
- * @param  {String|Array} [destination] - destination, absolute or relative to destinationPath().
- * @param {Object} [templateData] - ejs data
- * @param {Object} [templateOptions] - ejs options
- * @param {Object} [copyOptions] - mem-fs-editor copy options
- */
-fs.renderTemplate = function (
-  source = '',
-  destination = source,
-  templateData = this._templateData(),
-  templateOptions,
-  copyOptions
-) {
-  if (typeof templateData === 'string') {
-    templateData = this._templateData(templateData);
-  }
-
-  templateOptions = {context: this, ...templateOptions};
-
-  source = Array.isArray(source) ? source : [source];
-  const templatePath = this.templatePath(...source);
-  destination = Array.isArray(destination) ? destination : [destination];
-  const destinationPath = this.destinationPath(...destination);
-
-  this.fs.copyTpl(
-    templatePath,
-    destinationPath,
-    templateData,
-    templateOptions,
-    copyOptions
-  );
-};
-
-/**
- * Copy a template from templates folder to the destination.
- *
- * @param  {String|Array} source - template file, absolute or relative to templatePath().
- * @param  {String|Array} [destination] - destination, absolute or relative to destinationPath().
- * @param {Object} [templateData] - ejs data
- * @param {Object} [templateOptions] - ejs options
- * @param {Object} [copyOptions] - mem-fs-editor copy options
- */
-fs.renderTemplateAsync = function (
-  source = '',
-  destination = source,
-  templateData = this._templateData(),
-  templateOptions,
-  copyOptions
-) {
-  this.checkEnvironmentVersion('mem-fs-editor', '9.0.0');
-  if (typeof templateData === 'string') {
-    templateData = this._templateData(templateData);
-  }
-
-  templateOptions = {context: this, ...templateOptions};
-
-  source = Array.isArray(source) ? source : [source];
-  const templatePath = this.templatePath(...source);
-  destination = Array.isArray(destination) ? destination : [destination];
-  const destinationPath = this.destinationPath(...destination);
-
-  return this.fs.copyTplAsync(
-    templatePath,
-    destinationPath,
-    templateData,
-    templateOptions,
-    copyOptions
-  );
-};
-
-/**
- * Copy templates from templates folder to the destination.
- *
- * @param  {Array} templates - template file, absolute or relative to templatePath().
- * @param  {function} [templates.when] - conditional if the template should be written.
- *                                       First argument is the templateData, second is the generator.
- * @param  {String|Array} templates.source - template file, absolute or relative to templatePath().
- * @param  {String|Array} [templates.destination] - destination, absolute or relative to destinationPath().
- * @param {Object} [templates.templateOptions] - ejs options
- * @param {Object} [templates.copyOptions] - mem-fs-editor copy options
- * @param {Object} [templateData] - ejs data
- */
-fs.renderTemplates = function (templates, templateData = this._templateData()) {
-  assert(Array.isArray(templates), 'Templates must an array');
-  if (typeof templateData === 'string') {
-    templateData = this._templateData(templateData);
-  }
-
-  for (const template of templates)
-    renderEachTemplate(template, templateData, this, (...args) =>
-      this.renderTemplate(...args)
-    );
-};
-
-/**
- * Copy templates from templates folder to the destination.
- *
- * @param  {Array} templates - template file, absolute or relative to templatePath().
- * @param  {function} [templates.when] - conditional if the template should be written.
- *                                       First argument is the templateData, second is the generator.
- * @param  {String|Array} templates.source - template file, absolute or relative to templatePath().
- * @param  {String|Array} [templates.destination] - destination, absolute or relative to destinationPath().
- * @param {Object} [templates.templateOptions] - ejs options
- * @param {Object} [templates.copyOptions] - mem-fs-editor copy options
- * @param {Object} [templateData] - ejs data
- */
-fs.renderTemplatesAsync = function (
-  templates,
-  templateData = this._templateData()
-) {
-  assert(Array.isArray(templates), 'Templates must an array');
-  this.checkEnvironmentVersion('mem-fs-editor', '9.0.0');
-  if (typeof templateData === 'string') {
-    templateData = this._templateData(templateData);
-  }
-
-  return Promise.all(
-    templates.map((template) =>
-      renderEachTemplate(template, templateData, this, (...args) =>
-        this.renderTemplateAsync(...args)
-      )
-    )
-  );
-};
-
-/**
- * Utility method to get a formatted data for templates.
- *
- * @param {String} path - path to the storage key.
- * @return {Object} data to be passed to the templates.
- */
-fs._templateData = function (path) {
-  if (path) {
-    return this.config.getPath(path);
-  }
-
-  const allConfig = this.config.getAll();
-  if (this.generatorConfig) {
-    Object.assign(allConfig, this.generatorConfig.getAll());
-  }
-
-  if (this.instanceConfig) {
-    Object.assign(allConfig, this.instanceConfig.getAll());
-  }
-
-  return allConfig;
-};
-
-
-
-
- - - - - - - - - - diff --git a/actions_help.html b/actions_help.html deleted file mode 100644 index ffd77f0c..00000000 --- a/actions_help.html +++ /dev/null @@ -1,699 +0,0 @@ - - - - - Mixin: actions/help | Generator - - - - - - - - - - - -
- -
-
-
-

actions/help

-
- -
-
-
-
- -

Methods

- -
-
-

- - static - - argumentsHelp - () - → {String} - -
- - actions/help.js - - , - line 93 -
-

-
-
-
-

Get help text for arguments

-
- -
-
Returns:
- - String - - - -

Text of options in formatted table

-
- -
-
- -
-

- - static - - desc - (description) - - -
- - actions/help.js - - , - line 84 -
-

-
-
-
-

- Simple setter for custom - description - to append on help output. -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
description - String -
-
- -
-
- -
-

- - static - - help - () - → {String} - -
- - actions/help.js - - , - line 19 -
-

-
-
-
-

- Tries to get the description from a USAGE file one folder - above the source root otherwise uses a default description -

-
- -
-
Returns:
- - String - - - -

Help message of the generator

-
- -
-
- -
-

- - static - - optionsHelp - () - → {String} - -
- - actions/help.js - - , - - line 111 - -
-

-
-
-
-

Get help text for options

-
- -
-
Returns:
- - String - - - -

Text of options in formatted table

-
- -
-
- -
-

- - static - - usage - () - → {String} - -
- - actions/help.js - - , - line 59 -
-

-
-
-
-

- Output usage information for this given generator, depending - on its arguments or options -

-
- -
-
Returns:
- - String - - - -

Usage information of the generator

-
- -
-
-
-
-
-
- - - - - - - - - - diff --git a/actions_help.js.html b/actions_help.js.html deleted file mode 100644 index 857271eb..00000000 --- a/actions_help.js.html +++ /dev/null @@ -1,610 +0,0 @@ - - - - - Source: actions/help.js | Generator - - - - - - - - - - - -
- -
-
-
-
'use strict';
-const path = require('path');
-const fs = require('fs');
-const _ = require('lodash');
-const table = require('text-table');
-
-/**
- * @mixin
- * @alias actions/help
- */
-const help = module.exports;
-
-/**
- * Tries to get the description from a USAGE file one folder above the
- * source root otherwise uses a default description
- *
- * @return {String} Help message of the generator
- */
-help.help = function () {
-  const filepath = path.resolve(this.sourceRoot(), '../USAGE');
-  const exists = fs.existsSync(filepath);
-
-  let out = ['Usage:', '  ' + this.usage(), ''];
-
-  // Build options
-  if (Object.keys(this._options).length > 0) {
-    out = [...out, 'Options:', this.optionsHelp(), ''];
-  }
-
-  // Build arguments
-  if (this._arguments.length > 0) {
-    out = [...out, 'Arguments:', this.argumentsHelp(), ''];
-  }
-
-  // Append USAGE file is any
-  if (exists) {
-    out.push(fs.readFileSync(filepath, 'utf8'));
-  }
-
-  return out.join('\n');
-};
-
-function formatArg(config) {
-  let arg = `<${config.name}>`;
-
-  if (!config.required) {
-    arg = `[${arg}]`;
-  }
-
-  return arg;
-}
-
-/**
- * Output usage information for this given generator, depending on its arguments
- * or options
- *
- * @return {String} Usage information of the generator
- */
-help.usage = function () {
-  const options = Object.keys(this._options).length ? '[options]' : '';
-  let name = this.options.namespace;
-  let args = '';
-
-  if (this._arguments.length > 0) {
-    args = this._arguments.map(formatArg).join(' ') + ' ';
-  }
-
-  name = name.replace(/^yeoman:/, '');
-  let out = `yo ${name} ${args}${options}`;
-
-  if (this.description) {
-    out += '\n\n' + this.description;
-  }
-
-  return out;
-};
-
-/**
- * Simple setter for custom `description` to append on help output.
- *
- * @param {String} description
- */
-
-help.desc = function (description) {
-  this.description = description || '';
-  return this;
-};
-
-/**
- * Get help text for arguments
- * @returns {String} Text of options in formatted table
- */
-help.argumentsHelp = function () {
-  const rows = this._arguments.map((config) => {
-    return [
-      '',
-      config.name ? config.name : '',
-      config.description ? `# ${config.description}` : '',
-      config.type ? `Type: ${config.type.name}` : '',
-      `Required: ${config.required}`
-    ];
-  });
-
-  return table(rows);
-};
-
-/**
- * Get help text for options
- * @returns {String} Text of options in formatted table
- */
-help.optionsHelp = function () {
-  const options = _.reject(this._options, (x) => x.hide);
-
-  const rows = options.map((opt) => {
-    return [
-      '',
-      opt.alias ? `-${opt.alias}, ` : '',
-      `--${opt.name}`,
-      opt.description ? `# ${opt.description}` : '',
-      opt.default !== undefined && opt.default !== ''
-        ? 'Default: ' + opt.default
-        : ''
-    ];
-  });
-
-  return table(rows);
-};
-
-
-
-
- - - - - - - - - - diff --git a/actions_install.html b/actions_install.html deleted file mode 100644 index c7acabc4..00000000 --- a/actions_install.html +++ /dev/null @@ -1,1234 +0,0 @@ - - - - - Mixin: actions/install | Generator - - - - - - - - - - - -
- -
-
-
-

actions/install

-
- -
-
-
-
Deprecated:
-
-
    -
  • since version 5.0.0. Not included by default.
  • -
-
-
- -

Example

- -
const Generator = require('yeoman-generator');
-_.extend(Generator.prototype, require('yeoman-generator/lib/actions/install'));
-
- -

Methods

- -
-
-

- - static - - bowerInstall - - (cmpnt - opt - , options - opt - , spawnOptions - opt - ) - - - -
- - actions/install.js - - , - - line 199 - -
-

-
-
-
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
cmpnt - String - | - - Array - - <optional> -
-
-

Components to install

-
options - Object - - <optional> -
-
-

- Options to pass to - dargs - as arguments -

-
spawnOptions - Object - - <optional> -
-
-

- Options to pass - child_process.spawn - . -

-
-
- -
-
Deprecated:
-
-
    -
  • - Receives a list of `components` and an `options` object to - install through bower. The installation will automatically - run during the run loop `install` phase. -
  • -
-
-
-
- -
-

- - static - - installDependencies - - (options - opt - ) - - - -
- - actions/install.js - - , - - line 139 - -
-

-
-
-
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
options - Object - - <optional> -
-
-

options

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
npm - Boolean - | - - Object - - <optional> -
-
true -

- whether to run - npm install - or can be options to pass to - dargs - as arguments -

-
bower - Boolean - | - - Object - - <optional> -
-
false -

- whether to run - bower install - or can be options to pass to - dargs - as arguments -

-
yarn - Boolean - | - - Object - - <optional> -
-
false -

- whether to run - yarn install - or can be options to pass to - dargs - as arguments -

-
skipMessage - Boolean - - <optional> -
-
false -

whether to log the used commands

-
-
-
- -
-
Deprecated:
-
-
    -
  • - Runs `npm` and `bower`, in sequence, in the generated - directory and prints a message to let the user know. -
  • -
-
-
- -
Examples
- -
this.installDependencies({
-  bower: true,
-  npm: true
-});
- -
this.installDependencies({
-  yarn: {force: true},
-  npm: false
-});
-
- -
-

- - static - - npmInstall - - (pkgs - opt - , options - opt - , spawnOptions - opt - ) - - - -
- - actions/install.js - - , - - line 213 - -
-

-
-
-
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
pkgs - String - | - - Array - - <optional> -
-
-

Packages to install

-
options - Object - - <optional> -
-
-

- Options to pass to - dargs - as arguments -

-
spawnOptions - Object - - <optional> -
-
-

- Options to pass - child_process.spawn - . -

-
-
- -
-
Deprecated:
-
-
    -
  • - Receives a list of `packages` and an `options` object to - install through npm. The installation will automatically - run during the run loop `install` phase. -
  • -
-
-
-
- -
-

- - static - - scheduleInstallTask - - (installer, paths - opt - , options - opt - , spawnOptions - opt - ) - - - -
- - actions/install.js - - , - - line 34 - -
-

-
-
-
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
installer - String - -

Which package manager to use

-
paths - String - | - - Array - - <optional> -
-
-

- Packages to install. Use an empty string for - npm install -

-
options - Object - - <optional> -
-
-

- Options to pass to - dargs - as arguments -

-
spawnOptions - Object - - <optional> -
-
-

- Options to pass - child_process.spawn - . ref - https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options -

-
-
- -
-
Deprecated:
-
-
    -
  • - Combine package manager cmd line arguments and run the - `install` command. During the `install` step, every - command will be scheduled to run once, on the run loop. -
  • -
-
-
-
- -
-

- - static - - yarnInstall - - (pkgs - opt - , options - opt - , spawnOptions - opt - ) - - - -
- - actions/install.js - - , - - line 227 - -
-

-
-
-
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
pkgs - String - | - - Array - - <optional> -
-
-

Packages to install

-
options - Object - - <optional> -
-
-

- Options to pass to - dargs - as arguments -

-
spawnOptions - Object - - <optional> -
-
-

- Options to pass - child_process.spawn - . -

-
-
- -
-
Deprecated:
-
-
    -
  • - Receives a list of `packages` and an `options` object to - install through yarn. The installation will automatically - run during the run loop `install` phase. -
  • -
-
-
-
-
-
-
-
- - - - - - - - - - diff --git a/actions_install.js.html b/actions_install.js.html deleted file mode 100644 index 60eafb81..00000000 --- a/actions_install.js.html +++ /dev/null @@ -1,714 +0,0 @@ - - - - - Source: actions/install.js | Generator - - - - - - - - - - - -
- -
-
-
-
'use strict';
-/* eslint-disable unicorn/prefer-spread */
-const assert = require('assert');
-const _ = require('lodash');
-const dargs = require('dargs');
-const chalk = require('chalk');
-
-/**
- * @deprecated since version 5.0.0.
- * Not included by default.
- * @mixin
- * @alias actions/install
- *
- * @example
- * const Generator = require('yeoman-generator');
- * _.extend(Generator.prototype, require('yeoman-generator/lib/actions/install'));
- */
-const install = module.exports;
-
-/**
- * @deprecated
- * Combine package manager cmd line arguments and run the `install` command.
- *
- * During the `install` step, every command will be scheduled to run once, on the
- * run loop.
- *
- * @param {String} installer Which package manager to use
- * @param {String|Array} [paths] Packages to install. Use an empty string for `npm install`
- * @param {Object} [options] Options to pass to `dargs` as arguments
- * @param {Object} [spawnOptions] Options to pass `child_process.spawn`. ref
- *                                https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options
- */
-
-install.scheduleInstallTask = function (
-  installer,
-  paths,
-  options,
-  spawnOptions
-) {
-  options = options || {};
-  spawnOptions = spawnOptions || {};
-  paths = Array.isArray(paths) ? paths : (paths && paths.split(' ')) || [];
-
-  let args = ['install'].concat(paths).concat(dargs(options));
-
-  // Yarn uses the `add` command to specifically add a package to a project
-  if (installer === 'yarn' && paths.length > 0) {
-    args[0] = 'add';
-  }
-
-  // Only for npm, use a minimum cache of one day
-  if (installer === 'npm') {
-    args = [...args, '--cache-min', 24 * 60 * 60];
-  }
-
-  // Return early if we're skipping installation
-  if (this.options.skipInstall || this.options['skip-install']) {
-    this.log(
-      'Skipping install command: ' +
-        chalk.yellow(installer + ' ' + args.join(' '))
-    );
-    return;
-  }
-
-  this.env.runLoop.add(
-    'install',
-    (done) => {
-      this.emit(`${installer}Install`, paths);
-      this.spawnCommand(installer, args, spawnOptions)
-        .on('error', (error) => {
-          this.log(
-            chalk.red('Could not finish installation. \n') +
-              'Please install ' +
-              installer +
-              ' with ' +
-              chalk.yellow('npm install -g ' + installer) +
-              ' and try again. \n' +
-              'If ' +
-              installer +
-              ' is already installed, try running the following command manually: ' +
-              chalk.yellow(installer + ' ' + args.join(' '))
-          );
-          if (this.options.forceInstall || this.options['force-install']) {
-            return this.emit('error', error);
-          }
-
-          done();
-        })
-        .on('exit', (code, signal) => {
-          this.emit(`${installer}Install:end`, paths);
-          if (
-            (code || signal) &&
-            (this.options.forceInstall || this.options['force-install'])
-          ) {
-            return this.emit(
-              'error',
-              new Error(
-                `Installation of ${installer} failed with code ${
-                  code || signal
-                }`
-              )
-            );
-          }
-
-          done();
-        });
-    },
-    {
-      once:
-        installer + ' ' + args.join(' ') + ' ' + JSON.stringify(spawnOptions),
-      run: false
-    }
-  );
-};
-
-/**
- * @deprecated
- * Runs `npm` and `bower`, in sequence, in the generated directory and prints a
- * message to let the user know.
- *
- * @example
- * this.installDependencies({
- *   bower: true,
- *   npm: true
- * });
- *
- * @example
- * this.installDependencies({
- *   yarn: {force: true},
- *   npm: false
- * });
- *
- * @param {Object} [options] - options
- * @param {Boolean|Object} [options.npm=true] - whether to run `npm install` or can be options to pass to `dargs` as arguments
- * @param {Boolean|Object} [options.bower=false] - whether to run `bower install` or can be options to pass to `dargs` as arguments
- * @param {Boolean|Object} [options.yarn=false] - whether to run `yarn install` or can be options to pass to `dargs` as arguments
- * @param {Boolean} [options.skipMessage=false] - whether to log the used commands
- */
-install.installDependencies = function (options) {
-  options = options || {};
-  const message = {
-    commands: [],
-    template: _.template(
-      "\n\nI'm all done. " +
-        '<%= skipInstall ? "Just run" : "Running" %> <%= commands %> ' +
-        '<%= skipInstall ? "" : "for you " %>to install the required dependencies.' +
-        '<% if (!skipInstall) { %> If this fails, try running the command yourself.<% } %>\n\n'
-    )
-  };
-
-  const getOptions = (options) => {
-    return typeof options === 'object' ? options : null;
-  };
-
-  if (options.npm !== false) {
-    message.commands.push('npm install');
-    this.npmInstall(null, getOptions(options.npm));
-  }
-
-  if (options.yarn) {
-    message.commands.push('yarn install');
-    this.yarnInstall(null, getOptions(options.yarn));
-  }
-
-  if (options.bower) {
-    message.commands.push('bower install');
-    this.bowerInstall(null, getOptions(options.bower));
-  }
-
-  assert(
-    message.commands.length,
-    'installDependencies needs at least one of `npm`, `bower` or `yarn` to run.'
-  );
-
-  if (!options.skipMessage) {
-    const tplValues = _.extend(
-      {
-        skipInstall: false
-      },
-      this.options,
-      {
-        commands: chalk.yellow.bold(message.commands.join(' && '))
-      }
-    );
-    this.log(message.template(tplValues));
-  }
-};
-
-/**
- * @deprecated
- * Receives a list of `components` and an `options` object to install through bower.
- *
- * The installation will automatically run during the run loop `install` phase.
- *
- * @param {String|Array} [cmpnt] Components to install
- * @param {Object} [options] Options to pass to `dargs` as arguments
- * @param {Object} [spawnOptions] Options to pass `child_process.spawn`.
- */
-install.bowerInstall = function (cmpnt, options, spawnOptions) {
-  this.scheduleInstallTask('bower', cmpnt, options, spawnOptions);
-};
-
-/**
- * @deprecated
- * Receives a list of `packages` and an `options` object to install through npm.
- *
- * The installation will automatically run during the run loop `install` phase.
- *
- * @param {String|Array} [pkgs] Packages to install
- * @param {Object} [options] Options to pass to `dargs` as arguments
- * @param {Object} [spawnOptions] Options to pass `child_process.spawn`.
- */
-install.npmInstall = function (pkgs, options, spawnOptions) {
-  this.scheduleInstallTask('npm', pkgs, options, spawnOptions);
-};
-
-/**
- * @deprecated
- * Receives a list of `packages` and an `options` object to install through yarn.
- *
- * The installation will automatically run during the run loop `install` phase.
- *
- * @param {String|Array} [pkgs] Packages to install
- * @param {Object} [options] Options to pass to `dargs` as arguments
- * @param {Object} [spawnOptions] Options to pass `child_process.spawn`.
- */
-install.yarnInstall = function (pkgs, options, spawnOptions) {
-  this.scheduleInstallTask('yarn', pkgs, options, spawnOptions);
-};
-
-/* eslint-enable unicorn/prefer-spread */
-
-
-
-
- - - - - - - - - - diff --git a/actions_package-json.html b/actions_package-json.html deleted file mode 100644 index db7f3c2b..00000000 --- a/actions_package-json.html +++ /dev/null @@ -1,659 +0,0 @@ - - - - - Mixin: actions/package-json | Generator - - - - - - - - - - - -
- -
-
-
-

actions/package-json

-
- -
-
-
-
- -

Methods

- -
-
-

- - async - - addDependencies - (dependencies) - → {Promise} - - -

-
-
-
-

Add dependencies to the destination the package.json.

-

- Environment watches for package.json changes at - this.env.cwd - , and triggers an package manager install if it has been - committed to disk. If package.json is at a different folder, - like a changed generator root, propagate it to the Environment - like - this.env.cwd = this.destinationPath() - . -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
dependencies - Object - | - - string - | - - Array.<string> -
-
- -
-
Returns:
- - Promise - - - -

a 'packageName: packageVersion' object

-
- -
-
- -
-

- - async - - addDevDependencies - (dependencies) - → {Promise} - - -

-
-
-
-

Add dependencies to the destination the package.json.

-

- Environment watches for package.json changes at - this.env.cwd - , and triggers an package manager install if it has been - committed to disk. If package.json is at a different folder, - like a changed generator root, propagate it to the Environment - like - this.env.cwd = this.destinationPath() - . -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
dependencies - Object - | - - string - | - - Array.<string> -
-
- -
-
Returns:
- - Promise - - - -

a 'packageName: packageVersion' object

-
- -
-
-
-
-
-
- - - - - - - - - - diff --git a/actions_package-json.js.html b/actions_package-json.js.html deleted file mode 100644 index f549d22f..00000000 --- a/actions_package-json.js.html +++ /dev/null @@ -1,556 +0,0 @@ - - - - - Source: actions/package-json.js | Generator - - - - - - - - - - - -
- -
-
-
-
'use strict';
-
-module.exports = (cls) =>
-  /**
-   * @mixin
-   * @alias actions/package-json
-   */
-  class extends cls {
-    /**
-     * @private
-     * Resolve the dependencies to be added to the package.json.
-     *
-     * @param {Object|string|string[]} dependencies
-     * @return {Promise} a 'packageName: packageVersion' object
-     */
-    async _resolvePackageJsonDependencies(dependencies) {
-      if (typeof dependencies === 'string') {
-        dependencies = [dependencies];
-      } else if (typeof dependencies !== 'object') {
-        throw new TypeError(
-          'resolvePackageJsonDependencies requires an object'
-        );
-      } else if (!Array.isArray(dependencies)) {
-        dependencies = await Promise.all(
-          Object.entries(dependencies).map(([pkg, version]) =>
-            version
-              ? Promise.resolve([pkg, version])
-              : this.env.resolvePackage(pkg, version)
-          )
-        );
-        return Object.fromEntries(
-          dependencies.filter((...args) => args.length > 0 && args[0])
-        );
-      }
-
-      const entries = await Promise.all(
-        dependencies.map((dependency) => this.env.resolvePackage(dependency))
-      );
-      return Object.fromEntries(entries);
-    }
-
-    /**
-     * Add dependencies to the destination the package.json.
-     *
-     * Environment watches for package.json changes at `this.env.cwd`, and triggers an package manager install if it has been committed to disk.
-     * If package.json is at a different folder, like a changed generator root, propagate it to the Environment like `this.env.cwd = this.destinationPath()`.
-     *
-     * @param {Object|string|string[]} dependencies
-     * @return {Promise} a 'packageName: packageVersion' object
-     */
-    async addDependencies(dependencies) {
-      dependencies = await this._resolvePackageJsonDependencies(dependencies);
-      this.packageJson.merge({dependencies});
-      return dependencies;
-    }
-
-    /**
-     * Add dependencies to the destination the package.json.
-     *
-     * Environment watches for package.json changes at `this.env.cwd`, and triggers an package manager install if it has been committed to disk.
-     * If package.json is at a different folder, like a changed generator root, propagate it to the Environment like `this.env.cwd = this.destinationPath()`.
-     *
-     * @param {Object|string|string[]} dependencies
-     * @return {Promise} a 'packageName: packageVersion' object
-     */
-    async addDevDependencies(devDependencies) {
-      devDependencies = await this._resolvePackageJsonDependencies(
-        devDependencies
-      );
-      this.packageJson.merge({devDependencies});
-      return devDependencies;
-    }
-  };
-
-
-
-
- - - - - - - - - - diff --git a/actions_spawn-command.html b/actions_spawn-command.html deleted file mode 100644 index ffa4064b..00000000 --- a/actions_spawn-command.html +++ /dev/null @@ -1,713 +0,0 @@ - - - - - Mixin: actions/spawn-command | Generator - - - - - - - - - - - -
- -
-
-
-

actions/spawn-command

-
- -
-
-
-
- -

Methods

- -
-
-

- - static - - spawnCommand - - (command, args, opt - opt - ) - - → {String} - - -

-
-
-
-

- Normalize a command across OS and spawn it (asynchronously). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
command - String - -

program to execute

-
args - Array - -

list of arguments to pass to the program

-
opt - object - - <optional> -
-
-

any cross-spawn options

-
-
- -
-
Returns:
- - String - - - -

spawned process reference

-
- -
-
- -
-

- - static - - spawnCommandSync - - (command, args, opt - opt - ) - - → {String} - - -

-
-
-
-

- Normalize a command across OS and spawn it (synchronously). -

-
- -
-
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
command - String - -

program to execute

-
args - Array - -

list of arguments to pass to the program

-
opt - object - - <optional> -
-
-

any cross-spawn options

-
-
- -
-
Returns:
- - String - - - -

spawn.sync result

-
- -
-
-
-
-
-
- - - - - - - - - - diff --git a/actions_spawn-command.js.html b/actions_spawn-command.js.html deleted file mode 100644 index 2761f329..00000000 --- a/actions_spawn-command.js.html +++ /dev/null @@ -1,523 +0,0 @@ - - - - - Source: actions/spawn-command.js | Generator - - - - - - - - - - - -
- -
-
-
-
'use strict';
-const spawn = require('execa');
-
-/**
- * @mixin
- * @alias actions/spawn-command
- */
-const spawnCommand = module.exports;
-
-/**
- * Normalize a command across OS and spawn it (asynchronously).
- *
- * @param {String} command program to execute
- * @param {Array} args list of arguments to pass to the program
- * @param {object} [opt] any cross-spawn options
- * @return {String} spawned process reference
- */
-spawnCommand.spawnCommand = function (command, args, opt) {
-  return spawn(command, args, {
-    stdio: 'inherit',
-    cwd: this.destinationRoot(),
-    ...opt
-  });
-};
-
-/**
- * Normalize a command across OS and spawn it (synchronously).
- *
- * @param {String} command program to execute
- * @param {Array} args list of arguments to pass to the program
- * @param {object} [opt] any cross-spawn options
- * @return {String} spawn.sync result
- */
-spawnCommand.spawnCommandSync = function (command, args, opt) {
-  return spawn.sync(command, args, {
-    stdio: 'inherit',
-    cwd: this.destinationRoot(),
-    ...opt
-  });
-};
-
-
-
-
- - - - - - - - - - diff --git a/actions_user.html b/actions_user.html deleted file mode 100644 index 03504670..00000000 --- a/actions_user.html +++ /dev/null @@ -1,609 +0,0 @@ - - - - - Mixin: actions/user | Generator - - - - - - - - - - - -
- -
-
-
-

actions/user

-
- -
-
-
-
- -

Methods

- -
-
-

- - static - - git.email - () - → {String} - -
- - actions/user.js - - , - line 44 -
-

-
-
-
-

- Retrieves user's email from Git in the global scope or the - project scope (it'll take what Git will use in the current - context) -

-
- -
-
Returns:
- - String - - - -

configured git email or undefined

-
- -
-
- -
-

- - static - - git.name - () - → {String} - -
- - actions/user.js - - , - line 22 -
-

-
-
-
-

- Retrieves user's name from Git in the global scope or the - project scope (it'll take what Git will use in the current - context) -

-
- -
-
Returns:
- - String - - - -

configured git name or undefined

-
- -
-
- -
-

- - static - - github.username - () - → {Promise} - -
- - actions/user.js - - , - line 66 -
-

-
-
-
-

Retrieves GitHub's username from the GitHub API

-
- -
-
Returns:
- - Promise - - - -

- Resolved with the GitHub username or rejected if unable to get - the information -

-
- -
-
-
-
-
-
- - - - - - - - - - diff --git a/actions_user.js.html b/actions_user.js.html deleted file mode 100644 index 752c513f..00000000 --- a/actions_user.js.html +++ /dev/null @@ -1,549 +0,0 @@ - - - - - Source: actions/user.js | Generator - - - - - - - - - - - -
- -
-
-
-
'use strict';
-const shell = require('shelljs');
-const githubUsername = require('github-username');
-
-const nameCache = new Map();
-const emailCache = new Map();
-
-/**
- * @mixin
- * @alias actions/user
- */
-const user = module.exports;
-
-user.git = {};
-user.github = {};
-
-/**
- * Retrieves user's name from Git in the global scope or the project scope
- * (it'll take what Git will use in the current context)
- * @return {String} configured git name or undefined
- */
-user.git.name = () => {
-  let name = nameCache.get(process.cwd());
-
-  if (name) {
-    return name;
-  }
-
-  if (shell.which('git')) {
-    name = shell
-      .exec('git config --get user.name', {silent: true})
-      .stdout.trim();
-    nameCache.set(process.cwd(), name);
-  }
-
-  return name;
-};
-
-/**
- * Retrieves user's email from Git in the global scope or the project scope
- * (it'll take what Git will use in the current context)
- * @return {String} configured git email or undefined
- */
-user.git.email = () => {
-  let email = emailCache.get(process.cwd());
-
-  if (email) {
-    return email;
-  }
-
-  if (shell.which('git')) {
-    email = shell
-      .exec('git config --get user.email', {silent: true})
-      .stdout.trim();
-    emailCache.set(process.cwd(), email);
-  }
-
-  return email;
-};
-
-/**
- * Retrieves GitHub's username from the GitHub API
- * @return {Promise} Resolved with the GitHub username or rejected if unable to
- *                   get the information
- */
-user.github.username = () => githubUsername(user.git.email());
-
-
-
-
- - - - - - - - - - diff --git a/global.html b/global.html deleted file mode 100644 index 6f08e696..00000000 --- a/global.html +++ /dev/null @@ -1,870 +0,0 @@ - - - - - Global | Generator - - - - - - - - - - - -
- -
-
-
-

Global

-
- -
-

Members

- -
-
-

- - constant - - proxyHandler - - -
- - util/storage.js - - , - line 9 -
-

-
-
-
-

Proxy handler for Storage

-
- -
-
-
- -

Type Definitions

- -
-
-

- Priority - -
- index.js - , - line 48 -
-

-
-
-
-

Priority object.

-
- -
Type:
- - -
Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
priorityName - string - -

Name of the priority.

-
before - string - - <optional> -
-
-

- The queue which this priority should be added before. -

-
- -
-
- -
-

- QueueOptions - -
- index.js - , - line 34 -
-

-
-
-
-

Queue options.

-
- -
Type:
-
    -
  • - Object -
  • -
- -
Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
queueName - string - - <optional> -
-

Name of the queue.

once - boolean - - <optional> -
-
-

Execute only once by namespace and taskName.

-
run - boolean - - <optional> -
-
-

Run the queue if not running yet.

-
- -
-
- -
-

- Task - -
- index.js - , - line 55 -
-

-
-
-
-

Complete Task object.

-
- -
Type:
- - -
Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
method - - WrappedMethod - - -

Function to be queued.

-
taskName - string -

Name of the task.

- -
-
- -
-

- TaskOptions - -
- index.js - , - line 42 -
-

-
-
-
-

Task options.

-
- -
Type:
- - -
Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
reject - function - - <optional> -
-

Reject callback.

- -
-
- -
-

- - WrappedMethod - () - - -
- index.js - , - line 62 -
-

-
-
-
-

- RunAsync creates a promise and executes wrappedMethod inside - the promise. It replaces async property of the wrappedMethod's - context with one RunAsync provides. async() simulates an async - function by creating a callback. -

-

It supports promises/async and sync functions.

-
    -
  • - Promises/async: forward resolve/reject from the runAsync - promise to the promise returned by the wrappedMethod. -
  • -
  • - Sync functions: resolves with the returned value. Can be a - promise for chaining -
  • -
  • - Sync functions with callback (done = this.async()) calls: - Reject with done(rejectValue) first argument Resolve with - done(undefined, resolveValue) second argument -
  • -
  • - Callback must called when 'async()' was called inside a sync - function. -
  • -
  • - Callback can be ignored when 'async()' was called inside a - async function. -
  • -
-
- -
-
-
-
-
-
- - - - - - - - - - diff --git a/index.html b/index.html deleted file mode 100644 index e654dd97..00000000 --- a/index.html +++ /dev/null @@ -1,767 +0,0 @@ - - - - - Home | Generator - - - - - - - - - - - -
- -
-
-
-

- Generator - - npm - - - Build Status - - - Coverage Status - - - Gitter - -

-
-

- Rails-inspired generator system that provides scaffolding for your - apps -

-
-

- -

-

Getting Started

-

- If you're interested in writing your own Yeoman generator we - recommend reading - - the official getting started guide - - . The guide covers all the basics you need to get started. -

-

- A generator can be as complex as you want it to be. It can simply - copy a bunch of boilerplate files, or it can be more advanced asking - the user's preferences to scaffold a tailor made project. This - decision is up to you. -

-

- The fastest way to get started is to use - - generator-generator - - , a Yeoman generator to generate a Yeoman generator. -

-

- After reading the getting started guide, you might want to read the - code source or visit our - API documentation - for a list of all methods available. -

-

- - API documentation for v4.x - - . -

-

Debugging

-

- See the - - debugging guide - - . -

-

Contributing

-

- We love contributors! See our - contribution guideline - to get started. -

-

Sponsors

-

- Love Yeoman work and community? Help us keep it alive by donating - funds to cover project expenses! -
- [ - - Become a sponsor - - ] -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

License

-

- - BSD license - - Copyright (c) Google -

-
-
-
- - - - - - - - - - diff --git a/index.js.html b/index.js.html deleted file mode 100644 index 565c0257..00000000 --- a/index.js.html +++ /dev/null @@ -1,2057 +0,0 @@ - - - - - Source: index.js | Generator - - - - - - - - - - - -
- -
-
-
-
'use strict';
-const fs = require('fs');
-const path = require('path');
-const os = require('os');
-const EventEmitter = require('events');
-const assert = require('assert');
-const _ = require('lodash');
-const semver = require('semver');
-const readPkgUp = require('read-pkg-up');
-const chalk = require('chalk');
-const minimist = require('minimist');
-const runAsync = require('run-async');
-const createDebug = require('debug');
-const memFsEditor = require('mem-fs-editor');
-
-const packageJson = require('../package.json');
-const Storage = require('./util/storage');
-const promptSuggestion = require('./util/prompt-suggestion');
-
-const EMPTY = '@@_YEOMAN_EMPTY_MARKER_@@';
-const debug = createDebug('yeoman:generator');
-const ENV_VER_WITH_VER_API = '2.9.0';
-
-const mixins = [require('./actions/package-json')];
-
-// eslint-disable-next-line unicorn/no-array-reduce
-const Base = mixins.reduce((a, b) => b(a), EventEmitter);
-
-// Ensure a prototype method is a candidate run by default
-const methodIsValid = function (name) {
-  return name.charAt(0) !== '_' && name !== 'constructor';
-};
-
-/**
- * Queue options.
- * @typedef {Object} QueueOptions
- * @property {string} [queueName] - Name of the queue.
- * @property {boolean} [once] - Execute only once by namespace and taskName.
- * @property {boolean} [run] - Run the queue if not running yet.
- */
-
-/**
- * Task options.
- * @typedef {QueueOptions} TaskOptions
- * @property {Function} [reject] - Reject callback.
- */
-
-/**
- * Priority object.
- * @typedef {QueueOptions} Priority
- * @property {string} priorityName - Name of the priority.
- * @property {string} [before] - The queue which this priority should be added before.
- */
-
-/**
- * Complete Task object.
- * @typedef {TaskOptions} Task
- * @property {WrappedMethod} method - Function to be queued.
- * @property {string} taskName - Name of the task.
- */
-
-/**
- * RunAsync creates a promise and executes wrappedMethod inside the promise.
- * It replaces async property of the wrappedMethod's context with one RunAsync provides.
- * async() simulates an async function by creating a callback.
- *
- * It supports promises/async and sync functions.
- * - Promises/async: forward resolve/reject from the runAsync promise to the
- *   promise returned by the wrappedMethod.
- * - Sync functions: resolves with the returned value.
- *   Can be a promise for chaining
- * - Sync functions with callback (done = this.async()) calls:
- *   Reject with done(rejectValue) first argument
- *   Resolve with done(undefined, resolveValue) second argument
- * - Callback must called when 'async()' was called inside a sync function.
- * - Callback can be ignored when 'async()' was called inside a async function.
- * @typedef {Function} WrappedMethod
- */
-
-class Generator extends Base {
-  // If for some reason environment adds more queues, we should use or own for stability.
-  static get queues() {
-    return [
-      'initializing',
-      'prompting',
-      'configuring',
-      'default',
-      'writing',
-      'transform',
-      'conflicts',
-      'install',
-      'end'
-    ];
-  }
-
-  /**
-   * @classdesc The `Generator` class provides the common API shared by all generators.
-   * It define options, arguments, file, prompt, log, API, etc.
-   *
-   * It mixes into its prototype all the methods found in the `actions/` mixins.
-   *
-   * Every generator should extend this base class.
-   *
-   * @constructor
-   * @augments actions/package-json
-   * @mixes actions/help
-   * @mixes actions/spawn-command
-   * @mixes actions/user
-   * @mixes actions/fs
-   * @mixes nodejs/EventEmitter
-   *
-   * @param {string[]} args           - Provide arguments at initialization
-   * @param {Object} options          - Provide options at initialization
-   * @param {Priority[]} [options.customPriorities] - Custom priorities
-   * @property {Object}   env         - the current Environment being run
-   * @property {String}   resolved    - the path to the current generator
-   * @property {String}   description - Used in `--help` output
-   * @property {String}   appname     - The application name
-   * @property {Storage}  config      - `.yo-rc` config file manager
-   * @property {Object}   fs          - An instance of {@link https://github.com/SBoudrias/mem-fs-editor Mem-fs-editor}
-   * @property {Function} log         - Output content through Interface Adapter
-   * @param {Object} features         - Provide Generator features information
-   * @property {String}   uniqueBy    - The Generator instance unique identifier.
-   *                                    The Environment will ignore duplicated identifiers.
-   * @property {String}   unique      - uniqueBy calculation method (undefined/argument/namespace)
-   * @property {boolean} tasksMatchingPriority - Only queue methods that matches a priority.
-   * @property {String}   taskPrefix  - Tasks methods starts with prefix. Allows api methods (non tasks) without prefix.
-   * @property {boolean|Function} customInstallTask - Provides a custom install task. Environment >= 3.2.0
-   *                                                  Environment built-in task will not be executed
-   * @property {boolean|Function} customCommitTask - Provides a custom commit task. Environment >= 3.2.0
-   *                                                  Environment built-in task will not be executed
-   *
-   * @example
-   * const Generator = require('yeoman-generator');
-   * module.exports = class extends Generator {
-   *   writing() {
-   *     this.fs.write(this.destinationPath('index.js'), 'const foo = 1;');
-   *   }
-   * };
-   */
-  constructor(args, options, features) {
-    super();
-
-    if (!Array.isArray(args)) {
-      features = options;
-      options = args;
-      args = [];
-    }
-
-    options = options || {};
-    this.options = options;
-    this._initOptions = _.clone(options);
-    this._args = args || [];
-    this._options = {};
-    this._arguments = [];
-    this._prompts = [];
-    this._composedWith = [];
-    this._namespace = this.options.namespace;
-    this._namespaceId = this.options.namespaceId;
-    this.yoGeneratorVersion = packageJson.version;
-    this.features = features || {unique: this.options.unique};
-
-    this.option('help', {
-      type: Boolean,
-      alias: 'h',
-      description: "Print the generator's options and usage"
-    });
-
-    this.option('skip-cache', {
-      type: Boolean,
-      description: 'Do not remember prompt answers',
-      default: false
-    });
-
-    this.option('skip-install', {
-      type: Boolean,
-      description: 'Do not automatically install dependencies',
-      default: false
-    });
-
-    this.option('force-install', {
-      type: Boolean,
-      description: 'Fail on install dependencies error',
-      default: false
-    });
-
-    this.option('ask-answered', {
-      type: Boolean,
-      description: 'Show prompts for already configured options',
-      default: false
-    });
-
-    this.env = this.options.env;
-
-    this.resolved = this.options.resolved || __filename;
-    this.description = this.description || '';
-
-    if (this.env) {
-      // Determine the app root
-      this.contextRoot = this.env.cwd;
-      this.destinationRoot(this.options.destinationRoot || this.env.cwd);
-      // Clear destionationRoot, _destinationRoot will take priority when composing, but not override passed options.
-      delete this.options.destinationRoot;
-
-      // Ensure source/destination path, can be configured from subclasses
-      this.sourceRoot(path.join(path.dirname(this.resolved), 'templates'));
-
-      this.fs = memFsEditor.create(this.env.sharedFs);
-    }
-
-    // Add convenience debug object
-    this._debug = createDebug(
-      this.options.namespace || 'yeoman:unknownnamespace'
-    );
-
-    // Expose utilities for dependency-less generators.
-    this._ = _;
-
-    if (this.options.help) {
-      return;
-    }
-
-    if (this.features.unique && !this.features.uniqueBy) {
-      const {namespace} = this.options;
-      let uniqueBy;
-      if (
-        this.features.unique === true ||
-        this.features.unique === 'namespace'
-      ) {
-        uniqueBy = namespace;
-      } else if (
-        this.features.unique === 'argument' &&
-        this._args.length === 1
-      ) {
-        const namespaceId = this.env
-          .requireNamespace(namespace)
-          .with({instanceId: this._args[0]});
-        uniqueBy = namespaceId.id;
-      } else {
-        throw new Error(
-          `Error generating a uniqueBy value. Uniqueness '${this.features.unique}' not supported by '${this.options.namespace}'`
-        );
-      }
-
-      this.features.uniqueBy = uniqueBy;
-    }
-
-    if (!this.env) {
-      throw new Error('This generator requires an environment.');
-    }
-
-    // Ensure the environment support features this yeoman-generator version require.
-    if (
-      !this.env ||
-      !this.env.adapter ||
-      !this.env.runLoop ||
-      !this.env.sharedFs ||
-      !this.env.fs
-    ) {
-      throw new Error(
-        "Current environment doesn't provides some necessary feature this generator needs."
-      );
-    }
-
-    // Mirror the adapter log method on the generator.
-    //
-    // example:
-    // this.log('foo');
-    // this.log.error('bar');
-    this.log = this.env.adapter && this.env.adapter.log;
-
-    // Place holder for run-async callback.
-    this.async = () => () => {};
-
-    this.appname = this.determineAppname();
-
-    // Create config for the generator and instance
-    if (this._namespaceId && this._namespaceId.generator) {
-      this.generatorConfig = this.config.createStorage(
-        `:${this._namespaceId.generator}`
-      );
-      if (this._namespaceId.instanceId) {
-        this.instanceConfig = this.generatorConfig.createStorage(
-          `#${this._namespaceId.instanceId}`
-        );
-      }
-    }
-
-    this._globalConfig = this._getGlobalStorage();
-
-    // Queues map: generator's queue name => grouped-queue's queue name (custom name)
-    this._queues = {};
-
-    // Add original queues.
-    for (const queue of Generator.queues) {
-      this._queues[queue] = {priorityName: queue, queueName: queue};
-    }
-
-    // Add custom queues
-    if (Array.isArray(this.options.customPriorities)) {
-      this.registerPriorities(this.options.customPriorities);
-    }
-
-    this.compose = this.options.compose;
-
-    // Requires environment 3
-    if (!this.options.skipCheckEnv) {
-      this.checkEnvironmentVersion('3.0.0');
-    }
-
-    this.checkEnvironmentVersion('3.2.0', true);
-  }
-
-  /**
-   * Configure Generator behaviours.
-   *
-   * @param {Object} features
-   * @param {boolean|string} [features.unique] - Generates a uniqueBy id for the environment
-   *                                    Accepts 'namespace' or 'true' for one instance by namespace
-   *                                    Accepts 'argument' for one instance by namespace and 1 argument
-   *
-   */
-  setFeatures(features) {
-    Object.assign(this.features, features);
-  }
-
-  /**
-   * Specifications for Environment features.
-   *
-   * @return {Object}
-   */
-  getFeatures() {
-    return this.features;
-  }
-
-  /**
-   * Register priorities for this generator
-   *
-   * @param  {Object[]} priorities - Priorities
-   * @param  {String} priorities.priorityName - Priority name
-   * @param  {String} [priorities.before] - The new priority will be queued before the `before` priority. Required for new priorities.
-   * @param  {String} [priorities.queueName] - Name to be used at grouped-queue
-   * @param  {boolean} [priorities.edit] - Edit a priority
-   * @param  {boolean} [priorities.skip] - Queued manually only
-   * @param  {Object[]|function} [priorities.args] - Arguments to pass to tasks
-   */
-  registerPriorities(priorities) {
-    priorities = priorities.filter((priority) => {
-      if (priority.edit) {
-        const queue = this._queues[priority.priorityName];
-        if (!queue) {
-          throw new Error(
-            `Error editing priority ${priority.priorityName}, not found`
-          );
-        }
-
-        Object.assign(queue, {...priority, edit: undefined});
-      }
-
-      return !priority.edit;
-    });
-    const customPriorities = priorities.map((customPriority) => {
-      // Keep backward compatibility with name
-      const newPriority = {
-        priorityName: customPriority.name,
-        ...customPriority
-      };
-      delete newPriority.name;
-      return newPriority;
-    });
-
-    // Sort customPriorities, a referenced custom queue must be added before the one that reference it.
-    customPriorities.sort((a, b) => {
-      if (a.priorityName === b.priorityName) {
-        throw new Error(`Duplicate custom queue ${a.name}`);
-      }
-
-      if (a.priorityName === b.before) {
-        return -1;
-      }
-
-      if (b.priorityName === a.before) {
-        return 1;
-      }
-
-      return 0;
-    });
-
-    // Add queue to runLoop
-    for (const customQueue of customPriorities) {
-      customQueue.queueName =
-        customQueue.queueName ||
-        `${this.options.namespace}#${customQueue.priorityName}`;
-      debug(`Registering custom queue ${customQueue.queueName}`);
-      this._queues[customQueue.priorityName] = customQueue;
-
-      if (this.env.runLoop.queueNames.includes(customQueue.queueName)) {
-        continue;
-      }
-
-      const beforeQueue = customQueue.before
-        ? this._queues[customQueue.before].queueName
-        : undefined;
-      this.env.runLoop.addSubQueue(customQueue.queueName, beforeQueue);
-    }
-  }
-
-  checkEnvironmentVersion(packageDependency, version, warning = false) {
-    if (typeof version === 'boolean') {
-      warning = version;
-      version = undefined;
-    }
-
-    if (version === undefined) {
-      version = packageDependency;
-      packageDependency = 'yeoman-environment';
-    }
-
-    version = version || ENV_VER_WITH_VER_API;
-    const returnError = (currentVersion) => {
-      return new Error(
-        `This generator (${this.options.namespace}) requires ${packageDependency} at least ${version}, current version is ${currentVersion}, try reinstalling latest version of 'yo' or use '--ignore-version-check' option`
-      );
-    };
-
-    if (!this.env.getVersion) {
-      if (!this.options.ignoreVersionCheck && !warning) {
-        throw returnError(`less than ${ENV_VER_WITH_VER_API}`);
-      }
-
-      console.warn(
-        `It's not possible to check version with running Environment less than ${ENV_VER_WITH_VER_API}`
-      );
-      console.warn('Some features may be missing');
-      if (semver.lte(version, '2.8.1')) {
-        return undefined;
-      }
-
-      return false;
-    }
-
-    const runningVersion = this.env.getVersion(packageDependency);
-    if (runningVersion !== undefined && semver.lte(version, runningVersion)) {
-      return true;
-    }
-
-    if (this.options.ignoreVersionCheck || warning) {
-      console.warn(
-        `Current ${packageDependency} is not compatible with current generator, min required: ${version} current version: ${runningVersion}. Some features may be missing, try updating reinstalling 'yo'.`
-      );
-      return false;
-    }
-
-    throw returnError(runningVersion);
-  }
-
-  /**
-   * Convenience debug method
-   *
-   * @param  {any} args parameters to be passed to debug
-   */
-  debug(...args) {
-    this._debug(...args);
-  }
-
-  /**
-   * Register stored config prompts and optional option alternative.
-   *
-   * @param {Inquirer|Inquirer[]} questions - Inquirer question or questions.
-   * @param {Object|Boolean} [questions.exportOption] - Additional data to export this question as an option.
-   * @param {Storage|String} [question.storage=this.config] - Storage to store the answers.
-   */
-  registerConfigPrompts(questions) {
-    questions = Array.isArray(questions) ? questions : [questions];
-    const getOptionTypeFromInquirerType = (type) => {
-      if (type === 'number') {
-        return Number;
-      }
-
-      if (type === 'confirm') {
-        return Boolean;
-      }
-
-      if (type === 'checkbox') {
-        return Array;
-      }
-
-      return String;
-    };
-
-    for (const q of questions) {
-      const question = {...q};
-      if (q.exportOption) {
-        const option =
-          typeof q.exportOption === 'boolean' ? {} : q.exportOption;
-        this.option({
-          name: q.name,
-          type: getOptionTypeFromInquirerType(q.type),
-          description: q.message,
-          ...option,
-          storage: q.storage || this.config
-        });
-      }
-
-      this._prompts.push(question);
-    }
-  }
-
-  /**
-   * Prompt user to answer questions. The signature of this method is the same as {@link https://github.com/SBoudrias/Inquirer.js Inquirer.js}
-   *
-   * On top of the Inquirer.js API, you can provide a `{store: true}` property for
-   * every question descriptor. When set to true, Yeoman will store/fetch the
-   * user's answers as defaults.
-   *
-   * @param  {object|object[]} questions  Array of question descriptor objects. See {@link https://github.com/SBoudrias/Inquirer.js/blob/master/README.md Documentation}
-   * @param  {Storage|String} [questions.storage] Storage object or name (generator property) to be used by the question to store/fetch the response.
-   * @param  {Storage|String} [storage] Storage object or name (generator property) to be used by default to store/fetch responses.
-   * @return {Promise} prompt promise
-   */
-  prompt(questions, storage) {
-    const checkInquirer = () => {
-      if (this.inquireSupportsPrefilled === undefined) {
-        this.checkEnvironmentVersion();
-        this.inquireSupportsPrefilled = this.checkEnvironmentVersion(
-          'inquirer',
-          '7.1.0'
-        );
-      }
-    };
-
-    if (storage !== undefined) {
-      checkInquirer();
-    }
-
-    const storageForQuestion = {};
-
-    const getAnswerFromStorage = (question) => {
-      let questionStorage = question.storage || storage;
-      questionStorage =
-        typeof questionStorage === 'string'
-          ? this[questionStorage]
-          : questionStorage;
-      if (questionStorage) {
-        checkInquirer();
-
-        const {name} = question;
-        storageForQuestion[name] = questionStorage;
-        const value = questionStorage.getPath(name);
-        if (value !== undefined) {
-          question.default = (answers) => answers[name];
-          return [name, value];
-        }
-      }
-
-      return undefined;
-    };
-
-    if (!Array.isArray(questions)) {
-      questions = [questions];
-    }
-
-    // Shows the prompt even if the answer already exists.
-    for (const question of questions) {
-      if (question.askAnswered === undefined) {
-        question.askAnswered = this.options.askAnswered === true;
-      }
-    }
-
-    questions = promptSuggestion.prefillQuestions(
-      this._globalConfig,
-      questions
-    );
-    questions = promptSuggestion.prefillQuestions(this.config, questions);
-    const answers = Object.fromEntries(
-      questions.map(getAnswerFromStorage).filter(Boolean)
-    );
-
-    return this.env.adapter.prompt(questions, answers).then((answers) => {
-      Object.entries(storageForQuestion).forEach(([name, questionStorage]) => {
-        const answer = answers[name] === undefined ? null : answers[name];
-        questionStorage.setPath(name, answer);
-      });
-
-      if (!this.options.skipCache) {
-        promptSuggestion.storeAnswers(
-          this._globalConfig,
-          questions,
-          answers,
-          false
-        );
-        if (!this.options.skipLocalCache) {
-          promptSuggestion.storeAnswers(this.config, questions, answers, true);
-        }
-      }
-
-      return answers;
-    });
-  }
-
-  /**
-   * Adds an option to the set of generator expected options, only used to
-   * generate generator usage. By default, generators get all the cli options
-   * parsed by nopt as a `this.options` hash object.
-   *
-   * @param {String} [name] - Option name
-   * @param {Object} config - Option options
-   * @param {any} config.type - Either Boolean, String or Number
-   * @param {string} [config.description] - Description for the option
-   * @param {any} [config.default] - Default value
-   * @param {any} [config.alias] - Option name alias (example `-h` and --help`)
-   * @param {any} [config.hide] - Boolean whether to hide from help
-   * @param {Storage} [config.storage] - Storage to persist the option
-   * @return {this} This generator
-   */
-  option(name, config) {
-    if (Array.isArray(name)) {
-      for (const option of name) {
-        this.option(option);
-      }
-
-      return;
-    }
-
-    if (typeof name === 'object') {
-      config = name;
-      name = config.name;
-    }
-
-    config = config || {};
-
-    // Alias default to defaults for backward compatibility.
-    if ('defaults' in config) {
-      config.default = config.defaults;
-    }
-
-    config.description = config.description || config.desc;
-
-    _.defaults(config, {
-      name,
-      description: 'Description for ' + name,
-      type: Boolean,
-      hide: false
-    });
-
-    // Check whether boolean option is invalid (starts with no-)
-    const boolOptionRegex = /^no-/;
-    if (config.type === Boolean && boolOptionRegex.test(name)) {
-      const simpleName = name.replace(boolOptionRegex, '');
-      throw new Error(
-        [
-          `Option name ${chalk.yellow(name)} cannot start with ${chalk.red(
-            'no-'
-          )}\n`,
-          `Option name prefixed by ${chalk.yellow(
-            '--no'
-          )} are parsed as implicit`,
-          ` boolean. To use ${chalk.yellow('--' + name)} as an option, use\n`,
-          chalk.cyan(`  this.option('${simpleName}', {type: Boolean})`)
-        ].join('')
-      );
-    }
-
-    if (this._options[name] === null || this._options[name] === undefined) {
-      this._options[name] = config;
-    }
-
-    if (!this.options.skipParseOptions) {
-      this.parseOptions();
-    }
-
-    if (config.storage && this.options[name] !== undefined) {
-      const storage =
-        typeof config.storage === 'string'
-          ? this[config.storage]
-          : config.storage;
-      storage.set(name, this.options[name]);
-    }
-
-    return this;
-  }
-
-  /**
-   * Adds an argument to the class and creates an attribute getter for it.
-   *
-   * Arguments are different from options in several aspects. The first one
-   * is how they are parsed from the command line, arguments are retrieved
-   * based on their position.
-   *
-   * Besides, arguments are used inside your code as a property (`this.argument`),
-   * while options are all kept in a hash (`this.options`).
-   *
-   *
-   * @param {String} name - Argument name
-   * @param {Object} config - Argument options
-   * @param {any} config.type - String, Number, Array, or Object
-   * @param {string} [config.description] - Description for the argument
-   * @param {boolean} [config.required] - required` Boolean whether it is required
-   * @param {boolean} [config.optional] - Boolean whether it is optional
-   * @param {any} [config.default] - Default value for this argument
-   * @return {this} This generator
-   */
-  argument(name, config) {
-    config = config || {};
-
-    // Alias default to defaults for backward compatibility.
-    if ('defaults' in config) {
-      config.default = config.defaults;
-    }
-
-    config.description = config.description || config.desc;
-
-    _.defaults(config, {
-      name,
-      required: config.default === null || config.default === undefined,
-      type: String
-    });
-
-    this._arguments.push(config);
-
-    if (!this.options.skipParseOptions) {
-      this.parseOptions();
-    }
-
-    return this;
-  }
-
-  parseOptions() {
-    const minimistDef = {
-      string: [],
-      boolean: [],
-      alias: {},
-      default: {}
-    };
-
-    _.each(this._options, (option) => {
-      if (option.type === Boolean) {
-        minimistDef.boolean.push(option.name);
-        if (!('default' in option) && !option.required) {
-          minimistDef.default[option.name] = EMPTY;
-        }
-      } else {
-        minimistDef.string.push(option.name);
-      }
-
-      if (option.alias) {
-        minimistDef.alias[option.alias] = option.name;
-      }
-
-      // Only apply default values if we don't already have a value injected from
-      // the runner
-      if (option.name in this._initOptions) {
-        minimistDef.default[option.name] = this._initOptions[option.name];
-      } else if (option.alias && option.alias in this._initOptions) {
-        minimistDef.default[option.name] = this._initOptions[option.alias];
-      } else if ('default' in option) {
-        minimistDef.default[option.name] = option.default;
-      }
-    });
-
-    const parsedOptions = minimist(this._args, minimistDef);
-
-    // Parse options to the desired type
-    _.each(parsedOptions, (option, name) => {
-      // Manually set value as undefined if it should be.
-      if (option === EMPTY) {
-        delete parsedOptions[name];
-        return;
-      }
-
-      if (this._options[name] && option !== undefined) {
-        parsedOptions[name] = this._options[name].type(option);
-      }
-    });
-
-    // Parse positional arguments to valid options
-    for (const [index, config] of this._arguments.entries()) {
-      let value;
-      if (index >= parsedOptions._.length) {
-        if (config.name in this._initOptions) {
-          value = this._initOptions[config.name];
-        } else if ('default' in config) {
-          value = config.default;
-        } else {
-          continue;
-        }
-      } else if (config.type === Array) {
-        value = parsedOptions._.slice(index, parsedOptions._.length);
-      } else {
-        value = config.type(parsedOptions._[index]);
-      }
-
-      parsedOptions[config.name] = value;
-    }
-
-    // Make the parsed options available to the instance
-    Object.assign(this.options, parsedOptions);
-    this.args = parsedOptions._;
-    this.arguments = parsedOptions._;
-
-    // Make sure required args are all present
-    this.checkRequiredArgs();
-  }
-
-  checkRequiredArgs() {
-    // If the help option was provided, we don't want to check for required
-    // arguments, since we're only going to print the help message anyway.
-    if (this.options.help) {
-      return;
-    }
-
-    // Bail early if it's not possible to have a missing required arg
-    if (this.args.length > this._arguments.length) {
-      return;
-    }
-
-    for (const [position, config] of this._arguments.entries()) {
-      // If the help option was not provided, check whether the argument was
-      // required, and whether a value was provided.
-      if (config.required && position >= this.args.length) {
-        throw new Error(
-          `Did not provide required argument ${chalk.bold(config.name)}!`
-        );
-      }
-    }
-  }
-
-  /**
-   * Schedule methods on a run queue.
-   *
-   * @param {Function|Object} method: Method to be scheduled or object with function properties.
-   * @param {String} [methodName]: Name of the method (task) to be scheduled.
-   * @param {String} [queueName]: Name of the queue to be scheduled on.
-   * @param {Function} [reject]: Reject callback.
-   */
-  queueMethod(method, methodName, queueName, reject) {
-    if (typeof queueName === 'function') {
-      reject = queueName;
-      queueName = 'default';
-    } else {
-      queueName = queueName || 'default';
-    }
-
-    if (!_.isFunction(method)) {
-      if (typeof methodName === 'function') {
-        reject = methodName;
-        methodName = undefined;
-      }
-
-      this.queueTaskGroup(method, {
-        queueName: methodName,
-        reject
-      });
-      return;
-    }
-
-    this.queueTask({
-      method,
-      taskName: methodName,
-      queueName,
-      reject
-    });
-  }
-
-  /**
-   * Schedule tasks from a group on a run queue.
-   *
-   * @param {Object}          taskGroup: Object containing tasks.
-   * @param {TaskOptions} [taskOptions]: options.
-   */
-  queueTaskGroup(taskGroup, taskOptions) {
-    this.extractTasksFromGroup(taskGroup, taskOptions).forEach((task) => {
-      this.queueTask(task);
-    });
-  }
-
-  /**
-   * @private
-   * Extract tasks from a priority.
-   *
-   * @param {String}  name: The method name to schedule.
-   * @param {TaskOptions} [taskOptions]: options.
-   */
-  extractTasksFromPriority(name, taskOptions = {}) {
-    const priority = this._queues[name];
-    taskOptions = {
-      ...priority,
-      cancellable: true,
-      run: false,
-      ...taskOptions
-    };
-
-    if (taskOptions.auto && priority && priority.skip) {
-      return [];
-    }
-
-    const {taskPrefix = this.features.taskPrefix || ''} = taskOptions;
-    const propertyName = taskPrefix ? `${taskPrefix}${name}` : name;
-    const property = Object.getOwnPropertyDescriptor(
-      taskOptions.taskOrigin || Object.getPrototypeOf(this),
-      propertyName
-    );
-    if (!property) return [];
-
-    const item = property.value ? property.value : property.get.call(this);
-
-    // Name points to a function; single task
-    if (typeof item === 'function') {
-      return [{...taskOptions, taskName: name, method: item}];
-    }
-
-    if (!item || !priority) {
-      return [];
-    }
-
-    return this.extractTasksFromGroup(item, taskOptions);
-  }
-
-  /**
-   * @private
-   * Extract tasks from group.
-   *
-   * @param {Object}  group: Task group.
-   * @param {TaskOptions} [taskOptions]: options.
-   */
-  extractTasksFromGroup(group, taskOptions) {
-    return Object.entries(group)
-      .map(([taskName, method]) => {
-        if (typeof method !== 'function' || !methodIsValid(taskName)) return;
-        return {
-          ...taskOptions,
-          method,
-          taskName
-        };
-      })
-      .filter(Boolean);
-  }
-
-  /**
-   * @private
-   * Schedule a generator's method on a run queue.
-   *
-   * @param {String}  name: The method name to schedule.
-   * @param {TaskOptions} [taskOptions]: options.
-   */
-  queueOwnTask(name, taskOptions) {
-    this.extractTasksFromPriority(name, taskOptions).forEach((task) =>
-      this.queueTask(task)
-    );
-  }
-
-  /**
-   * @private
-   * Get task names.
-   *
-   * @return {string[]}
-   */
-  getTaskNames() {
-    const methods = Object.getOwnPropertyNames(Object.getPrototypeOf(this));
-    let validMethods = methods.filter(methodIsValid);
-    const {taskPrefix} = this.features;
-
-    if (taskPrefix) {
-      validMethods = validMethods
-        .filter((method) => method.startsWith(taskPrefix))
-        .map((method) => method.slice(taskPrefix.length));
-    } else {
-      validMethods = validMethods.filter((method) => method.charAt(0) !== '#');
-    }
-
-    if (this.features.tasksMatchingPriority) {
-      const queueNames = Object.keys(this._queues);
-      validMethods = validMethods.filter((method) =>
-        queueNames.includes(method)
-      );
-    }
-
-    return validMethods;
-  }
-
-  /**
-   * @private
-   * Schedule every generator's methods on a run queue.
-   *
-   * @param {TaskOptions} [taskOptions]: options.
-   */
-  queueOwnTasks(taskOptions) {
-    this._running = true;
-    this._taskStatus = {cancelled: false, timestamp: new Date()};
-
-    const validMethods = this.getTaskNames();
-    if (validMethods.length === 0 && this._prompts.length === 0) {
-      throw new Error(
-        'This Generator is empty. Add at least one method for it to run.'
-      );
-    }
-
-    if (this._prompts.length > 0) {
-      this.queueTask({
-        method: () => this.prompt(this._prompts, this.config),
-        taskName: 'Prompt registered questions',
-        queueName: 'prompting',
-        cancellable: true
-      });
-
-      if (validMethods.length === 0) {
-        this.queueTask({
-          method: () => {
-            this.renderTemplate();
-          },
-          taskName: 'Empty generator: copy templates',
-          queueName: 'writing',
-          cancellable: true
-        });
-      }
-    }
-
-    for (const methodName of validMethods)
-      this.queueOwnTask(methodName, taskOptions);
-
-    this.emit('queueOwnTasks');
-  }
-
-  /**
-   * Schedule tasks on a run queue.
-   *
-   * @param {Task} task: Task to be queued.
-   */
-  queueTask(task) {
-    const {queueName = 'default', taskName: methodName, run, once} = task;
-
-    const {runLoop} = this.env;
-    const {_taskStatus: taskStatus, options = {}} = this;
-    const {namespace = ''} = options;
-
-    debug(
-      `Queueing ${namespace}#${methodName} with options %o`,
-      _.omit(task, ['method'])
-    );
-    runLoop.add(
-      queueName,
-      // Run-queue's done(continue), pause
-      (continueQueue) => {
-        this.executeTask(task, undefined, taskStatus).then(continueQueue);
-      },
-      {once: once ? methodName : undefined, run}
-    );
-  }
-
-  /**
-   * @private
-   * Execute a task.
-   *
-   * @param {Task} task: Task to be executed.
-   * @param {string[]} args: Task arguments.
-   * @param {Object} taskStatus.
-   * @return Promise
-   */
-  executeTask(
-    task,
-    args = task.args || this.args,
-    taskStatus = this._taskStatus || {}
-  ) {
-    return new Promise((resolve) => {
-      const {
-        reject,
-        queueName = 'default',
-        taskName: methodName,
-        method
-      } = task;
-      const {namespace = ''} = this.options || {};
-
-      const priority = Object.entries(this._queues).find(
-        ([_, options]) => options.queueName === queueName
-      );
-      const priorityName = priority ? priority[0] : undefined;
-
-      debug(`Running ${namespace}#${methodName}`);
-      this.emit(`method:${methodName}`);
-      const taskCancelled = task.cancellable && taskStatus.cancelled;
-      if (taskCancelled) {
-        resolve();
-        return;
-      }
-
-      const generator = this;
-
-      runAsync(function () {
-        args = typeof args === 'function' ? args(generator) : args;
-        generator.async = () => this.async();
-        generator.runningState = {namespace, queueName, methodName};
-        return method.apply(generator, args);
-      })()
-        .then(() => {
-          delete this.runningState;
-          const eventName = `done$${
-            namespace || 'unknownnamespace'
-          }#${methodName}`;
-          debug(`Done event ${eventName}`);
-          this.env.emit(eventName, {
-            namespace,
-            generator: this,
-            queueName,
-            priorityName
-          });
-          resolve();
-        })
-        .catch((error) => {
-          const errorMessage = `An error occured while running ${namespace}#${methodName}`;
-          if (this.log.error) {
-            this.log.error(errorMessage);
-          } else {
-            debug(errorMessage);
-          }
-
-          if (reject) {
-            debug('Rejecting task promise, queue will continue normally');
-            reject(error);
-            resolve();
-            return;
-          }
-
-          delete this.runningState;
-          try {
-            this.env.emit('error', error);
-          } catch (error) {
-            setImmediate(() => {
-              throw error;
-            });
-          }
-        });
-    });
-  }
-
-  /**
-   * Generator config Storage.
-   */
-  get config() {
-    if (!this._config) {
-      this._config = this._getStorage();
-    }
-
-    return this._config;
-  }
-
-  /**
-   * Package.json Storage resolved to `this.destinationPath('package.json')`.
-   *
-   * Environment watches for package.json changes at `this.env.cwd`, and triggers an package manager install if it has been committed to disk.
-   * If package.json is at a different folder, like a changed generator root, propagate it to the Environment like `this.env.cwd = this.destinationPath()`.
-   *
-   * @example
-   * this.packageJson.merge({
-   *   scripts: {
-   *     start: 'webpack --serve',
-   *   },
-   *   dependencies: {
-   *     ...
-   *   },
-   *   peerDependencies: {
-   *     ...
-   *   },
-   * });
-   */
-  get packageJson() {
-    if (!this._packageJson) {
-      this._packageJson = this.createStorage('package.json');
-    }
-
-    return this._packageJson;
-  }
-
-  /**
-   * Ignore cancellable tasks.
-   */
-  cancelCancellableTasks() {
-    this._running = false;
-    // Task status references is registered at each running task
-    this._taskStatus.cancelled = true;
-    // Create a new task status.
-    delete this._taskStatus;
-  }
-
-  /**
-   * Start the generator again.
-   *
-   * @param {Object} [options]: options.
-   */
-  startOver(options = {}) {
-    this.cancelCancellableTasks();
-    Object.assign(this.options, options);
-    this.queueOwnTasks({auto: true});
-  }
-
-  /**
-   * Runs the generator, scheduling prototype methods on a run queue. Method names
-   * will determine the order each method is run. Methods without special names
-   * will run in the default queue.
-   *
-   * Any method named `constructor` and any methods prefixed by a `_` won't be scheduled.
-   *
-   * @return {Promise} Resolved once the process finish
-   */
-  run() {
-    return this.env.runGenerator(this);
-  }
-
-  /**
-   * Queue generator tasks.
-   *
-   * @return {Promise}
-   */
-  queueTasks() {
-    const beforeQueueCallback =
-      (this.features.taskPrefix && this.beforeQueue) || this._beforeQueue;
-    if (beforeQueueCallback) {
-      const maybePromise = beforeQueueCallback.call(this);
-      if (maybePromise && maybePromise.then) {
-        this.checkEnvironmentVersion('3.5.0');
-        return maybePromise.then(() => this._queueTasks());
-      }
-    }
-
-    return this._queueTasks();
-  }
-
-  _queueTasks() {
-    debug(
-      `Queueing generator ${this.options.namespace} with generator version ${this.yoGeneratorVersion}`
-    );
-    this.queueOwnTasks({auto: true});
-
-    if (this._composedWith.some((generator) => generator.then)) {
-      return Promise.all(this._composedWith).then(async (generators) => {
-        for (const generator of generators) {
-          // eslint-disable-next-line no-await-in-loop
-          await this.env.queueGenerator(await generator, false);
-        }
-      });
-    }
-
-    let promise;
-    for (const generator of this._composedWith) {
-      if (promise) {
-        promise.then(() => this.env.queueGenerator(generator, false));
-      } else {
-        const maybePromise = this.env.queueGenerator(generator, false);
-        if (maybePromise.then) {
-          promise = maybePromise;
-        }
-      }
-    }
-
-    this._composedWith = [];
-    return promise;
-  }
-
-  /**
-   * Compose this generator with another one.
-   * @param  {String|Object|Array} generator  The path to the generator module or an object (see examples)
-   * @param  {Array}  [args]       Arguments passed to the Generator
-   * @param  {Object}  [options]   The options passed to the Generator
-   * @param  {boolean}  [immediately] Boolean whether to queue the Generator immediately
-   * @return {Generator}    The composed generator
-   *
-   * @example <caption>Using a peerDependency generator</caption>
-   * this.composeWith('bootstrap', { sass: true });
-   *
-   * @example <caption>Using a direct dependency generator</caption>
-   * this.composeWith(require.resolve('generator-bootstrap/app/main.js'), { sass: true });
-   *
-   * @example <caption>Passing a Generator class</caption>
-   * this.composeWith({ Generator: MyGenerator, path: '../generator-bootstrap/app/main.js' }, { sass: true });
-   */
-  composeWith(generator, args, options, immediately = false) {
-    if (typeof args === 'boolean') {
-      args = [];
-    } else if (!Array.isArray(args) && typeof args === 'object') {
-      options = args;
-      args = options.arguments || options.args || [];
-    }
-
-    options = typeof options === 'boolean' ? {} : options || {};
-
-    let instantiatedGenerator;
-
-    if (Array.isArray(generator)) {
-      return generator.map((gen) => this.composeWith(gen, args, options));
-    }
-
-    // Pass down the default options so they're correctly mirrored down the chain.
-    options = {
-      destinationRoot: this._destinationRoot,
-      ...options,
-      skipInstall: this.options.skipInstall,
-      skipCache: this.options.skipCache,
-      forceInstall: this.options.forceInstall,
-      skipLocalCache: this.options.skipLocalCache
-    };
-
-    const instantiate = (Generator, path) => {
-      if (path === 'unknown') {
-        Generator.resolved = path;
-      } else {
-        Generator.resolved = require.resolve(path);
-      }
-
-      Generator.namespace = this.env.namespace(path);
-
-      return this.env.instantiate(Generator, args, options);
-    };
-
-    if (typeof generator === 'string') {
-      try {
-        // Allows to run a local generator without namespace.
-        const GeneratorImport = require(generator);
-        const Generator =
-          typeof GeneratorImport.default === 'function'
-            ? GeneratorImport.default
-            : GeneratorImport;
-
-        instantiatedGenerator = instantiate(Generator, generator);
-      } catch {
-        instantiatedGenerator = this.env.create(generator, args, options);
-      }
-    } else {
-      const {Generator, path} = generator;
-      assert(
-        Generator,
-        `${chalk.red('Missing Generator property')}
-When passing an object to Generator${chalk.cyan(
-          '#composeWith'
-        )} include the generator class to run in the ${chalk.cyan(
-          'Generator'
-        )} property
-
-this.composeWith({
-  ${chalk.yellow('Generator')}: MyGenerator,
-  ...\n
-});`
-      );
-      assert(
-        typeof path === 'string',
-        `${chalk.red('path property is not a string')}
-When passing an object to Generator${chalk.cyan(
-          '#composeWith'
-        )} include the path to the generators files in the ${chalk.cyan(
-          'path'
-        )} property
-
-this.composeWith({
-  ${chalk.yellow('path')}: '../my-generator',
-  ...
-});`
-      );
-      instantiatedGenerator = instantiate(Generator, path);
-    }
-
-    if (!instantiatedGenerator) {
-      return instantiatedGenerator;
-    }
-
-    if (this._running || immediately) {
-      if (instantiatedGenerator.then) {
-        return instantiatedGenerator.then((generator) => {
-          this.env.queueGenerator(generator);
-          return generator;
-        });
-      }
-
-      this.env.queueGenerator(instantiatedGenerator);
-    } else {
-      this._composedWith.push(instantiatedGenerator);
-    }
-
-    return instantiatedGenerator;
-  }
-
-  /**
-   * Determine the root generator name (the one who's extending Generator).
-   * @return {String} The name of the root generator
-   */
-  rootGeneratorName() {
-    const {packageJson: {name = '*'} = {}} =
-      readPkgUp.sync({cwd: this.resolved}) || {};
-    return name;
-  }
-
-  /**
-   * Determine the root generator version (the one who's extending Generator).
-   * @return {String} The version of the root generator
-   */
-  rootGeneratorVersion() {
-    const {packageJson: {version = '0.0.0'} = {}} =
-      readPkgUp.sync({cwd: this.resolved}) || {};
-    return version;
-  }
-
-  /**
-   * Return a storage instance.
-   * @param  {String} storePath  The path of the json file
-   * @param  {String} [path] The name in which is stored inside the json
-   * @param  {boolean|Object} [options] Treat path as an lodash path
-   * @return {Storage} json storage
-   */
-  createStorage(storePath, path, options) {
-    if (typeof path === 'object') {
-      options = path;
-      path = undefined;
-    } else if (typeof options === 'boolean') {
-      options = {lodashPath: options};
-    }
-
-    storePath = this.destinationPath(storePath);
-    return new Storage(path, this.fs, storePath, options);
-  }
-
-  /**
-   * Return a storage instance.
-   * @param  {String} [rootName] The rootName in which is stored inside .yo-rc.json
-   * @param  {object} [options] Storage options
-   * @return {Storage} Generator storage
-   * @private
-   */
-  _getStorage(rootName = this.rootGeneratorName(), options) {
-    if (typeof rootName === 'object') {
-      options = rootName;
-      rootName = this.rootGeneratorName();
-    }
-
-    const storePath = path.join(this.destinationRoot(), '.yo-rc.json');
-    return new Storage(rootName, this.fs, storePath, options);
-  }
-
-  /**
-   * Setup a globalConfig storage instance.
-   * @return {Storage} Global config storage
-   * @private
-   */
-  _getGlobalStorage() {
-    // When localConfigOnly === true simulate a globalConfig at local dir
-    const globalStorageDir = this.options.localConfigOnly
-      ? this.destinationRoot()
-      : os.homedir();
-    const storePath = path.join(globalStorageDir, '.yo-rc-global.json');
-    const storeName = `${this.rootGeneratorName()}:${this.rootGeneratorVersion()}`;
-    return new Storage(storeName, this.fs, storePath);
-  }
-
-  /**
-   * Change the generator destination root directory.
-   * This path is used to find storage, when using a file system helper method (like
-   * `this.write` and `this.copy`)
-   * @param  {String} rootPath new destination root path
-   * @return {String}          destination root path
-   */
-  destinationRoot(rootPath) {
-    if (typeof rootPath === 'string') {
-      this._destinationRoot = path.resolve(rootPath);
-
-      if (!fs.existsSync(this._destinationRoot)) {
-        fs.mkdirSync(this._destinationRoot, {recursive: true});
-      }
-
-      // Reset the storage
-      this._config = undefined;
-      // Reset packageJson
-      this._packageJson = undefined;
-    }
-
-    return this._destinationRoot || this.env.cwd;
-  }
-
-  /**
-   * Change the generator source root directory.
-   * This path is used by multiples file system methods like (`this.read` and `this.copy`)
-   * @param  {String} rootPath new source root path
-   * @return {String}          source root path
-   */
-  sourceRoot(rootPath) {
-    if (typeof rootPath === 'string') {
-      this._sourceRoot = path.resolve(rootPath);
-    }
-
-    return this._sourceRoot;
-  }
-
-  /**
-   * Join a path to the source root.
-   * @param  {...String} dest - path parts
-   * @return {String}    joined path
-   */
-  templatePath(...dest) {
-    let filepath = path.join.apply(path, dest);
-
-    if (!path.isAbsolute(filepath)) {
-      filepath = path.join(this.sourceRoot(), filepath);
-    }
-
-    return filepath;
-  }
-
-  /**
-   * Join a path to the destination root.
-   * @param  {...String} dest - path parts
-   * @return {String}    joined path
-   */
-  destinationPath(...dest) {
-    let filepath = path.join.apply(path, dest);
-
-    if (!path.isAbsolute(filepath)) {
-      filepath = path.join(this.destinationRoot(), filepath);
-    }
-
-    return filepath;
-  }
-
-  /**
-   * Determines the name of the application.
-   *
-   * First checks for name in bower.json.
-   * Then checks for name in package.json.
-   * Finally defaults to the name of the current directory.
-   * @return {String} The name of the application
-   */
-  determineAppname() {
-    let appname = this.fs.readJSON(this.destinationPath('bower.json'), {}).name;
-
-    if (!appname) {
-      appname = this.fs.readJSON(this.destinationPath('package.json'), {}).name;
-    }
-
-    if (!appname) {
-      appname = path.basename(this.destinationRoot());
-    }
-
-    return appname.replace(/[^\w\s]+?/g, ' ');
-  }
-
-  /**
-   * Add a transform stream to the commit stream.
-   *
-   * Most usually, these transform stream will be Gulp plugins.
-   *
-   * @param  {stream.Transform|stream.Transform[]} streams An array of Transform stream
-   * or a single one.
-   * @param {any} options Environment.applyTransforms options parameter
-   * @return {this} This generator
-   */
-  queueTransformStream(transformStreams, options) {
-    assert(
-      transformStreams,
-      'expected to receive a transform stream as parameter'
-    );
-
-    this.queueTask({
-      method() {
-        return this.env.applyTransforms(transformStreams, options);
-      },
-      taskName: 'transformStream',
-      queueName: 'transform'
-    });
-    return this;
-  }
-}
-
-// Mixin the actions modules
-_.extend(Generator.prototype, require('./actions/help'));
-_.extend(Generator.prototype, require('./actions/spawn-command'));
-_.extend(Generator.prototype, require('./actions/fs'));
-_.extend(Generator.prototype, require('./actions/package-json'));
-Generator.prototype.user = require('./actions/user');
-
-module.exports = Generator;
-
-
-
-
- - - - - - - - - - diff --git a/module-promptSuggestion.html b/module-promptSuggestion.html deleted file mode 100644 index 77740aed..00000000 --- a/module-promptSuggestion.html +++ /dev/null @@ -1,498 +0,0 @@ - - - - - Module: promptSuggestion | Generator - - - - - - - - - - - -
- -
-
-
-

promptSuggestion

-
- -
-
-
-

- Utilities to allow remembering answers to Inquirer.js prompts -

-
- -
-
-
-
-
-
-
-
- - - - - - - - - - diff --git a/util_prompt-suggestion.js.html b/util_prompt-suggestion.js.html deleted file mode 100644 index e8bcfec4..00000000 --- a/util_prompt-suggestion.js.html +++ /dev/null @@ -1,676 +0,0 @@ - - - - - Source: util/prompt-suggestion.js | Generator - - - - - - - - - - - -
- -
-
-
-
'use strict';
-const assert = require('assert');
-const _ = require('lodash');
-
-/**
- * @module promptSuggestion
- * @description Utilities to allow remembering answers to Inquirer.js prompts
- */
-const promptSuggestion = module.exports;
-
-/**
- * Returns the default value for a checkbox
- *
- * @param  {Object} question Inquirer prompt item
- * @param  {*} defaultValue  The stored default value
- * @return {*}               Default value to set
- * @private
- */
-const getCheckboxDefault = (question, defaultValue) => {
-  // For simplicity we uncheck all boxes and use .default to set the active ones
-  for (const choice of question.choices) {
-    if (typeof choice === 'object') {
-      choice.checked = false;
-    }
-  }
-
-  return defaultValue;
-};
-
-/**
- * Returns the default value for a list
- *
- * @param  {Object} question    Inquirer prompt item
- * @param  {*} defaultValue     The stored default value
- * @return {*}                  Default value to set
- * @private
- */
-const getListDefault = (question, defaultValue) => {
-  const choiceValues = question.choices.map((choice) =>
-    typeof choice === 'object' ? choice.value : choice
-  );
-  return choiceValues.indexOf(defaultValue);
-};
-
-/**
- * Return true if the answer should be store in
- * the global store, otherwise false
- *
- * @param  {Object}       question Inquirer prompt item
- * @param  {String|Array} answer   The inquirer answer
- * @param  {Boolean}      storeAll Should store default values
- * @return {Boolean}               Answer to be stored
- * @private
- */
-const storeListAnswer = (question, answer, storeAll) => {
-  const choiceValues = question.choices.map((choice) => {
-    if (Object.prototype.hasOwnProperty.call(choice, 'value')) {
-      return choice.value;
-    }
-
-    return choice;
-  });
-
-  const choiceIndex = choiceValues.indexOf(answer);
-
-  // Check if answer is not equal to default value
-  if (storeAll || question.default !== choiceIndex) {
-    return true;
-  }
-
-  return false;
-};
-
-/**
- * Return true if the answer should be store in
- * the global store, otherwise false
- *
- * @param  {Object}       question Inquirer prompt item
- * @param  {String|Array} answer   The inquirer answer
- * @param  {Boolean}      storeAll Should store default values
- * @return {Boolean}               Answer to be stored
- * @private
- */
-const storeAnswer = (question, answer, storeAll) => {
-  // Check if answer is not equal to default value or is undefined
-  if (answer !== undefined && (storeAll || question.default !== answer)) {
-    return true;
-  }
-
-  return false;
-};
-
-/**
- * Prefill the defaults with values from the global store
- *
- * @param  {Store}        store     `.yo-rc-global` global config
- * @param  {Array|Object} questions Original prompt questions
- * @return {Array}                  Prompt questions array with prefilled values.
- */
-promptSuggestion.prefillQuestions = (store, questions) => {
-  assert(store, 'A store parameter is required');
-  assert(questions, 'A questions parameter is required');
-
-  const promptValues = store.get('promptValues') || {};
-
-  if (!Array.isArray(questions)) {
-    questions = [questions];
-  }
-
-  questions = questions.map(_.clone);
-
-  // Write user defaults back to prompt
-  return questions.map((question) => {
-    if (question.store !== true) {
-      return question;
-    }
-
-    const storedValue = promptValues[question.name];
-
-    if (storedValue === undefined || _.isFunction(question.choices)) {
-      // Do not override prompt default when question.choices is a function,
-      // since can't guarantee that the `storedValue` will even be in the returned choices
-      return question;
-    }
-
-    // Override prompt default with the user's default
-    switch (question.type) {
-      case 'rawlist':
-      case 'expand':
-        question.default = getListDefault(question, storedValue);
-        break;
-      case 'checkbox':
-        question.default = getCheckboxDefault(question, storedValue);
-        break;
-      default:
-        question.default = storedValue;
-        break;
-    }
-
-    return question;
-  });
-};
-
-/**
- * Store the answers in the global store
- *
- * @param  {Store}        store     `.yo-rc-global` global config
- * @param  {Array|Object} questions Original prompt questions
- * @param  {Object}       answers   The inquirer answers
- * @param  {Boolean}      storeAll  Should store default values
- */
-promptSuggestion.storeAnswers = (store, questions, answers, storeAll) => {
-  assert(store, 'A store parameter is required');
-  assert(answers, 'A answers parameter is required');
-  assert(questions, 'A questions parameter is required');
-  assert.ok(_.isObject(answers), 'answers must be a object');
-
-  storeAll = storeAll || false;
-  const promptValues = store.get('promptValues') || {};
-
-  if (!Array.isArray(questions)) {
-    questions = [questions];
-  }
-
-  _.each(questions, (question) => {
-    if (question.store !== true) {
-      return;
-    }
-
-    let saveAnswer;
-    const key = question.name;
-    const answer = answers[key];
-
-    switch (question.type) {
-      case 'rawlist':
-      case 'expand':
-        saveAnswer = storeListAnswer(question, answer, storeAll);
-        break;
-
-      default:
-        saveAnswer = storeAnswer(question, answer, storeAll);
-        break;
-    }
-
-    if (saveAnswer) {
-      promptValues[key] = answer;
-    }
-  });
-
-  if (Object.keys(promptValues).length > 0) {
-    store.set('promptValues', promptValues);
-  }
-};
-
-
-
-
- - - - - - - - - - diff --git a/util_storage.js.html b/util_storage.js.html deleted file mode 100644 index bd7414bc..00000000 --- a/util_storage.js.html +++ /dev/null @@ -1,748 +0,0 @@ - - - - - Source: util/storage.js | Generator - - - - - - - - - - - -
- -
-
-
-
'use strict';
-const assert = require('assert');
-const _ = require('lodash');
-const sortKeys = require('sort-keys');
-
-/**
- * Proxy handler for Storage
- */
-const proxyHandler = {
-  get(storage, property) {
-    return storage.get(property);
-  },
-  set(storage, property, value) {
-    storage.set(property, value);
-    return true;
-  },
-  ownKeys(storage) {
-    return Reflect.ownKeys(storage._store);
-  },
-  has(target, prop) {
-    return target.get(prop) !== undefined;
-  },
-  getOwnPropertyDescriptor(target, key) {
-    return {
-      get: () => this.get(target, key),
-      enumerable: true,
-      configurable: true
-    };
-  }
-};
-
-/**
- * Storage instances handle a json file where Generator authors can store data.
- *
- * The `Generator` class instantiate the storage named `config` by default.
- *
- * @constructor
- * @param {String} [name]     The name of the new storage (this is a namespace)
- * @param {mem-fs-editor} fs  A mem-fs editor instance
- * @param {String} configPath The filepath used as a storage.
- * @param {Object} [options] Storage options.
- * @param {Boolean} [options.lodashPath=false] Set true to treat name as a lodash path.
- * @param {Boolean} [options.disableCache=false] Set true to disable json object cache.
- * @param {Boolean} [options.disableCacheByFile=false] Set true to cleanup cache for every fs change.
- * @param {Boolean} [options.sorted=false] Set true to write sorted json.
- *
- * @example
- * class extend Generator {
- *   writing: function() {
- *     this.config.set('coffeescript', false);
- *   }
- * }
- */
-class Storage {
-  constructor(name, fs, configPath, options = {}) {
-    if (name !== undefined && typeof name !== 'string') {
-      configPath = fs;
-      fs = name;
-      name = undefined;
-    }
-
-    if (typeof options === 'boolean') {
-      options = {lodashPath: options};
-    }
-
-    _.defaults(options, {
-      lodashPath: false,
-      disableCache: false,
-      disableCacheByFile: false,
-      sorted: false
-    });
-
-    assert(configPath, 'A config filepath is required to create a storage');
-
-    this.path = configPath;
-    this.name = name;
-    this.fs = fs;
-    this.indent = 2;
-    this.lodashPath = options.lodashPath;
-    this.disableCache = options.disableCache;
-    this.disableCacheByFile = options.disableCacheByFile;
-    this.sorted = options.sorted;
-
-    this.existed = Object.keys(this._store).length > 0;
-
-    this.fs.store.on('change', (filename) => {
-      // At mem-fs 1.1.3 filename is not passed to the event.
-      if (this.disableCacheByFile || (filename && filename !== this.path)) {
-        return;
-      }
-
-      delete this._cachedStore;
-    });
-  }
-
-  /**
-   * Return the current store as JSON object
-   * @return {Object} the store content
-   * @private
-   */
-  get _store() {
-    const store = this._cachedStore || this.fs.readJSON(this.path, {});
-    if (!this.disableCache) {
-      this._cachedStore = store;
-    }
-
-    if (!this.name) {
-      return store || {};
-    }
-
-    return (this.lodashPath ? _.get(store, this.name) : store[this.name]) || {};
-  }
-
-  /**
-   * Persist a configuration to disk
-   * @param {Object} val - current configuration values
-   * @private
-   */
-  _persist(value) {
-    if (this.sorted) {
-      value = sortKeys(value, {deep: true});
-    }
-
-    let fullStore;
-    if (this.name) {
-      fullStore = this.fs.readJSON(this.path, {});
-      if (this.lodashPath) {
-        _.set(fullStore, this.name, value);
-      } else {
-        fullStore[this.name] = value;
-      }
-    } else {
-      fullStore = value;
-    }
-
-    this.fs.writeJSON(this.path, fullStore, null, this.indent);
-  }
-
-  /**
-   * Save a new object of values
-   */
-  save() {
-    this._persist(this._store);
-  }
-
-  /**
-   * Get a stored value
-   * @param  {String} key  The key under which the value is stored.
-   * @return {*}           The stored value. Any JSON valid type could be returned
-   */
-  get(key) {
-    return this._store[key];
-  }
-
-  /**
-   * Get a stored value from a lodash path
-   * @param  {String} path  The path under which the value is stored.
-   * @return {*}           The stored value. Any JSON valid type could be returned
-   */
-  getPath(path) {
-    return _.get(this._store, path);
-  }
-
-  /**
-   * Get all the stored values
-   * @return {Object}  key-value object
-   */
-  getAll() {
-    return _.cloneDeep(this._store);
-  }
-
-  /**
-   * Assign a key to a value and schedule a save.
-   * @param {String} key  The key under which the value is stored
-   * @param {*} val  Any valid JSON type value (String, Number, Array, Object).
-   * @return {*} val  Whatever was passed in as val.
-   */
-  set(key, value) {
-    assert(!_.isFunction(value), "Storage value can't be a function");
-
-    const store = this._store;
-
-    if (_.isObject(key)) {
-      value = _.assignIn(store, key);
-    } else {
-      store[key] = value;
-    }
-
-    this._persist(store);
-    return value;
-  }
-
-  /**
-   * Assign a lodash path to a value and schedule a save.
-   * @param {String} path  The key under which the value is stored
-   * @param {*} val  Any valid JSON type value (String, Number, Array, Object).
-   * @return {*} val  Whatever was passed in as val.
-   */
-  setPath(path, value) {
-    assert(!_.isFunction(value), "Storage value can't be a function");
-
-    const store = this._store;
-    _.set(store, path, value);
-    this._persist(store);
-    return value;
-  }
-
-  /**
-   * Delete a key from the store and schedule a save.
-   * @param  {String} key  The key under which the value is stored.
-   */
-  delete(key) {
-    const store = this._store;
-    delete store[key];
-    this._persist(store);
-  }
-
-  /**
-   * Setup the store with defaults value and schedule a save.
-   * If keys already exist, the initial value is kept.
-   * @param  {Object} defaults  Key-value object to store.
-   * @return {*} val  Returns the merged options.
-   */
-  defaults(defaults) {
-    assert(
-      _.isObject(defaults),
-      'Storage `defaults` method only accept objects'
-    );
-    const store = _.defaults({}, this._store, defaults);
-    this._persist(store);
-    return this.getAll();
-  }
-
-  /**
-   * @param  {Object} defaults  Key-value object to store.
-   * @return {*} val  Returns the merged object.
-   */
-  merge(source) {
-    assert(_.isObject(source), 'Storage `merge` method only accept objects');
-    const value = _.merge({}, this._store, source);
-    this._persist(value);
-    return this.getAll();
-  }
-
-  /**
-   * Create a child storage.
-   * @param  {String} path - relative path of the key to create a new storage.
-   *                         Some paths need to be escaped. Eg: ["dotted.path"]
-   * @return {Storage} Returns a new Storage.
-   */
-  createStorage(path) {
-    const childName = this.name ? `${this.name}.${path}` : path;
-    return new Storage(childName, this.fs, this.path, true);
-  }
-
-  /**
-   * Creates a proxy object.
-   * @return {Object} proxy.
-   */
-  createProxy() {
-    return new Proxy(this, proxyHandler);
-  }
-}
-
-module.exports = Storage;
-
-
-
-
- - - - - - - - - -