Options
All
  • Public
  • Public/Protected
  • All
Menu

Module \mmir-tooling\src\utils

Index

Type aliases

IncludeType

IncludeType: "loadAfterInit" | "loadBeforeInit" | "includeModules"

PackageJson

PackageJson: {}

Type declaration

  • [field: string]: any

Variables

_isLog

_isLog: defaultIsLog = defaultIsLog

_isWarn

_isWarn: defaultIsWarn = defaultIsWarn

_log

_log: defaultLog = defaultLog

_warn

_warn: defaultWarn = defaultWarn

asyncSupport

asyncSupport: boolean = false

Const checksumUtil

checksumUtil: ChecksumUtils = (mmir as MmirModule).require('mmirf/checksumUtils').init()

Const log

log: any = logUtils.log

Const log

log: any = logUtils.log

Const mmirConfigFile

mmirConfigFile: "mmir.build.config.js" = "mmir.build.config.js"

Const mmirDir

mmirDir: any = path.dirname(require.resolve('mmir-lib'))

Const promiseConstr

promiseConstr: any = typeof Promise !== 'undefined'? Promise : require('es6-promise').Promise

Const reNormalize

reNormalize: RegExp = sep !== '/' ? new RegExp(sep.replace(/\\/g, '\\\\'), 'g') : null

readUp

readUp: ReadPkgUp

semVer

semVer: SemVer

Const warn

warn: any = logUtils.warn

Const warn

warn: any = logUtils.warn

Const warn

warn: any = logUtils.warn

Functions

addAliasFrom

addAppSettings

addAutoLoadModule

  • addAutoLoadModule(appConfig: WebpackAppConfig, id: string, file: string): void

addIncludeModule

  • addIncludeModule(appConfig: WebpackAppConfig, id: string, file?: string): void

checkPackageVersion

  • checkPackageVersion(packageId: string, versionRequirement: string): undefined | boolean

checkUpToDate

  • checkUpToDate(jsonContent: string, checksumPath: string, targetPath: string, additionalInfo: string): Promise<boolean>

contains

  • contains(list: any[], entry: any): boolean

Const createFileTestFunc

  • createFileTestFunc(absolutePaths: string[], debugStr?: string): (path: string) => boolean
  • Parameters

    • absolutePaths: string[]
    • Optional debugStr: string

    Returns (path: string) => boolean

      • (path: string): boolean
      • Parameters

        • path: string

        Returns boolean

customMerge

  • customMerge<TObject, TSource>(target: TObject, source: TSource): TObject & TSource
  • merge with custom handling for lists/arrays:

    if both objects are lists, do append (non-duplicate) entries from source to target, otherwise use lodash.merge()

    Type parameters

    • TObject

    • TSource

    Parameters

    • target: TObject

      target for merging

    • source: TSource

      source for merging

    Returns TObject & TSource

    the merged (target) object

defaultIsLog

  • defaultIsLog(): boolean

defaultIsWarn

  • defaultIsWarn(): boolean

defaultLog

  • defaultLog(_message?: any, ..._optionalParams: any[]): void

defaultWarn

  • defaultWarn(_message?: any, ..._optionalParams: any[]): void

doAddModule

doBuild

doLoadMmirBuildConfig

doRegisterModuleId

  • doRegisterModuleId(appConfig: WebpackAppConfig, id: string, file: string): void

getPackageVersion

  • getPackageVersion(packageId: string): undefined | PackageJson

init

  • init(opt?: meow.Options<meow.AnyFlags>, helpText?: string): void

initPackageReader

initSemVer

  • initSemVer(): undefined | SemVer

Const isDirectory

  • isDirectory(path: string): boolean

mergeLists

  • mergeLists(objValue: any, srcValue: any): any

Const normalizePath

  • normalizePath(path: string): string

registerModuleId

saveRequire

  • saveRequire(pkg: string): any

setOptionIf

  • setOptionIf(options: any, optionNameIfTrue: string, optionNameIfFalse: string, value: any, useIfNone: boolean, packageId: string, packageVersionRequirement: string): any
  • HELPER set backwards compatible options, depending on the version of a (webpack) plugin/module

    Parameters

    • options: any

      the options object

    • optionNameIfTrue: string

      the option (name) that should be set in case packageVersionRequirement evaluate to true

    • optionNameIfFalse: string

      the option (name) that should be set in case packageVersionRequirement evaluate to false

    • value: any

      the option value to set

    • useIfNone: boolean

      the fallback evaluation value that should be used in case the packageVersionRequirement could not be processed (most likely due to opitional/not installed dependencies)

    • packageId: string

      the package ID which's version shoulb be checked

    • packageVersionRequirement: string

      the requirement for the package's version, e.g. ">= 3.0.0" (uses semver.satisfies() if available)

    Returns any

    the modified options object

toAliasPath

  • toAliasPath(moduleFilePath: string): string

Generated using TypeDoc