forked from nestjs/nest-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REFACTORING-2 : add asset replacer into generate process strategy
- Loading branch information
thomrick
committed
Sep 7, 2017
1 parent
48c1bb5
commit 9388bb0
Showing
1 changed file
with
4 additions
and
3 deletions.
There are no files selected for viewing
7 changes: 4 additions & 3 deletions
7
src/new-core/process-strategies/impl/generate.process-strategy.ts
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,19 +1,20 @@ | ||
import {Asset} from '../../assets/impl/asset'; | ||
import {ExtensionType} from '../../extensions/extension.type'; | ||
import {AssetReplacer} from '../../replacers/impl/asset.replacer'; | ||
import {ImplementationTemplateLoader} from '../../template-loaders/impl/implementation.template-loader'; | ||
import {IProcessInputs, IProcessStrategy} from '../process-strategy.interface'; | ||
|
||
export class GenerateProcessStrategy implements IProcessStrategy { | ||
constructor() {} | ||
|
||
public async process(inputs?: IProcessInputs): Promise<void> { | ||
public async process(inputs: IProcessInputs): Promise<void> { | ||
const asset: Asset = new Asset( | ||
inputs.arguments.assetType, | ||
ExtensionType.TYPESCRIPT, | ||
inputs.arguments.assetName, | ||
inputs.arguments.moduleName, | ||
); | ||
await new ImplementationTemplateLoader(asset).load(); | ||
const content: string = await new ImplementationTemplateLoader(asset).load(); | ||
const replacedContent: string = new AssetReplacer(asset).replace(content); | ||
} | ||
|
||
} |