create-typescript-app 1.75.1 → 1.77.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 (266) hide show
  1. package/README.md +1 -1
  2. package/lib/bin/help.js +35 -35
  3. package/lib/bin/help.js.map +1 -1
  4. package/lib/bin/promptForMode.js +6 -6
  5. package/lib/bin/promptForMode.js.map +1 -1
  6. package/lib/create/createWithOptions.js +12 -13
  7. package/lib/create/createWithOptions.js.map +1 -1
  8. package/lib/index.d.ts +45 -0
  9. package/lib/index.js +5 -0
  10. package/lib/index.js.map +1 -1
  11. package/lib/next/base.d.ts +101 -0
  12. package/lib/next/base.js +140 -0
  13. package/lib/next/base.js.map +1 -0
  14. package/lib/next/blocks/blockAllContributors.d.ts +48 -0
  15. package/lib/next/blocks/blockAllContributors.js +59 -0
  16. package/lib/next/blocks/blockAllContributors.js.map +1 -0
  17. package/lib/next/blocks/blockAreTheTypesWrong.d.ts +48 -0
  18. package/lib/next/blocks/blockAreTheTypesWrong.js +29 -0
  19. package/lib/next/blocks/blockAreTheTypesWrong.js.map +1 -0
  20. package/lib/next/blocks/blockCSpell.d.ts +51 -0
  21. package/lib/next/blocks/blockCSpell.js +77 -0
  22. package/lib/next/blocks/blockCSpell.js.map +1 -0
  23. package/lib/next/blocks/blockContributingDocs.d.ts +48 -0
  24. package/lib/next/blocks/blockContributingDocs.js +116 -0
  25. package/lib/next/blocks/blockContributingDocs.js.map +1 -0
  26. package/lib/next/blocks/blockContributorCovenant.d.ts +48 -0
  27. package/lib/next/blocks/blockContributorCovenant.js +151 -0
  28. package/lib/next/blocks/blockContributorCovenant.js.map +1 -0
  29. package/lib/next/blocks/blockDevelopmentDocs.d.ts +62 -0
  30. package/lib/next/blocks/blockDevelopmentDocs.js +86 -0
  31. package/lib/next/blocks/blockDevelopmentDocs.js.map +1 -0
  32. package/lib/next/blocks/blockESLint.d.ts +73 -0
  33. package/lib/next/blocks/blockESLint.js +225 -0
  34. package/lib/next/blocks/blockESLint.js.map +1 -0
  35. package/lib/next/blocks/blockESLintComments.d.ts +48 -0
  36. package/lib/next/blocks/blockESLintComments.js +26 -0
  37. package/lib/next/blocks/blockESLintComments.js.map +1 -0
  38. package/lib/next/blocks/blockESLintJSDoc.d.ts +48 -0
  39. package/lib/next/blocks/blockESLintJSDoc.js +25 -0
  40. package/lib/next/blocks/blockESLintJSDoc.js.map +1 -0
  41. package/lib/next/blocks/blockESLintJSONC.d.ts +48 -0
  42. package/lib/next/blocks/blockESLintJSONC.js +21 -0
  43. package/lib/next/blocks/blockESLintJSONC.js.map +1 -0
  44. package/lib/next/blocks/blockESLintMarkdown.d.ts +48 -0
  45. package/lib/next/blocks/blockESLintMarkdown.js +27 -0
  46. package/lib/next/blocks/blockESLintMarkdown.js.map +1 -0
  47. package/lib/next/blocks/blockESLintMoreStyling.d.ts +48 -0
  48. package/lib/next/blocks/blockESLintMoreStyling.js +34 -0
  49. package/lib/next/blocks/blockESLintMoreStyling.js.map +1 -0
  50. package/lib/next/blocks/blockESLintNode.d.ts +48 -0
  51. package/lib/next/blocks/blockESLintNode.js +33 -0
  52. package/lib/next/blocks/blockESLintNode.js.map +1 -0
  53. package/lib/next/blocks/blockESLintPackageJson.d.ts +48 -0
  54. package/lib/next/blocks/blockESLintPackageJson.js +26 -0
  55. package/lib/next/blocks/blockESLintPackageJson.js.map +1 -0
  56. package/lib/next/blocks/blockESLintPerfectionist.d.ts +48 -0
  57. package/lib/next/blocks/blockESLintPerfectionist.js +32 -0
  58. package/lib/next/blocks/blockESLintPerfectionist.js.map +1 -0
  59. package/lib/next/blocks/blockESLintRegexp.d.ts +48 -0
  60. package/lib/next/blocks/blockESLintRegexp.js +23 -0
  61. package/lib/next/blocks/blockESLintRegexp.js.map +1 -0
  62. package/lib/next/blocks/blockESLintYML.d.ts +48 -0
  63. package/lib/next/blocks/blockESLintYML.js +46 -0
  64. package/lib/next/blocks/blockESLintYML.js.map +1 -0
  65. package/lib/next/blocks/blockFunding.d.ts +48 -0
  66. package/lib/next/blocks/blockFunding.js +20 -0
  67. package/lib/next/blocks/blockFunding.js.map +1 -0
  68. package/lib/next/blocks/blockGitHubActionsCI.d.ts +60 -0
  69. package/lib/next/blocks/blockGitHubActionsCI.js +122 -0
  70. package/lib/next/blocks/blockGitHubActionsCI.js.map +1 -0
  71. package/lib/next/blocks/blockGitHubIssueTemplates.d.ts +48 -0
  72. package/lib/next/blocks/blockGitHubIssueTemplates.js +217 -0
  73. package/lib/next/blocks/blockGitHubIssueTemplates.js.map +1 -0
  74. package/lib/next/blocks/blockGitHubPRTemplate.d.ts +48 -0
  75. package/lib/next/blocks/blockGitHubPRTemplate.js +32 -0
  76. package/lib/next/blocks/blockGitHubPRTemplate.js.map +1 -0
  77. package/lib/next/blocks/blockGitignore.d.ts +50 -0
  78. package/lib/next/blocks/blockGitignore.js +23 -0
  79. package/lib/next/blocks/blockGitignore.js.map +1 -0
  80. package/lib/next/blocks/blockKnip.d.ts +48 -0
  81. package/lib/next/blocks/blockKnip.js +58 -0
  82. package/lib/next/blocks/blockKnip.js.map +1 -0
  83. package/lib/next/blocks/blockMITLicense.d.ts +48 -0
  84. package/lib/next/blocks/blockMITLicense.js +46 -0
  85. package/lib/next/blocks/blockMITLicense.js.map +1 -0
  86. package/lib/next/blocks/blockMarkdownlint.d.ts +50 -0
  87. package/lib/next/blocks/blockMarkdownlint.js +77 -0
  88. package/lib/next/blocks/blockMarkdownlint.js.map +1 -0
  89. package/lib/next/blocks/blockNvmrc.d.ts +48 -0
  90. package/lib/next/blocks/blockNvmrc.js +26 -0
  91. package/lib/next/blocks/blockNvmrc.js.map +1 -0
  92. package/lib/next/blocks/blockPRCompliance.d.ts +48 -0
  93. package/lib/next/blocks/blockPRCompliance.js +48 -0
  94. package/lib/next/blocks/blockPRCompliance.js.map +1 -0
  95. package/lib/next/blocks/blockPackageJson.d.ts +56 -0
  96. package/lib/next/blocks/blockPackageJson.js +81 -0
  97. package/lib/next/blocks/blockPackageJson.js.map +1 -0
  98. package/lib/next/blocks/blockPnpmDedupe.d.ts +48 -0
  99. package/lib/next/blocks/blockPnpmDedupe.js +51 -0
  100. package/lib/next/blocks/blockPnpmDedupe.js.map +1 -0
  101. package/lib/next/blocks/blockPrettier.d.ts +57 -0
  102. package/lib/next/blocks/blockPrettier.js +104 -0
  103. package/lib/next/blocks/blockPrettier.js.map +1 -0
  104. package/lib/next/blocks/blockPrettierPluginCurly.d.ts +48 -0
  105. package/lib/next/blocks/blockPrettierPluginCurly.js +20 -0
  106. package/lib/next/blocks/blockPrettierPluginCurly.js.map +1 -0
  107. package/lib/next/blocks/blockPrettierPluginPackageJson.d.ts +48 -0
  108. package/lib/next/blocks/blockPrettierPluginPackageJson.js +20 -0
  109. package/lib/next/blocks/blockPrettierPluginPackageJson.js.map +1 -0
  110. package/lib/next/blocks/blockPrettierPluginSh.d.ts +48 -0
  111. package/lib/next/blocks/blockPrettierPluginSh.js +20 -0
  112. package/lib/next/blocks/blockPrettierPluginSh.js.map +1 -0
  113. package/lib/next/blocks/blockREADME.d.ts +50 -0
  114. package/lib/next/blocks/blockREADME.js +63 -0
  115. package/lib/next/blocks/blockREADME.js.map +1 -0
  116. package/lib/next/blocks/blockReleaseIt.d.ts +48 -0
  117. package/lib/next/blocks/blockReleaseIt.js +126 -0
  118. package/lib/next/blocks/blockReleaseIt.js.map +1 -0
  119. package/lib/next/blocks/blockRenovate.d.ts +48 -0
  120. package/lib/next/blocks/blockRenovate.js +34 -0
  121. package/lib/next/blocks/blockRenovate.js.map +1 -0
  122. package/lib/next/blocks/blockSecurityDocs.d.ts +48 -0
  123. package/lib/next/blocks/blockSecurityDocs.js +28 -0
  124. package/lib/next/blocks/blockSecurityDocs.js.map +1 -0
  125. package/lib/next/blocks/blockTSup.d.ts +50 -0
  126. package/lib/next/blocks/blockTSup.js +78 -0
  127. package/lib/next/blocks/blockTSup.js.map +1 -0
  128. package/lib/next/blocks/blockTemplatedBy.d.ts +50 -0
  129. package/lib/next/blocks/blockTemplatedBy.js +34 -0
  130. package/lib/next/blocks/blockTemplatedBy.js.map +1 -0
  131. package/lib/next/blocks/blockTypeScript.d.ts +48 -0
  132. package/lib/next/blocks/blockTypeScript.js +109 -0
  133. package/lib/next/blocks/blockTypeScript.js.map +1 -0
  134. package/lib/next/blocks/blockVSCode.d.ts +57 -0
  135. package/lib/next/blocks/blockVSCode.js +87 -0
  136. package/lib/next/blocks/blockVSCode.js.map +1 -0
  137. package/lib/next/blocks/blockVitest.d.ts +55 -0
  138. package/lib/next/blocks/blockVitest.js +154 -0
  139. package/lib/next/blocks/blockVitest.js.map +1 -0
  140. package/lib/next/blocks/index.d.ts +43 -0
  141. package/lib/next/blocks/index.js +43 -0
  142. package/lib/next/blocks/index.js.map +1 -0
  143. package/lib/next/blocks/options.fakes.d.ts +13 -0
  144. package/lib/next/blocks/options.fakes.js +15 -0
  145. package/lib/next/blocks/options.fakes.js.map +1 -0
  146. package/lib/next/blocks/packageData.d.ts +5 -0
  147. package/lib/next/blocks/packageData.js +25 -0
  148. package/lib/next/blocks/packageData.js.map +1 -0
  149. package/lib/next/presetCommon.d.ts +99 -0
  150. package/lib/next/presetCommon.js +21 -0
  151. package/lib/next/presetCommon.js.map +1 -0
  152. package/lib/next/presetEverything.d.ts +99 -0
  153. package/lib/next/presetEverything.js +59 -0
  154. package/lib/next/presetEverything.js.map +1 -0
  155. package/lib/next/presetMinimal.d.ts +99 -0
  156. package/lib/next/presetMinimal.js +45 -0
  157. package/lib/next/presetMinimal.js.map +1 -0
  158. package/lib/next/template.d.ts +99 -0
  159. package/lib/next/template.js +21 -0
  160. package/lib/next/template.js.map +1 -0
  161. package/lib/next/utils/removeTrailingSlash.d.ts +3 -0
  162. package/lib/next/utils/removeTrailingSlash.js +7 -0
  163. package/lib/next/utils/removeTrailingSlash.js.map +1 -0
  164. package/lib/next/utils/sortObject.d.ts +5 -0
  165. package/lib/next/utils/sortObject.js +9 -0
  166. package/lib/next/utils/sortObject.js.map +1 -0
  167. package/lib/next/utils/swallowError.d.ts +3 -0
  168. package/lib/next/utils/swallowError.js +7 -0
  169. package/lib/next/utils/swallowError.js.map +1 -0
  170. package/lib/shared/cli/spinners.d.ts +1 -1
  171. package/lib/shared/cli/spinners.js.map +1 -1
  172. package/lib/shared/isUsingCreateEngine.d.ts +3 -0
  173. package/lib/shared/isUsingCreateEngine.js +7 -0
  174. package/lib/shared/isUsingCreateEngine.js.map +1 -0
  175. package/lib/shared/options/args.d.ts +39 -13
  176. package/lib/shared/options/args.js +5 -0
  177. package/lib/shared/options/args.js.map +1 -1
  178. package/lib/shared/options/augmentOptionsWithExcludes.js +2 -2
  179. package/lib/shared/options/augmentOptionsWithExcludes.js.map +1 -1
  180. package/lib/shared/options/createOptionDefaults/index.d.ts +2 -4
  181. package/lib/shared/options/createOptionDefaults/index.js +4 -13
  182. package/lib/shared/options/createOptionDefaults/index.js.map +1 -1
  183. package/lib/shared/options/createOptionDefaults/readDefaultsFromReadme.js +4 -1
  184. package/lib/shared/options/createOptionDefaults/readDefaultsFromReadme.js.map +1 -1
  185. package/lib/shared/options/createOptionDefaults/readEmails.d.ts +11 -0
  186. package/lib/shared/options/createOptionDefaults/readEmails.js +14 -0
  187. package/lib/shared/options/createOptionDefaults/readEmails.js.map +1 -0
  188. package/lib/shared/options/createOptionDefaults/readFunding.d.ts +3 -0
  189. package/lib/shared/options/createOptionDefaults/readFunding.js +11 -0
  190. package/lib/shared/options/createOptionDefaults/readFunding.js.map +1 -0
  191. package/lib/shared/options/createOptionDefaults/readGuide.d.ts +6 -0
  192. package/lib/shared/options/createOptionDefaults/readGuide.js +18 -0
  193. package/lib/shared/options/createOptionDefaults/readGuide.js.map +1 -0
  194. package/lib/shared/options/ensureRepositoryExists.js +1 -1
  195. package/lib/shared/options/ensureRepositoryExists.js.map +1 -1
  196. package/lib/shared/options/exclusionKeys.d.ts +1 -1
  197. package/lib/shared/options/exclusionKeys.js +6 -0
  198. package/lib/shared/options/exclusionKeys.js.map +1 -1
  199. package/lib/shared/options/optionsSchema.d.ts +6 -2
  200. package/lib/shared/options/optionsSchema.js +1 -0
  201. package/lib/shared/options/optionsSchema.js.map +1 -1
  202. package/lib/shared/options/readOptions.d.ts +1 -1
  203. package/lib/shared/options/readOptions.js +1 -0
  204. package/lib/shared/options/readOptions.js.map +1 -1
  205. package/lib/shared/types.d.ts +32 -24
  206. package/lib/steps/addOwnerAsAllContributor.js +2 -2
  207. package/lib/steps/addOwnerAsAllContributor.js.map +1 -1
  208. package/lib/steps/clearUnnecessaryFiles.js +3 -4
  209. package/lib/steps/clearUnnecessaryFiles.js.map +1 -1
  210. package/lib/steps/finalizeDependencies.js +47 -44
  211. package/lib/steps/finalizeDependencies.js.map +1 -1
  212. package/lib/steps/populateCSpellDictionary.js +7 -7
  213. package/lib/steps/populateCSpellDictionary.js.map +1 -1
  214. package/lib/steps/removeSetupScripts.js +9 -3
  215. package/lib/steps/removeSetupScripts.js.map +1 -1
  216. package/lib/steps/uninstallPackages.js +10 -3
  217. package/lib/steps/uninstallPackages.js.map +1 -1
  218. package/lib/steps/updateReadme.d.ts +1 -1
  219. package/lib/steps/updateReadme.js +1 -1
  220. package/lib/steps/updateReadme.js.map +1 -1
  221. package/lib/steps/writeReadme/index.js +19 -19
  222. package/lib/steps/writeReadme/index.js.map +1 -1
  223. package/lib/steps/writing/creation/createCSpellConfig.d.ts +7 -0
  224. package/lib/steps/writing/creation/createCSpellConfig.js +27 -0
  225. package/lib/steps/writing/creation/createCSpellConfig.js.map +1 -0
  226. package/lib/steps/writing/creation/createDotGitignore.js +7 -5
  227. package/lib/steps/writing/creation/createDotGitignore.js.map +1 -1
  228. package/lib/steps/writing/creation/createESLintConfig.js +22 -46
  229. package/lib/steps/writing/creation/createESLintConfig.js.map +1 -1
  230. package/lib/steps/writing/creation/createTsupConfig.js +10 -10
  231. package/lib/steps/writing/creation/createTsupConfig.js.map +1 -1
  232. package/lib/steps/writing/creation/dotGitHub/createDevelopment/index.js +57 -41
  233. package/lib/steps/writing/creation/dotGitHub/createDevelopment/index.js.map +1 -1
  234. package/lib/steps/writing/creation/dotGitHub/createDevelopment/splitIntoSections.js +1 -1
  235. package/lib/steps/writing/creation/dotGitHub/createDevelopment/splitIntoSections.js.map +1 -1
  236. package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js +5 -5
  237. package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js.map +1 -1
  238. package/lib/steps/writing/creation/dotGitHub/createMultiWorkflowFile.d.ts +11 -9
  239. package/lib/steps/writing/creation/dotGitHub/createMultiWorkflowFile.js.map +1 -1
  240. package/lib/steps/writing/creation/dotGitHub/createSoloWorkflowFile.d.ts +16 -16
  241. package/lib/steps/writing/creation/dotGitHub/createSoloWorkflowFile.js.map +1 -1
  242. package/lib/steps/writing/creation/dotGitHub/createWorkflows.js +5 -1
  243. package/lib/steps/writing/creation/dotGitHub/createWorkflows.js.map +1 -1
  244. package/lib/steps/writing/creation/formatters/formatIgnoreFile.d.ts +1 -1
  245. package/lib/steps/writing/creation/formatters/formatIgnoreFile.js +1 -1
  246. package/lib/steps/writing/creation/formatters/formatIgnoreFile.js.map +1 -1
  247. package/lib/steps/writing/creation/formatters/formatTypeScript.js +1 -1
  248. package/lib/steps/writing/creation/formatters/formatTypeScript.js.map +1 -1
  249. package/lib/steps/writing/creation/formatters/formatYaml.js +3 -1
  250. package/lib/steps/writing/creation/formatters/formatYaml.js.map +1 -1
  251. package/lib/steps/writing/creation/index.d.ts +1 -1
  252. package/lib/steps/writing/creation/index.js +49 -1
  253. package/lib/steps/writing/creation/index.js.map +1 -1
  254. package/lib/steps/writing/creation/rootFiles.js +5 -15
  255. package/lib/steps/writing/creation/rootFiles.js.map +1 -1
  256. package/lib/steps/writing/creation/writePackageJson.js +69 -62
  257. package/lib/steps/writing/creation/writePackageJson.js.map +1 -1
  258. package/lib/steps/writing/types.d.ts +1 -1
  259. package/lib/steps/writing/writeStructure.js +9 -1
  260. package/lib/steps/writing/writeStructure.js.map +1 -1
  261. package/lib/steps/writing/writeStructureWorker.js +1 -1
  262. package/lib/steps/writing/writeStructureWorker.js.map +1 -1
  263. package/package.json +57 -52
  264. package/lib/shared/options/createOptionDefaults/readDefaultsFromDevelopment.d.ts +0 -8
  265. package/lib/shared/options/createOptionDefaults/readDefaultsFromDevelopment.js +0 -22
  266. package/lib/shared/options/createOptionDefaults/readDefaultsFromDevelopment.js.map +0 -1
