Options
All
  • Public
  • Public/Protected
  • All
Menu

The class helps you bundle apps for deployment on the Moovweb XDN.

Hierarchy

  • DeploymentBuilder

Index

Constructors

constructor

Properties

appDir

appDir: string

jsDir

jsDir: string

sourcesDir

sourcesDir: string

staticAssetsDir

staticAssetsDir: string

xdnDir

xdnDir: string

Accessors

Static xdnVersion

  • get xdnVersion(): string
  • XDN version of @xdn/core.

    Returns string

Methods

addDefaultAppResources

  • addDefaultAppResources(defaultAppPath: string): this
  • Ensures all assets in the defaultAppPath are either already present in the user's app or are copied over from defaultAppPath.

    Parameters

    • defaultAppPath: string

    Returns this

    A self reference, suitable for chaining

addDefaultXdnScripts

  • addDefaultXdnScripts(scriptsOverride?: {}): this
  • Copies all the xdn scripts into the package.json file, if they don't already exist.

    Parameters

    • Default value scriptsOverride: {} = {}

      Used to pass framework-specific script overrides

    Returns this

    A self reference, suitable for chaining

addJSAsset

  • addJSAsset(src: string, dest?: undefined | string): this
  • Adds an asset to the bundle for JavaScript workers

    Parameters

    • src: string

      The source path

    • Optional dest: undefined | string

      The destination path within the lambda root directory

    Returns this

    a self reference, suitable for chaining

addJSBackend

  • addJSBackend(modulePath: string): this
  • Adds the module for the js backend

    Parameters

    • modulePath: string

      The path to the server module for the JS backend.

    Returns this

    a self reference, suitable for chaining

addSource

  • addSource(src: string): void
  • Copies a file or directory into .xdn/src

    Parameters

    • src: string

    Returns void

addStaticAsset

  • addStaticAsset(src: string, dest: string): this
  • Adds a folder or file as static asset. Also register directories as asset aliases when they contains an index.html file

    Parameters

    • src: string

      The source path

    • dest: string

      The destination path in s3

    Returns this

    a self reference, suitable for chaining

build

  • build(): Promise<void>
  • Copies all of the standard assets into the JS and static asset bundles. These are the same for any framework.

    Returns Promise<void>

clearPreviousBuildOutput

  • clearPreviousBuildOutput(): this
  • Deletes the output of the previous build.

    Returns this

copySync

  • copySync(from: string, to: string): void
  • Copies a file

    Parameters

    • from: string

      the source path

    • to: string

      the destination path

    Returns void

emptyDirSync

  • emptyDirSync(dir: string): void
  • Deletes all files in a directory

    Parameters

    • dir: string

      The directory to empty

    Returns void

exec

  • exec(path: string, args: string[], options?: SpawnOptions): Promise<unknown>
  • Runs a command.

    Parameters

    • path: string

      The path to the executable

    • args: string[]

      The arguments to pass

    • Default value options: SpawnOptions = {}

      Options for process.spawn

    Returns Promise<unknown>

getRouter

  • getRouter(): Promise<Router>
  • Returns the router instance.

    Returns Promise<Router>

includeFiles

  • includeFiles(): Promise<void>
  • Adds all configured extra files to the lamdba directory

    Returns Promise<void>

includeNodeModules

  • includeNodeModules(): Promise<void>
  • Adds all dependencies from package.json to the JS bundle (excluding devDependencies)

    Returns Promise<void>

log

  • log(...msg: any[]): void
  • Logs a message to the console if process.env.debug is set to true

    Parameters

    • Rest ...msg: any[]

      The message to log

    Returns void

preparePackageJson

  • preparePackageJson(): void
  • Copies the package.json file into the lambda and adjust all dependencies that use file paths

    Returns void

readFileSync

  • readFileSync(path: string, __namedParameters?: { encoding: "utf8" | "ascii" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" }): string
  • Reads a file

    Parameters

    • path: string

      the file path

    • Default value __namedParameters: { encoding: "utf8" | "ascii" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" } = {}
      • encoding: "utf8" | "ascii" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex"

    Returns string

    The file contents

removeSync

  • removeSync(path: string): void
  • Deletes a file

    Parameters

    • path: string

      The file to delete

    Returns void

writeFileSync

  • writeFileSync(to: string, content: string, encoding?: string): void
  • Writes a file

    Parameters

    • to: string

      the destination path

    • content: string

      the contents of the file

    • Default value encoding: string = "utf8"

      the encoding

    Returns void

Generated using TypeDoc