create-typescript-app 1.76.0 → 1.77.1

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 (285) hide show
  1. package/README.md +1 -1
  2. package/lib/bin/promptForMode.js +2 -1
  3. package/lib/bin/promptForMode.js.map +1 -1
  4. package/lib/create/createWithOptions.d.ts +3 -4
  5. package/lib/create/createWithOptions.js +19 -12
  6. package/lib/create/createWithOptions.js.map +1 -1
  7. package/lib/index.d.ts +45 -0
  8. package/lib/index.js +5 -0
  9. package/lib/index.js.map +1 -1
  10. package/lib/initialize/initializeWithOptions.d.ts +3 -4
  11. package/lib/initialize/initializeWithOptions.js +4 -4
  12. package/lib/initialize/initializeWithOptions.js.map +1 -1
  13. package/lib/migrate/migrateWithOptions.d.ts +3 -4
  14. package/lib/migrate/migrateWithOptions.js +8 -5
  15. package/lib/migrate/migrateWithOptions.js.map +1 -1
  16. package/lib/next/base.d.ts +101 -0
  17. package/lib/next/base.js +144 -0
  18. package/lib/next/base.js.map +1 -0
  19. package/lib/next/blocks/blockAllContributors.d.ts +48 -0
  20. package/lib/next/blocks/blockAllContributors.js +60 -0
  21. package/lib/next/blocks/blockAllContributors.js.map +1 -0
  22. package/lib/next/blocks/blockAreTheTypesWrong.d.ts +48 -0
  23. package/lib/next/blocks/blockAreTheTypesWrong.js +29 -0
  24. package/lib/next/blocks/blockAreTheTypesWrong.js.map +1 -0
  25. package/lib/next/blocks/blockCSpell.d.ts +51 -0
  26. package/lib/next/blocks/blockCSpell.js +72 -0
  27. package/lib/next/blocks/blockCSpell.js.map +1 -0
  28. package/lib/next/blocks/blockContributingDocs.d.ts +48 -0
  29. package/lib/next/blocks/blockContributingDocs.js +127 -0
  30. package/lib/next/blocks/blockContributingDocs.js.map +1 -0
  31. package/lib/next/blocks/blockContributorCovenant.d.ts +48 -0
  32. package/lib/next/blocks/blockContributorCovenant.js +162 -0
  33. package/lib/next/blocks/blockContributorCovenant.js.map +1 -0
  34. package/lib/next/blocks/blockDevelopmentDocs.d.ts +62 -0
  35. package/lib/next/blocks/blockDevelopmentDocs.js +92 -0
  36. package/lib/next/blocks/blockDevelopmentDocs.js.map +1 -0
  37. package/lib/next/blocks/blockESLint.d.ts +73 -0
  38. package/lib/next/blocks/blockESLint.js +242 -0
  39. package/lib/next/blocks/blockESLint.js.map +1 -0
  40. package/lib/next/blocks/blockESLintComments.d.ts +48 -0
  41. package/lib/next/blocks/blockESLintComments.js +26 -0
  42. package/lib/next/blocks/blockESLintComments.js.map +1 -0
  43. package/lib/next/blocks/blockESLintJSDoc.d.ts +48 -0
  44. package/lib/next/blocks/blockESLintJSDoc.js +25 -0
  45. package/lib/next/blocks/blockESLintJSDoc.js.map +1 -0
  46. package/lib/next/blocks/blockESLintJSONC.d.ts +48 -0
  47. package/lib/next/blocks/blockESLintJSONC.js +21 -0
  48. package/lib/next/blocks/blockESLintJSONC.js.map +1 -0
  49. package/lib/next/blocks/blockESLintMarkdown.d.ts +48 -0
  50. package/lib/next/blocks/blockESLintMarkdown.js +27 -0
  51. package/lib/next/blocks/blockESLintMarkdown.js.map +1 -0
  52. package/lib/next/blocks/blockESLintMoreStyling.d.ts +48 -0
  53. package/lib/next/blocks/blockESLintMoreStyling.js +34 -0
  54. package/lib/next/blocks/blockESLintMoreStyling.js.map +1 -0
  55. package/lib/next/blocks/blockESLintNode.d.ts +48 -0
  56. package/lib/next/blocks/blockESLintNode.js +33 -0
  57. package/lib/next/blocks/blockESLintNode.js.map +1 -0
  58. package/lib/next/blocks/blockESLintPackageJson.d.ts +48 -0
  59. package/lib/next/blocks/blockESLintPackageJson.js +26 -0
  60. package/lib/next/blocks/blockESLintPackageJson.js.map +1 -0
  61. package/lib/next/blocks/blockESLintPerfectionist.d.ts +48 -0
  62. package/lib/next/blocks/blockESLintPerfectionist.js +32 -0
  63. package/lib/next/blocks/blockESLintPerfectionist.js.map +1 -0
  64. package/lib/next/blocks/blockESLintRegexp.d.ts +48 -0
  65. package/lib/next/blocks/blockESLintRegexp.js +23 -0
  66. package/lib/next/blocks/blockESLintRegexp.js.map +1 -0
  67. package/lib/next/blocks/blockESLintYML.d.ts +48 -0
  68. package/lib/next/blocks/blockESLintYML.js +46 -0
  69. package/lib/next/blocks/blockESLintYML.js.map +1 -0
  70. package/lib/next/blocks/blockExampleFiles.d.ts +50 -0
  71. package/lib/next/blocks/blockExampleFiles.js +25 -0
  72. package/lib/next/blocks/blockExampleFiles.js.map +1 -0
  73. package/lib/next/blocks/blockFunding.d.ts +48 -0
  74. package/lib/next/blocks/blockFunding.js +20 -0
  75. package/lib/next/blocks/blockFunding.js.map +1 -0
  76. package/lib/next/blocks/blockGitHubActionsCI.d.ts +60 -0
  77. package/lib/next/blocks/blockGitHubActionsCI.js +133 -0
  78. package/lib/next/blocks/blockGitHubActionsCI.js.map +1 -0
  79. package/lib/next/blocks/blockGitHubIssueTemplates.d.ts +48 -0
  80. package/lib/next/blocks/blockGitHubIssueTemplates.js +217 -0
  81. package/lib/next/blocks/blockGitHubIssueTemplates.js.map +1 -0
  82. package/lib/next/blocks/blockGitHubPRTemplate.d.ts +48 -0
  83. package/lib/next/blocks/blockGitHubPRTemplate.js +32 -0
  84. package/lib/next/blocks/blockGitHubPRTemplate.js.map +1 -0
  85. package/lib/next/blocks/blockGitignore.d.ts +50 -0
  86. package/lib/next/blocks/blockGitignore.js +23 -0
  87. package/lib/next/blocks/blockGitignore.js.map +1 -0
  88. package/lib/next/blocks/blockKnip.d.ts +48 -0
  89. package/lib/next/blocks/blockKnip.js +58 -0
  90. package/lib/next/blocks/blockKnip.js.map +1 -0
  91. package/lib/next/blocks/blockMITLicense.d.ts +48 -0
  92. package/lib/next/blocks/blockMITLicense.js +46 -0
  93. package/lib/next/blocks/blockMITLicense.js.map +1 -0
  94. package/lib/next/blocks/blockMarkdownlint.d.ts +50 -0
  95. package/lib/next/blocks/blockMarkdownlint.js +77 -0
  96. package/lib/next/blocks/blockMarkdownlint.js.map +1 -0
  97. package/lib/next/blocks/blockNvmrc.d.ts +48 -0
  98. package/lib/next/blocks/blockNvmrc.js +26 -0
  99. package/lib/next/blocks/blockNvmrc.js.map +1 -0
  100. package/lib/next/blocks/blockPRCompliance.d.ts +48 -0
  101. package/lib/next/blocks/blockPRCompliance.js +48 -0
  102. package/lib/next/blocks/blockPRCompliance.js.map +1 -0
  103. package/lib/next/blocks/blockPackageJson.d.ts +57 -0
  104. package/lib/next/blocks/blockPackageJson.js +92 -0
  105. package/lib/next/blocks/blockPackageJson.js.map +1 -0
  106. package/lib/next/blocks/blockPnpmDedupe.d.ts +48 -0
  107. package/lib/next/blocks/blockPnpmDedupe.js +46 -0
  108. package/lib/next/blocks/blockPnpmDedupe.js.map +1 -0
  109. package/lib/next/blocks/blockPrettier.d.ts +57 -0
  110. package/lib/next/blocks/blockPrettier.js +114 -0
  111. package/lib/next/blocks/blockPrettier.js.map +1 -0
  112. package/lib/next/blocks/blockPrettierPluginCurly.d.ts +48 -0
  113. package/lib/next/blocks/blockPrettierPluginCurly.js +20 -0
  114. package/lib/next/blocks/blockPrettierPluginCurly.js.map +1 -0
  115. package/lib/next/blocks/blockPrettierPluginPackageJson.d.ts +48 -0
  116. package/lib/next/blocks/blockPrettierPluginPackageJson.js +20 -0
  117. package/lib/next/blocks/blockPrettierPluginPackageJson.js.map +1 -0
  118. package/lib/next/blocks/blockPrettierPluginSh.d.ts +48 -0
  119. package/lib/next/blocks/blockPrettierPluginSh.js +20 -0
  120. package/lib/next/blocks/blockPrettierPluginSh.js.map +1 -0
  121. package/lib/next/blocks/blockREADME.d.ts +50 -0
  122. package/lib/next/blocks/blockREADME.js +63 -0
  123. package/lib/next/blocks/blockREADME.js.map +1 -0
  124. package/lib/next/blocks/blockReleaseIt.d.ts +48 -0
  125. package/lib/next/blocks/blockReleaseIt.js +131 -0
  126. package/lib/next/blocks/blockReleaseIt.js.map +1 -0
  127. package/lib/next/blocks/blockRenovate.d.ts +48 -0
  128. package/lib/next/blocks/blockRenovate.js +34 -0
  129. package/lib/next/blocks/blockRenovate.js.map +1 -0
  130. package/lib/next/blocks/blockRepositoryBranchProtection.d.ts +50 -0
  131. package/lib/next/blocks/blockRepositoryBranchProtection.js +49 -0
  132. package/lib/next/blocks/blockRepositoryBranchProtection.js.map +1 -0
  133. package/lib/next/blocks/blockRepositoryLabels.d.ts +48 -0
  134. package/lib/next/blocks/blockRepositoryLabels.js +18 -0
  135. package/lib/next/blocks/blockRepositoryLabels.js.map +1 -0
  136. package/lib/next/blocks/blockRepositorySettings.d.ts +48 -0
  137. package/lib/next/blocks/blockRepositorySettings.js +42 -0
  138. package/lib/next/blocks/blockRepositorySettings.js.map +1 -0
  139. package/lib/next/blocks/blockSecurityDocs.d.ts +48 -0
  140. package/lib/next/blocks/blockSecurityDocs.js +28 -0
  141. package/lib/next/blocks/blockSecurityDocs.js.map +1 -0
  142. package/lib/next/blocks/blockTSup.d.ts +50 -0
  143. package/lib/next/blocks/blockTSup.js +95 -0
  144. package/lib/next/blocks/blockTSup.js.map +1 -0
  145. package/lib/next/blocks/blockTemplatedBy.d.ts +48 -0
  146. package/lib/next/blocks/blockTemplatedBy.js +30 -0
  147. package/lib/next/blocks/blockTemplatedBy.js.map +1 -0
  148. package/lib/next/blocks/blockTypeScript.d.ts +48 -0
  149. package/lib/next/blocks/blockTypeScript.js +137 -0
  150. package/lib/next/blocks/blockTypeScript.js.map +1 -0
  151. package/lib/next/blocks/blockVSCode.d.ts +57 -0
  152. package/lib/next/blocks/blockVSCode.js +91 -0
  153. package/lib/next/blocks/blockVSCode.js.map +1 -0
  154. package/lib/next/blocks/blockVitest.d.ts +55 -0
  155. package/lib/next/blocks/blockVitest.js +217 -0
  156. package/lib/next/blocks/blockVitest.js.map +1 -0
  157. package/lib/next/blocks/index.d.ts +43 -0
  158. package/lib/next/blocks/index.js +43 -0
  159. package/lib/next/blocks/index.js.map +1 -0
  160. package/lib/next/blocks/options.fakes.d.ts +13 -0
  161. package/lib/next/blocks/options.fakes.js +15 -0
  162. package/lib/next/blocks/options.fakes.js.map +1 -0
  163. package/lib/next/blocks/packageData.d.ts +5 -0
  164. package/lib/next/blocks/packageData.js +25 -0
  165. package/lib/next/blocks/packageData.js.map +1 -0
  166. package/lib/next/blocks/phases.d.ts +9 -0
  167. package/lib/next/blocks/phases.js +11 -0
  168. package/lib/next/blocks/phases.js.map +1 -0
  169. package/lib/next/presetCommon.d.ts +99 -0
  170. package/lib/next/presetCommon.js +21 -0
  171. package/lib/next/presetCommon.js.map +1 -0
  172. package/lib/next/presetEverything.d.ts +99 -0
  173. package/lib/next/presetEverything.js +59 -0
  174. package/lib/next/presetEverything.js.map +1 -0
  175. package/lib/next/presetMinimal.d.ts +99 -0
  176. package/lib/next/presetMinimal.js +53 -0
  177. package/lib/next/presetMinimal.js.map +1 -0
  178. package/lib/next/runCreateEnginePreset.d.ts +7 -0
  179. package/lib/next/runCreateEnginePreset.js +20 -0
  180. package/lib/next/runCreateEnginePreset.js.map +1 -0
  181. package/lib/next/template.d.ts +99 -0
  182. package/lib/next/template.js +21 -0
  183. package/lib/next/template.js.map +1 -0
  184. package/lib/next/utils/sortObject.d.ts +5 -0
  185. package/lib/next/utils/sortObject.js +9 -0
  186. package/lib/next/utils/sortObject.js.map +1 -0
  187. package/lib/next/utils/swallowError.d.ts +3 -0
  188. package/lib/next/utils/swallowError.js +7 -0
  189. package/lib/next/utils/swallowError.js.map +1 -0
  190. package/lib/shared/isUsingCreateEngine.d.ts +3 -0
  191. package/lib/shared/isUsingCreateEngine.js +7 -0
  192. package/lib/shared/isUsingCreateEngine.js.map +1 -0
  193. package/lib/shared/options/createOptionDefaults/index.d.ts +2 -4
  194. package/lib/shared/options/createOptionDefaults/index.js +4 -13
  195. package/lib/shared/options/createOptionDefaults/index.js.map +1 -1
  196. package/lib/shared/options/createOptionDefaults/readDefaultsFromReadme.js +4 -1
  197. package/lib/shared/options/createOptionDefaults/readDefaultsFromReadme.js.map +1 -1
  198. package/lib/shared/options/createOptionDefaults/readEmails.d.ts +11 -0
  199. package/lib/shared/options/createOptionDefaults/readEmails.js +14 -0
  200. package/lib/shared/options/createOptionDefaults/readEmails.js.map +1 -0
  201. package/lib/shared/options/createOptionDefaults/readFunding.d.ts +3 -0
  202. package/lib/shared/options/createOptionDefaults/readFunding.js +11 -0
  203. package/lib/shared/options/createOptionDefaults/readFunding.js.map +1 -0
  204. package/lib/shared/options/createOptionDefaults/readGuide.d.ts +6 -0
  205. package/lib/shared/options/createOptionDefaults/readGuide.js +18 -0
  206. package/lib/shared/options/createOptionDefaults/readGuide.js.map +1 -0
  207. package/lib/shared/options/ensureRepositoryExists.d.ts +3 -4
  208. package/lib/shared/options/ensureRepositoryExists.js +9 -8
  209. package/lib/shared/options/ensureRepositoryExists.js.map +1 -1
  210. package/lib/shared/options/readOptions.d.ts +5 -6
  211. package/lib/shared/options/readOptions.js +7 -4
  212. package/lib/shared/options/readOptions.js.map +1 -1
  213. package/lib/shared/types.d.ts +7 -0
  214. package/lib/steps/addOwnerAsAllContributor.js.map +1 -1
  215. package/lib/steps/clearUnnecessaryFiles.js +0 -1
  216. package/lib/steps/clearUnnecessaryFiles.js.map +1 -1
  217. package/lib/steps/finalizeDependencies.js +5 -7
  218. package/lib/steps/finalizeDependencies.js.map +1 -1
  219. package/lib/steps/initializeGitHubRepository/index.js +7 -2
  220. package/lib/steps/initializeGitHubRepository/index.js.map +1 -1
  221. package/lib/steps/initializeGitHubRepository/outcomeLabels.d.ts +13 -0
  222. package/lib/steps/initializeGitHubRepository/{labels/outcomeLabels.js → outcomeLabels.js} +4 -1
  223. package/lib/steps/initializeGitHubRepository/outcomeLabels.js.map +1 -0
  224. package/lib/steps/removeSetupScripts.js +9 -3
  225. package/lib/steps/removeSetupScripts.js.map +1 -1
  226. package/lib/steps/uninstallPackages.js +14 -5
  227. package/lib/steps/uninstallPackages.js.map +1 -1
  228. package/lib/steps/writing/creation/createCSpellConfig.d.ts +7 -0
  229. package/lib/steps/writing/creation/createCSpellConfig.js +27 -0
  230. package/lib/steps/writing/creation/createCSpellConfig.js.map +1 -0
  231. package/lib/steps/writing/creation/createDotGitignore.js +7 -5
  232. package/lib/steps/writing/creation/createDotGitignore.js.map +1 -1
  233. package/lib/steps/writing/creation/createESLintConfig.js +1 -3
  234. package/lib/steps/writing/creation/createESLintConfig.js.map +1 -1
  235. package/lib/steps/writing/creation/createTsupConfig.js +10 -10
  236. package/lib/steps/writing/creation/createTsupConfig.js.map +1 -1
  237. package/lib/steps/writing/creation/dotGitHub/createDevelopment/index.js +31 -16
  238. package/lib/steps/writing/creation/dotGitHub/createDevelopment/index.js.map +1 -1
  239. package/lib/steps/writing/creation/dotGitHub/createDevelopment/splitIntoSections.js +1 -1
  240. package/lib/steps/writing/creation/dotGitHub/createDevelopment/splitIntoSections.js.map +1 -1
  241. package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js +5 -5
  242. package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js.map +1 -1
  243. package/lib/steps/writing/creation/dotGitHub/createMultiWorkflowFile.d.ts +3 -1
  244. package/lib/steps/writing/creation/dotGitHub/createMultiWorkflowFile.js.map +1 -1
  245. package/lib/steps/writing/creation/dotGitHub/createWorkflows.js +5 -1
  246. package/lib/steps/writing/creation/dotGitHub/createWorkflows.js.map +1 -1
  247. package/lib/steps/writing/creation/formatters/formatIgnoreFile.d.ts +1 -1
  248. package/lib/steps/writing/creation/formatters/formatIgnoreFile.js +1 -1
  249. package/lib/steps/writing/creation/formatters/formatIgnoreFile.js.map +1 -1
  250. package/lib/steps/writing/creation/formatters/formatTypeScript.js +1 -1
  251. package/lib/steps/writing/creation/formatters/formatTypeScript.js.map +1 -1
  252. package/lib/steps/writing/creation/formatters/formatYaml.js +3 -1
  253. package/lib/steps/writing/creation/formatters/formatYaml.js.map +1 -1
  254. package/lib/steps/writing/creation/index.d.ts +1 -1
  255. package/lib/steps/writing/creation/index.js +48 -1
  256. package/lib/steps/writing/creation/index.js.map +1 -1
  257. package/lib/steps/writing/creation/rootFiles.js +4 -14
  258. package/lib/steps/writing/creation/rootFiles.js.map +1 -1
  259. package/lib/steps/writing/creation/writeAllContributorsRC.js +1 -9
  260. package/lib/steps/writing/creation/writeAllContributorsRC.js.map +1 -1
  261. package/lib/steps/writing/creation/writePackageJson.js +69 -62
  262. package/lib/steps/writing/creation/writePackageJson.js.map +1 -1
  263. package/lib/steps/writing/types.d.ts +1 -1
  264. package/lib/steps/writing/writeStructure.js +9 -1
  265. package/lib/steps/writing/writeStructure.js.map +1 -1
  266. package/lib/steps/writing/writeStructureWorker.js +1 -1
  267. package/lib/steps/writing/writeStructureWorker.js.map +1 -1
  268. package/package.json +35 -28
  269. package/lib/shared/options/createOptionDefaults/readDefaultsFromDevelopment.d.ts +0 -8
  270. package/lib/shared/options/createOptionDefaults/readDefaultsFromDevelopment.js +0 -22
  271. package/lib/shared/options/createOptionDefaults/readDefaultsFromDevelopment.js.map +0 -1
  272. package/lib/shared/options/getGitHub.d.ts +0 -9
  273. package/lib/shared/options/getGitHub.js +0 -17
  274. package/lib/shared/options/getGitHub.js.map +0 -1
  275. package/lib/steps/detectExistingContributors.d.ts +0 -7
  276. package/lib/steps/detectExistingContributors.js +0 -19
  277. package/lib/steps/detectExistingContributors.js.map +0 -1
  278. package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.d.ts +0 -8
  279. package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.js +0 -14
  280. package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.js.map +0 -1
  281. package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.d.ts +0 -8
  282. package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js +0 -63
  283. package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js.map +0 -1
  284. package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.d.ts +0 -7
  285. package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.js.map +0 -1
