@etohq/cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,470 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const fs_exists_cached_1 = require("fs-exists-cached");
7
+ // import { setTelemetryEnabled } from "@etohq/telemetry"
8
+ const path_1 = __importDefault(require("path"));
9
+ const resolve_cwd_1 = __importDefault(require("resolve-cwd"));
10
+ const new_1 = require("./commands/new");
11
+ const did_you_mean_1 = require("./did-you-mean");
12
+ const reporter_1 = __importDefault(require("./reporter"));
13
+ const yargs = require(`yargs`);
14
+ const handlerP = (fn) => (...args) => {
15
+ Promise.resolve(fn(...args)).then(() => process.exit(0), (err) => console.log(err));
16
+ };
17
+ function buildLocalCommands(cli, isLocalProject) {
18
+ const defaultPort = "9000";
19
+ const directory = path_1.default.resolve(`.`);
20
+ const projectInfo = { directory };
21
+ const useYarn = (0, fs_exists_cached_1.sync)(path_1.default.join(directory, `yarn.lock`));
22
+ if (isLocalProject) {
23
+ projectInfo["sitePackageJson"] = require(path_1.default.join(directory, `package.json`));
24
+ }
25
+ function resolveLocalCommand(command) {
26
+ if (!isLocalProject) {
27
+ cli.showHelp((s) => console.log(s));
28
+ }
29
+ try {
30
+ const cmdPath = resolve_cwd_1.default.silent(`@etohq/eto/commands/${command}`);
31
+ return require(cmdPath).default;
32
+ }
33
+ catch (err) {
34
+ console.error(err);
35
+ cli.showHelp((s) => console.error(s));
36
+ }
37
+ }
38
+ function getCommandHandler(command, handler) {
39
+ return (argv) => {
40
+ const localCmd = resolveLocalCommand(command);
41
+ const args = { ...argv, ...projectInfo, useYarn };
42
+ return handler ? handler(args, localCmd) : localCmd(args);
43
+ };
44
+ }
45
+ cli
46
+ .command({
47
+ command: `new [root] [starter]`,
48
+ builder: (_) => _.option(`seed`, {
49
+ type: `boolean`,
50
+ describe: `If flag is set the command will attempt to seed the database after setup.`,
51
+ default: false,
52
+ })
53
+ .option(`y`, {
54
+ type: `boolean`,
55
+ alias: "useDefaults",
56
+ describe: `If flag is set the command will not interactively collect database credentials`,
57
+ default: false,
58
+ })
59
+ .option(`skip-db`, {
60
+ type: `boolean`,
61
+ describe: `If flag is set the command will not attempt to complete database setup`,
62
+ default: false,
63
+ })
64
+ .option(`skip-migrations`, {
65
+ type: `boolean`,
66
+ describe: `If flag is set the command will not attempt to complete database migration`,
67
+ default: false,
68
+ })
69
+ .option(`skip-env`, {
70
+ type: `boolean`,
71
+ describe: `If flag is set the command will not attempt to populate .env`,
72
+ default: false,
73
+ })
74
+ .option(`db-user`, {
75
+ type: `string`,
76
+ describe: `The database user to use for database setup and migrations.`,
77
+ })
78
+ .option(`db-database`, {
79
+ type: `string`,
80
+ describe: `The database use for database setup and migrations.`,
81
+ })
82
+ .option(`db-pass`, {
83
+ type: `string`,
84
+ describe: `The database password to use for database setup and migrations.`,
85
+ })
86
+ .option(`db-port`, {
87
+ type: `number`,
88
+ describe: `The database port to use for database setup and migrations.`,
89
+ })
90
+ .option(`db-host`, {
91
+ type: `string`,
92
+ describe: `The database host to use for database setup and migrations.`,
93
+ })
94
+ .option(`v2`, {
95
+ type: `boolean`,
96
+ describe: `Install Eto with the V2 feature flag enabled. WARNING: Eto V2 is still in development and shouldn't be used in production.`,
97
+ default: false,
98
+ })
99
+ .option(`branch`, {
100
+ type: `string`,
101
+ describe: `The branch of the git repository to clone.`,
102
+ }),
103
+ desc: `Create a new Eto project.`,
104
+ handler: handlerP(new_1.newStarter),
105
+ })
106
+ .command({
107
+ command: "db:setup",
108
+ desc: "Create the database, run migrations and sync links",
109
+ builder: (builder) => {
110
+ builder.option("db", {
111
+ type: "string",
112
+ describe: "Specify the name of the database you want to create",
113
+ });
114
+ builder.option("interactive", {
115
+ type: "boolean",
116
+ default: true,
117
+ describe: "Display prompts. Use --no-interactive flag to run the command without prompts",
118
+ });
119
+ builder.option("skip-links", {
120
+ type: "boolean",
121
+ describe: "Do not sync links",
122
+ });
123
+ builder.option("execute-all-links", {
124
+ type: "boolean",
125
+ describe: "Skip prompts and execute all (including unsafe) actions from sync links",
126
+ });
127
+ builder.option("execute-safe-links", {
128
+ type: "boolean",
129
+ describe: "Skip prompts and execute only safe actions from sync links",
130
+ });
131
+ },
132
+ handler: handlerP(getCommandHandler("db/setup", (args, cmd) => {
133
+ process.env.NODE_ENV = process.env.NODE_ENV || `development`;
134
+ return cmd(args);
135
+ })),
136
+ })
137
+ .command({
138
+ command: "db:create",
139
+ desc: "Create the database used by your application",
140
+ builder: (builder) => {
141
+ builder.option("db", {
142
+ type: "string",
143
+ describe: "Specify the name of the database you want to create",
144
+ });
145
+ builder.option("interactive", {
146
+ type: "boolean",
147
+ default: true,
148
+ describe: "Display prompts. Use --no-interactive flag to run the command without prompts",
149
+ });
150
+ },
151
+ handler: handlerP(getCommandHandler("db/create", (args, cmd) => {
152
+ process.env.NODE_ENV = process.env.NODE_ENV || `development`;
153
+ return cmd(args);
154
+ })),
155
+ })
156
+ .command({
157
+ command: "db:migrate",
158
+ desc: "Migrate the database by executing pending migrations",
159
+ builder: (builder) => {
160
+ builder.option("skip-links", {
161
+ type: "boolean",
162
+ describe: "Do not sync links",
163
+ });
164
+ builder.option("execute-all-links", {
165
+ type: "boolean",
166
+ describe: "Skip prompts and execute all (including unsafe) actions from sync links",
167
+ });
168
+ builder.option("execute-safe-links", {
169
+ type: "boolean",
170
+ describe: "Skip prompts and execute only safe actions from sync links",
171
+ });
172
+ },
173
+ handler: handlerP(getCommandHandler("db/migrate", (args, cmd) => {
174
+ process.env.NODE_ENV = process.env.NODE_ENV || `development`;
175
+ return cmd(args);
176
+ })),
177
+ })
178
+ .command({
179
+ command: "db:rollback [modules...]",
180
+ desc: "Rollback last batch of executed migrations for a given module",
181
+ builder: {
182
+ modules: {
183
+ type: "array",
184
+ description: "Modules for which to rollback migrations",
185
+ demand: true,
186
+ },
187
+ },
188
+ handler: handlerP(getCommandHandler("db/rollback", (args, cmd) => {
189
+ process.env.NODE_ENV = process.env.NODE_ENV || `development`;
190
+ return cmd(args);
191
+ })),
192
+ })
193
+ .command({
194
+ command: "db:generate [modules...]",
195
+ desc: "Generate migrations for a given module",
196
+ builder: {
197
+ modules: {
198
+ type: "array",
199
+ description: "Modules for which to generate migration files",
200
+ demand: true,
201
+ },
202
+ },
203
+ handler: handlerP(getCommandHandler("db/generate", (args, cmd) => {
204
+ process.env.NODE_ENV = process.env.NODE_ENV || `development`;
205
+ return cmd(args);
206
+ })),
207
+ })
208
+ .command({
209
+ command: "db:sync-links",
210
+ desc: "Sync database schema with the links defined by your application and Eto core",
211
+ builder: (builder) => {
212
+ builder.option("execute-all", {
213
+ type: "boolean",
214
+ describe: "Skip prompts and execute all (including unsafe) actions",
215
+ });
216
+ builder.option("execute-safe", {
217
+ type: "boolean",
218
+ describe: "Skip prompts and execute only safe actions",
219
+ });
220
+ },
221
+ handler: handlerP(getCommandHandler("db/sync-links", (args, cmd) => {
222
+ process.env.NODE_ENV = process.env.NODE_ENV || `development`;
223
+ return cmd(args);
224
+ })),
225
+ })
226
+ .command({
227
+ command: `telemetry`,
228
+ describe: `Enable or disable collection of anonymous usage data.`,
229
+ builder: (yargs) => yargs
230
+ .option(`enable`, {
231
+ type: `boolean`,
232
+ description: `Enable telemetry (default)`,
233
+ })
234
+ .option(`disable`, {
235
+ type: `boolean`,
236
+ description: `Disable telemetry`,
237
+ }),
238
+ handler: handlerP(({ enable, disable }) => {
239
+ const enabled = Boolean(enable) || !disable;
240
+ // setTelemetryEnabled(enabled)
241
+ reporter_1.default.info(`Telemetry collection ${enabled ? `enabled` : `disabled`}`);
242
+ }),
243
+ })
244
+ .command({
245
+ command: `develop`,
246
+ desc: `Start development server. Watches file and rebuilds when something changes`,
247
+ builder: (_) => _.option("types", {
248
+ type: "boolean",
249
+ default: true,
250
+ describe: "Generate automated types for modules inside the .eto directory",
251
+ })
252
+ .option(`H`, {
253
+ alias: `host`,
254
+ type: `string`,
255
+ default: process.env.HOST,
256
+ describe: process.env.HOST
257
+ ? `Set host. Defaults to ${process.env.HOST} (set by env.HOST)`
258
+ : "",
259
+ })
260
+ .option(`p`, {
261
+ alias: `port`,
262
+ type: `string`,
263
+ default: process.env.PORT || defaultPort,
264
+ describe: process.env.PORT
265
+ ? `Set port. Defaults to ${process.env.PORT} (set by env.PORT) (otherwise defaults ${defaultPort})`
266
+ : `Set port. Defaults to ${defaultPort}`,
267
+ }),
268
+ handler: handlerP(getCommandHandler(`develop`, (args, cmd) => {
269
+ process.env.NODE_ENV = process.env.NODE_ENV || `development`;
270
+ cmd(args);
271
+ // Return an empty promise to prevent handlerP from exiting early.
272
+ // The development server shouldn't ever exit until the user directly
273
+ // kills it so this is fine.
274
+ return new Promise((resolve) => { });
275
+ })),
276
+ })
277
+ .command({
278
+ command: `start`,
279
+ desc: `Start production server.`,
280
+ builder: (_) => _.option("types", {
281
+ type: "boolean",
282
+ default: false,
283
+ describe: "Generate automated types for modules inside the .eto directory",
284
+ })
285
+ .option(`H`, {
286
+ alias: `host`,
287
+ type: `string`,
288
+ default: process.env.HOST,
289
+ describe: process.env.HOST
290
+ ? `Set host. Defaults to ${process.env.HOST} (set by env.HOST)`
291
+ : ``,
292
+ })
293
+ .option(`p`, {
294
+ alias: `port`,
295
+ type: `string`,
296
+ default: process.env.PORT || defaultPort,
297
+ describe: process.env.PORT
298
+ ? `Set port. Defaults to ${process.env.PORT} (set by env.PORT) (otherwise defaults ${defaultPort})`
299
+ : `Set port. Defaults to ${defaultPort}`,
300
+ })
301
+ .option(`cluster`, {
302
+ type: `number`,
303
+ describe: "Start the Node.js server in cluster mode. You can specify the number of cpus to use, which defaults to (env.CPUS)",
304
+ }),
305
+ handler: handlerP(getCommandHandler(`start`, (args, cmd) => {
306
+ process.env.NODE_ENV = process.env.NODE_ENV || `development`;
307
+ cmd(args);
308
+ // Return an empty promise to prevent handlerP from exiting early.
309
+ // The development server shouldn't ever exit until the user directly
310
+ // kills it so this is fine.
311
+ return new Promise((resolve) => { });
312
+ })),
313
+ })
314
+ .command({
315
+ command: "build",
316
+ desc: "Build your project.",
317
+ builder: (_) => _.option("admin-only", {
318
+ default: false,
319
+ type: "boolean",
320
+ describe: "Only build the admin to serve it separately (outDir .eto/admin)",
321
+ }),
322
+ handler: handlerP(getCommandHandler(`build`, (args, cmd) => {
323
+ process.env.NODE_ENV = process.env.NODE_ENV || `development`;
324
+ cmd(args);
325
+ return new Promise((resolve) => { });
326
+ })),
327
+ })
328
+ .command({
329
+ command: `user`,
330
+ desc: `Create a user`,
331
+ builder: (_) => _.option(`e`, {
332
+ alias: `email`,
333
+ type: `string`,
334
+ describe: `User's email.`,
335
+ })
336
+ .option(`p`, {
337
+ alias: `password`,
338
+ type: `string`,
339
+ describe: `User's password.`,
340
+ })
341
+ .option(`i`, {
342
+ alias: `id`,
343
+ type: `string`,
344
+ describe: `User's id.`,
345
+ })
346
+ .option(`invite`, {
347
+ type: `boolean`,
348
+ describe: `If flag is set, an invitation will be created instead of a new user and the invite token will be returned.`,
349
+ default: false,
350
+ }),
351
+ handler: handlerP(getCommandHandler(`user`, (args, cmd) => {
352
+ cmd(args);
353
+ // Return an empty promise to prevent handlerP from exiting early.
354
+ // The development server shouldn't ever exit until the user directly
355
+ // kills it so this is fine.
356
+ return new Promise((resolve) => { });
357
+ })),
358
+ })
359
+ .command({
360
+ command: `exec [file] [args..]`,
361
+ desc: `Run a function defined in a file.`,
362
+ handler: handlerP(getCommandHandler(`exec`, (args, cmd) => {
363
+ cmd(args);
364
+ // Return an empty promise to prevent handlerP from exiting early.
365
+ // The development server shouldn't ever exit until the user directly
366
+ // kills it so this is fine.
367
+ return new Promise((resolve) => { });
368
+ })),
369
+ });
370
+ }
371
+ function isLocalEtoProject() {
372
+ let inEtoProject = false;
373
+ try {
374
+ const { dependencies, devDependencies } = require(path_1.default.resolve(`./package.json`));
375
+ inEtoProject = !!((dependencies && dependencies["@etohq/eto"]) ||
376
+ (devDependencies && devDependencies["@etohq/eto"]));
377
+ }
378
+ catch (err) {
379
+ // ignore
380
+ }
381
+ return inEtoProject;
382
+ }
383
+ function getVersionInfo() {
384
+ const { version } = require(`../package.json`);
385
+ const isEtoProject = isLocalEtoProject();
386
+ if (isEtoProject) {
387
+ let etoVersion = "";
388
+ try {
389
+ etoVersion = require(path_1.default.join(process.cwd(), `node_modules`, `@etohq/eto`, `package.json`)).version;
390
+ }
391
+ catch (e) {
392
+ /* noop */
393
+ }
394
+ if (!etoVersion) {
395
+ etoVersion = `unknown`;
396
+ }
397
+ return `Eto CLI version: ${version}
398
+ Eto version: ${etoVersion}
399
+ Note: this is the Eto version for the site at: ${process.cwd()}`;
400
+ }
401
+ else {
402
+ return `Eto CLI version: ${version}`;
403
+ }
404
+ }
405
+ exports.default = (argv) => {
406
+ const cli = yargs();
407
+ const isLocalProject = isLocalEtoProject();
408
+ cli
409
+ .scriptName(`eto`)
410
+ .usage(`Usage: $0 <command> [options]`)
411
+ .alias(`h`, `help`)
412
+ .alias(`v`, `version`)
413
+ .option(`verbose`, {
414
+ default: false,
415
+ type: `boolean`,
416
+ describe: `Turn on verbose output`,
417
+ global: true,
418
+ })
419
+ .option(`no-color`, {
420
+ alias: `no-colors`,
421
+ default: false,
422
+ type: `boolean`,
423
+ describe: `Turn off the color in output`,
424
+ global: true,
425
+ })
426
+ .option(`json`, {
427
+ describe: `Turn on the JSON logger`,
428
+ default: false,
429
+ type: `boolean`,
430
+ global: true,
431
+ });
432
+ buildLocalCommands(cli, isLocalProject);
433
+ try {
434
+ cli.version(`version`, `Show the version of the Eto CLI and the Eto package in the current project`, getVersionInfo());
435
+ }
436
+ catch (e) {
437
+ // ignore
438
+ }
439
+ return cli
440
+ .wrap(cli.terminalWidth())
441
+ .demandCommand(1, `Pass --help to see all available commands and options.`)
442
+ .strict()
443
+ .fail((msg, err, yargs) => {
444
+ const availableCommands = yargs
445
+ .getCommands()
446
+ .map((commandDescription) => {
447
+ const [command] = commandDescription;
448
+ return command.split(` `)[0];
449
+ });
450
+ const arg = argv.slice(2)[0];
451
+ const suggestion = arg ? (0, did_you_mean_1.didYouMean)(arg, availableCommands) : ``;
452
+ if (msg) {
453
+ reporter_1.default.error(msg);
454
+ console.log();
455
+ }
456
+ if (suggestion) {
457
+ reporter_1.default.info(suggestion);
458
+ console.log();
459
+ }
460
+ if (err) {
461
+ console.error("--------------- ERROR ---------------------");
462
+ console.error(err);
463
+ console.error("-------------------------------------------");
464
+ }
465
+ cli.showHelp((s) => console.error(s));
466
+ process.exit(1);
467
+ })
468
+ .parse(argv.slice(2));
469
+ };
470
+ //# sourceMappingURL=create-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-cli.js","sourceRoot":"","sources":["../src/create-cli.ts"],"names":[],"mappings":";;;;;AAAA,uDAAqD;AACrD,yDAAyD;AACzD,gDAAuB;AACvB,8DAAoC;AACpC,wCAA2C;AAC3C,iDAA2C;AAC3C,0DAAiC;AAEjC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAE9B,MAAM,QAAQ,GACZ,CAAC,EAAE,EAAE,EAAE,CACP,CAAC,GAAG,IAAI,EAAE,EAAE;IACV,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAC/B,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EACrB,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAC1B,CAAA;AACH,CAAC,CAAA;AAEH,SAAS,kBAAkB,CAAC,GAAG,EAAE,cAAc;IAC7C,MAAM,WAAW,GAAG,MAAM,CAAA;IAC1B,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAEnC,MAAM,WAAW,GAAG,EAAE,SAAS,EAAE,CAAA;IACjC,MAAM,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0,0 +1,2 @@
1
+ export declare function didYouMean(scmd: any, commands: any): string;
2
+ //# sourceMappingURL=did-you-mean.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"did-you-mean.d.ts","sourceRoot":"","sources":["../src/did-you-mean.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,CAAC,IAAI,KAAA,EAAE,QAAQ,KAAA,GAAG,MAAM,CAejD"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.didYouMean = didYouMean;
7
+ const meant_1 = __importDefault(require("meant"));
8
+ function didYouMean(scmd, commands) {
9
+ const bestSimilarity = (0, meant_1.default)(scmd, commands).map((str) => {
10
+ return ` ${str}`;
11
+ });
12
+ if (bestSimilarity.length === 0)
13
+ return ``;
14
+ if (bestSimilarity.length === 1) {
15
+ return `\nDid you mean this?\n ${bestSimilarity[0]}\n`;
16
+ }
17
+ else {
18
+ return ([`\nDid you mean one of these?`]
19
+ .concat(bestSimilarity.slice(0, 3))
20
+ .join(`\n`) + `\n`);
21
+ }
22
+ }
23
+ //# sourceMappingURL=did-you-mean.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"did-you-mean.js","sourceRoot":"","sources":["../src/did-you-mean.ts"],"names":[],"mappings":";;;;;AAEA,gCAeC;AAjBD,kDAAyB;AAEzB,SAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ;IACvC,MAAM,cAAc,GAAG,IAAA,eAAK,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACvD,OAAO,OAAO,GAAG,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAC1C,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,0BAA0B,cAAc,CAAC,CAAC,CAAC,IAAI,CAAA;IACxD,CAAC;SAAM,CAAC;QACN,OAAO,CACL,CAAC,8BAA8B,CAAC;aAC7B,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aAClC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CACrB,CAAA;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const os_1 = __importDefault(require("os"));
8
+ const util_1 = __importDefault(require("util"));
9
+ const create_cli_1 = __importDefault(require("./create-cli"));
10
+ const useJsonLogger = process.argv.slice(2).some((arg) => arg.includes(`json`));
11
+ if (useJsonLogger) {
12
+ process.env.GATSBY_LOGGER = `json`;
13
+ }
14
+ // Ensure stable runs on Windows when started from different shells (i.e. c:\dir vs C:\dir)
15
+ if (os_1.default.platform() === `win32`) {
16
+ // ensureWindowsDriveLetterIsUppercase()
17
+ }
18
+ process.on(`unhandledRejection`, (reason) => {
19
+ // This will exit the process in newer Node anyway so lets be consistent
20
+ // across versions and crash
21
+ // reason can be anything, it can be a message, an object, ANYTHING!
22
+ // we convert it to an error object, so we don't crash on structured error validation
23
+ if (!(reason instanceof Error)) {
24
+ reason = new Error(util_1.default.format(reason));
25
+ }
26
+ console.log(reason);
27
+ // report.panic(`UNHANDLED REJECTION`, reason as Error)
28
+ });
29
+ process.on(`uncaughtException`, (error) => {
30
+ console.log(error);
31
+ // report.panic(`UNHANDLED EXCEPTION`, error)
32
+ });
33
+ (0, create_cli_1.default)(process.argv);
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,4CAAmB;AACnB,gDAAuB;AACvB,8DAAoC;AAEpC,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;AAE/E,IAAI,aAAa,EAAE,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,MAAM,CAAA;AACpC,CAAC;AAED,2FAA2F;AAC3F,IAAI,YAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,EAAE,CAAC;IAC9B,wCAAwC;AAC1C,CAAC;AAED,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE;IAC1C,wEAAwE;IACxE,4BAA4B;IAE5B,oEAAoE;IACpE,qFAAqF;IACrF,IAAI,CAAC,CAAC,MAAM,YAAY,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,GAAG,IAAI,KAAK,CAAC,cAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;IACzC,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACnB,uDAAuD;AACzD,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;IACxC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAClB,6CAA6C;AAC/C,CAAC,CAAC,CAAA;AAEF,IAAA,oBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,CAAA"}