@@ -5,6 +5,6 @@ import '../shared/codes.js';
5
5
  declare const endOfReadmeTemplateLine = "> \uD83D\uDC99 This package was templated with [`create-typescript-app`](https://github.com/JoshuaKGoldberg/create-typescript-app).";
6
6
  declare const endOfReadmeNotice: string;
7
7
  declare const endOfReadmeMatcher: RegExp;
8
- declare function updateReadme(options: Pick<Options, "owner">): Promise<void>;
8
+ declare function updateReadme(options: Pick<Options, "excludeTemplatedBy" | "owner">): Promise<void>;
9
9
 
10
10
  export { endOfReadmeMatcher, endOfReadmeNotice, endOfReadmeTemplateLine, updateReadme };
@@ -13,7 +13,7 @@ const endOfReadmeMatcher = /💙.+(?:based|built|templated).+(?:from|using|on|wi
13
13
  async function updateReadme(options) {
14
14
  let contents = await readFileSafe("./README.md", "");
15
15
  contents = contents.replaceAll("JoshuaKGoldberg", options.owner);
16
- if (!endOfReadmeMatcher.test(contents)) {
16
+ if (!options.excludeTemplatedBy && !endOfReadmeMatcher.test(contents)) {
17
17
  contents += endOfReadmeNotice;
18
18
  }
19
19
  await fs.writeFile("./README.md", contents);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/steps/updateReadme.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport { EOL } from \"node:os\";\n\nimport { readFileSafe } from \"../shared/readFileSafe.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport const endOfReadmeTemplateLine = `> 💙 This package was templated with [\\`create-typescript-app\\`](https://github.com/JoshuaKGoldberg/create-typescript-app).`;\n\nexport const endOfReadmeNotice = [\n\t``,\n\t`<!-- You can remove this notice if you don't want it 🙂 no worries! -->`,\n\t``,\n\tendOfReadmeTemplateLine,\n\t``,\n].join(EOL);\n\nexport const endOfReadmeMatcher =\n\t/💙.+(?:based|built|templated).+(?:from|using|on|with).+create-typescript-app/;\n\nexport async function updateReadme(options: Pick<Options, \"owner\">) {\n\tlet contents = await readFileSafe(\"./README.md\", \"\");\n\n\tcontents = contents.replaceAll(\"JoshuaKGoldberg\", options.owner);\n\n\tif (!endOfReadmeMatcher.test(contents)) {\n\t\tcontents += endOfReadmeNotice;\n\t}\n\n\tawait fs.writeFile(\"./README.md\", contents);\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AACpB,SAAS,WAAW;AAEpB,SAAS,oBAAoB;AAGtB,MAAM,0BAA0B;AAEhC,MAAM,oBAAoB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,EAAE,KAAK,GAAG;AAEH,MAAM,qBACZ;AAED,eAAsB,aAAa,SAAiC;AACnE,MAAI,WAAW,MAAM,aAAa,eAAe,EAAE;AAEnD,aAAW,SAAS,WAAW,mBAAmB,QAAQ,KAAK;AAE/D,MAAI,CAAC,mBAAmB,KAAK,QAAQ,GAAG;AACvC,gBAAY;AAAA,EACb;AAEA,QAAM,GAAG,UAAU,eAAe,QAAQ;AAC3C;","names":[]}
1
+ {"version":3,"sources":["../../src/steps/updateReadme.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport { EOL } from \"node:os\";\n\nimport { readFileSafe } from \"../shared/readFileSafe.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport const endOfReadmeTemplateLine = `> 💙 This package was templated with [\\`create-typescript-app\\`](https://github.com/JoshuaKGoldberg/create-typescript-app).`;\n\nexport const endOfReadmeNotice = [\n\t``,\n\t`<!-- You can remove this notice if you don't want it 🙂 no worries! -->`,\n\t``,\n\tendOfReadmeTemplateLine,\n\t``,\n].join(EOL);\n\nexport const endOfReadmeMatcher =\n\t/💙.+(?:based|built|templated).+(?:from|using|on|with).+create-typescript-app/;\n\nexport async function updateReadme(\n\toptions: Pick<Options, \"excludeTemplatedBy\" | \"owner\">,\n) {\n\tlet contents = await readFileSafe(\"./README.md\", \"\");\n\n\tcontents = contents.replaceAll(\"JoshuaKGoldberg\", options.owner);\n\n\tif (!options.excludeTemplatedBy && !endOfReadmeMatcher.test(contents)) {\n\t\tcontents += endOfReadmeNotice;\n\t}\n\n\tawait fs.writeFile(\"./README.md\", contents);\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AACpB,SAAS,WAAW;AAEpB,SAAS,oBAAoB;AAGtB,MAAM,0BAA0B;AAEhC,MAAM,oBAAoB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,EAAE,KAAK,GAAG;AAEH,MAAM,qBACZ;AAED,eAAsB,aACrB,SACC;AACD,MAAI,WAAW,MAAM,aAAa,eAAe,EAAE;AAEnD,aAAW,SAAS,WAAW,mBAAmB,QAAQ,KAAK;AAE/D,MAAI,CAAC,QAAQ,sBAAsB,CAAC,mBAAmB,KAAK,QAAQ,GAAG;AACtE,gBAAY;AAAA,EACb;AAEA,QAAM,GAAG,UAAU,eAAe,QAAQ;AAC3C;","names":[]}
@@ -5,25 +5,6 @@ import { findExistingBadges } from "./findExistingBadges.js";
5
5
  import { findIntroSectionClose } from "./findIntroSectionClose.js";
6
6
  import { generateTopContent } from "./generateTopContent.js";
7
7
  const contributorsIndicator = `<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->`;
8
- function generateAllContributorsContent(options) {
9
- return [
10
- `## Contributors`,
11
- ``,
12
- `<!-- spellchecker: disable -->`,
13
- contributorsIndicator,
14
- `<!-- prettier-ignore-start -->`,
15
- !options.excludeLintMd && `<!-- markdownlint-disable -->`,
16
- `<table>`,
17
- `<!-- (this will be filled in by all-contributors) -->`,
18
- `</table>`,
19
- ``,
20
- !options.excludeLintMd && `<!-- markdownlint-restore -->`,
21
- `<!-- prettier-ignore-end -->`,
22
- ``,
23
- `<!-- ALL-CONTRIBUTORS-LIST:END -->`,
24
- `<!-- spellchecker: enable -->`
25
- ].filter(Boolean).join("\n");
26
- }
27
8
  async function writeReadme(options) {
28
9
  const allContributorsContent = !options.excludeAllContributors && generateAllContributorsContent(options);
29
10
  let contents = await readFileSafe("README.md", "");
@@ -51,6 +32,25 @@ async function writeReadme(options) {
51
32
  }
52
33
  await fs.writeFile("README.md", contents);
53
34
  }
35
+ function generateAllContributorsContent(options) {
36
+ return [
37
+ `## Contributors`,
38
+ ``,
39
+ `<!-- spellchecker: disable -->`,
40
+ contributorsIndicator,
41
+ `<!-- prettier-ignore-start -->`,
42
+ !options.excludeLintMd && `<!-- markdownlint-disable -->`,
43
+ `<table>`,
44
+ `<!-- (this will be filled in by all-contributors) -->`,
45
+ `</table>`,
46
+ ``,
47
+ !options.excludeLintMd && `<!-- markdownlint-restore -->`,
48
+ `<!-- prettier-ignore-end -->`,
49
+ ``,
50
+ `<!-- ALL-CONTRIBUTORS-LIST:END -->`,
51
+ `<!-- spellchecker: enable -->`
52
+ ].filter(Boolean).join("\n");
53
+ }
54
54
  export {
55
55
  writeReadme
56
56
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/steps/writeReadme/index.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nimport { readFileSafe } from \"../../shared/readFileSafe.js\";\nimport { Options } from \"../../shared/types.js\";\nimport { endOfReadmeMatcher, endOfReadmeNotice } from \"../updateReadme.js\";\nimport { findExistingBadges } from \"./findExistingBadges.js\";\nimport { findIntroSectionClose } from \"./findIntroSectionClose.js\";\nimport { generateTopContent } from \"./generateTopContent.js\";\n\nconst contributorsIndicator = `<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->`;\n\nfunction generateAllContributorsContent(options: Options) {\n\treturn [\n\t\t`## Contributors`,\n\t\t``,\n\t\t`<!-- spellchecker: disable -->`,\n\t\tcontributorsIndicator,\n\t\t`<!-- prettier-ignore-start -->`,\n\t\t!options.excludeLintMd && `<!-- markdownlint-disable -->`,\n\t\t`<table>`,\n\t\t`<!-- (this will be filled in by all-contributors) -->`,\n\t\t`</table>`,\n\t\t``,\n\t\t!options.excludeLintMd && `<!-- markdownlint-restore -->`,\n\t\t`<!-- prettier-ignore-end -->`,\n\t\t``,\n\t\t`<!-- ALL-CONTRIBUTORS-LIST:END -->`,\n\t\t`<!-- spellchecker: enable -->`,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\"\\n\");\n}\n\nexport async function writeReadme(options: Options) {\n\tconst allContributorsContent =\n\t\t!options.excludeAllContributors && generateAllContributorsContent(options);\n\tlet contents = await readFileSafe(\"README.md\", \"\");\n\tif (!contents) {\n\t\tawait fs.writeFile(\n\t\t\t\"README.md\",\n\t\t\t[\n\t\t\t\tgenerateTopContent(options, []),\n\t\t\t\tallContributorsContent,\n\t\t\t\tendOfReadmeNotice.slice(1),\n\t\t\t]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(\"\\n\\n\"),\n\t\t);\n\t\treturn;\n\t}\n\n\tconst endOfIntroSection = findIntroSectionClose(contents);\n\n\tcontents = [\n\t\tgenerateTopContent(options, findExistingBadges(contents)),\n\t\tcontents.slice(endOfIntroSection),\n\t]\n\t\t.join(\"\")\n\t\t.replace(/\\[!\\[.+\\]\\(.+\\)\\]\\(.+\\)/g, \"\")\n\t\t.replace(/!\\[.+\\]\\(.+\\)/g, \"\")\n\t\t.replaceAll(\"\\r\", \"\")\n\t\t.replaceAll(\"\\n\\n\\n\", \"\\n\\n\");\n\n\tif (allContributorsContent && !contents.includes(contributorsIndicator)) {\n\t\tcontents = [contents, allContributorsContent].join(\"\\n\\n\");\n\t}\n\n\tif (!endOfReadmeMatcher.test(contents)) {\n\t\tcontents = [contents, endOfReadmeNotice].join(\"\\n\");\n\t}\n\n\tawait fs.writeFile(\"README.md\", contents);\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,SAAS,oBAAoB;AAE7B,SAAS,oBAAoB,yBAAyB;AACtD,SAAS,0BAA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;AACzC;","names":[]}
1
+ {"version":3,"sources":["../../../src/steps/writeReadme/index.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nimport { readFileSafe } from \"../../shared/readFileSafe.js\";\nimport { Options } from \"../../shared/types.js\";\nimport { endOfReadmeMatcher, endOfReadmeNotice } from \"../updateReadme.js\";\nimport { findExistingBadges } from \"./findExistingBadges.js\";\nimport { findIntroSectionClose } from \"./findIntroSectionClose.js\";\nimport { generateTopContent } from \"./generateTopContent.js\";\n\nconst contributorsIndicator = `<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->`;\n\nexport async function writeReadme(options: Options) {\n\tconst allContributorsContent =\n\t\t!options.excludeAllContributors && generateAllContributorsContent(options);\n\tlet contents = await readFileSafe(\"README.md\", \"\");\n\tif (!contents) {\n\t\tawait fs.writeFile(\n\t\t\t\"README.md\",\n\t\t\t[\n\t\t\t\tgenerateTopContent(options, []),\n\t\t\t\tallContributorsContent,\n\t\t\t\tendOfReadmeNotice.slice(1),\n\t\t\t]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(\"\\n\\n\"),\n\t\t);\n\t\treturn;\n\t}\n\n\tconst endOfIntroSection = findIntroSectionClose(contents);\n\n\tcontents = [\n\t\tgenerateTopContent(options, findExistingBadges(contents)),\n\t\tcontents.slice(endOfIntroSection),\n\t]\n\t\t.join(\"\")\n\t\t.replace(/\\[!\\[.+\\]\\(.+\\)\\]\\(.+\\)/g, \"\")\n\t\t.replace(/!\\[.+\\]\\(.+\\)/g, \"\")\n\t\t.replaceAll(\"\\r\", \"\")\n\t\t.replaceAll(\"\\n\\n\\n\", \"\\n\\n\");\n\n\tif (allContributorsContent && !contents.includes(contributorsIndicator)) {\n\t\tcontents = [contents, allContributorsContent].join(\"\\n\\n\");\n\t}\n\n\tif (!endOfReadmeMatcher.test(contents)) {\n\t\tcontents = [contents, endOfReadmeNotice].join(\"\\n\");\n\t}\n\n\tawait fs.writeFile(\"README.md\", contents);\n}\n\nfunction generateAllContributorsContent(options: Options) {\n\treturn [\n\t\t`## Contributors`,\n\t\t``,\n\t\t`<!-- spellchecker: disable -->`,\n\t\tcontributorsIndicator,\n\t\t`<!-- prettier-ignore-start -->`,\n\t\t!options.excludeLintMd && `<!-- markdownlint-disable -->`,\n\t\t`<table>`,\n\t\t`<!-- (this will be filled in by all-contributors) -->`,\n\t\t`</table>`,\n\t\t``,\n\t\t!options.excludeLintMd && `<!-- markdownlint-restore -->`,\n\t\t`<!-- prettier-ignore-end -->`,\n\t\t``,\n\t\t`<!-- ALL-CONTRIBUTORS-LIST:END -->`,\n\t\t`<!-- spellchecker: enable -->`,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\"\\n\");\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,SAAS,oBAAoB;AAE7B,SAAS,oBAAoB,yBAAyB;AACtD,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,0BAA0B;AAEnC,MAAM,wBAAwB;AAE9B,eAAsB,YAAY,SAAkB;AACnD,QAAM,yBACL,CAAC,QAAQ,0BAA0B,+BAA+B,OAAO;AAC1E,MAAI,WAAW,MAAM,aAAa,aAAa,EAAE;AACjD,MAAI,CAAC,UAAU;AACd,UAAM,GAAG;AAAA,MACR;AAAA,MACA;AAAA,QACC,mBAAmB,SAAS,CAAC,CAAC;AAAA,QAC9B;AAAA,QACA,kBAAkB,MAAM,CAAC;AAAA,MAC1B,EACE,OAAO,OAAO,EACd,KAAK,MAAM;AAAA,IACd;AACA;AAAA,EACD;AAEA,QAAM,oBAAoB,sBAAsB,QAAQ;AAExD,aAAW;AAAA,IACV,mBAAmB,SAAS,mBAAmB,QAAQ,CAAC;AAAA,IACxD,SAAS,MAAM,iBAAiB;AAAA,EACjC,EACE,KAAK,EAAE,EACP,QAAQ,4BAA4B,EAAE,EACtC,QAAQ,kBAAkB,EAAE,EAC5B,WAAW,MAAM,EAAE,EACnB,WAAW,UAAU,MAAM;AAE7B,MAAI,0BAA0B,CAAC,SAAS,SAAS,qBAAqB,GAAG;AACxE,eAAW,CAAC,UAAU,sBAAsB,EAAE,KAAK,MAAM;AAAA,EAC1D;AAEA,MAAI,CAAC,mBAAmB,KAAK,QAAQ,GAAG;AACvC,eAAW,CAAC,UAAU,iBAAiB,EAAE,KAAK,IAAI;AAAA,EACnD;AAEA,QAAM,GAAG,UAAU,aAAa,QAAQ;AACzC;AAEA,SAAS,+BAA+B,SAAkB;AACzD,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,EACE,OAAO,OAAO,EACd,KAAK,IAAI;AACZ;","names":[]}
@@ -0,0 +1,7 @@
1
+ import { Options } from '../../../shared/types.js';
2
+ import 'zod';
3
+ import '../../../shared/codes.js';
4
+
5
+ declare function createCSpellConfig(options: Pick<Options, "excludeAllContributors" | "excludeLintMd" | "excludeReleases" | "excludeRenovate" | "excludeTemplatedBy" | "excludeTests">): Promise<string>;
6
+
7
+ export { createCSpellConfig };
@@ -0,0 +1,27 @@
1
+ import { formatJson } from "./formatters/formatJson.js";
2
+ async function createCSpellConfig(options) {
3
+ const words = [
4
+ "tseslint",
5
+ !options.excludeReleases && "apexskier",
6
+ !options.excludeRenovate && "automerge",
7
+ !options.excludeLintMd && "markdownlintignore",
8
+ !options.excludeTemplatedBy && "joshuakgoldberg"
9
+ ].filter(Boolean).sort();
10
+ return await formatJson({
11
+ dictionaries: ["npm", "node", "typescript"],
12
+ ignorePaths: [
13
+ ...options.excludeAllContributors ? [] : [".all-contributorsrc"],
14
+ ".github",
15
+ "CHANGELOG.md",
16
+ ...options.excludeTests ? [] : ["coverage"],
17
+ "lib",
18
+ "node_modules",
19
+ "pnpm-lock.yaml"
20
+ ],
21
+ words
22
+ });
23
+ }
24
+ export {
25
+ createCSpellConfig
26
+ };
27
+ //# sourceMappingURL=createCSpellConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/steps/writing/creation/createCSpellConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\nexport async function createCSpellConfig(\n\toptions: Pick<\n\t\tOptions,\n\t\t| \"excludeAllContributors\"\n\t\t| \"excludeLintMd\"\n\t\t| \"excludeReleases\"\n\t\t| \"excludeRenovate\"\n\t\t| \"excludeTemplatedBy\"\n\t\t| \"excludeTests\"\n\t>,\n) {\n\tconst words = [\n\t\t\"tseslint\",\n\t\t!options.excludeReleases && \"apexskier\",\n\t\t!options.excludeRenovate && \"automerge\",\n\t\t!options.excludeLintMd && \"markdownlintignore\",\n\t\t!options.excludeTemplatedBy && \"joshuakgoldberg\",\n\t]\n\t\t.filter(Boolean)\n\t\t.sort();\n\n\treturn await formatJson({\n\t\tdictionaries: [\"npm\", \"node\", \"typescript\"],\n\t\tignorePaths: [\n\t\t\t...(options.excludeAllContributors ? [] : [\".all-contributorsrc\"]),\n\t\t\t\".github\",\n\t\t\t\"CHANGELOG.md\",\n\t\t\t...(options.excludeTests ? [] : [\"coverage\"]),\n\t\t\t\"lib\",\n\t\t\t\"node_modules\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t],\n\t\twords,\n\t});\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAE3B,eAAsB,mBACrB,SASC;AACD,QAAM,QAAQ;AAAA,IACb;AAAA,IACA,CAAC,QAAQ,mBAAmB;AAAA,IAC5B,CAAC,QAAQ,mBAAmB;AAAA,IAC5B,CAAC,QAAQ,iBAAiB;AAAA,IAC1B,CAAC,QAAQ,sBAAsB;AAAA,EAChC,EACE,OAAO,OAAO,EACd,KAAK;AAEP,SAAO,MAAM,WAAW;AAAA,IACvB,cAAc,CAAC,OAAO,QAAQ,YAAY;AAAA,IAC1C,aAAa;AAAA,MACZ,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,qBAAqB;AAAA,MAChE;AAAA,MACA;AAAA,MACA,GAAI,QAAQ,eAAe,CAAC,IAAI,CAAC,UAAU;AAAA,MAC3C;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,EACD,CAAC;AACF;","names":[]}
@@ -1,10 +1,12 @@
1
1
  import { formatIgnoreFile } from "./formatters/formatIgnoreFile.js";
2
2
  function createDotGitignore(options) {
3
- return formatIgnoreFile([
4
- ...options.excludeTests ? [] : ["/coverage"],
5
- "/lib",
6
- "/node_modules"
7
- ]);
3
+ return formatIgnoreFile(
4
+ [
5
+ ...options.excludeTests ? [] : ["/coverage"],
6
+ "/lib",
7
+ "/node_modules"
8
+ ].sort()
9
+ );
8
10
  }
9
11
  export {
10
12
  createDotGitignore
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/steps/writing/creation/createDotGitignore.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\n\nexport function createDotGitignore(options: Pick<Options, \"excludeTests\">) {\n\treturn formatIgnoreFile([\n\t\t...(options.excludeTests ? [] : [\"/coverage\"]),\n\t\t\"/lib\",\n\t\t\"/node_modules\",\n\t]);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAE1B,SAAS,mBAAmB,SAAwC;AAC1E,SAAO,iBAAiB;AAAA,IACvB,GAAI,QAAQ,eAAe,CAAC,IAAI,CAAC,WAAW;AAAA,IAC5C;AAAA,IACA;AAAA,EACD,CAAC;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/steps/writing/creation/createDotGitignore.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\n\nexport function createDotGitignore(options: Pick<Options, \"excludeTests\">) {\n\treturn formatIgnoreFile(\n\t\t[\n\t\t\t...(options.excludeTests ? [] : [\"/coverage\"]),\n\t\t\t\"/lib\",\n\t\t\t\"/node_modules\",\n\t\t].sort(),\n\t);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAE1B,SAAS,mBAAmB,SAAwC;AAC1E,SAAO;AAAA,IACN;AAAA,MACC,GAAI,QAAQ,eAAe,CAAC,IAAI,CAAC,WAAW;AAAA,MAC5C;AAAA,MACA;AAAA,IACD,EAAE,KAAK;AAAA,EACR;AACD;","names":[]}
@@ -2,8 +2,8 @@ import { formatTypeScript } from "./formatters/formatTypeScript.js";
2
2
  async function createESLintConfig(options) {
3
3
  const tseslintBase = options.excludeLintStrict ? "recommended" : "strict";
4
4
  const imports = [
5
- `import eslint from "@eslint/js";`,
6
5
  !options.excludeLintESLint && `import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";`,
6
+ `import eslint from "@eslint/js";`,
7
7
  !options.excludeTests && `import vitest from "@vitest/eslint-plugin";`,
8
8
  !options.excludeLintJSDoc && `import jsdoc from "eslint-plugin-jsdoc";`,
9
9
  !options.excludeLintJson && `import jsonc from "eslint-plugin-jsonc";`,
@@ -17,19 +17,23 @@ async function createESLintConfig(options) {
17
17
  ].filter(Boolean);
18
18
  const elements = [
19
19
  `eslint.configs.recommended,`,
20
- !options.excludeLintJson && ` ...jsonc.configs["flat/recommended-with-json"],`,
21
- !options.excludeLintMd && ` ...markdown.configs.recommended,`,
22
- !options.excludeLintYml && ` ...yml.configs["flat/recommended"],`,
23
- !options.excludeLintYml && ` ...yml.configs["flat/prettier"],`,
24
20
  !options.excludeLintESLint && ` comments.recommended,`,
25
21
  !options.excludeLintJSDoc && ` jsdoc.configs["flat/contents-typescript-error"],
26
- jsdoc.configs["flat/logical-typescript-error"],
27
- jsdoc.configs["flat/stylistic-typescript-error"],`,
22
+ jsdoc.configs["flat/logical-typescript-error"],
23
+ jsdoc.configs["flat/stylistic-typescript-error"],`,
24
+ !options.excludeLintJson && ` jsonc.configs["flat/recommended-with-json"],`,
25
+ !options.excludeLintMd && ` markdown.configs.recommended,`,
28
26
  ` n.configs["flat/recommended"],`,
29
27
  !options.excludeLintPackageJson && ` packageJson,`,
30
28
  !options.excludeLintPerfectionist && ` perfectionist.configs["recommended-natural"],`,
31
29
  !options.excludeLintRegex && ` regexp.configs["flat/recommended"],`
32
30
  ].filter(Boolean);
31
+ const ignores = [
32
+ ...options.excludeTests ? [] : ["**/*.snap", "coverage"],
33
+ "lib",
34
+ "node_modules",
35
+ "pnpm-lock.yaml"
36
+ ].map((ignore) => JSON.stringify(ignore)).sort();
33
37
  const rules = !options.excludeLintStylistic && `{
34
38
  // Stylistic concerns that don't interfere with Prettier
35
39
  "logical-assignment-operators": [
@@ -44,42 +48,23 @@ async function createESLintConfig(options) {
44
48
  return await formatTypeScript(`${imports.join("\n")}
45
49
 
46
50
  export default tseslint.config(
47
- {
48
- ignores: [${options.excludeTests ? "" : `
49
- "coverage*",`}
50
- "lib",
51
- "node_modules",
52
- "pnpm-lock.yaml",${options.excludeTests ? "" : `
53
- "**/*.snap",`}
54
- ],
55
- },
56
- {
57
- linterOptions: {
58
- reportUnusedDisableDirectives: "error",
59
- },
60
- },
51
+ { ignores: [${ignores.join(", ")}], },
52
+ { linterOptions: { reportUnusedDisableDirectives: "error" } },
61
53
  ${elements.join("\n")}
62
54
  {
63
55
  extends: ${options.excludeLintStylistic ? `tseslint.configs.${tseslintBase}TypeChecked` : `[
64
- ...tseslint.configs.${tseslintBase}TypeChecked,
65
- ...tseslint.configs.stylisticTypeChecked,
56
+ tseslint.configs.${tseslintBase}TypeChecked,
57
+ tseslint.configs.stylisticTypeChecked,
66
58
  ]`},
67
59
  files: ["**/*.js", "**/*.ts"],
68
60
  languageOptions: {
69
61
  parserOptions: {
70
- projectService: {
71
- allowDefaultProject: ["*.config.*s"],
72
- },
62
+ projectService: { allowDefaultProject: ["*.config.*s"] },
73
63
  tsconfigRootDir: import.meta.dirname
74
64
  },
75
65
  },${rules ? `
76
66
  rules: ${rules},` : ""}${options.excludeLintPerfectionist ? "" : `
77
- settings: {
78
- perfectionist: {
79
- partitionByComment: true,
80
- type: "natural",
81
- },
82
- },`}
67
+ settings: { perfectionist: { partitionByComment: true, type: "natural" } },`}
83
68
  },
84
69
  {
85
70
  extends: [tseslint.configs.disableTypeChecked],
@@ -92,31 +77,22 @@ export default tseslint.config(
92
77
  },
93
78
  },${options.excludeTests ? "" : `
94
79
  {
95
- files: ["**/*.test.*"],
96
80
  extends: [vitest.configs.recommended],
97
- rules: {
98
- // These on-by-default rules aren't useful in test files.
99
- "@typescript-eslint/no-unsafe-assignment": "off",
100
- "@typescript-eslint/no-unsafe-call": "off",
101
- },
81
+ files: ["**/*.test.*"],
82
+ rules: { "@typescript-eslint/no-unsafe-assignment": "off" },
102
83
  },`}${options.excludeLintYml ? "" : `
103
84
  {
85
+ extends: [yml.configs["flat/recommended"], yml.configs["flat/prettier"]],
104
86
  files: ["**/*.{yml,yaml}"],
105
87
  rules: {
106
88
  "yml/file-extension": ["error", { extension: "yml" }],
107
89
  "yml/sort-keys": [
108
90
  "error",
109
- {
110
- order: { type: "asc" },
111
- pathPattern: "^.*$",
112
- },
91
+ { order: { type: "asc" }, pathPattern: "^.*$" },
113
92
  ],
114
93
  "yml/sort-sequence-values": [
115
94
  "error",
116
- {
117
- order: { type: "asc" },
118
- pathPattern: "^.*$",
119
- },
95
+ { order: { type: "asc" }, pathPattern: "^.*$" },
120
96
  ],
121
97
  },
122
98
  },`}
@@ -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.excludeTests && `import vitest from \"@vitest/eslint-plugin\";`,\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.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/contents-typescript-error\"],\n\tjsdoc.configs[\"flat/logical-typescript-error\"],\n\tjsdoc.configs[\"flat/stylistic-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\tconst rules =\n\t\t!options.excludeLintStylistic &&\n\t\t`{\n\t\t\t// Stylistic concerns that don't interfere with Prettier\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\"no-useless-rename\": \"error\",\n\t\t\t\"object-shorthand\": \"error\",\n\t\t\t\"operator-assignment\": \"error\",\n\t\t}`;\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\toptions.excludeTests\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\t\"**/*.snap\",`\n\t\t\t}\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{\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: [\"*.config.*s\"],\n\t\t\t\t},\n\t\t\t\ttsconfigRootDir: import.meta.dirname\n\t\t\t},\n\t\t},${\n\t\t\trules\n\t\t\t\t? `\n\t\trules: ${rules},`\n\t\t\t\t: \"\"\n\t\t}${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\tsettings: {\n\t\t\tperfectionist: {\n\t\t\t\tpartitionByComment: true,\n\t\t\t\ttype: \"natural\",\n\t\t\t},\n\t\t},`\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\textends: [vitest.configs.recommended],\n\t\trules: {\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,gBAAgB;AAAA,IACzB,CAAC,QAAQ,oBAAoB;AAAA,IAC7B,CAAC,QAAQ,mBAAmB;AAAA,IAC5B,CAAC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,IACA,CAAC,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AQ,eACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUJ,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
+ {"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!options.excludeLintESLint &&\n\t\t\t`import comments from \"@eslint-community/eslint-plugin-eslint-comments/configs\";`,\n\t\t`import eslint from \"@eslint/js\";`,\n\t\t!options.excludeTests && `import vitest from \"@vitest/eslint-plugin\";`,\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.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.excludeLintESLint && `\tcomments.recommended,`,\n\t\t!options.excludeLintJSDoc &&\n\t\t\t`\tjsdoc.configs[\"flat/contents-typescript-error\"],\n\t\tjsdoc.configs[\"flat/logical-typescript-error\"],\n\t\tjsdoc.configs[\"flat/stylistic-typescript-error\"],`,\n\t\t!options.excludeLintJson && `\tjsonc.configs[\"flat/recommended-with-json\"],`,\n\t\t!options.excludeLintMd && `\tmarkdown.configs.recommended,`,\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\tconst ignores = [\n\t\t...(options.excludeTests ? [] : [\"**/*.snap\", \"coverage\"]),\n\t\t\"lib\",\n\t\t\"node_modules\",\n\t\t\"pnpm-lock.yaml\",\n\t]\n\t\t.map((ignore) => JSON.stringify(ignore))\n\t\t.sort();\n\n\tconst rules =\n\t\t!options.excludeLintStylistic &&\n\t\t`{\n\t\t\t// Stylistic concerns that don't interfere with Prettier\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\"no-useless-rename\": \"error\",\n\t\t\t\"object-shorthand\": \"error\",\n\t\t\t\"operator-assignment\": \"error\",\n\t\t}`;\n\n\treturn await formatTypeScript(`${imports.join(\"\\n\")}\n\nexport default tseslint.config(\n\t{ ignores: [${ignores.join(\", \")}], },\n\t{ linterOptions: { reportUnusedDisableDirectives: \"error\" } },\n\t${elements.join(\"\\n\")}\n\t{\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\ttseslint.configs.${tseslintBase}TypeChecked,\n\t\t\ttseslint.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: { allowDefaultProject: [\"*.config.*s\"] },\n\t\t\t\ttsconfigRootDir: import.meta.dirname\n\t\t\t},\n\t\t},${\n\t\t\trules\n\t\t\t\t? `\n\t\trules: ${rules},`\n\t\t\t\t: \"\"\n\t\t}${\n\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\tsettings: { perfectionist: { partitionByComment: true, type: \"natural\" } },`\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\textends: [vitest.configs.recommended],\n\t\tfiles: [\"**/*.test.*\"],\n\t\trules: { \"@typescript-eslint/no-unsafe-assignment\": \"off\" },\n\t},`\n\t}${\n\t\toptions.excludeLintYml\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\textends: [yml.configs[\"flat/recommended\"], yml.configs[\"flat/prettier\"]],\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{ order: { type: \"asc\" }, pathPattern: \"^.*$\" },\n\t\t\t],\n\t\t\t\"yml/sort-sequence-values\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ order: { type: \"asc\" }, pathPattern: \"^.*$\" },\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,CAAC,QAA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A,WACK,KAAK,MACV,EACJ,GACC,QAAQ,2BACL,KACA;AAAA,8EAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAQsB,QAAQ,UAAU;AAAA;AAAA;AAAA,KAIxC,QAAQ,eACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMJ,GACC,QAAQ,iBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBJ;AAAA;AAAA,CAEA;AACD;","names":[]}
@@ -2,16 +2,16 @@ import { formatTypeScript } from "./formatters/formatTypeScript.js";
2
2
  async function createTsupConfig(options) {
3
3
  return await formatTypeScript(`import { defineConfig } from "tsup";
4
4
 
5
- export default defineConfig({
6
- bundle: false,
7
- clean: true,
8
- dts: true,
9
- entry: ["src/**/*.ts"${options.excludeTests ? "" : `, "!src/**/*.test.*"`}],
10
- format: "esm",
11
- outDir: "lib",
12
- sourcemap: true,
13
- });
14
- `);
5
+ export default defineConfig({
6
+ bundle: false,
7
+ clean: true,
8
+ dts: true,
9
+ entry: ["src/**/*.ts"${options.excludeTests ? "" : `, "!src/**/*.test.*"`}],
10
+ format: "esm",
11
+ outDir: "lib",
12
+ sourcemap: true,
13
+ });
14
+ `);
15
15
  }
16
16
  export {
17
17
  createTsupConfig
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/steps/writing/creation/createTsupConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createTsupConfig(options: Pick<Options, \"excludeTests\">) {\n\treturn await formatTypeScript(`import { defineConfig } from \"tsup\";\n\n\t\texport default defineConfig({\n\t\t\tbundle: false,\n\t\t\tclean: true,\n\t\t\tdts: true,\n\t\t\tentry: [\"src/**/*.ts\"${options.excludeTests ? \"\" : `, \"!src/**/*.test.*\"`}],\n\t\t\tformat: \"esm\",\n\t\t\toutDir: \"lib\",\n\t\t\tsourcemap: true,\n\t\t});\n\t`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,iBAAiB,SAAwC;AAC9E,SAAO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAML,QAAQ,eAAe,KAAK,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA,EAK1E;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/steps/writing/creation/createTsupConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createTsupConfig(options: Pick<Options, \"excludeTests\">) {\n\treturn await formatTypeScript(`import { defineConfig } from \"tsup\";\n\nexport default defineConfig({\n\tbundle: false,\n\tclean: true,\n\tdts: true,\n\tentry: [\"src/**/*.ts\"${options.excludeTests ? \"\" : `, \"!src/**/*.test.*\"`}],\n\tformat: \"esm\",\n\toutDir: \"lib\",\n\tsourcemap: true,\n});\n`);\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC,eAAsB,iBAAiB,SAAwC;AAC9E,SAAO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAMP,QAAQ,eAAe,KAAK,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA,CAKzE;AACD;","names":[]}
@@ -8,32 +8,6 @@ const headingAliases = /* @__PURE__ */ new Map([
8
8
  ["test", "Testing"],
9
9
  ["tests", "Testing"]
10
10
  ]);
11
- function createLintingSection(options) {
12
- const lintLines = [
13
- !options.excludeLintKnip && `- \`pnpm lint:knip\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`,
14
- !options.excludeLintMd && `- \`pnpm lint:md\` ([Markdownlint](https://github.com/DavidAnson/markdownlint): Checks Markdown source files`,
15
- !options.excludeLintPackages && `- \`pnpm lint:packages\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \`pnpm-lock.yml\` file`,
16
- !options.excludeLintSpelling && `- \`pnpm lint:spelling\` ([cspell](https://cspell.org)): Spell checks across all source files`
17
- ].filter(Boolean);
18
- return lintLines.length ? [
19
- `This package includes several forms of linting to enforce consistent code quality and styling.`,
20
- `Each should be shown in VS Code, and can be run manually on the command-line:`,
21
- ``,
22
- `- \`pnpm lint\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files`,
23
- ...lintLines,
24
- ``,
25
- `Read the individual documentation for each linter to understand how it can be configured and used best.`,
26
- ``,
27
- `For example, ESLint can be run with \`--fix\` to auto-fix some lint rule complaints:`
28
- ].join("\n") : `[ESLint](https://eslint.org) is used with with [typescript-eslint](https://typescript-eslint.io)) to lint JavaScript and TypeScript source files.
29
- You can run it locally on the command-line:
30
-
31
- \`\`\`shell
32
- pnpm run lint
33
- \`\`\`
34
-
35
- ESLint can be run with \`--fix\` to auto-fix some lint rule complaints:`;
36
- }
37
11
  async function createDevelopment(options) {
38
12
  const existingContents = await readFileSafe(".github/DEVELOPMENT.md", "");
39
13
  const newSections = {
@@ -48,6 +22,11 @@ Add \`--watch\` to run the builder in a watch mode that continuously cleans and
48
22
  \`\`\`shell
49
23
  pnpm build --watch
50
24
  \`\`\``,
25
+ ...options.bin && {
26
+ "### Built App Debugging": `This repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging.
27
+ To debug a \`bin\` app, add a breakpoint to your code, then run _Debug Program_ from the VS Code Debug panel (or press F5).
28
+ VS Code will automatically run the \`build\` task in the background before running \`${options.bin}\`.`
29
+ },
51
30
  "## Formatting": `[Prettier](https://prettier.io) is used to format code.
52
31
  It should be applied automatically when you save files in VS Code or make a Git commit.
53
32
 
@@ -62,7 +41,7 @@ pnpm format --write
62
41
  pnpm run lint --fix
63
42
  \`\`\`
64
43
 
65
- Note 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.`,
44
+ Note that you'll need to run \`pnpm build\` before \`pnpm lint\` so that lint rules which check the file system can pick up on any built files.`,
66
45
  ...!options.excludeTests && {
67
46
  "## Testing": `[Vitest](https://vitest.dev) is used for tests.
68
47
  You can run it locally on the command-line:
@@ -79,6 +58,7 @@ pnpm run test --coverage
79
58
 
80
59
  Note that [console-fail-test](https://github.com/JoshuaKGoldberg/console-fail-test) is enabled for all test runs.
81
60
  Calls to \`console.log\`, \`console.warn\`, and other console methods will cause a test to fail.`,
61
+ // Debugging tests are intentionally put second
82
62
  "### Debugging Tests": `This repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging unit tests.
83
63
  To launch it, open a test file, then run _Debug Current Test File_ from the VS Code Debug panel (or press F5).`
84
64
  },
@@ -100,14 +80,29 @@ pnpm tsc --watch
100
80
  "Development",
101
81
  Object.keys(newSections).map((key) => key.replace(/^#* /, ""))
102
82
  ]);
103
- const preservedSections = Object.fromEntries(
104
- splitIntoSections(existingContents).filter(([key]) => {
105
- const keyText = key.replace(/^#* /, "");
106
- return !newSectionHeadings.has(
107
- headingAliases.get(keyText.toLowerCase()) ?? keyText
108
- );
109
- })
110
- );
83
+ const existingSectionsSplit = splitIntoSections(existingContents);
84
+ const preservedSectionsSplit = existingSectionsSplit.filter(([key]) => {
85
+ const keyText = key.replace(/^#* /, "");
86
+ return !newSectionHeadings.has(
87
+ headingAliases.get(keyText.toLowerCase()) ?? keyText
88
+ );
89
+ });
90
+ const preservedSections = Object.fromEntries(preservedSectionsSplit);
91
+ const sectionLines = [];
92
+ const seen = /* @__PURE__ */ new Set();
93
+ for (const sections of [newSections, preservedSections]) {
94
+ for (const heading in sections) {
95
+ if (seen.has(heading)) {
96
+ continue;
97
+ }
98
+ seen.add(heading);
99
+ const contents = sections[heading];
100
+ sectionLines.push("");
101
+ sectionLines.push(heading);
102
+ sectionLines.push("");
103
+ sectionLines.push(contents);
104
+ }
105
+ }
111
106
  const result = `# Development
112
107
  ${options.guide ? `
113
108
  > If you'd like a more guided walkthrough, see [${options.guide.title}](${options.guide.href}).
@@ -123,15 +118,36 @@ pnpm install
123
118
 
124
119
  > This repository includes a list of suggested VS Code extensions.
125
120
  > 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.
126
-
127
- ${Object.entries({ ...newSections, ...preservedSections }).map(
128
- ([heading, content]) => `${heading}
129
-
130
- ${content}`
131
- ).join("\n\n")}
121
+ ${sectionLines.join("\n")}
132
122
  `;
133
123
  return result;
134
124
  }
125
+ function createLintingSection(options) {
126
+ const lintLines = [
127
+ !options.excludeLintKnip && `- \`pnpm lint:knip\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`,
128
+ !options.excludeLintMd && `- \`pnpm lint:md\` ([Markdownlint](https://github.com/DavidAnson/markdownlint)): Checks Markdown source files`,
129
+ !options.excludeLintPackages && `- \`pnpm lint:packages\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \`pnpm-lock.yml\` file`,
130
+ !options.excludeLintSpelling && `- \`pnpm lint:spelling\` ([cspell](https://cspell.org)): Spell checks across all source files`
131
+ ].filter(Boolean);
132
+ return lintLines.length ? [
133
+ `This package includes several forms of linting to enforce consistent code quality and styling.`,
134
+ `Each should be shown in VS Code, and can be run manually on the command-line:`,
135
+ ``,
136
+ `- \`pnpm lint\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files`,
137
+ ...lintLines,
138
+ ``,
139
+ `Read the individual documentation for each linter to understand how it can be configured and used best.`,
140
+ ``,
141
+ `For example, ESLint can be run with \`--fix\` to auto-fix some lint rule complaints:`
142
+ ].join("\n") : `[ESLint](https://eslint.org) is used with with [typescript-eslint](https://typescript-eslint.io)) to lint JavaScript and TypeScript source files.
143
+ You can run it locally on the command-line:
144
+
145
+ \`\`\`shell
146
+ pnpm run lint
147
+ \`\`\`
148
+
149
+ ESLint can be run with \`--fix\` to auto-fix some lint rule complaints:`;
150
+ }
135
151
  export {
136
152
  createDevelopment
137
153
  };
@@ -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\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,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;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":[]}
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\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...(options.bin && {\n\t\t\t\"### Built App Debugging\": `This repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging.\nTo debug a \\`bin\\` app, add a breakpoint to your code, then run _Debug Program_ from the VS Code Debug panel (or press F5).\nVS Code will automatically run the \\`build\\` task in the background before running \\`${options.bin}\\`.`,\n\t\t}),\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 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 are intentionally put second\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 existingSectionsSplit = splitIntoSections(existingContents);\n\tconst preservedSectionsSplit = existingSectionsSplit.filter(([key]) => {\n\t\tconst keyText = key.replace(/^#* /, \"\");\n\t\treturn !newSectionHeadings.has(\n\t\t\theadingAliases.get(keyText.toLowerCase()) ?? keyText,\n\t\t);\n\t});\n\tconst preservedSections = Object.fromEntries(preservedSectionsSplit);\n\n\tconst sectionLines: string[] = [];\n\tconst seen = new Set<string>();\n\n\tfor (const sections of [newSections, preservedSections]) {\n\t\tfor (const heading in sections) {\n\t\t\tif (seen.has(heading)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tseen.add(heading);\n\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst contents = sections[heading as keyof typeof sections]!;\n\n\t\t\tsectionLines.push(\"\");\n\t\t\tsectionLines.push(heading);\n\t\t\tsectionLines.push(\"\");\n\t\t\tsectionLines.push(contents);\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${sectionLines.join(\"\\n\")}\n`;\n\n\treturn result;\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"],"mappings":"AAAA,SAAS,oBAAoB;A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
@@ -12,7 +12,7 @@ function splitIntoSections(text) {
12
12
  nextStart = remaining.length;
13
13
  }
14
14
  const heading = remaining.slice(0, indexOfNewline).trim();
15
- const contents = remaining.slice(indexOfNewline, nextStart).trimEnd().replace(/^\n+/, "");
15
+ const contents = remaining.slice(indexOfNewline, nextStart).trim().replace(/^\n+/, "");
16
16
  sections.push([heading, contents]);
17
17
  remaining = remaining.slice(nextStart);
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/steps/writing/creation/dotGitHub/createDevelopment/splitIntoSections.ts"],"sourcesContent":["export function splitIntoSections(text: string) {\n\tconst sections: [string, string][] = [];\n\tif (!text) {\n\t\treturn sections;\n\t}\n\n\tlet remaining = `${text}\\n`;\n\n\twhile (remaining) {\n\t\tconst indexOfNewline = remaining.indexOf(\"\\n\", 1);\n\t\tlet nextStart = remaining.indexOf(\"\\n#\", 1);\n\t\tif (nextStart === -1) {\n\t\t\tnextStart = remaining.length;\n\t\t}\n\n\t\tconst heading = remaining.slice(0, indexOfNewline).trim();\n\t\tconst contents = remaining\n\t\t\t.slice(indexOfNewline, nextStart)\n\t\t\t.trimEnd()\n\t\t\t.replace(/^\\n+/, \"\");\n\n\t\tsections.push([heading, contents]);\n\t\tremaining = remaining.slice(nextStart);\n\t}\n\n\treturn sections;\n}\n"],"mappings":"AAAO,SAAS,kBAAkB,MAAc;AAC/C,QAAM,WAA+B,CAAC;AACtC,MAAI,CAAC,MAAM;AACV,WAAO;AAAA,EACR;AAEA,MAAI,YAAY,GAAG,IAAI;AAAA;AAEvB,SAAO,WAAW;AACjB,UAAM,iBAAiB,UAAU,QAAQ,MAAM,CAAC;AAChD,QAAI,YAAY,UAAU,QAAQ,OAAO,CAAC;AAC1C,QAAI,cAAc,IAAI;AACrB,kBAAY,UAAU;AAAA,IACvB;AAEA,UAAM,UAAU,UAAU,MAAM,GAAG,cAAc,EAAE,KAAK;AACxD,UAAM,WAAW,UACf,MAAM,gBAAgB,SAAS,EAC/B,QAAQ,EACR,QAAQ,QAAQ,EAAE;AAEpB,aAAS,KAAK,CAAC,SAAS,QAAQ,CAAC;AACjC,gBAAY,UAAU,MAAM,SAAS;AAAA,EACtC;AAEA,SAAO;AACR;","names":[]}
1
+ {"version":3,"sources":["../../../../../../src/steps/writing/creation/dotGitHub/createDevelopment/splitIntoSections.ts"],"sourcesContent":["export function splitIntoSections(text: string) {\n\tconst sections: [string, string][] = [];\n\tif (!text) {\n\t\treturn sections;\n\t}\n\n\tlet remaining = `${text}\\n`;\n\n\twhile (remaining) {\n\t\tconst indexOfNewline = remaining.indexOf(\"\\n\", 1);\n\t\tlet nextStart = remaining.indexOf(\"\\n#\", 1);\n\t\tif (nextStart === -1) {\n\t\t\tnextStart = remaining.length;\n\t\t}\n\n\t\tconst heading = remaining.slice(0, indexOfNewline).trim();\n\t\tconst contents = remaining\n\t\t\t.slice(indexOfNewline, nextStart)\n\t\t\t.trim()\n\t\t\t.replace(/^\\n+/, \"\");\n\n\t\tsections.push([heading, contents]);\n\t\tremaining = remaining.slice(nextStart);\n\t}\n\n\treturn sections;\n}\n"],"mappings":"AAAO,SAAS,kBAAkB,MAAc;AAC/C,QAAM,WAA+B,CAAC;AACtC,MAAI,CAAC,MAAM;AACV,WAAO;AAAA,EACR;AAEA,MAAI,YAAY,GAAG,IAAI;AAAA;AAEvB,SAAO,WAAW;AACjB,UAAM,iBAAiB,UAAU,QAAQ,MAAM,CAAC;AAChD,QAAI,YAAY,UAAU,QAAQ,OAAO,CAAC;AAC1C,QAAI,cAAc,IAAI;AACrB,kBAAY,UAAU;AAAA,IACvB;AAEA,UAAM,UAAU,UAAU,MAAM,GAAG,cAAc,EAAE,KAAK;AACxD,UAAM,WAAW,UACf,MAAM,gBAAgB,SAAS,EAC/B,KAAK,EACL,QAAQ,QAAQ,EAAE;AAEpB,aAAS,KAAK,CAAC,SAAS,QAAQ,CAAC;AACjC,gBAAY,UAAU,MAAM,SAAS;AAAA,EACtC;AAEA,SAAO;AACR;","names":[]}
@@ -26,20 +26,20 @@ community include:
26
26
  - Being respectful of differing opinions, viewpoints, and experiences
27
27
  - Giving and gracefully accepting constructive feedback
28
28
  - Accepting responsibility and apologizing to those affected by our mistakes,
29
- and learning from the experience
29
+ and learning from the experience
30
30
  - Focusing on what is best not just for us as individuals, but for the overall
31
- community
31
+ community
32
32
 
33
33
  Examples of unacceptable behavior include:
34
34
 
35
35
  - The use of sexualized language or imagery, and sexual attention or advances of
36
- any kind
36
+ any kind
37
37
  - Trolling, insulting or derogatory comments, and personal or political attacks
38
38
  - Public or private harassment
39
39
  - Publishing others' private information, such as a physical or email address,
40
- without their explicit permission
40
+ without their explicit permission
41
41
  - Other conduct which could reasonably be considered inappropriate in a
42
- professional setting
42
+ professional setting
43
43
 
44
44
  ## Enforcement Responsibilities
45
45