Skip to content

Latest commit

 

History

History
1035 lines (903 loc) · 33.1 KB

File metadata and controls

1035 lines (903 loc) · 33.1 KB

Modules

dotenv
Global
Init

Start weldable

Logger
standalone
Typescript
webpack
webpackConfigs

dotenv

dotenv~dotenv : Object

Package for lib

Kind: inner constant of dotenv

dotenv~setupWebpackDotenvFile(filePath, settings) ⇒ undefined | *

Set up a webpack dotenv plugin config.

Kind: inner method of dotenv

ParamType
filePathstring
settingsobject
settings.consoleMessageobject

dotenv~setupWebpackDotenvFilesForEnv(params, settings) ⇒ Array

For use with webpack configurations. Set up multiple webpack dotenv file parameters.

Kind: inner method of dotenv

ParamTypeDefault
paramsobject
[params.directory]string"<OPTIONS.contextPath>"
params.envstring
settingsobject
settings.consoleMessageobject
settings.setupWebpackDotenvFilefunction

dotenv~setupDotenvFile(filePath) ⇒ void

Set up, and access, a dotenv file and the related set of parameters.

Kind: inner method of dotenv

ParamType
filePathstring

dotenv~setDotenvParam(params)

Set an array of dotenv params

Kind: inner method of dotenv

ParamType
paramsArray.<{param: string, value: string, ignoreIfSet: boolean}>

dotenv~setupDotenvFilesForEnv(params, settings) ⇒ object

A function for use with non-webpack configurations. Set up and access local and specific dotenv file parameters. dotenv parameters are string based, failed or missing dotenv parameters return an empty string.

Kind: inner method of dotenv

ParamTypeDefaultDescription
paramsobject
params.envstring
[params.relativePath]string"<OPTIONS.contextPath>"
[params.dotenvNamePrefix]string"BUILD"

Add an internal prefix to dotenv parameters used for configuration to avoid overlap.

[params.setBuildDefaults]booleantrue
[params.isMessaging]booleanfalse
[params.setExposedParams]booleanfalse

Ignore the potential for dotenv parameter overlap and attempt to set non-prefixed configuration parameters if not already set.

settingsobject
settings.consoleMessageobject
settings.setDotenvParamfunction
settings.setupDotenvFilefunction

Global

Global~jsFileExtensions : Array.<string>

JS file extensions

Kind: inner constant of Global

Global~tsFileExtensions : Array.<string>

TS file extensions

Kind: inner constant of Global

Global~contextPath : string

Global context path. On load set path.

Kind: inner constant of Global

Global~OPTIONS : Object

Global options/settings. One time _set, then freeze.

Kind: inner constant of Global

Global~errorMessageHandler(errors) ⇒ string | any | Array.<any>

Handle a variety of error types consistently.

Kind: inner method of Global

ParamType
errorsstring | Array | object | any

Global~isPromise(obj) ⇒ boolean

Check if "is a Promise", "Promise like".

Kind: inner method of Global

ParamType
objPromise | *

Global~dynamicImport(file) ⇒ Promise.<any>

Import module regardless of CommonJS or ES.

Kind: inner method of Global

ParamType
filestring

Global~createFile(contents, options) ⇒ Object

Create a file with a fallback name based on hashed contents.

Kind: inner method of Global

ParamType
contentsstring
optionsobject
options.dirstring
options.extstring
options.encodingstring
options.filenamestring
options.resetDirboolean

Global~runCmd(cmd, settings) ⇒ string

Execute a command

Kind: inner method of Global

ParamType
cmdstring
settingsobject
settings.errorMessagestring

Init

Start weldable

Init~weldable(options, settings) ⇒ Promise.<void>

Organize package functionality.

Kind: inner method of Init

ParamType
optionsobject
options.isCreateTsConfigOnlyboolean
options.isStandaloneboolean
settingsobject
settings.cleanDistfunction
settings.createTsConfigfunction
settings.createWpConfigfunction
settings.standalonefunction
settings.startWpfunction

Logger

Logger~color : Object

Console output colors

Kind: inner constant of Logger

Logger~consoleMessage : Object

Convenience wrapper for preset console messaging and colors.

Kind: inner constant of Logger

standalone

standalone~createStandaloneTsConfig(aliasOptions, settings)

