-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/completion' into develop
Closes #8
- Loading branch information
Showing
21 changed files
with
460 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env node | ||
/* eslint-disable no-console */ | ||
|
||
const program = require('commander'), | ||
packageFile = require('../package.json'), | ||
Completion = require('../lib/commands/completion'), | ||
{ options } = require('../lib/commands-options/clea-completion'), | ||
Command = require('../lib/utilities/command'); | ||
|
||
program.version(packageFile.version); | ||
|
||
Command.addOptions(program, options); | ||
|
||
program.parse(process.argv); | ||
|
||
const completion = new Completion(program.zsh && 'zsh'); | ||
completion.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
#!/usr/bin/env node | ||
|
||
const program = require('commander'), | ||
chalk = require('chalk'), | ||
SemVer = require('semver').SemVer, | ||
|
||
packageFile = require('../package.json'), | ||
nodeVersion = new SemVer(process.version), | ||
logger = require('../vendors/logger'); | ||
logger = require('../vendors/logger'), | ||
packageFile = require('../package.json'), | ||
{ commands } = require('../lib/commands-options/clea'), | ||
Command = require('../lib/utilities/command'); | ||
|
||
if (nodeVersion.compare(new SemVer('6.9.0')) < 0) { | ||
logger.error(`ERROR: Your running version of Node v${nodeVersion.version}, is not a supported version to use the CLI. The official Node supported version is 6.9 and greater.`); | ||
|
||
process.exit(1); | ||
} | ||
|
||
program.version(packageFile.version) | ||
.command('new', `creates a new directory and runs ${chalk.blue.bold('clea init')} in it`) | ||
.command('init', `creates a new project in the current folder`) | ||
.command('generate', 'generates new code from blueprints') | ||
.command('serve', 'builds and serves your app, rebuilding on file changes') | ||
.command('build', 'builds your app and places it into the output path') | ||
.command('test', 'runs your app\'s test suite') | ||
.command('lint', 'lints code in existing project') | ||
.parse(process.argv); | ||
program.version(packageFile.version); | ||
Command.addCommands(program, commands); | ||
program.parse(process.argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const options = [{ | ||
option: '-v, --verbose', | ||
doc: 'verbose mode' | ||
}, { | ||
option: '--target [env]', | ||
doc: 'build the application with the targeted environment (defaults to: development)' | ||
}, { | ||
option: '--output-path [path]', | ||
doc: 'build the application into this path (defaults to: dist/)' | ||
}, { | ||
option: '--base-href [url]', | ||
doc: 'base url for the application being built (defaults to: /)' | ||
}, { | ||
option: '--compress', | ||
doc: 'enable gzip compression' | ||
}, { | ||
option: '--sourcemap', | ||
doc: 'output sourcemaps' | ||
}, { | ||
option: '--doc', | ||
doc: 'generate the documentation' | ||
}, { | ||
option: '--progress', | ||
doc: 'display a compilation progress' | ||
}, { | ||
option: '--merge-config [config]', | ||
doc: 'merge the given webpack configuration with the existing one' | ||
}, { | ||
option: '--override-config [config]', | ||
doc: 'override the existing webpack configuration by the given one' | ||
}]; | ||
|
||
module.exports.name = 'build'; | ||
module.exports.options = options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const options = [{ | ||
option: '-z, --zsh', | ||
doc: 'generate zsh config' | ||
}, { | ||
option: '-b, --bash', | ||
doc: 'generate bash config' | ||
}]; | ||
|
||
module.exports.name = 'completion'; | ||
module.exports.options = options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const chalk = require('chalk'); | ||
|
||
const options = [{ | ||
option: '--with-component', | ||
doc: `generate a component with the generated module. Only for ${chalk.blue('module')} blueprint.` | ||
}, { | ||
option: '--lazy-load', | ||
doc: `lazy load the module in the closest parent routing file. Only for ${chalk.blue('module')} blueprint.` | ||
}]; | ||
|
||
module.exports.name = 'generate'; | ||
module.exports.options = options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const options = [{ | ||
option: '-v, --verbose', | ||
doc: 'verbose mode' | ||
}, { | ||
option: '--lib', | ||
doc: 'generate a library instead of an application' | ||
}, { | ||
option: '--ui-framework [framework]', | ||
doc: 'create application with built-in ui framework. "material" or "bootstrap" (defaults to: none)' | ||
}, { | ||
option: '--make-it-progressive', | ||
doc: 'add the default configuration for a Progressive Web App (defaults to: false)' | ||
}, { | ||
option: '--skip-install', | ||
doc: 'skip installing packages (defaults to: false)' | ||
}, { | ||
option: '--skip-git', | ||
doc: 'skip initializing a git repository (defaults to: false)' | ||
}, { | ||
option: '--commit-message-conventions', | ||
doc: 'add commit-msg hook to force use of the Google message conventions (defaults to: false)' | ||
}]; | ||
|
||
module.exports.name = 'init'; | ||
module.exports.options = options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const options = [{ | ||
option: '--fix', | ||
doc: 'will attempt to fix lint errors' | ||
}, { | ||
option: '--force', | ||
doc: 'will always return error code 0 even with lint errors. It also launches all linters, whether there is errors or not.' | ||
}]; | ||
|
||
module.exports.name = 'lint'; | ||
module.exports.options = options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const options = [{ | ||
option: '-v, --verbose', | ||
doc: 'verbose mode' | ||
}, { | ||
option: '--lib', | ||
doc: 'generate a library instead of an application' | ||
}, { | ||
option: '--ui-framework [framework]', | ||
doc: 'create application with built-in ui framework. "material" or "bootstrap" (defaults to: none)' | ||
}, { | ||
option: '--make-it-progressive', | ||
doc: 'add the default configuration for a Progressive Web App (defaults to: false)' | ||
}, { | ||
option: '--skip-install', | ||
doc: 'skip installing packages (defaults to: false)' | ||
}, { | ||
option: '--skip-git', | ||
doc: 'skip initializing a git repository (defaults to: false)' | ||
}, { | ||
option: '--commit-message-conventions', | ||
doc: 'add commit-msg hook to force use of the Google message conventions (defaults to: false)' | ||
}]; | ||
|
||
module.exports.name = 'new'; | ||
module.exports.options = options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const options = [{ | ||
option: '-v, --verbose', | ||
doc: 'verbose mode' | ||
}, { | ||
option: '--target [env]', | ||
doc: 'build the application with the targeted environment (defaults to: development)', | ||
default: 'development' | ||
}, { | ||
option: '--host [host]', | ||
doc: 'host to listen to (defaults to: localhost)', | ||
default: 'localhost' | ||
}, { | ||
option: '--port [port]', | ||
doc: 'the port to serve the application (defaults to: 8080)', | ||
default: '8080' | ||
}, { | ||
option: '--base-href [url]', | ||
doc: 'base url for the application being built (defaults to: /)', | ||
default: '/' | ||
}, { | ||
option: '--https', | ||
doc: 'flag to turn on HTTPS' | ||
}, { | ||
option: '--progress', | ||
doc: 'display a compilation progress (defaults to: false)' | ||
}, { | ||
option: '--api [db]', | ||
doc: 'enable the mock API on the specified database JSON file (defaults to: db.json)' | ||
}, { | ||
option: '--api-custom-routes [config]', | ||
doc: 'add custom Express routes (defaults to: api.conf.js)', | ||
default: 'api.conf.js' | ||
}, { | ||
option: '--proxy-config [config]', | ||
doc: 'proxy configuration file' | ||
}, { | ||
option: '--merge-config [config]', | ||
doc: 'merge the given webpack configuration with the existing one' | ||
}, { | ||
option: '--override-config [config]', | ||
doc: 'override the existing webpack configuration by the given one' | ||
}]; | ||
|
||
module.exports.name = 'serve'; | ||
module.exports.options = options; |
Oops, something went wrong.