Skip to content

Cloud Technology LLC's Node.js Packaged Systems & Utilities

License

Notifications You must be signed in to change notification settings

cloud-hybrid/cloud-technology

Repository files navigation

Cloud Technology

Cloud Technology LLC's Node.js Packaged Systems & Utilities

Ideas

  • File-System "Database" system for CMS or Form CMS using Python's Pickled Data Type(s) + S3 Remote Storage

Setup & Initialization

git clone "https://github.com/cloud-hybrid/cloud-technology.git" ./cloud-technology

cd "${_}" && git submodule init

# --> Merge Strategy
git config --file ".gitconfig" pull.rebase false

git submodule update --recursive
git submodule foreach git checkout "$(git rev-parse --abbrev-ref HEAD)"
git submodule foreach git pull origin "$(git rev-parse --abbrev-ref HEAD)"

Workspaces

Creating a Workspace

In order to add or create a workspace, either instantiate the folder + NPM-compliant package structure, or run the following command:

npm init --yes --workspace "[Workspace-Name]"

The workspace name can also be a relative path:

npm init --yes --workspace "./packages/[Workspace-Name]"

As well as a wildcard:

npm init --yes --workspace "./packages/[Workspace-Name]/*"

Managing Specific Workspace(s)

Adding a Dependency Package:

npm install "[Dependency]" --workspace "[Workspace-Name]" ? --save-dev

Building a specific Workspace:

npm ci --workspace "[Workspace-Name]"

Running Localized Workspace Commands

Example (React Application):

npm run start --workspace packages/ui-template
npm run build --workspace packages/ui-template

Overview

Every package has the capability to run scripts, and given the specifities of how Node.js handles module resolution, it's possible to consume any defined workspace by it's declared package.json name.

Similar to an import, such defined scripts can be ran from the root package as if the current-working-directory were already localized to the target module.

// ./packages/ui-menu/index.js
module.exports = () => (<DOM/>);

/// --- ///

// ./packages/ui-shell/index.js
const Menu = require("@cloud-technology/ui-menu");

...

const DOM = () => {
    return (
        <>
            <Menu/>
            <Shell/>
        </>
    );
};

module.exports = () => (<DOM/>);

Lastly,

npm run start --workspace "./packages/ui-shell"

NPM

About

Cloud Technology LLC's Node.js Packaged Systems & Utilities

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published