Comparing version 0.12.0 to 0.13.0
@@ -37,3 +37,3 @@ var __defProp = Object.defineProperty; | ||
"@types/node": "^16.11.6", | ||
aocrunner: "^0.12.0", | ||
aocrunner: "^0.13.0", | ||
prettier: "^2.4.1" | ||
@@ -40,0 +40,0 @@ }, |
import prompts from "prompts"; | ||
import { execSync } from "child_process"; | ||
import kleur from "kleur"; | ||
const onCancel = () => { | ||
console.log(kleur.yellow("Aborting!")); | ||
process.exit(1); | ||
}; | ||
const initPrompt = () => { | ||
@@ -69,3 +74,3 @@ const firstYear = 2015; | ||
} | ||
]); | ||
], { onCancel }); | ||
}; | ||
@@ -72,0 +77,0 @@ var initPrompt_default = initPrompt; |
{ | ||
"name": "aocrunner", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"description": "Advent of Code runner", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -21,3 +21,3 @@ import type { Setup } from "../types/common" | ||
"@types/node": "^16.11.6", | ||
aocrunner: "^0.12.0", | ||
aocrunner: "^0.13.0", | ||
prettier: "^2.4.1", | ||
@@ -24,0 +24,0 @@ }, |
import prompts from "prompts" | ||
import { execSync } from "child_process" | ||
import kleur from "kleur" | ||
const onCancel = () => { | ||
console.log(kleur.yellow("Aborting!")) | ||
process.exit(1) | ||
} | ||
const initPrompt = () => { | ||
@@ -19,62 +25,65 @@ const firstYear = 2015 | ||
return prompts([ | ||
{ | ||
type: "select", | ||
name: "year", | ||
message: "Year", | ||
choices: years.map((year) => ({ title: year, value: year })), | ||
initial: 0, | ||
}, | ||
{ | ||
type: "text", | ||
name: "name", | ||
message: "Directory name", | ||
initial: (prev) => `aoc${prev}`, | ||
}, | ||
{ | ||
type: "select", | ||
name: "language", | ||
message: "Language", | ||
choices: [ | ||
{ title: "JavaScript", value: "js" }, | ||
{ title: "TypeScript", value: "ts" }, | ||
], | ||
initial: 0, | ||
}, | ||
{ | ||
type: (prev) => (prev === "ts" ? "toggle" : null), | ||
name: "strict", | ||
message: "Strict mode", | ||
initial: true, | ||
active: "yes", | ||
inactive: "no", | ||
}, | ||
{ | ||
type: "toggle", | ||
name: "semicolons", | ||
message: "Semicolons", | ||
initial: true, | ||
active: "yes", | ||
inactive: "no", | ||
}, | ||
{ | ||
type: "text", | ||
name: "author", | ||
message: `Author`, | ||
initial: author, | ||
}, | ||
{ | ||
type: "select", | ||
name: "packageManager", | ||
message: "Package manager", | ||
choices: [ | ||
{ title: "NPM", value: "npm" }, | ||
{ title: "Yarn", value: "yarn" }, | ||
{ title: "pnpm", value: "pnpm" }, | ||
], | ||
initial: 0, | ||
}, | ||
]) | ||
return prompts( | ||
[ | ||
{ | ||
type: "select", | ||
name: "year", | ||
message: "Year", | ||
choices: years.map((year) => ({ title: year, value: year })), | ||
initial: 0, | ||
}, | ||
{ | ||
type: "text", | ||
name: "name", | ||
message: "Directory name", | ||
initial: (prev) => `aoc${prev}`, | ||
}, | ||
{ | ||
type: "select", | ||
name: "language", | ||
message: "Language", | ||
choices: [ | ||
{ title: "JavaScript", value: "js" }, | ||
{ title: "TypeScript", value: "ts" }, | ||
], | ||
initial: 0, | ||
}, | ||
{ | ||
type: (prev) => (prev === "ts" ? "toggle" : null), | ||
name: "strict", | ||
message: "Strict mode", | ||
initial: true, | ||
active: "yes", | ||
inactive: "no", | ||
}, | ||
{ | ||
type: "toggle", | ||
name: "semicolons", | ||
message: "Semicolons", | ||
initial: true, | ||
active: "yes", | ||
inactive: "no", | ||
}, | ||
{ | ||
type: "text", | ||
name: "author", | ||
message: `Author`, | ||
initial: author, | ||
}, | ||
{ | ||
type: "select", | ||
name: "packageManager", | ||
message: "Package manager", | ||
choices: [ | ||
{ title: "NPM", value: "npm" }, | ||
{ title: "Yarn", value: "yarn" }, | ||
{ title: "pnpm", value: "pnpm" }, | ||
], | ||
initial: 0, | ||
}, | ||
], | ||
{ onCancel }, | ||
) | ||
} | ||
export default initPrompt |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
95835
1896