Home Reference Source Repository

References

Function Summary

Static Public Function Summary
public

addPadding(string: string, length: number): string

Pads a string to a given length with spaces.

public

appendConfig(configObject: rocConfig): rocConfig

Appends to the configuration object.

public

Appends settings to the configuration object.

public

buildCompleteConfig(debug: boolean, config: rocConfig, meta: rocMetaConfig, newConfig: rocConfig, newMeta: rocMetaConfig, directory: string, validate: boolean): Object

Builds the complete configuration objects.

public
public

error(text: string): string

Formats a string suitable for error output.

public

Formats a string suitable for error labels.

public

execute(command: string): Promise

Executes a command string.

public

fileExists(filepath: string, directory: string): boolean

Verifys if a file exists.

public

generateCommandDocumentation(settings: rocConfig, commands+meta: rocMetaConfig, command: string, name: string): string

Generates a string with information about a specific command.

public

Generates a string with information about all the possible commands.

public

Generates markdown documentation for the provided configuration object.

public

generateTable(initalDocumentationObject: rocDocumentationObject, header: rocTableHeader, settings: rocTableSettings): string

Creates a table based on a rocDocumentationObject.

public

generateTextDocumentation(config: rocConfig, metaConfig: rocMetaConfig, filter: string[]): string

Generates plain text documentation for the provided configuration object.

public

get(packageName: string, version: string): string

Fetches the tarball for a repository on Github.

public

getAbsolutePath(filepath: string, directory: string): string

Makes a path absolute if not already is that.

public

getApplicationConfig(applicationConfigPath: string, directory: string, debug: boolean): object

Gets the application configuration by reading a file.

public

Gets the current configuration object.

public

Converts an object to a string.

public

getMappings(documentationObject: rocDocumentationObject): Object

Creates mappings between cli commands to their "path" in the configuration structure, their validator and type convertor.

public

Reads a package.json file.

public

getRocDependencies(packageJson: Object): string[]

Gets the Roc dependencies from a package.json.

public

Gets the settings in the configuration object.

public

getSuggestions(current: string[], possible: string[], command: boolean): string

Will create a string with suggestions for possible typos.

public

getVersions(packageName: string): object[]

Fetches an array of all the tags for a Github repo, used as possible versions for a template.

public

Formats a string suitable for important messages.

public

Formats a string suitable for important labels.

public

init(parsedArguments: rocCommandObject): Promise

Command used to init a new Roc project.

public

isArray(validator: function | RegExp): function

Validates an array using a validator.

public

Validates an pontential array using a validator.

public

Validates an string.

public

Validates an string.

public

isObject(validator: function | RegExp): function

Validates an object using a validator.

public

Validates an string.

public

Validates an string.

public

isValid(value: object, validator: function | RegExp): boolean

Helper to use a validator.

public

Merges two configuration objects.

public

ok(text: string): string

Formats a string suitable for confirmations.

public

Formats a string suitable for confirmation labels.

public

oneOf(validators: ...function): function

Validates against a list of validators.

public

pad(length: number, character: string): string

Returns a string to pad with.

public

parseArguments(args: Object, mappings: Object): Object

Converts a set of arguments to rocConfigSettings object.

public

parseOptions(command: string, commands: Object, options: Object[]): Object

Parses options and validates them.

public

required(validator: function): function

Marks that the value is required

public

runCli(info: {version: string, name: string}, initalConfig: rocConfig, initalMeta: rocMetaConfig, args: string[]): undefined

Invokes the Roc cli.

public

throwError(name: string, message: string, value: object, type: string)

Throws error for failed validations.

public

toCliFlag(configPaths: string[]): string

Takes a configuration path array and convertes it to a cli flag.

public

Validates if a directory seems to be a Roc application project.

public

validate(settings: rocSettings, metaSettings: rocMetaSettings, toValidate: array | boolean)

Validates the provided configuration object.

public

validateMightThrow(settings: rocSettings, validations: Object)

Validates the provided configuration object.

public

Formats a string suitable for warnings.

public

Formats a string suitable for warning labels.

Variable Summary

Static Public Variable Summary
public

The default prompt options.

Typedef Summary

Static Public Typedef Summary
public

Validator info object.

public

Validator info object.

public

Roc config object.

public

Roc documentation object.

public

Roc map object.

public

Roc meta config object.

public

Roc meta settings object.

public

Roc meta settings object.

public

Roc parsed options.

public

Roc settings object.

public

Roc table header object.

public

Roc table settings object.