Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
feat(lerna-dockerize): add init command to main cli
Browse files Browse the repository at this point in the history
  • Loading branch information
rudxde committed Mar 19, 2022
1 parent 6d2a683 commit a1ba0a0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
6 changes: 3 additions & 3 deletions packages/init/package.json
Expand Up @@ -26,19 +26,19 @@
"lerna-dockerize-init": "./bin"
},
"dependencies": {
"@lerna-dockerize/cli": "^0.8.4",
"@lerna-dockerize/logger": "^0.8.4",
"chalk": "^5.0.0",
"inquirer": "^8.2.0",
"logform": "^2.2.0",
"ora": "^6.0.1",
"winston": "^3.3.3",
"yargs": "^17.0.1"
"winston": "^3.3.3"
},
"devDependencies": {
"@types/inquirer": "^8.2.0",
"@types/jasmine": "^4.0.0",
"@types/node": "^17.0.17",
"@types/npm-package-arg": "^6.1.0",
"@types/yargs": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/eslint-plugin-tslint": "^5.11.0",
"@typescript-eslint/parser": "^4.22.0",
Expand Down
18 changes: 11 additions & 7 deletions packages/init/src/bin.ts
@@ -1,8 +1,12 @@
import yargs from 'yargs';
import { command } from '.';
import { initCommand } from '.';
import { getLogger } from '@lerna-dockerize/logger';
import { cli } from '@lerna-dockerize/cli';

yargs
.wrap(process.stdout.columns)
.command(command)
.demandCommand()
.argv;

cli([
initCommand,
])
.catch(err => {
getLogger().error(err);
process.exit(1);
});
4 changes: 2 additions & 2 deletions packages/init/src/index.ts
@@ -1,8 +1,8 @@
import type { CommandModule } from 'yargs';
import type { CommandModule } from '@lerna-dockerize/cli';
import { IInitArgs } from './args';


export const command: CommandModule<{}, IInitArgs> = {
export const initCommand: CommandModule<{}, IInitArgs> = {
command: 'init',
describe: 'Initialize lerna-dockerize in your project',
builder: {
Expand Down
1 change: 1 addition & 0 deletions packages/lerna-dockerize/package.json
Expand Up @@ -27,6 +27,7 @@
},
"dependencies": {
"@lerna-dockerize/generate": "0.8.4",
"@lerna-dockerize/init": "0.8.4",
"@lerna-dockerize/logger": "0.8.4",
"@lerna-dockerize/cli": "0.8.4"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/lerna-dockerize/src/index.ts
@@ -1,10 +1,12 @@
import { generateCommand } from '@lerna-dockerize/generate';
import { initCommand } from '@lerna-dockerize/init';
import { getLogger } from '@lerna-dockerize/logger';
import { cli } from '@lerna-dockerize/cli';


cli([
generateCommand,
initCommand,
])
.catch(err => {
getLogger().error(err);
Expand Down

0 comments on commit a1ba0a0

Please sign in to comment.