Create a basic standalone tsconfig if isCreateTsConfig is false. This can be overridden with CLI options, or if a tsconfig already exists.

Kind: inner method of standalone

ParamType
aliasOptionsobject
aliasOptions.isCreateTsConfigboolean
aliasOptions.loaderstring
settingsobject
settings.configFilenamestring
settings.consoleMessageobject
settings.createTsConfigfunction

standalone~outputStandaloneSrcIndexFile() ⇒ string

Output a basic index file.

Kind: inner method of standalone

standalone~createStandaloneSrcIndexFile(options, settings)

Create a src/index file for webpack app entry.

Kind: inner method of standalone

ParamType
optionsobject
options.contextPathstring
options.loaderstring
settingsobject
settings.filenamestring
settings.consoleMessageobject
settings.createFilefunction
settings.jsFileExtensionsArray.<string>
settings.tsFileExtensionsArray.<string>
settings.outputStandaloneSrcIndexFilefunction

standalone~outputStandaloneWebpackConfig(options, settings) ⇒ string

Output a file complete webpack configuration

Kind: inner method of standalone

ParamType
optionsobject
options.loaderstring
settingsobject
settings.commonfunction
settings.developmentfunction
settings.preprocessLoaderJsfunction
settings.preprocessLoaderTsfunction
settings.preprocessLoaderNonefunction
settings.productionfunction
settings.setDotenvParamfunction
settings.setupWebpackDotenvFilefunction
settings.setupWebpackDotenvFilesForEnvfunction
settings.setupDotenvFilefunction
settings.setupDotenvFilesForEnvfunction
settings.jsFileExtensionsArray.<string>
settings.tsFileExtensionsArray.<string>

standalone~createStandaloneWebpackConfig(options, settings)

Update package.json, and conditionally a babel config, in the consuming project root.

Kind: inner method of standalone

ParamType
optionsobject
options.contextPathstring
settingsobject
settings.filenamestring
settings.consoleMessageobject
settings.createFilefunction
settings.outputStandaloneWebpackConfigfunction

standalone~outputStandalonePackageJson() ⇒ string

Output a basic package.json

Kind: inner method of standalone

standalone~createStandalonePackageJson(options, settings)

Update package.json, and conditionally a babel config, in the consuming project root.

Kind: inner method of standalone

ParamType
optionsobject
options.contextPathstring
options.loaderstring
settingsobject
settings.consoleMessageobject
settings.createFilefunction
settings.isTestModeboolean
settings.packageFileNamestring
settings.outputStandalonePackageJsonfunction
settings.runCmdfunction
settings.webpackFileNamestring

standalone~outputStandaloneBabelConfig() ⇒ string

Output a basic babel config file.

Kind: inner method of standalone

standalone~createStandaloneBabelConfig(options, settings)

Create a basic babel config

Kind: inner method of standalone

ParamType
optionsobject
options.contextPathstring
options.loaderstring
settingsobject
settings.consoleMessageobject
settings.createFilefunction
settings.filenamestring
settings.outputStandaloneBabelConfigfunction

standalone~standalone(settings)

Organize and output a basic webpack configuration.

Kind: inner method of standalone

ParamType
settingsobject
settings.consoleMessageobject
settings.createStandaloneBabelConfigfunction
settings.createStandaloneSrcIndexFilefunction
settings.createStandaloneTsConfigfunction
settings.createStandalonePackageJsonfunction
settings.createStandaloneWebpackConfigfunction

Typescript

Typescript~createTsConfig(dotenv, options, settings) ⇒ undefined | Object

Create, or merge, a tsconfig file.

Kind: inner method of Typescript

ParamTypeDescription
dotenvobject
dotenv._BUILD_DIST_DIRstring
optionsobject
options.baseTsConfigstring
options.contextPathstring
options.isCreateTsConfigboolean
options.isMergeTsConfigboolean
options.isRegenTsConfigboolean
settingsobject
settings.configFilenamestring
settings.consoleMessageobject
settings.createFilefunction
settings.isMessagingboolean

Helps with standalone configuration

webpack

webpack~cleanDist(dotenv)

Clean the "distribution" directory. Compensate for Webpack not cleaning output on development.

Kind: inner method of webpack

ParamType
dotenvobject
dotenv._BUILD_DIST_DIRstring

