Options
All
  • Public
  • Public/Protected
  • All
Menu

Package @tscmono/repo

Index

References

Type aliases

Cache Variables

Config Functions

Other Functions

TSConfig Generation Functions

References

repoConfig

Re-exports repoConfig

Type aliases

TSConfigTemplate

TSConfigTemplate: { content: any; isRoot: boolean; path: string }

Describe what should be written to the filesystem for a tsconfig

Type declaration

  • content: any

    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>

Config Functions

Const getRepoConfig

  • getRepoConfig(rootDir?: string): Promise<RepoConfig>
  • 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<RepoConfig>

Other 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 } }>

TSConfig Generation Functions

Const generateTsConfigs

  • generateTsConfigs(rootDir?: string): Promise<{ content: any; 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; 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

Generated using TypeDoc