Options
All
  • Public
  • Public/Protected
  • All
Menu

Package @tscmono/plugin-repo

Index

References

generateTsConfigs

Re-exports generateTsConfigs

getTree

Re-exports getTree

reduceTreeNodeToTSConfigList

Re-exports reduceTreeNodeToTSConfigList

repoConfig

Re-exports repoConfig

treeNodeToTSConfig

Re-exports treeNodeToTSConfig

workspaceTree

Re-exports workspaceTree

Type aliases

TSConfigTemplate

TSConfigTemplate: { content: any & { references: { path: string }[] }; isRoot: boolean; path: string }

Describe what should be written to the filesystem for a tsconfig

Type declaration

  • content: any & { references: { path: string }[] }

    The content to be written

  • isRoot: boolean

    Used to decide if the baseConfig should be added as extends

  • path: string

    The path of the file to be writte

Cache Variables

Const repoConfig

repoConfig: { refresh: (...args: K) => Promise<T>; value: Promise<T> } = registerCache('repoConfig',getRepoConfig,)

Cached version of the Get Repo Config function

Type declaration

  • refresh: (...args: K) => Promise<T>
      • (...args: K): Promise<T>
      • Parameters

        • Rest ...args: K

        Returns Promise<T>

  • value: Promise<T>

Const workspaceTree

workspaceTree: { refresh: (...args: K) => Promise<T>; value: Promise<T> } = registerCache('workspaceTree',getTree,)

Cached version of the Workspace Tree Generator function

Type declaration

  • refresh: (...args: K) => Promise<T>
      • (...args: K): Promise<T>
      • Parameters

        • Rest ...args: K

        Returns Promise<T>

  • value: Promise<T>

Command Variables

Const commandPath

commandPath: string[] = ['generate', 'repo']

Command path of the RepoCommand

Plugin Definition Variables

Const commands

commands: RepoCommand[] = [RepoCommand,]

Define commands exported from this plugin

Const runOnDefault

runOnDefault: true = true

State that this plugin should be run from BaseCommand

Const runOnDefaultPath

runOnDefaultPath: string[] = commandPath

Path to be run from BaseCommand

Const runOnDefaultPriority

runOnDefaultPriority: 10 = 10

Run priority of this plugin when evaluated by BaseCommand

Config Functions

Const getRepoConfig

  • getRepoConfig(rootDir?: string): Promise<Required & Optional>
  • Obtain the monorepo tscmono config using cosmiconfig

    Parameters

    • Default value rootDir: string = process.cwd()

      Optional directory from which to obtain the repo config

    Returns Promise<Required & Optional>

TSConfig Generation Functions

Const generateTsConfigs

  • generateTsConfigs(rootDir?: string): Promise<{ content: any & { references: { path: string }[] }; isRoot: boolean; path: string }[]>
  • Generate TSConfigTemplates for all repo paths

    Parameters

    • Default value rootDir: string = process.cwd()

      The root directory to be used when generating tsConfigs

    Returns Promise<{ content: any & { references: { path: string }[] }; isRoot: boolean; path: string }[]>

Const reduceTreeNodeToTSConfigList

Const treeNodeToTSConfig

  • Convert a single TreeNode instance to a TSConfigTemplate, given the project path, and a template to be used. It will only generate the template for the current node, and not traverse its children

    Parameters

    • projectPath: string

      The project path

    • tree: TreeNode

      The tree to be converted

    • tpl: any

      The template to be used

    Returns TSConfigTemplate

Tree Functions

Const getTree

  • getTree(rootDir?: string): Promise<{ projectRoot: string; tree: { children: Record<string, TreeNode | string>; path: string } }>
  • Create a project tree based on workspaces

    Parameters

    • Default value rootDir: string = process.cwd()

      The root directory used in creating the project tree

    Returns Promise<{ projectRoot: string; tree: { children: Record<string, TreeNode | string>; path: string } }>

Generated using TypeDoc