-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
219 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,27 @@ | ||
import { GenericAngularEnv, getWorkspace, NG_APP_NAME } from '@bitdev/angular.dev-services.common'; | ||
import { NG_APP_NAME } from '@bitdev/angular.dev-services.common'; | ||
import { Application, ApplicationType } from '@teambit/application'; | ||
import { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver'; | ||
import { EnvContext, EnvHandler } from '@teambit/envs'; | ||
import { Logger } from '@teambit/logger'; | ||
import { Workspace } from '@teambit/workspace'; | ||
import { EnvHandler } from '@teambit/envs'; | ||
import { AngularAppOptions } from './angular-app-options'; | ||
import { AngularApp } from './angular.application'; | ||
|
||
interface AngularAppTypeOptions { | ||
name?: string; | ||
angularEnv: GenericAngularEnv; | ||
} | ||
|
||
export class AngularAppType implements ApplicationType<AngularAppOptions> { | ||
constructor(readonly name: string, private angularEnv: GenericAngularEnv, private context: EnvContext, private depsResolver: DependencyResolverMain, private logger: Logger, private workspace?: Workspace) { | ||
} | ||
constructor(readonly name: string) {} | ||
|
||
createApp(options: AngularAppOptions): Application { | ||
return new AngularApp( | ||
this.angularEnv, | ||
this.context, | ||
options, | ||
this.depsResolver, | ||
this.logger, | ||
this.workspace | ||
); | ||
return new AngularApp({ | ||
...options, | ||
name: this.name | ||
}); | ||
} | ||
|
||
static from(options: AngularAppTypeOptions): EnvHandler<AngularAppType> { | ||
return (context: EnvContext) => { | ||
return () => { | ||
const name = options.name || NG_APP_NAME; | ||
const depsResolver = context.getAspect<DependencyResolverMain>(DependencyResolverAspect.id); | ||
const workspace = getWorkspace(context); | ||
const logger = context.createLogger(name); | ||
return new AngularAppType(name, options.angularEnv, context, depsResolver, logger, workspace); | ||
return new AngularAppType(name); | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.