This commit is contained in:
2020-04-23 17:51:19 +02:00
parent fee3f55300
commit 8bc26b384e
3 changed files with 17 additions and 6 deletions

View File

@ -6,7 +6,7 @@
*/
import path from 'path';
import { Input } from 'enquirer';
import { Input, Confirm } from 'enquirer';
import { Snippet } from '../../Snippet';
import { apply_template, modify_json, run_command } from '../../Helper';
@ -19,7 +19,7 @@ export default class Node implements Snippet {
)
.run ();
const use_ts = await new confirm ({
const use_ts = await new Confirm ({
message: 'use typescript?',
initial: false
})
@ -50,7 +50,7 @@ export default class Node implements Snippet {
test: 'nyc ava'
};
if (use_ts)
obj.scripts.compile = 'tsc';
(obj.scripts as Record<string, unknown>).compile = 'tsc';
return obj;
}, path.join (folder, 'package.json'));
}