Last active
February 28, 2020 16:31
-
-
Save jacksteamdev/37175dd3fd80cce8553a025d8d656961 to your computer and use it in GitHub Desktop.
PlopJS when and transform TS usage examples
This file contains hidden or 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
import { AddActionConfig, AddManyActionConfig, ModifyActionConfig, PlopGenerator } from './index'; | |
export const gen: PlopGenerator = { | |
description: 'asfd', | |
prompts: [], | |
actions: [ | |
{ | |
type: 'add', | |
path: 'asfd', | |
template: 'asfd', | |
when(): string | void { | |
return 'abc'; | |
}, | |
transform(): string { | |
return 'abc'; | |
} | |
}, | |
{ | |
type: 'addMany', | |
destination: 'abc', | |
base: 'abc', | |
templateFiles: 'abc', | |
globOptions: 'abc', | |
path: 'abc', | |
when(): string | void { | |
return 'abc'; | |
}, | |
transform(): string { | |
return 'abc'; | |
} | |
}, | |
{ | |
type: 'modify', | |
path: 'abc', | |
pattern: 'abc', | |
template: 'abc', | |
templateFile: 'abc' | |
}, | |
{ | |
type: 'modify', | |
path: 'abc', | |
pattern: 'abc', | |
template: 'abc', | |
templateFile: 'abc', | |
transform(): string { | |
return 'abc'; | |
} | |
}, | |
{ | |
type: 'modify', | |
path: 'abc', | |
transform(): string { | |
return 'abc'; | |
} | |
} | |
] as [ | |
AddActionConfig, | |
AddManyActionConfig, | |
ModifyActionConfig, | |
ModifyActionConfig, | |
ModifyActionConfig | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment