1.2.1 • Published 3 years ago

workspaces-utils v1.2.1

Weekly downloads
99
License
MIT
Repository
github
Last release
3 years ago

workspaces-utils

TODO: description

Usage

const workspacesUtils = require('workspaces-utils');

// TODO: DEMONSTRATE API

Documentation

Table of Contents

getWorkSpaceDirPaths

getWorkspaceDirPaths gets you concatenated list of dir paths in workspace

Parameters

  • pathToRoot String path to root dir with default as app root in node project

Returns Array array of paths in workspace using npm-link-extras getDirectories

getWorkSpacePackages

getWorkSpacePackages gets you concatenated list of package.jsons in workspace

Parameters

  • pathToRoot String path to root dir with default as app root in node project

Returns Array array of paths in workspace using npm-link-extras getPackages

getWorkspaces

returns the defined workspace as patterns in a yarn monorepo. It accounts for yarn 1.5.1 when workspaces became an object or array.

Parameters

  • pathToRoot String path to root dir with package.json

Returns Array array of patterns (eg: packages/*)

getWorkspaceDirNames

gets you the dir names in workspace instead of globs It can optionally take a path to root with default as appRoot inside a node project

Parameters

  • pathToRoot String path to root dir

Returns Array names of dirs in workspace

getWorkspaceAbsPaths

can get you absolute paths to directories or files in workspace

Parameters

  • pathToRoot String path to root dir with default as app root in node project
  • pathTo String path to file or dir in workspace

Returns Array array of paths

getWorkSpacePathTo

is a curried fn that takes a file or dir path as the first fn arg and a root path as the second fn arg to return workspace relative paths

Parameters

  • pathToRoot String relative path to root
  • pathTo String path to file or dir in workspace

Returns Array array of paths

getPathsInWorkspace

takes an array of paths/filenames and returns workspace relative paths to them

Parameters

  • paths Array array of file names or paths
  • appRoot String root path to start from, usually application root

Returns Array array of paths mapped to workspace packages

1.2.1

3 years ago

1.2.0

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago