1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', {
|
4 | value: true
|
5 | });
|
6 |
|
7 | const debug = require('debug');
|
8 |
|
9 | const core = require('@beemo/core');
|
10 |
|
11 | const cli = require('@boost/cli');
|
12 |
|
13 | const parseSpecialArgv = require('./parseSpecialArgv.js');
|
14 |
|
15 | const _interopDefault = e => e && e.__esModule ? e : {
|
16 | default: e
|
17 | };
|
18 |
|
19 | const debug__default = _interopDefault(debug);
|
20 |
|
21 |
|
22 |
|
23 | const brandName = process.env.BEEMO_BRAND_NAME || 'Beemo';
|
24 | const binName = process.env.BEEMO_BRAND_BINARY || 'beemo';
|
25 | const manualURL = process.env.BEEMO_MANUAL_URL || 'https://beemo.dev';
|
26 | process.env.BOOSTJS_DEBUG_NAMESPACE = binName;
|
27 |
|
28 | if (process.env.TIMING) {
|
29 | require('time-require');
|
30 |
|
31 |
|
32 | } else if (process.argv.includes('--debug')) {
|
33 | debug__default.default.enable(`${binName}:*`);
|
34 | }
|
35 |
|
36 | const _parseSpecialArgv$par = parseSpecialArgv.parseSpecialArgv(process.argv.slice(2)),
|
37 | argv = _parseSpecialArgv$par.argv,
|
38 | parallelArgv = _parseSpecialArgv$par.parallelArgv;
|
39 |
|
40 | const tool = new core.Tool({
|
41 | argv,
|
42 | projectName: binName
|
43 | });
|
44 |
|
45 | const _require = require('@beemo/core/package.json'),
|
46 | version = _require.version;
|
47 |
|
48 | const footer = cli.applyStyle([tool.msg('app:cliEpilogue', {
|
49 | manualURL
|
50 | }), tool.msg('app:poweredBy', {
|
51 | version
|
52 | })].join('\n'), 'muted');
|
53 | const program = new cli.Program({
|
54 | bin: binName,
|
55 | footer,
|
56 | name: brandName,
|
57 | version
|
58 | });
|
59 | exports.argv = argv;
|
60 | exports.parallelArgv = parallelArgv;
|
61 | exports.program = program;
|
62 | exports.tool = tool;
|
63 |
|