@smartsoft001/cli
Advanced tools
Comparing version 0.0.35 to 0.0.36
{ | ||
"name": "@smartsoft001/cli", | ||
"version": "0.0.35", | ||
"version": "0.0.36", | ||
"bin": { | ||
@@ -5,0 +5,0 @@ "smart": "smart.js" |
@@ -11,2 +11,8 @@ # @smartsoft001/cli | ||
### Prepare system | ||
Preparing operating system dependencies to work with the framework. | ||
`smart prepare` | ||
### Create project | ||
@@ -13,0 +19,0 @@ |
@@ -7,2 +7,3 @@ "use strict"; | ||
const workspace_init_1 = require("./commands/workspace-init"); | ||
const system_prepare_1 = require("./commands/system-prepare"); | ||
//import { systemPrepare } from './commands/system-prepare' | ||
@@ -22,9 +23,5 @@ // tslint:disable-next-line:no-unused-expression | ||
})) | ||
// .command( | ||
// 'prepare', | ||
// 'Prepare dependencies', | ||
// async (args) => { | ||
// await workspacePrepare({ }) | ||
// }, | ||
// ) | ||
.command('prepare', 'Prepare system dependencies', (args) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
yield system_prepare_1.systemPrepare(); | ||
})) | ||
.command('$0', 'Show usage', () => null, (args) => { | ||
@@ -31,0 +28,0 @@ console.log(path_1.basename(args['$0'])); |
@@ -0,1 +1,17 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.systemPrepare = void 0; | ||
const tslib_1 = require("tslib"); | ||
const utils_1 = require("./utils"); | ||
function systemPrepare() { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
utils_1.log('Install nx cli'); | ||
utils_1.runCommand(`npm i -g nx@11.0.18 -g`); | ||
utils_1.log('Install angular cli'); | ||
utils_1.runCommand(`npm i @angular/cli@11.0.5 -g`); | ||
utils_1.log('Install ionic cli'); | ||
utils_1.runCommand(`npm i -g @ionic/cli@6.12.3 -g`); | ||
}); | ||
} | ||
exports.systemPrepare = systemPrepare; | ||
//# sourceMappingURL=system-prepare.js.map |
@@ -5,25 +5,15 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const child_process_1 = require("child_process"); | ||
const fs_extra_1 = require("fs-extra"); | ||
const path_1 = require("path"); | ||
function log(...msg) { | ||
console.log('>', ` SMART `, ...msg); | ||
} | ||
function runCommand(command, cwd = process.cwd()) { | ||
log(` RUN `, command); | ||
child_process_1.execSync(command, { cwd, stdio: [] }); | ||
} | ||
function info(message) { | ||
log(` INFO `, message); | ||
} | ||
const utils_1 = require("./utils"); | ||
function runInstallDeps(target) { | ||
log('Install dependencies'); | ||
utils_1.log('Install dependencies'); | ||
const devDeps = [ | ||
'@smartsoft001/core', | ||
]; | ||
const installDevDeps = `npm i ${devDeps.join(' ')} -D`; | ||
runCommand(installDevDeps, target); | ||
const installDevDeps = `npm i ${devDeps.join(' ')} --save`; | ||
utils_1.runCommand(installDevDeps, target); | ||
} | ||
function runInstallDevDeps(target) { | ||
log('Install dev dependencies'); | ||
utils_1.log('Install dev dependencies'); | ||
const devDeps = [ | ||
@@ -54,11 +44,11 @@ '@smartsoft001/schematics', | ||
const installDevDeps = `npm i ${devDeps.join(' ')} -D`; | ||
runCommand(installDevDeps, target); | ||
utils_1.runCommand(installDevDeps, target); | ||
} | ||
function runSetNgConfig(target) { | ||
log('Set NG config'); | ||
runCommand("ng config cli.defaultCollection @smartsoft001/schematics", target); | ||
runCommand("ng add @smartsoft001/schematics", target); | ||
utils_1.log('Set NG config'); | ||
utils_1.runCommand("ng config cli.defaultCollection @smartsoft001/schematics", target); | ||
utils_1.runCommand("ng add @smartsoft001/schematics", target); | ||
} | ||
function createNxWorkspace(name) { | ||
log('Creating Nx Workspace'); | ||
utils_1.log('Creating Nx Workspace'); | ||
const params = [ | ||
@@ -71,3 +61,3 @@ '--nx-cloud=true', | ||
const createCommand = `npx create-nx-workspace@latest ${name} ${params.join(' ')}`; | ||
runCommand(createCommand); | ||
utils_1.runCommand(createCommand); | ||
} | ||
@@ -74,0 +64,0 @@ function workspaceInit({ name }) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
9253
15
144
28