add hygen template
This commit is contained in:
parent
ba9ebde241
commit
e89237b77c
15
2021/_templates/day/new/part1.pm.t
Normal file
15
2021/_templates/day/new/part1.pm.t
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
to: '<%= day %>/part1.pm'
|
||||||
|
---
|
||||||
|
package part1;
|
||||||
|
|
||||||
|
use 5.34.0;
|
||||||
|
use warnings;
|
||||||
|
use experimental 'signatures';
|
||||||
|
|
||||||
|
use List::AllUtils qw/ /;
|
||||||
|
|
||||||
|
sub solution() {
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
19
2021/_templates/day/new/part2.pm.t
Normal file
19
2021/_templates/day/new/part2.pm.t
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
to: '<%= day %>/part2.pm'
|
||||||
|
---
|
||||||
|
package part2;
|
||||||
|
|
||||||
|
use 5.20.0;
|
||||||
|
use warnings;
|
||||||
|
use experimental 'signatures';
|
||||||
|
|
||||||
|
use List::AllUtils qw/ /;
|
||||||
|
|
||||||
|
require './part1.pm';
|
||||||
|
|
||||||
|
use experimental qw/ signatures postderef /;
|
||||||
|
|
||||||
|
sub solution() {
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
7
2021/_templates/day/new/prompt.js
Normal file
7
2021/_templates/day/new/prompt.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
module.exports = [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
name: 'day',
|
||||||
|
message: "What day?"
|
||||||
|
}
|
||||||
|
]
|
20
2021/_templates/day/new/tests.t
Normal file
20
2021/_templates/day/new/tests.t
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
to: '<%= day %>/test.t'
|
||||||
|
---
|
||||||
|
use 5.34.0;
|
||||||
|
|
||||||
|
use Test2::V0;
|
||||||
|
use Path::Tiny;
|
||||||
|
|
||||||
|
require './part1.pm';
|
||||||
|
require './part2.pm';
|
||||||
|
|
||||||
|
subtest part1 => sub {
|
||||||
|
my $todo = todo 'TODO';
|
||||||
|
is part1::solution( ) => 'TODO';
|
||||||
|
};
|
||||||
|
|
||||||
|
subtest part2 => sub {
|
||||||
|
my $todo = todo 'TODO';
|
||||||
|
is part2::solution( ) => 'TODO';
|
||||||
|
};
|
5
2021/_templates/generator/help/index.ejs.t
Normal file
5
2021/_templates/generator/help/index.ejs.t
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
message: |
|
||||||
|
hygen {bold generator new} --name [NAME] --action [ACTION]
|
||||||
|
hygen {bold generator with-prompt} --name [NAME] --action [ACTION]
|
||||||
|
---
|
18
2021/_templates/generator/new/hello.ejs.t
Normal file
18
2021/_templates/generator/new/hello.ejs.t
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
to: _templates/<%= name %>/<%= action || 'new' %>/hello.ejs.t
|
||||||
|
---
|
||||||
|
---
|
||||||
|
to: app/hello.js
|
||||||
|
---
|
||||||
|
const hello = ```
|
||||||
|
Hello!
|
||||||
|
This is your first hygen template.
|
||||||
|
|
||||||
|
Learn what it can do here:
|
||||||
|
|
||||||
|
https://github.com/jondot/hygen
|
||||||
|
```
|
||||||
|
|
||||||
|
console.log(hello)
|
||||||
|
|
||||||
|
|
18
2021/_templates/generator/with-prompt/hello.ejs.t
Normal file
18
2021/_templates/generator/with-prompt/hello.ejs.t
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
to: _templates/<%= name %>/<%= action || 'new' %>/hello.ejs.t
|
||||||
|
---
|
||||||
|
---
|
||||||
|
to: app/hello.js
|
||||||
|
---
|
||||||
|
const hello = ```
|
||||||
|
Hello!
|
||||||
|
This is your first prompt based hygen template.
|
||||||
|
|
||||||
|
Learn what it can do here:
|
||||||
|
|
||||||
|
https://github.com/jondot/hygen
|
||||||
|
```
|
||||||
|
|
||||||
|
console.log(hello)
|
||||||
|
|
||||||
|
|
14
2021/_templates/generator/with-prompt/prompt.js
Normal file
14
2021/_templates/generator/with-prompt/prompt.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
to: _templates/<%= name %>/<%= action || 'new' %>/prompt.js
|
||||||
|
---
|
||||||
|
|
||||||
|
// see types of prompts:
|
||||||
|
// https://github.com/enquirer/enquirer/tree/master/examples
|
||||||
|
//
|
||||||
|
module.exports = [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
name: 'message',
|
||||||
|
message: "What's your message?"
|
||||||
|
}
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user