create-typescript-app 1.29.52 → 1.31.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.
Files changed (63) hide show
  1. package/README.md +7 -5
  2. package/lib/bin/index.js +5 -4
  3. package/lib/bin/index.js.map +1 -1
  4. package/lib/bin/mode.d.ts +1 -1
  5. package/lib/bin/mode.js.map +1 -1
  6. package/lib/create/createRerunSuggestion.js +15 -1
  7. package/lib/create/createRerunSuggestion.js.map +1 -1
  8. package/lib/create/index.js +2 -2
  9. package/lib/create/index.js.map +1 -1
  10. package/lib/initialize/index.js +2 -2
  11. package/lib/initialize/index.js.map +1 -1
  12. package/lib/migrate/index.js +2 -2
  13. package/lib/migrate/index.js.map +1 -1
  14. package/lib/shared/options/args.d.ts +30 -0
  15. package/lib/shared/options/args.js +10 -0
  16. package/lib/shared/options/args.js.map +1 -1
  17. package/lib/shared/options/augmentOptionsWithExcludes.js +30 -0
  18. package/lib/shared/options/augmentOptionsWithExcludes.js.map +1 -1
  19. package/lib/shared/options/detectEmailRedundancy.d.ts +8 -0
  20. package/lib/shared/options/detectEmailRedundancy.js +16 -0
  21. package/lib/shared/options/detectEmailRedundancy.js.map +1 -0
  22. package/lib/shared/options/getPrefillOrPromptedOption.js +1 -2
  23. package/lib/shared/options/getPrefillOrPromptedOption.js.map +1 -1
  24. package/lib/shared/options/optionsSchema.d.ts +174 -0
  25. package/lib/shared/options/optionsSchema.js +52 -0
  26. package/lib/shared/options/optionsSchema.js.map +1 -0
  27. package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/index.d.ts +8 -4
  28. package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/index.js +15 -10
  29. package/lib/shared/options/readOptionDefaults/index.js.map +1 -0
  30. package/lib/shared/options/readOptionDefaults/parsePackageAuthor.js.map +1 -0
  31. package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.d.ts +6 -0
  32. package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.js +16 -0
  33. package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.js.map +1 -0
  34. package/lib/shared/options/readOptions.d.ts +1 -1
  35. package/lib/shared/options/readOptions.js +47 -45
  36. package/lib/shared/options/readOptions.js.map +1 -1
  37. package/lib/shared/types.d.ts +18 -3
  38. package/lib/steps/finalizeDependencies.js +0 -2
  39. package/lib/steps/finalizeDependencies.js.map +1 -1
  40. package/lib/steps/uninstallPackages.js +1 -0
  41. package/lib/steps/uninstallPackages.js.map +1 -1
  42. package/lib/steps/updateLocalFiles.js +1 -4
  43. package/lib/steps/updateLocalFiles.js.map +1 -1
  44. package/lib/steps/writing/creation/createESLintRC.js +26 -42
  45. package/lib/steps/writing/creation/createESLintRC.js.map +1 -1
  46. package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js +2 -2
  47. package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js.map +1 -1
  48. package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.d.ts +1 -1
  49. package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js.map +1 -1
  50. package/lib/steps/writing/creation/dotGitHub/workflows.js +31 -32
  51. package/lib/steps/writing/creation/dotGitHub/workflows.js.map +1 -1
  52. package/lib/steps/writing/creation/rootFiles.js +1 -1
  53. package/lib/steps/writing/creation/rootFiles.js.map +1 -1
  54. package/lib/steps/writing/creation/writePackageJson.js +1 -2
  55. package/lib/steps/writing/creation/writePackageJson.js.map +1 -1
  56. package/package.json +2 -4
  57. package/lib/shared/options/readGitAndNpmDefaults/index.js.map +0 -1
  58. package/lib/shared/options/readGitAndNpmDefaults/parsePackageAuthor.js.map +0 -1
  59. package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.d.ts +0 -3
  60. package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.js +0 -8
  61. package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.js.map +0 -1
  62. /package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/parsePackageAuthor.d.ts +0 -0
  63. /package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/parsePackageAuthor.js +0 -0
package/README.md CHANGED
@@ -26,11 +26,7 @@
26
26
  <img alt="TypeScript: Strict 💪" src="https://img.shields.io/badge/typescript-strict_💪-21bb42.svg" />
27
27
  </p>
28
28
 
29
- Note that this template is early stage, opinionated, and not endorsed by the TypeScript team.
30
- It can be configured to set up a _lot_ of tooling out of the box.
31
- Each of the included tools exists for a good reason and provides real value.
32
-
33
- If you don't want to use any particular tool, you can always remove it manually.
29
+ <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">
34
30
 
35
31
  ## Getting Started
36
32
 
