4.1.0 • Published 3 years ago

subpkg v4.1.0

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

subpkg

npm version

subpkg is a roughly API-compatible implementation of subpackage which has zero dependencies and trades support for environment variables for several additional features like linking and version bumping. subpkg allows you to run scripts defined in package.json across multiple sub-projects and serves as a minimal alternative to Lerna or pnpm's support for 'workspaces'.

Usage

$ npm install --save-dev subpkg
{
    "name": "my-awesome-project",
    "version": "2.5.1",
    "subPackages": [
        "packages/sub-package-1",
        "packages/sub-package-2"
    ],
    "scripts": {
      "postinstall": "subpkg install && ...",
      "build": "subpkg run build && ..."
    }
}

Dynamic modules

{
    "name": "my-awesome-project",
    "version": "2.5.1",
    "subPackages": {
        "dirA" : "packagesA.json",
        "dirB" : "packagesB.json"
    },
    "scripts": {
      "postinstall": "subpkg install && ...",
      "build": "subpkg run build && ..."
    }
}

Where packagesA.json is a JSON file specifying active/inactive packages in the directory dirA and both dirA and packagesA.json are paths relative to root directory:

{
    "sub-package-1": true,
    "sub-package-2": true,
    "sub-package-3": false,
}

Modules set to false will not be taken into account.

Laravel Modules

This feature allows for seamless integration with the nWidart/laravel-modules project:

{
    "name": "my-awesome-project",
    "version": "2.5.1",
    "subPackages": {
        "modules" : "modules_statuses.json"
    }
}

License

subpkg is distributed under the terms of the MIT License.

4.1.0

3 years ago

4.0.2

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago

0.0.1

5 years ago