@@ -0,0 +1,162 @@
1
+ import { base } from "../base.js";
2
+ import { CommandPhase } from "./phases.js";
3
+ const blockContributorCovenant = base.createBlock({
4
+ about: {
5
+ name: "Contributor Covenant"
6
+ },
7
+ migrate() {
8
+ return {
9
+ scripts: [
10
+ {
11
+ commands: ["rm CODE_OF_CONDUCT.md"],
12
+ phase: CommandPhase.Migrations
13
+ }
14
+ ]
15
+ };
16
+ },
17
+ produce({ options }) {
18
+ return {
19
+ files: {
20
+ ".github": {
21
+ "CODE_OF_CONDUCT.md": `# Contributor Covenant Code of Conduct
22
+
23
+ ## Our Pledge
24
+
25
+ We as members, contributors, and leaders pledge to make participation in our
26
+ community a harassment-free experience for everyone, regardless of age, body
27
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
28
+ identity and expression, level of experience, education, socio-economic status,
29
+ nationality, personal appearance, race, caste, color, religion, or sexual
30
+ identity and orientation.
31
+
32
+ We pledge to act and interact in ways that contribute to an open, welcoming,
33
+ diverse, inclusive, and healthy community.
34
+
35
+ ## Our Standards
36
+
37
+ Examples of behavior that contributes to a positive environment for our
38
+ community include:
39
+
40
+ - Demonstrating empathy and kindness toward other people
41
+ - Being respectful of differing opinions, viewpoints, and experiences
42
+ - Giving and gracefully accepting constructive feedback
43
+ - Accepting responsibility and apologizing to those affected by our mistakes,
44
+ and learning from the experience
45
+ - Focusing on what is best not just for us as individuals, but for the overall
46
+ community
47
+
48
+ Examples of unacceptable behavior include:
49
+
50
+ - The use of sexualized language or imagery, and sexual attention or advances of
51
+ any kind
52
+ - Trolling, insulting or derogatory comments, and personal or political attacks
53
+ - Public or private harassment
54
+ - Publishing others' private information, such as a physical or email address,
55
+ without their explicit permission
56
+ - Other conduct which could reasonably be considered inappropriate in a
57
+ professional setting
58
+
59
+ ## Enforcement Responsibilities
60
+
61
+ Community leaders are responsible for clarifying and enforcing our standards of
62
+ acceptable behavior and will take appropriate and fair corrective action in
63
+ response to any behavior that they deem inappropriate, threatening, offensive,
64
+ or harmful.
65
+
66
+ Community leaders have the right and responsibility to remove, edit, or reject
67
+ comments, commits, code, wiki edits, issues, and other contributions that are
68
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
69
+ decisions when appropriate.
70
+
71
+ ## Scope
72
+
73
+ This Code of Conduct applies within all community spaces, and also applies when
74
+ an individual is officially representing the community in public spaces.
75
+ Examples of representing our community include using an official e-mail address,
76
+ posting via an official social media account, or acting as an appointed
77
+ representative at an online or offline event.
78
+
79
+ ## Enforcement
80
+
81
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
82
+ reported to the community leaders responsible for enforcement at
83
+ ${options.email.github}.
84
+ All complaints will be reviewed and investigated promptly and fairly.
85
+
86
+ All community leaders are obligated to respect the privacy and security of the
87
+ reporter of any incident.
88
+
89
+ ## Enforcement Guidelines
90
+
91
+ Community leaders will follow these Community Impact Guidelines in determining
92
+ the consequences for any action they deem in violation of this Code of Conduct:
93
+
94
+ ### 1. Correction
95
+
96
+ **Community Impact**: Use of inappropriate language or other behavior deemed
97
+ unprofessional or unwelcome in the community.
98
+
99
+ **Consequence**: A private, written warning from community leaders, providing
100
+ clarity around the nature of the violation and an explanation of why the
101
+ behavior was inappropriate. A public apology may be requested.
102
+
103
+ ### 2. Warning
104
+
105
+ **Community Impact**: A violation through a single incident or series of
106
+ actions.
107
+
108
+ **Consequence**: A warning with consequences for continued behavior. No
109
+ interaction with the people involved, including unsolicited interaction with
110
+ those enforcing the Code of Conduct, for a specified period of time. This
111
+ includes avoiding interactions in community spaces as well as external channels
112
+ like social media. Violating these terms may lead to a temporary or permanent
113
+ ban.
114
+
115
+ ### 3. Temporary Ban
116
+
117
+ **Community Impact**: A serious violation of community standards, including
118
+ sustained inappropriate behavior.
119
+
120
+ **Consequence**: A temporary ban from any sort of interaction or public
121
+ communication with the community for a specified period of time. No public or
122
+ private interaction with the people involved, including unsolicited interaction
123
+ with those enforcing the Code of Conduct, is allowed during this period.
124
+ Violating these terms may lead to a permanent ban.
125
+
126
+ ### 4. Permanent Ban
127
+
128
+ **Community Impact**: Demonstrating a pattern of violation of community
129
+ standards, including sustained inappropriate behavior, harassment of an
130
+ individual, or aggression toward or disparagement of classes of individuals.
131
+
132
+ **Consequence**: A permanent ban from any sort of public interaction within the
133
+ community.
134
+
135
+ ## Attribution
136
+
137
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
138
+ version 2.1, available at
139
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
140
+
141
+ Community Impact Guidelines were inspired by
142
+ [Mozilla's code of conduct enforcement ladder][mozilla coc].
143
+
144
+ For answers to common questions about this code of conduct, see the FAQ at
145
+ [https://www.contributor-covenant.org/faq][faq]. Translations are available at
146
+ [https://www.contributor-covenant.org/translations][translations].
147
+
148
+ [homepage]: https://www.contributor-covenant.org
149
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
150
+ [mozilla coc]: https://github.com/mozilla/diversity
151
+ [faq]: https://www.contributor-covenant.org/faq
152
+ [translations]: https://www.contributor-covenant.org/translations
153
+ `
154
+ }
155
+ }
156
+ };
157
+ }
158
+ });
159
+ export {
160
+ blockContributorCovenant
161
+ };
162
+ //# sourceMappingURL=blockContributorCovenant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/next/blocks/blockContributorCovenant.ts"],"sourcesContent":["import { base } from \"../base.js\";\nimport { CommandPhase } from \"./phases.js\";\n\nexport const blockContributorCovenant = base.createBlock({\n\tabout: {\n\t\tname: \"Contributor Covenant\",\n\t},\n\tmigrate() {\n\t\treturn {\n\t\t\tscripts: [\n\t\t\t\t{\n\t\t\t\t\tcommands: [\"rm CODE_OF_CONDUCT.md\"],\n\t\t\t\t\tphase: CommandPhase.Migrations,\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t},\n\tproduce({ options }) {\n\t\treturn {\n\t\t\tfiles: {\n\t\t\t\t\".github\": {\n\t\t\t\t\t\"CODE_OF_CONDUCT.md\": `# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participation in our\ncommunity a harassment-free experience for everyone, regardless of age, body\nsize, visible or invisible disability, ethnicity, sex characteristics, gender\nidentity and expression, level of experience, education, socio-economic status,\nnationality, personal appearance, race, caste, color, religion, or sexual\nidentity and orientation.\n\nWe pledge to act and interact in ways that contribute to an open, welcoming,\ndiverse, inclusive, and healthy community.\n\n## Our Standards\n\nExamples of behavior that contributes to a positive environment for our\ncommunity include:\n\n- Demonstrating empathy and kindness toward other people\n- Being respectful of differing opinions, viewpoints, and experiences\n- Giving and gracefully accepting constructive feedback\n- Accepting responsibility and apologizing to those affected by our mistakes,\n and learning from the experience\n- Focusing on what is best not just for us as individuals, but for the overall\n community\n\nExamples of unacceptable behavior include:\n\n- The use of sexualized language or imagery, and sexual attention or advances of\nany kind\n- Trolling, insulting or derogatory comments, and personal or political attacks\n- Public or private harassment\n- Publishing others' private information, such as a physical or email address,\nwithout their explicit permission\n- Other conduct which could reasonably be considered inappropriate in a\nprofessional setting\n\n## Enforcement Responsibilities\n\nCommunity leaders are responsible for clarifying and enforcing our standards of\nacceptable behavior and will take appropriate and fair corrective action in\nresponse to any behavior that they deem inappropriate, threatening, offensive,\nor harmful.\n\nCommunity leaders have the right and responsibility to remove, edit, or reject\ncomments, commits, code, wiki edits, issues, and other contributions that are\nnot aligned to this Code of Conduct, and will communicate reasons for moderation\ndecisions when appropriate.\n\n## Scope\n\nThis Code of Conduct applies within all community spaces, and also applies when\nan individual is officially representing the community in public spaces.\nExamples of representing our community include using an official e-mail address,\nposting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported to the community leaders responsible for enforcement at\n${options.email.github}.\nAll complaints will be reviewed and investigated promptly and fairly.\n\nAll community leaders are obligated to respect the privacy and security of the\nreporter of any incident.\n\n## Enforcement Guidelines\n\nCommunity leaders will follow these Community Impact Guidelines in determining\nthe consequences for any action they deem in violation of this Code of Conduct:\n\n### 1. Correction\n\n**Community Impact**: Use of inappropriate language or other behavior deemed\nunprofessional or unwelcome in the community.\n\n**Consequence**: A private, written warning from community leaders, providing\nclarity around the nature of the violation and an explanation of why the\nbehavior was inappropriate. A public apology may be requested.\n\n### 2. Warning\n\n**Community Impact**: A violation through a single incident or series of\nactions.\n\n**Consequence**: A warning with consequences for continued behavior. No\ninteraction with the people involved, including unsolicited interaction with\nthose enforcing the Code of Conduct, for a specified period of time. This\nincludes avoiding interactions in community spaces as well as external channels\nlike social media. Violating these terms may lead to a temporary or permanent\nban.\n\n### 3. Temporary Ban\n\n**Community Impact**: A serious violation of community standards, including\nsustained inappropriate behavior.\n\n**Consequence**: A temporary ban from any sort of interaction or public\ncommunication with the community for a specified period of time. No public or\nprivate interaction with the people involved, including unsolicited interaction\nwith those enforcing the Code of Conduct, is allowed during this period.\nViolating these terms may lead to a permanent ban.\n\n### 4. Permanent Ban\n\n**Community Impact**: Demonstrating a pattern of violation of community\nstandards, including sustained inappropriate behavior, harassment of an\nindividual, or aggression toward or disparagement of classes of individuals.\n\n**Consequence**: A permanent ban from any sort of public interaction within the\ncommunity.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage],\nversion 2.1, available at\n[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].\n\nCommunity Impact Guidelines were inspired by\n[Mozilla's code of conduct enforcement ladder][mozilla coc].\n\nFor answers to common questions about this code of conduct, see the FAQ at\n[https://www.contributor-covenant.org/faq][faq]. Translations are available at\n[https://www.contributor-covenant.org/translations][translations].\n\n[homepage]: https://www.contributor-covenant.org\n[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html\n[mozilla coc]: https://github.com/mozilla/diversity\n[faq]: https://www.contributor-covenant.org/faq\n[translations]: https://www.contributor-covenant.org/translations\n`,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t},\n});\n"],"mappings":"AAAA,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAEtB,MAAM,2BAA2B,KAAK,YAAY;AAAA,EACxD,OA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mentDocs: create.BlockWithAddons<{
4
+ hints: string[];
5
+ sections: Record<string, {
6
+ contents?: string | {
7
+ after?: string[] | undefined;
8
+ before?: string | undefined;
9
+ items?: string[] | undefined;
10
+ plural?: string | undefined;
11
+ } | undefined;
12
+ innerSections?: {
13
+ contents: string;
14
+ heading: string;
15
+ }[] | undefined;
16
+ }>;
17
+ }, {
18
+ description: string;
19
+ email: {
20
+ github: string;
21
+ npm: string;
22
+ };
23
+ title: string;
24
+ owner: string;
25
+ repository: string;
26
+ access?: "public" | "restricted" | undefined;
27
+ author?: string | undefined;
28
+ bin?: string | undefined;
29
+ login?: string | undefined;
30
+ contributors?: {
31
+ name: string;
32
+ avatar_url: string;
33
+ contributions: string[];
34
+ login: string;
35
+ profile: string;
36
+ }[] | undefined;
37
+ documentation?: string | undefined;
38
+ funding?: string | undefined;
39
+ guide?: {
40
+ href: string;
41
+ title: string;
42
+ } | undefined;
43
+ hideTemplatedBy?: boolean | undefined;
44
+ keywords?: string[] | undefined;
45
+ logo?: {
46
+ alt: string;
47
+ src: string;
48
+ } | undefined;
49
+ node?: {
50
+ minimum: string;
51
+ pinned?: string | undefined;
52
+ } | undefined;
53
+ packageData?: {
54
+ dependencies?: Record<string, string> | undefined;
55
+ devDependencies?: Record<string, string> | undefined;
56
+ scripts?: Record<string, string> | undefined;
57
+ } | undefined;
58
+ preserveGeneratedFrom?: boolean | undefined;
59
+ version?: string | undefined;
60
+ }>;
61
+
62
+ export { blockDevelopmentDocs };
@@ -0,0 +1,92 @@
1
+ import { z } from "zod";
2
+ import { base } from "../base.js";
3
+ import { CommandPhase } from "./phases.js";
4
+ const zInnerSection = z.object({
5
+ contents: z.string(),
6
+ heading: z.string()
7
+ });
8
+ function printInnerSection(innerSection) {
9
+ return [`### ${innerSection.heading}`, ``, innerSection.contents];
10
+ }
11
+ const zSection = z.object({
12
+ contents: z.union([
13
+ z.string(),
14
+ z.object({
15
+ after: z.array(z.string()).optional(),
16
+ before: z.string().optional(),
17
+ items: z.array(z.string()).optional(),
18
+ plural: z.string().optional()
19
+ })
20
+ ]).optional(),
21
+ innerSections: z.array(zInnerSection).optional()
22
+ });
23
+ function printSection(heading, section) {
24
+ const innerSections = section.innerSections?.flatMap(printInnerSection) ?? [];
25
+ if (section.contents === void 0) {
26
+ return innerSections;
27
+ }
28
+ const contents = typeof section.contents === "string" ? { before: section.contents } : section.contents;
29
+ return [
30
+ `## ${heading}`,
31
+ ``,
32
+ ...contents.before ? [contents.before] : [],
33
+ ...contents.items?.sort(
34
+ (a, b) => a.replaceAll("`", "").localeCompare(b.replaceAll("`", ""))
35
+ ) ?? [],
36
+ ...contents.items?.length && contents.plural ? [``, contents.plural] : [],
37
+ ...contents.after ?? [],
38
+ ...innerSections
39
+ ];
40
+ }
41
+ const blockDevelopmentDocs = base.createBlock({
42
+ about: {
43
+ name: "Development Docs"
44
+ },
45
+ addons: {
46
+ hints: z.array(z.string()).default([]),
47
+ sections: z.record(z.string(), zSection).default({})
48
+ },
49
+ migrate() {
50
+ return {
51
+ scripts: [
52
+ {
53
+ commands: ["rm DEVELOPMENT.md"],
54
+ phase: CommandPhase.Migrations
55
+ }
56
+ ]
57
+ };
58
+ },
59
+ produce({ addons, options }) {
60
+ const lines = [
61
+ `# Development`,
62
+ ``,
63
+ ...options.guide ? [
64
+ `> If you'd like a more guided walkthrough, see [${options.guide.title}](${options.guide.href}).`,
65
+ `> It'll walk you through the common activities you'll need to contribute.`,
66
+ ``
67
+ ] : [],
68
+ `After [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation):`,
69
+ ``,
70
+ `\`\`\`shell`,
71
+ `git clone https://github.com/<your-name-here>/${options.repository}`,
72
+ `cd ${options.repository}`,
73
+ `pnpm install`,
74
+ `\`\`\``,
75
+ ``,
76
+ ...addons.hints.length ? [...addons.hints, ``] : [],
77
+ ...Object.entries(addons.sections).sort(([a], [b]) => a.localeCompare(b)).flatMap(([heading, section]) => printSection(heading, section)),
78
+ ...options.documentation ? [options.documentation] : []
79
+ ];
80
+ return {
81
+ files: {
82
+ ".github": {
83
+ "DEVELOPMENT.md": lines.join("\n")
84
+ }
85
+ }
86
+ };
87
+ }
88
+ });
89
+ export {
90
+ blockDevelopmentDocs
91
+ };
92
+ //# sourceMappingURL=blockDevelopmentDocs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/next/blocks/blockDevelopmentDocs.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { base } from \"../base.js\";\nimport { CommandPhase } from \"./phases.js\";\n\nconst zInnerSection = z.object({\n\tcontents: z.string(),\n\theading: z.string(),\n});\n\ntype InnerSection = z.infer<typeof zInnerSection>;\n\nfunction printInnerSection(innerSection: InnerSection) {\n\treturn [`### ${innerSection.heading}`, ``, innerSection.contents];\n}\n\nconst zSection = z.object({\n\tcontents: z\n\t\t.union([\n\t\t\tz.string(),\n\t\t\tz.object({\n\t\t\t\tafter: z.array(z.string()).optional(),\n\t\t\t\tbefore: z.string().optional(),\n\t\t\t\titems: z.array(z.string()).optional(),\n\t\t\t\tplural: z.string().optional(),\n\t\t\t}),\n\t\t])\n\t\t.optional(),\n\tinnerSections: z.array(zInnerSection).optional(),\n});\n\ntype Section = z.infer<typeof zSection>;\n\nfunction printSection(heading: string, section: Section) {\n\tconst innerSections = section.innerSections?.flatMap(printInnerSection) ?? [];\n\n\tif (section.contents === undefined) {\n\t\treturn innerSections;\n\t}\n\n\tconst contents =\n\t\ttypeof section.contents === \"string\"\n\t\t\t? { before: section.contents }\n\t\t\t: section.contents;\n\n\treturn [\n\t\t`## ${heading}`,\n\t\t``,\n\t\t...(contents.before ? [contents.before] : []),\n\t\t...(contents.items?.sort((a, b) =>\n\t\t\ta.replaceAll(\"`\", \"\").localeCompare(b.replaceAll(\"`\", \"\")),\n\t\t) ?? []),\n\t\t...(contents.items?.length && contents.plural ? [``, contents.plural] : []),\n\t\t...(contents.after ?? []),\n\t\t...innerSections,\n\t];\n}\n\nexport const blockDevelopmentDocs = base.createBlock({\n\tabout: {\n\t\tname: \"Development Docs\",\n\t},\n\taddons: {\n\t\thints: z.array(z.string()).default([]),\n\t\tsections: z.record(z.string(), zSection).default({}),\n\t},\n\tmigrate() {\n\t\treturn {\n\t\t\tscripts: [\n\t\t\t\t{\n\t\t\t\t\tcommands: [\"rm DEVELOPMENT.md\"],\n\t\t\t\t\tphase: CommandPhase.Migrations,\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t},\n\tproduce({ addons, options }) {\n\t\tconst lines = [\n\t\t\t`# Development`,\n\t\t\t``,\n\t\t\t...(options.guide\n\t\t\t\t? [\n\t\t\t\t\t\t`> If you'd like a more guided walkthrough, see [${options.guide.title}](${options.guide.href}).`,\n\t\t\t\t\t\t`> It'll walk you through the common activities you'll need to contribute.`,\n\t\t\t\t\t\t``,\n\t\t\t\t\t]\n\t\t\t\t: []),\n\t\t\t`After [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation):`,\n\t\t\t``,\n\t\t\t`\\`\\`\\`shell`,\n\t\t\t`git clone https://github.com/<your-name-here>/${options.repository}`,\n\t\t\t`cd ${options.repository}`,\n\t\t\t`pnpm install`,\n\t\t\t`\\`\\`\\``,\n\t\t\t``,\n\t\t\t...(addons.hints.length ? [...addons.hints, ``] : []),\n\t\t\t...Object.entries(addons.sections)\n\t\t\t\t.sort(([a], [b]) => a.localeCompare(b))\n\t\t\t\t.flatMap(([heading, section]) => printSection(heading, section)),\n\t\t\t...(options.documentation ? [options.documentation] : []),\n\t\t];\n\n\t\treturn {\n\t\t\tfiles: {\n\t\t\t\t\".github\": {\n\t\t\t\t\t\"DEVELOPMENT.md\": lines.join(\"\\n\"),\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t},\n});\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAE7B,MAAM,gBAAgB,EAAE,OAAO;AAAA,EAC9B,UAAU,EAAE,OAAO;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@@ -0,0 +1,73 @@
1
+ import * as create from 'create';
2
+
3
+ declare const blockESLint: create.BlockWithAddons<{
4
+ extensions: (string | {
5
+ plugins?: Record<string, string> | undefined;
6
+ files?: string[] | undefined;
7
+ settings?: Record<string, unknown> | undefined;
8
+ extends?: string[] | undefined;
9
+ languageOptions?: unknown;
10
+ linterOptions?: unknown;
11
+ rules?: Record<string, "off" | "error" | "warn" | ["error" | "warn", unknown] | ["error" | "warn", unknown, unknown]> | {
12
+ entries: Record<string, "off" | "error" | "warn" | ["error" | "warn", unknown] | ["error" | "warn", unknown, unknown]>;
13
+ comment?: string | undefined;
14
+ }[] | undefined;
15
+ })[];
16
+ ignores: string[];
17
+ imports: {
18
+ source: string;
19
+ specifier: string;
20
+ types?: boolean | undefined;
21
+ }[];
22
+ settings?: Record<string, unknown> | undefined;
23
+ rules?: Record<string, "off" | "error" | "warn" | ["error" | "warn", unknown] | ["error" | "warn", unknown, unknown]> | {
24
+ entries: Record<string, "off" | "error" | "warn" | ["error" | "warn", unknown] | ["error" | "warn", unknown, unknown]>;
25
+ comment?: string | undefined;
26
+ }[] | undefined;
27
+ beforeLint?: string | undefined;
28
+ }, {
29
+ description: string;
30
+ email: {
31
+ github: string;
32
+ npm: string;
33
+ };
34
+ title: string;
35
+ owner: string;
36
+ repository: string;
37
+ access?: "public" | "restricted" | undefined;
38
+ author?: string | undefined;
39
+ bin?: string | undefined;
40
+ login?: string | undefined;
41
+ contributors?: {
42
+ name: string;
43
+ avatar_url: string;
44
+ contributions: string[];
45
+ login: string;
46
+ profile: string;
47
+ }[] | undefined;
48
+ documentation?: string | undefined;
49
+ funding?: string | undefined;
50
+ guide?: {
51
+ href: string;
52
+ title: string;
53
+ } | undefined;
54
+ hideTemplatedBy?: boolean | undefined;
55
+ keywords?: string[] | undefined;
56
+ logo?: {
57
+ alt: string;
58
+ src: string;
59
+ } | undefined;
60
+ node?: {
61
+ minimum: string;
62
+ pinned?: string | undefined;
63
+ } | undefined;
64
+ packageData?: {
65
+ dependencies?: Record<string, string> | undefined;
66
+ devDependencies?: Record<string, string> | undefined;
67
+ scripts?: Record<string, string> | undefined;
68
+ } | undefined;
69
+ preserveGeneratedFrom?: boolean | undefined;
70
+ version?: string | undefined;
71
+ }>;
72
+
73
+ export { blockESLint };
@@ -0,0 +1,242 @@
1
+ import { parse as parsePackageName } from "parse-package-name";
2
+ import { z } from "zod";
3
+ import { base } from "../base.js";
4
+ import { blockCSpell } from "./blockCSpell.js";
5
+ import { blockDevelopmentDocs } from "./blockDevelopmentDocs.js";
6
+ import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
7
+ import { blockPackageJson } from "./blockPackageJson.js";
8
+ import { blockVSCode } from "./blockVSCode.js";
9
+ import { getPackageDependencies } from "./packageData.js";
10
+ import { CommandPhase } from "./phases.js";
11
+ const zRuleOptions = z.union([
12
+ z.literal("error"),
13
+ z.literal("off"),
14
+ z.literal("warn"),
15
+ z.union([
16
+ z.tuple([z.union([z.literal("error"), z.literal("warn")]), z.unknown()]),
17
+ z.tuple([
18
+ z.union([z.literal("error"), z.literal("warn")]),
19
+ z.unknown(),
20
+ z.unknown()
21
+ ])
22
+ ])
23
+ ]);
24
+ const zExtensionRules = z.union([
25
+ z.record(z.string(), zRuleOptions),
26
+ z.array(
27
+ z.object({
28
+ comment: z.string().optional(),
29
+ entries: z.record(z.string(), zRuleOptions)
30
+ })
31
+ )
32
+ ]);
33
+ const zExtension = z.object({
34
+ extends: z.array(z.string()).optional(),
35
+ files: z.array(z.string()).optional(),
36
+ languageOptions: z.unknown().optional(),
37
+ linterOptions: z.unknown().optional(),
38
+ plugins: z.record(z.string(), z.string()).optional(),
39
+ rules: zExtensionRules.optional(),
40
+ settings: z.record(z.string(), z.unknown()).optional()
41
+ });
42
+ const zPackageImport = z.object({
43
+ source: z.string(),
44
+ specifier: z.string(),
45
+ types: z.boolean().optional()
46
+ });
47
+ const blockESLint = base.createBlock({
48
+ about: {
49
+ name: "ESLint"
50
+ },
51
+ addons: {
52
+ beforeLint: z.string().optional(),
53
+ extensions: z.array(z.union([z.string(), zExtension])).default([]),
54
+ ignores: z.array(z.string()).default([]),
55
+ imports: z.array(zPackageImport).default([]),
56
+ rules: zExtensionRules.optional(),
57
+ settings: z.record(z.string(), z.unknown()).optional()
58
+ },
59
+ migrate() {
60
+ return {
61
+ scripts: [
62
+ {
63
+ commands: ["rm .eslintrc* .eslintignore"],
64
+ phase: CommandPhase.Migrations
65
+ }
66
+ ]
67
+ };
68
+ },
69
+ produce({ addons, options }) {
70
+ const { extensions, ignores, imports, rules, settings } = addons;
71
+ const importLines = [
72
+ 'import eslint from "@eslint/js";',
73
+ 'import tseslint from "typescript-eslint";',
74
+ ...imports.map(
75
+ (packageImport) => `import ${packageImport.specifier} from "${packageImport.source}"`
76
+ )
77
+ ].sort(
78
+ (a, b) => a.replace(/.+from/, "").localeCompare(b.replace(/.+from/, ""))
79
+ );
80
+ const ignoreLines = ["lib", "node_modules", "pnpm-lock.yaml", ...ignores].map((ignore) => JSON.stringify(ignore)).sort();
81
+ const extensionLines = [
82
+ printExtension({
83
+ extends: [
84
+ "tseslint.configs.strictTypeChecked",
85
+ "tseslint.configs.stylisticTypeChecked"
86
+ ],
87
+ files: ["**/*.js", "**/*.ts"],
88
+ languageOptions: {
89
+ parserOptions: {
90
+ projectService: {
91
+ allowDefaultProject: ["*.config.*s"]
92
+ },
93
+ tsconfigRootDir: "import.meta.dirname"
94
+ }
95
+ },
96
+ ...rules && { rules },
97
+ ...settings && { settings }
98
+ }),
99
+ ...extensions.map(
100
+ (extension) => typeof extension === "string" ? extension : printExtension(extension)
101
+ )
102
+ ].sort((a, b) => processForSort(a).localeCompare(processForSort(b))).map((t) => t);
103
+ return {
104
+ addons: [
105
+ blockCSpell({
106
+ words: ["tseslint"]
107
+ }),
108
+ blockDevelopmentDocs({
109
+ sections: {
110
+ Linting: {
111
+ contents: {
112
+ after: [
113
+ `
114
+ For example, ESLint can be run with \`--fix\` to auto-fix some lint rule complaints:
115
+
116
+ \`\`\`shell
117
+ pnpm run lint --fix
118
+ \`\`\`
119
+ `,
120
+ ...addons.beforeLint ? [addons.beforeLint] : []
121
+ ],
122
+ before: `
123
+ This package includes several forms of linting to enforce consistent code quality and styling.
124
+ Each should be shown in VS Code, and can be run manually on the command-line:
125
+ `,
126
+ items: [
127
+ `- \`pnpm lint\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files`
128
+ ],
129
+ plural: `Read the individual documentation for each linter to understand how it can be configured and used best.`
130
+ }
131
+ }
132
+ }
133
+ }),
134
+ blockGitHubActionsCI({
135
+ jobs: [
136
+ {
137
+ name: "Lint",
138
+ steps: [
139
+ ...options.bin ? [{ run: "pnpm build" }] : [],
140
+ { run: "pnpm lint" }
141
+ ]
142
+ }
143
+ ]
144
+ }),
145
+ blockPackageJson({
146
+ properties: {
147
+ devDependencies: getPackageDependencies(
148
+ "@eslint/js",
149
+ "@types/node",
150
+ "eslint",
151
+ "typescript-eslint",
152
+ ...imports.flatMap(({ source, types }) => {
153
+ const { name } = parsePackageName(source);
154
+ return types ? [name, `@types/${name}`] : [name];
155
+ })
156
+ ),
157
+ scripts: {
158
+ lint: "eslint . --max-warnings 0"
159
+ }
160
+ }
161
+ }),
162
+ blockVSCode({
163
+ extensions: ["dbaeumer.vscode-eslint"],
164
+ settings: {
165
+ "editor.codeActionsOnSave": {
166
+ "source.fixAll.eslint": "explicit"
167
+ },
168
+ "eslint.probe": [
169
+ "javascript",
170
+ "javascriptreact",
171
+ "json",
172
+ "jsonc",
173
+ "markdown",
174
+ "typescript",
175
+ "typescriptreact",
176
+ "yaml"
177
+ ],
178
+ "eslint.rules.customizations": [{ rule: "*", severity: "warn" }]
179
+ }
180
+ })
181
+ ],
182
+ files: {
183
+ "eslint.config.js": `${importLines.join("\n")}
184
+
185
+ export default tseslint.config(
186
+ { ignores: [${ignoreLines.join(", ")}] },
187
+ ${printExtension({
188
+ linterOptions: { reportUnusedDisableDirectives: "error" }
189
+ })},
190
+ eslint.configs.recommended,
191
+ ${extensionLines.join(",")}
192
+ );`
193
+ },
194
+ scripts: [
195
+ {
196
+ commands: ["pnpm lint --fix"],
197
+ phase: CommandPhase.Process
198
+ }
199
+ ]
200
+ };
201
+ }
202
+ });
203
+ function printExtension(extension) {
204
+ return [
205
+ "{",
206
+ extension.extends && `extends: [${extension.extends.join(", ")}],`,
207
+ extension.files && `files: [${extension.files.map((glob) => JSON.stringify(glob)).join(", ")}],`,
208
+ extension.languageOptions && `languageOptions: ${JSON.stringify(extension.languageOptions).replace('"import.meta.dirname"', "import.meta.dirname")},`,
209
+ extension.linterOptions && `linterOptions: ${JSON.stringify(extension.linterOptions)}`,
210
+ extension.rules && `rules: ${printExtensionRules(extension.rules)},`,
211
+ extension.settings && `settings: ${JSON.stringify(extension.settings)},`,
212
+ "}"
213
+ ].filter(Boolean).join(" ");
214
+ }
215
+ function printExtensionRules(rules) {
216
+ if (!Array.isArray(rules)) {
217
+ return JSON.stringify(rules);
218
+ }
219
+ return [
220
+ "{",
221
+ ...rules.flatMap((group) => [
222
+ group.comment ? `// ${group.comment}
223
+ ` : "",
224
+ ...Object.entries(group.entries).map(
225
+ ([ruleName, options]) => `"${ruleName}": ${JSON.stringify(options)},`
226
+ )
227
+ ]),
228
+ "}"
229
+ ].join("");
230
+ }
231
+ function processForSort(line) {
232
+ if (line.startsWith("...") || /\w+/.test(line[0])) {
233
+ return `A
234
+ ${line.replaceAll(/\W+/g, "")}`;
235
+ }
236
+ return `B
237
+ ${(/files: (.+)/.exec(line)?.[1] ?? line).replaceAll(/\W+/g, "")}`;
238
+ }
239
+ export {
240
+ blockESLint
241
+ };
242
+ //# sourceMappingURL=blockESLint.js.map