create-typescript-app 1.65.0 → 1.67.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 (38) hide show
  1. package/lib/create/createRerunSuggestion.js.map +1 -1
  2. package/lib/create/index.js.map +1 -1
  3. package/lib/shared/options/createOptionDefaults/index.js.map +1 -1
  4. package/lib/shared/options/ensureRepositoryExists.js.map +1 -1
  5. package/lib/shared/options/optionsSchema.d.ts +6 -6
  6. package/lib/shared/options/readOptions.js.map +1 -1
  7. package/lib/steps/addOwnerAsAllContributor.js.map +1 -1
  8. package/lib/steps/clearUnnecessaryFiles.js +1 -0
  9. package/lib/steps/clearUnnecessaryFiles.js.map +1 -1
  10. package/lib/steps/createJoshuaKGoldbergReplacement.js.map +1 -1
  11. package/lib/steps/finalizeDependencies.js.map +1 -1
  12. package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js +9 -9
  13. package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js.map +1 -1
  14. package/lib/steps/updateLocalFiles.js +1 -1
  15. package/lib/steps/updateLocalFiles.js.map +1 -1
  16. package/lib/steps/writing/creation/createESLintConfig.js +5 -0
  17. package/lib/steps/writing/creation/createESLintConfig.js.map +1 -1
  18. package/lib/steps/writing/creation/dotGitHub/createDevelopment/index.js.map +1 -1
  19. package/lib/steps/writing/creation/dotGitHub/createMultiWorkflowFile.d.ts +16 -0
  20. package/lib/steps/writing/creation/dotGitHub/createMultiWorkflowFile.js +33 -0
  21. package/lib/steps/writing/creation/dotGitHub/createMultiWorkflowFile.js.map +1 -0
  22. package/lib/steps/writing/creation/dotGitHub/{createWorkflowFile.d.ts → createSoloWorkflowFile.d.ts} +2 -2
  23. package/lib/steps/writing/creation/dotGitHub/{createWorkflowFile.js → createSoloWorkflowFile.js} +7 -12
  24. package/lib/steps/writing/creation/dotGitHub/createSoloWorkflowFile.js.map +1 -0
  25. package/lib/steps/writing/creation/dotGitHub/createWorkflows.d.ts +4 -12
  26. package/lib/steps/writing/creation/dotGitHub/createWorkflows.js +103 -97
  27. package/lib/steps/writing/creation/dotGitHub/createWorkflows.js.map +1 -1
  28. package/lib/steps/writing/creation/dotGitHub/formatWorkflowYaml.d.ts +3 -0
  29. package/lib/steps/writing/creation/dotGitHub/formatWorkflowYaml.js +8 -0
  30. package/lib/steps/writing/creation/dotGitHub/formatWorkflowYaml.js.map +1 -0
  31. package/lib/steps/writing/creation/dotGitHub/index.d.ts +4 -12
  32. package/lib/steps/writing/creation/dotHusky.js +1 -5
  33. package/lib/steps/writing/creation/dotHusky.js.map +1 -1
  34. package/lib/steps/writing/creation/dotVSCode.js.map +1 -1
  35. package/lib/steps/writing/creation/writePackageJson.js +3 -1
  36. package/lib/steps/writing/creation/writePackageJson.js.map +1 -1
  37. package/package.json +40 -40
  38. package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { allArgOptions } from \"../shared/options/args.js\";\nimport {\n\tExclusionKey,\n\tgetExclusions,\n} from \"../shared/options/exclusionKeys.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\nconst defaultValues = new Map([[\"access\", \"public\"]]);\n\nexport function createRerunSuggestion(options: Partial<Options>): string {\n\tconst optionsNormalized = {\n\t\t...options,\n\t\temail: undefined,\n\t\t...(options.email && {\n\t\t\temailGitHub: options.email.github,\n\t\t\temailNpm: options.email.npm,\n\t\t}),\n\t\t...(options.guide\n\t\t\t? {\n\t\t\t\t\tguide: options.guide.href,\n\t\t\t\t\tguideTitle: options.guide.title,\n\t\t\t }\n\t\t\t: { guide: 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\t...(options.offline && {\n\t\t\tskipAllContributorsApi: undefined,\n\t\t\tskipGitHubApi: undefined,\n\t\t}),\n\t};\n\n\tconst args = Object.entries(optionsNormalized)\n\t\t// Sort so the base is first, then the rest are sorted alphabetically\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 out entries with an excluded key or a default or falsy value\n\t\t.filter(\n\t\t\t([key, value]) =>\n\t\t\t\tgetExclusions(options, optionsNormalized.base)[key as ExclusionKey] ==\n\t\t\t\t\tundefined &&\n\t\t\t\t!!value &&\n\t\t\t\tvalue !== defaultValues.get(key),\n\t\t)\n\t\t.map(([key, value]) => {\n\t\t\treturn `--${getFirstMatchingArg(key)}${stringifyValue(value)}`;\n\t\t})\n\t\t.join(\" \");\n\n\treturn [\"npx create-typescript-app\", args].filter(Boolean).join(\" \");\n}\n\nfunction stringifyValue(\n\tvalue: boolean | string | string[] | undefined,\n): string {\n\tif (Array.isArray(value)) {\n\t\treturn stringifyValue(value.join(\" \"));\n\t}\n\n\tif (typeof value === \"boolean\" && value) {\n\t\treturn \"\";\n\t}\n\n\tconst valueStringified = `${value}`;\n\n\treturn valueStringified.includes(\" \")\n\t\t? ` \"${valueStringified}\"`\n\t\t: ` ${valueStringified}`;\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAC9B;AAAA,EAEC;AAAA,OACM;AAGP,SAAS,oBAAoB,KAAa;AACzC,SAAO,OAAO,KAAK,aAAa,EAAE;AAAA,IACjC,CAAC,QAAQ,IAAI,WAAW,KAAK,EAAE,MAAM,IAAI,YAAY;AAAA,EACtD;AACD;AAEA,MAAM,gBAAgB,oBAAI,IAAI,CAAC,CAAC,UAAU,QAAQ,CAAC,CAAC;AAE7C,SAAS,sBAAsB,SAAmC;AACxE,QAAM,oBAAoB;AAAA,IACzB,GAAG;AAAA,IACH,OAAO;AAAA,IAC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rB,IAAI,gBAAgB;AACxB;","names":[]}
