open-index/open-npm huggingface dataset:
npm package: @modular-rocks/workspace
Description: A workspace for working with virtual codebases
Author: Alex Dollery
Latest version: 0.2.0

# A Workspace for working with virtual codebases

## Installation

`npm install @modular-rocks/workspace`

or

`yarn add @modular-rocks/workspace`

## Usage

A Workspace can contain multiple Codebases, a Codebase will contain FileContainers. It is designed to be highly configurable, allowing you to extend the Workspace, Codebase or FileContainer classes, allowing you to build anything you want on top.

Each Workspace and Codebase accepts an `Options` argument containing configuration options.

| Option          | Description                                     | Type                             | Example                    |
| --------------- | ----------------------------------------------- | -------------------------------- | -------------------------- |
| pipeline        | Array of functions                              | Function[]                       | [functionA, functionB]     |
| files           | Array of arrays consisting of pathname and code | [pathname:string, code:string][] | [['/path', 'hello world']] |
| src             | source of the project                           | string                           | '/path/to/project'         |
| extensions      | Array of extensions to filter the files by      | string[]                         | ['ts', 'js']               |
| ignoredFiles    | Array of files to filter the files by           | string[]                         | ['.d.ts']                  |
| ignoredImports  | Array of import statements                      | string[]                         | ['$GlobalVariable']        |
| packageContents | JSON Object like in `package.json`              | Object                           | ['$GlobalVariable']        |

    const opts: Options = {
      pipeline,
      files,
      src: '/',
      extensions: [],
      ignoredFiles: [],
      ignoredImports: [],
      packageContents: {}
    }

A FileContainer accepts 3 arguments: `pathname:string`, `code:string`, `codebase:Codebase`.

The pipeline is described in detail in the readme of the pipeline folder.

## Framework specific versions

- [workspace-node](https://github.com/modular-rocks/workspace-node)

## Examples

Examples coming soon...

## License

Apache 2.0
npm package: @modular-rocks/workspace-node
Description: This is the Workspace for Typescript/Javascript, extending @modular-rocks/workspace specifically for NodeJS.
Author: Alex Dollery
Latest version: 0.1.12

# A Workspace for working with virtual codebases

## Installation

`npm install @modular-rocks/workspace-node`

or

`yarn add @modular-rocks/workspace-node`

## Usage

Workspace-node is built directly on top of Workspace and adds further functionality for `NodeJS` environments. Additional options for node specific environments are:

| Option                     | Description                                   | Type     |
| -------------------------- | --------------------------------------------- | -------- |
| packageContents (optional) | The hash contents of your `package.json` file | Object{} |
| packagePath (optional)     | The path to your `package.json` file          | string   |

[File](https://github.com/modular-rocks/workspace-node/blob/main/src/workspace/codebase/file/index.ts) also contains more `node` specific methods for AST parsing.

## Important

Remember, this isn't only the version for NodeJS, its the version for virtualising a NodeJS codebase, in NodeJS.

Workspace is written in NodeJS, but can work with any codebase by reading files. This is why `workspace-node` uses packages like `BabelJS` to visit the AST, whereas `workspace` can be configured to use other parsers for other languages / environments.

## Examples

Examples coming soon...

## License

Apache 2.0
npm package: @modular-rpc/mproto
Description: The TypeScript runtime library for mproto schemas.
Author: modular-rpc authors
Latest version: 0.1.1

# Mproto TypeScript runtime

This package is the TypeScript runtime library for the `mproto` serialization system. TypeScript code generated from a `mproto` schema takes this package as a dependency. See the top-level `mproto` readme in the [github repository](https://github.com/modular-rpc/mproto) for more information.

## License

Apache 2.0
npm package: @modular-scripts/workspace-resolver
Description: This package encapsulates two functions:
Latest version: 2.0.0

# @modular-scripts/workspace-resolver

This package encapsulates two functions:

1. `resolveWorkspace` - Searches the filesystem (at a given modular root) for
   workspace packages, returning a flat map of all packages found, with an
   additional `type` field containing the modular type (if present). An optional
   2nd argument of `target` can be passed, which sets the working directory that
   workspaces should be resolved from. This can be useful when the modular root
   needs to be different to the current working directory, such as when modular
   `convert` or `port` happens.
2. `analyzeWorkspaceDependencies` - Analyzes `package.json` files for a set of
   workspace packages, returning a flat object for each package, listing out
   workspace inter-dependencies plus and mismatched dependencies. The
   dependencies are analyzed according to dependencies defined in `package.json`
   files. The resulting output intends to match the yarn v1 (classic) output for
   `yarn workspaces info` (1)

In most cases, the output of `resolveWorkspace` can be passed directly to
`analyzeWorkspaceDependencies`.

(1) This package exists as a drop-in replacement for `yarn workspaces info`
because the yarn command is not consistent across other versions of yarn.

## Example

```TypeScript
const [workspacePackages] = resolveWorkspace('path/to/modular/project/root')

/*
Map {
    "example-package": {
        path: 'packages/example-package',
        name: 'example-package',
        workspace: false,
        version: '1.0.0',
        modular: {
            type: 'package'
        },
        type: 'package',
        children: [],
        parent: null,
        dependencies: {
            'lodash': '10.0.0'
        }
    },
    ...
}
*/

const analyzed = analyzeWorkspaceDependencies(workspacePackages);

/*
{
  "example-package": {
    "location": "packages/example-package",
    "workspaceDependencies": ['another-package'],
    "mismatchedWorkspaceDependencies": []
  },
  "another-package": {
    "location": "packages/another-package",
    "workspaceDependencies": [],
    "mismatchedWorkspaceDependencies": ['mismatched-dep-one']
  },
  ...
*/

```