Skip to content

Commit

Permalink
Merge pull request #38 from raxjs/feat-ssr-debug
Browse files Browse the repository at this point in the history
refactor: command register for debug ssr app
  • Loading branch information
Orange-C authored Oct 29, 2019
2 parents 6f23a33 + 0528078 commit 66bdef3
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 61 deletions.
17 changes: 0 additions & 17 deletions packages/rax-scripts/bin/rax-scripts-build.js

This file was deleted.

10 changes: 0 additions & 10 deletions packages/rax-scripts/bin/rax-scripts-lint.js

This file was deleted.

17 changes: 0 additions & 17 deletions packages/rax-scripts/bin/rax-scripts-start.js

This file was deleted.

10 changes: 0 additions & 10 deletions packages/rax-scripts/bin/rax-scripts-test.js

This file was deleted.

49 changes: 42 additions & 7 deletions packages/rax-scripts/bin/rax-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,48 @@


const program = require('commander');
const { dev, build } = require('scripts-core');
const packageInfo = require('../package.json');

program
.version(packageInfo.version)
.usage('<command> [options]')
.command('build', 'Build project in production mode')
.command('start', 'Start a web server in development mode (hot-reload and inline-module-source-map is enable default)')
.command('lint', 'Lint for source (only support component now)')
.command('test', 'Testing use jest(only support component now)')
.parse(process.argv);
.version(packageInfo.version);

program
.command('start')
.description('Start a web server in development mode (hot-reload and inline-module-source-map is enable default)')
.option('--config <config>', 'use custom config')
.action((options) => {
dev({
args: {
config: options.config,
},
});
});

program
.command('build')
.description('Build project in production mode')
.option('--config <config>', 'use custom config')
.action((options) => {
build({
args: {
config: options.config,
},
});
});

program
.command('lint')
.description('Lint for source (only support component now)')
.action(() => {
require('../src/lint')();
});

program
.command('test')
.description('Testing use jest(only support component now)')
.action(() => {
require('../src/jest')();
});

program.parse(process.argv);

0 comments on commit 66bdef3

Please sign in to comment.