create-typescript-app 1.45.0 โ†’ 1.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,8 +13,8 @@
13
13
  <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/LICENSE.md" target="_blank"><img alt="License: MIT ๐Ÿ“" src="https://img.shields.io/badge/license-MIT_๐Ÿ“-21bb42.svg"></a>
14
14
  <a href="https://github.com/sponsors/JoshuaKGoldberg" target="_blank"><img alt="Sponsor: On GitHub ๐Ÿ’ธ" src="https://img.shields.io/badge/sponsor-on_github_๐Ÿ’ธ-21bb42.svg" /></a>
15
15
  <img alt="Style: Prettier ๐Ÿงน" src="https://img.shields.io/badge/style-prettier_๐Ÿงน-21bb42.svg" />
16
- <img alt="TypeScript: Strict ๐Ÿ’ช" src="https://img.shields.io/badge/typescript-strict_๐Ÿ’ช-21bb42.svg" />
17
- <img alt="npm package version" src="https://img.shields.io/npm/v/create-typescript-app?color=21bb42" />
16
+ <img alt="TypeScript: Strict ๐Ÿ’ช" src="https://img.shields.io/badge/typescript-strict_๐Ÿ’ช-21bb42.svg" />
17
+ <img alt="npm package version" src="https://img.shields.io/npm/v/create-typescript-app?color=21bb42" />
18
18
  </p>
19
19
 
20
20
  <img align="right" alt="Project logo: the TypeScript blue square with rounded corners, but a plus sign instead of 'TS'" src="./create-typescript-app.png">
