@cto.af/monopub - v1.1.0
    Preparing search index...

    Class MonoRoot

    Representation for the root package of the monorepo.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    • get name(): string

      Package name. Asserts if not available. Must call init() first.

      Returns string

    • get private(): boolean

      Is this package private?

      Returns boolean

    • get version(): string

      Current version of the package.

      Returns string

    • set version(ver: string): void

      Parameters

      • ver: string

      Returns void

    • get workspaces(): string[]

      Workspaces as defined in the package file, if you are using npm-style workspaces.

      Returns string[]

    Methods

    • All of the child packages. Depending on opts.private, may not include private packages.

      Returns MapIterator<PackageFile>

      PackageFile.

    • Delete the given fields from all packages.

      Parameters

      • fields: string[]

        Field names to delete.

      Returns this

      Promise of this, for chaining.

    • Get the set of local dependencies. Which of the local pacakges does this package depend upon?

      Parameters

      • locals: Set<string>

        The names of the local packages.

      Returns Set<string>

      The local packages we depend on.

    • Execute a command in the directory for this pacakge.

      Parameters

      • opts: SpawnOptions

        Options for spawn. {stdion: 'inherit'} is recommended.

      • command: string

        Shell command.

      Returns Promise<ExecResult>

      Results of execution when complete.

    • Execute the given script in the directories of this package and all sub-projects. If one script fails, execution stops.

      Parameters

      • opts: SpawnOptions

        Options for exec.

      • cmd: string

        Shell script to run.

      Returns Promise<ExecResult[]>

      Array of execution results. If one execution fails, the last result will have "ok: false".

    • Initialize this package, and all of the sub-packages. Compute the dependency topology.

      Returns Promise<MonoRoot>

      A promise that completes when all reads are done.

    • Save this package and any sub-package files, if they are dirty.

      Parameters

      • gitAdd: boolean = false

        If true, add the changed files to the pending git commit.

      Returns Promise<MonoRoot>

      Promise of this, for chaining.

    • Set the version of all sub-packages to the version of the root package.

      Returns void