webpack~createWpConfig(options, settings) ⇒ Promise.<object>

Webpack merge base configuration files. If available merge extended configuration files.

Kind: inner method of webpack

ParamType
optionsobject
options.nodeEnvstring
options.dotenvobject
options.extendedConfigsArray.<string>
settingsobject
settings.consoleMessagefunction
settings.dynamicImportfunction
settings.isPromisefunction
settings.webpackCommonConfigfunction
settings.webpackDevelopmentConfigfunction
settings.webpackPreprocessLoaderConfigfunction
settings.webpackProductionConfigfunction

webpack~startWpErrorStatsHandler(err, stats, options, settings)

webpack callback error and stats handler. Separated for testing.

Kind: inner method of webpack

ParamType
err*
stats*
optionsobject
options.statsundefined | string
options.statsFileundefined | string
options.statsPathundefined | string
settingsobject
settings.colorobject
settings.consoleMessagefunction
settings.createFilefunction
settings.errorMessageHandlerfunction

webpack~startWp(webpackConfig, options, settings) ⇒ Promise.<void>

Start webpack development or production.

Kind: inner method of webpack

ParamType
webpackConfigobject
optionsobject
options.nodeEnvstring
settingsobject
settings.consoleMessagefunction
settings.startWpErrorStatsHandlerfunction
settings.webpackfunction
settings.WebpackDevServerfunction

webpackConfigs

webpackConfigs~preprocessLoaderJs(dotenv, settings) ⇒ Object

Assumption based preprocess loader for JS

Kind: inner method of webpackConfigs

ParamType
dotenvobject
dotenv._BUILD_SRC_DIRstring
settingsobject
settings.jsFileExtensionsArray.<string>

webpackConfigs~preprocessLoaderTs(dotenv, settings) ⇒ Object

Assumption based preprocess loader for Typescript

Kind: inner method of webpackConfigs

ParamType
dotenvobject
dotenv._BUILD_SRC_DIRstring
settingsobject
settings.jsFileExtensionsArray.<string>
settings.tsFileExtensionsArray.<string>

webpackConfigs~preprocessLoaderNone() ⇒ Object

Assumption based preprocess loader for none

Kind: inner method of webpackConfigs

webpackConfigs~preprocessLoader(options) ⇒ Object

Assumption based preprocess loader

Kind: inner method of webpackConfigs

ParamType
optionsobject
options.loaderstring

webpackConfigs~common(dotenv, settings) ⇒ Object

Common webpack settings between environments.

Kind: inner method of webpackConfigs

ParamType
dotenvobject
dotenv._BUILD_APP_INDEX_PREFIXstring
dotenv._BUILD_DIST_DIRstring
dotenv._BUILD_HTML_INDEX_DIRstring
dotenv._BUILD_PUBLIC_PATHstring
dotenv._BUILD_RELATIVE_DIRNAMEstring
dotenv._BUILD_SRC_DIRstring
dotenv._BUILD_STATIC_DIRstring
dotenv._BUILD_UI_NAMEstring
settingsobject
settings.consoleMessageobject
settings.jsFileExtensionsArray.<string>
settings.setupWebpackDotenvFilesForEnvfunction
settings.tsFileExtensionsArray.<string>

webpackConfigs~development(dotenv, settings) ⇒ Object

Development webpack configuration.

Kind: inner method of webpackConfigs

ParamType
dotenvobject
dotenv.NODE_ENVstring
dotenv._BUILD_DIST_DIRstring
dotenv._BUILD_HOSTstring
dotenv._BUILD_HTML_INDEX_DIRstring
dotenv._BUILD_OPEN_PATHstring
dotenv._BUILD_RELATIVE_DIRNAMEstring
dotenv._BUILD_PORTstring
dotenv._BUILD_SRC_DIRstring
dotenv._BUILD_STATIC_DIRstring
settingsobject
settings.setupWebpackDotenvFilesForEnvfunction

webpackConfigs~production(dotenv, settings) ⇒ Object

Production webpack configuration.

Kind: inner method of webpackConfigs

ParamType
dotenvobject
dotenv.NODE_ENVstring
dotenv._BUILD_RELATIVE_DIRNAMEstring
settingsobject
settings.setupWebpackDotenvFilesForEnvfunction