diff --git a/packages/frint-cli/src/bin/frint.ts b/packages/frint-cli/src/bin/frint.ts index 91b8d931..d0a0f1ba 100644 --- a/packages/frint-cli/src/bin/frint.ts +++ b/packages/frint-cli/src/bin/frint.ts @@ -66,7 +66,7 @@ function run() { return console.log('Command not available.'); } - return commandApp.get('execute')(); + return (commandApp.get('execute') as FrintCliProvider)(); } run(); diff --git a/packages/frint-cli/src/commands/help.spec.ts b/packages/frint-cli/src/commands/help.spec.ts index a19a1fc7..ae00cfe2 100644 --- a/packages/frint-cli/src/commands/help.spec.ts +++ b/packages/frint-cli/src/commands/help.spec.ts @@ -22,7 +22,7 @@ describe('frint-cli › commands › help', () => { const commandApp = rootApp.getAppInstance('help'); const fakeConsole = rootApp.get('console'); - commandApp.get('execute')(); + commandApp.get('execute')(); expect(fakeConsole.errors.length).to.equal(1); expect(fakeConsole.errors[0]).to.contain('Must provide a command name'); @@ -50,7 +50,7 @@ describe('frint-cli › commands › help', () => { const commandApp = rootApp.getAppInstance('help'); const fakeConsole = rootApp.get('console'); - commandApp.get('execute')(); + commandApp.get('execute')(); expect(fakeConsole.logs.length).to.equal(1); }); diff --git a/packages/frint-cli/src/commands/version.spec.ts b/packages/frint-cli/src/commands/version.spec.ts index a6175383..365e6877 100644 --- a/packages/frint-cli/src/commands/version.spec.ts +++ b/packages/frint-cli/src/commands/version.spec.ts @@ -39,7 +39,7 @@ describe('frint-cli › commands › version', () => { '{"version": "1.2.3"}' ); - commandApp.get('execute')(); + commandApp.get('execute')(); expect(fakeConsole.logs.length).to.equal(1); expect(fakeConsole.logs[0]).to.contain('v1.2.3'); diff --git a/packages/frint-di/index.d.ts b/packages/frint-di/index.d.ts index 7fe27851..241bfa31 100644 --- a/packages/frint-di/index.d.ts +++ b/packages/frint-di/index.d.ts @@ -13,7 +13,7 @@ export interface Provider { export interface Container { getDeps(container: Provider): any; register(container: Provider): any; - get(name: string): T; + get(name: string): any; } export interface ContainerOptions { @@ -24,6 +24,6 @@ export interface Constructor { new(): T; } -export function createContainer(providers: Provider[], options: ContainerOptions): Constructor; +export function createContainer(providers: Provider[], options?: ContainerOptions): Constructor; export function resolveContainer(Container: Constructor): T; diff --git a/packages/frint/src/App.ts b/packages/frint/src/App.ts index b76fe7ce..938c8fb1 100644 --- a/packages/frint/src/App.ts +++ b/packages/frint/src/App.ts @@ -193,8 +193,8 @@ export class App { }); } - public get(providerName) { - const value = this.container.get(providerName); + public get(providerName) { + const value = this.container.get(providerName); if (typeof value !== 'undefined') { return value;