Global

Methods

addGeneratorOptions(command, generator) → {Command}

Load Generator options into a commander instance.

Parameters:
Name Type Description
command Command

Command to load options

generator Generator

Generator

Returns:
Command -

return command

createCommitTransform()

Transform api should be avoided by generators without a executable. May break between major yo versions.

createConflicterCheckTransform()

Transform api should be avoided by generators without a executable. May break between major yo versions.

createConflicterStatusTransform(logger) → {Transform}

Transform api should be avoided by generators without a executable. May break between major yo versions.

Create a transform to apply conflicter status.

Parameters:
Name Type Description
logger Log

Log reference. See log.js

Returns:
Transform -

A Transform https://nodejs.org/api/stream.html#stream_class_stream_transform

createEachFileTransform(forEach, options) → {Transform}

Transform api should be avoided by generators without a executable. May break between major yo versions.

Create a for each file stream transform.

Parameters:
Name Type Description
forEach function

Function to execute for each file

options Object

Options

Properties
Name Type Attributes Default Description
autoForward boolean <optional>
true

Set false to don't add a file to the stream, the function must do it.

executeUnmodified boolean <optional>
false

Set true to execute the forEach function with a not modified file.

forwardUmodified boolean <optional>
true

Set false to don't add a not modified file to the stream.

Returns:
Transform -

A Transform https://nodejs.org/api/stream.html#stream_class_stream_transform

createFileTransform(transform, options) → {Stream}

Transform api should be avoided by generators without a executable. May break between major yo versions.

Creates a out of order transform.

Parameters:
Name Type Description
transform function

transform function.

options Object

additional options passed to transform

Returns:
Stream -

a transform stream.

createModifiedTransform()

Transform api should be avoided by generators without a executable. May break between major yo versions.

createYoRcTransform() → {Transform}

Transform api should be avoided by generators without a executable. May break between major yo versions.

Create a force yeoman configs transform stream.

Returns:
Transform -

A Transform https://nodejs.org/api/stream.html#stream_class_stream_transform

createYoResolveTransform(conflicter, yoResolveFileName) → {Transform}

Transform api should be avoided by generators without a executable. May break between major yo versions.

Create a yo-resolve transform stream. Suports pre-defined conflicter actions action based on file glob.

Parameters:
Name Type Description
conflicter Conflicter

Conflicter instance

yoResolveFileName string

.yo-resolve filename

Returns:
Transform -

A Transform https://nodejs.org/api/stream.html#stream_class_stream_transform

async execute(generatorNamespace, args)

Generate a command for the generator and execute.

Parameters:
Name Type Description
generatorNamespace string
args Array.<string>

fileIsModified(field)

Transform api should be avoided by generators without a executable. May break between major yo versions.

Detect if the file is modified See https://github.com/SBoudrias/mem-fs-editor/blob/3ff18e26c52dc30d8f371bcc72c1884f2ea706d6/lib/actions/commit.js#L38

Parameters:
Name Type Description
field Object

vinyl file

getGeneratorHint()

Hint of generator module name

async packageManagerInstallTask() → {Promise.<boolean>}

Executes package manager install.

  • checks if package.json was committed.
  • uses a preferred package manager or try to detect.
Returns:
Promise.<boolean> -

Promise true if the install execution suceeded.

splitArgsFromString()

Two-step argument splitting function that first splits arguments in quotes, and then splits up the remaining arguments if they are not part of a quote.