Cloud Technology LLC's Node.js
Packaged Systems & Utilities
- File-System "Database" system for CMS or Form CMS using Python's Pickled Data Type(s) + S3 Remote Storage
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)"
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]/*"
Adding a Dependency Package:
npm install "[Dependency]" --workspace "[Workspace-Name]" ? --save-dev
Building a specific Workspace:
npm ci --workspace "[Workspace-Name]"
Example (React Application):
npm run start --workspace packages/ui-template
npm run build --workspace packages/ui-template
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"