Skip to main content

WebdaProject

@webda/compiler


Class: WebdaProject

Defined in: definition.ts:758

Represents a Webda project on disk, providing access to package metadata and project paths

Constructors​

Constructor​

new WebdaProject(folder, output?): WebdaProject

Defined in: definition.ts:765

Create a new WebdaProject.

Parameters​

folder​

string

path to the project root

output?​

WorkerOutput = ...

worker output for logging

Returns​

WebdaProject

Properties​

folder​

protected folder: string

Defined in: definition.ts:766

path to the project root


namespace​

namespace: string

Defined in: definition.ts:759


output​

protected output: WorkerOutput

Defined in: definition.ts:767

worker output for logging


packageDescription​

packageDescription: PackageDescriptor

Defined in: definition.ts:760

Methods​

completeNamespace()​

completeNamespace(name): string

Defined in: definition.ts:900

Prefix a name with the project namespace if it does not already contain one

Parameters​

name​

string

the name to prefix

Returns​

string

the namespaced name


emit()​

emit(event, ...args): void

Defined in: definition.ts:870

Emit an output event

Parameters​

event​

string

event name

args​

...any[]

event arguments

Returns​

void


ensureDependency()​

ensureDependency(name): void

Defined in: definition.ts:850

Ensure a dependency is declared

Parameters​

name​

string

the package name to check

Returns​

void


getAppPath()​

getAppPath(path?): string

Defined in: definition.ts:879

Get an absolute path within the project folder, or the project root if no path given

Parameters​

path?​

string

relative path within the project

Returns​

string

the absolute path


getDigest()​

getDigest(): string

Defined in: definition.ts:821

Compute digest of the source files

Returns​

string

the MD5 hex digest of the source


isApplication()​

isApplication(): boolean

Defined in: definition.ts:785

Check if the project is a webda application

Returns​

boolean

true if a webda.config file exists


log()​

log(level, ...args): void

Defined in: definition.ts:891

Log a message at the specified level through the worker output

Parameters​

level​

WorkerLogLevel

log level

args​

...any[]

log arguments

Returns​

void


on()​

on(event, listener): void

Defined in: definition.ts:861

Subscribe to output events

Parameters​

event​

string

event name

listener​

(...args) => void

callback function

Returns​

void