MCPcopy Create free account
hub / github.com/GrapesJS/cli / createCommands

Function createCommands

src/cli.ts:44–148  ·  view source on GitHub ↗
(yargs)

Source from the content-addressed store, hash-verified

42}
43
44export const createCommands = (yargs) => {
45 return yargs
46 .command(['serve [port]', 'server'], 'Start the server', (yargs) => {
47 yargs
48 .positional('devServer', {
49 describe: 'webpack-dev-server options',
50 type: 'string',
51 default: '{}',
52 })
53 .positional('host', {
54 alias: 'h',
55 describe: 'Host to bind on',
56 type: 'string',
57 default: 'localhost',
58 })
59 .positional('port', {
60 alias: 'p',
61 describe: 'Port to bind on',
62 type: 'number',
63 default: 8080,
64 })
65 .positional('htmlWebpack', {
66 describe: 'html-webpack-plugin options',
67 type: 'string',
68 default: '{}',
69 })
70 webpackOptions(yargs);
71 }, (argv) => serve(argv))
72 .command('build', 'Build the source', (yargs) => {
73 yargs
74 .positional('stats', {
75 describe: 'Options for webpack Stats instance',
76 type: 'string',
77 default: '{}',
78 })
79 .positional('statsOutput', {
80 describe: 'Specify the path where to output webpack stats file (eg. "stats.json")',
81 type: 'string',
82 default: '',
83 })
84 .positional('patch', {
85 describe: 'Increase automatically the patch version',
86 type: 'boolean',
87 default: true,
88 })
89 .positional('localePath', {
90 describe: 'Path to the directory containing locale files',
91 type: 'string',
92 default: 'src/locale',
93 })
94 .positional('dts', {
95 describe: 'Generate typescript dts file ("include", "skip", "only")',
96 type: 'string',
97 default: 'include',
98 });
99 webpackOptions(yargs);
100 }, (argv) => build(argv))
101 .command('init', 'Init GrapesJS plugin project', (yargs) => {

Callers 1

argsToOptsFunction · 0.85

Calls 1

webpackOptionsFunction · 0.85

Tested by

no test coverage detected