package/lib/bin/index.js CHANGED
@@ -48,7 +48,10 @@ async function bin(args) {
48
48
  logLine();
49
49
  logLine(introWarnings[0]);
50
50
  logLine(introWarnings[1]);
51
- const { mode, options: promptedOptions } = await promptForMode(values.mode);
51
+ const { mode, options: promptedOptions } = await promptForMode(
52
+ !!values.auto,
53
+ values.mode
54
+ );
52
55
  if (typeof mode !== "string") {
53
56
  prompts.outro(chalk.red(mode?.message ?? operationMessage("cancelled")));
54
57
  return 1;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bin/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport { parseArgs } from \"node:util\";\nimport { fromZodError } from \"zod-validation-error\";\n\nimport { createRerunSuggestion } from \"../create/createRerunSuggestion.js\";\nimport { create } from \"../create/index.js\";\nimport { initialize } from \"../initialize/index.js\";\nimport { migrate } from \"../migrate/index.js\";\nimport { logLine } from \"../shared/cli/lines.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { logHelpText } from \"./help.js\";\nimport { getVersionFromPackageJson } from \"./packageJson.js\";\nimport { promptForMode } from \"./promptForMode.js\";\n\nconst operationMessage = (verb: string) =>\n\t`Operation ${verb}. Exiting - maybe another time? ๐Ÿ‘‹`;\n\nexport async function bin(args: string[]) {\n\tconsole.clear();\n\n\tconst version = await getVersionFromPackageJson();\n\n\tconst introPrompts = [\n\t\tchalk.greenBright(`โœจ Welcome to`),\n\t\tchalk.bgGreenBright.black(`create-typescript-app`),\n\t\tchalk.greenBright(`${version}! โœจ`),\n\t].join(\" \");\n\n\tconst introWarnings = [\n\t\tchalk.yellow(\n\t\t\t\"โš ๏ธ This template is early stage, opinionated, and not endorsed by the TypeScript team. โš ๏ธ\",\n\t\t),\n\t\tchalk.yellow(\n\t\t\t\"โš ๏ธ If any tooling it sets displeases you, you can always remove that portion manually. โš ๏ธ\",\n\t\t),\n\t];\n\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: {\n\t\t\thelp: {\n\t\t\t\tshort: \"h\",\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t\tmode: { type: \"string\" },\n\t\t},\n\t\tstrict: false,\n\t});\n\n\tconst help = values.help;\n\n\tif (help) {\n\t\tlogHelpText([introPrompts, ...introWarnings]);\n\t\treturn 0;\n\t}\n\n\tprompts.intro(introPrompts);\n\n\tlogLine();\n\tlogLine(introWarnings[0]);\n\tlogLine(introWarnings[1]);\n\n\tconst { mode, options: promptedOptions } = await promptForMode(values.mode);\n\tif (typeof mode !== \"string\") {\n\t\tprompts.outro(chalk.red(mode?.message ?? operationMessage(\"cancelled\")));\n\t\treturn 1;\n\t}\n\n\tconst runners = { create, initialize, migrate };\n\tconst { code, error, options } = await runners[mode](args, promptedOptions);\n\n\tprompts.log.info(\n\t\t[\n\t\t\tchalk.italic(`Tip: to run again with the same input values, use:`),\n\t\t\tchalk.blue(createRerunSuggestion(options)),\n\t\t].join(\" \"),\n\t);\n\n\tif (code) {\n\t\tlogLine();\n\n\t\tif (error) {\n\t\t\tlogLine(\n\t\t\t\tchalk.red(typeof error === \"string\" ? error : fromZodError(error)),\n\t\t\t);\n\t\t\tlogLine();\n\t\t}\n\n\t\tprompts.cancel(\n\t\t\tcode === StatusCodes.Cancelled\n\t\t\t\t? operationMessage(\"cancelled\")\n\t\t\t\t: operationMessage(\"failed\"),\n\t\t);\n\t}\n\n\treturn code;\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAE7B,SAAS,6BAA6B;AACtC,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,iCAAiC;AAC1C,SAAS,qBAAqB;AAE9B,MAAM,mBAAmB,CAAC,SACzB,aAAa,IAAI;AAElB,eAAsB,IAAI,MAAgB;AACzC,UAAQ,MAAM;AAEd,QAAM,UAAU,MAAM,0BAA0B;AAEhD,QAAM,eAAe;AAAA,IACpB,MAAM,YAAY,mBAAc;AAAA,IAChC,MAAM,cAAc,MAAM,uBAAuB;AAAA,IACjD,MAAM,YAAY,GAAG,OAAO,UAAK;AAAA,EAClC,EAAE,KAAK,GAAG;AAEV,QAAM,gBAAgB;AAAA,IACrB,MAAM;AAAA,MACL;AAAA,IACD;AAAA,IACA,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AAEA,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,MACR,MAAM;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACP;AAAA,MACA,MAAM,EAAE,MAAM,SAAS;AAAA,IACxB;AAAA,IACA,QAAQ;AAAA,EACT,CAAC;AAED,QAAM,OAAO,OAAO;AAEpB,MAAI,MAAM;AACT,gBAAY,CAAC,cAAc,GAAG,aAAa,CAAC;AAC5C,WAAO;AAAA,EACR;AAEA,UAAQ,MAAM,YAAY;AAE1B,UAAQ;AACR,UAAQ,cAAc,CAAC,CAAC;AACxB,UAAQ,cAAc,CAAC,CAAC;AAExB,QAAM,EAAE,MAAM,SAAS,gBAAgB,IAAI,MAAM,cAAc,OAAO,IAAI;AAC1E,MAAI,OAAO,SAAS,UAAU;AAC7B,YAAQ,MAAM,MAAM,IAAI,MAAM,WAAW,iBAAiB,WAAW,CAAC,CAAC;AACvE,WAAO;AAAA,EACR;AAEA,QAAM,UAAU,EAAE,QAAQ,YAAY,QAAQ;AAC9C,QAAM,EAAE,MAAM,OAAO,QAAQ,IAAI,MAAM,QAAQ,IAAI,EAAE,MAAM,eAAe;AAE1E,UAAQ,IAAI;AAAA,IACX;AAAA,MACC,MAAM,OAAO,oDAAoD;AAAA,MACjE,MAAM,KAAK,sBAAsB,OAAO,CAAC;AAAA,IAC1C,EAAE,KAAK,GAAG;AAAA,EACX;AAEA,MAAI,MAAM;AACT,YAAQ;AAER,QAAI,OAAO;AACV;AAAA,QACC,MAAM,IAAI,OAAO,UAAU,WAAW,QAAQ,aAAa,KAAK,CAAC;AAAA,MAClE;AACA,cAAQ;AAAA,IACT;AAEA,YAAQ;AAAA,MACP,SAAS,YAAY,YAClB,iBAAiB,WAAW,IAC5B,iBAAiB,QAAQ;AAAA,IAC7B;AAAA,EACD;AAEA,SAAO;AACR;","names":[]}
1
+ {"version":3,"sources":["../../src/bin/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport { parseArgs } from \"node:util\";\nimport { fromZodError } from \"zod-validation-error\";\n\nimport { createRerunSuggestion } from \"../create/createRerunSuggestion.js\";\nimport { create } from \"../create/index.js\";\nimport { initialize } from \"../initialize/index.js\";\nimport { migrate } from \"../migrate/index.js\";\nimport { logLine } from \"../shared/cli/lines.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { logHelpText } from \"./help.js\";\nimport { getVersionFromPackageJson } from \"./packageJson.js\";\nimport { promptForMode } from \"./promptForMode.js\";\n\nconst operationMessage = (verb: string) =>\n\t`Operation ${verb}. Exiting - maybe another time? ๐Ÿ‘‹`;\n\nexport async function bin(args: string[]) {\n\tconsole.clear();\n\n\tconst version = await getVersionFromPackageJson();\n\n\tconst introPrompts = [\n\t\tchalk.greenBright(`โœจ Welcome to`),\n\t\tchalk.bgGreenBright.black(`create-typescript-app`),\n\t\tchalk.greenBright(`${version}! โœจ`),\n\t].join(\" \");\n\n\tconst introWarnings = [\n\t\tchalk.yellow(\n\t\t\t\"โš ๏ธ This template is early stage, opinionated, and not endorsed by the TypeScript team. โš ๏ธ\",\n\t\t),\n\t\tchalk.yellow(\n\t\t\t\"โš ๏ธ If any tooling it sets displeases you, you can always remove that portion manually. โš ๏ธ\",\n\t\t),\n\t];\n\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: {\n\t\t\thelp: {\n\t\t\t\tshort: \"h\",\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t\tmode: { type: \"string\" },\n\t\t},\n\t\tstrict: false,\n\t});\n\n\tconst help = values.help;\n\n\tif (help) {\n\t\tlogHelpText([introPrompts, ...introWarnings]);\n\t\treturn 0;\n\t}\n\n\tprompts.intro(introPrompts);\n\n\tlogLine();\n\tlogLine(introWarnings[0]);\n\tlogLine(introWarnings[1]);\n\n\tconst { mode, options: promptedOptions } = await promptForMode(\n\t\t!!values.auto,\n\t\tvalues.mode,\n\t);\n\tif (typeof mode !== \"string\") {\n\t\tprompts.outro(chalk.red(mode?.message ?? operationMessage(\"cancelled\")));\n\t\treturn 1;\n\t}\n\n\tconst runners = { create, initialize, migrate };\n\tconst { code, error, options } = await runners[mode](args, promptedOptions);\n\n\tprompts.log.info(\n\t\t[\n\t\t\tchalk.italic(`Tip: to run again with the same input values, use:`),\n\t\t\tchalk.blue(createRerunSuggestion(options)),\n\t\t].join(\" \"),\n\t);\n\n\tif (code) {\n\t\tlogLine();\n\n\t\tif (error) {\n\t\t\tlogLine(\n\t\t\t\tchalk.red(typeof error === \"string\" ? error : fromZodError(error)),\n\t\t\t);\n\t\t\tlogLine();\n\t\t}\n\n\t\tprompts.cancel(\n\t\t\tcode === StatusCodes.Cancelled\n\t\t\t\t? operationMessage(\"cancelled\")\n\t\t\t\t: operationMessage(\"failed\"),\n\t\t);\n\t}\n\n\treturn code;\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAE7B,SAAS,6BAA6B;AACtC,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,iCAAiC;AAC1C,SAAS,qBAAqB;AAE9B,MAAM,mBAAmB,CAAC,SACzB,aAAa,IAAI;AAElB,eAAsB,IAAI,MAAgB;AACzC,UAAQ,MAAM;AAEd,QAAM,UAAU,MAAM,0BAA0B;AAEhD,QAAM,eAAe;AAAA,IACpB,MAAM,YAAY,mBAAc;AAAA,IAChC,MAAM,cAAc,MAAM,uBAAuB;AAAA,IACjD,MAAM,YAAY,GAAG,OAAO,UAAK;AAAA,EAClC,EAAE,KAAK,GAAG;AAEV,QAAM,gBAAgB;AAAA,IACrB,MAAM;AAAA,MACL;AAAA,IACD;AAAA,IACA,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AAEA,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,MACR,MAAM;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACP;AAAA,MACA,MAAM,EAAE,MAAM,SAAS;AAAA,IACxB;AAAA,IACA,QAAQ;AAAA,EACT,CAAC;AAED,QAAM,OAAO,OAAO;AAEpB,MAAI,MAAM;AACT,gBAAY,CAAC,cAAc,GAAG,aAAa,CAAC;AAC5C,WAAO;AAAA,EACR;AAEA,UAAQ,MAAM,YAAY;AAE1B,UAAQ;AACR,UAAQ,cAAc,CAAC,CAAC;AACxB,UAAQ,cAAc,CAAC,CAAC;AAExB,QAAM,EAAE,MAAM,SAAS,gBAAgB,IAAI,MAAM;AAAA,IAChD,CAAC,CAAC,OAAO;AAAA,IACT,OAAO;AAAA,EACR;AACA,MAAI,OAAO,SAAS,UAAU;AAC7B,YAAQ,MAAM,MAAM,IAAI,MAAM,WAAW,iBAAiB,WAAW,CAAC,CAAC;AACvE,WAAO;AAAA,EACR;AAEA,QAAM,UAAU,EAAE,QAAQ,YAAY,QAAQ;AAC9C,QAAM,EAAE,MAAM,OAAO,QAAQ,IAAI,MAAM,QAAQ,IAAI,EAAE,MAAM,eAAe;AAE1E,UAAQ,IAAI;AAAA,IACX;AAAA,MACC,MAAM,OAAO,oDAAoD;AAAA,MACjE,MAAM,KAAK,sBAAsB,OAAO,CAAC;AAAA,IAC1C,EAAE,KAAK,GAAG;AAAA,EACX;AAEA,MAAI,MAAM;AACT,YAAQ;AAER,QAAI,OAAO;AACV;AAAA,QACC,MAAM,IAAI,OAAO,UAAU,WAAW,QAAQ,aAAa,KAAK,CAAC;AAAA,MAClE;AACA,cAAQ;AAAA,IACT;AAEA,YAAQ;AAAA,MACP,SAAS,YAAY,YAClB,iBAAiB,WAAW,IAC5B,iBAAiB,QAAQ;AAAA,IAC7B;AAAA,EACD;AAEA,SAAO;AACR;","names":[]}
@@ -6,6 +6,6 @@ interface PromptedMode {
6
6
  mode: Error | Mode | undefined;
7
7
  options?: PromptedOptions;
8
8
  }
9
- declare function promptForMode(input: boolean | string | undefined): Promise<PromptedMode>;
9
+ declare function promptForMode(auto: boolean, input: boolean | string | undefined): Promise<PromptedMode>;
10
10
 
11
11
  export { PromptedMode, promptForMode };
@@ -12,7 +12,12 @@ function isMode(input) {
12
12
  function label(base, text) {
13
13
  return `${chalk.bold(base)} ${text}`;
14
14
  }
15
- async function promptForMode(input) {
15
+ async function promptForMode(auto, input) {
16
+ if (auto && input !== "migrate") {
17
+ return {
18
+ mode: new Error("--auto can only be used with --mode migrate.")
19
+ };
20
+ }
16
21
  if (input) {
17
22
  if (!isMode(input)) {
18
23
  return {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bin/promptForMode.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport * as fs from \"fs/promises\";\nimport path from \"node:path\";\nimport * as process from \"node:process\";\n\nimport { logLine } from \"../shared/cli/lines.js\";\nimport { filterPromptCancel } from \"../shared/prompts.js\";\nimport { Mode, PromptedOptions } from \"../shared/types.js\";\n\nconst allowedModes = [\"create\", \"initialize\", \"migrate\"] satisfies Mode[];\n\nfunction isMode(input: boolean | string): input is Mode {\n\treturn allowedModes.includes(input as Mode);\n}\n\nfunction label(base: string, text: string) {\n\treturn `${chalk.bold(base)} ${text}`;\n}\n\nexport interface PromptedMode {\n\tmode: Error | Mode | undefined;\n\toptions?: PromptedOptions;\n}\n\nexport async function promptForMode(\n\tinput: boolean | string | undefined,\n): Promise<PromptedMode> {\n\tif (input) {\n\t\tif (!isMode(input)) {\n\t\t\treturn {\n\t\t\t\tmode: new Error(\n\t\t\t\t\t`Unknown --mode: ${input}. Allowed modes are: ${allowedModes.join(\n\t\t\t\t\t\t\", \",\n\t\t\t\t\t)}.`,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\treturn { mode: input };\n\t}\n\n\tconst dir = await fs.readdir(\".\");\n\n\tif (dir.length === 0) {\n\t\tconst mode = filterPromptCancel(\n\t\t\t(await prompts.select({\n\t\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\t\"create\",\n\t\t\t\t\t\t\t\"a new repository in the current empty directory\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"create-current\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: label(\"create\", \"a new repository in a new child directory\"),\n\t\t\t\t\t\tvalue: \"create-child\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t})) as string,\n\t\t);\n\n\t\tconst directory = path.basename(process.cwd());\n\n\t\treturn {\n\t\t\tmode: \"create\",\n\t\t\t...(mode === \"create-current\" && {\n\t\t\t\toptions: {\n\t\t\t\t\tdirectory: \".\",\n\t\t\t\t\trepository: directory,\n\t\t\t\t},\n\t\t\t}),\n\t\t};\n\t}\n\n\tif (dir.includes(\".git\")) {\n\t\treturn {\n\t\t\tmode: filterPromptCancel(\n\t\t\t\t(await prompts.select({\n\t\t\t\t\tinitialValue: \"migrate\" as Mode,\n\t\t\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: label(\"create\", \"a new repository in a child directory\"),\n\t\t\t\t\t\t\tvalue: \"create\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\t\t\"initialize\",\n\t\t\t\t\t\t\t\t\"a freshly cloned repository in the current directory\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tvalue: \"initialize\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\t\t\"migrate\",\n\t\t\t\t\t\t\t\t\"the existing repository in the current directory\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tvalue: \"migrate\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t})) as Mode | symbol,\n\t\t\t),\n\t\t};\n\t}\n\n\tlogLine();\n\tlogLine(\n\t\tchalk.gray(\n\t\t\t\"Defaulting to --mode create because the directory contains children and isn't a Git repository.\",\n\t\t),\n\t);\n\n\treturn {\n\t\tmode: \"create\",\n\t};\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAClB,YAAY,QAAQ;AACpB,OAAO,UAAU;AACjB,YAAY,aAAa;AAEzB,SAAS,eAAe;AACxB,SAAS,0BAA0B;AAGnC,MAAM,eAAe,CAAC,UAAU,cAAc,SAAS;AAEvD,SAAS,OAAO,OAAwC;AACvD,SAAO,aAAa,SAAS,KAAa;AAC3C;AAEA,SAAS,MAAM,MAAc,MAAc;AAC1C,SAAO,GAAG,MAAM,KAAK,IAAI,CAAC,IAAI,IAAI;AACnC;AAOA,eAAsB,cACrB,OACwB;AACxB,MAAI,OAAO;AACV,QAAI,CAAC,OAAO,KAAK,GAAG;AACnB,aAAO;AAAA,QACN,MAAM,IAAI;AAAA,UACT,mBAAmB,KAAK,wBAAwB,aAAa;AAAA,YAC5D;AAAA,UACD,CAAC;AAAA,QACF;AAAA,MACD;AAAA,IACD;AAEA,WAAO,EAAE,MAAM,MAAM;AAAA,EACtB;AAEA,QAAM,MAAM,MAAM,GAAG,QAAQ,GAAG;AAEhC,MAAI,IAAI,WAAW,GAAG;AACrB,UAAM,OAAO;AAAA,MACX,MAAM,QAAQ,OAAO;AAAA,QACrB,SAAS,MAAM,KAAK,yCAAyC;AAAA,QAC7D,SAAS;AAAA,UACR;AAAA,YACC,OAAO;AAAA,cACN;AAAA,cACA;AAAA,YACD;AAAA,YACA,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,OAAO,MAAM,UAAU,2CAA2C;AAAA,YAClE,OAAO;AAAA,UACR;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAEA,UAAM,YAAY,KAAK,SAAS,QAAQ,IAAI,CAAC;AAE7C,WAAO;AAAA,MACN,MAAM;AAAA,MACN,GAAI,SAAS,oBAAoB;AAAA,QAChC,SAAS;AAAA,UACR,WAAW;AAAA,UACX,YAAY;AAAA,QACb;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAEA,MAAI,IAAI,SAAS,MAAM,GAAG;AACzB,WAAO;AAAA,MACN,MAAM;AAAA,QACJ,MAAM,QAAQ,OAAO;AAAA,UACrB,cAAc;AAAA,UACd,SAAS,MAAM,KAAK,yCAAyC;AAAA,UAC7D,SAAS;AAAA,YACR;AAAA,cACC,OAAO,MAAM,UAAU,uCAAuC;AAAA,cAC9D,OAAO;AAAA,YACR;AAAA,YACA;AAAA,cACC,OAAO;AAAA,gBACN;AAAA,gBACA;AAAA,cACD;AAAA,cACA,OAAO;AAAA,YACR;AAAA,YACA;AAAA,cACC,OAAO;AAAA,gBACN;AAAA,gBACA;AAAA,cACD;AAAA,cACA,OAAO;AAAA,YACR;AAAA,UACD;AAAA,QACD,CAAC;AAAA,MACF;AAAA,IACD;AAAA,EACD;AAEA,UAAQ;AACR;AAAA,IACC,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;","names":[]}
1
+ {"version":3,"sources":["../../src/bin/promptForMode.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport * as fs from \"fs/promises\";\nimport path from \"node:path\";\nimport * as process from \"node:process\";\n\nimport { logLine } from \"../shared/cli/lines.js\";\nimport { filterPromptCancel } from \"../shared/prompts.js\";\nimport { Mode, PromptedOptions } from \"../shared/types.js\";\n\nconst allowedModes = [\"create\", \"initialize\", \"migrate\"] satisfies Mode[];\n\nfunction isMode(input: boolean | string): input is Mode {\n\treturn allowedModes.includes(input as Mode);\n}\n\nfunction label(base: string, text: string) {\n\treturn `${chalk.bold(base)} ${text}`;\n}\n\nexport interface PromptedMode {\n\tmode: Error | Mode | undefined;\n\toptions?: PromptedOptions;\n}\n\nexport async function promptForMode(\n\tauto: boolean,\n\tinput: boolean | string | undefined,\n): Promise<PromptedMode> {\n\tif (auto && input !== \"migrate\") {\n\t\treturn {\n\t\t\tmode: new Error(\"--auto can only be used with --mode migrate.\"),\n\t\t};\n\t}\n\n\tif (input) {\n\t\tif (!isMode(input)) {\n\t\t\treturn {\n\t\t\t\tmode: new Error(\n\t\t\t\t\t`Unknown --mode: ${input}. Allowed modes are: ${allowedModes.join(\n\t\t\t\t\t\t\", \",\n\t\t\t\t\t)}.`,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\treturn { mode: input };\n\t}\n\n\tconst dir = await fs.readdir(\".\");\n\n\tif (dir.length === 0) {\n\t\tconst mode = filterPromptCancel(\n\t\t\t(await prompts.select({\n\t\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\t\"create\",\n\t\t\t\t\t\t\t\"a new repository in the current empty directory\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"create-current\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: label(\"create\", \"a new repository in a new child directory\"),\n\t\t\t\t\t\tvalue: \"create-child\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t})) as string,\n\t\t);\n\n\t\tconst directory = path.basename(process.cwd());\n\n\t\treturn {\n\t\t\tmode: \"create\",\n\t\t\t...(mode === \"create-current\" && {\n\t\t\t\toptions: {\n\t\t\t\t\tdirectory: \".\",\n\t\t\t\t\trepository: directory,\n\t\t\t\t},\n\t\t\t}),\n\t\t};\n\t}\n\n\tif (dir.includes(\".git\")) {\n\t\treturn {\n\t\t\tmode: filterPromptCancel(\n\t\t\t\t(await prompts.select({\n\t\t\t\t\tinitialValue: \"migrate\" as Mode,\n\t\t\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: label(\"create\", \"a new repository in a child directory\"),\n\t\t\t\t\t\t\tvalue: \"create\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\t\t\"initialize\",\n\t\t\t\t\t\t\t\t\"a freshly cloned repository in the current directory\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tvalue: \"initialize\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\t\t\"migrate\",\n\t\t\t\t\t\t\t\t\"the existing repository in the current directory\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tvalue: \"migrate\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t})) as Mode | symbol,\n\t\t\t),\n\t\t};\n\t}\n\n\tlogLine();\n\tlogLine(\n\t\tchalk.gray(\n\t\t\t\"Defaulting to --mode create because the directory contains children and isn't a Git repository.\",\n\t\t),\n\t);\n\n\treturn {\n\t\tmode: \"create\",\n\t};\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAClB,YAAY,QAAQ;AACpB,OAAO,UAAU;AACjB,YAAY,aAAa;AAEzB,SAAS,eAAe;AACxB,SAAS,0BAA0B;AAGnC,MAAM,eAAe,CAAC,UAAU,cAAc,SAAS;AAEvD,SAAS,OAAO,OAAwC;AACvD,SAAO,aAAa,SAAS,KAAa;AAC3C;AAEA,SAAS,MAAM,MAAc,MAAc;AAC1C,SAAO,GAAG,MAAM,KAAK,IAAI,CAAC,IAAI,IAAI;AACnC;AAOA,eAAsB,cACrB,MACA,OACwB;AACxB,MAAI,QAAQ,UAAU,WAAW;AAChC,WAAO;AAAA,MACN,MAAM,IAAI,MAAM,8CAA8C;AAAA,IAC/D;AAAA,EACD;AAEA,MAAI,OAAO;AACV,QAAI,CAAC,OAAO,KAAK,GAAG;AACnB,aAAO;AAAA,QACN,MAAM,IAAI;AAAA,U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R;AAAA,IACC,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;","names":[]}
@@ -9,6 +9,11 @@ declare const allArgOptions: {
9
9
  readonly docsSection: "optional";
10
10
  readonly type: "string";
11
11
  };
12
+ readonly auto: {
13
+ readonly description: "Whether to infer all options from files on disk.";
14
+ readonly docsSection: "optional";
15
+ readonly type: "boolean";
16
+ };
12
17
  readonly base: {
13
18
  readonly description: `Whether to scaffold the repository with:\n \u2022 everything: that comes with the template (${string})\n \u2022 minimum: amounts of tooling, essentially opting out of everything\n \u2022 prompt: for which portions to exclude`;
14
19
  readonly docsSection: "core";
@@ -15,6 +15,11 @@ const allArgOptions = {
15
15
  docsSection: "optional",
16
16
  type: "string"
17
17
  },
18
+ auto: {
19
+ description: `Whether to infer all options from files on disk.`,
20
+ docsSection: "optional",
21
+ type: "boolean"
22
+ },
18
23
  base: {
19
24
  description: `Whether to scaffold the repository with:
20
25
  \u2022 everything: that comes with the template (${chalk.cyanBright.bold(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/options/args.ts"],"sourcesContent":["import chalk from \"chalk\";\n\nexport const allArgOptions = {\n\taccess: {\n\t\tdescription: `(${chalk.cyanBright(\n\t\t\t'\"public\" | \"restricted\"',\n\t\t)}): Which ${chalk.cyanBright(\"npm publish --access\")} to \n release npm packages with (by default, \"public\")`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\tauthor: {\n\t\tdescription: `Username on npm to publish packages under (by \n default, an existing npm author, or the currently logged in npm user, or \n ${chalk.cyanBright(\"owner.toLowerCase()\")})`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\tbase: {\n\t\tdescription: `Whether to scaffold the repository with:\n โ€ข everything: that comes with the template (${chalk.cyanBright.bold(\n\t\t\"recommended\",\n\t)})\n โ€ข minimum: amounts of tooling, essentially opting out of everything\n โ€ข prompt: for which portions to exclude`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"string\",\n\t},\n\t\"create-repository\": {\n\t\tdescription: `Whether to create a corresponding repository on github.com \n (if it doesn't yet exist)`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"boolean\",\n\t},\n\tdescription: {\n\t\tdescription: `Sentence case description of the repository \n (e.g. A quickstart-friendly TypeScript package with lots of great \n repository tooling. โœจ)`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"string\",\n\t},\n\tdirectory: {\n\t\tdescription: `Directory to create the repository in (by default, the same \n name as the repository)`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\temail: {\n\t\tdescription: `Email address to be listed as the point of contact in docs \n and packages (e.g. example@joshuakgoldberg.com)`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\t\"email-github\": {\n\t\tdescription: `Optionally, may be provided to use different emails in ${chalk.cyanBright(\n\t\t\t\".md\",\n\t\t)} \n files`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\t\"email-npm\": {\n\t\tdescription: `Optionally, may be provided to use different emails in \n ${chalk.cyanBright(\"package.json\")}`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\t\"exclude-all-contributors\": {\n\t\tdescription: `Don't add all-contributors to track contributions \n and display them in a README.md table.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-compliance\": {\n\t\tdescription: `Don't add a GitHub Actions workflow to verify that PRs match \n an expected format.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-deprecation\": {\n\t\tdescription: `Don't use eslint-plugin-deprecation to report on usage \n of code marked as ${chalk.cyanBright(\"@deprecated\")}.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-jsdoc\": {\n\t\tdescription: `Don't use eslint-plugin-jsdoc to enforce good practices around \n JSDoc comments.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-json\": {\n\t\tdescription: `Don't apply linting and sorting to ${chalk.cyanBright(\n\t\t\t\"*.json\",\n\t\t)}, and \n ${chalk.cyanBright(\"*.jsonc\")} files.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-knip\": {\n\t\tdescription: `Don't add Knip to detect unused files, dependencies, and code \n exports.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-md\": {\n\t\tdescription: `Don't apply linting to ${chalk.cyanBright(\"*.md\")} files.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-package-json\": {\n\t\tdescription: `Don't add npm-package-json-lint to lint for \n package.json correctness.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-packages\": {\n\t\tdescription: `Don't add a pnpm dedupe workflow to ensure packages \n aren't duplicated unnecessarily.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-perfectionist\": {\n\t\tdescription: `Don't apply eslint-plugin-perfectionist to ensure \n imports, keys, and so on are in sorted order.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-regex\": {\n\t\tdescription: `Don't add eslint-plugin-regex to enforce good practices around \n regular expressions.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-spelling\": {\n\t\tdescription: `Don't add cspell to spell check against dictionaries \n of known words.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-strict\": {\n\t\tdescription: `Don't augment the recommended logical lint rules with \n typescript-eslint's strict config.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-stylistic\": {\n\t\tdescription: `Don't add stylistic rules such as typescript-eslint's \n stylistic config.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-yml\": {\n\t\tdescription: `Don't apply linting and sorting to ${chalk.cyanBright(\n\t\t\t\"*.yaml\",\n\t\t)} and ${chalk.cyanBright(\"*.yml\")} files.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-releases\": {\n\t\tdescription: `Don't add release-it to generate changelogs, package bumps, \n and publishes based on conventional commits.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-renovate\": {\n\t\tdescription: `Don't add a Renovate config to dependencies up-to-date with \n PRs.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-tests\": {\n\t\tdescription: `Don't add Vitest tooling for fast unit tests, configured \n with coverage tracking.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\tfunding: {\n\t\tdescription: `GitHub organization or username to mention in ${chalk.cyanBright(\n\t\t\t\"funding.yml\",\n\t\t)} \n (by default, owner)`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\tguide: {\n\t\tdescription: `Link to a contribution guide to place at the top of the \n development docs`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\t\"guide-title\": {\n\t\tdescription: `If ${chalk.cyanBright(\n\t\t\t\"--guide\",\n\t\t)} is provided or detected from an existing \n DEVELOPMENT.md, the text title to place in the guide link`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\tkeywords: {\n\t\tdescription: `Any number of keywords to include in ${chalk.cyanBright(\n\t\t\t\"package.json\",\n\t\t)} (by default, \n none). This can be specified any number of times, like \n ${chalk.cyanBright('--keywords apple --keywords \"banana cherry\"')}`,\n\t\tdocsSection: \"optional\",\n\t\tmultiple: true,\n\t\ttype: \"string\",\n\t},\n\tlogo: {\n\t\tdescription: `Local image file in the repository to display near the top of \n the README.md as a logo`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\t\"logo-alt\": {\n\t\tdescription: `If ${chalk.cyanBright(\n\t\t\t\"--logo\",\n\t\t)} is provided or detected from an existing README.md, \n alt text that describes the image will be prompted for if not provided`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\tmode: {\n\t\tdescription: `Whether to:\n โ€ข create: a new repository in a child directory\n โ€ข initialize: a freshly repository in the current directory\n โ€ข migrate: an existing repository in the current directory`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"string\",\n\t},\n\toffline: {\n\t\tdescription: `You can run ${chalk.cyanBright(\n\t\t\t\"create-typescript-app\",\n\t\t)} in an \"offline\" mode. \n Doing so will:\n โ€ข Enable ${chalk.cyanBright(\n\t\t\"--exclude-all-contributors-api\",\n\t)} and ${chalk.cyanBright(\"--skip-github-api\")}\n โ€ข Skip network calls when setting up contributors\n โ€ข Run pnpm commands with pnpm's ${chalk.cyanBright(\"--offline\")} mode`,\n\t\tdocsSection: \"offline\",\n\t\ttype: \"boolean\",\n\t},\n\towner: {\n\t\tdescription: `GitHub organization or user the repository is underneath \n (e.g. JoshuaKGoldberg)`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"string\",\n\t},\n\t\"preserve-generated-form\": {\n\t\tdescription: `Whether to keep the GitHub repository generated from \n notice (by default, false)`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"boolean\",\n\t},\n\trepository: {\n\t\tdescription: `The kebab-case name of the repository \n (e.g. create-typescript-app)`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"string\",\n\t},\n\t\"skip-all-contributors-api\": {\n\t\tdescription: `Skips network calls that fetch all-contributors data from\n GitHub. This flag does nothing if ${chalk.cyanBright(\n\t\t\"--exclude-all-contributors\",\n\t)} was specified.`,\n\t\tdocsSection: \"skip-net\",\n\t\ttype: \"boolean\",\n\t},\n\t\"skip-github-api\": {\n\t\tdescription: `Skips calling to GitHub APIs.`,\n\t\tdocsSection: \"skip-net\",\n\t\ttype: \"boolean\",\n\t},\n\t\"skip-install\": {\n\t\tdescription: `Skips installing all the new template packages with pnpm.`,\n\t\tdocsSection: \"skip-net\",\n\t\ttype: \"boolean\",\n\t},\n\t\"skip-removal\": {\n\t\tdescription: `Skips removing setup docs and scripts, including this ${chalk.cyanBright(\n\t\t\t\"docs/\",\n\t\t)} \n directory`,\n\t\tdocsSection: \"skip-disk\",\n\t\ttype: \"boolean\",\n\t},\n\t\"skip-restore\": {\n\t\tdescription: `Skips the prompt offering to restore the repository if an \n error occurs during setup`,\n\t\tdocsSection: \"skip-disk\",\n\t\ttype: \"boolean\",\n\t},\n\t\"skip-uninstall\": {\n\t\tdescription: `Skips uninstalling packages only used for setup scripts`,\n\t\tdocsSection: \"skip-disk\",\n\t\ttype: \"boolean\",\n\t},\n\ttitle: {\n\t\tdescription: `Title Case title for the repository to be used in \n documentation (e.g. Create TypeScript App)`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"string\",\n\t},\n} as const;\n"],"mappings":"AAAA,OAAO,WAAW;AAEX,MAAM,gBAAgB;AAAA,EAC5B,QAAQ;AAAA,IACP,aAAa,IAAI,MAAM;AAAA,MACtB;AAAA,IACD,CAAC,YAAY,MAAM,WAAW,sBAAsB,CAAC;AAAA;AAAA,IAErD,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,QAAQ;AAAA,IACP,aAAa;AAAA;AAAA,IAEX,MAAM,WAAW,qBAAqB,CAAC;AAAA,IACzC,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,MAAM;AAAA,IACL,aAAa;AAAA,qDACiC,MAAM,WAAW;AAAA,MAC/D;AAAA,IACD,CAAC;AAAA;AAAA;AAAA,IAGA,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,qBAAqB;AAAA,IACpB,aAAa;AAAA;AAAA,IAEb,aAAa;AA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A,6BAA6B;AAAA,IAC5B,aAAa;AAAA,sCACuB,MAAM;AAAA,MAC1C;AAAA,IACD,CAAC;AAAA,IACA,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,mBAAmB;AAAA,IAClB,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,gBAAgB;AAAA,IACf,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,gBAAgB;AAAA,IACf,aAAa,yDAAyD,MAAM;AAAA,MAC3E;AAAA,IACD,CAAC;AAAA;AAAA,IAED,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,gBAAgB;AAAA,IACf,aAAa;AAAA;AAAA,IAEb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,kBAAkB;AAAA,IACjB,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,OAAO;AAAA,IACN,aAAa;AAAA;AAAA,IAEb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../src/shared/options/args.ts"],"sourcesContent":["import chalk from \"chalk\";\n\nexport const allArgOptions = {\n\taccess: {\n\t\tdescription: `(${chalk.cyanBright(\n\t\t\t'\"public\" | \"restricted\"',\n\t\t)}): Which ${chalk.cyanBright(\"npm publish --access\")} to \n release npm packages with (by default, \"public\")`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\tauthor: {\n\t\tdescription: `Username on npm to publish packages under (by \n default, an existing npm author, or the currently logged in npm user, or \n ${chalk.cyanBright(\"owner.toLowerCase()\")})`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\tauto: {\n\t\tdescription: `Whether to infer all options from files on disk.`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"boolean\",\n\t},\n\tbase: {\n\t\tdescription: `Whether to scaffold the repository with:\n โ€ข everything: that comes with the template (${chalk.cyanBright.bold(\n\t\t\"recommended\",\n\t)})\n โ€ข minimum: amounts of tooling, essentially opting out of everything\n โ€ข prompt: for which portions to exclude`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"string\",\n\t},\n\t\"create-repository\": {\n\t\tdescription: `Whether to create a corresponding repository on github.com \n (if it doesn't yet exist)`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"boolean\",\n\t},\n\tdescription: {\n\t\tdescription: `Sentence case description of the repository \n (e.g. A quickstart-friendly TypeScript package with lots of great \n repository tooling. โœจ)`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"string\",\n\t},\n\tdirectory: {\n\t\tdescription: `Directory to create the repository in (by default, the same \n name as the repository)`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\temail: {\n\t\tdescription: `Email address to be listed as the point of contact in docs \n and packages (e.g. example@joshuakgoldberg.com)`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\t\"email-github\": {\n\t\tdescription: `Optionally, may be provided to use different emails in ${chalk.cyanBright(\n\t\t\t\".md\",\n\t\t)} \n files`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\t\"email-npm\": {\n\t\tdescription: `Optionally, may be provided to use different emails in \n ${chalk.cyanBright(\"package.json\")}`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\t\"exclude-all-contributors\": {\n\t\tdescription: `Don't add all-contributors to track contributions \n and display them in a README.md table.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-compliance\": {\n\t\tdescription: `Don't add a GitHub Actions workflow to verify that PRs match \n an expected format.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-deprecation\": {\n\t\tdescription: `Don't use eslint-plugin-deprecation to report on usage \n of code marked as ${chalk.cyanBright(\"@deprecated\")}.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-jsdoc\": {\n\t\tdescription: `Don't use eslint-plugin-jsdoc to enforce good practices around \n JSDoc comments.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-json\": {\n\t\tdescription: `Don't apply linting and sorting to ${chalk.cyanBright(\n\t\t\t\"*.json\",\n\t\t)}, and \n ${chalk.cyanBright(\"*.jsonc\")} files.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-knip\": {\n\t\tdescription: `Don't add Knip to detect unused files, dependencies, and code \n exports.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-md\": {\n\t\tdescription: `Don't apply linting to ${chalk.cyanBright(\"*.md\")} files.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-package-json\": {\n\t\tdescription: `Don't add npm-package-json-lint to lint for \n package.json correctness.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-packages\": {\n\t\tdescription: `Don't add a pnpm dedupe workflow to ensure packages \n aren't duplicated unnecessarily.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-perfectionist\": {\n\t\tdescription: `Don't apply eslint-plugin-perfectionist to ensure \n imports, keys, and so on are in sorted order.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-regex\": {\n\t\tdescription: `Don't add eslint-plugin-regex to enforce good practices around \n regular expressions.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-spelling\": {\n\t\tdescription: `Don't add cspell to spell check against dictionaries \n of known words.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-strict\": {\n\t\tdescription: `Don't augment the recommended logical lint rules with \n typescript-eslint's strict config.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-stylistic\": {\n\t\tdescription: `Don't add stylistic rules such as typescript-eslint's \n stylistic config.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-lint-yml\": {\n\t\tdescription: `Don't apply linting and sorting to ${chalk.cyanBright(\n\t\t\t\"*.yaml\",\n\t\t)} and ${chalk.cyanBright(\"*.yml\")} files.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-releases\": {\n\t\tdescription: `Don't add release-it to generate changelogs, package bumps, \n and publishes based on conventional commits.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-renovate\": {\n\t\tdescription: `Don't add a Renovate config to dependencies up-to-date with \n PRs.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\t\"exclude-tests\": {\n\t\tdescription: `Don't add Vitest tooling for fast unit tests, configured \n with coverage tracking.`,\n\t\tdocsSection: \"opt-out\",\n\t\ttype: \"boolean\",\n\t},\n\tfunding: {\n\t\tdescription: `GitHub organization or username to mention in ${chalk.cyanBright(\n\t\t\t\"funding.yml\",\n\t\t)} \n (by default, owner)`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\tguide: {\n\t\tdescription: `Link to a contribution guide to place at the top of the \n development docs`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\t\"guide-title\": {\n\t\tdescription: `If ${chalk.cyanBright(\n\t\t\t\"--guide\",\n\t\t)} is provided or detected from an existing \n DEVELOPMENT.md, the text title to place in the guide link`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\tkeywords: {\n\t\tdescription: `Any number of keywords to include in ${chalk.cyanBright(\n\t\t\t\"package.json\",\n\t\t)} (by default, \n none). This can be specified any number of times, like \n ${chalk.cyanBright('--keywords apple --keywords \"banana cherry\"')}`,\n\t\tdocsSection: \"optional\",\n\t\tmultiple: true,\n\t\ttype: \"string\",\n\t},\n\tlogo: {\n\t\tdescription: `Local image file in the repository to display near the top of \n the README.md as a logo`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\t\"logo-alt\": {\n\t\tdescription: `If ${chalk.cyanBright(\n\t\t\t\"--logo\",\n\t\t)} is provided or detected from an existing README.md, \n alt text that describes the image will be prompted for if not provided`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"string\",\n\t},\n\tmode: {\n\t\tdescription: `Whether to:\n โ€ข create: a new repository in a child directory\n โ€ข initialize: a freshly repository in the current directory\n โ€ข migrate: an existing repository in the current directory`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"string\",\n\t},\n\toffline: {\n\t\tdescription: `You can run ${chalk.cyanBright(\n\t\t\t\"create-typescript-app\",\n\t\t)} in an \"offline\" mode. \n Doing so will:\n โ€ข Enable ${chalk.cyanBright(\n\t\t\"--exclude-all-contributors-api\",\n\t)} and ${chalk.cyanBright(\"--skip-github-api\")}\n โ€ข Skip network calls when setting up contributors\n โ€ข Run pnpm commands with pnpm's ${chalk.cyanBright(\"--offline\")} mode`,\n\t\tdocsSection: \"offline\",\n\t\ttype: \"boolean\",\n\t},\n\towner: {\n\t\tdescription: `GitHub organization or user the repository is underneath \n (e.g. JoshuaKGoldberg)`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"string\",\n\t},\n\t\"preserve-generated-form\": {\n\t\tdescription: `Whether to keep the GitHub repository generated from \n notice (by default, false)`,\n\t\tdocsSection: \"optional\",\n\t\ttype: \"boolean\",\n\t},\n\trepository: {\n\t\tdescription: `The kebab-case name of the repository \n (e.g. create-typescript-app)`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"string\",\n\t},\n\t\"skip-all-contributors-api\": {\n\t\tdescription: `Skips network calls that fetch all-contributors data from\n GitHub. This flag does nothing if ${chalk.cyanBright(\n\t\t\"--exclude-all-contributors\",\n\t)} was specified.`,\n\t\tdocsSection: \"skip-net\",\n\t\ttype: \"boolean\",\n\t},\n\t\"skip-github-api\": {\n\t\tdescription: `Skips calling to GitHub APIs.`,\n\t\tdocsSection: \"skip-net\",\n\t\ttype: \"boolean\",\n\t},\n\t\"skip-install\": {\n\t\tdescription: `Skips installing all the new template packages with pnpm.`,\n\t\tdocsSection: \"skip-net\",\n\t\ttype: \"boolean\",\n\t},\n\t\"skip-removal\": {\n\t\tdescription: `Skips removing setup docs and scripts, including this ${chalk.cyanBright(\n\t\t\t\"docs/\",\n\t\t)} \n directory`,\n\t\tdocsSection: \"skip-disk\",\n\t\ttype: \"boolean\",\n\t},\n\t\"skip-restore\": {\n\t\tdescription: `Skips the prompt offering to restore the repository if an \n error occurs during setup`,\n\t\tdocsSection: \"skip-disk\",\n\t\ttype: \"boolean\",\n\t},\n\t\"skip-uninstall\": {\n\t\tdescription: `Skips uninstalling packages only used for setup scripts`,\n\t\tdocsSection: \"skip-disk\",\n\t\ttype: \"boolean\",\n\t},\n\ttitle: {\n\t\tdescription: `Title Case title for the repository to be used in \n documentation (e.g. Create TypeScript App)`,\n\t\tdocsSection: \"core\",\n\t\ttype: \"string\",\n\t},\n} as const;\n"],"mappings":"AAAA,OAAO,WAAW;AAEX,MAAM,gBAAgB;AAAA,EAC5B,QAAQ;AAAA,IACP,aAAa,IAAI,MAAM;AAAA,MACtB;AAAA,IACD,CAAC,YAAY,MAAM,WAAW,sBAAsB,CAAC;AAAA;AAAA,IAErD,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,QAAQ;AAAA,IACP,aAAa;AAAA;AAAA,IAEX,MAAM,WAAW,qBAAqB,CAAC;AAAA,IACzC,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,MAAM;AAAA,IACL,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,MAAM;AAAA,I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P;AAAA,EACA,2BAA2B;AAAA,IAC1B,aAAa;AAAA;AAAA,IAEb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,YAAY;AAAA,IACX,aAAa;AAAA;AAAA,IAEb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,6BAA6B;AAAA,IAC5B,aAAa;AAAA,sCACuB,MAAM;AAAA,MAC1C;AAAA,IACD,CAAC;AAAA,IACA,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,mBAAmB;AAAA,IAClB,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,gBAAgB;AAAA,IACf,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,gBAAgB;AAAA,IACf,aAAa,yDAAyD,MAAM;AAAA,MAC3E;AAAA,IACD,CAAC;AAAA;AAAA,IAED,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,gBAAgB;AAAA,IACf,aAAa;AAAA;AAAA,IAEb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,kBAAkB;AAAA,IACjB,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,OAAO;AAAA,IACN,aAAa;AAAA;AAAA,IAEb,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AACD;","names":[]}
@@ -1,3 +1,9 @@
1
- declare function getPrefillOrPromptedOption(message: string, getPlaceholder?: () => Promise<string | undefined>): Promise<string | undefined>;
1
+ declare function getPrefillOrPromptedOption(name: string, auto: boolean, message: string, getDefaultValue?: () => Promise<string | undefined>): Promise<{
2
+ error: string | undefined;
3
+ value: string | undefined;
4
+ } | {
5
+ value: string | undefined;
6
+ error?: undefined;
7
+ }>;
2
8
 
3
9
  export { getPrefillOrPromptedOption };
@@ -1,17 +1,26 @@
1
1
  import * as prompts from "@clack/prompts";
2
2
  import { filterPromptCancel } from "../prompts.js";
3
- async function getPrefillOrPromptedOption(message, getPlaceholder) {
4
- return filterPromptCancel(
5
- await prompts.text({
6
- message,
7
- placeholder: await getPlaceholder?.(),
8
- validate: (val) => {
9
- if (val.length === 0) {
10
- return "Please enter a value.";
3
+ async function getPrefillOrPromptedOption(name, auto, message, getDefaultValue) {
4
+ const defaultValue = await getDefaultValue?.();
5
+ if (auto || defaultValue) {
6
+ return {
7
+ error: defaultValue ? void 0 : `Could not infer a default value for ${name}.`,
8
+ value: defaultValue
9
+ };
10
+ }
11
+ return {
12
+ value: filterPromptCancel(
13
+ await prompts.text({
14
+ message,
15
+ placeholder: defaultValue,
16
+ validate: (val) => {
17
+ if (val.length === 0) {
18
+ return "Please enter a value.";
19
+ }
11
20
  }
12
- }
13
- })
14
- );
21
+ })
22
+ )
23
+ };
15
24
  }
16
25
  export {
17
26
  getPrefillOrPromptedOption
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/options/getPrefillOrPromptedOption.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { filterPromptCancel } from \"../prompts.js\";\n\nexport async function getPrefillOrPromptedOption(\n\tmessage: string,\n\tgetPlaceholder?: () => Promise<string | undefined>,\n) {\n\treturn filterPromptCancel(\n\t\tawait prompts.text({\n\t\t\tmessage,\n\t\t\tplaceholder: await getPlaceholder?.(),\n\t\t\tvalidate: (val) => {\n\t\t\t\tif (val.length === 0) {\n\t\t\t\t\treturn \"Please enter a value.\";\n\t\t\t\t}\n\t\t\t},\n\t\t}),\n\t);\n}\n"],"mappings":"AAAA,YAAY,aAAa;AAEzB,SAAS,0BAA0B;AAEnC,eAAsB,2BACrB,SACA,gBACC;AACD,SAAO;AAAA,IACN,MAAM,QAAQ,KAAK;AAAA,MAClB;AAAA,MACA,aAAa,MAAM,iBAAiB;AAAA,MACpC,UAAU,CAAC,QAAQ;AAClB,YAAI,IAAI,WAAW,GAAG;AACrB,iBAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../src/shared/options/getPrefillOrPromptedOption.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { filterPromptCancel } from \"../prompts.js\";\n\nexport async function getPrefillOrPromptedOption(\n\tname: string,\n\tauto: boolean,\n\tmessage: string,\n\tgetDefaultValue?: () => Promise<string | undefined>,\n) {\n\tconst defaultValue = await getDefaultValue?.();\n\n\tif (auto || defaultValue) {\n\t\treturn {\n\t\t\terror: defaultValue\n\t\t\t\t? undefined\n\t\t\t\t: `Could not infer a default value for ${name}.`,\n\t\t\tvalue: defaultValue,\n\t\t};\n\t}\n\n\treturn {\n\t\tvalue: filterPromptCancel(\n\t\t\tawait prompts.text({\n\t\t\t\tmessage,\n\t\t\t\tplaceholder: defaultValue,\n\t\t\t\tvalidate: (val) => {\n\t\t\t\t\tif (val.length === 0) {\n\t\t\t\t\t\treturn \"Please enter a value.\";\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t),\n\t};\n}\n"],"mappings":"AAAA,YAAY,aAAa;AAEzB,SAAS,0BAA0B;AAEnC,eAAsB,2BACrB,MACA,MACA,SACA,iBACC;AACD,QAAM,eAAe,MAAM,kBAAkB;AAE7C,MAAI,QAAQ,cAAc;AACzB,WAAO;AAAA,MACN,OAAO,eACJ,SACA,uCAAuC,IAAI;AAAA,MAC9C,OAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AAAA,IACN,OAAO;AAAA,MACN,MAAM,QAAQ,KAAK;AAAA,QAClB;AAAA,QACA,aAAa;AAAA,QACb,UAAU,CAAC,QAAQ;AAClB,cAAI,IAAI,WAAW,GAAG;AACrB,mBAAO;AAAA,UACR;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AACD;","names":[]}
@@ -0,0 +1,8 @@
1
+ import { Options } from '../types.js';
2
+ import 'zod';
3
+ import '../codes.js';
4
+
5
+ type InferredOptions = Pick<Options, "description" | "email" | "guide" | "logo" | "owner" | "repository" | "title">;
6
+ declare function logInferredOptions(augmentedOptions: InferredOptions): void;
7
+
8
+ export { InferredOptions, logInferredOptions };
@@ -0,0 +1,24 @@
1
+ import chalk from "chalk";
2
+ import { logLine } from "../cli/lines.js";
3
+ function logInferredOptions(augmentedOptions) {
4
+ logLine();
5
+ logLine(chalk.gray("--auto inferred the following values:"));
6
+ logLine(chalk.gray(`- description: ${augmentedOptions.description}`));
7
+ logLine(chalk.gray(`- email-github: ${augmentedOptions.email.github}`));
8
+ logLine(chalk.gray(`- email-npm: ${augmentedOptions.email.github}`));
9
+ if (augmentedOptions.guide) {
10
+ logLine(chalk.gray(`- guide: ${augmentedOptions.guide.href}`));
11
+ logLine(chalk.gray(`- guide-title: ${augmentedOptions.guide.title}`));
12
+ }
13
+ if (augmentedOptions.logo) {
14
+ logLine(chalk.gray(`- logo: ${augmentedOptions.logo.src}`));
15
+ logLine(chalk.gray(`- logo-alt: ${augmentedOptions.logo.alt}`));
16
+ }
17
+ logLine(chalk.gray(`- owner: ${augmentedOptions.owner}`));
18
+ logLine(chalk.gray(`- repository: ${augmentedOptions.repository}`));
19
+ logLine(chalk.gray(`- title: ${augmentedOptions.title}`));
20
+ }
21
+ export {
22
+ logInferredOptions
23
+ };
24
+ //# sourceMappingURL=logInferredOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shared/options/logInferredOptions.ts"],"sourcesContent":["import chalk from \"chalk\";\n\nimport { logLine } from \"../cli/lines.js\";\nimport { Options } from \"../types.js\";\n\nexport type InferredOptions = Pick<\n\tOptions,\n\t\"description\" | \"email\" | \"guide\" | \"logo\" | \"owner\" | \"repository\" | \"title\"\n>;\n\nexport function logInferredOptions(augmentedOptions: InferredOptions) {\n\tlogLine();\n\tlogLine(chalk.gray(\"--auto inferred the following values:\"));\n\tlogLine(chalk.gray(`- description: ${augmentedOptions.description}`));\n\tlogLine(chalk.gray(`- email-github: ${augmentedOptions.email.github}`));\n\tlogLine(chalk.gray(`- email-npm: ${augmentedOptions.email.github}`));\n\n\tif (augmentedOptions.guide) {\n\t\tlogLine(chalk.gray(`- guide: ${augmentedOptions.guide.href}`));\n\t\tlogLine(chalk.gray(`- guide-title: ${augmentedOptions.guide.title}`));\n\t}\n\n\tif (augmentedOptions.logo) {\n\t\tlogLine(chalk.gray(`- logo: ${augmentedOptions.logo.src}`));\n\t\tlogLine(chalk.gray(`- logo-alt: ${augmentedOptions.logo.alt}`));\n\t}\n\n\tlogLine(chalk.gray(`- owner: ${augmentedOptions.owner}`));\n\tlogLine(chalk.gray(`- repository: ${augmentedOptions.repository}`));\n\tlogLine(chalk.gray(`- title: ${augmentedOptions.title}`));\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAElB,SAAS,eAAe;AAQjB,SAAS,mBAAmB,kBAAmC;AACrE,UAAQ;AACR,UAAQ,MAAM,KAAK,uCAAuC,CAAC;AAC3D,UAAQ,MAAM,KAAK,kBAAkB,iBAAiB,WAAW,EAAE,CAAC;AACpE,UAAQ,MAAM,KAAK,mBAAmB,iBAAiB,MAAM,MAAM,EAAE,CAAC;AACtE,UAAQ,MAAM,KAAK,gBAAgB,iBAAiB,MAAM,MAAM,EAAE,CAAC;AAEnE,MAAI,iBAAiB,OAAO;AAC3B,YAAQ,MAAM,KAAK,YAAY,iBAAiB,MAAM,IAAI,EAAE,CAAC;AAC7D,YAAQ,MAAM,KAAK,kBAAkB,iBAAiB,MAAM,KAAK,EAAE,CAAC;AAAA,EACrE;AAEA,MAAI,iBAAiB,MAAM;AAC1B,YAAQ,MAAM,KAAK,WAAW,iBAAiB,KAAK,GAAG,EAAE,CAAC;AAC1D,YAAQ,MAAM,KAAK,eAAe,iBAAiB,KAAK,GAAG,EAAE,CAAC;AAAA,EAC/D;AAEA,UAAQ,MAAM,KAAK,YAAY,iBAAiB,KAAK,EAAE,CAAC;AACxD,UAAQ,MAAM,KAAK,iBAAiB,iBAAiB,UAAU,EAAE,CAAC;AAClE,UAAQ,MAAM,KAAK,YAAY,iBAAiB,KAAK,EAAE,CAAC;AACzD;","names":[]}
@@ -3,6 +3,7 @@ import { z } from 'zod';
3
3
  declare const optionsSchemaShape: {
4
4
  access: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"restricted">]>>;
5
5
  author: z.ZodOptional<z.ZodString>;
6
+ auto: z.ZodOptional<z.ZodBoolean>;
6
7
  base: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"common">, z.ZodLiteral<"everything">, z.ZodLiteral<"minimum">, z.ZodLiteral<"prompt">]>>;
7
8
  description: z.ZodOptional<z.ZodString>;
8
9
  directory: z.ZodOptional<z.ZodString>;
@@ -57,6 +58,7 @@ declare const optionsSchemaShape: {
57
58
  declare const optionsSchema: z.ZodObject<{
58
59
  access: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"restricted">]>>;
59
60
  author: z.ZodOptional<z.ZodString>;
61
+ auto: z.ZodOptional<z.ZodBoolean>;
60
62
  base: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"common">, z.ZodLiteral<"everything">, z.ZodLiteral<"minimum">, z.ZodLiteral<"prompt">]>>;
61
63
  description: z.ZodOptional<z.ZodString>;
62
64
  directory: z.ZodOptional<z.ZodString>;
@@ -110,6 +112,7 @@ declare const optionsSchema: z.ZodObject<{
110
112
  }, "strip", z.ZodTypeAny, {
111
113
  access?: "public" | "restricted" | undefined;
112
114
  author?: string | undefined;
115
+ auto?: boolean | undefined;
113
116
  base?: "common" | "everything" | "minimum" | "prompt" | undefined;
114
117
  description?: string | undefined;
115
118
  directory?: string | undefined;
@@ -157,6 +160,7 @@ declare const optionsSchema: z.ZodObject<{
157
160
  }, {
158
161
  access?: "public" | "restricted" | undefined;
159
162
  author?: string | undefined;
163
+ auto?: boolean | undefined;
160
164
  base?: "common" | "everything" | "minimum" | "prompt" | undefined;
161
165
  description?: string | undefined;
162
166
  directory?: string | undefined;
@@ -2,6 +2,7 @@ import { z } from "zod";
2
2
  const optionsSchemaShape = {
3
3
  access: z.union([z.literal("public"), z.literal("restricted")]).optional(),
4
4
  author: z.string().optional(),
5
+ auto: z.boolean().optional(),
5
6
  base: z.union([
6
7
  z.literal("common"),
7
8
  z.literal("everything"),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/options/optionsSchema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const optionsSchemaShape = {\n\taccess: z.union([z.literal(\"public\"), z.literal(\"restricted\")]).optional(),\n\tauthor: z.string().optional(),\n\tbase: z\n\t\t.union([\n\t\t\tz.literal(\"common\"),\n\t\t\tz.literal(\"everything\"),\n\t\t\tz.literal(\"minimum\"),\n\t\t\tz.literal(\"prompt\"),\n\t\t])\n\t\t.optional(),\n\tdescription: z.string().optional(),\n\tdirectory: z.string().optional(),\n\temail: z\n\t\t.object({\n\t\t\tgithub: z.string().email(),\n\t\t\tnpm: z.string().email(),\n\t\t})\n\t\t.optional(),\n\texcludeAllContributors: z.boolean().optional(),\n\texcludeCompliance: z.boolean().optional(),\n\texcludeLintDeprecation: z.boolean().optional(),\n\texcludeLintESLint: z.boolean().optional(),\n\texcludeLintJSDoc: z.boolean().optional(),\n\texcludeLintJson: z.boolean().optional(),\n\texcludeLintKnip: z.boolean().optional(),\n\texcludeLintMd: z.boolean().optional(),\n\texcludeLintPackageJson: z.boolean().optional(),\n\texcludeLintPackages: z.boolean().optional(),\n\texcludeLintPerfectionist: z.boolean().optional(),\n\texcludeLintRegex: z.boolean().optional(),\n\texcludeLintSpelling: z.boolean().optional(),\n\texcludeLintStrict: z.boolean().optional(),\n\texcludeLintStylistic: z.boolean().optional(),\n\texcludeLintYml: z.boolean().optional(),\n\texcludeReleases: z.boolean().optional(),\n\texcludeRenovate: z.boolean().optional(),\n\texcludeTests: z.boolean().optional(),\n\tfunding: z.string().optional(),\n\tguide: z.string().url().optional(),\n\tguideTitle: z.string().optional(),\n\tkeywords: z.array(z.string()).optional(),\n\tlogo: z.string().optional(),\n\tlogoAlt: z.string().optional(),\n\tmode: z\n\t\t.union([z.literal(\"create\"), z.literal(\"initialize\"), z.literal(\"migrate\")])\n\t\t.optional(),\n\toffline: z.boolean().optional(),\n\towner: z.string().optional(),\n\tpreserveGeneratedFrom: z.boolean().optional(),\n\trepository: z.string().optional(),\n\tskipAllContributorsApi: z.boolean().optional(),\n\tskipGitHubApi: z.boolean().optional(),\n\tskipInstall: z.boolean().optional(),\n\tskipRemoval: z.boolean().optional(),\n\tskipRestore: z.boolean().optional(),\n\tskipUninstall: z.boolean().optional(),\n\ttitle: z.string().optional(),\n};\n\nexport const optionsSchema = z.object(optionsSchemaShape);\n"],"mappings":"AAAA,SAAS,SAAS;AAEX,MAAM,qBAAqB;AAAA,EACjC,QAAQ,EAAE,MAAM,CAAC,EAAE,QAAQ,QAAQ,GAAG,EAAE,QAAQ,YAAY,CAAC,CAAC,EAAE,SAAS;AAAA,EACzE,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,MAAM,EACJ,MAAM;AAAA,IACN,EAAE,QAAQ,QAAQ;AAAA,IAClB,EAAE,QAAQ,YAAY;AAAA,IACtB,EAAE,QAAQ,SAAS;AAAA,IACnB,EAAE,QAAQ,QAAQ;AAAA,EACnB,CAAC,EACA,SAAS;AAAA,EACX,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,OAAO,EACL,OAAO;AAAA,IACP,QAAQ,EAAE,OAAO,EAAE,MAAM;AAAA,IACzB,KAAK,EAAE,OAAO,EAAE,MAAM;AAAA,EACvB,CAAC,EACA,SAAS;AAAA,EACX,wBAAwB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC7C,mBAAmB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACxC,wBAAwB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC7C,mBAAmB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACxC,kBAAkB,EAAE,QAAQ,EAAE,SAAS;A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S;AAAA,EAChC,wBAAwB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC7C,eAAe,EAAE,QAAQ,EAAE,SAAS;AAAA,EACpC,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,eAAe,EAAE,QAAQ,EAAE,SAAS;AAAA,EACpC,OAAO,EAAE,OAAO,EAAE,SAAS;AAC5B;AAEO,MAAM,gBAAgB,EAAE,OAAO,kBAAkB;","names":[]}
1
+ {"version":3,"sources":["../../../src/shared/options/optionsSchema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const optionsSchemaShape = {\n\taccess: z.union([z.literal(\"public\"), z.literal(\"restricted\")]).optional(),\n\tauthor: z.string().optional(),\n\tauto: z.boolean().optional(),\n\tbase: z\n\t\t.union([\n\t\t\tz.literal(\"common\"),\n\t\t\tz.literal(\"everything\"),\n\t\t\tz.literal(\"minimum\"),\n\t\t\tz.literal(\"prompt\"),\n\t\t])\n\t\t.optional(),\n\tdescription: z.string().optional(),\n\tdirectory: z.string().optional(),\n\temail: z\n\t\t.object({\n\t\t\tgithub: z.string().email(),\n\t\t\tnpm: z.string().email(),\n\t\t})\n\t\t.optional(),\n\texcludeAllContributors: z.boolean().optional(),\n\texcludeCompliance: z.boolean().optional(),\n\texcludeLintDeprecation: z.boolean().optional(),\n\texcludeLintESLint: z.boolean().optional(),\n\texcludeLintJSDoc: z.boolean().optional(),\n\texcludeLintJson: z.boolean().optional(),\n\texcludeLintKnip: z.boolean().optional(),\n\texcludeLintMd: z.boolean().optional(),\n\texcludeLintPackageJson: z.boolean().optional(),\n\texcludeLintPackages: z.boolean().optional(),\n\texcludeLintPerfectionist: z.boolean().optional(),\n\texcludeLintRegex: z.boolean().optional(),\n\texcludeLintSpelling: z.boolean().optional(),\n\texcludeLintStrict: z.boolean().optional(),\n\texcludeLintStylistic: z.boolean().optional(),\n\texcludeLintYml: z.boolean().optional(),\n\texcludeReleases: z.boolean().optional(),\n\texcludeRenovate: z.boolean().optional(),\n\texcludeTests: z.boolean().optional(),\n\tfunding: z.string().optional(),\n\tguide: z.string().url().optional(),\n\tguideTitle: z.string().optional(),\n\tkeywords: z.array(z.string()).optional(),\n\tlogo: z.string().optional(),\n\tlogoAlt: z.string().optional(),\n\tmode: z\n\t\t.union([z.literal(\"create\"), z.literal(\"initialize\"), z.literal(\"migrate\")])\n\t\t.optional(),\n\toffline: z.boolean().optional(),\n\towner: z.string().optional(),\n\tpreserveGeneratedFrom: z.boolean().optional(),\n\trepository: z.string().optional(),\n\tskipAllContributorsApi: z.boolean().optional(),\n\tskipGitHubApi: z.boolean().optional(),\n\tskipInstall: z.boolean().optional(),\n\tskipRemoval: z.boolean().optional(),\n\tskipRestore: z.boolean().optional(),\n\tskipUninstall: z.boolean().optional(),\n\ttitle: z.string().optional(),\n};\n\nexport const optionsSchema = z.object(optionsSchemaShape);\n"],"mappings":"AAAA,SAAS,SAAS;AAEX,MAAM,qBAAqB;AAAA,EACjC,QAAQ,EAAE,MAAM,CAAC,EAAE,QAAQ,QAAQ,GAAG,EAAE,QAAQ,YAAY,CAAC,CAAC,EAAE,SAAS;AAAA,EACzE,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,MAAM,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC3B,MAAM,EACJ,MAAM;AAAA,IACN,EAAE,QAAQ,QAAQ;AAAA,IAClB,EAAE,QAAQ,YAAY;AAAA,IACtB,EAAE,QAAQ,SAAS;AAAA,IACnB,EAAE,QAAQ,QAAQ;AAAA,EACnB,CAAC,EACA,SAAS;AAAA,EACX,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,OAAO,EACL,OAAO;AAAA,IACP,QAAQ,EAAE,OAAO,EAAE,MAAM;AAAA,IACzB,KAAK,EAAE,OAAO,EAA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AAE,QAAQ,QAAQ,GAAG,EAAE,QAAQ,YAAY,GAAG,EAAE,QAAQ,SAAS,CAAC,CAAC,EAC1E,SAAS;AAAA,EACX,SAAS,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC9B,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,uBAAuB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC5C,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,wBAAwB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC7C,eAAe,EAAE,QAAQ,EAAE,SAAS;AAAA,EACpC,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,eAAe,EAAE,QAAQ,EAAE,SAAS;AAAA,EACpC,OAAO,EAAE,OAAO,EAAE,SAAS;AAC5B;AAEO,MAAM,gBAAgB,EAAE,OAAO,kBAAkB;","names":[]}
@@ -9,6 +9,7 @@ import { ensureRepositoryExists } from "./ensureRepositoryExists.js";
9
9
  import { getBase } from "./getBase.js";
10
10
  import { getGitHub } from "./getGitHub.js";
11
11
  import { getPrefillOrPromptedOption } from "./getPrefillOrPromptedOption.js";
12
+ import { logInferredOptions } from "./logInferredOptions.js";
12
13
  import { optionsSchema } from "./optionsSchema.js";
13
14
  async function readOptions(args, mode, promptedOptions = {}) {
14
15
  const defaults = createOptionDefaults(promptedOptions);
@@ -24,6 +25,7 @@ async function readOptions(args, mode, promptedOptions = {}) {
24
25
  const mappedOptions = {
25
26
  access: values.access,
26
27
  author: values.author,
28
+ auto: !!values.auto,
27
29
  base: values.base,
28
30
  description: values.description,
29
31
  directory: values.directory,
@@ -81,23 +83,31 @@ async function readOptions(args, mode, promptedOptions = {}) {
81
83
  };
82
84
  }
83
85
  const options = optionsParseResult.data;
84
- options.owner ??= await getPrefillOrPromptedOption(
86
+ const ownerOption = await getPrefillOrPromptedOption(
87
+ "owner",
88
+ !!mappedOptions.auto,
85
89
  "What organization or user will the repository be under?",
86
90
  defaults.owner
87
91
  );
92
+ options.owner ??= ownerOption.value;
88
93
  if (!options.owner) {
89
94
  return {
90
95
  cancelled: true,
96
+ error: ownerOption.error,
91
97
  options
92
98
  };
93
99
  }
94
- options.repository ??= await getPrefillOrPromptedOption(
100
+ const repositoryOption = await getPrefillOrPromptedOption(
101
+ "repository",
102
+ !!mappedOptions.auto,
95
103
  "What will the kebab-case name of the repository be?",
96
104
  defaults.repository
97
105
  );
106
+ options.repository ??= repositoryOption.value;
98
107
  if (!options.repository) {
99
108
  return {
100
109
  cancelled: true,
110
+ error: repositoryOption.error,
101
111
  options
102
112
  };
103
113
  }
@@ -110,47 +120,71 @@ async function readOptions(args, mode, promptedOptions = {}) {
110
120
  }
111
121
  );
112
122
  if (!repository) {
113
- return { cancelled: true, options };
123
+ return { cancelled: true, error: repositoryOption.error, options };
114
124
  }
115
- options.description ??= await getPrefillOrPromptedOption(
125
+ const descriptionOption = await getPrefillOrPromptedOption(
126
+ "description",
127
+ !!mappedOptions.auto,
116
128
  "How would you describe the new package?",
117
129
  async () => await defaults.description() ?? "A very lovely package. Hooray!"
118
130
  );
131
+ options.description ??= descriptionOption.value;
119
132
  if (!options.description) {
120
- return { cancelled: true, options };
133
+ return { cancelled: true, error: descriptionOption.error, options };
121
134
  }
122
- options.title ??= await getPrefillOrPromptedOption(
135
+ const titleOption = await getPrefillOrPromptedOption(
136
+ "title",
137
+ !!mappedOptions.auto,
123
138
  "What will the Title Case title of the repository be?",
124
139
  async () => await defaults.title() ?? titleCase(repository).replaceAll("-", " ")
125
140
  );
141
+ options.title ??= titleOption.value;
126
142
  if (!options.title) {
127
- return { cancelled: true, options };
143
+ return { cancelled: true, error: titleOption.error, options };
128
144
  }
129
145
  let guide;
130
146
  if (options.guide) {
131
- const title = options.guideTitle ?? await getPrefillOrPromptedOption(
132
- "What is the title text for the guide?"
133
- );
134
- if (!title) {
135
- return { cancelled: true, options };
147
+ if (options.guideTitle) {
148
+ guide = { href: options.guide, title: options.guideTitle };
149
+ } else {
150
+ const titleOption2 = await getPrefillOrPromptedOption(
151
+ "getPrefillOrPromptedOption",
152
+ !!mappedOptions.auto,
153
+ "What is the title text for the guide?"
154
+ );
155
+ if (!titleOption2.value) {
156
+ return { cancelled: true, error: titleOption2.error, options };
157
+ }
158
+ guide = { href: options.guide, title: titleOption2.value };
136
159
  }
137
- guide = { href: options.guide, title };
138
160
  }
139
161
  let logo;
140
162
  if (options.logo) {
141
- const alt = options.logoAlt ?? await getPrefillOrPromptedOption(
142
- "What is the alt text (non-visual description) of the logo?"
143
- );
144
- if (!alt) {
145
- return { cancelled: true, options };
163
+ if (options.logoAlt) {
164
+ logo = { alt: options.logoAlt, src: options.logo };
165
+ } else {
166
+ const logoAltOption = await getPrefillOrPromptedOption(
167
+ "getPrefillOrPromptedOption",
168
+ !!mappedOptions.auto,
169
+ "What is the alt text (non-visual description) of the logo?"
170
+ );
171
+ if (!logoAltOption.value) {
172
+ return { cancelled: true, error: logoAltOption.error, options };
173
+ }
174
+ logo = { alt: logoAltOption.value, src: options.logo };
146
175
  }
147
- logo = { alt, src: options.logo };
148
176
  }
149
- const email = options.email ?? await defaults.email() ?? await getPrefillOrPromptedOption(
150
- "What email should be used in package.json and .md files?"
151
- );
177
+ let email = options.email ?? await defaults.email();
152
178
  if (!email) {
153
- return { cancelled: true, options };
179
+ const emailOption = await getPrefillOrPromptedOption(
180
+ "email",
181
+ !!mappedOptions.auto,
182
+ "What email should be used in package.json and .md files?"
183
+ );
184
+ if (!emailOption.value) {
185
+ return { cancelled: true, error: emailOption.error, options };
186
+ }
187
+ email = { github: emailOption.value, npm: emailOption.value };
154
188
  }
155
189
  const augmentedOptions = await augmentOptionsWithExcludes({
156
190
  ...options,
@@ -158,7 +192,7 @@ async function readOptions(args, mode, promptedOptions = {}) {
158
192
  author: options.author ?? await defaults.owner(),
159
193
  description: options.description,
160
194
  directory: options.directory ?? promptedOptions.directory ?? options.repository,
161
- email: typeof email === "string" ? { github: email, npm: email } : email,
195
+ email,
162
196
  funding: options.funding ?? await defaults.funding(),
163
197
  guide,
164
198
  logo,
@@ -173,6 +207,9 @@ async function readOptions(args, mode, promptedOptions = {}) {
173
207
  options
174
208
  };
175
209
  }
210
+ if (options.auto) {
211
+ logInferredOptions(augmentedOptions);
212
+ }
176
213
  return {
177
214
  cancelled: false,
178
215
  github,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Mode, OptionsGuide, PromptedOptions } from \"../types.js\";\nimport { Options, OptionsLogo } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { createOptionDefaults } from \"./createOptionDefaults/index.js\";\nimport { detectEmailRedundancy } from \"./detectEmailRedundancy.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { getBase } from \"./getBase.js\";\nimport { GitHub, getGitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { optionsSchema } from \"./optionsSchema.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\terror?: string | z.ZodError<object>;\n\toptions: object;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(\n\targs: string[],\n\tmode: Mode,\n\tpromptedOptions: PromptedOptions = {},\n): Promise<OptionsParseResult> {\n\tconst defaults = createOptionDefaults(promptedOptions);\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tif (mode === \"migrate\" && !values.base) {\n\t\tvalues.base = await getBase();\n\t}\n\n\tconst mappedOptions = {\n\t\taccess: values.access,\n\t\tauthor: values.author,\n\t\tbase: values.base,\n\t\tdescription: values.description,\n\t\tdirectory: values.directory,\n\t\temail:\n\t\t\tvalues.email ?? values[\"email-github\"] ?? values[\"email-npm\"]\n\t\t\t\t? {\n\t\t\t\t\t\tgithub: values.email ?? values[\"email-github\"],\n\t\t\t\t\t\tnpm: values.email ?? values[\"email-npm\"],\n\t\t\t\t }\n\t\t\t\t: undefined,\n\t\texcludeAllContributors: values[\"exclude-all-contributors\"],\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeLintDeprecation: values[\"exclude-lint-deprecation\"],\n\t\texcludeLintESLint: values[\"exclude-lint-eslint\"],\n\t\texcludeLintJSDoc: values[\"exclude-lint-jsdoc\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintRegex: values[\"exclude-lint-regex\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintStrict: values[\"exclude-lint-strict\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\tguide: values.guide,\n\t\tlogo: values.logo,\n\t\toffline: values.offline,\n\t\towner: values.owner,\n\t\tpreserveGeneratedFrom:\n\t\t\tvalues[\"preserve-generated-from\"] ?? values.owner === \"JoshuaKGoldberg\",\n\t\trepository: values.repository,\n\t\tskipAllContributorsApi:\n\t\t\tvalues[\"skip-all-contributors-api\"] ?? values.offline,\n\t\tskipGitHubApi: values[\"skip-github-api\"] ?? values.offline,\n\t\tskipInstall: values[\"skip-install\"],\n\t\tskipRemoval: values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst emailError = detectEmailRedundancy(values);\n\tif (emailError) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: emailError,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: optionsParseResult.error,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\toptions.owner ??= await getPrefillOrPromptedOption(\n\t\t\"What organization or user will the repository be under?\",\n\t\tdefaults.owner,\n\t);\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\toptions.repository ??= await getPrefillOrPromptedOption(\n\t\t\"What will the kebab-case name of the repository be?\",\n\t\tdefaults.repository,\n\t);\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { github, repository } = await ensureRepositoryExists(\n\t\toptions.skipGitHubApi\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", getGitHub),\n\t\t{\n\t\t\tmode,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\tif (!repository) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\toptions.description ??= await getPrefillOrPromptedOption(\n\t\t\"How would you describe the new package?\",\n\t\tasync () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t);\n\tif (!options.description) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\toptions.title ??= await getPrefillOrPromptedOption(\n\t\t\"What will the Title Case title of the repository be?\",\n\t\tasync () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t);\n\tif (!options.title) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\tlet guide: OptionsGuide | undefined;\n\n\tif (options.guide) {\n\t\tconst title =\n\t\t\toptions.guideTitle ??\n\t\t\t(await getPrefillOrPromptedOption(\n\t\t\t\t\"What is the title text for the guide?\",\n\t\t\t));\n\t\tif (!title) {\n\t\t\treturn { cancelled: true, options };\n\t\t}\n\n\t\tguide = { href: options.guide, title };\n\t}\n\n\tlet logo: OptionsLogo | undefined;\n\n\tif (options.logo) {\n\t\tconst alt =\n\t\t\toptions.logoAlt ??\n\t\t\t(await getPrefillOrPromptedOption(\n\t\t\t\t\"What is the alt text (non-visual description) of the logo?\",\n\t\t\t));\n\t\tif (!alt) {\n\t\t\treturn { cancelled: true, options };\n\t\t}\n\n\t\tlogo = { alt, src: options.logo };\n\t}\n\n\tconst email =\n\t\toptions.email ??\n\t\t(await defaults.email()) ??\n\t\t(await getPrefillOrPromptedOption(\n\t\t\t\"What email should be used in package.json and .md files?\",\n\t\t));\n\tif (!email) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\taccess: options.access ?? \"public\",\n\t\tauthor: options.author ?? (await defaults.owner()),\n\t\tdescription: options.description,\n\t\tdirectory:\n\t\t\toptions.directory ?? promptedOptions.directory ?? options.repository,\n\t\temail: typeof email === \"string\" ? { github: email, npm: email } : email,\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\tguide,\n\t\tlogo,\n\t\tmode,\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\treturn {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AAQ,KAAK;AAAA,EACjC;AAEA,QAAM,QACL,QAAQ,SACP,MAAM,SAAS,MAAM,KACrB,MAAM;AAAA,IACN;AAAA,EACD;AACD,MAAI,CAAC,OAAO;AACX,WAAO,EAAE,WAAW,MAAM,QAAQ;AAAA,EACnC;AAEA,QAAM,mBAAmB,MAAM,2BAA2B;AAAA,IACzD,GAAG;AAAA,IACH,QAAQ,QAAQ,UAAU;AAAA,IAC1B,QAAQ,QAAQ,UAAW,MAAM,SAAS,MAAM;AAAA,IAChD,aAAa,QAAQ;AAAA,IACrB,WACC,QAAQ,aAAa,gBAAgB,aAAa,QAAQ;AAAA,IAC3D,OAAO,OAAO,UAAU,WAAW,EAAE,QAAQ,OAAO,KAAK,MAAM,IAAI;AAAA,IACnE,SAAS,QAAQ,WAAY,MAAM,SAAS,QAAQ;AAAA,IACpD;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,QAAQ;AAAA,IACf;AAAA,IACA,OAAO,QAAQ;AAAA,EAChB,CAAC;AAED,MAAI,CAAC,kBAAkB;AACtB,WAAO;AAAA,MACN,WAAW;AAAA,MACX;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AAAA,IACN,WAAW;AAAA,IACX;AAAA,IACA,SAAS;AAAA,EACV;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Mode, OptionsGuide, PromptedOptions } from \"../types.js\";\nimport { Options, OptionsLogo } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { createOptionDefaults } from \"./createOptionDefaults/index.js\";\nimport { detectEmailRedundancy } from \"./detectEmailRedundancy.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { getBase } from \"./getBase.js\";\nimport { GitHub, getGitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { logInferredOptions } from \"./logInferredOptions.js\";\nimport { optionsSchema } from \"./optionsSchema.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\terror?: string | z.ZodError<object>;\n\toptions: object;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(\n\targs: string[],\n\tmode: Mode,\n\tpromptedOptions: PromptedOptions = {},\n): Promise<OptionsParseResult> {\n\tconst defaults = createOptionDefaults(promptedOptions);\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tif (mode === \"migrate\" && !values.base) {\n\t\tvalues.base = await getBase();\n\t}\n\n\tconst mappedOptions = {\n\t\taccess: values.access,\n\t\tauthor: values.author,\n\t\tauto: !!values.auto,\n\t\tbase: values.base,\n\t\tdescription: values.description,\n\t\tdirectory: values.directory,\n\t\temail:\n\t\t\tvalues.email ?? values[\"email-github\"] ?? values[\"email-npm\"]\n\t\t\t\t? {\n\t\t\t\t\t\tgithub: values.email ?? values[\"email-github\"],\n\t\t\t\t\t\tnpm: values.email ?? values[\"email-npm\"],\n\t\t\t\t }\n\t\t\t\t: undefined,\n\t\texcludeAllContributors: values[\"exclude-all-contributors\"],\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeLintDeprecation: values[\"exclude-lint-deprecation\"],\n\t\texcludeLintESLint: values[\"exclude-lint-eslint\"],\n\t\texcludeLintJSDoc: values[\"exclude-lint-jsdoc\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintRegex: values[\"exclude-lint-regex\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintStrict: values[\"exclude-lint-strict\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\tguide: values.guide,\n\t\tlogo: values.logo,\n\t\toffline: values.offline,\n\t\towner: values.owner,\n\t\tpreserveGeneratedFrom:\n\t\t\tvalues[\"preserve-generated-from\"] ?? values.owner === \"JoshuaKGoldberg\",\n\t\trepository: values.repository,\n\t\tskipAllContributorsApi:\n\t\t\tvalues[\"skip-all-contributors-api\"] ?? values.offline,\n\t\tskipGitHubApi: values[\"skip-github-api\"] ?? values.offline,\n\t\tskipInstall: values[\"skip-install\"],\n\t\tskipRemoval: values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst emailError = detectEmailRedundancy(values);\n\tif (emailError) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: emailError,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: optionsParseResult.error,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\tconst ownerOption = await getPrefillOrPromptedOption(\n\t\t\"owner\",\n\t\t!!mappedOptions.auto,\n\t\t\"What organization or user will the repository be under?\",\n\t\tdefaults.owner,\n\t);\n\n\toptions.owner ??= ownerOption.value;\n\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: ownerOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst repositoryOption = await getPrefillOrPromptedOption(\n\t\t\"repository\",\n\t\t!!mappedOptions.auto,\n\t\t\"What will the kebab-case name of the repository be?\",\n\t\tdefaults.repository,\n\t);\n\n\toptions.repository ??= repositoryOption.value;\n\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: repositoryOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { github, repository } = await ensureRepositoryExists(\n\t\toptions.skipGitHubApi\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", getGitHub),\n\t\t{\n\t\t\tmode,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\n\tif (!repository) {\n\t\treturn { cancelled: true, error: repositoryOption.error, options };\n\t}\n\n\tconst descriptionOption = await getPrefillOrPromptedOption(\n\t\t\"description\",\n\t\t!!mappedOptions.auto,\n\t\t\"How would you describe the new package?\",\n\t\tasync () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t);\n\n\toptions.description ??= descriptionOption.value;\n\n\tif (!options.description) {\n\t\treturn { cancelled: true, error: descriptionOption.error, options };\n\t}\n\n\tconst titleOption = await getPrefillOrPromptedOption(\n\t\t\"title\",\n\t\t!!mappedOptions.auto,\n\t\t\"What will the Title Case title of the repository be?\",\n\t\tasync () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t);\n\n\toptions.title ??= titleOption.value;\n\n\tif (!options.title) {\n\t\treturn { cancelled: true, error: titleOption.error, options };\n\t}\n\n\tlet guide: OptionsGuide | undefined;\n\n\tif (options.guide) {\n\t\tif (options.guideTitle) {\n\t\t\tguide = { href: options.guide, title: options.guideTitle };\n\t\t} else {\n\t\t\tconst titleOption = await getPrefillOrPromptedOption(\n\t\t\t\t\"getPrefillOrPromptedOption\",\n\t\t\t\t!!mappedOptions.auto,\n\t\t\t\t\"What is the title text for the guide?\",\n\t\t\t);\n\n\t\t\tif (!titleOption.value) {\n\t\t\t\treturn { cancelled: true, error: titleOption.error, options };\n\t\t\t}\n\n\t\t\tguide = { href: options.guide, title: titleOption.value };\n\t\t}\n\t}\n\n\tlet logo: OptionsLogo | undefined;\n\n\tif (options.logo) {\n\t\tif (options.logoAlt) {\n\t\t\tlogo = { alt: options.logoAlt, src: options.logo };\n\t\t} else {\n\t\t\tconst logoAltOption = await getPrefillOrPromptedOption(\n\t\t\t\t\"getPrefillOrPromptedOption\",\n\t\t\t\t!!mappedOptions.auto,\n\t\t\t\t\"What is the alt text (non-visual description) of the logo?\",\n\t\t\t);\n\n\t\t\tif (!logoAltOption.value) {\n\t\t\t\treturn { cancelled: true, error: logoAltOption.error, options };\n\t\t\t}\n\n\t\t\tlogo = { alt: logoAltOption.value, src: options.logo };\n\t\t}\n\t}\n\n\tlet email = options.email ?? (await defaults.email());\n\n\tif (!email) {\n\t\tconst emailOption = await getPrefillOrPromptedOption(\n\t\t\t\"email\",\n\t\t\t!!mappedOptions.auto,\n\t\t\t\"What email should be used in package.json and .md files?\",\n\t\t);\n\n\t\tif (!emailOption.value) {\n\t\t\treturn { cancelled: true, error: emailOption.error, options };\n\t\t}\n\n\t\temail = { github: emailOption.value, npm: emailOption.value };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\taccess: options.access ?? \"public\",\n\t\tauthor: options.author ?? (await defaults.owner()),\n\t\tdescription: options.description,\n\t\tdirectory:\n\t\t\toptions.directory ?? promptedOptions.directory ?? options.repository,\n\t\temail,\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\tguide,\n\t\tlogo,\n\t\tmode,\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tif (options.auto) {\n\t\tlogInferredOptions(augmentedOptions);\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAG1B,SAAS,mBAAmB;AAG5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AACvC,SAAS,eAAe;AACxB,SAAiB,iBAAiB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAmB9B,eAAsB,YACrB,MACA,MACA,kBAAmC,CAAC,GACN;AAC9B,QAAM,WAAW,qBAAqB,eAAe;AACrD,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT,CAAC;AAED,MAAI,SAAS,aAAa,CAAC,OAAO,MAAM;AACvC,WAAO,OAAO,MAAM,QAAQ;AAAA,EAC7B;AAEA,QAAM,gBAAgB;AAAA,IACrB,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,IACf,MAAM,CAAC,CAAC,OAAO;AAAA,IACf,MAAM,OAAO;AAAA,IACb,aAAa,OAAO;AAAA,IACpB,WAAW,OAAO;AAAA,IAClB,OACC,OAAO,SAAS,OAAO,cAAc,KAAK,OAAO,WAAW,IACzD;AAAA,MACA,QAAQ,OAAO,SAAS,OAAO,cAAc;AAAA,MAC7C,KAAK,OAAO,SAAS,OAAO,WAAW;AAAA,IACvC,IACA;AAAA,IACJ,wBAAwB,OAAO,0BAA0B;AAAA,IACzD,mBAAmB,OAAO,oBAAoB;AAAA,IAC9C,wBAAwB,OAAO,0BAA0B;AAAA,IACzD,mBAAmB,OAAO,qBAAqB;AAAA,IAC/C,kBAAk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,OAAO,KAAK,YAAY,MAAM;AAAA,EAC7D;AAEA,QAAM,mBAAmB,MAAM,2BAA2B;AAAA,IACzD,GAAG;AAAA,IACH,QAAQ,QAAQ,UAAU;AAAA,IAC1B,QAAQ,QAAQ,UAAW,MAAM,SAAS,MAAM;AAAA,IAChD,aAAa,QAAQ;AAAA,IACrB,WACC,QAAQ,aAAa,gBAAgB,aAAa,QAAQ;AAAA,IAC3D;AAAA,IACA,SAAS,QAAQ,WAAY,MAAM,SAAS,QAAQ;AAAA,IACpD;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,QAAQ;AAAA,IACf;AAAA,IACA,OAAO,QAAQ;AAAA,EAChB,CAAC;AAED,MAAI,CAAC,kBAAkB;AACtB,WAAO;AAAA,MACN,WAAW;AAAA,MACX;AAAA,IACD;AAAA,EACD;AAEA,MAAI,QAAQ,MAAM;AACjB,uBAAmB,gBAAgB;AAAA,EACpC;AAEA,SAAO;AAAA,IACN,WAAW;AAAA,IACX;AAAA,IACA,SAAS;AAAA,EACV;AACD;","names":["titleOption"]}
@@ -70,7 +70,7 @@ interface Options {
70
70
  funding?: string;
71
71
  guide?: OptionsGuide;
72
72
  keywords?: string[];
73
- logo: OptionsLogo | undefined;
73
+ logo?: OptionsLogo;
74
74
  mode: Mode;
75
75
  offline?: boolean;
76
76
  owner: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-typescript-app",
3
- "version": "1.45.0",
3
+ "version": "1.46.0",
4
4
  "description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. ๐Ÿ’",
5
5
  "repository": {
6
6
  "type": "git",
@@ -90,7 +90,7 @@
90
90
  "globby": "^14.0.0",
91
91
  "husky": "^8.0.3",
92
92
  "jsonc-eslint-parser": "^2.3.0",
93
- "knip": "2.41.2",
93
+ "knip": "2.41.3",
94
94
  "lint-staged": "^15.0.0",
95
95
  "markdownlint": "^0.32.0",
96
96
  "markdownlint-cli": "^0.37.0",