1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

switch to webpack

This commit is contained in:
Kyle Spearrin
2018-05-14 23:16:59 -04:00
parent 55ebf3ac64
commit ec049edfdf
9 changed files with 4319 additions and 58 deletions

View File

@@ -1,6 +0,0 @@
#!/usr/bin/env node
require('tsconfig-paths').register();
require('ts-node').register();
const main = require('./main.ts');
new main.Main().run();

View File

@@ -57,7 +57,7 @@ export class Main {
program: Program;
constructor() {
this.i18nService = new I18nService('en', '../locales');
this.i18nService = new I18nService('en', './locales');
this.platformUtilsService = new NodePlatformUtilsService();
this.cryptoFunctionService = new NodeCryptoFunctionService();
this.storageService = new NodeStorageService('Bitwarden CLI');
@@ -89,6 +89,11 @@ export class Main {
this.program = new Program(this);
}
async run() {
await this.init();
this.program.run();
}
private async init() {
this.containerService.attachToWindow(global);
await this.environmentService.setUrlsFromStorage();
@@ -96,13 +101,7 @@ export class Main {
await this.i18nService.init(locale);
await this.authService.init();
}
async run() {
await this.init();
this.program.run();
}
}
if (process.env.NODE_ENV === 'debug') {
new Main().run();
}
const main = new Main();
main.run();

View File

@@ -1,13 +1,13 @@
import * as program from 'commander';
import { Main } from './bw';
import { DeleteCommand } from './commands/delete.command';
import { GetCommand } from './commands/get.command';
import { ListCommand } from './commands/list.command';
import { LoginCommand } from './commands/login.command';
import { SyncCommand } from './commands/sync.command';
import { Main } from './main';
import { Response } from './models/response';
import { CreateCommand } from './commands/create.command';
import { EncodeCommand } from './commands/encode.command';

View File

@@ -13,7 +13,7 @@ export class I18nService extends BaseI18nService {
});
this.supportedTranslationLocales = [
'en'
'en',
];
}
}