1.0.4 • Published 4 years ago
@binaryshrub/arbor-cli v1.0.4
_
__ _ _ __| |__ ___ _ __
/ _` | '__| '_ \ / _ \| '__|
| (_| | | | |_) | (_) | |
\__,_|_| |_.__/ \___/|_|
by: BinaryShrub
A CLI to initialize and manage monorepo projects for services and their shared components.
https://www.npmjs.com/package/@binaryshrub/arbor-cli
Getting Started
With arbor, creating a mono repositiory is a snap! the CLI allows you to configure service(s) and shared components that are preconfigured with yarn workspace
, lerna
, typescript
, jest
, eslint
, prettier
, and husky
(for safer commits):
# yarn
yarn global add @binaryshrub/arbor-cli
# npm
npm install -g @binaryshrub/arbor-cli
Example Project
mkdir my-project && cd my-project
arbor init
# add service to project
arbor add -t service -n my-service
# add component to project
arbor add -t component -n my-component
# help
arbor --help
Structure
.
├── .arbor
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .prettierignore
├── .prettierrc.js
├── .vscode
│ └── extensions.json
├── LICENSE
├── jest.config.js
├── lerna.json
├── package.json
├── packages
│ ├── components
│ │ └── my-component
│ │ ├── jest.config.js
│ │ ├── package.json
│ │ ├── src
│ │ │ └── index.ts
│ │ ├── test
│ │ │ └── index.spec.ts
│ │ └── tsconfig.build.json
│ └── services
│ └── my-service
│ ├── jest.config.js
│ ├── package.json
│ ├── src
│ │ └── app.ts
│ ├── test
│ │ ├── integration
│ │ │ └── app.test.ts
│ │ └── unit
│ │ └── app.spec.ts
│ ├── tsconfig.build.json
│ └── webpack.config.js
├── tsconfig.json
├── webpack.config.js
└── yarn.lock
12 directories, 26 files
Development
# run cli
yarn local
# build cli
yarn build
# install cli
yarn deploy
# reinstall dependencies
yarn refresh
Preconfigured Scripts
"scripts": {
"local": "ENV=DEV ts-node src/cli.ts",
"clean": "rm -rf lib local-project",
"build": "rm -rf lib && tsc",
"postbuild": "cp -R src/templates lib",
"deploy": "yarn build && npm link; rm package-lock.json; arbor --help",
"refresh": "rm -rf node_modules yarn.lock local-project && yarn install",
"git:commit": "yarn refresh && yarn build && git add -A; yarn local arbor --help"
}
Workspace (macOS)
# install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install git
brew install git
# install node
brew install node
# install yarn
brew install yarn
# clone
git clone git@github.com:BinaryShrub/arbor-cli.git
cd arbor-cli
# install dependencies
yarn install