1
+ {"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { allArgOptions } from \"../shared/options/args.js\";\nimport {\n\tExclusionKey,\n\tgetExclusions,\n} from \"../shared/options/exclusionKeys.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\nconst defaultValues = new Map([[\"access\", \"public\"]]);\n\nexport function createRerunSuggestion(options: Partial<Options>): string {\n\tconst optionsNormalized = {\n\t\t...options,\n\t\temail: undefined,\n\t\t...(options.email && {\n\t\t\temailGitHub: options.email.github,\n\t\t\temailNpm: options.email.npm,\n\t\t}),\n\t\t...(options.guide\n\t\t\t? {\n\t\t\t\t\tguide: options.guide.href,\n\t\t\t\t\tguideTitle: options.guide.title,\n\t\t\t\t}\n\t\t\t: { guide: 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\t}\n\t\t\t: { logo: undefined }),\n\t\t...(options.offline && {\n\t\t\tskipAllContributorsApi: undefined,\n\t\t\tskipGitHubApi: undefined,\n\t\t}),\n\t};\n\n\tconst args = Object.entries(optionsNormalized)\n\t\t// Sort so the base is first, then the rest are sorted alphabetically\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 out entries with an excluded key or a default or falsy value\n\t\t.filter(\n\t\t\t([key, value]) =>\n\t\t\t\tgetExclusions(options, optionsNormalized.base)[key as ExclusionKey] ==\n\t\t\t\t\tundefined &&\n\t\t\t\t!!value &&\n\t\t\t\tvalue !== defaultValues.get(key),\n\t\t)\n\t\t.map(([key, value]) => {\n\t\t\treturn `--${getFirstMatchingArg(key)}${stringifyValue(value)}`;\n\t\t})\n\t\t.join(\" \");\n\n\treturn [\"npx create-typescript-app\", args].filter(Boolean).join(\" \");\n}\n\nfunction stringifyValue(\n\tvalue: boolean | string | string[] | undefined,\n): string {\n\tif (Array.isArray(value)) {\n\t\treturn stringifyValue(value.join(\" \"));\n\t}\n\n\tif (typeof value === \"boolean\" && value) {\n\t\treturn \"\";\n\t}\n\n\tconst valueStringified = `${value}`;\n\n\treturn valueStringified.includes(\" \")\n\t\t? ` \"${valueStringified}\"`\n\t\t: ` ${valueStringified}`;\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAC9B;AAAA,EAEC;AAAA,OACM;AAGP,SAAS,oBAAoB,KAAa;AACzC,SAAO,OAAO,KAAK,aAAa,EAAE;AAAA,IACjC,CAAC,QAAQ,IAAI,WAAW,KAAK,EAAE,MAAM,IAAI,YAAY;AAAA,EACtD;AACD;AAEA,MAAM,gBAAgB,oBAAI,IAAI,CAAC,CAAC,UAAU,QAAQ,CAAC,CAAC;AAE7C,SAAS,sBAAsB,SAAmC;AACxE,QAAM,oBAAoB;AAAA,IACzB,GAAG;AAAA,IACH,OAAO;AAAA,IACP,GAAI,QAAQ,SAAS;AAAA,MACpB,aAAa,QAAQ,MAAM;AAAA,MAC3B,UAAU,QAAQ,MAAM;AAAA,IACzB;AAAA,IACA,GAAI,QAAQ,QACT;AAAA,MACA,OAAO,QAAQ,MAAM;AAAA,MACrB,YAAY,QAAQ,MAAM;AAAA,IAC3B,IACC,EAAE,OAAO,OAAU;AAAA,IACtB,GAAI,QAAQ,OACT;AAAA,MACA,MAAM,QAAQ,KAAK;AAAA,MACnB,SAAS,QAAQ,KAAK;AAAA,IACvB,IACC,EAAE,MAAM,OAAU;AAAA,IACrB,GAAI,QAAQ,WAAW;AAAA,MACtB,wBAAwB;AAAA,MACxB,eAAe;AAAA,IAChB;AAAA,EACD;AAEA,QAAM,OAAO,OAAO,QAAQ,iBAAiB,EAE3C;AAAA,IAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MACb,MAAM,SAAS,KAAK,MAAM,SAAS,IAAI,EAAE,cAAc,CAAC;AAAA,EACzD,EAEC;AAAA,IACA,CAAC,CAAC,KAAK,KAAK,MACX,cAAc,SAAS,kBAAkB,IAAI,EAAE,GAAmB,KACjE,UACD,CAAC,CAAC,SACF,UAAU,cAAc,IAAI,GAAG;AAAA,EACjC,EACC,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AACtB,WAAO,KAAK,oBAAoB,GAAG,CAAC,GAAG,eAAe,KAAK,CAAC;AAAA,EAC7D,CAAC,EACA,KAAK,GAAG;AAEV,SAAO,CAAC,6BAA6B,IAAI,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AACpE;AAEA,SAAS,eACR,OACS;AACT,MAAI,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAO,eAAe,MAAM,KAAK,GAAG,CAAC;AAAA,EACtC;AAEA,MAAI,OAAO,UAAU,aAAa,OAAO;AACxC,WAAO;AAAA,EACR;AAEA,QAAM,mBAAmB,GAAG,KAAK;AAEjC,SAAO,iBAAiB,SAAS,GAAG,IACjC,KAAK,gBAAgB,MACrB,IAAI,gBAAgB;AACxB;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/create/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { generateNextSteps } from \"../shared/generateNextSteps.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { ModeRunner } from \"../shared/types.js\";\nimport { createAndEnterGitDirectory } from \"./createAndEnterGitDirectory.js\";\nimport { createRerunSuggestion } from \"./createRerunSuggestion.js\";\nimport { createWithOptions } from \"./createWithOptions.js\";\n\nexport const create: ModeRunner = async (args, promptedOptions) => {\n\tconst inputs = await readOptions(args, \"create\", promptedOptions);\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\tif (!(await createAndEnterGitDirectory(inputs.options.directory))) {\n\t\tprompts.outro(\n\t\t\tchalk.red(\n\t\t\t\t`The ${inputs.options.directory} directory already exists and is not empty. Please clear the directory, run with --mode initialize, or try a different directory.`,\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\t\t\t\tconst nextSteps = generateNextSteps(inputs.options);\n\n\t\t\t\toutro(\n\t\t\t\t\tsentToGitHub\n\t\t\t\t\t\t? nextSteps\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({\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\tmode: \"initialize\",\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\tvariant: \"code\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t...nextSteps,\n\t\t\t\t\t\t ],\n\t\t\t\t);\n\t\t\t},\n\t\t\tskipRestore: inputs.options.skipRestore,\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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 { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { generateNextSteps } from \"../shared/generateNextSteps.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { ModeRunner } from \"../shared/types.js\";\nimport { createAndEnterGitDirectory } from \"./createAndEnterGitDirectory.js\";\nimport { createRerunSuggestion } from \"./createRerunSuggestion.js\";\nimport { createWithOptions } from \"./createWithOptions.js\";\n\nexport const create: ModeRunner = async (args, promptedOptions) => {\n\tconst inputs = await readOptions(args, \"create\", promptedOptions);\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\tif (!(await createAndEnterGitDirectory(inputs.options.directory))) {\n\t\tprompts.outro(\n\t\t\tchalk.red(\n\t\t\t\t`The ${inputs.options.directory} directory already exists and is not empty. Please clear the directory, run with --mode initialize, or try a different directory.`,\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\t\t\t\tconst nextSteps = generateNextSteps(inputs.options);\n\n\t\t\t\toutro(\n\t\t\t\t\tsentToGitHub\n\t\t\t\t\t\t? nextSteps\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({\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\tmode: \"initialize\",\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\tvariant: \"code\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t...nextSteps,\n\t\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;AAElB,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAE7B,SAAS,kCAAkC;AAC3C,SAAS,6BAA6B;AACtC,SAAS,yBAAyB;AAE3B,MAAM,SAAqB,OAAO,MAAM,oBAAoB;AAClE,QAAM,SAAS,MAAM,YAAY,MAAM,UAAU,eAAe;AAChE,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,OAAO,OAAO;AAAA,MACd,SAAS,OAAO;AAAA,IACjB;AAAA,EACD;AAEA,MAAI,CAAE,MAAM,2BAA2B,OAAO,QAAQ,SAAS,GAAI;AAClE,YAAQ;AAAA,MACP,MAAM;AAAA,QACL,OAAO,OAAO,QAAQ,SAAS;AAAA,MAChC;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;AACvD,cAAM,YAAY,kBAAkB,OAAO,OAAO;AAElD;AAAA,UACC,eACG,YACA;AAAA,YACA;AAAA,cACC,OACC;AAAA,cACD,OAAO;AAAA,gBACN,MAAM,OAAO,QAAQ,UAAU;AAAA,gBAC/B,sBAAsB;AAAA,kBACrB,GAAG,OAAO;AAAA,kBACV,MAAM;AAAA,kBACN,eAAe;AAAA,kBACf,aAAa;AAAA,gBACd,CAAC;AAAA,gBACD;AAAA,gBACA;AAAA,gBACA;AAAA,cACD;AAAA,cACA,SAAS;AAAA,YACV;AAAA,YACA,GAAG;AAAA,UACJ;AAAA,QACH;AAAA,MACD;AAAA,MACA,aAAa,OAAO,QAAQ;AAAA,IAC7B,CAAC;AAAA,IACD,SAAS,OAAO;AAAA,EACjB;AACD;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/shared/options/createOptionDefaults/index.ts"],"sourcesContent":["import { $ } from \"execa\";\nimport gitRemoteOriginUrl from \"git-remote-origin-url\";\nimport gitUrlParse from \"git-url-parse\";\nimport lazyValue from \"lazy-value\";\nimport * as fs from \"node:fs/promises\";\nimport npmUser from \"npm-user\";\n\nimport { readPackageData } from \"../../packages.js\";\nimport { tryCatchAsync } from \"../../tryCatchAsync.js\";\nimport { tryCatchLazyValueAsync } from \"../../tryCatchLazyValueAsync.js\";\nimport { PromptedOptions } from \"../../types.js\";\nimport { parsePackageAuthor } from \"./parsePackageAuthor.js\";\nimport { readDefaultsFromDevelopment } from \"./readDefaultsFromDevelopment.js\";\nimport { readDefaultsFromReadme } from \"./readDefaultsFromReadme.js\";\n\nexport function createOptionDefaults(promptedOptions?: PromptedOptions) {\n\tconst gitDefaults = tryCatchLazyValueAsync(async () =>\n\t\tgitUrlParse(await gitRemoteOriginUrl()),\n\t);\n\n\tconst npmDefaults = tryCatchLazyValueAsync(async () => {\n\t\tconst whoami = (await $`npm whoami`).stdout;\n\t\treturn whoami ? await npmUser(whoami) : undefined;\n\t});\n\n\tconst packageData = lazyValue(readPackageData);\n\tconst packageAuthor = lazyValue(async () =>\n\t\tparsePackageAuthor(await packageData()),\n\t);\n\n\treturn {\n\t\tauthor: async () => (await packageAuthor()).author ?? npmDefaults.name,\n\t\tbin: async () => (await packageData()).bin,\n\t\tdescription: async () => (await packageData()).description,\n\t\temail: async () => {\n\t\t\tconst gitEmail = await tryCatchAsync(\n\t\t\t\tasync () => (await $`git config --get user.email`).stdout,\n\t\t\t);\n\t\t\tconst npmEmail =\n\t\t\t\t(await npmDefaults())?.email ?? (await packageAuthor()).email;\n\n\t\t\t/* eslint-disable @typescript-eslint/no-non-null-assertion */\n\t\t\treturn gitEmail || npmEmail\n\t\t\t\t? { github: (gitEmail || npmEmail)!, npm: (npmEmail || gitEmail)! }\n\t\t\t\t: undefined;\n\t\t\t/* eslint-enable @typescript-eslint/no-non-null-assertion */\n\t\t},\n\t\tfunding: async () =>\n\t\t\tawait tryCatchAsync(\n\t\t\t\tasync () =>\n\t\t\t\t\t(await fs.readFile(\".github/FUNDING.yml\"))\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.split(\":\")[1]\n\t\t\t\t\t\t?.trim(),\n\t\t\t),\n\t\towner: async () =>\n\t\t\t(await gitDefaults())?.organization ?? (await packageAuthor()).author,\n\t\trepository: async () =>\n\t\t\tpromptedOptions?.repository ??\n\t\t\t(await gitDefaults())?.name ??\n\t\t\t(await packageData()).name,\n\t\t...readDefaultsFromDevelopment(),\n\t\t...readDefaultsFromReadme(),\n\t};\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,OAAO,wBAAwB;AAC/B,OAAO,iBAAiB;AACxB,OAAO,eAAe;AACtB,YAAY,QAAQ;AACpB,OAAO,aAAa;AAEpB,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B;AAEvC,SAAS,0BAA0B;AACnC,SAAS,mCAAmC;AAC5C,SAAS,8BAA8B;AAEhC,SAAS,qBAAqB,iBAAmC;AACvE,QAAM,cAAc;AAAA,IAAuB,YAC1C,YAAY,MAAM,mBAAmB,CAAC;AAAA,EACvC;AAEA,QAAM,cAAc,uBAAuB,YAAY;AACtD,UAAM,UAAU,MAAM,eAAe;AACrC,WAAO,SAAS,MAAM,QAAQ,MAAM,IAAI;AAAA,EACzC,CAAC;AAED,QAAM,cAAc,UAAU,eAAe;AAC7C,QAAM,gBAAgB;AAAA,IAAU,YAC/B,mBAAmB,MAAM,YAAY,CAAC;AAAA,EACvC;AAEA,SAAO;AAAA,IACN,QAAQ,aAAa,MAAM,cAAc,GAAG,UAAU,YAAY;AAAA,IAClE,KAAK,aAAa,MAAM,YAAY,GAAG;AAAA,IACvC,aAAa,aAAa,MAAM,YAAY,GAAG;AAAA,IAC/C,OAAO,YAAY;AAClB,YAAM,WAAW,MAAM;AAAA,QACtB,aAAa,MAAM,gCAAgC;AAAA,MACpD;AACA,YAAM,YACJ,MAAM,YAAY,IAAI,UAAU,MAAM,cAAc,GAAG;AAGzD,aAAO,YAAY,WAChB,EAAE,QAAS,YAAY,UAAY,KAAM,YAAY,SAAW,IAChE;AAAA,IAEJ;AAAA,IACA,SAAS,YACR,MAAM;AAAA,MACL,aACE,MAAM,GAAG,SAAS,qBAAqB,GACtC,SAAS,EACT,MAAM,GAAG,EAAE,CAAC,GACX,KAAK;AAAA,IACV;AAAA,IACD,OAAO,aACL,MAAM,YAAY,IAAI,iBAAiB,MAAM,cAAc,GAAG;AAAA,IAChE,YAAY,YACX,iBAAiB,eAChB,MAAM,YAAY,IAAI,SACtB,MAAM,YAAY,GAAG;AAAA,IACvB,GAAG,4BAA4B;AAAA,IAC/B,GAAG,uBAAuB;AAAA,EAC3B;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../src/shared/options/createOptionDefaults/index.ts"],"sourcesContent":["import { $ } from \"execa\";\nimport gitRemoteOriginUrl from \"git-remote-origin-url\";\nimport gitUrlParse from \"git-url-parse\";\nimport lazyValue from \"lazy-value\";\nimport * as fs from \"node:fs/promises\";\nimport npmUser from \"npm-user\";\n\nimport { readPackageData } from \"../../packages.js\";\nimport { tryCatchAsync } from \"../../tryCatchAsync.js\";\nimport { tryCatchLazyValueAsync } from \"../../tryCatchLazyValueAsync.js\";\nimport { PromptedOptions } from \"../../types.js\";\nimport { parsePackageAuthor } from \"./parsePackageAuthor.js\";\nimport { readDefaultsFromDevelopment } from \"./readDefaultsFromDevelopment.js\";\nimport { readDefaultsFromReadme } from \"./readDefaultsFromReadme.js\";\n\nexport function createOptionDefaults(promptedOptions?: PromptedOptions) {\n\tconst gitDefaults = tryCatchLazyValueAsync(async () =>\n\t\tgitUrlParse(await gitRemoteOriginUrl()),\n\t);\n\n\tconst npmDefaults = tryCatchLazyValueAsync(async () => {\n\t\tconst whoami = (await $`npm whoami`).stdout;\n\t\treturn whoami ? await npmUser(whoami) : undefined;\n\t});\n\n\tconst packageData = lazyValue(readPackageData);\n\tconst packageAuthor = lazyValue(async () =>\n\t\tparsePackageAuthor(await packageData()),\n\t);\n\n\treturn {\n\t\tauthor: async () => (await packageAuthor()).author ?? npmDefaults.name,\n\t\tbin: async () => (await packageData()).bin,\n\t\tdescription: async () => (await packageData()).description,\n\t\temail: async () => {\n\t\t\tconst gitEmail = await tryCatchAsync(\n\t\t\t\tasync () => (await $`git config --get user.email`).stdout,\n\t\t\t);\n\t\t\tconst npmEmail =\n\t\t\t\t(await npmDefaults())?.email ?? (await packageAuthor()).email;\n\n\t\t\t/* eslint-disable @typescript-eslint/no-non-null-assertion */\n\t\t\treturn gitEmail || npmEmail\n\t\t\t\t? { github: (gitEmail || npmEmail)!, npm: (npmEmail || gitEmail)! }\n\t\t\t\t: undefined;\n\t\t\t/* eslint-enable @typescript-eslint/no-non-null-assertion */\n\t\t},\n\t\tfunding: async () =>\n\t\t\tawait tryCatchAsync(async () =>\n\t\t\t\t(await fs.readFile(\".github/FUNDING.yml\"))\n\t\t\t\t\t.toString()\n\t\t\t\t\t.split(\":\")[1]\n\t\t\t\t\t?.trim(),\n\t\t\t),\n\t\towner: async () =>\n\t\t\t(await gitDefaults())?.organization ?? (await packageAuthor()).author,\n\t\trepository: async () =>\n\t\t\tpromptedOptions?.repository ??\n\t\t\t(await gitDefaults())?.name ??\n\t\t\t(await packageData()).name,\n\t\t...readDefaultsFromDevelopment(),\n\t\t...readDefaultsFromReadme(),\n\t};\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,OAAO,wBAAwB;AAC/B,OAAO,iBAAiB;AACxB,OAAO,eAAe;AACtB,YAAY,QAAQ;AACpB,OAAO,aAAa;AAEpB,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B;AAEvC,SAAS,0BAA0B;AACnC,SAAS,mCAAmC;AAC5C,SAAS,8BAA8B;AAEhC,SAAS,qBAAqB,iBAAmC;AACvE,QAAM,cAAc;AAAA,IAAuB,YAC1C,YAAY,MAAM,mBAAmB,CAAC;AAAA,EACvC;AAEA,QAAM,cAAc,uBAAuB,YAAY;AACtD,UAAM,UAAU,MAAM,eAAe;AACrC,WAAO,SAAS,MAAM,QAAQ,MAAM,IAAI;AAAA,EACzC,CAAC;AAED,QAAM,cAAc,UAAU,eAAe;AAC7C,QAAM,gBAAgB;AAAA,IAAU,YAC/B,mBAAmB,MAAM,YAAY,CAAC;AAAA,EACvC;AAEA,SAAO;AAAA,IACN,QAAQ,aAAa,MAAM,cAAc,GAAG,UAAU,YAAY;AAAA,IAClE,KAAK,aAAa,MAAM,YAAY,GAAG;AAAA,IACvC,aAAa,aAAa,MAAM,YAAY,GAAG;AAAA,IAC/C,OAAO,YAAY;AAClB,YAAM,WAAW,MAAM;AAAA,QACtB,aAAa,MAAM,gCAAgC;AAAA,MACpD;AACA,YAAM,YACJ,MAAM,YAAY,IAAI,UAAU,MAAM,cAAc,GAAG;AAGzD,aAAO,YAAY,WAChB,EAAE,QAAS,YAAY,UAAY,KAAM,YAAY,SAAW,IAChE;AAAA,IAEJ;AAAA,IACA,SAAS,YACR,MAAM;AAAA,MAAc,aAClB,MAAM,GAAG,SAAS,qBAAqB,GACtC,SAAS,EACT,MAAM,GAAG,EAAE,CAAC,GACX,KAAK;AAAA,IACT;AAAA,IACD,OAAO,aACL,MAAM,YAAY,IAAI,iBAAiB,MAAM,cAAc,GAAG;AAAA,IAChE,YAAY,YACX,iBAAiB,eAChB,MAAM,YAAY,IAAI,SACtB,MAAM,YAAY,GAAG;AAAA,IACvB,GAAG,4BAA4B;AAAA,IAC/B,GAAG,uBAAuB;AAAA,EAC3B;AACD;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/options/ensureRepositoryExists.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { doesRepositoryExist } from \"../doesRepositoryExist.js\";\nimport { filterPromptCancel } from \"../prompts.js\";\nimport { Options } from \"../types.js\";\nimport { createRepositoryWithApi } from \"./createRepositoryWithApi.js\";\nimport { GitHub } from \"./getGitHub.js\";\n\nexport type EnsureRepositoryExistsOptions = Pick<\n\tOptions,\n\t\"mode\" | \"owner\" | \"preserveGeneratedFrom\" | \"repository\"\n>;\n\nexport interface RepositoryExistsResult {\n\tgithub: GitHub | undefined;\n\trepository: string;\n}\n\nexport async function ensureRepositoryExists(\n\tgithub: GitHub | undefined,\n\toptions: EnsureRepositoryExistsOptions,\n): Promise<Partial<RepositoryExistsResult>> {\n\t// We'll only respect input options once before prompting for them\n\tlet { repository } = options;\n\tlet createRepository = options.mode === \"create\";\n\n\t// We'll continuously pester the user for a repository\n\t// until they bail, create a new one, or it exists.\n\twhile (github) {\n\t\tif (await doesRepositoryExist(github.octokit, options)) {\n\t\t\treturn { github, repository };\n\t\t}\n\n\t\tconst selection = createRepository\n\t\t\t? \"create\"\n\t\t\t: filterPromptCancel(\n\t\t\t\t\t(await prompts.select({\n\t\t\t\t\t\tmessage: `Repository ${options.repository} doesn't seem to exist under ${options.owner}. What would you like to do?`,\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{ label: \"Create a new repository\", value: \"create\" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: \"Switch to a different repository name\",\n\t\t\t\t\t\t\t\tvalue: \"different\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: \"Keep changes local\",\n\t\t\t\t\t\t\t\tvalue: \"local\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ label: \"Bail out and maybe try again later\", value: \"bail\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t})) as \"bail\" | \"create\" | \"different\" | \"local\",\n\t\t\t );\n\n\t\tcreateRepository = false;\n\n\t\tswitch (selection) {\n\t\t\tcase undefined:\n\t\t\tcase \"bail\":\n\t\t\t\treturn {};\n\n\t\t\tcase \"create\":\n\t\t\t\tawait createRepositoryWithApi(github.octokit, {\n\t\t\t\t\towner: options.owner,\n\t\t\t\t\tpreserveGeneratedFrom: options.preserveGeneratedFrom,\n\t\t\t\t\trepository,\n\t\t\t\t});\n\t\t\t\treturn { github, repository };\n\n\t\t\tcase \"different\": {\n\t\t\t\tconst newRepository = filterPromptCancel(\n\t\t\t\t\tawait prompts.text({\n\t\t\t\t\t\tmessage: `What would you like to call the repository?`,\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\tif (!newRepository) {\n\t\t\t\t\treturn {};\n\t\t\t\t}\n\n\t\t\t\trepository = newRepository;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase \"local\":\n\t\t\t\tgithub = undefined;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn { github, repository };\n}\n"],"mappings":"AAAA,YAAY,aAAa;AAEzB,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AAEnC,SAAS,+BAA+B;AAaxC,eAAsB,uBACrB,QACA,SAC2C;AAE3C,MAAI,EAAE,WAAW,IAAI;AACrB,MAAI,mBAAmB,QAAQ,SAAS;AAIxC,SAAO,QAAQ;AACd,QAAI,MAAM,oBAAoB,OAAO,SAAS,OAAO,GAAG;AACvD,aAAO,EAAE,QAAQ,WAAW;AAAA,IAC7B;AAEA,UAAM,YAAY,mBACf,WACA;AAAA,MACC,MAAM,QAAQ,OAAO;AAAA,QACrB,SAAS,cAAc,QAAQ,UAAU,gCAAgC,QAAQ,KAAK;AAAA,QACtF,SAAS;AAAA,UACR,EAAE,OAAO,2BAA2B,OAAO,SAAS;AAAA,UACpD;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,UACR;AAAA,UACA,EAAE,OAAO,sCAAsC,OAAO,OAAO;AAAA,QAC9D;AAAA,MACD,CAAC;AAAA,IACD;AAEH,uBAAmB;AAEnB,YAAQ,WAAW;AAAA,MAClB,KAAK;AAAA,MACL,KAAK;AACJ,eAAO,CAAC;AAAA,MAET,KAAK;AACJ,cAAM,wBAAwB,OAAO,SAAS;AAAA,UAC7C,OAAO,QAAQ;AAAA,UACf,uBAAuB,QAAQ;AAAA,UAC/B;AAAA,QACD,CAAC;AACD,eAAO,EAAE,QAAQ,WAAW;AAAA,MAE7B,KAAK,aAAa;AACjB,cAAM,gBAAgB;AAAA,UACrB,MAAM,QAAQ,KAAK;AAAA,YAClB,SAAS;AAAA,UACV,CAAC;AAAA,QACF;AAEA,YAAI,CAAC,eAAe;AACnB,iBAAO,CAAC;AAAA,QACT;AAEA,qBAAa;AACb;AAAA,MACD;AAAA,MAEA,KAAK;AACJ,iBAAS;AACT;AAAA,IACF;AAAA,EACD;AAEA,SAAO,EAAE,QAAQ,WAAW;AAC7B;","names":[]}
1
+ {"version":3,"sources":["../../../src/shared/options/ensureRepositoryExists.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { doesRepositoryExist } from \"../doesRepositoryExist.js\";\nimport { filterPromptCancel } from \"../prompts.js\";\nimport { Options } from \"../types.js\";\nimport { createRepositoryWithApi } from \"./createRepositoryWithApi.js\";\nimport { GitHub } from \"./getGitHub.js\";\n\nexport type EnsureRepositoryExistsOptions = Pick<\n\tOptions,\n\t\"mode\" | \"owner\" | \"preserveGeneratedFrom\" | \"repository\"\n>;\n\nexport interface RepositoryExistsResult {\n\tgithub: GitHub | undefined;\n\trepository: string;\n}\n\nexport async function ensureRepositoryExists(\n\tgithub: GitHub | undefined,\n\toptions: EnsureRepositoryExistsOptions,\n): Promise<Partial<RepositoryExistsResult>> {\n\t// We'll only respect input options once before prompting for them\n\tlet { repository } = options;\n\tlet createRepository = options.mode === \"create\";\n\n\t// We'll continuously pester the user for a repository\n\t// until they bail, create a new one, or it exists.\n\twhile (github) {\n\t\tif (await doesRepositoryExist(github.octokit, options)) {\n\t\t\treturn { github, repository };\n\t\t}\n\n\t\tconst selection = createRepository\n\t\t\t? \"create\"\n\t\t\t: filterPromptCancel(\n\t\t\t\t\t(await prompts.select({\n\t\t\t\t\t\tmessage: `Repository ${options.repository} doesn't seem to exist under ${options.owner}. What would you like to do?`,\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{ label: \"Create a new repository\", value: \"create\" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: \"Switch to a different repository name\",\n\t\t\t\t\t\t\t\tvalue: \"different\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: \"Keep changes local\",\n\t\t\t\t\t\t\t\tvalue: \"local\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ label: \"Bail out and maybe try again later\", value: \"bail\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t})) as \"bail\" | \"create\" | \"different\" | \"local\",\n\t\t\t\t);\n\n\t\tcreateRepository = false;\n\n\t\tswitch (selection) {\n\t\t\tcase undefined:\n\t\t\tcase \"bail\":\n\t\t\t\treturn {};\n\n\t\t\tcase \"create\":\n\t\t\t\tawait createRepositoryWithApi(github.octokit, {\n\t\t\t\t\towner: options.owner,\n\t\t\t\t\tpreserveGeneratedFrom: options.preserveGeneratedFrom,\n\t\t\t\t\trepository,\n\t\t\t\t});\n\t\t\t\treturn { github, repository };\n\n\t\t\tcase \"different\": {\n\t\t\t\tconst newRepository = filterPromptCancel(\n\t\t\t\t\tawait prompts.text({\n\t\t\t\t\t\tmessage: `What would you like to call the repository?`,\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\tif (!newRepository) {\n\t\t\t\t\treturn {};\n\t\t\t\t}\n\n\t\t\t\trepository = newRepository;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase \"local\":\n\t\t\t\tgithub = undefined;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn { github, repository };\n}\n"],"mappings":"AAAA,YAAY,aAAa;AAEzB,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AAEnC,SAAS,+BAA+B;AAaxC,eAAsB,uBACrB,QACA,SAC2C;AAE3C,MAAI,EAAE,WAAW,IAAI;AACrB,MAAI,mBAAmB,QAAQ,SAAS;AAIxC,SAAO,QAAQ;AACd,QAAI,MAAM,oBAAoB,OAAO,SAAS,OAAO,GAAG;AACvD,aAAO,EAAE,QAAQ,WAAW;AAAA,IAC7B;AAEA,UAAM,YAAY,mBACf,WACA;AAAA,MACC,MAAM,QAAQ,OAAO;AAAA,QACrB,SAAS,cAAc,QAAQ,UAAU,gCAAgC,QAAQ,KAAK;AAAA,QACtF,SAAS;AAAA,UACR,EAAE,OAAO,2BAA2B,OAAO,SAAS;AAAA,UACpD;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,UACR;AAAA,UACA,EAAE,OAAO,sCAAsC,OAAO,OAAO;AAAA,QAC9D;AAAA,MACD,CAAC;AAAA,IACF;AAEF,uBAAmB;AAEnB,YAAQ,WAAW;AAAA,MAClB,KAAK;AAAA,MACL,KAAK;AACJ,eAAO,CAAC;AAAA,MAET,KAAK;AACJ,cAAM,wBAAwB,OAAO,SAAS;AAAA,UAC7C,OAAO,QAAQ;AAAA,UACf,uBAAuB,QAAQ;AAAA,UAC/B;AAAA,QACD,CAAC;AACD,eAAO,EAAE,QAAQ,WAAW;AAAA,MAE7B,KAAK,aAAa;AACjB,cAAM,gBAAgB;AAAA,UACrB,MAAM,QAAQ,KAAK;AAAA,YAClB,SAAS;AAAA,UACV,CAAC;AAAA,QACF;AAEA,YAAI,CAAC,eAAe;AACnB,iBAAO,CAAC;AAAA,QACT;AAEA,qBAAa;AACb;AAAA,MACD;AAAA,MAEA,KAAK;AACJ,iBAAS;AACT;AAAA,IACF;AAAA,EACD;AAEA,SAAO,EAAE,QAAQ,WAAW;AAC7B;","names":[]}
@@ -112,11 +112,12 @@ declare const optionsSchema: z.ZodObject<{
112
112
  skipUninstall: z.ZodOptional<z.ZodBoolean>;
113
113
  title: z.ZodOptional<z.ZodString>;
114
114
  }, "strip", z.ZodTypeAny, {
115
- description?: string | undefined;
115
+ mode?: "create" | "initialize" | "migrate" | undefined;
116
+ auto?: boolean | undefined;
116
117
  offline?: boolean | undefined;
118
+ description?: string | undefined;
117
119
  access?: "public" | "restricted" | undefined;
118
120
  author?: string | undefined;
119
- auto?: boolean | undefined;
120
121
  base?: "common" | "everything" | "minimal" | "prompt" | undefined;
121
122
  bin?: string | undefined;
122
123
  directory?: string | undefined;
@@ -128,7 +129,6 @@ declare const optionsSchema: z.ZodObject<{
128
129
  guide?: string | undefined;
129
130
  keywords?: string[] | undefined;
130
131
  logo?: string | undefined;
131
- mode?: "create" | "initialize" | "migrate" | undefined;
132
132
  owner?: string | undefined;
133
133
  repository?: string | undefined;
134
134
  title?: string | undefined;
@@ -161,11 +161,12 @@ declare const optionsSchema: z.ZodObject<{
161
161
  guideTitle?: string | undefined;
162
162
  logoAlt?: string | undefined;
163
163
  }, {
164
- description?: string | undefined;
164
+ mode?: "create" | "initialize" | "migrate" | undefined;
165
+ auto?: boolean | undefined;
165
166
  offline?: boolean | undefined;
167
+ description?: string | undefined;
166
168
  access?: "public" | "restricted" | undefined;
167
169
  author?: string | undefined;
168
- auto?: boolean | undefined;
169
170
  base?: "common" | "everything" | "minimal" | "prompt" | undefined;
170
171
  bin?: string | undefined;
171
172
  directory?: string | undefined;
@@ -177,7 +178,6 @@ declare const optionsSchema: z.ZodObject<{
177
178
  guide?: string | undefined;
178
179
  keywords?: string[] | undefined;
179
180
  logo?: string | undefined;
180
- mode?: "create" | "initialize" | "migrate" | undefined;
181
181
  owner?: string | undefined;
182
182
  repository?: string | undefined;
183
183
  title?: string | undefined;
@@ -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 { getGitHub, GitHub } 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\tbin: values.bin,\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\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\tguideTitle: values[\"guide-title\"],\n\t\tlogo: values.logo,\n\t\tlogoAlt: values[\"logo-alt\"],\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\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.owner,\n\t\tmessage: \"What organization or user will the repository be under?\",\n\t\tname: \"owner\",\n\t\tprovided: options.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\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.repository,\n\t\tmessage: \"What will the kebab-case name of the repository be?\",\n\t\tname: \"repository\",\n\t\tprovided: options.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\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t\tmessage: \"How would you describe the new package?\",\n\t\tname: \"description\",\n\t\tprovided: options.description,\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\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t\tmessage: \"What will the Title Case title of the repository be?\",\n\t\tname: \"title\",\n\t\tprovided: options.title,\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\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the title text for the guide?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\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\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the alt text (non-visual description) of the logo?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\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\tauto: !!mappedOptions.auto,\n\t\t\tmessage: \"What email should be used in package.json and .md files?\",\n\t\t\tname: \"email\",\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,\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C,OAAO;AACX,UAAM,cAAc,MAAM,2BAA2B;AAAA,MACpD,MAAM,CAAC,CAAC,cAAc;AAAA,MACtB,SAAS;AAAA,MACT,MAAM;AAAA,IACP,CAAC;AAED,QAAI,CAAC,YAAY,OAAO;AACvB,aAAO,EAAE,WAAW,MAAM,OAAO,YAAY,OAAO,QAAQ;AAAA,IAC7D;AAEA,YAAQ,EAAE,QAAQ,YAAY,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"]}
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 { getGitHub, GitHub } 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\tbin: values.bin,\n\t\tdescription: values.description,\n\t\tdirectory: values.directory,\n\t\temail:\n\t\t\t(values.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\t}\n\t\t\t\t: undefined,\n\t\texcludeAllContributors: values[\"exclude-all-contributors\"],\n\t\texcludeCompliance: values[\"exclude-compliance\"],\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\tguideTitle: values[\"guide-title\"],\n\t\tlogo: values.logo,\n\t\tlogoAlt: values[\"logo-alt\"],\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\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.owner,\n\t\tmessage: \"What organization or user will the repository be under?\",\n\t\tname: \"owner\",\n\t\tprovided: options.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\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.repository,\n\t\tmessage: \"What will the kebab-case name of the repository be?\",\n\t\tname: \"repository\",\n\t\tprovided: options.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\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t\tmessage: \"How would you describe the new package?\",\n\t\tname: \"description\",\n\t\tprovided: options.description,\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\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t\tmessage: \"What will the Title Case title of the repository be?\",\n\t\tname: \"title\",\n\t\tprovided: options.title,\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\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the title text for the guide?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\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\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the alt text (non-visual description) of the logo?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\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\tauto: !!mappedOptions.auto,\n\t\t\tmessage: \"What email should be used in package.json and .md files?\",\n\t\t\tname: \"email\",\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,SAAS,iBAAyB;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,KAAK,OAAO;AAAA,IACZ,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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"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/steps/addOwnerAsAllContributor.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nimport { getGitHubUserAsAllContributor } from \"../shared/getGitHubUserAsAllContributor.js\";\nimport { readFileAsJson } from \"../shared/readFileAsJson.js\";\nimport { AllContributorsData, Options } from \"../shared/types.js\";\nimport { formatJson } from \"./writing/creation/formatters/formatJson.js\";\n\nexport async function addOwnerAsAllContributor(\n\toptions: Pick<Options, \"offline\" | \"owner\">,\n) {\n\tconst user = await getGitHubUserAsAllContributor(options);\n\n\tconst existingContributors = (await readFileAsJson(\n\t\t\"./.all-contributorsrc\",\n\t)) as AllContributorsData;\n\tif (!isValidAllContributorsData(existingContributors)) {\n\t\tthrow new Error(\n\t\t\t`Invalid .all-contributorsrc: ${JSON.stringify(existingContributors)}`,\n\t\t);\n\t}\n\n\tconst contributors = existingContributors.contributors\n\t\t.filter(({ login }) => [\"JoshuaKGoldberg\", user].includes(login))\n\t\t.map((contributor) =>\n\t\t\tcontributor.login === \"JoshuaKGoldberg\"\n\t\t\t\t? { ...contributor, contributions: [\"tool\"] }\n\t\t\t\t: {\n\t\t\t\t\t\t...contributor,\n\t\t\t\t\t\tcontributions: Array.from(\n\t\t\t\t\t\t\tnew Set([...contributor.contributions, \"tool\"]),\n\t\t\t\t\t\t),\n\t\t\t\t },\n\t\t);\n\n\tif (!contributors.some((contributor) => contributor.login === user)) {\n\t\tcontributors.push({\n\t\t\tcontributions: [\"tool\"],\n\t\t\tlogin: user,\n\t\t});\n\t}\n\n\tawait fs.writeFile(\n\t\t\"./.all-contributorsrc\",\n\t\tawait formatJson({\n\t\t\t...existingContributors,\n\t\t\tcontributors,\n\t\t}),\n\t);\n}\n\nfunction isValidAllContributorsData(\n\tvalue: unknown,\n): value is AllContributorsData {\n\treturn !!value && typeof value === \"object\" && \"contributors\" in value;\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,SAAS,qCAAqC;AAC9C,SAAS,sBAAsB;AAE/B,SAAS,kBAAkB;AAE3B,eAAsB,yBACrB,SACC;AACD,QAAM,OAAO,MAAM,8BAA8B,OAAO;AAExD,QAAM,uBAAwB,MAAM;AAAA,IACnC;AAAA,EACD;AACA,MAAI,CAAC,2BAA2B,oBAAoB,GAAG;AACtD,UAAM,IAAI;AAAA,MACT,gCAAgC,KAAK,UAAU,oBAAoB,CAAC;AAAA,IACrE;AAAA,EACD;AAEA,QAAM,eAAe,qBAAqB,aACxC,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC,mBAAmB,IAAI,EAAE,SAAS,KAAK,CAAC,EAC/D;AAAA,IAAI,CAAC,gBACL,YAAY,UAAU,oBACnB,EAAE,GAAG,aAAa,eAAe,CAAC,MAAM,EAAE,IAC1C;AAAA,MACA,GAAG;AAAA,MACH,eAAe,MAAM;AAAA,QACpB,oBAAI,IAAI,CAAC,GAAG,YAAY,eAAe,MAAM,CAAC;AAAA,MAC/C;AAAA,IACA;AAAA,EACJ;AAED,MAAI,CAAC,aAAa,KAAK,CAAC,gBAAgB,YAAY,UAAU,IAAI,GAAG;AACpE,iBAAa,KAAK;AAAA,MACjB,eAAe,CAAC,MAAM;AAAA,MACtB,OAAO;AAAA,IACR,CAAC;AAAA,EACF;AAEA,QAAM,GAAG;AAAA,IACR;AAAA,IACA,MAAM,WAAW;AAAA,MAChB,GAAG;AAAA,MACH;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAEA,SAAS,2BACR,OAC+B;AAC/B,SAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,kBAAkB;AAClE;","names":[]}
1
+ {"version":3,"sources":["../../src/steps/addOwnerAsAllContributor.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nimport { getGitHubUserAsAllContributor } from \"../shared/getGitHubUserAsAllContributor.js\";\nimport { readFileAsJson } from \"../shared/readFileAsJson.js\";\nimport { AllContributorsData, Options } from \"../shared/types.js\";\nimport { formatJson } from \"./writing/creation/formatters/formatJson.js\";\n\nexport async function addOwnerAsAllContributor(\n\toptions: Pick<Options, \"offline\" | \"owner\">,\n) {\n\tconst user = await getGitHubUserAsAllContributor(options);\n\n\tconst existingContributors = (await readFileAsJson(\n\t\t\"./.all-contributorsrc\",\n\t)) as AllContributorsData;\n\tif (!isValidAllContributorsData(existingContributors)) {\n\t\tthrow new Error(\n\t\t\t`Invalid .all-contributorsrc: ${JSON.stringify(existingContributors)}`,\n\t\t);\n\t}\n\n\tconst contributors = existingContributors.contributors\n\t\t.filter(({ login }) => [\"JoshuaKGoldberg\", user].includes(login))\n\t\t.map((contributor) =>\n\t\t\tcontributor.login === \"JoshuaKGoldberg\"\n\t\t\t\t? { ...contributor, contributions: [\"tool\"] }\n\t\t\t\t: {\n\t\t\t\t\t\t...contributor,\n\t\t\t\t\t\tcontributions: Array.from(\n\t\t\t\t\t\t\tnew Set([...contributor.contributions, \"tool\"]),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t);\n\n\tif (!contributors.some((contributor) => contributor.login === user)) {\n\t\tcontributors.push({\n\t\t\tcontributions: [\"tool\"],\n\t\t\tlogin: user,\n\t\t});\n\t}\n\n\tawait fs.writeFile(\n\t\t\"./.all-contributorsrc\",\n\t\tawait formatJson({\n\t\t\t...existingContributors,\n\t\t\tcontributors,\n\t\t}),\n\t);\n}\n\nfunction isValidAllContributorsData(\n\tvalue: unknown,\n): value is AllContributorsData {\n\treturn !!value && typeof value === \"object\" && \"contributors\" in value;\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,SAAS,qCAAqC;AAC9C,SAAS,sBAAsB;AAE/B,SAAS,kBAAkB;AAE3B,eAAsB,yBACrB,SACC;AACD,QAAM,OAAO,MAAM,8BAA8B,OAAO;AAExD,QAAM,uBAAwB,MAAM;AAAA,IACnC;AAAA,EACD;AACA,MAAI,CAAC,2BAA2B,oBAAoB,GAAG;AACtD,UAAM,IAAI;AAAA,MACT,gCAAgC,KAAK,UAAU,oBAAoB,CAAC;AAAA,IACrE;AAAA,EACD;AAEA,QAAM,eAAe,qBAAqB,aACxC,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC,mBAAmB,IAAI,EAAE,SAAS,KAAK,CAAC,EAC/D;AAAA,IAAI,CAAC,gBACL,YAAY,UAAU,oBACnB,EAAE,GAAG,aAAa,eAAe,CAAC,MAAM,EAAE,IAC1C;AAAA,MACA,GAAG;AAAA,MACH,eAAe,MAAM;AAAA,QACpB,oBAAI,IAAI,CAAC,GAAG,YAAY,eAAe,MAAM,CAAC;AAAA,MAC/C;AAAA,IACD;AAAA,EACH;AAED,MAAI,CAAC,aAAa,KAAK,CAAC,gBAAgB,YAAY,UAAU,IAAI,GAAG;AACpE,iBAAa,KAAK;AAAA,MACjB,eAAe,CAAC,MAAM;AAAA,MACtB,OAAO;AAAA,IACR,CAAC;AAAA,EACF;AAEA,QAAM,GAAG;AAAA,IACR;AAAA,IACA,MAAM,WAAW;AAAA,MAChB,GAAG;AAAA,MACH;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAEA,SAAS,2BACR,OAC+B;AAC/B,SAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,kBAAkB;AAClE;","names":[]}
@@ -2,6 +2,7 @@ import * as fs from "node:fs/promises";
2
2
  const globPaths = [
3
3
  ...extensions(".babelrc", "cjs", "cts", "js", "json", "mjs"),
4
4
  ...extensions(".eslintrc", "js", "json", "yml"),
5
+ ...extensions(".mocha", "cjs", "js", "json", "jsonc", "yaml", "yml"),
5
6
  ...extensions(".prettierrc", "json", "json5", "yaml", "yml"),
6
7
  ...extensions("prettier.config", "js", "mjs", "cjs"),
7
8
  ...extensions("babel.config", "cjs", "cts", "js", "json", "mjs"),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/steps/clearUnnecessaryFiles.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nconst globPaths = [\n\t...extensions(\".babelrc\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\".eslintrc\", \"js\", \"json\", \"yml\"),\n\t...extensions(\".prettierrc\", \"json\", \"json5\", \"yaml\", \"yml\"),\n\t...extensions(\"prettier.config\", \"js\", \"mjs\", \"cjs\"),\n\t...extensions(\"babel.config\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\"jest.config\", \"cjs\", \"js\", \"json\", \"mjs\", \"ts\"),\n\t\"./src/**/*.js\",\n\t\".circleci/config.yml\",\n\t\".github/codecov.yml\",\n\t\".babelrc\",\n\t\".npmignore\",\n\t\".eslintignore\",\n\t\".eslintrc\",\n\t\"CODE_OF_CONDUCT.md\",\n\t\"CONTRIBUTING.md\",\n\t\".npmpackagejsonlintrc.json\",\n\t\"codecov.yml\",\n\t\"DEVELOPMENT.md\",\n\t\"dist\",\n\t\"lib\",\n\t\"package-lock.json\",\n\t\"travis.yml\",\n\t\"yarn.lock\",\n];\n\nfunction extensions(base: string, ...extensions: string[]) {\n\treturn extensions.map((extension) => [base, extension].join(\".\"));\n}\n\nexport async function clearUnnecessaryFiles() {\n\tfor (const globPath of globPaths) {\n\t\tawait fs.rm(globPath, { force: true, recursive: true });\n\t}\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,MAAM,YAAY;AAAA,EACjB,GAAG,WAAW,YAAY,OAAO,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC3D,GAAG,WAAW,aAAa,MAAM,QAAQ,KAAK;AAAA,EAC9C,GAAG,WAAW,eAAe,QAAQ,SAAS,QAAQ,KAAK;AAAA,EAC3D,GAAG,WAAW,mBAAmB,MAAM,OAAO,KAAK;AAAA,EACnD,GAAG,WAAW,gBAAgB,OAAO,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC/D,GAAG,WAAW,eAAe,OAAO,MAAM,QAAQ,OAAO,IAAI;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,SAAS,WAAW,SAAiBA,aAAsB;AAC1D,SAAOA,YAAW,IAAI,CAAC,cAAc,CAAC,MAAM,SAAS,EAAE,KAAK,GAAG,CAAC;AACjE;AAEA,eAAsB,wBAAwB;AAC7C,aAAW,YAAY,WAAW;AACjC,UAAM,GAAG,GAAG,UAAU,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,EACvD;AACD;","names":["extensions"]}
1
+ {"version":3,"sources":["../../src/steps/clearUnnecessaryFiles.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nconst globPaths = [\n\t...extensions(\".babelrc\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\".eslintrc\", \"js\", \"json\", \"yml\"),\n\t...extensions(\".mocha\", \"cjs\", \"js\", \"json\", \"jsonc\", \"yaml\", \"yml\"),\n\t...extensions(\".prettierrc\", \"json\", \"json5\", \"yaml\", \"yml\"),\n\t...extensions(\"prettier.config\", \"js\", \"mjs\", \"cjs\"),\n\t...extensions(\"babel.config\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\"jest.config\", \"cjs\", \"js\", \"json\", \"mjs\", \"ts\"),\n\t\"./src/**/*.js\",\n\t\".circleci/config.yml\",\n\t\".github/codecov.yml\",\n\t\".babelrc\",\n\t\".npmignore\",\n\t\".eslintignore\",\n\t\".eslintrc\",\n\t\"CODE_OF_CONDUCT.md\",\n\t\"CONTRIBUTING.md\",\n\t\".npmpackagejsonlintrc.json\",\n\t\"codecov.yml\",\n\t\"DEVELOPMENT.md\",\n\t\"dist\",\n\t\"lib\",\n\t\"package-lock.json\",\n\t\"travis.yml\",\n\t\"yarn.lock\",\n];\n\nfunction extensions(base: string, ...extensions: string[]) {\n\treturn extensions.map((extension) => [base, extension].join(\".\"));\n}\n\nexport async function clearUnnecessaryFiles() {\n\tfor (const globPath of globPaths) {\n\t\tawait fs.rm(globPath, { force: true, recursive: true });\n\t}\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,MAAM,YAAY;AAAA,EACjB,GAAG,WAAW,YAAY,OAAO,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC3D,GAAG,WAAW,aAAa,MAAM,QAAQ,KAAK;AAAA,EAC9C,GAAG,WAAW,UAAU,OAAO,MAAM,QAAQ,SAAS,QAAQ,KAAK;AAAA,EACnE,GAAG,WAAW,eAAe,QAAQ,SAAS,QAAQ,KAAK;AAAA,EAC3D,GAAG,WAAW,mBAAmB,MAAM,OAAO,KAAK;AAAA,EACnD,GAAG,WAAW,gBAAgB,OAAO,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC/D,GAAG,WAAW,eAAe,OAAO,MAAM,QAAQ,OAAO,IAAI;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,SAAS,WAAW,SAAiBA,aAAsB;AAC1D,SAAOA,YAAW,IAAI,CAAC,cAAc,CAAC,MAAM,SAAS,EAAE,KAAK,GAAG,CAAC;AACjE;AAEA,eAAsB,wBAAwB;AAC7C,aAAW,YAAY,WAAW;AACjC,UAAM,GAAG,GAAG,UAAU,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,EACvD;AACD;","names":["extensions"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/steps/createJoshuaKGoldbergReplacement.ts"],"sourcesContent":["import { Options } from \"../shared/types.js\";\n\n/**\n * Creates a replace-in-file replacement for JoshuaKGoldberg/... matches,\n * keeping repository names not being migrated (e.g. for GitHub actions).\n */\nexport const createJoshuaKGoldbergReplacement = (\n\toptions: Pick<Options, \"owner\" | \"repository\">,\n): [RegExp, ToCallback] => [\n\t/JoshuaKGoldberg(?:\\/(.+))?/g,\n\t(full: string, capture: string | undefined) =>\n\t\tcapture\n\t\t\t? // If this was a \"JoshuaKGoldberg/...\" repository link,\n\t\t\t // swap the owner if it's the repository being migrated.\n\t\t\t capture.startsWith(options.repository)\n\t\t\t\t? `${options.owner}/${capture}`\n\t\t\t\t: full\n\t\t\t: // Otherwise it's just \"JoshuaKGoldberg\" standalone,\n\t\t\t // so swap to the new owner.\n\t\t\t options.owner,\n];\n"],"mappings":"AAMO,MAAM,mCAAmC,CAC/C,YAC0B;AAAA,EAC1B;AAAA,EACA,CAAC,MAAc,YACd;AAAA;AAAA;AAAA,IAGG,QAAQ,WAAW,QAAQ,UAAU,IACpC,GAAG,QAAQ,KAAK,IAAI,OAAO,KAC3B;AAAA;AAAA;AAAA;AAAA,IAGD,QAAQ;AAAA;AACb;","names":[]}
1
+ {"version":3,"sources":["../../src/steps/createJoshuaKGoldbergReplacement.ts"],"sourcesContent":["import { Options } from \"../shared/types.js\";\n\n/**\n * Creates a replace-in-file replacement for JoshuaKGoldberg/... matches,\n * keeping repository names not being migrated (e.g. for GitHub actions).\n */\nexport const createJoshuaKGoldbergReplacement = (\n\toptions: Pick<Options, \"owner\" | \"repository\">,\n): [RegExp, ToCallback] => [\n\t/JoshuaKGoldberg(?:\\/(.+))?/g,\n\t(full: string, capture: string | undefined) =>\n\t\tcapture\n\t\t\t? // If this was a \"JoshuaKGoldberg/...\" repository link,\n\t\t\t\t// swap the owner if it's the repository being migrated.\n\t\t\t\tcapture.startsWith(options.repository)\n\t\t\t\t? `${options.owner}/${capture}`\n\t\t\t\t: full\n\t\t\t: // Otherwise it's just \"JoshuaKGoldberg\" standalone,\n\t\t\t\t// so swap to the new owner.\n\t\t\t\toptions.owner,\n];\n"],"mappings":"AAMO,MAAM,mCAAmC,CAC/C,YAC0B;AAAA,EAC1B;AAAA,EACA,CAAC,MAAc,YACd;AAAA;AAAA;AAAA,IAGE,QAAQ,WAAW,QAAQ,UAAU,IACnC,GAAG,QAAQ,KAAK,IAAI,OAAO,KAC3B;AAAA;AAAA;AAAA;AAAA,IAGF,QAAQ;AAAA;AACZ;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/steps/finalizeDependencies.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function finalizeDependencies(options: Options) {\n\tconst devDependencies = [\n\t\t\"@eslint/js\",\n\t\t\"@eslint-community/eslint-plugin-eslint-comments\",\n\t\t\"@types/eslint-plugin-markdown\",\n\t\t\"@types/eslint__js\",\n\t\t\"@types/node\",\n\t\t\"eslint\",\n\t\t\"eslint-plugin-jsdoc\",\n\t\t\"eslint-plugin-n\",\n\t\t\"eslint-plugin-regexp\",\n\t\t\"husky\",\n\t\t\"lint-staged\",\n\t\t\"prettier\",\n\t\t\"prettier-plugin-curly\",\n\t\t\"prettier-plugin-sh\",\n\t\t\"prettier-plugin-packagejson\",\n\t\t\"tsup\",\n\t\t\"typescript\",\n\t\t\"typescript-eslint\",\n\t\t...(options.excludeAllContributors ? [] : [\"all-contributors-cli\"]),\n\t\t...(options.excludeLintJson ? [] : [\"eslint-plugin-jsonc\"]),\n\t\t...(options.excludeLintJson && options.excludeLintPackageJson\n\t\t\t? []\n\t\t\t: [\"jsonc-eslint-parser\"]),\n\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t...(options.excludeLintMd\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"eslint-plugin-markdown\",\n\t\t\t\t\t\"markdownlint\",\n\t\t\t\t\t\"markdownlint-cli\",\n\t\t\t\t\t\"sentences-per-line\",\n\t\t\t ]),\n\t\t...(options.excludeLintPackageJson ? [] : [\"eslint-plugin-package-json\"]),\n\t\t...(options.excludeLintPerfectionist\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-perfectionist\"]),\n\t\t...(options.excludeLintSpelling ? [] : [\"cspell\"]),\n\t\t...(options.excludeLintYml ? [] : [\"eslint-plugin-yml\"]),\n\t\t...(options.excludeReleases\n\t\t\t? []\n\t\t\t: [\"@release-it/conventional-changelog\", \"release-it\"]),\n\t\t...(options.excludeTests\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"@vitest/coverage-v8\",\n\t\t\t\t\t\"console-fail-test\",\n\t\t\t\t\t\"eslint-plugin-vitest\",\n\t\t\t\t\t\"vitest\",\n\t\t\t ]),\n\t]\n\t\t.filter(Boolean)\n\t\t.sort()\n\t\t.map((packageName) => `${packageName}@latest`)\n\t\t.join(\" \");\n\n\tawait execaCommand(\n\t\t`pnpm add ${devDependencies} -D${options.offline ? \" --offline\" : \"\"}`,\n\t);\n\n\tif (!options.excludeAllContributors) {\n\t\tawait execaCommand(`npx all-contributors-cli generate`);\n\t\tawait removeDependencies(\n\t\t\t[\"all-contributors-cli\", \"all-contributors-for-repository\"],\n\t\t\t(await readPackageData()).devDependencies,\n\t\t\t\"-D\",\n\t\t);\n\t}\n\n\tawait execaCommand(`pnpm dedupe`);\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB,0BAA0B;AAGpD,eAAsB,qBAAqB,SAAkB;AAC5D,QAAM,kBAAkB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,sBAAsB;AAAA,IACjE,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,qBAAqB;AAAA,IACzD,GAAI,QAAQ,mBAAmB,QAAQ,yBACpC,CAAC,IACD,CAAC,qBAAqB;AAAA,IACzB,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,MAAM;AAAA,IAC1C,GAAI,QAAQ,gBACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACA;AAAA,IACH,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,4BAA4B;AAAA,IACvE,GAAI,QAAQ,2BACT,CAAC,IACD,CAAC,6BAA6B;AAAA,IACjC,GAAI,QAAQ,sBAAsB,CAAC,IAAI,CAAC,QAAQ;AAAA,IAChD,GAAI,QAAQ,iBAAiB,CAAC,IAAI,CAAC,mBAAmB;AAAA,IACtD,GAAI,QAAQ,kBACT,CAAC,IACD,CAAC,sCAAsC,YAAY;AAAA,IACtD,GAAI,QAAQ,eACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACA;AAAA,EACJ,EACE,OAAO,OAAO,EACd,KAAK,EACL,IAAI,CAAC,gBAAgB,GAAG,WAAW,SAAS,EAC5C,KAAK,GAAG;AAEV,QAAM;AAAA,IACL,YAAY,eAAe,MAAM,QAAQ,UAAU,eAAe,EAAE;AAAA,EACrE;AAEA,MAAI,CAAC,QAAQ,wBAAwB;AACpC,UAAM,aAAa,mCAAmC;AACtD,UAAM;AAAA,MACL,CAAC,wBAAwB,iCAAiC;AAAA,OACzD,MAAM,gBAAgB,GAAG;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAEA,QAAM,aAAa,aAAa;AACjC;","names":[]}
1
+ {"version":3,"sources":["../../src/steps/finalizeDependencies.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function finalizeDependencies(options: Options) {\n\tconst devDependencies = [\n\t\t\"@eslint/js\",\n\t\t\"@eslint-community/eslint-plugin-eslint-comments\",\n\t\t\"@types/eslint-plugin-markdown\",\n\t\t\"@types/eslint__js\",\n\t\t\"@types/node\",\n\t\t\"eslint\",\n\t\t\"eslint-plugin-jsdoc\",\n\t\t\"eslint-plugin-n\",\n\t\t\"eslint-plugin-regexp\",\n\t\t\"husky\",\n\t\t\"lint-staged\",\n\t\t\"prettier\",\n\t\t\"prettier-plugin-curly\",\n\t\t\"prettier-plugin-sh\",\n\t\t\"prettier-plugin-packagejson\",\n\t\t\"tsup\",\n\t\t\"typescript\",\n\t\t\"typescript-eslint\",\n\t\t...(options.excludeAllContributors ? [] : [\"all-contributors-cli\"]),\n\t\t...(options.excludeLintJson ? [] : [\"eslint-plugin-jsonc\"]),\n\t\t...(options.excludeLintJson && options.excludeLintPackageJson\n\t\t\t? []\n\t\t\t: [\"jsonc-eslint-parser\"]),\n\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t...(options.excludeLintMd\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"eslint-plugin-markdown\",\n\t\t\t\t\t\"markdownlint\",\n\t\t\t\t\t\"markdownlint-cli\",\n\t\t\t\t\t\"sentences-per-line\",\n\t\t\t\t]),\n\t\t...(options.excludeLintPackageJson ? [] : [\"eslint-plugin-package-json\"]),\n\t\t...(options.excludeLintPerfectionist\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-perfectionist\"]),\n\t\t...(options.excludeLintSpelling ? [] : [\"cspell\"]),\n\t\t...(options.excludeLintYml ? [] : [\"eslint-plugin-yml\"]),\n\t\t...(options.excludeReleases\n\t\t\t? []\n\t\t\t: [\"@release-it/conventional-changelog\", \"release-it\"]),\n\t\t...(options.excludeTests\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"@vitest/coverage-v8\",\n\t\t\t\t\t\"console-fail-test\",\n\t\t\t\t\t\"eslint-plugin-vitest\",\n\t\t\t\t\t\"vitest\",\n\t\t\t\t]),\n\t]\n\t\t.filter(Boolean)\n\t\t.sort()\n\t\t.map((packageName) => `${packageName}@latest`)\n\t\t.join(\" \");\n\n\tawait execaCommand(\n\t\t`pnpm add ${devDependencies} -D${options.offline ? \" --offline\" : \"\"}`,\n\t);\n\n\tif (!options.excludeAllContributors) {\n\t\tawait execaCommand(`npx all-contributors-cli generate`);\n\t\tawait removeDependencies(\n\t\t\t[\"all-contributors-cli\", \"all-contributors-for-repository\"],\n\t\t\t(await readPackageData()).devDependencies,\n\t\t\t\"-D\",\n\t\t);\n\t}\n\n\tawait execaCommand(`pnpm dedupe`);\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB,0BAA0B;AAGpD,eAAsB,qBAAqB,SAAkB;AAC5D,QAAM,kBAAkB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,sBAAsB;AAAA,IACjE,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,qBAAqB;AAAA,IACzD,GAAI,QAAQ,mBAAmB,QAAQ,yBACpC,CAAC,IACD,CAAC,qBAAqB;AAAA,IACzB,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,MAAM;AAAA,IAC1C,GAAI,QAAQ,gBACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACF,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,4BAA4B;AAAA,IACvE,GAAI,QAAQ,2BACT,CAAC,IACD,CAAC,6BAA6B;AAAA,IACjC,GAAI,QAAQ,sBAAsB,CAAC,IAAI,CAAC,QAAQ;AAAA,IAChD,GAAI,QAAQ,iBAAiB,CAAC,IAAI,CAAC,mBAAmB;AAAA,IACtD,GAAI,QAAQ,kBACT,CAAC,IACD,CAAC,sCAAsC,YAAY;AAAA,IACtD,GAAI,QAAQ,eACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACH,EACE,OAAO,OAAO,EACd,KAAK,EACL,IAAI,CAAC,gBAAgB,GAAG,WAAW,SAAS,EAC5C,KAAK,GAAG;AAEV,QAAM;AAAA,IACL,YAAY,eAAe,MAAM,QAAQ,UAAU,eAAe,EAAE;AAAA,EACrE;AAEA,MAAI,CAAC,QAAQ,wBAAwB;AACpC,UAAM,aAAa,mCAAmC;AACtD,UAAM;AAAA,MACL,CAAC,wBAAwB,iCAAiC;AAAA,OACzD,MAAM,gBAAgB,GAAG;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAEA,QAAM,aAAa,aAAa;AACjC;","names":[]}
@@ -17,15 +17,15 @@ async function initializeBranchProtectionSettings(octokit, options) {
17
17
  required_pull_request_reviews: null,
18
18
  required_status_checks: {
19
19
  checks: [
20
- { context: "build" },
21
- { context: "lint" },
22
- { context: "prettier" },
23
- ...options.excludeCompliance ? [] : [{ context: "compliance" }],
24
- ...options.excludeLintKnip ? [] : [{ context: "lint_knip" }],
25
- ...options.excludeLintMd ? [] : [{ context: "lint_markdown" }],
26
- ...options.excludeLintPackages ? [] : [{ context: "lint_packages" }],
27
- ...options.excludeLintSpelling ? [] : [{ context: "lint_spelling" }],
28
- ...options.excludeTests ? [] : [{ context: "test" }]
20
+ { context: "Build" },
21
+ ...options.excludeCompliance ? [] : [{ context: "Compliance" }],
22
+ { context: "Lint" },
23
+ ...options.excludeLintKnip ? [] : [{ context: "Lint Knip" }],
24
+ ...options.excludeLintMd ? [] : [{ context: "Lint Markdown" }],
25
+ ...options.excludeLintPackages ? [] : [{ context: "Lint Packages" }],
26
+ ...options.excludeLintSpelling ? [] : [{ context: "Lint Spelling" }],
27
+ { context: "Prettier" },
28
+ ...options.excludeTests ? [] : [{ context: "Test" }]
29
29
  ],
30
30
  strict: false
31
31
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/steps/initializeGitHubRepository/initializeBranchProtectionSettings.ts"],"sourcesContent":["import { RequestError } from \"@octokit/request-error\";\nimport { Octokit } from \"octokit\";\n\nimport { Options } from \"../../shared/types.js\";\n\nexport async function initializeBranchProtectionSettings(\n\toctokit: Octokit,\n\toptions: Options,\n) {\n\ttry {\n\t\tawait octokit.request(\n\t\t\t`PUT /repos/${options.owner}/${options.repository}/branches/main/protection`,\n\t\t\t{\n\t\t\t\tallow_deletions: false,\n\t\t\t\tallow_force_pushes: true,\n\t\t\t\tallow_fork_pushes: false,\n\t\t\t\tallow_fork_syncing: true,\n\t\t\t\tblock_creations: false,\n\t\t\t\tbranch: \"main\",\n\t\t\t\tenforce_admins: false,\n\t\t\t\towner: options.owner,\n\t\t\t\trepo: options.repository,\n\t\t\t\trequired_conversation_resolution: true,\n\t\t\t\trequired_linear_history: false,\n\t\t\t\trequired_pull_request_reviews: null,\n\t\t\t\trequired_status_checks: {\n\t\t\t\t\tchecks: [\n\t\t\t\t\t\t{ context: \"build\" },\n\t\t\t\t\t\t{ context: \"lint\" },\n\t\t\t\t\t\t{ context: \"prettier\" },\n\t\t\t\t\t\t...(options.excludeCompliance ? [] : [{ context: \"compliance\" }]),\n\t\t\t\t\t\t...(options.excludeLintKnip ? [] : [{ context: \"lint_knip\" }]),\n\t\t\t\t\t\t...(options.excludeLintMd ? [] : [{ context: \"lint_markdown\" }]),\n\t\t\t\t\t\t...(options.excludeLintPackages\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: [{ context: \"lint_packages\" }]),\n\t\t\t\t\t\t...(options.excludeLintSpelling\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: [{ context: \"lint_spelling\" }]),\n\t\t\t\t\t\t...(options.excludeTests ? [] : [{ context: \"test\" }]),\n\t\t\t\t\t],\n\t\t\t\t\tstrict: false,\n\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KAAK;AAC3C,aAAO;AAAA,IACR;AAEA,UAAM;AAAA,EACP;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../src/steps/initializeGitHubRepository/initializeBranchProtectionSettings.ts"],"sourcesContent":["import { RequestError } from \"@octokit/request-error\";\nimport { Octokit } from \"octokit\";\n\nimport { Options } from \"../../shared/types.js\";\n\nexport async function initializeBranchProtectionSettings(\n\toctokit: Octokit,\n\toptions: Options,\n) {\n\ttry {\n\t\tawait octokit.request(\n\t\t\t`PUT /repos/${options.owner}/${options.repository}/branches/main/protection`,\n\t\t\t{\n\t\t\t\tallow_deletions: false,\n\t\t\t\tallow_force_pushes: true,\n\t\t\t\tallow_fork_pushes: false,\n\t\t\t\tallow_fork_syncing: true,\n\t\t\t\tblock_creations: false,\n\t\t\t\tbranch: \"main\",\n\t\t\t\tenforce_admins: false,\n\t\t\t\towner: options.owner,\n\t\t\t\trepo: options.repository,\n\t\t\t\trequired_conversation_resolution: true,\n\t\t\t\trequired_linear_history: false,\n\t\t\t\trequired_pull_request_reviews: null,\n\t\t\t\trequired_status_checks: {\n\t\t\t\t\tchecks: [\n\t\t\t\t\t\t{ context: \"Build\" },\n\t\t\t\t\t\t...(options.excludeCompliance ? [] : [{ context: \"Compliance\" }]),\n\t\t\t\t\t\t{ context: \"Lint\" },\n\t\t\t\t\t\t...(options.excludeLintKnip ? [] : [{ context: \"Lint Knip\" }]),\n\t\t\t\t\t\t...(options.excludeLintMd ? [] : [{ context: \"Lint Markdown\" }]),\n\t\t\t\t\t\t...(options.excludeLintPackages\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: [{ context: \"Lint Packages\" }]),\n\t\t\t\t\t\t...(options.excludeLintSpelling\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: [{ context: \"Lint Spelling\" }]),\n\t\t\t\t\t\t{ context: \"Prettier\" },\n\t\t\t\t\t\t...(options.excludeTests ? [] : [{ context: \"Test\" }]),\n\t\t\t\t\t],\n\t\t\t\t\tstrict: false,\n\t\t\t\t},\n\t\t\t\trestrictions: null,\n\t\t\t},\n\t\t);\n\t} catch (error) {\n\t\tif ((error as RequestError).status === 403) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n"],"mappings":"AAKA,eAAsB,mCACrB,SACA,SACC;AACD,MAAI;AACH,UAAM,QAAQ;AAAA,MACb,cAAc,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA,MACjD;AAAA,QACC,iBAAiB;AAAA,QACjB,oBAAoB;AAAA,QACpB,mBAAmB;AAAA,QACnB,oBAAoB;AAAA,QACpB,iBAAiB;AAAA,QACjB,QAAQ;AAAA,QACR,gBAAgB;AAAA,QAChB,OAAO,QAAQ;AAAA,QACf,MAAM,QAAQ;AAAA,QACd,kCAAkC;AAAA,QAClC,yBAAyB;AAAA,QACzB,+BAA+B;AAAA,QAC/B,wBAAwB;AAAA,UACvB,QAAQ;AAAA,YACP,EAAE,SAAS,QAAQ;AAAA,YACnB,GAAI,QAAQ,oBAAoB,CAAC,IAAI,CAAC,EAAE,SAAS,aAAa,CAAC;AAAA,YAC/D,EAAE,SAAS,OAAO;AAAA,YAClB,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,EAAE,SAAS,YAAY,CAAC;AAAA,YAC5D,GAAI,QAAQ,gBAAgB,CAAC,IAAI,CAAC,EAAE,SAAS,gBAAgB,CAAC;AAAA,YAC9D,GAAI,QAAQ,sBACT,CAAC,IACD,CAAC,EAAE,SAAS,gBAAgB,CAAC;AAAA,YAChC,GAAI,QAAQ,sBACT,CAAC,IACD,CAAC,EAAE,SAAS,gBAAgB,CAAC;AAAA,YAChC,EAAE,SAAS,WAAW;AAAA,YACtB,GAAI,QAAQ,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS,OAAO,CAAC;AAAA,UACrD;AAAA,UACA,QAAQ;AAAA,QACT;AAAA,QACA,cAAc;AAAA,MACf;AAAA,IACD;AAAA,EACD,SAAS,OAAO;AACf,QAAK,MAAuB,WAAW,KAAK;AAC3C,aAAO;AAAA,IACR;AAEA,UAAM;AAAA,EACP;AACD;","names":[]}
@@ -1,4 +1,4 @@
1
- import replaceInFile from "replace-in-file";
1
+ import { replaceInFile } from "replace-in-file";
2
2
  import { readFileSafeAsJson } from "../shared/readFileSafeAsJson.js";
3
3
  import { createJoshuaKGoldbergReplacement } from "./createJoshuaKGoldbergReplacement.js";
4
4
  import { endOfReadmeTemplateLine } from "./updateReadme.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/steps/updateLocalFiles.ts"],"sourcesContent":["import replaceInFile, { From, To } from \"replace-in-file\";\n\nimport { readFileSafeAsJson } from \"../shared/readFileSafeAsJson.js\";\nimport { Options } from \"../shared/types.js\";\nimport { createJoshuaKGoldbergReplacement } from \"./createJoshuaKGoldbergReplacement.js\";\nimport { endOfReadmeTemplateLine } from \"./updateReadme.js\";\n\ninterface ExistingPackageData {\n\tdescription?: string;\n\tversion?: string;\n}\n\nexport async function updateLocalFiles(options: Options) {\n\tconst existingPackage = ((await readFileSafeAsJson(\"./package.json\")) ??\n\t\t{}) as ExistingPackageData;\n\n\tconst replacements: [From, To, (string | string[])?][] = [\n\t\t[/Create TypeScript App/g, options.title],\n\t\tcreateJoshuaKGoldbergReplacement(options),\n\t\t[/JoshuaKGoldberg/g, options.owner, \"package.json\"],\n\t\t[/create-typescript-app/g, options.repository],\n\t\t[/\\/\\*\\n.+\\*\\/\\n\\n/gs, ``, \"eslint.config.js\"],\n\t\t[/\"author\": \".+\"/g, `\"author\": \"${options.author}\"`, \"./package.json\"],\n\t\t...(options.mode === \"migrate\"\n\t\t\t? []\n\t\t\t: ([\n\t\t\t\t\t// Only creating a new repository should remove these parts.\n\t\t\t\t\t// Existing ones might coincidentally have them too.\n\t\t\t\t\t[/\"test:create\": \".+\\n/g, ``, \"./package.json\"],\n\t\t\t\t\t[/\"test:initialize\": \".*/g, ``, \"./package.json\"],\n\t\t\t\t\t[/\"initialize\": \".*/g, ``, \"./package.json\"],\n\t\t\t\t\t[/\"test:migrate\": \".+\\n/g, ``, \"./package.json\"],\n\t\t\t\t\t[\n\t\t\t\t\t\t/## Getting Started.*## Development/gs,\n\t\t\t\t\t\t`## Development`,\n\t\t\t\t\t\t\"./README.md\",\n\t\t\t\t\t],\n\t\t\t\t\t[/\\n## Setup Scripts.*$/gs, \"\", \"./.github/DEVELOPMENT.md\"],\n\t\t\t\t\t[`\\t\\t\"src/initialize/index.ts\",\\n`, ``, \"./knip.json\"],\n\t\t\t\t\t[`\\t\\t\"src/migrate/index.ts\",\\n`, ``, \"./knip.json\"],\n\t\t\t\t\t[\n\t\t\t\t\t\t`[\"src/index.ts!\", \"script/initialize*.js\"]`,\n\t\t\t\t\t\t`\"src/index.ts!\"`,\n\t\t\t\t\t\t\"./knip.json\",\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t`[\"src/**/*.ts!\", \"script/**/*.js\"]`,\n\t\t\t\t\t\t`\"src/**/*.ts!\"`,\n\t\t\t\t\t\t\"./knip.json\",\n\t\t\t\t\t],\n\t\t\t\t\t// Edge case: migration scripts will rewrite README.md attribution\n\t\t\t\t\t[\n\t\t\t\t\t\t/> 💙 This package was templated with .+\\./g,\n\t\t\t\t\t\tendOfReadmeTemplateLine,\n\t\t\t\t\t\t\"./README.md\",\n\t\t\t\t\t],\n\t\t\t ] as typeof replacements)),\n\t];\n\n\tif (existingPackage.description) {\n\t\treplacements.push([existingPackage.description, options.description]);\n\t}\n\n\tif (options.mode !== \"migrate\") {\n\t\treplacements.push([/\"bin\": \".+\\n/g, ``, \"./package.json\"]);\n\n\t\tif (options.mode === \"initialize\" && existingPackage.version) {\n\t\t\treplacements.push([\n\t\t\t\tnew RegExp(`\"version\": \"${existingPackage.version}\"`, \"g\"),\n\t\t\t\t`\"version\": \"0.0.0\"`,\n\t\t\t\t\"./package.json\",\n\t\t\t]);\n\t\t}\n\t}\n\n\tfor (const [from, to, files = [\"./.github/**/*\", \"./*.*\"]] of replacements) {\n\t\ttry {\n\t\t\tawait replaceInFile({\n\t\t\t\tallowEmptyPaths: true,\n\t\t\t\tfiles,\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst toString = typeof to === \"function\" ? \"(function)\" : to;\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to replace ${from.toString()} with ${toString} in ${files.toString()}`,\n\t\t\t\t{\n\t\t\t\t\tcause: error,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n}\n"],"mappings":"AAAA,OAAO,mBAAiC;AAExC,SAAS,0BAA0B;AAEnC,SAAS,wCAAwC;AACjD,SAAS,+BAA+B;AAOxC,eAAsB,iBAAiB,SAAkB;AACxD,QAAM,kBAAoB,MAAM,mBAAmB,gBAAgB,KAClE,CAAC;AAEF,QAAM,eAAmD;AAAA,IACxD,CAAC,0BAA0B,QAAQ,KAAK;AAAA,IACxC,iCAAiC,OAAO;AAAA,IACxC,CAAC,oBAAoB,QAAQ,OAAO,cAAc;AAAA,IAClD,CAAC,0BAA0B,QAAQ,UAAU;AAAA,IAC7C,CAAC,sBAAsB,IAAI,kBAAkB;AAAA,IAC7C,CAAC,mBAAmB,cAAc,QAAQ,MAAM,KAAK,gBAAgB;AAAA,IACrE,GAAI,QAAQ,SAAS,YAClB,CAAC,IACA;AAAA;AAAA;AAAA,MAGD,CAAC,yBAAyB,IAAI,gBAAgB;AAAA,MAC9C,CAAC,2BAA2B,IAAI,gBAAgB;AAAA,MAChD,CAAC,sBAAsB,IAAI,gBAAgB;AAAA,MAC3C,CAAC,0BAA0B,IAAI,gBAAgB;AAAA,MAC/C;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MACA,CAAC,2BAA2B,IAAI,0BAA0B;AAAA,MAC1D,CAAC;AAAA,GAAoC,IAAI,aAAa;AAAA,MACtD,CAAC;AAAA,GAAiC,IAAI,aAAa;AAAA,MACnD;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MACA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA;AAAA,MAEA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACA;AAAA,EACJ;AAEA,MAAI,gBAAgB,aAAa;AAChC,iBAAa,KAAK,CAAC,gBAAgB,aAAa,QAAQ,WAAW,CAAC;AAAA,EACrE;AAEA,MAAI,QAAQ,SAAS,WAAW;AAC/B,iBAAa,KAAK,CAAC,iBAAiB,IAAI,gBAAgB,CAAC;AAEzD,QAAI,QAAQ,SAAS,gBAAgB,gBAAgB,SAAS;AAC7D,mBAAa,KAAK;AAAA,QACjB,IAAI,OAAO,eAAe,gBAAgB,OAAO,KAAK,GAAG;AAAA,QACzD;AAAA,QACA;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AAEA,aAAW,CAAC,MAAM,IAAI,QAAQ,CAAC,kBAAkB,OAAO,CAAC,KAAK,cAAc;AAC3E,QAAI;AACH,YAAM,cAAc;AAAA,QACnB,iBAAiB;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAC;AAAA,IACF,SAAS,OAAO;AACf,YAAM,WAAW,OAAO,OAAO,aAAa,eAAe;AAC3D,YAAM,IAAI;AAAA,QACT,qBAAqB,KAAK,SAAS,CAAC,SAAS,QAAQ,OAAO,MAAM,SAAS,CAAC;AAAA,QAC5E;AAAA,UACC,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../src/steps/updateLocalFiles.ts"],"sourcesContent":["import { From, replaceInFile, To } from \"replace-in-file\";\n\nimport { readFileSafeAsJson } from \"../shared/readFileSafeAsJson.js\";\nimport { Options } from \"../shared/types.js\";\nimport { createJoshuaKGoldbergReplacement } from \"./createJoshuaKGoldbergReplacement.js\";\nimport { endOfReadmeTemplateLine } from \"./updateReadme.js\";\n\ninterface ExistingPackageData {\n\tdescription?: string;\n\tversion?: string;\n}\n\nexport async function updateLocalFiles(options: Options) {\n\tconst existingPackage = ((await readFileSafeAsJson(\"./package.json\")) ??\n\t\t{}) as ExistingPackageData;\n\n\tconst replacements: [From, To, (string | string[])?][] = [\n\t\t[/Create TypeScript App/g, options.title],\n\t\tcreateJoshuaKGoldbergReplacement(options),\n\t\t[/JoshuaKGoldberg/g, options.owner, \"package.json\"],\n\t\t[/create-typescript-app/g, options.repository],\n\t\t[/\\/\\*\\n.+\\*\\/\\n\\n/gs, ``, \"eslint.config.js\"],\n\t\t[/\"author\": \".+\"/g, `\"author\": \"${options.author}\"`, \"./package.json\"],\n\t\t...(options.mode === \"migrate\"\n\t\t\t? []\n\t\t\t: ([\n\t\t\t\t\t// Only creating a new repository should remove these parts.\n\t\t\t\t\t// Existing ones might coincidentally have them too.\n\t\t\t\t\t[/\"test:create\": \".+\\n/g, ``, \"./package.json\"],\n\t\t\t\t\t[/\"test:initialize\": \".*/g, ``, \"./package.json\"],\n\t\t\t\t\t[/\"initialize\": \".*/g, ``, \"./package.json\"],\n\t\t\t\t\t[/\"test:migrate\": \".+\\n/g, ``, \"./package.json\"],\n\t\t\t\t\t[\n\t\t\t\t\t\t/## Getting Started.*## Development/gs,\n\t\t\t\t\t\t`## Development`,\n\t\t\t\t\t\t\"./README.md\",\n\t\t\t\t\t],\n\t\t\t\t\t[/\\n## Setup Scripts.*$/gs, \"\", \"./.github/DEVELOPMENT.md\"],\n\t\t\t\t\t[`\\t\\t\"src/initialize/index.ts\",\\n`, ``, \"./knip.json\"],\n\t\t\t\t\t[`\\t\\t\"src/migrate/index.ts\",\\n`, ``, \"./knip.json\"],\n\t\t\t\t\t[\n\t\t\t\t\t\t`[\"src/index.ts!\", \"script/initialize*.js\"]`,\n\t\t\t\t\t\t`\"src/index.ts!\"`,\n\t\t\t\t\t\t\"./knip.json\",\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t`[\"src/**/*.ts!\", \"script/**/*.js\"]`,\n\t\t\t\t\t\t`\"src/**/*.ts!\"`,\n\t\t\t\t\t\t\"./knip.json\",\n\t\t\t\t\t],\n\t\t\t\t\t// Edge case: migration scripts will rewrite README.md attribution\n\t\t\t\t\t[\n\t\t\t\t\t\t/> 💙 This package was templated with .+\\./g,\n\t\t\t\t\t\tendOfReadmeTemplateLine,\n\t\t\t\t\t\t\"./README.md\",\n\t\t\t\t\t],\n\t\t\t\t] as typeof replacements)),\n\t];\n\n\tif (existingPackage.description) {\n\t\treplacements.push([existingPackage.description, options.description]);\n\t}\n\n\tif (options.mode !== \"migrate\") {\n\t\treplacements.push([/\"bin\": \".+\\n/g, ``, \"./package.json\"]);\n\n\t\tif (options.mode === \"initialize\" && existingPackage.version) {\n\t\t\treplacements.push([\n\t\t\t\tnew RegExp(`\"version\": \"${existingPackage.version}\"`, \"g\"),\n\t\t\t\t`\"version\": \"0.0.0\"`,\n\t\t\t\t\"./package.json\",\n\t\t\t]);\n\t\t}\n\t}\n\n\tfor (const [from, to, files = [\"./.github/**/*\", \"./*.*\"]] of replacements) {\n\t\ttry {\n\t\t\tawait replaceInFile({\n\t\t\t\tallowEmptyPaths: true,\n\t\t\t\tfiles,\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst toString = typeof to === \"function\" ? \"(function)\" : to;\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to replace ${from.toString()} with ${toString} in ${files.toString()}`,\n\t\t\t\t{\n\t\t\t\t\tcause: error,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n}\n"],"mappings":"AAAA,SAAe,qBAAyB;AAExC,SAAS,0BAA0B;AAEnC,SAAS,wCAAwC;AACjD,SAAS,+BAA+B;AAOxC,eAAsB,iBAAiB,SAAkB;AACxD,QAAM,kBAAoB,MAAM,mBAAmB,gBAAgB,KAClE,CAAC;AAEF,QAAM,eAAmD;AAAA,IACxD,CAAC,0BAA0B,QAAQ,KAAK;AAAA,IACxC,iCAAiC,OAAO;AAAA,IAC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AC3E,QAAI;AACH,YAAM,cAAc;AAAA,QACnB,iBAAiB;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAC;AAAA,IACF,SAAS,OAAO;AACf,YAAM,WAAW,OAAO,OAAO,aAAa,eAAe;AAC3D,YAAM,IAAI;AAAA,QACT,qBAAqB,KAAK,SAAS,CAAC,SAAS,QAAQ,OAAO,MAAM,SAAS,CAAC;AAAA,QAC5E;AAAA,UACC,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
@@ -72,6 +72,7 @@ export default tseslint.config(
72
72
  "operator-assignment": "error",`}
73
73
 
74
74
  // These on-by-default rules don't work well for this repo and we like them off.${options.excludeLintJSDoc ? "" : `
75
+ "jsdoc/lines-before-block": "off",
75
76
  "jsdoc/require-jsdoc": "off",
76
77
  "jsdoc/require-param": "off",
77
78
  "jsdoc/require-property": "off",
@@ -80,6 +81,10 @@ export default tseslint.config(
80
81
 
81
82
  // These on-by-default rules work well for this repo if configured
82
83
  "@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],${options.excludeLintPerfectionist ? "" : `
84
+ "n/no-unsupported-features/node-builtins": [
85
+ "error",
86
+ { allowExperimental: true },
87
+ ],
83
88
  "perfectionist/sort-objects": [
84
89
  "error",
85
90
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/steps/writing/creation/createESLintConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintConfig(options: Options) {\n\tconst tseslintBase = options.excludeLintStrict ? \"recommended\" : \"strict\";\n\n\tconst imports = [\n\t\t`import eslint from \"@eslint/js\";`,\n\t\t!options.excludeLintESLint &&\n\t\t\t`import comments from \"@eslint-community/eslint-plugin-eslint-comments/configs\";`,\n\t\t!options.excludeLintJSDoc && `import jsdoc from \"eslint-plugin-jsdoc\";`,\n\t\t!options.excludeLintJson && `import jsonc from \"eslint-plugin-jsonc\";`,\n\t\t!options.excludeLintMd && `import markdown from \"eslint-plugin-markdown\";`,\n\t\t`import n from \"eslint-plugin-n\";`,\n\t\t!options.excludeLintPackageJson &&\n\t\t\t`import packageJson from \"eslint-plugin-package-json/configs/recommended\";`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`import perfectionist from \"eslint-plugin-perfectionist\";`,\n\t\t!options.excludeLintRegex &&\n\t\t\t`import * as regexp from \"eslint-plugin-regexp\";`,\n\t\t!options.excludeTests && `import vitest from \"eslint-plugin-vitest\";`,\n\t\t!options.excludeLintYml && `import yml from \"eslint-plugin-yml\";`,\n\t\t`import tseslint from \"typescript-eslint\";`,\n\t].filter(Boolean);\n\n\tconst elements = [\n\t\t`eslint.configs.recommended,`,\n\t\t!options.excludeLintJson &&\n\t\t\t`\t...jsonc.configs[\"flat/recommended-with-json\"],`,\n\t\t!options.excludeLintMd && `\t...markdown.configs.recommended,`,\n\t\t!options.excludeLintYml && `\t...yml.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintYml && `\t...yml.configs[\"flat/prettier\"],`,\n\t\t!options.excludeLintESLint && `\tcomments.recommended,`,\n\t\t!options.excludeLintJSDoc &&\n\t\t\t`\tjsdoc.configs[\"flat/recommended-typescript-error\"],`,\n\t\t`\tn.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintPackageJson && `\tpackageJson,`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`\tperfectionist.configs[\"recommended-natural\"],`,\n\t\t!options.excludeLintRegex && `\tregexp.configs[\"flat/recommended\"],`,\n\t].filter(Boolean);\n\n\treturn await formatTypeScript(`${imports.join(\"\\n\")}\n\nexport default tseslint.config(\n\t{\n\t\tignores: [${\n\t\t\toptions.excludeTests\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\t\t\"coverage*\",`\n\t\t}\n\t\t\t\"lib\",\n\t\t\t\"node_modules\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t\t\"**/*.snap\",\n\t\t],\n\t},\n\t{\n\t\tlinterOptions: {\n\t\t\treportUnusedDisableDirectives: \"error\",\n\t\t},\n\t},\n\t${elements.join(\"\\n\")}\n\t...tseslint.config({\n\t\textends: ${\n\t\t\toptions.excludeLintStylistic\n\t\t\t\t? `tseslint.configs.${tseslintBase}TypeChecked`\n\t\t\t\t: `[\n\t\t\t...tseslint.configs.${tseslintBase}TypeChecked,\n\t\t\t...tseslint.configs.stylisticTypeChecked,\n\t\t]`\n\t\t},\n\t\tfiles: [\"**/*.js\", \"**/*.ts\"],\n\t\tlanguageOptions: {\n\t\t\tparserOptions: {\n\t\t\t\tprojectService: {\n\t\t\t\t\tallowDefaultProject: [\"*.*s\", \"eslint.config.js\"],\n\t\t\t\t\tdefaultProject: \"./tsconfig.json\",\n\t\t\t\t},\n\t\t\t\ttsconfigRootDir: import.meta.dirname\n\t\t\t},\n\t\t},\n\t\trules: {\n\t\t\t${\n\t\t\t\t!options.excludeLintJSDoc || !options.excludeLintStylistic\n\t\t\t\t\t? \"// These off-by-default rules work well for this repo and we like them on.\"\n\t\t\t\t\t: \"\"\n\t\t\t}${\n\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"jsdoc/informative-docs\": \"error\",`\n\t\t\t}${\n\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"logical-assignment-operators\": [\n\t\t\t\t\"error\",\n\t\t\t\t\"always\",\n\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t],\n\t\t\t\"operator-assignment\": \"error\",`\n\t\t\t}\n\n\t\t\t// These on-by-default rules don't work well for this repo and we like them off.${\n\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"jsdoc/require-jsdoc\": \"off\",\n\t\t\t\"jsdoc/require-param\": \"off\",\n\t\t\t\"jsdoc/require-property\": \"off\",\n\t\t\t\"jsdoc/require-returns\": \"off\",`\n\t\t\t}\n\t\t\t\"no-constant-condition\": \"off\",\n\n\t\t\t// These on-by-default rules work well for this repo if configured\n\t\t\t\"@typescript-eslint/no-unused-vars\": [\"error\", { caughtErrors: \"all\" }],${\n\t\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"perfectionist/sort-objects\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: \"asc\",\n\t\t\t\t\tpartitionByComment: true,\n\t\t\t\t\ttype: \"natural\",\n\t\t\t\t},\n\t\t\t],`\n\t\t\t}${\n\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\n\t\t\t// Stylistic concerns that don't interfere with Prettier\n\t\t\t\"no-useless-rename\": \"error\",\n\t\t\t\"object-shorthand\": \"error\",`\n\t\t\t}\n\t\t},\n\t}),\n\t{\n\t\tfiles: [\"*.jsonc\"],\n\t\trules: {\n\t\t\t\"jsonc/comma-dangle\": \"off\",\n\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t\"jsonc/sort-keys\": \"error\",\n\t\t},\n\t},\n\t{\n\t\textends: [tseslint.configs.disableTypeChecked],\n\t\tfiles: [\"**/*.md/*.ts\"],\n\t\trules: {\n\t\t\t\"n/no-missing-import\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ allowModules: [\"${options.repository}\"] },\n\t\t\t],\n\t\t},\n\t},${\n\t\toptions.excludeTests\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\tfiles: [\"**/*.test.*\"],\n\t\tlanguageOptions: {\n\t\t\tglobals: vitest.environments.env.globals,\n\t\t},\n\t\tplugins: { vitest, },\n\t\trules: {\n\t\t\t...vitest.configs.recommended.rules,\n\n\t\t\t// These on-by-default rules aren't useful in test files.\n\t\t\t\"@typescript-eslint/no-unsafe-assignment\": \"off\",\n\t\t\t\"@typescript-eslint/no-unsafe-call\": \"off\",\n\t\t},\n\t},`\n\t}${\n\t\toptions.excludeLintYml\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\tfiles: [\"**/*.{yml,yaml}\"],\n\t\trules: {\n\t\t\t\"yml/file-extension\": [\"error\", { extension: \"yml\" }],\n\t\t\t\"yml/sort-keys\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t},\n\t\t\t],\n\t\t\t\"yml/sort-sequence-values\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},`\n\t}\n);\n`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,mBAAmB,SAAkB;AAC1D,QAAM,eAAe,QAAQ,oBAAoB,gBAAgB;AAEjE,QAAM,UAAU;AAAA,IACf;AAAA,IACA,CAAC,QAAQ,qBACR;AAAA,IACD,CAAC,QAAQ,oBAAoB;AAAA,IAC7B,CAAC,QAAQ,mBAAmB;AAAA,IAC5B,CAAC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,IACA,CAAC,QAAQ,0BACR;AAAA,IACD,CAAC,QAAQ,4BACR;AAAA,IACD,CAAC,QAAQ,oBACR;AAAA,IACD,CAAC,QAAQ,gBAAgB;AAAA,IACzB,CAAC,QAAQ,kBAAkB;AAAA,IAC3B;AAAA,EACD,EAAE,OAAO,OAAO;AAEhB,QAAM,WAAW;AAAA,IAChB;AAAA,IACA,CAAC,QAAQ,mBACR;AAAA,IACD,CAAC,QAAQ,iBAAiB;AAAA,IAC1B,CAAC,QAAQ,kBAAkB;AAAA,IAC3B,CAAC,QAAQ,kBAAkB;AAAA,IAC3B,CAAC,QAAQ,qBAAqB;AAAA,IAC9B,CAAC,QAAQ,oBACR;AAAA,IACD;AAAA,IACA,CAAC,QAAQ,0BAA0B;AAAA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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAqBJ;AAAA;AAAA,CAEA;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../src/steps/writing/creation/createESLintConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintConfig(options: Options) {\n\tconst tseslintBase = options.excludeLintStrict ? \"recommended\" : \"strict\";\n\n\tconst imports = [\n\t\t`import eslint from \"@eslint/js\";`,\n\t\t!options.excludeLintESLint &&\n\t\t\t`import comments from \"@eslint-community/eslint-plugin-eslint-comments/configs\";`,\n\t\t!options.excludeLintJSDoc && `import jsdoc from \"eslint-plugin-jsdoc\";`,\n\t\t!options.excludeLintJson && `import jsonc from \"eslint-plugin-jsonc\";`,\n\t\t!options.excludeLintMd && `import markdown from \"eslint-plugin-markdown\";`,\n\t\t`import n from \"eslint-plugin-n\";`,\n\t\t!options.excludeLintPackageJson &&\n\t\t\t`import packageJson from \"eslint-plugin-package-json/configs/recommended\";`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`import perfectionist from \"eslint-plugin-perfectionist\";`,\n\t\t!options.excludeLintRegex &&\n\t\t\t`import * as regexp from \"eslint-plugin-regexp\";`,\n\t\t!options.excludeTests && `import vitest from \"eslint-plugin-vitest\";`,\n\t\t!options.excludeLintYml && `import yml from \"eslint-plugin-yml\";`,\n\t\t`import tseslint from \"typescript-eslint\";`,\n\t].filter(Boolean);\n\n\tconst elements = [\n\t\t`eslint.configs.recommended,`,\n\t\t!options.excludeLintJson &&\n\t\t\t`\t...jsonc.configs[\"flat/recommended-with-json\"],`,\n\t\t!options.excludeLintMd && `\t...markdown.configs.recommended,`,\n\t\t!options.excludeLintYml && `\t...yml.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintYml && `\t...yml.configs[\"flat/prettier\"],`,\n\t\t!options.excludeLintESLint && `\tcomments.recommended,`,\n\t\t!options.excludeLintJSDoc &&\n\t\t\t`\tjsdoc.configs[\"flat/recommended-typescript-error\"],`,\n\t\t`\tn.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintPackageJson && `\tpackageJson,`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`\tperfectionist.configs[\"recommended-natural\"],`,\n\t\t!options.excludeLintRegex && `\tregexp.configs[\"flat/recommended\"],`,\n\t].filter(Boolean);\n\n\treturn await formatTypeScript(`${imports.join(\"\\n\")}\n\nexport default tseslint.config(\n\t{\n\t\tignores: [${\n\t\t\toptions.excludeTests\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\t\t\"coverage*\",`\n\t\t}\n\t\t\t\"lib\",\n\t\t\t\"node_modules\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t\t\"**/*.snap\",\n\t\t],\n\t},\n\t{\n\t\tlinterOptions: {\n\t\t\treportUnusedDisableDirectives: \"error\",\n\t\t},\n\t},\n\t${elements.join(\"\\n\")}\n\t...tseslint.config({\n\t\textends: ${\n\t\t\toptions.excludeLintStylistic\n\t\t\t\t? `tseslint.configs.${tseslintBase}TypeChecked`\n\t\t\t\t: `[\n\t\t\t...tseslint.configs.${tseslintBase}TypeChecked,\n\t\t\t...tseslint.configs.stylisticTypeChecked,\n\t\t]`\n\t\t},\n\t\tfiles: [\"**/*.js\", \"**/*.ts\"],\n\t\tlanguageOptions: {\n\t\t\tparserOptions: {\n\t\t\t\tprojectService: {\n\t\t\t\t\tallowDefaultProject: [\"*.*s\", \"eslint.config.js\"],\n\t\t\t\t\tdefaultProject: \"./tsconfig.json\",\n\t\t\t\t},\n\t\t\t\ttsconfigRootDir: import.meta.dirname\n\t\t\t},\n\t\t},\n\t\trules: {\n\t\t\t${\n\t\t\t\t!options.excludeLintJSDoc || !options.excludeLintStylistic\n\t\t\t\t\t? \"// These off-by-default rules work well for this repo and we like them on.\"\n\t\t\t\t\t: \"\"\n\t\t\t}${\n\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"jsdoc/informative-docs\": \"error\",`\n\t\t\t}${\n\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"logical-assignment-operators\": [\n\t\t\t\t\"error\",\n\t\t\t\t\"always\",\n\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t],\n\t\t\t\"operator-assignment\": \"error\",`\n\t\t\t}\n\n\t\t\t// These on-by-default rules don't work well for this repo and we like them off.${\n\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"jsdoc/lines-before-block\": \"off\",\n\t\t\t\"jsdoc/require-jsdoc\": \"off\",\n\t\t\t\"jsdoc/require-param\": \"off\",\n\t\t\t\"jsdoc/require-property\": \"off\",\n\t\t\t\"jsdoc/require-returns\": \"off\",`\n\t\t\t}\n\t\t\t\"no-constant-condition\": \"off\",\n\n\t\t\t// These on-by-default rules work well for this repo if configured\n\t\t\t\"@typescript-eslint/no-unused-vars\": [\"error\", { caughtErrors: \"all\" }],${\n\t\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"n/no-unsupported-features/node-builtins\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ allowExperimental: true },\n\t\t\t],\n\t\t\t\"perfectionist/sort-objects\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: \"asc\",\n\t\t\t\t\tpartitionByComment: true,\n\t\t\t\t\ttype: \"natural\",\n\t\t\t\t},\n\t\t\t],`\n\t\t\t}${\n\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\n\t\t\t// Stylistic concerns that don't interfere with Prettier\n\t\t\t\"no-useless-rename\": \"error\",\n\t\t\t\"object-shorthand\": \"error\",`\n\t\t\t}\n\t\t},\n\t}),\n\t{\n\t\tfiles: [\"*.jsonc\"],\n\t\trules: {\n\t\t\t\"jsonc/comma-dangle\": \"off\",\n\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t\"jsonc/sort-keys\": \"error\",\n\t\t},\n\t},\n\t{\n\t\textends: [tseslint.configs.disableTypeChecked],\n\t\tfiles: [\"**/*.md/*.ts\"],\n\t\trules: {\n\t\t\t\"n/no-missing-import\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ allowModules: [\"${options.repository}\"] },\n\t\t\t],\n\t\t},\n\t},${\n\t\toptions.excludeTests\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\tfiles: [\"**/*.test.*\"],\n\t\tlanguageOptions: {\n\t\t\tglobals: vitest.environments.env.globals,\n\t\t},\n\t\tplugins: { vitest, },\n\t\trules: {\n\t\t\t...vitest.configs.recommended.rules,\n\n\t\t\t// These on-by-default rules aren't useful in test files.\n\t\t\t\"@typescript-eslint/no-unsafe-assignment\": \"off\",\n\t\t\t\"@typescript-eslint/no-unsafe-call\": \"off\",\n\t\t},\n\t},`\n\t}${\n\t\toptions.excludeLintYml\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\tfiles: [\"**/*.{yml,yaml}\"],\n\t\trules: {\n\t\t\t\"yml/file-extension\": [\"error\", { extension: \"yml\" }],\n\t\t\t\"yml/sort-keys\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t},\n\t\t\t],\n\t\t\t\"yml/sort-sequence-values\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\tpathPattern: \"^.*$\",\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},`\n\t}\n);\n`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,mBAAmB,SAAkB;AAC1D,QAAM,eAAe,QAAQ,oBAAoB,gBAAgB;AAEjE,QAAM,UAAU;AAAA,IACf;AAAA,IACA,CAA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AAAA;AAAA,mCAOJ;AAAA;AAAA,qFAGC,QAAQ,mBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAMJ;AAAA;AAAA;AAAA;AAAA,6EAKC,QAAQ,2BACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAaJ,GACC,QAAQ,uBACL,KACA;AAAA;AAAA;AAAA;AAAA,gCAKJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAiBqB,QAAQ,UAAU;AAAA;AAAA;AAAA,KAIxC,QAAQ,eACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAeJ,GACC,QAAQ,iBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAqBJ;AAAA;AAAA,CAEA;AACD;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/steps/writing/creation/dotGitHub/createDevelopment/index.ts"],"sourcesContent":["import { readFileSafe } from \"../../../../../shared/readFileSafe.js\";\nimport { Options } from \"../../../../../shared/types.js\";\nimport { splitIntoSections } from \"./splitIntoSections.js\";\n\nconst headingAliases = new Map([\n\t[\"build\", \"Building\"],\n\t[\"builds\", \"Building\"],\n\t[\"format\", \"Formatting\"],\n\t[\"lint\", \"Linting\"],\n\t[\"test\", \"Testing\"],\n\t[\"tests\", \"Testing\"],\n]);\n\nfunction createLintingSection(options: Options) {\n\tconst lintLines = [\n\t\t!options.excludeLintKnip &&\n\t\t\t`- \\`pnpm lint:knip\\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`,\n\t\t!options.excludeLintMd &&\n\t\t\t`- \\`pnpm lint:md\\` ([Markdownlint](https://github.com/DavidAnson/markdownlint): Checks Markdown source files`,\n\t\t!options.excludeLintPackages &&\n\t\t\t`- \\`pnpm lint:packages\\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \\`pnpm-lock.yml\\` file`,\n\t\t!options.excludeLintSpelling &&\n\t\t\t`- \\`pnpm lint:spelling\\` ([cspell](https://cspell.org)): Spell checks across all source files`,\n\t].filter(Boolean);\n\n\treturn lintLines.length\n\t\t? [\n\t\t\t\t`This package includes several forms of linting to enforce consistent code quality and styling.`,\n\t\t\t\t`Each should be shown in VS Code, and can be run manually on the command-line:`,\n\t\t\t\t``,\n\t\t\t\t`- \\`pnpm lint\\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files`,\n\t\t\t\t...lintLines,\n\t\t\t\t``,\n\t\t\t\t`Read the individual documentation for each linter to understand how it can be configured and used best.`,\n\t\t\t\t``,\n\t\t\t\t`For example, ESLint can be run with \\`--fix\\` to auto-fix some lint rule complaints:`,\n\t\t ].join(\"\\n\")\n\t\t: `[ESLint](https://eslint.org) is used with with [typescript-eslint](https://typescript-eslint.io)) to lint JavaScript and TypeScript source files.\nYou can run it locally on the command-line:\n\n\\`\\`\\`shell\npnpm run lint\n\\`\\`\\`\n\nESLint can be run with \\`--fix\\` to auto-fix some lint rule complaints:`;\n}\n\nexport async function createDevelopment(options: Options) {\n\tconst existingContents = await readFileSafe(\".github/DEVELOPMENT.md\", \"\");\n\n\tconst newSections = {\n\t\t\"## Building\": `Run [**tsup**](https://tsup.egoist.dev) locally to build source files from \\`src/\\` into output files in \\`lib/\\`:\n\n\\`\\`\\`shell\npnpm build\n\\`\\`\\`\n\nAdd \\`--watch\\` to run the builder in a watch mode that continuously cleans and recreates \\`lib/\\` as you save files:\n\n\\`\\`\\`shell\npnpm build --watch\n\\`\\`\\``,\n\t\t\"## Formatting\": `[Prettier](https://prettier.io) is used to format code.\nIt should be applied automatically when you save files in VS Code or make a Git commit.\n\nTo manually reformat all files, you can run:\n\n\\`\\`\\`shell\npnpm format --write\n\\`\\`\\``,\n\t\t\"## Linting\": `${createLintingSection(options)}\n\n\\`\\`\\`shell\npnpm run lint --fix\n\\`\\`\\`\n\nNote that you'll likely need to run \\`pnpm build\\` before \\`pnpm lint\\` so that lint rules which check the file system can pick up on any built files.`,\n\t\t...(!options.excludeTests && {\n\t\t\t\"## Testing\": `[Vitest](https://vitest.dev) is used for tests.\nYou can run it locally on the command-line:\n\n\\`\\`\\`shell\npnpm run test\n\\`\\`\\`\n\nAdd the \\`--coverage\\` flag to compute test coverage and place reports in the \\`coverage/\\` directory:\n\n\\`\\`\\`shell\npnpm run test --coverage\n\\`\\`\\`\n\nNote that [console-fail-test](https://github.com/JoshuaKGoldberg/console-fail-test) is enabled for all test runs.\nCalls to \\`console.log\\`, \\`console.warn\\`, and other console methods will cause a test to fail.`,\n\n\t\t\t\"### Debugging Tests\": `This repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging unit tests.\nTo launch it, open a test file, then run _Debug Current Test File_ from the VS Code Debug panel (or press F5).`,\n\t\t}),\n\t\t\"## Type Checking\": `You should be able to see suggestions from [TypeScript](https://typescriptlang.org) in your editor for all open files.\n\nHowever, it can be useful to run the TypeScript command-line (\\`tsc\\`) to type check all files in \\`src/\\`:\n\n\\`\\`\\`shell\npnpm tsc\n\\`\\`\\`\n\nAdd \\`--watch\\` to keep the type checker running in a watch mode that updates the display as you save files:\n\n\\`\\`\\`shell\npnpm tsc --watch\n\\`\\`\\``,\n\t};\n\n\tconst newSectionHeadings = new Set([\n\t\t\"Development\",\n\t\tObject.keys(newSections).map((key) => key.replace(/^#* /, \"\")),\n\t]);\n\n\tconst preservedSections = Object.fromEntries(\n\t\tsplitIntoSections(existingContents).filter(([key]) => {\n\t\t\tconst keyText = key.replace(/^#* /, \"\");\n\t\t\treturn !newSectionHeadings.has(\n\t\t\t\theadingAliases.get(keyText.toLowerCase()) ?? keyText,\n\t\t\t);\n\t\t}),\n\t);\n\n\tconst result = `# Development\n${\n\toptions.guide\n\t\t? `\n> If you'd like a more guided walkthrough, see [${options.guide.title}](${options.guide.href}).\n> It'll walk you through the common activities you'll need to contribute.\n`\n\t\t: \"\"\n}\nAfter [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation):\n\n\\`\\`\\`shell\ngit clone https://github.com/<your-name-here>/${options.repository}\ncd ${options.repository}\npnpm install\n\\`\\`\\`\n\n> This repository includes a list of suggested VS Code extensions.\n> It's a good idea to use [VS Code](https://code.visualstudio.com) and accept its suggestion to install them, as they'll help with development.\n\n${Object.entries({ ...newSections, ...preservedSections })\n\t.map(\n\t\t([heading, content]) => `${heading}\n\n${content}`,\n\t)\n\t.join(\"\\n\\n\")}\n`;\n\n\treturn result;\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAElC,MAAM,iBAAiB,oBAAI,IAAI;AAAA,EAC9B,CAAC,SAAS,UAAU;AAAA,EACpB,CAAC,UAAU,UAAU;AAAA,EACrB,CAAC,UAAU,YAAY;AAAA,EACvB,CAAC,QAAQ,SAAS;AAAA,EAClB,CAAC,QAAQ,SAAS;AAAA,EAClB,CAAC,SAAS,SAAS;AACpB,CAAC;AAED,SAAS,qBAAqB,SAAkB;AAC/C,QAAM,YAAY;AAAA,IACjB,CAAC,QAAQ,mBACR;AAAA,IACD,CAAC,QAAQ,iBACR;AAAA,IACD,CAAC,QAAQ,uBACR;AAAA,IACD,CAAC,QAAQ,uBACR;AAAA,EACF,EAAE,OAAO,OAAO;AAEhB,SAAO,UAAU,SACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA,EAAE,KAAK,IAAI,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOrB,OAAO,QAAQ,EAAE,GAAG,aAAa,GAAG,kBAAkB,CAAC,EACvD;AAAA,IACA,CAAC,CAAC,SAAS,OAAO,MAAM,GAAG,OAAO;AAAA;AAAA,EAElC,OAAO;AAAA,EACR,EACC,KAAK,MAAM,CAAC;AAAA;AAGb,SAAO;AACR;","names":[]}
1
+ {"version":3,"sources":["../../../../../../src/steps/writing/creation/dotGitHub/createDevelopment/index.ts"],"sourcesContent":["import { readFileSafe } from \"../../../../../shared/readFileSafe.js\";\nimport { Options } from \"../../../../../shared/types.js\";\nimport { splitIntoSections } from \"./splitIntoSections.js\";\n\nconst headingAliases = new Map([\n\t[\"build\", \"Building\"],\n\t[\"builds\", \"Building\"],\n\t[\"format\", \"Formatting\"],\n\t[\"lint\", \"Linting\"],\n\t[\"test\", \"Testing\"],\n\t[\"tests\", \"Testing\"],\n]);\n\nfunction createLintingSection(options: Options) {\n\tconst lintLines = [\n\t\t!options.excludeLintKnip &&\n\t\t\t`- \\`pnpm lint:knip\\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`,\n\t\t!options.excludeLintMd &&\n\t\t\t`- \\`pnpm lint:md\\` ([Markdownlint](https://github.com/DavidAnson/markdownlint): Checks Markdown source files`,\n\t\t!options.excludeLintPackages &&\n\t\t\t`- \\`pnpm lint:packages\\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \\`pnpm-lock.yml\\` file`,\n\t\t!options.excludeLintSpelling &&\n\t\t\t`- \\`pnpm lint:spelling\\` ([cspell](https://cspell.org)): Spell checks across all source files`,\n\t].filter(Boolean);\n\n\treturn lintLines.length\n\t\t? [\n\t\t\t\t`This package includes several forms of linting to enforce consistent code quality and styling.`,\n\t\t\t\t`Each should be shown in VS Code, and can be run manually on the command-line:`,\n\t\t\t\t``,\n\t\t\t\t`- \\`pnpm lint\\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files`,\n\t\t\t\t...lintLines,\n\t\t\t\t``,\n\t\t\t\t`Read the individual documentation for each linter to understand how it can be configured and used best.`,\n\t\t\t\t``,\n\t\t\t\t`For example, ESLint can be run with \\`--fix\\` to auto-fix some lint rule complaints:`,\n\t\t\t].join(\"\\n\")\n\t\t: `[ESLint](https://eslint.org) is used with with [typescript-eslint](https://typescript-eslint.io)) to lint JavaScript and TypeScript source files.\nYou can run it locally on the command-line:\n\n\\`\\`\\`shell\npnpm run lint\n\\`\\`\\`\n\nESLint can be run with \\`--fix\\` to auto-fix some lint rule complaints:`;\n}\n\nexport async function createDevelopment(options: Options) {\n\tconst existingContents = await readFileSafe(\".github/DEVELOPMENT.md\", \"\");\n\n\tconst newSections = {\n\t\t\"## Building\": `Run [**tsup**](https://tsup.egoist.dev) locally to build source files from \\`src/\\` into output files in \\`lib/\\`:\n\n\\`\\`\\`shell\npnpm build\n\\`\\`\\`\n\nAdd \\`--watch\\` to run the builder in a watch mode that continuously cleans and recreates \\`lib/\\` as you save files:\n\n\\`\\`\\`shell\npnpm build --watch\n\\`\\`\\``,\n\t\t\"## Formatting\": `[Prettier](https://prettier.io) is used to format code.\nIt should be applied automatically when you save files in VS Code or make a Git commit.\n\nTo manually reformat all files, you can run:\n\n\\`\\`\\`shell\npnpm format --write\n\\`\\`\\``,\n\t\t\"## Linting\": `${createLintingSection(options)}\n\n\\`\\`\\`shell\npnpm run lint --fix\n\\`\\`\\`\n\nNote that you'll likely need to run \\`pnpm build\\` before \\`pnpm lint\\` so that lint rules which check the file system can pick up on any built files.`,\n\t\t...(!options.excludeTests && {\n\t\t\t\"## Testing\": `[Vitest](https://vitest.dev) is used for tests.\nYou can run it locally on the command-line:\n\n\\`\\`\\`shell\npnpm run test\n\\`\\`\\`\n\nAdd the \\`--coverage\\` flag to compute test coverage and place reports in the \\`coverage/\\` directory:\n\n\\`\\`\\`shell\npnpm run test --coverage\n\\`\\`\\`\n\nNote that [console-fail-test](https://github.com/JoshuaKGoldberg/console-fail-test) is enabled for all test runs.\nCalls to \\`console.log\\`, \\`console.warn\\`, and other console methods will cause a test to fail.`,\n\n\t\t\t\"### Debugging Tests\": `This repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging unit tests.\nTo launch it, open a test file, then run _Debug Current Test File_ from the VS Code Debug panel (or press F5).`,\n\t\t}),\n\t\t\"## Type Checking\": `You should be able to see suggestions from [TypeScript](https://typescriptlang.org) in your editor for all open files.\n\nHowever, it can be useful to run the TypeScript command-line (\\`tsc\\`) to type check all files in \\`src/\\`:\n\n\\`\\`\\`shell\npnpm tsc\n\\`\\`\\`\n\nAdd \\`--watch\\` to keep the type checker running in a watch mode that updates the display as you save files:\n\n\\`\\`\\`shell\npnpm tsc --watch\n\\`\\`\\``,\n\t};\n\n\tconst newSectionHeadings = new Set([\n\t\t\"Development\",\n\t\tObject.keys(newSections).map((key) => key.replace(/^#* /, \"\")),\n\t]);\n\n\tconst preservedSections = Object.fromEntries(\n\t\tsplitIntoSections(existingContents).filter(([key]) => {\n\t\t\tconst keyText = key.replace(/^#* /, \"\");\n\t\t\treturn !newSectionHeadings.has(\n\t\t\t\theadingAliases.get(keyText.toLowerCase()) ?? keyText,\n\t\t\t);\n\t\t}),\n\t);\n\n\tconst result = `# Development\n${\n\toptions.guide\n\t\t? `\n> If you'd like a more guided walkthrough, see [${options.guide.title}](${options.guide.href}).\n> It'll walk you through the common activities you'll need to contribute.\n`\n\t\t: \"\"\n}\nAfter [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation):\n\n\\`\\`\\`shell\ngit clone https://github.com/<your-name-here>/${options.repository}\ncd ${options.repository}\npnpm install\n\\`\\`\\`\n\n> This repository includes a list of suggested VS Code extensions.\n> It's a good idea to use [VS Code](https://code.visualstudio.com) and accept its suggestion to install them, as they'll help with development.\n\n${Object.entries({ ...newSections, ...preservedSections })\n\t.map(\n\t\t([heading, content]) =>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AAuB;AAAA;AAAA,IAExB;AAAA,IACA,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAarB;AAEA,QAAM,qBAAqB,oBAAI,IAAI;AAAA,IAClC;AAAA,IACA,OAAO,KAAK,WAAW,EAAE,IAAI,CAAC,QAAQ,IAAI,QAAQ,QAAQ,EAAE,CAAC;AAAA,EAC9D,CAAC;AAED,QAAM,oBAAoB,OAAO;AAAA,IAChC,kBAAkB,gBAAgB,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM;AACrD,YAAM,UAAU,IAAI,QAAQ,QAAQ,EAAE;AACtC,aAAO,CAAC,mBAAmB;AAAA,QAC1B,eAAe,IAAI,QAAQ,YAAY,CAAC,KAAK;AAAA,MAC9C;AAAA,IACD,CAAC;AAAA,EACF;AAEA,QAAM,SAAS;AAAA,EAEf,QAAQ,QACL;AAAA,kDAC8C,QAAQ,MAAM,KAAK,KAAK,QAAQ,MAAM,IAAI;AAAA;AAAA,IAGxF,EACJ;AAAA;AAAA;AAAA;AAAA,gDAIgD,QAAQ,UAAU;AAAA,KAC7D,QAAQ,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOrB,OAAO,QAAQ,EAAE,GAAG,aAAa,GAAG,kBAAkB,CAAC,EACvD;AAAA,IACA,CAAC,CAAC,SAAS,OAAO,MAAM,GAAG,OAAO;AAAA;AAAA,EAElC,OAAO;AAAA,EACR,EACC,KAAK,MAAM,CAAC;AAAA;AAGb,SAAO;AACR;","names":[]}
@@ -0,0 +1,16 @@
1
+ type MultiWorkflowJobStep = {
2
+ run: string;
3
+ } | {
4
+ uses: string;
5
+ };
6
+ interface MultiWorkflowJobOptions {
7
+ name: string;
8
+ steps: MultiWorkflowJobStep[];
9
+ }
10
+ interface MultiWorkflowFileOptions {
11
+ jobs: MultiWorkflowJobOptions[];
12
+ name: string;
13
+ }
14
+ declare function createMultiWorkflowFile({ jobs, name, }: MultiWorkflowFileOptions): string;
15
+
16
+ export { type MultiWorkflowFileOptions, type MultiWorkflowJobOptions, type MultiWorkflowJobStep, createMultiWorkflowFile };
@@ -0,0 +1,33 @@
1
+ import { formatWorkflowYaml } from "./formatWorkflowYaml.js";
2
+ function createMultiWorkflowFile({
3
+ jobs,
4
+ name
5
+ }) {
6
+ return formatWorkflowYaml({
7
+ jobs: Object.fromEntries(
8
+ jobs.map((job) => [
9
+ job.name.toLowerCase().replaceAll(" ", "_"),
10
+ {
11
+ name: job.name,
12
+ "runs-on": "ubuntu-latest",
13
+ steps: [
14
+ { uses: "actions/checkout@v4" },
15
+ { uses: "./.github/actions/prepare" },
16
+ ...job.steps
17
+ ]
18
+ }
19
+ ])
20
+ ),
21
+ name,
22
+ on: {
23
+ pull_request: null,
24
+ push: {
25
+ branches: ["main"]
26
+ }
27
+ }
28
+ });
29
+ }
30
+ export {
31
+ createMultiWorkflowFile
32
+ };
33
+ //# sourceMappingURL=createMultiWorkflowFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createMultiWorkflowFile.ts"],"sourcesContent":["import { formatWorkflowYaml } from \"./formatWorkflowYaml.js\";\n\nexport type MultiWorkflowJobStep = { run: string } | { uses: string };\n\nexport interface MultiWorkflowJobOptions {\n\tname: string;\n\tsteps: MultiWorkflowJobStep[];\n}\n\nexport interface MultiWorkflowFileOptions {\n\tjobs: MultiWorkflowJobOptions[];\n\tname: string;\n}\n\nexport function createMultiWorkflowFile({\n\tjobs,\n\tname,\n}: MultiWorkflowFileOptions) {\n\treturn formatWorkflowYaml({\n\t\tjobs: Object.fromEntries(\n\t\t\tjobs.map((job) => [\n\t\t\t\tjob.name.toLowerCase().replaceAll(\" \", \"_\"),\n\t\t\t\t{\n\t\t\t\t\tname: job.name,\n\t\t\t\t\t\"runs-on\": \"ubuntu-latest\",\n\t\t\t\t\tsteps: [\n\t\t\t\t\t\t{ uses: \"actions/checkout@v4\" },\n\t\t\t\t\t\t{ uses: \"./.github/actions/prepare\" },\n\t\t\t\t\t\t...job.steps,\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t]),\n\t\t),\n\t\tname,\n\t\ton: {\n\t\t\tpull_request: null,\n\t\t\tpush: {\n\t\t\t\tbranches: [\"main\"],\n\t\t\t},\n\t\t},\n\t});\n}\n"],"mappings":"AAAA,SAAS,0BAA0B;AAc5B,SAAS,wBAAwB;AAAA,EACvC;AAAA,EACA;AACD,GAA6B;AAC5B,SAAO,mBAAmB;AAAA,IACzB,MAAM,OAAO;AAAA,MACZ,KAAK,IAAI,CAAC,QAAQ;AAAA,QACjB,IAAI,KAAK,YAAY,EAAE,WAAW,KAAK,GAAG;AAAA,QAC1C;AAAA,UACC,MAAM,IAAI;AAAA,UACV,WAAW;AAAA,UACX,OAAO;AAAA,YACN,EAAE,MAAM,sBAAsB;AAAA,YAC9B,EAAE,MAAM,4BAA4B;AAAA,YACpC,GAAG,IAAI;AAAA,UACR;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAAA,IACA;AAAA,IACA,IAAI;AAAA,MACH,cAAc;AAAA,MACd,MAAM;AAAA,QACL,UAAU,CAAC,MAAM;AAAA,MAClB;AAAA,IACD;AAAA,EACD,CAAC;AACF;","names":[]}
@@ -52,6 +52,6 @@ interface WorkflowFileOptionsSteps extends WorkflowFileOptionsBase {
52
52
  steps: WorkflowFileStep[];
53
53
  }
54
54
  type WorkflowFileOptions = WorkflowFileOptionsRuns | WorkflowFileOptionsSteps;
55
- declare function createWorkflowFile({ concurrency, name, on, permissions, ...options }: WorkflowFileOptions): string;
55
+ declare function createSoloWorkflowFile({ concurrency, name, on, permissions, ...options }: WorkflowFileOptions): string;
56
56
 
57
- export { createWorkflowFile };
57
+ export { createSoloWorkflowFile };
@@ -1,17 +1,12 @@
1
- import { formatYaml } from "../formatters/formatYaml.js";
2
- function createWorkflowFile({
1
+ import { formatWorkflowYaml } from "./formatWorkflowYaml.js";
2
+ function createSoloWorkflowFile({
3
3
  concurrency,
4
4
  name,
5
- on = {
6
- pull_request: null,
7
- push: {
8
- branches: ["main"]
9
- }
10
- },
5
+ on,
11
6
  permissions,
12
7
  ...options
13
8
  }) {
14
- return formatYaml({
9
+ return formatWorkflowYaml({
15
10
  concurrency,
16
11
  jobs: {
17
12
  [name.replaceAll(" ", "_").toLowerCase()]: {
@@ -27,9 +22,9 @@ function createWorkflowFile({
27
22
  name,
28
23
  on,
29
24
  permissions
30
- }).replaceAll(/\n(\S)/g, "\n\n$1").replaceAll(/: "\\n(.+)"/g, ": |\n$1").replaceAll("\\n", "\n").replaceAll("\\t", " ");
25
+ });
31
26
  }
32
27
  export {
33
- createWorkflowFile
28
+ createSoloWorkflowFile
34
29
  };
35
- //# sourceMappingURL=createWorkflowFile.js.map
30
+ //# sourceMappingURL=createSoloWorkflowFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createSoloWorkflowFile.ts"],"sourcesContent":["import { formatWorkflowYaml } from \"./formatWorkflowYaml.js\";\n\ninterface WorkflowFileConcurrency {\n\t\"cancel-in-progress\"?: boolean;\n\tgroup: string;\n}\n\ninterface WorkflowFileOn {\n\tissue_comment?: {\n\t\ttypes?: string[];\n\t};\n\tissues?: {\n\t\ttypes?: string[];\n\t};\n\tpull_request?:\n\t\t| {\n\t\t\t\tbranches?: string | string[];\n\t\t\t\ttypes?: string[];\n\t\t }\n\t\t| null\n\t\t| string;\n\tpull_request_target?: {\n\t\ttypes: string[];\n\t};\n\tpush?: {\n\t\tbranches: string[];\n\t};\n\trelease?: {\n\t\ttypes: string[];\n\t};\n\tworkflow_dispatch?: null | string;\n}\n\ninterface WorkflowFilePermissions {\n\tcontents?: string;\n\t\"id-token\"?: string;\n\tissues?: string;\n\t\"pull-requests\"?: string;\n}\n\ninterface WorkflowFileStep {\n\tenv?: Record<string, string>;\n\tif?: string;\n\tname?: string;\n\trun?: string;\n\tuses?: string;\n\twith?: Record<string, unknown>;\n}\n\ninterface WorkflowFileOptionsBase {\n\tconcurrency?: WorkflowFileConcurrency;\n\tif?: string;\n\tname: string;\n\ton?: WorkflowFileOn;\n\tpermissions?: WorkflowFilePermissions;\n}\n\ninterface WorkflowFileOptionsRuns extends WorkflowFileOptionsBase {\n\truns: (string | WorkflowFileStep)[];\n}\n\ninterface WorkflowFileOptionsSteps extends WorkflowFileOptionsBase {\n\tsteps: WorkflowFileStep[];\n}\n\ntype WorkflowFileOptions = WorkflowFileOptionsRuns | WorkflowFileOptionsSteps;\n\nexport function createSoloWorkflowFile({\n\tconcurrency,\n\tname,\n\ton,\n\tpermissions,\n\t...options\n}: WorkflowFileOptions) {\n\treturn formatWorkflowYaml({\n\t\tconcurrency,\n\t\tjobs: {\n\t\t\t[name.replaceAll(\" \", \"_\").toLowerCase()]: {\n\t\t\t\t...(options.if && { if: options.if }),\n\t\t\t\t\"runs-on\": \"ubuntu-latest\",\n\t\t\t\tsteps:\n\t\t\t\t\t\"runs\" in options\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{ uses: \"actions/checkout@v4\" },\n\t\t\t\t\t\t\t\t{ uses: \"./.github/actions/prepare\" },\n\t\t\t\t\t\t\t\t...options.runs.map((run) => ({ run })),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t: options.steps,\n\t\t\t},\n\t\t},\n\t\tname,\n\t\ton,\n\t\tpermissions,\n\t});\n}\n"],"mappings":"AAAA,SAAS,0BAA0B;AAmE5B,SAAS,uBAAuB;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAwB;AACvB,SAAO,mBAAmB;AAAA,IACzB;AAAA,IACA,MAAM;AAAA,MACL,CAAC,KAAK,WAAW,KAAK,GAAG,EAAE,YAAY,CAAC,GAAG;AAAA,QAC1C,GAAI,QAAQ,MAAM,EAAE,IAAI,QAAQ,GAAG;AAAA,QACnC,WAAW;AAAA,QACX,OACC,UAAU,UACP;AAAA,UACA,EAAE,MAAM,sBAAsB;AAAA,UAC9B,EAAE,MAAM,4BAA4B;AAAA,UACpC,GAAG,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE;AAAA,QACvC,IACC,QAAQ;AAAA,MACb;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AACF;","names":[]}