@@ -47,6 +43,12 @@ Use the corresponding docs page to get started:
47
43
  - [Initializing from the template](./docs/Initialization.md): creating a new repository with the [_Use this template_](https://github.com/JoshuaKGoldberg/create-typescript-app/generate) button on GitHub
48
44
  - [Migrating an existing repository](./docs/Migration.md): adding this template's tooling on top of an existing repository
49
45
 
46
+ Note that this template is early stage, opinionated, and not endorsed by the TypeScript team.
47
+ It can be configured to set up a _lot_ of tooling out of the box.
48
+ Each of the included tools exists for a good reason and provides real value.
49
+
50
+ If you don't want to use any particular tool, you can always remove it manually.
51
+
50
52
  ## Explainer
51
53
 
52
54
  This template is available for anybody who wants to set up a Node application using TypeScript.
package/lib/bin/index.js CHANGED
@@ -43,7 +43,7 @@ async function bin(args) {
43
43
  return 1;
44
44
  }
45
45
  const runners = { create, initialize, migrate };
46
- const { code, options, zodError } = await runners[mode](args);
46
+ const { code, error, options } = await runners[mode](args);
47
47
  prompts.log.info(
48
48
  [
49
49
  chalk.italic(`Tip: to run again with the same input values, use:`),
@@ -52,9 +52,10 @@ async function bin(args) {
52
52
  );
53
53
  if (code) {
54
54
  logLine();
55
- if (zodError) {
56
- const validationError = fromZodError(zodError);
57
- logLine(chalk.red(validationError));
55
+ if (error) {
56
+ logLine(
57
+ chalk.red(typeof error === "string" ? error : fromZodError(error))
58
+ );
58
59
  logLine();
59
60
  }
60
61
  prompts.cancel(
@@ -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 { promptForMode } from \"./mode.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\tprompts.intro(\n\t\t[\n\t\t\tchalk.greenBright(`Welcome to`),\n\t\t\tchalk.bgGreenBright.black(`create-typescript-app`),\n\t\t\tchalk.greenBright(`! 🎉`),\n\t\t].join(\" \"),\n\t);\n\n\tlogLine();\n\tlogLine(\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);\n\tlogLine(\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\tmode: { type: \"string\" },\n\t\t},\n\t\tstrict: false,\n\t});\n\n\tconst mode = 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, options, zodError } = await runners[mode](args);\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(mode, options)),\n\t\t].join(\" \"),\n\t);\n\n\tif (code) {\n\t\tlogLine();\n\n\t\tif (zodError) {\n\t\t\tconst validationError = fromZodError(zodError);\n\t\t\tlogLine(chalk.red(validationError));\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,qBAAqB;AAE9B,MAAM,mBAAmB,CAAC,SACzB,aAAa,IAAI;AAElB,eAAsB,IAAI,MAAgB;AACzC,UAAQ,MAAM;AAEd,UAAQ;AAAA,IACP;AAAA,MACC,MAAM,YAAY,YAAY;AAAA,MAC9B,MAAM,cAAc,MAAM,uBAAuB;AAAA,MACjD,MAAM,YAAY,aAAM;AAAA,IACzB,EAAE,KAAK,GAAG;AAAA,EACX;AAEA,UAAQ;AACR;AAAA,IACC,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AACA;AAAA,IACC,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AAEA,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,MACR,MAAM,EAAE,MAAM,SAAS;AAAA,IACxB;AAAA,IACA,QAAQ;AAAA,EACT,CAAC;AAED,QAAM,OAAO,MAAM,cAAc,OAAO,IAAI;AAC5C,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,SAAS,SAAS,IAAI,MAAM,QAAQ,IAAI,EAAE,IAAI;AAE5D,UAAQ,IAAI;AAAA,IACX;AAAA,MACC,MAAM,OAAO,oDAAoD;AAAA,MACjE,MAAM,KAAK,sBAAsB,MAAM,OAAO,CAAC;AAAA,IAChD,EAAE,KAAK,GAAG;AAAA,EACX;AAEA,MAAI,MAAM;AACT,YAAQ;AAER,QAAI,UAAU;AACb,YAAM,kBAAkB,aAAa,QAAQ;AAC7C,cAAQ,MAAM,IAAI,eAAe,CAAC;AAClC,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 { promptForMode } from \"./mode.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\tprompts.intro(\n\t\t[\n\t\t\tchalk.greenBright(`Welcome to`),\n\t\t\tchalk.bgGreenBright.black(`create-typescript-app`),\n\t\t\tchalk.greenBright(`! 🎉`),\n\t\t].join(\" \"),\n\t);\n\n\tlogLine();\n\tlogLine(\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);\n\tlogLine(\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\tmode: { type: \"string\" },\n\t\t},\n\t\tstrict: false,\n\t});\n\n\tconst mode = 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);\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(mode, 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,qBAAqB;AAE9B,MAAM,mBAAmB,CAAC,SACzB,aAAa,IAAI;AAElB,eAAsB,IAAI,MAAgB;AACzC,UAAQ,MAAM;AAEd,UAAQ;AAAA,IACP;AAAA,MACC,MAAM,YAAY,YAAY;AAAA,MAC9B,MAAM,cAAc,MAAM,uBAAuB;AAAA,MACjD,MAAM,YAAY,aAAM;AAAA,IACzB,EAAE,KAAK,GAAG;AAAA,EACX;AAEA,UAAQ;AACR;AAAA,IACC,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AACA;AAAA,IACC,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AAEA,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,MACR,MAAM,EAAE,MAAM,SAAS;AAAA,IACxB;AAAA,IACA,QAAQ;AAAA,EACT,CAAC;AAED,QAAM,OAAO,MAAM,cAAc,OAAO,IAAI;AAC5C,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,IAAI;AAEzD,UAAQ,IAAI;AAAA,IACX;AAAA,MACC,MAAM,OAAO,oDAAoD;AAAA,MACjE,MAAM,KAAK,sBAAsB,MAAM,OAAO,CAAC;AAAA,IAChD,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":[]}
package/lib/bin/mode.d.ts CHANGED
@@ -4,8 +4,8 @@ import { Options } from '../shared/types.js';
4
4
 
5
5
  interface ModeResult {
6
6
  code: StatusCode;
7
+ error?: string | z.ZodError<object>;
7
8
  options: Partial<Options>;
8
- zodError?: z.ZodError<object>;
9
9
  }
10
10
  type ModeRunner = (args: string[]) => Promise<ModeResult>;
11
11
  type Mode = "create" | "initialize" | "migrate";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bin/mode.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport z from \"zod\";\n\nimport { StatusCode } from \"../shared/codes.js\";\nimport { filterPromptCancel } from \"../shared/prompts.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport interface ModeResult {\n\tcode: StatusCode;\n\toptions: Partial<Options>;\n\tzodError?: z.ZodError<object>;\n}\n\nexport type ModeRunner = (args: string[]) => Promise<ModeResult>;\n\nexport type Mode = \"create\" | \"initialize\" | \"migrate\";\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\nexport async function promptForMode(input: boolean | string | undefined) {\n\tif (input) {\n\t\tif (!isMode(input)) {\n\t\t\treturn new Error(\n\t\t\t\t`Unknown --mode: ${input}. Allowed modes are: ${allowedModes.join(\n\t\t\t\t\t\", \",\n\t\t\t\t)}.`,\n\t\t\t);\n\t\t}\n\n\t\treturn input;\n\t}\n\n\tconst label = (base: string, text: string) => `${chalk.bold(base)} ${text}`;\n\n\tconst selection = filterPromptCancel(\n\t\t(await prompts.select({\n\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: label(\"create\", \"a new repository in a child directory\"),\n\t\t\t\t\tvalue: \"create\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\"initialize\",\n\t\t\t\t\t\t\"a freshly repository in the current directory\",\n\t\t\t\t\t),\n\t\t\t\t\tvalue: \"initialize\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\"migrate\",\n\t\t\t\t\t\t\"an existing repository in the current directory\",\n\t\t\t\t\t),\n\t\t\t\t\tvalue: \"migrate\",\n\t\t\t\t},\n\t\t\t],\n\t\t})) as Mode | symbol,\n\t);\n\n\treturn selection;\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAIlB,SAAS,0BAA0B;AAanC,MAAM,eAAe,CAAC,UAAU,cAAc,SAAS;AAEvD,SAAS,OAAO,OAAwC;AACvD,SAAO,aAAa,SAAS,KAAa;AAC3C;AAEA,eAAsB,cAAc,OAAqC;AACxE,MAAI,OAAO;AACV,QAAI,CAAC,OAAO,KAAK,GAAG;AACnB,aAAO,IAAI;AAAA,QACV,mBAAmB,KAAK,wBAAwB,aAAa;AAAA,UAC5D;AAAA,QACD,CAAC;AAAA,MACF;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AAEA,QAAM,QAAQ,CAAC,MAAc,SAAiB,GAAG,MAAM,KAAK,IAAI,CAAC,IAAI,IAAI;AAEzE,QAAM,YAAY;AAAA,IAChB,MAAM,QAAQ,OAAO;AAAA,MACrB,SAAS,MAAM,KAAK,yCAAyC;AAAA,MAC7D,SAAS;AAAA,QACR;AAAA,UACC,OAAO,MAAM,UAAU,uCAAuC;AAAA,UAC9D,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,OAAO;AAAA,YACN;AAAA,YACA;AAAA,UACD;AAAA,UACA,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,OAAO;AAAA,YACN;AAAA,YACA;AAAA,UACD;AAAA,UACA,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AAEA,SAAO;AACR;","names":[]}
1
+ {"version":3,"sources":["../../src/bin/mode.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport z from \"zod\";\n\nimport { StatusCode } from \"../shared/codes.js\";\nimport { filterPromptCancel } from \"../shared/prompts.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport interface ModeResult {\n\tcode: StatusCode;\n\terror?: string | z.ZodError<object>;\n\toptions: Partial<Options>;\n}\n\nexport type ModeRunner = (args: string[]) => Promise<ModeResult>;\n\nexport type Mode = \"create\" | \"initialize\" | \"migrate\";\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\nexport async function promptForMode(input: boolean | string | undefined) {\n\tif (input) {\n\t\tif (!isMode(input)) {\n\t\t\treturn new Error(\n\t\t\t\t`Unknown --mode: ${input}. Allowed modes are: ${allowedModes.join(\n\t\t\t\t\t\", \",\n\t\t\t\t)}.`,\n\t\t\t);\n\t\t}\n\n\t\treturn input;\n\t}\n\n\tconst label = (base: string, text: string) => `${chalk.bold(base)} ${text}`;\n\n\tconst selection = filterPromptCancel(\n\t\t(await prompts.select({\n\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: label(\"create\", \"a new repository in a child directory\"),\n\t\t\t\t\tvalue: \"create\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\"initialize\",\n\t\t\t\t\t\t\"a freshly repository in the current directory\",\n\t\t\t\t\t),\n\t\t\t\t\tvalue: \"initialize\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\"migrate\",\n\t\t\t\t\t\t\"an existing repository in the current directory\",\n\t\t\t\t\t),\n\t\t\t\t\tvalue: \"migrate\",\n\t\t\t\t},\n\t\t\t],\n\t\t})) as Mode | symbol,\n\t);\n\n\treturn selection;\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAIlB,SAAS,0BAA0B;AAanC,MAAM,eAAe,CAAC,UAAU,cAAc,SAAS;AAEvD,SAAS,OAAO,OAAwC;AACvD,SAAO,aAAa,SAAS,KAAa;AAC3C;AAEA,eAAsB,cAAc,OAAqC;AACxE,MAAI,OAAO;AACV,QAAI,CAAC,OAAO,KAAK,GAAG;AACnB,aAAO,IAAI;AAAA,QACV,mBAAmB,KAAK,wBAAwB,aAAa;AAAA,UAC5D;AAAA,QACD,CAAC;AAAA,MACF;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AAEA,QAAM,QAAQ,CAAC,MAAc,SAAiB,GAAG,MAAM,KAAK,IAAI,CAAC,IAAI,IAAI;AAEzE,QAAM,YAAY;AAAA,IAChB,MAAM,QAAQ,OAAO;AAAA,MACrB,SAAS,MAAM,KAAK,yCAAyC;AAAA,MAC7D,SAAS;AAAA,QACR;AAAA,UACC,OAAO,MAAM,UAAU,uCAAuC;AAAA,UAC9D,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,OAAO;AAAA,YACN;AAAA,YACA;AAAA,UACD;AAAA,UACA,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,OAAO;AAAA,YACN;AAAA,YACA;AAAA,UACD;AAAA,UACA,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AAEA,SAAO;AACR;","names":[]}
@@ -5,7 +5,21 @@ function getFirstMatchingArg(key) {
5
5
  );
6
6
  }
7
7
  function createRerunSuggestion(mode, options) {
8
- const args = Object.entries(options).filter(([, value]) => !!value).map(([key, value]) => {
8
+ const optionsNormalized = {
9
+ ...options,
10
+ ...options.email ? {
11
+ email: void 0,
12
+ emailGitHub: options.email.github,
13
+ emailNpm: options.email.npm
14
+ } : { email: void 0 },
15
+ ...options.logo ? {
16
+ logo: options.logo.src,
17
+ logoAlt: options.logo.alt
18
+ } : { logo: void 0 }
19
+ };
20
+ const args = Object.entries(optionsNormalized).sort(
21
+ ([a], [b]) => a === "base" ? -1 : b === "base" ? 1 : a.localeCompare(b)
22
+ ).filter(([, value]) => !!value).map(([key, value]) => {
9
23
  const valueStringified = `${value}`;
10
24
  return `--${getFirstMatchingArg(key)} ${valueStringified.includes(" ") ? `"${value}"` : value}`;
11
25
  }).join(" ");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { Mode } from \"../bin/mode.js\";\nimport { allArgOptions } from \"../shared/options/args.js\";\nimport { Options } from \"../shared/types.js\";\n\nfunction getFirstMatchingArg(key: string) {\n\treturn Object.keys(allArgOptions).find(\n\t\t(arg) => arg.replaceAll(\"-\", \"\") === key.toLowerCase(),\n\t);\n}\n\nexport function createRerunSuggestion(\n\tmode: Mode,\n\toptions: Partial<Options>,\n): string {\n\tconst args = Object.entries(options)\n\t\t.filter(([, value]) => !!value)\n\t\t.map(([key, value]) => {\n\t\t\tconst valueStringified = `${value}`;\n\t\t\treturn `--${getFirstMatchingArg(key)} ${\n\t\t\t\tvalueStringified.includes(\" \") ? `\"${value}\"` : value\n\t\t\t}`;\n\t\t})\n\t\t.join(\" \");\n\n\treturn `npx create-typescript-app --mode ${mode} ${args}`;\n}\n"],"mappings":"AACA,SAAS,qBAAqB;AAG9B,SAAS,oBAAoB,KAAa;AACzC,SAAO,OAAO,KAAK,aAAa,EAAE;AAAA,IACjC,CAAC,QAAQ,IAAI,WAAW,KAAK,EAAE,MAAM,IAAI,YAAY;AAAA,EACtD;AACD;AAEO,SAAS,sBACf,MACA,SACS;AACT,QAAM,OAAO,OAAO,QAAQ,OAAO,EACjC,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC,KAAK,EAC7B,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AACtB,UAAM,mBAAmB,GAAG,KAAK;AACjC,WAAO,KAAK,oBAAoB,GAAG,CAAC,IACnC,iBAAiB,SAAS,GAAG,IAAI,IAAI,KAAK,MAAM,KACjD;AAAA,EACD,CAAC,EACA,KAAK,GAAG;AAEV,SAAO,oCAAoC,IAAI,IAAI,IAAI;AACxD;","names":[]}
1
+ {"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { Mode } from \"../bin/mode.js\";\nimport { allArgOptions } from \"../shared/options/args.js\";\nimport { Options } from \"../shared/types.js\";\n\nfunction getFirstMatchingArg(key: string) {\n\treturn Object.keys(allArgOptions).find(\n\t\t(arg) => arg.replaceAll(\"-\", \"\") === key.toLowerCase(),\n\t);\n}\n\nexport function createRerunSuggestion(\n\tmode: Mode,\n\toptions: Partial<Options>,\n): string {\n\tconst optionsNormalized = {\n\t\t...options,\n\t\t...(options.email\n\t\t\t? {\n\t\t\t\t\temail: undefined,\n\t\t\t\t\temailGitHub: options.email.github,\n\t\t\t\t\temailNpm: options.email.npm,\n\t\t\t }\n\t\t\t: { email: undefined }),\n\t\t...(options.logo\n\t\t\t? {\n\t\t\t\t\tlogo: options.logo.src,\n\t\t\t\t\tlogoAlt: options.logo.alt,\n\t\t\t }\n\t\t\t: { logo: undefined }),\n\t};\n\n\tconst args = Object.entries(optionsNormalized)\n\t\t.sort(([a], [b]) =>\n\t\t\ta === \"base\" ? -1 : b === \"base\" ? 1 : a.localeCompare(b),\n\t\t)\n\t\t.filter(([, value]) => !!value)\n\t\t.map(([key, value]) => {\n\t\t\tconst valueStringified = `${value}`;\n\t\t\treturn `--${getFirstMatchingArg(key)} ${\n\t\t\t\tvalueStringified.includes(\" \") ? `\"${value}\"` : value\n\t\t\t}`;\n\t\t})\n\t\t.join(\" \");\n\n\treturn `npx create-typescript-app --mode ${mode} ${args}`;\n}\n"],"mappings":"AACA,SAAS,qBAAqB;AAG9B,SAAS,oBAAoB,KAAa;AACzC,SAAO,OAAO,KAAK,aAAa,EAAE;AAAA,IACjC,CAAC,QAAQ,IAAI,WAAW,KAAK,EAAE,MAAM,IAAI,YAAY;AAAA,EACtD;AACD;AAEO,SAAS,sBACf,MACA,SACS;AACT,QAAM,oBAAoB;AAAA,IACzB,GAAG;AAAA,IACH,GAAI,QAAQ,QACT;AAAA,MACA,OAAO;AAAA,MACP,aAAa,QAAQ,MAAM;AAAA,MAC3B,UAAU,QAAQ,MAAM;AAAA,IACxB,IACA,EAAE,OAAO,OAAU;AAAA,IACtB,GAAI,QAAQ,OACT;AAAA,MACA,MAAM,QAAQ,KAAK;AAAA,MACnB,SAAS,QAAQ,KAAK;AAAA,IACtB,IACA,EAAE,MAAM,OAAU;AAAA,EACtB;AAEA,QAAM,OAAO,OAAO,QAAQ,iBAAiB,EAC3C;AAAA,IAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MACb,MAAM,SAAS,KAAK,MAAM,SAAS,IAAI,EAAE,cAAc,CAAC;AAAA,EACzD,EACC,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC,KAAK,EAC7B,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AACtB,UAAM,mBAAmB,GAAG,KAAK;AACjC,WAAO,KAAK,oBAAoB,GAAG,CAAC,IACnC,iBAAiB,SAAS,GAAG,IAAI,IAAI,KAAK,MAAM,KACjD;AAAA,EACD,CAAC,EACA,KAAK,GAAG;AAEV,SAAO,oCAAoC,IAAI,IAAI,IAAI;AACxD;","names":[]}
@@ -12,8 +12,8 @@ async function create(args) {
12
12
  if (inputs.cancelled) {
13
13
  return {
14
14
  code: StatusCodes.Cancelled,
15
- options: inputs.options,
16
- zodError: inputs.zodError
15
+ error: inputs.error,
16
+ options: inputs.options
17
17
  };
18
18
  }
19
19
  const wat = await createAndEnterRepository(inputs.options.repository);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/create/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nimport { ModeResult } from \"../bin/mode.js\";\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { createAndEnterRepository } from \"./createAndEnterRepository.js\";\nimport { createRerunSuggestion } from \"./createRerunSuggestion.js\";\nimport { createWithOptions } from \"./createWithOptions.js\";\n\nexport async function create(args: string[]): Promise<ModeResult> {\n\tconst inputs = await readOptions(args);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\toptions: inputs.options,\n\t\t\tzodError: inputs.zodError,\n\t\t};\n\t}\n\n\tconst wat = await createAndEnterRepository(inputs.options.repository);\n\tif (!wat) {\n\t\tprompts.outro(\n\t\t\tchalk.red(\n\t\t\t\t`The ${inputs.options.repository} directory already exists. Please remove the directory or try a different name.`,\n\t\t\t),\n\t\t);\n\t\treturn { code: StatusCodes.Failure, options: inputs.options };\n\t}\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tconst { sentToGitHub } = await createWithOptions(inputs);\n\n\t\t\t\toutro(\n\t\t\t\t\tsentToGitHub\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"Now all you have to do is populate the repository's ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"Consider creating a GitHub repository from the new directory:\",\n\t\t\t\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t\t\t\t`cd ${inputs.options.repository}`,\n\t\t\t\t\t\t\t\t\t\tcreateRerunSuggestion(\"initialize\", {\n\t\t\t\t\t\t\t\t\t\t\t...inputs.options,\n\t\t\t\t\t\t\t\t\t\t\tskipGitHubApi: false,\n\t\t\t\t\t\t\t\t\t\t\tskipInstall: false,\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t\t\t\t`git commit -m \"feat: initial commit ✨\"`,\n\t\t\t\t\t\t\t\t\t\t`git push -u origin main`,\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"If you do, be sure to populate its ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ],\n\t\t\t\t);\n\t\t\t},\n\t\t\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAGlB,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,gCAAgC;AACzC,SAAS,6BAA6B;AACtC,SAAS,yBAAyB;AAElC,eAAsB,OAAO,MAAqC;AACjE,QAAM,SAAS,MAAM,YAAY,IAAI;AACrC,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,SAAS,OAAO;AAAA,MAChB,UAAU,OAAO;AAAA,IAClB;AAAA,EACD;AAEA,QAAM,MAAM,MAAM,yBAAyB,OAAO,QAAQ,UAAU;AACpE,MAAI,CAAC,KAAK;AACT,YAAQ;AAAA,MACP,MAAM;AAAA,QACL,OAAO,OAAO,QAAQ,UAAU;AAAA,MACjC;AAAA,IACD;AACA,WAAO,EAAE,MAAM,YAAY,SAAS,SAAS,OAAO,QAAQ;AAAA,EAC7D;AAEA,SAAO;AAAA,IACN,MAAM,MAAM,aAAa;AAAA,MACxB,KAAK,YAAY;AAChB,cAAM,EAAE,aAAa,IAAI,MAAM,kBAAkB,MAAM;AAEvD;AAAA,UACC,eACG;AAAA,YACA;AAAA,cACC,OACC;AAAA,YACF;AAAA,UACA,IACA;AAAA,YACA;AAAA,cACC,OACC;AAAA,cACD,OAAO;AAAA,gBACN,MAAM,OAAO,QAAQ,UAAU;AAAA,gBAC/B,sBAAsB,cAAc;AAAA,kBACnC,GAAG,OAAO;AAAA,kBACV,eAAe;AAAA,kBACf,aAAa;AAAA,gBACd,CAAC;AAAA,gBACD;AAAA,gBACA;AAAA,gBACA;AAAA,cACD;AAAA,YACD;AAAA,YACA;AAAA,cACC,OACC;AAAA,YACF;AAAA,UACA;AAAA,QACJ;AAAA,MACD;AAAA,MACA,aAAa,OAAO,QAAQ;AAAA,IAC7B,CAAC;AAAA,IACD,SAAS,OAAO;AAAA,EACjB;AACD;","names":[]}
1
+ {"version":3,"sources":["../../src/create/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nimport { ModeResult } from \"../bin/mode.js\";\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { createAndEnterRepository } from \"./createAndEnterRepository.js\";\nimport { createRerunSuggestion } from \"./createRerunSuggestion.js\";\nimport { createWithOptions } from \"./createWithOptions.js\";\n\nexport async function create(args: string[]): Promise<ModeResult> {\n\tconst inputs = await readOptions(args);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\terror: inputs.error,\n\t\t\toptions: inputs.options,\n\t\t};\n\t}\n\n\tconst wat = await createAndEnterRepository(inputs.options.repository);\n\tif (!wat) {\n\t\tprompts.outro(\n\t\t\tchalk.red(\n\t\t\t\t`The ${inputs.options.repository} directory already exists. Please remove the directory or try a different name.`,\n\t\t\t),\n\t\t);\n\t\treturn { code: StatusCodes.Failure, options: inputs.options };\n\t}\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tconst { sentToGitHub } = await createWithOptions(inputs);\n\n\t\t\t\toutro(\n\t\t\t\t\tsentToGitHub\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"Now all you have to do is populate the repository's ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"Consider creating a GitHub repository from the new directory:\",\n\t\t\t\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t\t\t\t`cd ${inputs.options.repository}`,\n\t\t\t\t\t\t\t\t\t\tcreateRerunSuggestion(\"initialize\", {\n\t\t\t\t\t\t\t\t\t\t\t...inputs.options,\n\t\t\t\t\t\t\t\t\t\t\tskipGitHubApi: false,\n\t\t\t\t\t\t\t\t\t\t\tskipInstall: false,\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t\t\t\t`git commit -m \"feat: initial commit ✨\"`,\n\t\t\t\t\t\t\t\t\t\t`git push -u origin main`,\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"If you do, be sure to populate its ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ],\n\t\t\t\t);\n\t\t\t},\n\t\t\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAGlB,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,gCAAgC;AACzC,SAAS,6BAA6B;AACtC,SAAS,yBAAyB;AAElC,eAAsB,OAAO,MAAqC;AACjE,QAAM,SAAS,MAAM,YAAY,IAAI;AACrC,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,OAAO,OAAO;AAAA,MACd,SAAS,OAAO;AAAA,IACjB;AAAA,EACD;AAEA,QAAM,MAAM,MAAM,yBAAyB,OAAO,QAAQ,UAAU;AACpE,MAAI,CAAC,KAAK;AACT,YAAQ;AAAA,MACP,MAAM;AAAA,QACL,OAAO,OAAO,QAAQ,UAAU;AAAA,MACjC;AAAA,IACD;AACA,WAAO,EAAE,MAAM,YAAY,SAAS,SAAS,OAAO,QAAQ;AAAA,EAC7D;AAEA,SAAO;AAAA,IACN,MAAM,MAAM,aAAa;AAAA,MACxB,KAAK,YAAY;AAChB,cAAM,EAAE,aAAa,IAAI,MAAM,kBAAkB,MAAM;AAEvD;AAAA,UACC,eACG;AAAA,YACA;AAAA,cACC,OACC;AAAA,YACF;AAAA,UACA,IACA;AAAA,YACA;AAAA,cACC,OACC;AAAA,cACD,OAAO;AAAA,gBACN,MAAM,OAAO,QAAQ,UAAU;AAAA,gBAC/B,sBAAsB,cAAc;AAAA,kBACnC,GAAG,OAAO;AAAA,kBACV,eAAe;AAAA,kBACf,aAAa;AAAA,gBACd,CAAC;AAAA,gBACD;AAAA,gBACA;AAAA,gBACA;AAAA,cACD;AAAA,YACD;AAAA,YACA;AAAA,cACC,OACC;AAAA,YACF;AAAA,UACA;AAAA,QACJ;AAAA,MACD;AAAA,MACA,aAAa,OAAO,QAAQ;AAAA,IAC7B,CAAC;AAAA,IACD,SAAS,OAAO;AAAA,EACjB;AACD;","names":[]}
@@ -9,8 +9,8 @@ const initialize = async (args) => {
9
9
  if (inputs.cancelled) {
10
10
  return {
11
11
  code: StatusCodes.Cancelled,
12
- options: inputs.options,
13
- zodError: inputs.zodError
12
+ error: inputs.error,
13
+ options: inputs.options
14
14
  };
15
15
  }
16
16
  await ensureGitRepository();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/initialize/index.ts"],"sourcesContent":["import { ModeRunner } from \"../bin/mode.js\";\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { ensureGitRepository } from \"../shared/ensureGitRepository.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { initializeWithOptions } from \"./initializeWithOptions.js\";\n\nexport const initialize: ModeRunner = async (args) => {\n\tconst inputs = await readOptions(args);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\toptions: inputs.options,\n\t\t\tzodError: inputs.zodError,\n\t\t};\n\t}\n\n\tawait ensureGitRepository();\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tawait initializeWithOptions(inputs);\n\n\t\t\t\toutro([\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"You may consider committing these changes:\",\n\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t`git commit -m \"feat: initialized repo ✨`,\n\t\t\t\t\t\t\t`git push`,\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\"Otherwise, all you have to do is populate the repository's ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t},\n\t\t\t\t]);\n\t\t\t},\n\t\t\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n};\n"],"mappings":"AACA,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AAE/B,MAAM,aAAyB,OAAO,SAAS;AACrD,QAAM,SAAS,MAAM,YAAY,IAAI;AACrC,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,SAAS,OAAO;AAAA,MAChB,UAAU,OAAO;AAAA,IAClB;AAAA,EACD;AAEA,QAAM,oBAAoB;AAE1B,SAAO;AAAA,IACN,MAAM,MAAM,aAAa;AAAA,MACxB,KAAK,YAAY;AAChB,cAAM,sBAAsB,MAAM;AAElC,cAAM;AAAA,UACL;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,cACN;AAAA,cACA;AAAA,cACA;AAAA,YACD;AAAA,UACD;AAAA,UACA;AAAA,YACC,OACC;AAAA,UACF;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MACA,aAAa,OAAO,QAAQ;AAAA,IAC7B,CAAC;AAAA,IACD,SAAS,OAAO;AAAA,EACjB;AACD;","names":[]}
1
+ {"version":3,"sources":["../../src/initialize/index.ts"],"sourcesContent":["import { ModeRunner } from \"../bin/mode.js\";\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { ensureGitRepository } from \"../shared/ensureGitRepository.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { initializeWithOptions } from \"./initializeWithOptions.js\";\n\nexport const initialize: ModeRunner = async (args) => {\n\tconst inputs = await readOptions(args);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\terror: inputs.error,\n\t\t\toptions: inputs.options,\n\t\t};\n\t}\n\n\tawait ensureGitRepository();\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tawait initializeWithOptions(inputs);\n\n\t\t\t\toutro([\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"You may consider committing these changes:\",\n\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t`git commit -m \"feat: initialized repo ✨`,\n\t\t\t\t\t\t\t`git push`,\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\"Otherwise, all you have to do is populate the repository's ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t},\n\t\t\t\t]);\n\t\t\t},\n\t\t\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n};\n"],"mappings":"AACA,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AAE/B,MAAM,aAAyB,OAAO,SAAS;AACrD,QAAM,SAAS,MAAM,YAAY,IAAI;AACrC,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,OAAO,OAAO;AAAA,MACd,SAAS,OAAO;AAAA,IACjB;AAAA,EACD;AAEA,QAAM,oBAAoB;AAE1B,SAAO;AAAA,IACN,MAAM,MAAM,aAAa;AAAA,MACxB,KAAK,YAAY;AAChB,cAAM,sBAAsB,MAAM;AAElC,cAAM;AAAA,UACL;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,cACN;AAAA,cACA;AAAA,cACA;AAAA,YACD;AAAA,UACD;AAAA,UACA;AAAA,YACC,OACC;AAAA,UACF;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MACA,aAAa,OAAO,QAAQ;AAAA,IAC7B,CAAC;AAAA,IACD,SAAS,OAAO;AAAA,EACjB;AACD;","names":[]}
@@ -9,8 +9,8 @@ const migrate = async (args) => {
9
9
  if (inputs.cancelled) {
10
10
  return {
11
11
  code: StatusCodes.Cancelled,
12
- options: inputs.options,
13
- zodError: inputs.zodError
12
+ error: inputs.error,
13
+ options: inputs.options
14
14
  };
15
15
  }
16
16
  await ensureGitRepository();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/migrate/index.ts"],"sourcesContent":["import { ModeRunner } from \"../bin/mode.js\";\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { ensureGitRepository } from \"../shared/ensureGitRepository.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { migrateWithOptions } from \"./migrateWithOptions.js\";\n\nexport const migrate: ModeRunner = async (args) => {\n\tconst inputs = await readOptions(args);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\toptions: inputs.options,\n\t\t\tzodError: inputs.zodError,\n\t\t};\n\t}\n\n\tawait ensureGitRepository();\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tawait migrateWithOptions(inputs);\n\n\t\t\t\toutro([\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"You may consider committing these changes:\",\n\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t`git commit -m \"migrated repo to create-typescript-app ✨`,\n\t\t\t\t\t\t\t`git push`,\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\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n};\n"],"mappings":"AACA,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AAE5B,MAAM,UAAsB,OAAO,SAAS;AAClD,QAAM,SAAS,MAAM,YAAY,IAAI;AACrC,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,SAAS,OAAO;AAAA,MAChB,UAAU,OAAO;AAAA,IAClB;AAAA,EACD;AAEA,QAAM,oBAAoB;AAE1B,SAAO;AAAA,IACN,MAAM,MAAM,aAAa;AAAA,MACxB,KAAK,YAAY;AAChB,cAAM,mBAAmB,MAAM;AAE/B,cAAM;AAAA,UACL;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,cACN;AAAA,cACA;AAAA,cACA;AAAA,YACD;AAAA,UACD;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MACA,aAAa,OAAO,QAAQ;AAAA,IAC7B,CAAC;AAAA,IACD,SAAS,OAAO;AAAA,EACjB;AACD;","names":[]}
1
+ {"version":3,"sources":["../../src/migrate/index.ts"],"sourcesContent":["import { ModeRunner } from \"../bin/mode.js\";\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { ensureGitRepository } from \"../shared/ensureGitRepository.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { migrateWithOptions } from \"./migrateWithOptions.js\";\n\nexport const migrate: ModeRunner = async (args) => {\n\tconst inputs = await readOptions(args);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\terror: inputs.error,\n\t\t\toptions: inputs.options,\n\t\t};\n\t}\n\n\tawait ensureGitRepository();\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tawait migrateWithOptions(inputs);\n\n\t\t\t\toutro([\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"You may consider committing these changes:\",\n\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t`git commit -m \"migrated repo to create-typescript-app ✨`,\n\t\t\t\t\t\t\t`git push`,\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\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n};\n"],"mappings":"AACA,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AAE5B,MAAM,UAAsB,OAAO,SAAS;AAClD,QAAM,SAAS,MAAM,YAAY,IAAI;AACrC,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,OAAO,OAAO;AAAA,MACd,SAAS,OAAO;AAAA,IACjB;AAAA,EACD;AAEA,QAAM,oBAAoB;AAE1B,SAAO;AAAA,IACN,MAAM,MAAM,aAAa;AAAA,MACxB,KAAK,YAAY;AAChB,cAAM,mBAAmB,MAAM;AAE/B,cAAM;AAAA,UACL;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,cACN;AAAA,cACA;AAAA,cACA;AAAA,YACD;AAAA,UACD;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MACA,aAAa,OAAO,QAAQ;AAAA,IAC7B,CAAC;AAAA,IACD,SAAS,OAAO;AAAA,EACjB;AACD;","names":[]}
@@ -14,12 +14,27 @@ declare const allArgOptions: {
14
14
  readonly email: {
15
15
  readonly type: "string";
16
16
  };
17
+ readonly "email-github": {
18
+ readonly type: "string";
19
+ };
20
+ readonly "email-npm": {
21
+ readonly type: "string";
22
+ };
17
23
  readonly "exclude-compliance": {
18
24
  readonly type: "boolean";
19
25
  };
20
26
  readonly "exclude-contributors": {
21
27
  readonly type: "boolean";
22
28
  };
29
+ readonly "exclude-lint-deprecation": {
30
+ readonly type: "boolean";
31
+ };
32
+ readonly "exclude-lint-eslint": {
33
+ readonly type: "boolean";
34
+ };
35
+ readonly "exclude-lint-jsdoc": {
36
+ readonly type: "boolean";
37
+ };
23
38
  readonly "exclude-lint-json": {
24
39
  readonly type: "boolean";
25
40
  };
@@ -38,9 +53,18 @@ declare const allArgOptions: {
38
53
  readonly "exclude-lint-perfectionist": {
39
54
  readonly type: "boolean";
40
55
  };
56
+ readonly "exclude-lint-regex": {
57
+ readonly type: "boolean";
58
+ };
41
59
  readonly "exclude-lint-spelling": {
42
60
  readonly type: "boolean";
43
61
  };
62
+ readonly "exclude-lint-strict": {
63
+ readonly type: "boolean";
64
+ };
65
+ readonly "exclude-lint-stylistic": {
66
+ readonly type: "boolean";
67
+ };
44
68
  readonly "exclude-lint-yml": {
45
69
  readonly type: "boolean";
46
70
  };
@@ -56,6 +80,12 @@ declare const allArgOptions: {
56
80
  readonly funding: {
57
81
  readonly type: "string";
58
82
  };
83
+ readonly logo: {
84
+ readonly type: "string";
85
+ };
86
+ readonly "logo-alt": {
87
+ readonly type: "string";
88
+ };
59
89
  readonly owner: {
60
90
  readonly type: "string";
61
91
  };
@@ -4,20 +4,30 @@ const allArgOptions = {
4
4
  "create-repository": { type: "boolean" },
5
5
  description: { type: "string" },
6
6
  email: { type: "string" },
7
+ "email-github": { type: "string" },
8
+ "email-npm": { type: "string" },
7
9
  "exclude-compliance": { type: "boolean" },
8
10
  "exclude-contributors": { type: "boolean" },
11
+ "exclude-lint-deprecation": { type: "boolean" },
12
+ "exclude-lint-eslint": { type: "boolean" },
13
+ "exclude-lint-jsdoc": { type: "boolean" },
9
14
  "exclude-lint-json": { type: "boolean" },
10
15
  "exclude-lint-knip": { type: "boolean" },
11
16
  "exclude-lint-md": { type: "boolean" },
12
17
  "exclude-lint-package-json": { type: "boolean" },
13
18
  "exclude-lint-packages": { type: "boolean" },
14
19
  "exclude-lint-perfectionist": { type: "boolean" },
20
+ "exclude-lint-regex": { type: "boolean" },
15
21
  "exclude-lint-spelling": { type: "boolean" },
22
+ "exclude-lint-strict": { type: "boolean" },
23
+ "exclude-lint-stylistic": { type: "boolean" },
16
24
  "exclude-lint-yml": { type: "boolean" },
17
25
  "exclude-releases": { type: "boolean" },
18
26
  "exclude-renovate": { type: "boolean" },
19
27
  "exclude-tests": { type: "boolean" },
20
28
  funding: { type: "string" },
29
+ logo: { type: "string" },
30
+ "logo-alt": { type: "string" },
21
31
  owner: { type: "string" },
22
32
  repository: { type: "string" },
23
33
  "skip-github-api": { type: "boolean" },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/options/args.ts"],"sourcesContent":["export const allArgOptions = {\n\tauthor: { type: \"string\" },\n\tbase: { type: \"string\" },\n\t\"create-repository\": { type: \"boolean\" },\n\tdescription: { type: \"string\" },\n\temail: { type: \"string\" },\n\t\"exclude-compliance\": { type: \"boolean\" },\n\t\"exclude-contributors\": { type: \"boolean\" },\n\t\"exclude-lint-json\": { type: \"boolean\" },\n\t\"exclude-lint-knip\": { type: \"boolean\" },\n\t\"exclude-lint-md\": { type: \"boolean\" },\n\t\"exclude-lint-package-json\": { type: \"boolean\" },\n\t\"exclude-lint-packages\": { type: \"boolean\" },\n\t\"exclude-lint-perfectionist\": { type: \"boolean\" },\n\t\"exclude-lint-spelling\": { type: \"boolean\" },\n\t\"exclude-lint-yml\": { type: \"boolean\" },\n\t\"exclude-releases\": { type: \"boolean\" },\n\t\"exclude-renovate\": { type: \"boolean\" },\n\t\"exclude-tests\": { type: \"boolean\" },\n\tfunding: { type: \"string\" },\n\towner: { type: \"string\" },\n\trepository: { type: \"string\" },\n\t\"skip-github-api\": { type: \"boolean\" },\n\t\"skip-install\": { type: \"boolean\" },\n\t\"skip-removal\": { type: \"boolean\" },\n\t\"skip-restore\": { type: \"boolean\" },\n\t\"skip-uninstall\": { type: \"boolean\" },\n\ttitle: { type: \"string\" },\n} as const;\n"],"mappings":"AAAO,MAAM,gBAAgB;AAAA,EAC5B,QAAQ,EAAE,MAAM,SAAS;AAAA,EACzB,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,aAAa,EAAE,MAAM,SAAS;AAAA,EAC9B,OAAO,EAAE,MAAM,SAAS;AAAA,EACxB,sBAAsB,EAAE,MAAM,UAAU;AAAA,EACxC,wBAAwB,EAAE,MAAM,UAAU;AAAA,EAC1C,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,mBAAmB,EAAE,MAAM,UAAU;AAAA,EACrC,6BAA6B,EAAE,MAAM,UAAU;AAAA,EAC/C,yBAAyB,EAAE,MAAM,UAAU;AAAA,EAC3C,8BAA8B,EAAE,MAAM,UAAU;AAAA,EAChD,yBAAyB,EAAE,MAAM,UAAU;AAAA,EAC3C,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,iBAAiB,EAAE,MAAM,UAAU;AAAA,EACnC,SAAS,EAAE,MAAM,SAAS;AAAA,EAC1B,OAAO,EAAE,MAAM,SAAS;AAAA,EACxB,YAAY,EAAE,MAAM,SAAS;AAAA,EAC7B,mBAAmB,EAAE,MAAM,UAAU;AAAA,EACrC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,kBAAkB,EAAE,MAAM,UAAU;AAAA,EACpC,OAAO,EAAE,MAAM,SAAS;AACzB;","names":[]}
1
+ {"version":3,"sources":["../../../src/shared/options/args.ts"],"sourcesContent":["export const allArgOptions = {\n\tauthor: { type: \"string\" },\n\tbase: { type: \"string\" },\n\t\"create-repository\": { type: \"boolean\" },\n\tdescription: { type: \"string\" },\n\temail: { type: \"string\" },\n\t\"email-github\": { type: \"string\" },\n\t\"email-npm\": { type: \"string\" },\n\t\"exclude-compliance\": { type: \"boolean\" },\n\t\"exclude-contributors\": { type: \"boolean\" },\n\t\"exclude-lint-deprecation\": { type: \"boolean\" },\n\t\"exclude-lint-eslint\": { type: \"boolean\" },\n\t\"exclude-lint-jsdoc\": { type: \"boolean\" },\n\t\"exclude-lint-json\": { type: \"boolean\" },\n\t\"exclude-lint-knip\": { type: \"boolean\" },\n\t\"exclude-lint-md\": { type: \"boolean\" },\n\t\"exclude-lint-package-json\": { type: \"boolean\" },\n\t\"exclude-lint-packages\": { type: \"boolean\" },\n\t\"exclude-lint-perfectionist\": { type: \"boolean\" },\n\t\"exclude-lint-regex\": { type: \"boolean\" },\n\t\"exclude-lint-spelling\": { type: \"boolean\" },\n\t\"exclude-lint-strict\": { type: \"boolean\" },\n\t\"exclude-lint-stylistic\": { type: \"boolean\" },\n\t\"exclude-lint-yml\": { type: \"boolean\" },\n\t\"exclude-releases\": { type: \"boolean\" },\n\t\"exclude-renovate\": { type: \"boolean\" },\n\t\"exclude-tests\": { type: \"boolean\" },\n\tfunding: { type: \"string\" },\n\tlogo: { type: \"string\" },\n\t\"logo-alt\": { type: \"string\" },\n\towner: { type: \"string\" },\n\trepository: { type: \"string\" },\n\t\"skip-github-api\": { type: \"boolean\" },\n\t\"skip-install\": { type: \"boolean\" },\n\t\"skip-removal\": { type: \"boolean\" },\n\t\"skip-restore\": { type: \"boolean\" },\n\t\"skip-uninstall\": { type: \"boolean\" },\n\ttitle: { type: \"string\" },\n} as const;\n"],"mappings":"AAAO,MAAM,gBAAgB;AAAA,EAC5B,QAAQ,EAAE,MAAM,SAAS;AAAA,EACzB,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,aAAa,EAAE,MAAM,SAAS;AAAA,EAC9B,OAAO,EAAE,MAAM,SAAS;AAAA,EACxB,gBAAgB,EAAE,MAAM,SAAS;AAAA,EACjC,aAAa,EAAE,MAAM,SAAS;AAAA,EAC9B,sBAAsB,EAAE,MAAM,UAAU;AAAA,EACxC,wBAAwB,EAAE,MAAM,UAAU;AAAA,EAC1C,4BAA4B,EAAE,MAAM,UAAU;AAAA,EAC9C,uBAAuB,EAAE,MAAM,UAAU;AAAA,EACzC,sBAAsB,EAAE,MAAM,UAAU;AAAA,EACxC,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,mBAAmB,EAAE,MAAM,UAAU;AAAA,EACrC,6BAA6B,EAAE,MAAM,UAAU;AAAA,EAC/C,yBAAyB,EAAE,MAAM,UAAU;AAAA,EAC3C,8BAA8B,EAAE,MAAM,UAAU;AAAA,EAChD,sBAAsB,EAAE,MAAM,UAAU;AAAA,EACxC,yBAAyB,EAAE,MAAM,UAAU;AAAA,EAC3C,uBAAuB,EAAE,MAAM,UAAU;AAAA,EACzC,0BAA0B,EAAE,MAAM,UAAU;AAAA,EAC5C,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,iBAAiB,EAAE,MAAM,UAAU;AAAA,EACnC,SAAS,EAAE,MAAM,SAAS;AAAA,EAC1B,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,YAAY,EAAE,MAAM,SAAS;AAAA,EAC7B,OAAO,EAAE,MAAM,SAAS;AAAA,EACxB,YAAY,EAAE,MAAM,SAAS;AAAA,EAC7B,mBAAmB,EAAE,MAAM,UAAU;AAAA,EACrC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,kBAAkB,EAAE,MAAM,UAAU;AAAA,EACpC,OAAO,EAAE,MAAM,SAAS;AACzB;","names":[]}
@@ -11,6 +11,21 @@ const exclusionDescriptions = {
11
11
  hint: "--exclude-contributors",
12
12
  label: "Add all-contributors to track contributions and display them in a README.md table."
13
13
  },
14
+ excludeLintDeprecation: {
15
+ hint: "--exclude-lint-deprecation",
16
+ label: "Include an eslint-plugin-deprecation to reports on usage of code marked as @deprecated.",
17
+ uncommon: true
18
+ },
19
+ excludeLintESLint: {
20
+ hint: "--exclude-lint-eslint",
21
+ label: "Include eslint-plugin-eslint-comment to enforce good practices around ESLint comment directives.",
22
+ uncommon: true
23
+ },
24
+ excludeLintJSDoc: {
25
+ hint: "--exclude-lint-jsdoc",
26
+ label: "Include eslint-plugin-jsdoc to enforce good practices around JSDoc comments.",
27
+ uncommon: true
28
+ },
14
29
  excludeLintJson: {
15
30
  hint: "--exclude-lint-json",
16
31
  label: "Apply linting and sorting to *.json and *.jsonc files.",
@@ -40,11 +55,26 @@ const exclusionDescriptions = {
40
55
  label: "Apply eslint-plugin-perfectionist to ensure imports, keys, and so on are in sorted order.",
41
56
  uncommon: true
42
57
  },
58
+ excludeLintRegex: {
59
+ hint: "--exclude-lint-regex",
60
+ label: "Include eslint-plugin-regex to enforce good practices around regular expressions.",
61
+ uncommon: true
62
+ },
43
63
  excludeLintSpelling: {
44
64
  hint: "--exclude-lint-spelling",
45
65
  label: "Add cspell to spell check against dictionaries of known words.",
46
66
  uncommon: true
47
67
  },
68
+ excludeLintStrict: {
69
+ hint: "--exclude-lint-strict",
70
+ label: "Include strict logical lint rules such as typescript-eslint's strict config. ",
71
+ uncommon: true
72
+ },
73
+ excludeLintStylistic: {
74
+ hint: "--exclude-lint-stylistic",
75
+ label: "Include stylistic lint rules such as typescript-eslint's stylistic config.",
76
+ uncommon: true
77
+ },
48
78
  excludeLintYml: {
49
79
  hint: "--exclude-lint-yml",
50
80
  label: "Apply linting and sorting to *.yaml and *.yml files.",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/options/augmentOptionsWithExcludes.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nimport { filterPromptCancel } from \"../prompts.js\";\nimport { InputBase, Options } from \"../types.js\";\n\ninterface ExclusionDescription {\n\thint: string;\n\tlabel: string;\n\tuncommon?: true;\n}\n\ntype ExclusionKey = keyof Options & `exclude${string}`;\n\nconst exclusionDescriptions: Record<ExclusionKey, ExclusionDescription> = {\n\texcludeCompliance: {\n\t\thint: \"--exclude-compliance\",\n\t\tlabel:\n\t\t\t\"Add a GitHub Actions workflow to verify that PRs match an expected format.\",\n\t\tuncommon: true,\n\t},\n\texcludeContributors: {\n\t\thint: \"--exclude-contributors\",\n\t\tlabel:\n\t\t\t\"Add all-contributors to track contributions and display them in a README.md table.\",\n\t},\n\texcludeLintJson: {\n\t\thint: \"--exclude-lint-json\",\n\t\tlabel: \"Apply linting and sorting to *.json and *.jsonc files.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintKnip: {\n\t\thint: \"--exclude-lint-knip\",\n\t\tlabel: \"Add Knip to detect unused files, dependencies, and code exports.\",\n\t},\n\texcludeLintMd: {\n\t\thint: \"--exclude-lint-md\",\n\t\tlabel: \"Apply linting to *.md files.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintPackageJson: {\n\t\thint: \"--exclude-lint-package-json\",\n\t\tlabel: \"Add npm-package-json-lint to lint for package.json correctness.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintPackages: {\n\t\thint: \"--exclude-lint-packages\",\n\t\tlabel:\n\t\t\t\"Add a pnpm dedupe workflow to ensure packages aren't duplicated unnecessarily.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintPerfectionist: {\n\t\thint: \"--exclude-lint-perfectionist\",\n\t\tlabel:\n\t\t\t\"Apply eslint-plugin-perfectionist to ensure imports, keys, and so on are in sorted order.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintSpelling: {\n\t\thint: \"--exclude-lint-spelling\",\n\t\tlabel: \"Add cspell to spell check against dictionaries of known words.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintYml: {\n\t\thint: \"--exclude-lint-yml\",\n\t\tlabel: \"Apply linting and sorting to *.yaml and *.yml files.\",\n\t\tuncommon: true,\n\t},\n\texcludeReleases: {\n\t\thint: \"--exclude-releases\",\n\t\tlabel:\n\t\t\t\"Add release-it to generate changelogs, package bumps, and publishes based on conventional commits.\",\n\t},\n\texcludeRenovate: {\n\t\thint: \"--exclude-renovate\",\n\t\tlabel: \"Add a Renovate config to keep dependencies up-to-date with PRs.\",\n\t},\n\texcludeTests: {\n\t\thint: \"--exclude-tests\",\n\t\tlabel:\n\t\t\t\"Add Vitest tooling for fast unit tests, configured with coverage tracking.\",\n\t},\n};\n\nconst exclusionKeys = Object.keys(exclusionDescriptions) as ExclusionKey[];\n\nexport async function augmentOptionsWithExcludes(\n\toptions: Options,\n): Promise<Options | undefined> {\n\tif (\n\t\tObject.keys(options).some(\n\t\t\t(key) =>\n\t\t\t\tkey in exclusionDescriptions &&\n\t\t\t\toptions[key as keyof typeof options] !== undefined,\n\t\t)\n\t) {\n\t\treturn options;\n\t}\n\n\tconst base =\n\t\toptions.base ??\n\t\tfilterPromptCancel<InputBase | symbol>(\n\t\t\tawait prompts.select({\n\t\t\t\tinitialValue: \"common\" as InputBase,\n\t\t\t\tmessage: `How much tooling would you like the template to set up for you?`,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: makeLabel(\n\t\t\t\t\t\t\t\"everything\",\n\t\t\t\t\t\t\t\"The most comprehensive tooling imaginable: sorting, spellchecking, and more!\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"everything\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\thint: \"recommended\",\n\t\t\t\t\t\tlabel: makeLabel(\n\t\t\t\t\t\t\t\"common\",\n\t\t\t\t\t\t\t\"Bare starters plus testing and automation for all-contributors and releases.\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"common\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: makeLabel(\n\t\t\t\t\t\t\t\"minimum\",\n\t\t\t\t\t\t\t\"Just bare starter tooling: building, formatting, linting, and type checking.\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"minimum\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: makeLabel(\"prompt\", \"(allow me to customize)\"),\n\t\t\t\t\t\tvalue: \"prompt\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t);\n\n\tswitch (base) {\n\t\tcase undefined:\n\t\t\treturn undefined;\n\n\t\tcase \"common\":\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\texclusionKeys\n\t\t\t\t\t\t.filter((exclusion) => exclusionDescriptions[exclusion].uncommon)\n\t\t\t\t\t\t.map((exclusion) => [exclusion, options[exclusion] ?? true]),\n\t\t\t\t),\n\t\t\t};\n\n\t\tcase \"everything\":\n\t\t\treturn options;\n\n\t\tcase \"minimum\":\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\texclusionKeys.map((exclusion) => [\n\t\t\t\t\t\texclusion,\n\t\t\t\t\t\toptions[exclusion] ?? true,\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t};\n\n\t\tcase \"prompt\":\n\t\t\tconst exclusionsNotEnabled = new Set(\n\t\t\t\tfilterPromptCancel(\n\t\t\t\t\tawait prompts.multiselect({\n\t\t\t\t\t\tinitialValues: exclusionKeys,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\"Select the tooling portions you'd like to remove. All are enabled by default.\",\n\t\t\t\t\t\toptions: Object.entries(exclusionDescriptions).map(\n\t\t\t\t\t\t\t([value, { hint, label }]) => ({\n\t\t\t\t\t\t\t\thint,\n\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\tvalue: value as ExclusionKey,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\texclusionKeys.map(\n\t\t\t\t\t\t(exclusionKey) =>\n\t\t\t\t\t\t\t[exclusionKey, !exclusionsNotEnabled.has(exclusionKey)] as const,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t};\n\t}\n}\n\nfunction makeLabel(label: string, message: string) {\n\treturn [chalk.bold(label), message].join(\"\\t \");\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAElB,SAAS,0BAA0B;AAWnC,MAAM,wBAAoE;AAAA,EACzE,mBAAmB;AAAA,IAClB,MAAM;AAAA,IACN,OACC;AAAA,IACD,UAAU;AAAA,EACX;AAAA,EACA,qBAAqB;AAAA,IACpB,MAAM;AAAA,IACN,OACC;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IAChB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,EACX;AAAA,EACA,iBAAiB;AAAA,IAChB,MAAM;AAAA,IACN,OAAO;AAAA,EACR;AAAA,EACA,eAAe;AAAA,IACd,MAAM;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,EACX;AAAA,EACA,wBAAwB;AAAA,IACvB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,EACX;AAAA,EACA,qBAAqB;AAAA,IACpB,MAAM;AAAA,IACN,OACC;AAAA,IACD,UAAU;AAAA,EACX;AAAA,EACA,0BAA0B;AAAA,IACzB,MAAM;AAAA,IACN,OACC;AAAA,IACD,UAAU;AAAA,EACX;AAAA,EACA,qBAAqB;AAAA,IACpB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,EACX;AAAA,EACA,gBAAgB;AAAA,IACf,MAAM;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,EACX;AAAA,EACA,iBAAiB;AAAA,IAChB,MAAM;AAAA,IACN,OACC;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IAChB,MAAM;AAAA,IACN,OAAO;AAAA,EACR;AAAA,EACA,cAAc;AAAA,IACb,MAAM;AAAA,IACN,OACC;AAAA,EACF;AACD;AAEA,MAAM,gBAAgB,OAAO,KAAK,qBAAqB;AAEvD,eAAsB,2BACrB,SAC+B;AAC/B,MACC,OAAO,KAAK,OAAO,EAAE;AAAA,IACpB,CAAC,QACA,OAAO,yBACP,QAAQ,GAA2B,MAAM;AAAA,EAC3C,GACC;AACD,WAAO;AAAA,EACR;AAEA,QAAM,OACL,QAAQ,QACR;AAAA,IACC,MAAM,QAAQ,OAAO;AAAA,MACpB,cAAc;AAAA,MACd,SAAS;AAAA,MACT,SAAS;AAAA,QACR;AAAA,UACC,OAAO;AAAA,YACN;AAAA,YACA;AAAA,UACD;AAAA,UACA,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,OAAO;AAAA,YACN;AAAA,YACA;AAAA,UACD;AAAA,UACA,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,OAAO;AAAA,YACN;AAAA,YACA;AAAA,UACD;AAAA,UACA,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,OAAO,UAAU,UAAU,yBAAyB;AAAA,UACpD,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AAED,UAAQ,MAAM;AAAA,IACb,KAAK;AACJ,aAAO;AAAA,IAER,KAAK;AACJ,aAAO;AAAA,QACN,GAAG;AAAA,QACH,GAAG,OAAO;AAAA,UACT,cACE,OAAO,CAAC,cAAc,sBAAsB,SAAS,EAAE,QAAQ,EAC/D,IAAI,CAAC,cAAc,CAAC,WAAW,QAAQ,SAAS,KAAK,IAAI,CAAC;AAAA,QAC7D;AAAA,MACD;AAAA,IAED,KAAK;AACJ,aAAO;AAAA,IAER,KAAK;AACJ,aAAO;AAAA,QACN,GAAG;AAAA,QACH,GAAG,OAAO;AAAA,UACT,cAAc,IAAI,CAAC,cAAc;AAAA,YAChC;AAAA,YACA,QAAQ,SAAS,KAAK;AAAA,UACvB,CAAC;AAAA,QACF;AAAA,MACD;AAAA,IAED,KAAK;AACJ,YAAM,uBAAuB,IAAI;AAAA,QAChC;AAAA,UACC,MAAM,QAAQ,YAAY;AAAA,YACzB,eAAe;AAAA,YACf,SACC;AAAA,YACD,SAAS,OAAO,QAAQ,qBAAqB,EAAE;AAAA,cAC9C,CAAC,CAAC,OAAO,EAAE,MAAM,MAAM,CAAC,OAAO;AAAA,gBAC9B;AAAA,gBACA;AAAA,gBACA;AAAA,cACD;AAAA,YACD;AAAA,UACD,CAAC;AAAA,QACF;AAAA,MACD;AAEA,aAAO;AAAA,QACN,GAAG;AAAA,QACH,GAAG,OAAO;AAAA,UACT,cAAc;AAAA,YACb,CAAC,iBACA,CAAC,cAAc,CAAC,qBAAqB,IAAI,YAAY,CAAC;AAAA,UACxD;AAAA,QACD;AAAA,MACD;AAAA,EACF;AACD;AAEA,SAAS,UAAU,OAAe,SAAiB;AAClD,SAAO,CAAC,MAAM,KAAK,KAAK,GAAG,OAAO,EAAE,KAAK,IAAK;AAC/C;","names":[]}
1
+ {"version":3,"sources":["../../../src/shared/options/augmentOptionsWithExcludes.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nimport { filterPromptCancel } from \"../prompts.js\";\nimport { InputBase, Options } from \"../types.js\";\n\ninterface ExclusionDescription {\n\thint: string;\n\tlabel: string;\n\tuncommon?: true;\n}\n\ntype ExclusionKey = keyof Options & `exclude${string}`;\n\nconst exclusionDescriptions: Record<ExclusionKey, ExclusionDescription> = {\n\texcludeCompliance: {\n\t\thint: \"--exclude-compliance\",\n\t\tlabel:\n\t\t\t\"Add a GitHub Actions workflow to verify that PRs match an expected format.\",\n\t\tuncommon: true,\n\t},\n\texcludeContributors: {\n\t\thint: \"--exclude-contributors\",\n\t\tlabel:\n\t\t\t\"Add all-contributors to track contributions and display them in a README.md table.\",\n\t},\n\texcludeLintDeprecation: {\n\t\thint: \"--exclude-lint-deprecation\",\n\t\tlabel:\n\t\t\t\"Include an eslint-plugin-deprecation to reports on usage of code marked as @deprecated.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintESLint: {\n\t\thint: \"--exclude-lint-eslint\",\n\t\tlabel:\n\t\t\t\"Include eslint-plugin-eslint-comment to enforce good practices around ESLint comment directives.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintJSDoc: {\n\t\thint: \"--exclude-lint-jsdoc\",\n\t\tlabel:\n\t\t\t\"Include eslint-plugin-jsdoc to enforce good practices around JSDoc comments.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintJson: {\n\t\thint: \"--exclude-lint-json\",\n\t\tlabel: \"Apply linting and sorting to *.json and *.jsonc files.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintKnip: {\n\t\thint: \"--exclude-lint-knip\",\n\t\tlabel: \"Add Knip to detect unused files, dependencies, and code exports.\",\n\t},\n\texcludeLintMd: {\n\t\thint: \"--exclude-lint-md\",\n\t\tlabel: \"Apply linting to *.md files.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintPackageJson: {\n\t\thint: \"--exclude-lint-package-json\",\n\t\tlabel: \"Add npm-package-json-lint to lint for package.json correctness.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintPackages: {\n\t\thint: \"--exclude-lint-packages\",\n\t\tlabel:\n\t\t\t\"Add a pnpm dedupe workflow to ensure packages aren't duplicated unnecessarily.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintPerfectionist: {\n\t\thint: \"--exclude-lint-perfectionist\",\n\t\tlabel:\n\t\t\t\"Apply eslint-plugin-perfectionist to ensure imports, keys, and so on are in sorted order.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintRegex: {\n\t\thint: \"--exclude-lint-regex\",\n\t\tlabel:\n\t\t\t\"Include eslint-plugin-regex to enforce good practices around regular expressions.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintSpelling: {\n\t\thint: \"--exclude-lint-spelling\",\n\t\tlabel: \"Add cspell to spell check against dictionaries of known words.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintStrict: {\n\t\thint: \"--exclude-lint-strict\",\n\t\tlabel:\n\t\t\t\"Include strict logical lint rules such as typescript-eslint's strict config. \",\n\t\tuncommon: true,\n\t},\n\texcludeLintStylistic: {\n\t\thint: \"--exclude-lint-stylistic\",\n\t\tlabel:\n\t\t\t\"Include stylistic lint rules such as typescript-eslint's stylistic config.\",\n\t\tuncommon: true,\n\t},\n\texcludeLintYml: {\n\t\thint: \"--exclude-lint-yml\",\n\t\tlabel: \"Apply linting and sorting to *.yaml and *.yml files.\",\n\t\tuncommon: true,\n\t},\n\texcludeReleases: {\n\t\thint: \"--exclude-releases\",\n\t\tlabel:\n\t\t\t\"Add release-it to generate changelogs, package bumps, and publishes based on conventional commits.\",\n\t},\n\texcludeRenovate: {\n\t\thint: \"--exclude-renovate\",\n\t\tlabel: \"Add a Renovate config to keep dependencies up-to-date with PRs.\",\n\t},\n\texcludeTests: {\n\t\thint: \"--exclude-tests\",\n\t\tlabel:\n\t\t\t\"Add Vitest tooling for fast unit tests, configured with coverage tracking.\",\n\t},\n};\n\nconst exclusionKeys = Object.keys(exclusionDescriptions) as ExclusionKey[];\n\nexport async function augmentOptionsWithExcludes(\n\toptions: Options,\n): Promise<Options | undefined> {\n\tif (\n\t\tObject.keys(options).some(\n\t\t\t(key) =>\n\t\t\t\tkey in exclusionDescriptions &&\n\t\t\t\toptions[key as keyof typeof options] !== undefined,\n\t\t)\n\t) {\n\t\treturn options;\n\t}\n\n\tconst base =\n\t\toptions.base ??\n\t\tfilterPromptCancel<InputBase | symbol>(\n\t\t\tawait prompts.select({\n\t\t\t\tinitialValue: \"common\" as InputBase,\n\t\t\t\tmessage: `How much tooling would you like the template to set up for you?`,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: makeLabel(\n\t\t\t\t\t\t\t\"everything\",\n\t\t\t\t\t\t\t\"The most comprehensive tooling imaginable: sorting, spellchecking, and more!\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"everything\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\thint: \"recommended\",\n\t\t\t\t\t\tlabel: makeLabel(\n\t\t\t\t\t\t\t\"common\",\n\t\t\t\t\t\t\t\"Bare starters plus testing and automation for all-contributors and releases.\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"common\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: makeLabel(\n\t\t\t\t\t\t\t\"minimum\",\n\t\t\t\t\t\t\t\"Just bare starter tooling: building, formatting, linting, and type checking.\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: \"minimum\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: makeLabel(\"prompt\", \"(allow me to customize)\"),\n\t\t\t\t\t\tvalue: \"prompt\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t);\n\n\tswitch (base) {\n\t\tcase undefined:\n\t\t\treturn undefined;\n\n\t\tcase \"common\":\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\texclusionKeys\n\t\t\t\t\t\t.filter((exclusion) => exclusionDescriptions[exclusion].uncommon)\n\t\t\t\t\t\t.map((exclusion) => [exclusion, options[exclusion] ?? true]),\n\t\t\t\t),\n\t\t\t};\n\n\t\tcase \"everything\":\n\t\t\treturn options;\n\n\t\tcase \"minimum\":\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\texclusionKeys.map((exclusion) => [\n\t\t\t\t\t\texclusion,\n\t\t\t\t\t\toptions[exclusion] ?? true,\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t};\n\n\t\tcase \"prompt\":\n\t\t\tconst exclusionsNotEnabled = new Set(\n\t\t\t\tfilterPromptCancel(\n\t\t\t\t\tawait prompts.multiselect({\n\t\t\t\t\t\tinitialValues: exclusionKeys,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\"Select the tooling portions you'd like to remove. All are enabled by default.\",\n\t\t\t\t\t\toptions: Object.entries(exclusionDescriptions).map(\n\t\t\t\t\t\t\t([value, { hint, label }]) => ({\n\t\t\t\t\t\t\t\thint,\n\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\tvalue: value as ExclusionKey,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\texclusionKeys.map(\n\t\t\t\t\t\t(exclusionKey) =>\n\t\t\t\t\t\t\t[exclusionKey, !exclusionsNotEnabled.has(exclusionKey)] as const,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t};\n\t}\n}\n\nfunction makeLabel(label: string, message: string) {\n\treturn [chalk.bold(label), message].join(\"\\t \");\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,8 @@
1
+ interface EmailValues {
2
+ email?: boolean | string;
3
+ "email-github"?: boolean | string;
4
+ "email-npm"?: boolean | string;
5
+ }
6
+ declare function detectEmailRedundancy(values: EmailValues): "--email should not be specified if both --email-github and --email-npm are specified." | "If --email-github is specified, either --email or --email-npm should be." | "If --email-npm is specified, either --email or --email-github should be." | undefined;
7
+
8
+ export { EmailValues, detectEmailRedundancy };
@@ -0,0 +1,16 @@
1
+ function detectEmailRedundancy(values) {
2
+ if (values.email) {
3
+ return values["email-github"] && values["email-npm"] ? "--email should not be specified if both --email-github and --email-npm are specified." : void 0;
4
+ }
5
+ if (values["email-github"] && !values["email-npm"]) {
6
+ return "If --email-github is specified, either --email or --email-npm should be.";
7
+ }
8
+ if (values["email-npm"] && !values["email-github"]) {
9
+ return "If --email-npm is specified, either --email or --email-github should be.";
10
+ }
11
+ return void 0;
12
+ }
13
+ export {
14
+ detectEmailRedundancy
15
+ };
16
+ //# sourceMappingURL=detectEmailRedundancy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shared/options/detectEmailRedundancy.ts"],"sourcesContent":["export interface EmailValues {\n\temail?: boolean | string;\n\t\"email-github\"?: boolean | string;\n\t\"email-npm\"?: boolean | string;\n}\n\nexport function detectEmailRedundancy(values: EmailValues) {\n\tif (values.email) {\n\t\treturn values[\"email-github\"] && values[\"email-npm\"]\n\t\t\t? \"--email should not be specified if both --email-github and --email-npm are specified.\"\n\t\t\t: undefined;\n\t}\n\n\tif (values[\"email-github\"] && !values[\"email-npm\"]) {\n\t\treturn \"If --email-github is specified, either --email or --email-npm should be.\";\n\t}\n\n\tif (values[\"email-npm\"] && !values[\"email-github\"]) {\n\t\treturn \"If --email-npm is specified, either --email or --email-github should be.\";\n\t}\n\n\treturn undefined;\n}\n"],"mappings":"AAMO,SAAS,sBAAsB,QAAqB;AAC1D,MAAI,OAAO,OAAO;AACjB,WAAO,OAAO,cAAc,KAAK,OAAO,WAAW,IAChD,0FACA;AAAA,EACJ;AAEA,MAAI,OAAO,cAAc,KAAK,CAAC,OAAO,WAAW,GAAG;AACnD,WAAO;AAAA,EACR;AAEA,MAAI,OAAO,WAAW,KAAK,CAAC,OAAO,cAAc,GAAG;AACnD,WAAO;AAAA,EACR;AAEA,SAAO;AACR;","names":[]}
@@ -4,7 +4,7 @@ async function getPrefillOrPromptedOption(existingValue, message, getPlaceholder
4
4
  if (existingValue) {
5
5
  return existingValue;
6
6
  }
7
- const value = filterPromptCancel(
7
+ return filterPromptCancel(
8
8
  await prompts.text({
9
9
  message,
10
10
  placeholder: await getPlaceholder?.(),
@@ -15,7 +15,6 @@ async function getPrefillOrPromptedOption(existingValue, message, getPlaceholder
15
15
  }
16
16
  })
17
17
  );
18
- return value;
19
18
  }
20
19
  export {
21
20
  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\texistingValue: string | undefined,\n\tmessage: string,\n\tgetPlaceholder?: () => Promise<string | undefined>,\n) {\n\tif (existingValue) {\n\t\treturn existingValue;\n\t}\n\n\tconst value = 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\treturn value;\n}\n"],"mappings":"AAAA,YAAY,aAAa;AAEzB,SAAS,0BAA0B;AAEnC,eAAsB,2BACrB,eACA,SACA,gBACC;AACD,MAAI,eAAe;AAClB,WAAO;AAAA,EACR;AAEA,QAAM,QAAQ;AAAA,IACb,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;AAEA,SAAO;AACR;","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\texistingValue: string | undefined,\n\tmessage: string,\n\tgetPlaceholder?: () => Promise<string | undefined>,\n) {\n\tif (existingValue) {\n\t\treturn existingValue;\n\t}\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,eACA,SACA,gBACC;AACD,MAAI,eAAe;AAClB,WAAO;AAAA,EACR;AAEA,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":[]}