create-typescript-app 1.77.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 (105) hide show
  1. package/lib/bin/promptForMode.js +2 -1
  2. package/lib/bin/promptForMode.js.map +1 -1
  3. package/lib/create/createWithOptions.d.ts +3 -4
  4. package/lib/create/createWithOptions.js +19 -11
  5. package/lib/create/createWithOptions.js.map +1 -1
  6. package/lib/initialize/initializeWithOptions.d.ts +3 -4
  7. package/lib/initialize/initializeWithOptions.js +4 -4
  8. package/lib/initialize/initializeWithOptions.js.map +1 -1
  9. package/lib/migrate/migrateWithOptions.d.ts +3 -4
  10. package/lib/migrate/migrateWithOptions.js +8 -5
  11. package/lib/migrate/migrateWithOptions.js.map +1 -1
  12. package/lib/next/base.js +4 -0
  13. package/lib/next/base.js.map +1 -1
  14. package/lib/next/blocks/blockAllContributors.js +12 -11
  15. package/lib/next/blocks/blockAllContributors.js.map +1 -1
  16. package/lib/next/blocks/blockCSpell.js +2 -7
  17. package/lib/next/blocks/blockCSpell.js.map +1 -1
  18. package/lib/next/blocks/blockContributingDocs.js +11 -0
  19. package/lib/next/blocks/blockContributingDocs.js.map +1 -1
  20. package/lib/next/blocks/blockContributorCovenant.js +11 -0
  21. package/lib/next/blocks/blockContributorCovenant.js.map +1 -1
  22. package/lib/next/blocks/blockDevelopmentDocs.js +15 -9
  23. package/lib/next/blocks/blockDevelopmentDocs.js.map +1 -1
  24. package/lib/next/blocks/blockESLint.js +18 -1
  25. package/lib/next/blocks/blockESLint.js.map +1 -1
  26. package/lib/next/blocks/blockExampleFiles.d.ts +50 -0
  27. package/lib/next/blocks/blockExampleFiles.js +25 -0
  28. package/lib/next/blocks/blockExampleFiles.js.map +1 -0
  29. package/lib/next/blocks/blockGitHubActionsCI.js +11 -0
  30. package/lib/next/blocks/blockGitHubActionsCI.js.map +1 -1
  31. package/lib/next/blocks/blockPackageJson.d.ts +1 -0
  32. package/lib/next/blocks/blockPackageJson.js +18 -7
  33. package/lib/next/blocks/blockPackageJson.js.map +1 -1
  34. package/lib/next/blocks/blockPnpmDedupe.js +1 -6
  35. package/lib/next/blocks/blockPnpmDedupe.js.map +1 -1
  36. package/lib/next/blocks/blockPrettier.js +18 -8
  37. package/lib/next/blocks/blockPrettier.js.map +1 -1
  38. package/lib/next/blocks/blockReleaseIt.js +5 -0
  39. package/lib/next/blocks/blockReleaseIt.js.map +1 -1
  40. package/lib/next/blocks/blockRepositoryBranchProtection.d.ts +50 -0
  41. package/lib/next/blocks/blockRepositoryBranchProtection.js +49 -0
  42. package/lib/next/blocks/blockRepositoryBranchProtection.js.map +1 -0
  43. package/lib/next/blocks/blockRepositoryLabels.d.ts +48 -0
  44. package/lib/next/blocks/blockRepositoryLabels.js +18 -0
  45. package/lib/next/blocks/blockRepositoryLabels.js.map +1 -0
  46. package/lib/next/blocks/blockRepositorySettings.d.ts +48 -0
  47. package/lib/next/blocks/blockRepositorySettings.js +42 -0
  48. package/lib/next/blocks/blockRepositorySettings.js.map +1 -0
  49. package/lib/next/blocks/blockTSup.js +19 -2
  50. package/lib/next/blocks/blockTSup.js.map +1 -1
  51. package/lib/next/blocks/blockTemplatedBy.d.ts +1 -3
  52. package/lib/next/blocks/blockTemplatedBy.js +0 -4
  53. package/lib/next/blocks/blockTemplatedBy.js.map +1 -1
  54. package/lib/next/blocks/blockTypeScript.js +28 -0
  55. package/lib/next/blocks/blockTypeScript.js.map +1 -1
  56. package/lib/next/blocks/blockVSCode.js +4 -0
  57. package/lib/next/blocks/blockVSCode.js.map +1 -1
  58. package/lib/next/blocks/blockVitest.js +63 -0
  59. package/lib/next/blocks/blockVitest.js.map +1 -1
  60. package/lib/next/blocks/packageData.js.map +1 -1
  61. package/lib/next/blocks/phases.d.ts +9 -0
  62. package/lib/next/blocks/phases.js +11 -0
  63. package/lib/next/blocks/phases.js.map +1 -0
  64. package/lib/next/presetMinimal.js +8 -0
  65. package/lib/next/presetMinimal.js.map +1 -1
  66. package/lib/next/runCreateEnginePreset.d.ts +7 -0
  67. package/lib/next/runCreateEnginePreset.js +20 -0
  68. package/lib/next/runCreateEnginePreset.js.map +1 -0
  69. package/lib/shared/options/ensureRepositoryExists.d.ts +3 -4
  70. package/lib/shared/options/ensureRepositoryExists.js +9 -8
  71. package/lib/shared/options/ensureRepositoryExists.js.map +1 -1
  72. package/lib/shared/options/readOptions.d.ts +5 -6
  73. package/lib/shared/options/readOptions.js +7 -4
  74. package/lib/shared/options/readOptions.js.map +1 -1
  75. package/lib/steps/finalizeDependencies.js +43 -48
  76. package/lib/steps/finalizeDependencies.js.map +1 -1
  77. package/lib/steps/initializeGitHubRepository/index.js +7 -2
  78. package/lib/steps/initializeGitHubRepository/index.js.map +1 -1
  79. package/lib/steps/initializeGitHubRepository/outcomeLabels.d.ts +13 -0
  80. package/lib/steps/initializeGitHubRepository/{labels/outcomeLabels.js → outcomeLabels.js} +4 -1
  81. package/lib/steps/initializeGitHubRepository/outcomeLabels.js.map +1 -0
  82. package/lib/steps/uninstallPackages.js +4 -2
  83. package/lib/steps/uninstallPackages.js.map +1 -1
  84. package/lib/steps/writing/creation/index.js +4 -5
  85. package/lib/steps/writing/creation/index.js.map +1 -1
  86. package/lib/steps/writing/creation/writeAllContributorsRC.js +1 -9
  87. package/lib/steps/writing/creation/writeAllContributorsRC.js.map +1 -1
  88. package/package.json +27 -25
  89. package/lib/next/utils/removeTrailingSlash.d.ts +0 -3
  90. package/lib/next/utils/removeTrailingSlash.js +0 -7
  91. package/lib/next/utils/removeTrailingSlash.js.map +0 -1
  92. package/lib/shared/options/getGitHub.d.ts +0 -9
  93. package/lib/shared/options/getGitHub.js +0 -17
  94. package/lib/shared/options/getGitHub.js.map +0 -1
  95. package/lib/steps/detectExistingContributors.d.ts +0 -7
  96. package/lib/steps/detectExistingContributors.js +0 -19
  97. package/lib/steps/detectExistingContributors.js.map +0 -1
  98. package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.d.ts +0 -8
  99. package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.js +0 -14
  100. package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.js.map +0 -1
  101. package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.d.ts +0 -8
  102. package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js +0 -63
  103. package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js.map +0 -1
  104. package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.d.ts +0 -7
  105. package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.js.map +0 -1
@@ -0,0 +1,11 @@
1
+ const CommandPhase = {
2
+ Migrations: 0,
3
+ Install: 1,
4
+ Build: 2,
5
+ Process: 3,
6
+ Format: 4
7
+ };
8
+ export {
9
+ CommandPhase
10
+ };
11
+ //# sourceMappingURL=phases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/next/blocks/phases.ts"],"sourcesContent":["// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair\n/* eslint-disable perfectionist/sort-objects */\n\nexport const CommandPhase = {\n\tMigrations: 0,\n\tInstall: 1,\n\tBuild: 2,\n\tProcess: 3,\n\tFormat: 4,\n} as const;\n"],"mappings":"AAGO,MAAM,eAAe;AAAA,EAC3B,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AACT;","names":[]}
@@ -3,6 +3,7 @@ import { blockContributingDocs } from "./blocks/blockContributingDocs.js";
3
3
  import { blockContributorCovenant } from "./blocks/blockContributorCovenant.js";
4
4
  import { blockDevelopmentDocs } from "./blocks/blockDevelopmentDocs.js";
5
5
  import { blockESLint } from "./blocks/blockESLint.js";
6
+ import { blockExampleFiles } from "./blocks/blockExampleFiles.js";
6
7
  import { blockFunding } from "./blocks/blockFunding.js";
7
8
  import { blockGitHubActionsCI } from "./blocks/blockGitHubActionsCI.js";
8
9
  import { blockGitHubIssueTemplates } from "./blocks/blockGitHubIssueTemplates.js";
@@ -12,6 +13,9 @@ import { blockMITLicense } from "./blocks/blockMITLicense.js";
12
13
  import { blockPackageJson } from "./blocks/blockPackageJson.js";
13
14
  import { blockPrettier } from "./blocks/blockPrettier.js";
14
15
  import { blockREADME } from "./blocks/blockREADME.js";
16
+ import { blockRepositoryBranchProtection } from "./blocks/blockRepositoryBranchProtection.js";
17
+ import { blockRepositoryLabels } from "./blocks/blockRepositoryLabels.js";
18
+ import { blockRepositorySettings } from "./blocks/blockRepositorySettings.js";
15
19
  import { blockTemplatedBy } from "./blocks/blockTemplatedBy.js";
16
20
  import { blockTSup } from "./blocks/blockTSup.js";
17
21
  import { blockTypeScript } from "./blocks/blockTypeScript.js";
@@ -25,6 +29,7 @@ const presetMinimal = base.createPreset({
25
29
  blockContributorCovenant,
26
30
  blockDevelopmentDocs,
27
31
  blockESLint,
32
+ blockExampleFiles,
28
33
  blockFunding,
29
34
  blockGitHubActionsCI,
30
35
  blockGitHubIssueTemplates,
@@ -34,6 +39,9 @@ const presetMinimal = base.createPreset({
34
39
  blockPackageJson,
35
40
  blockPrettier,
36
41
  blockREADME,
42
+ blockRepositoryBranchProtection,
43
+ blockRepositoryLabels,
44
+ blockRepositorySettings,
37
45
  blockTemplatedBy,
38
46
  blockTSup,
39
47
  blockTypeScript
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/next/presetMinimal.ts"],"sourcesContent":["import { base } from \"./base.js\";\nimport { blockContributingDocs } from \"./blocks/blockContributingDocs.js\";\nimport { blockContributorCovenant } from \"./blocks/blockContributorCovenant.js\";\nimport { blockDevelopmentDocs } from \"./blocks/blockDevelopmentDocs.js\";\nimport { blockESLint } from \"./blocks/blockESLint.js\";\nimport { blockFunding } from \"./blocks/blockFunding.js\";\nimport { blockGitHubActionsCI } from \"./blocks/blockGitHubActionsCI.js\";\nimport { blockGitHubIssueTemplates } from \"./blocks/blockGitHubIssueTemplates.js\";\nimport { blockGitHubPRTemplate } from \"./blocks/blockGitHubPRTemplate.js\";\nimport { blockGitignore } from \"./blocks/blockGitignore.js\";\nimport { blockMITLicense } from \"./blocks/blockMITLicense.js\";\nimport { blockPackageJson } from \"./blocks/blockPackageJson.js\";\nimport { blockPrettier } from \"./blocks/blockPrettier.js\";\nimport { blockREADME } from \"./blocks/blockREADME.js\";\nimport { blockTemplatedBy } from \"./blocks/blockTemplatedBy.js\";\nimport { blockTSup } from \"./blocks/blockTSup.js\";\nimport { blockTypeScript } from \"./blocks/blockTypeScript.js\";\n\nexport const presetMinimal = base.createPreset({\n\tabout: {\n\t\tdescription:\n\t\t\t\"Just bare starter tooling: building, formatting, linting, and type checking.\",\n\t\tname: \"Minimal\",\n\t},\n\tblocks: [\n\t\tblockContributingDocs,\n\t\tblockContributorCovenant,\n\t\tblockDevelopmentDocs,\n\t\tblockESLint,\n\t\tblockFunding,\n\t\tblockGitHubActionsCI,\n\t\tblockGitHubIssueTemplates,\n\t\tblockGitHubPRTemplate,\n\t\tblockGitignore,\n\t\tblockMITLicense,\n\t\tblockPackageJson,\n\t\tblockPrettier,\n\t\tblockREADME,\n\t\tblockTemplatedBy,\n\t\tblockTSup,\n\t\tblockTypeScript,\n\t],\n});\n"],"mappings":"AAAA,SAAS,YAAY;AACrB,SAAS,6BAA6B;AACtC,SAAS,gCAAgC;AACzC,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,SAAS,iCAAiC;AAC1C,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAEzB,MAAM,gBAAgB,KAAK,aAAa;AAAA,EAC9C,OAAO;AAAA,IACN,aACC;AAAA,IACD,MAAM;AAAA,EACP;AAAA,EACA,QAAQ;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../src/next/presetMinimal.ts"],"sourcesContent":["import { base } from \"./base.js\";\nimport { blockContributingDocs } from \"./blocks/blockContributingDocs.js\";\nimport { blockContributorCovenant } from \"./blocks/blockContributorCovenant.js\";\nimport { blockDevelopmentDocs } from \"./blocks/blockDevelopmentDocs.js\";\nimport { blockESLint } from \"./blocks/blockESLint.js\";\nimport { blockExampleFiles } from \"./blocks/blockExampleFiles.js\";\nimport { blockFunding } from \"./blocks/blockFunding.js\";\nimport { blockGitHubActionsCI } from \"./blocks/blockGitHubActionsCI.js\";\nimport { blockGitHubIssueTemplates } from \"./blocks/blockGitHubIssueTemplates.js\";\nimport { blockGitHubPRTemplate } from \"./blocks/blockGitHubPRTemplate.js\";\nimport { blockGitignore } from \"./blocks/blockGitignore.js\";\nimport { blockMITLicense } from \"./blocks/blockMITLicense.js\";\nimport { blockPackageJson } from \"./blocks/blockPackageJson.js\";\nimport { blockPrettier } from \"./blocks/blockPrettier.js\";\nimport { blockREADME } from \"./blocks/blockREADME.js\";\nimport { blockRepositoryBranchProtection } from \"./blocks/blockRepositoryBranchProtection.js\";\nimport { blockRepositoryLabels } from \"./blocks/blockRepositoryLabels.js\";\nimport { blockRepositorySettings } from \"./blocks/blockRepositorySettings.js\";\nimport { blockTemplatedBy } from \"./blocks/blockTemplatedBy.js\";\nimport { blockTSup } from \"./blocks/blockTSup.js\";\nimport { blockTypeScript } from \"./blocks/blockTypeScript.js\";\n\nexport const presetMinimal = base.createPreset({\n\tabout: {\n\t\tdescription:\n\t\t\t\"Just bare starter tooling: building, formatting, linting, and type checking.\",\n\t\tname: \"Minimal\",\n\t},\n\tblocks: [\n\t\tblockContributingDocs,\n\t\tblockContributorCovenant,\n\t\tblockDevelopmentDocs,\n\t\tblockESLint,\n\t\tblockExampleFiles,\n\t\tblockFunding,\n\t\tblockGitHubActionsCI,\n\t\tblockGitHubIssueTemplates,\n\t\tblockGitHubPRTemplate,\n\t\tblockGitignore,\n\t\tblockMITLicense,\n\t\tblockPackageJson,\n\t\tblockPrettier,\n\t\tblockREADME,\n\t\tblockRepositoryBranchProtection,\n\t\tblockRepositoryLabels,\n\t\tblockRepositorySettings,\n\t\tblockTemplatedBy,\n\t\tblockTSup,\n\t\tblockTypeScript,\n\t],\n});\n"],"mappings":"AAAA,SAAS,YAAY;AACrB,SAAS,6BAA6B;AACtC,SAAS,gCAAgC;AACzC,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,SAAS,iCAAiC;AAC1C,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,uCAAuC;AAChD,SAAS,6BAA6B;AACtC,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAEzB,MAAM,gBAAgB,KAAK,aAAa;AAAA,EAC9C,OAAO;AAAA,IACN,aACC;AAAA,IACD,MAAM;AAAA,EACP;AAAA,EACA,QAAQ;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD,CAAC;","names":[]}
@@ -0,0 +1,7 @@
1
+ import { Options } from '../shared/types.js';
2
+ import 'zod';
3
+ import '../shared/codes.js';
4
+
5
+ declare function runCreateEnginePreset(options: Options): Promise<void>;
6
+
7
+ export { runCreateEnginePreset };
@@ -0,0 +1,20 @@
1
+ import { runPreset } from "create";
2
+ import { presetCommon } from "./presetCommon.js";
3
+ import { presetEverything } from "./presetEverything.js";
4
+ import { presetMinimal } from "./presetMinimal.js";
5
+ const presets = {
6
+ common: presetCommon,
7
+ everything: presetEverything,
8
+ minimal: presetMinimal
9
+ };
10
+ async function runCreateEnginePreset(options) {
11
+ const preset = options.base && options.base !== "prompt" && presets[options.base];
12
+ if (!preset) {
13
+ throw new Error(`Cannot yet use create engine with base ${options.base}.`);
14
+ }
15
+ await runPreset(preset, { mode: "initialize", options });
16
+ }
17
+ export {
18
+ runCreateEnginePreset
19
+ };
20
+ //# sourceMappingURL=runCreateEnginePreset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/next/runCreateEnginePreset.ts"],"sourcesContent":["import { runPreset } from \"create\";\n\nimport { Options } from \"../shared/types.js\";\nimport { presetCommon } from \"./presetCommon.js\";\nimport { presetEverything } from \"./presetEverything.js\";\nimport { presetMinimal } from \"./presetMinimal.js\";\n\nconst presets = {\n\tcommon: presetCommon,\n\teverything: presetEverything,\n\tminimal: presetMinimal,\n};\n\nexport async function runCreateEnginePreset(options: Options) {\n\tconst preset =\n\t\toptions.base && options.base !== \"prompt\" && presets[options.base];\n\n\tif (!preset) {\n\t\tthrow new Error(`Cannot yet use create engine with base ${options.base}.`);\n\t}\n\n\tawait runPreset(preset, { mode: \"initialize\", options });\n}\n"],"mappings":"AAAA,SAAS,iBAAiB;AAG1B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAE9B,MAAM,UAAU;AAAA,EACf,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,SAAS;AACV;AAEA,eAAsB,sBAAsB,SAAkB;AAC7D,QAAM,SACL,QAAQ,QAAQ,QAAQ,SAAS,YAAY,QAAQ,QAAQ,IAAI;AAElE,MAAI,CAAC,QAAQ;AACZ,UAAM,IAAI,MAAM,0CAA0C,QAAQ,IAAI,GAAG;AAAA,EAC1E;AAEA,QAAM,UAAU,QAAQ,EAAE,MAAM,cAAc,QAAQ,CAAC;AACxD;","names":[]}
@@ -1,14 +1,13 @@
1
+ import { Octokit } from 'octokit';
1
2
  import { Options } from '../types.js';
2
- import { GitHub } from './getGitHub.js';
3
3
  import 'zod';
4
4
  import '../codes.js';
5
- import 'octokit';
6
5
 
7
6
  type EnsureRepositoryExistsOptions = Pick<Options, "mode" | "owner" | "preserveGeneratedFrom" | "repository">;
8
7
  interface RepositoryExistsResult {
9
- github: GitHub | undefined;
8
+ octokit: Octokit | undefined;
10
9
  repository: string;
11
10
  }
12
- declare function ensureRepositoryExists(github: GitHub | undefined, options: EnsureRepositoryExistsOptions): Promise<Partial<RepositoryExistsResult>>;
11
+ declare function ensureRepositoryExists(octokit: Octokit | undefined, options: EnsureRepositoryExistsOptions): Promise<Partial<RepositoryExistsResult>>;
13
12
 
14
13
  export { type EnsureRepositoryExistsOptions, type RepositoryExistsResult, ensureRepositoryExists };
@@ -1,13 +1,14 @@
1
1
  import * as prompts from "@clack/prompts";
2
2
  import { doesRepositoryExist } from "../doesRepositoryExist.js";
3
+ import { isUsingCreateEngine } from "../isUsingCreateEngine.js";
3
4
  import { filterPromptCancel } from "../prompts.js";
4
5
  import { createRepositoryWithApi } from "./createRepositoryWithApi.js";
5
- async function ensureRepositoryExists(github, options) {
6
+ async function ensureRepositoryExists(octokit, options) {
6
7
  let { repository } = options;
7
8
  let createRepository = options.mode === "create";
8
- while (github) {
9
- if (await doesRepositoryExist(github.octokit, options)) {
10
- return { github, repository };
9
+ while (octokit) {
10
+ if (isUsingCreateEngine() || await doesRepositoryExist(octokit, options)) {
11
+ return { octokit, repository };
11
12
  }
12
13
  const selection = createRepository ? "create" : filterPromptCancel(
13
14
  await prompts.select({
@@ -32,12 +33,12 @@ async function ensureRepositoryExists(github, options) {
32
33
  case void 0:
33
34
  return {};
34
35
  case "create":
35
- await createRepositoryWithApi(github.octokit, {
36
+ await createRepositoryWithApi(octokit, {
36
37
  owner: options.owner,
37
38
  preserveGeneratedFrom: options.preserveGeneratedFrom,
38
39
  repository
39
40
  });
40
- return { github, repository };
41
+ return { octokit, repository };
41
42
  case "different": {
42
43
  const newRepository = filterPromptCancel(
43
44
  await prompts.text({
@@ -51,11 +52,11 @@ async function ensureRepositoryExists(github, options) {
51
52
  break;
52
53
  }
53
54
  case "local":
54
- github = void 0;
55
+ octokit = void 0;
55
56
  break;
56
57
  }
57
58
  }
58
- return { github, repository };
59
+ return { octokit, repository };
59
60
  }
60
61
  export {
61
62
  ensureRepositoryExists
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/options/ensureRepositoryExists.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { doesRepositoryExist } from \"../doesRepositoryExist.js\";\nimport { filterPromptCancel } from \"../prompts.js\";\nimport { Options } from \"../types.js\";\nimport { createRepositoryWithApi } from \"./createRepositoryWithApi.js\";\nimport { GitHub } from \"./getGitHub.js\";\n\nexport type EnsureRepositoryExistsOptions = Pick<\n\tOptions,\n\t\"mode\" | \"owner\" | \"preserveGeneratedFrom\" | \"repository\"\n>;\n\nexport interface RepositoryExistsResult {\n\tgithub: GitHub | undefined;\n\trepository: string;\n}\n\nexport async function ensureRepositoryExists(\n\tgithub: GitHub | undefined,\n\toptions: EnsureRepositoryExistsOptions,\n): Promise<Partial<RepositoryExistsResult>> {\n\t// We'll only respect input options once before prompting for them\n\tlet { repository } = options;\n\tlet createRepository = options.mode === \"create\";\n\n\t// We'll continuously pester the user for a repository\n\t// until they bail, create a new one, or it exists.\n\twhile (github) {\n\t\tif (await doesRepositoryExist(github.octokit, options)) {\n\t\t\treturn { github, repository };\n\t\t}\n\n\t\tconst selection = createRepository\n\t\t\t? \"create\"\n\t\t\t: filterPromptCancel(\n\t\t\t\t\t(await prompts.select({\n\t\t\t\t\t\tmessage: `Repository ${options.repository} doesn't seem to exist under ${options.owner}. What would you like to do?`,\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{ label: \"Create a new repository\", value: \"create\" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: \"Switch to a different repository name\",\n\t\t\t\t\t\t\t\tvalue: \"different\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: \"Keep changes local\",\n\t\t\t\t\t\t\t\tvalue: \"local\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ label: \"Bail out and maybe try again later\", value: \"bail\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t})) as \"bail\" | \"create\" | \"different\" | \"local\",\n\t\t\t\t);\n\n\t\tcreateRepository = false;\n\n\t\tswitch (selection) {\n\t\t\tcase \"bail\":\n\t\t\tcase undefined:\n\t\t\t\treturn {};\n\n\t\t\tcase \"create\":\n\t\t\t\tawait createRepositoryWithApi(github.octokit, {\n\t\t\t\t\towner: options.owner,\n\t\t\t\t\tpreserveGeneratedFrom: options.preserveGeneratedFrom,\n\t\t\t\t\trepository,\n\t\t\t\t});\n\t\t\t\treturn { github, repository };\n\n\t\t\tcase \"different\": {\n\t\t\t\tconst newRepository = filterPromptCancel(\n\t\t\t\t\tawait prompts.text({\n\t\t\t\t\t\tmessage: `What would you like to call the repository?`,\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\tif (!newRepository) {\n\t\t\t\t\treturn {};\n\t\t\t\t}\n\n\t\t\t\trepository = newRepository;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase \"local\":\n\t\t\t\tgithub = undefined;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn { github, repository };\n}\n"],"mappings":"AAAA,YAAY,aAAa;AAEzB,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AAEnC,SAAS,+BAA+B;AAaxC,eAAsB,uBACrB,QACA,SAC2C;AAE3C,MAAI,EAAE,WAAW,IAAI;AACrB,MAAI,mBAAmB,QAAQ,SAAS;AAIxC,SAAO,QAAQ;AACd,QAAI,MAAM,oBAAoB,OAAO,SAAS,OAAO,GAAG;AACvD,aAAO,EAAE,QAAQ,WAAW;AAAA,IAC7B;AAEA,UAAM,YAAY,mBACf,WACA;AAAA,MACC,MAAM,QAAQ,OAAO;AAAA,QACrB,SAAS,cAAc,QAAQ,UAAU,gCAAgC,QAAQ,KAAK;AAAA,QACtF,SAAS;AAAA,UACR,EAAE,OAAO,2BAA2B,OAAO,SAAS;AAAA,UACpD;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,UACR;AAAA,UACA,EAAE,OAAO,sCAAsC,OAAO,OAAO;AAAA,QAC9D;AAAA,MACD,CAAC;AAAA,IACF;AAEF,uBAAmB;AAEnB,YAAQ,WAAW;AAAA,MAClB,KAAK;AAAA,MACL,KAAK;AACJ,eAAO,CAAC;AAAA,MAET,KAAK;AACJ,cAAM,wBAAwB,OAAO,SAAS;AAAA,UAC7C,OAAO,QAAQ;AAAA,UACf,uBAAuB,QAAQ;AAAA,UAC/B;AAAA,QACD,CAAC;AACD,eAAO,EAAE,QAAQ,WAAW;AAAA,MAE7B,KAAK,aAAa;AACjB,cAAM,gBAAgB;AAAA,UACrB,MAAM,QAAQ,KAAK;AAAA,YAClB,SAAS;AAAA,UACV,CAAC;AAAA,QACF;AAEA,YAAI,CAAC,eAAe;AACnB,iBAAO,CAAC;AAAA,QACT;AAEA,qBAAa;AACb;AAAA,MACD;AAAA,MAEA,KAAK;AACJ,iBAAS;AACT;AAAA,IACF;AAAA,EACD;AAEA,SAAO,EAAE,QAAQ,WAAW;AAC7B;","names":[]}
1
+ {"version":3,"sources":["../../../src/shared/options/ensureRepositoryExists.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport { Octokit } from \"octokit\";\n\nimport { doesRepositoryExist } from \"../doesRepositoryExist.js\";\nimport { isUsingCreateEngine } from \"../isUsingCreateEngine.js\";\nimport { filterPromptCancel } from \"../prompts.js\";\nimport { Options } from \"../types.js\";\nimport { createRepositoryWithApi } from \"./createRepositoryWithApi.js\";\n\nexport type EnsureRepositoryExistsOptions = Pick<\n\tOptions,\n\t\"mode\" | \"owner\" | \"preserveGeneratedFrom\" | \"repository\"\n>;\n\nexport interface RepositoryExistsResult {\n\toctokit: Octokit | undefined;\n\trepository: string;\n}\n\nexport async function ensureRepositoryExists(\n\toctokit: Octokit | undefined,\n\toptions: EnsureRepositoryExistsOptions,\n): Promise<Partial<RepositoryExistsResult>> {\n\t// We'll only respect input options once before prompting for them\n\tlet { repository } = options;\n\tlet createRepository = options.mode === \"create\";\n\n\t// We'll continuously pester the user for a repository\n\t// until they bail, create a new one, or it exists.\n\twhile (octokit) {\n\t\tif (\n\t\t\tisUsingCreateEngine() ||\n\t\t\t(await doesRepositoryExist(octokit, options))\n\t\t) {\n\t\t\treturn { octokit, repository };\n\t\t}\n\n\t\tconst selection = createRepository\n\t\t\t? \"create\"\n\t\t\t: filterPromptCancel(\n\t\t\t\t\t(await prompts.select({\n\t\t\t\t\t\tmessage: `Repository ${options.repository} doesn't seem to exist under ${options.owner}. What would you like to do?`,\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{ label: \"Create a new repository\", value: \"create\" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: \"Switch to a different repository name\",\n\t\t\t\t\t\t\t\tvalue: \"different\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: \"Keep changes local\",\n\t\t\t\t\t\t\t\tvalue: \"local\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ label: \"Bail out and maybe try again later\", value: \"bail\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t})) as \"bail\" | \"create\" | \"different\" | \"local\",\n\t\t\t\t);\n\n\t\tcreateRepository = false;\n\n\t\tswitch (selection) {\n\t\t\tcase \"bail\":\n\t\t\tcase undefined:\n\t\t\t\treturn {};\n\n\t\t\tcase \"create\":\n\t\t\t\tawait createRepositoryWithApi(octokit, {\n\t\t\t\t\towner: options.owner,\n\t\t\t\t\tpreserveGeneratedFrom: options.preserveGeneratedFrom,\n\t\t\t\t\trepository,\n\t\t\t\t});\n\t\t\t\treturn { octokit, repository };\n\n\t\t\tcase \"different\": {\n\t\t\t\tconst newRepository = filterPromptCancel(\n\t\t\t\t\tawait prompts.text({\n\t\t\t\t\t\tmessage: `What would you like to call the repository?`,\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\tif (!newRepository) {\n\t\t\t\t\treturn {};\n\t\t\t\t}\n\n\t\t\t\trepository = newRepository;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase \"local\":\n\t\t\t\toctokit = undefined;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn { octokit, repository };\n}\n"],"mappings":"AAAA,YAAY,aAAa;AAGzB,SAAS,2BAA2B;AACpC,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AAEnC,SAAS,+BAA+B;AAYxC,eAAsB,uBACrB,SACA,SAC2C;AAE3C,MAAI,EAAE,WAAW,IAAI;AACrB,MAAI,mBAAmB,QAAQ,SAAS;AAIxC,SAAO,SAAS;AACf,QACC,oBAAoB,KACnB,MAAM,oBAAoB,SAAS,OAAO,GAC1C;AACD,aAAO,EAAE,SAAS,WAAW;AAAA,IAC9B;AAEA,UAAM,YAAY,mBACf,WACA;AAAA,MACC,MAAM,QAAQ,OAAO;AAAA,QACrB,SAAS,cAAc,QAAQ,UAAU,gCAAgC,QAAQ,KAAK;AAAA,QACtF,SAAS;AAAA,UACR,EAAE,OAAO,2BAA2B,OAAO,SAAS;AAAA,UACpD;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,UACR;AAAA,UACA,EAAE,OAAO,sCAAsC,OAAO,OAAO;AAAA,QAC9D;AAAA,MACD,CAAC;AAAA,IACF;AAEF,uBAAmB;AAEnB,YAAQ,WAAW;AAAA,MAClB,KAAK;AAAA,MACL,KAAK;AACJ,eAAO,CAAC;AAAA,MAET,KAAK;AACJ,cAAM,wBAAwB,SAAS;AAAA,UACtC,OAAO,QAAQ;AAAA,UACf,uBAAuB,QAAQ;AAAA,UAC/B;AAAA,QACD,CAAC;AACD,eAAO,EAAE,SAAS,WAAW;AAAA,MAE9B,KAAK,aAAa;AACjB,cAAM,gBAAgB;AAAA,UACrB,MAAM,QAAQ,KAAK;AAAA,YAClB,SAAS;AAAA,UACV,CAAC;AAAA,QACF;AAEA,YAAI,CAAC,eAAe;AACnB,iBAAO,CAAC;AAAA,QACT;AAEA,qBAAa;AACb;AAAA,MACD;AAAA,MAEA,KAAK;AACJ,kBAAU;AACV;AAAA,IACF;AAAA,EACD;AAEA,SAAO,EAAE,SAAS,WAAW;AAC9B;","names":[]}
@@ -1,11 +1,10 @@
1
+ import { Octokit } from 'octokit';
1
2
  import { z } from 'zod';
2
3
  import { Options, Mode, PromptedOptions } from '../types.js';
3
- import { GitHub } from './getGitHub.js';
4
4
  import '../codes.js';
5
- import 'octokit';
6
5
 
7
- interface GitHubAndOptions {
8
- github: GitHub | undefined;
6
+ interface OctokitAndOptions {
7
+ octokit: Octokit | undefined;
9
8
  options: Options;
10
9
  }
11
10
  interface OptionsParseCancelled {
@@ -14,9 +13,9 @@ interface OptionsParseCancelled {
14
13
  options: object;
15
14
  }
16
15
  type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;
17
- interface OptionsParseSuccess extends GitHubAndOptions {
16
+ interface OptionsParseSuccess extends OctokitAndOptions {
18
17
  cancelled: false;
19
18
  }
20
19
  declare function readOptions(args: string[], mode: Mode, promptedOptions?: PromptedOptions): Promise<OptionsParseResult>;
21
20
 
22
- export { type GitHubAndOptions, type OptionsParseCancelled, type OptionsParseResult, type OptionsParseSuccess, readOptions };
21
+ export { type OctokitAndOptions, type OptionsParseCancelled, type OptionsParseResult, type OptionsParseSuccess, readOptions };
@@ -1,4 +1,5 @@
1
1
  import { parseArgs } from "node:util";
2
+ import { octokitFromAuth } from "octokit-from-auth";
2
3
  import { titleCase } from "title-case";
3
4
  import { withSpinner } from "../cli/spinners.js";
4
5
  import { allArgOptions } from "./args.js";
@@ -7,7 +8,6 @@ import { createOptionDefaults } from "./createOptionDefaults/index.js";
7
8
  import { detectEmailRedundancy } from "./detectEmailRedundancy.js";
8
9
  import { ensureRepositoryExists } from "./ensureRepositoryExists.js";
9
10
  import { getBase } from "./getBase.js";
10
- import { getGitHub } from "./getGitHub.js";
11
11
  import { getPrefillOrPromptedOption } from "./getPrefillOrPromptedOption.js";
12
12
  import { logInferredOptions } from "./logInferredOptions.js";
13
13
  import { optionsSchema } from "./optionsSchema.js";
@@ -116,8 +116,11 @@ async function readOptions(args, mode, promptedOptions = {}) {
116
116
  options
117
117
  };
118
118
  }
119
- const { github, repository } = await ensureRepositoryExists(
120
- options.skipGitHubApi ? void 0 : await withSpinner("Checking GitHub authentication", getGitHub),
119
+ const { octokit, repository } = await ensureRepositoryExists(
120
+ options.skipGitHubApi ? void 0 : await withSpinner(
121
+ "Checking GitHub authentication",
122
+ async () => octokitFromAuth()
123
+ ),
121
124
  {
122
125
  mode,
123
126
  owner: options.owner,
@@ -220,7 +223,7 @@ async function readOptions(args, mode, promptedOptions = {}) {
220
223
  }
221
224
  return {
222
225
  cancelled: false,
223
- github,
226
+ octokit,
224
227
  options: augmentedOptions
225
228
  };
226
229
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Mode, OptionsGuide, PromptedOptions } from \"../types.js\";\nimport { Options, OptionsLogo } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { createOptionDefaults } from \"./createOptionDefaults/index.js\";\nimport { detectEmailRedundancy } from \"./detectEmailRedundancy.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { getBase } from \"./getBase.js\";\nimport { getGitHub, GitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { logInferredOptions } from \"./logInferredOptions.js\";\nimport { optionsSchema } from \"./optionsSchema.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\terror?: string | z.ZodError<object>;\n\toptions: object;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport async function readOptions(\n\targs: string[],\n\tmode: Mode,\n\tpromptedOptions: PromptedOptions = {},\n): Promise<OptionsParseResult> {\n\tconst defaults = createOptionDefaults(promptedOptions);\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tif (mode === \"migrate\" && !values.base) {\n\t\tvalues.base = await getBase();\n\t}\n\n\tconst mappedOptions = {\n\t\taccess: values.access,\n\t\tauthor: values.author,\n\t\tauto: !!values.auto,\n\t\tbase: values.base,\n\t\tbin: values.bin,\n\t\tdescription: values.description,\n\t\tdirectory: values.directory,\n\t\temail:\n\t\t\t(values.email ?? values[\"email-github\"] ?? values[\"email-npm\"])\n\t\t\t\t? {\n\t\t\t\t\t\tgithub: values.email ?? values[\"email-github\"],\n\t\t\t\t\t\tnpm: values.email ?? values[\"email-npm\"],\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\texcludeAllContributors: values[\"exclude-all-contributors\"],\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeLintESLint: values[\"exclude-lint-eslint\"],\n\t\texcludeLintJSDoc: values[\"exclude-lint-jsdoc\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintRegex: values[\"exclude-lint-regex\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintStrict: values[\"exclude-lint-strict\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTemplatedBy: values[\"exclude-templated-by\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\tguide: values.guide,\n\t\tguideTitle: values[\"guide-title\"],\n\t\tlogo: values.logo,\n\t\tlogoAlt: values[\"logo-alt\"],\n\t\toffline: values.offline,\n\t\towner: values.owner,\n\t\tpreserveGeneratedFrom:\n\t\t\tvalues[\"preserve-generated-from\"] ?? values.owner === \"JoshuaKGoldberg\",\n\t\trepository: values.repository,\n\t\tskipAllContributorsApi:\n\t\t\tvalues[\"skip-all-contributors-api\"] ?? values.offline,\n\t\tskipGitHubApi: values[\"skip-github-api\"] ?? values.offline,\n\t\tskipInstall: values[\"skip-install\"],\n\t\tskipRemoval: values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst emailError = detectEmailRedundancy(values);\n\tif (emailError) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: emailError,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: optionsParseResult.error,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\tconst ownerOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.owner,\n\t\tmessage: \"What organization or user will the repository be under?\",\n\t\tname: \"owner\",\n\t\tprovided: options.owner,\n\t});\n\n\toptions.owner ??= ownerOption.value;\n\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: ownerOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst repositoryOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.repository,\n\t\tmessage: \"What will the kebab-case name of the repository be?\",\n\t\tname: \"repository\",\n\t\tprovided: options.repository,\n\t});\n\n\toptions.repository ??= repositoryOption.value;\n\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: repositoryOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { github, repository } = await ensureRepositoryExists(\n\t\toptions.skipGitHubApi\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", getGitHub),\n\t\t{\n\t\t\tmode,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\n\tif (!repository) {\n\t\treturn { cancelled: true, error: repositoryOption.error, options };\n\t}\n\n\tconst descriptionOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t\tmessage: \"How would you describe the new package?\",\n\t\tname: \"description\",\n\t\tprovided: options.description,\n\t});\n\n\toptions.description ??= descriptionOption.value;\n\n\tif (!options.description) {\n\t\treturn { cancelled: true, error: descriptionOption.error, options };\n\t}\n\n\tconst titleOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t\tmessage: \"What will the Title Case title of the repository be?\",\n\t\tname: \"title\",\n\t\tprovided: options.title,\n\t});\n\n\toptions.title ??= titleOption.value;\n\n\tif (!options.title) {\n\t\treturn { cancelled: true, error: titleOption.error, options };\n\t}\n\n\tlet guide: OptionsGuide | undefined;\n\n\tif (options.guide) {\n\t\tif (options.guideTitle) {\n\t\t\tguide = { href: options.guide, title: options.guideTitle };\n\t\t} else {\n\t\t\tconst titleOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the title text for the guide?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!titleOption.value) {\n\t\t\t\treturn { cancelled: true, error: titleOption.error, options };\n\t\t\t}\n\n\t\t\tguide = { href: options.guide, title: titleOption.value };\n\t\t}\n\t}\n\n\tlet logo: OptionsLogo | undefined;\n\n\tif (options.logo) {\n\t\tif (options.logoAlt) {\n\t\t\tlogo = { alt: options.logoAlt, src: options.logo };\n\t\t} else {\n\t\t\tconst logoAltOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the alt text (non-visual description) of the logo?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!logoAltOption.value) {\n\t\t\t\treturn { cancelled: true, error: logoAltOption.error, options };\n\t\t\t}\n\n\t\t\tlogo = { alt: logoAltOption.value, src: options.logo };\n\t\t}\n\t}\n\n\tlet email = options.email ?? (await defaults.email());\n\n\tif (!email) {\n\t\tconst emailOption = await getPrefillOrPromptedOption({\n\t\t\tauto: !!mappedOptions.auto,\n\t\t\tmessage: \"What email should be used in package.json and .md files?\",\n\t\t\tname: \"email\",\n\t\t});\n\n\t\tif (!emailOption.value) {\n\t\t\treturn { cancelled: true, error: emailOption.error, options };\n\t\t}\n\n\t\temail = { github: emailOption.value, npm: emailOption.value };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\taccess: options.access ?? \"public\",\n\t\tauthor:\n\t\t\toptions.author ?? (await defaults.author()) ?? (await defaults.owner()),\n\t\tbin: options.bin ?? (await defaults.bin()),\n\t\tdescription: options.description,\n\t\tdirectory:\n\t\t\toptions.directory ?? promptedOptions.directory ?? options.repository,\n\t\temail,\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\tguide: guide ?? (await defaults.guide()),\n\t\tlogo: logo ?? (await defaults.logo()),\n\t\tmode,\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tif (options.auto) {\n\t\tlogInferredOptions(augmentedOptions);\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAG1B,SAAS,mBAAmB;AAG5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AACvC,SAAS,eAAe;AACxB,SAAS,iBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAmB9B,eAAsB,YACrB,MACA,MACA,kBAAmC,CAAC,GACN;AAC9B,QAAM,WAAW,qBAAqB,eAAe;AACrD,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT,CAAC;AAED,MAAI,SAAS,aAAa,CA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,MAAM,SAAS,IAAI;AAAA,IACxC,aAAa,QAAQ;AAAA,IACrB,WACC,QAAQ,aAAa,gBAAgB,aAAa,QAAQ;AAAA,IAC3D;AAAA,IACA,SAAS,QAAQ,WAAY,MAAM,SAAS,QAAQ;AAAA,IACpD,OAAO,SAAU,MAAM,SAAS,MAAM;AAAA,IACtC,MAAM,QAAS,MAAM,SAAS,KAAK;AAAA,IACnC;AAAA,IACA,OAAO,QAAQ;AAAA,IACf;AAAA,IACA,OAAO,QAAQ;AAAA,EAChB,CAAC;AAED,MAAI,CAAC,kBAAkB;AACtB,WAAO;AAAA,MACN,WAAW;AAAA,MACX;AAAA,IACD;AAAA,EACD;AAEA,MAAI,QAAQ,MAAM;AACjB,uBAAmB,gBAAgB;AAAA,EACpC;AAEA,SAAO;AAAA,IACN,WAAW;AAAA,IACX;AAAA,IACA,SAAS;AAAA,EACV;AACD;","names":["titleOption"]}
1
+ {"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { Octokit } from \"octokit\";\nimport { octokitFromAuth } from \"octokit-from-auth\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Mode, OptionsGuide, PromptedOptions } from \"../types.js\";\nimport { Options, OptionsLogo } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { createOptionDefaults } from \"./createOptionDefaults/index.js\";\nimport { detectEmailRedundancy } from \"./detectEmailRedundancy.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { getBase } from \"./getBase.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { logInferredOptions } from \"./logInferredOptions.js\";\nimport { optionsSchema } from \"./optionsSchema.js\";\n\nexport interface OctokitAndOptions {\n\toctokit: Octokit | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\terror?: string | z.ZodError<object>;\n\toptions: object;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport interface OptionsParseSuccess extends OctokitAndOptions {\n\tcancelled: false;\n}\n\nexport async function readOptions(\n\targs: string[],\n\tmode: Mode,\n\tpromptedOptions: PromptedOptions = {},\n): Promise<OptionsParseResult> {\n\tconst defaults = createOptionDefaults(promptedOptions);\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tif (mode === \"migrate\" && !values.base) {\n\t\tvalues.base = await getBase();\n\t}\n\n\tconst mappedOptions = {\n\t\taccess: values.access,\n\t\tauthor: values.author,\n\t\tauto: !!values.auto,\n\t\tbase: values.base,\n\t\tbin: values.bin,\n\t\tdescription: values.description,\n\t\tdirectory: values.directory,\n\t\temail:\n\t\t\t(values.email ?? values[\"email-github\"] ?? values[\"email-npm\"])\n\t\t\t\t? {\n\t\t\t\t\t\tgithub: values.email ?? values[\"email-github\"],\n\t\t\t\t\t\tnpm: values.email ?? values[\"email-npm\"],\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\texcludeAllContributors: values[\"exclude-all-contributors\"],\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeLintESLint: values[\"exclude-lint-eslint\"],\n\t\texcludeLintJSDoc: values[\"exclude-lint-jsdoc\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintRegex: values[\"exclude-lint-regex\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintStrict: values[\"exclude-lint-strict\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTemplatedBy: values[\"exclude-templated-by\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\tguide: values.guide,\n\t\tguideTitle: values[\"guide-title\"],\n\t\tlogo: values.logo,\n\t\tlogoAlt: values[\"logo-alt\"],\n\t\toffline: values.offline,\n\t\towner: values.owner,\n\t\tpreserveGeneratedFrom:\n\t\t\tvalues[\"preserve-generated-from\"] ?? values.owner === \"JoshuaKGoldberg\",\n\t\trepository: values.repository,\n\t\tskipAllContributorsApi:\n\t\t\tvalues[\"skip-all-contributors-api\"] ?? values.offline,\n\t\tskipGitHubApi: values[\"skip-github-api\"] ?? values.offline,\n\t\tskipInstall: values[\"skip-install\"],\n\t\tskipRemoval: values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst emailError = detectEmailRedundancy(values);\n\tif (emailError) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: emailError,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: optionsParseResult.error,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\tconst ownerOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.owner,\n\t\tmessage: \"What organization or user will the repository be under?\",\n\t\tname: \"owner\",\n\t\tprovided: options.owner,\n\t});\n\n\toptions.owner ??= ownerOption.value;\n\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: ownerOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst repositoryOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.repository,\n\t\tmessage: \"What will the kebab-case name of the repository be?\",\n\t\tname: \"repository\",\n\t\tprovided: options.repository,\n\t});\n\n\toptions.repository ??= repositoryOption.value;\n\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: repositoryOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { octokit, repository } = await ensureRepositoryExists(\n\t\toptions.skipGitHubApi\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", async () =>\n\t\t\t\t\toctokitFromAuth(),\n\t\t\t\t),\n\t\t{\n\t\t\tmode,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\n\tif (!repository) {\n\t\treturn { cancelled: true, error: repositoryOption.error, options };\n\t}\n\n\tconst descriptionOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t\tmessage: \"How would you describe the new package?\",\n\t\tname: \"description\",\n\t\tprovided: options.description,\n\t});\n\n\toptions.description ??= descriptionOption.value;\n\n\tif (!options.description) {\n\t\treturn { cancelled: true, error: descriptionOption.error, options };\n\t}\n\n\tconst titleOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t\tmessage: \"What will the Title Case title of the repository be?\",\n\t\tname: \"title\",\n\t\tprovided: options.title,\n\t});\n\n\toptions.title ??= titleOption.value;\n\n\tif (!options.title) {\n\t\treturn { cancelled: true, error: titleOption.error, options };\n\t}\n\n\tlet guide: OptionsGuide | undefined;\n\n\tif (options.guide) {\n\t\tif (options.guideTitle) {\n\t\t\tguide = { href: options.guide, title: options.guideTitle };\n\t\t} else {\n\t\t\tconst titleOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the title text for the guide?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!titleOption.value) {\n\t\t\t\treturn { cancelled: true, error: titleOption.error, options };\n\t\t\t}\n\n\t\t\tguide = { href: options.guide, title: titleOption.value };\n\t\t}\n\t}\n\n\tlet logo: OptionsLogo | undefined;\n\n\tif (options.logo) {\n\t\tif (options.logoAlt) {\n\t\t\tlogo = { alt: options.logoAlt, src: options.logo };\n\t\t} else {\n\t\t\tconst logoAltOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the alt text (non-visual description) of the logo?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!logoAltOption.value) {\n\t\t\t\treturn { cancelled: true, error: logoAltOption.error, options };\n\t\t\t}\n\n\t\t\tlogo = { alt: logoAltOption.value, src: options.logo };\n\t\t}\n\t}\n\n\tlet email = options.email ?? (await defaults.email());\n\n\tif (!email) {\n\t\tconst emailOption = await getPrefillOrPromptedOption({\n\t\t\tauto: !!mappedOptions.auto,\n\t\t\tmessage: \"What email should be used in package.json and .md files?\",\n\t\t\tname: \"email\",\n\t\t});\n\n\t\tif (!emailOption.value) {\n\t\t\treturn { cancelled: true, error: emailOption.error, options };\n\t\t}\n\n\t\temail = { github: emailOption.value, npm: emailOption.value };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\taccess: options.access ?? \"public\",\n\t\tauthor:\n\t\t\toptions.author ?? (await defaults.author()) ?? (await defaults.owner()),\n\t\tbin: options.bin ?? (await defaults.bin()),\n\t\tdescription: options.description,\n\t\tdirectory:\n\t\t\toptions.directory ?? promptedOptions.directory ?? options.repository,\n\t\temail,\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\tguide: guide ?? (await defaults.guide()),\n\t\tlogo: logo ?? (await defaults.logo()),\n\t\tmode,\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tif (options.auto) {\n\t\tlogInferredOptions(augmentedOptions);\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\toctokit,\n\t\toptions: augmentedOptions,\n\t};\n}\n"],"mappings":"AAAA,SAAS,iBAAiB;AAE1B,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAG1B,SAAS,mBAAmB;AAG5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AACvC,SAAS,eAAe;AACxB,SAAS,kCAAkC;AAC3C,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAmB9B,eAAsB,YACrB,MACA,MACA,kBAAmC,CAAC,GACN;AAC9B,QAAM,WAAW,qBAAqB,eAAe;AACrD,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT,CAAC;AAED,MAAI,SAAS,aAAa,CAAC,OAAO,MAAM;AACvC,WAAO,OAAO,MAAM,QAAQ;AAAA,EAC7B;AAEA,QAAM,gBAAgB;AAAA,IACrB,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,IACf,MAAM,CAAC,CAAC,OAAO;AAAA,IACf,MAAM,OAAO;AAAA,IACb,KAAK,OAAO;AAAA,IACZ,aAAa,OAAO;AAAA,IACpB,WAAW,OAAO;AAAA,IAClB,OACE,OAAO,SAAS,OAAO,cAAc,KAAK,OAAO,WAAW,IAC1D;AAAA,MACA,QAAQ,OAAO,SAAS,OAAO,cAAc;AAAA,MAC7C,K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AkB;AACtB,WAAO;AAAA,MACN,WAAW;AAAA,MACX;AAAA,IACD;AAAA,EACD;AAEA,MAAI,QAAQ,MAAM;AACjB,uBAAmB,gBAAgB;AAAA,EACpC;AAEA,SAAO;AAAA,IACN,WAAW;AAAA,IACX;AAAA,IACA,SAAS;AAAA,EACV;AACD;","names":["titleOption"]}
@@ -1,57 +1,52 @@
1
1
  import { execaCommand } from "execa";
2
- import { isUsingCreateEngine } from "../shared/isUsingCreateEngine.js";
3
2
  import { readPackageData, removeDependencies } from "../shared/packages.js";
4
3
  async function finalizeDependencies(options) {
5
- if (isUsingCreateEngine()) {
6
- await execaCommand("pnpm install");
7
- } else {
8
- const devDependencies = [
9
- "@eslint/js",
10
- "@types/node",
11
- "eslint-plugin-n",
12
- "eslint",
13
- "husky",
14
- "lint-staged",
15
- "prettier-plugin-curly",
16
- "prettier-plugin-packagejson",
17
- "prettier-plugin-sh",
18
- "prettier",
19
- "tsup",
20
- "typescript-eslint",
21
- "typescript",
22
- ...options.excludeAllContributors ? [] : ["all-contributors-cli"],
23
- ...options.excludeLintESLint ? [] : ["@eslint-community/eslint-plugin-eslint-comments"],
24
- ...options.excludeLintJSDoc ? [] : ["eslint-plugin-jsdoc"],
25
- ...options.excludeLintJson ? [] : ["eslint-plugin-jsonc"],
26
- ...options.excludeLintKnip ? [] : ["knip"],
27
- ...options.excludeLintMd ? [] : [
28
- "@types/eslint-plugin-markdown",
29
- "eslint-plugin-markdown",
30
- "markdownlint",
31
- "markdownlint-cli",
32
- "sentences-per-line"
33
- ],
34
- ...options.excludeLintPackageJson ? [] : ["eslint-plugin-package-json"],
35
- ...options.excludeLintPerfectionist ? [] : ["eslint-plugin-perfectionist"],
36
- ...options.excludeLintRegex ? [] : ["eslint-plugin-regexp"],
37
- ...options.excludeLintSpelling ? [] : ["cspell"],
38
- ...options.excludeLintYml ? [] : ["eslint-plugin-yml"],
39
- ...options.excludeReleases ? [] : ["@release-it/conventional-changelog", "release-it"],
40
- ...options.excludeTests ? [] : [
41
- "@vitest/coverage-v8",
42
- "@vitest/eslint-plugin",
43
- "console-fail-test",
44
- "vitest"
45
- ]
46
- ].filter(Boolean).sort().map((packageName) => `${packageName}@latest`).join(" ");
47
- await execaCommand(
48
- `pnpm add ${devDependencies} -D${options.offline ? " --offline" : ""}`
49
- );
50
- }
4
+ const devDependencies = [
5
+ "@eslint/js",
6
+ "@types/node",
7
+ "eslint-plugin-n",
8
+ "eslint",
9
+ "husky",
10
+ "lint-staged",
11
+ "prettier-plugin-curly",
12
+ "prettier-plugin-packagejson",
13
+ "prettier-plugin-sh",
14
+ "prettier",
15
+ "tsup",
16
+ "typescript-eslint",
17
+ "typescript",
18
+ ...options.excludeAllContributors ? [] : ["all-contributors-cli"],
19
+ ...options.excludeLintESLint ? [] : ["@eslint-community/eslint-plugin-eslint-comments"],
20
+ ...options.excludeLintJSDoc ? [] : ["eslint-plugin-jsdoc"],
21
+ ...options.excludeLintJson ? [] : ["eslint-plugin-jsonc"],
22
+ ...options.excludeLintKnip ? [] : ["knip"],
23
+ ...options.excludeLintMd ? [] : [
24
+ "@types/eslint-plugin-markdown",
25
+ "eslint-plugin-markdown",
26
+ "markdownlint",
27
+ "markdownlint-cli",
28
+ "sentences-per-line"
29
+ ],
30
+ ...options.excludeLintPackageJson ? [] : ["eslint-plugin-package-json"],
31
+ ...options.excludeLintPerfectionist ? [] : ["eslint-plugin-perfectionist"],
32
+ ...options.excludeLintRegex ? [] : ["eslint-plugin-regexp"],
33
+ ...options.excludeLintSpelling ? [] : ["cspell"],
34
+ ...options.excludeLintYml ? [] : ["eslint-plugin-yml"],
35
+ ...options.excludeReleases ? [] : ["@release-it/conventional-changelog", "release-it"],
36
+ ...options.excludeTests ? [] : [
37
+ "@vitest/coverage-v8",
38
+ "@vitest/eslint-plugin",
39
+ "console-fail-test",
40
+ "vitest"
41
+ ]
42
+ ].filter(Boolean).sort().map((packageName) => `${packageName}@latest`).join(" ");
43
+ await execaCommand(
44
+ `pnpm add ${devDependencies} -D${options.offline ? " --offline" : ""}`
45
+ );
51
46
  if (!options.excludeAllContributors) {
52
47
  await execaCommand(`npx all-contributors-cli generate`);
53
48
  await removeDependencies(
54
- ["all-contributors-cli", "all-contributors-for-repository"],
49
+ ["all-contributors-cli"],
55
50
  (await readPackageData()).devDependencies,
56
51
  "-D"
57
52
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/steps/finalizeDependencies.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nimport { isUsingCreateEngine } from \"../shared/isUsingCreateEngine.js\";\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function finalizeDependencies(options: Options) {\n\tif (isUsingCreateEngine()) {\n\t\t// TODO: How to switch from \"latest\" to the actual versions?\n\t\t// Maybe an eslint-plugin-package-json lint rule?\n\t\tawait execaCommand(\"pnpm install\");\n\t} else {\n\t\tconst devDependencies = [\n\t\t\t\"@eslint/js\",\n\t\t\t\"@types/node\",\n\t\t\t\"eslint-plugin-n\",\n\t\t\t\"eslint\",\n\t\t\t\"husky\",\n\t\t\t\"lint-staged\",\n\t\t\t\"prettier-plugin-curly\",\n\t\t\t\"prettier-plugin-packagejson\",\n\t\t\t\"prettier-plugin-sh\",\n\t\t\t\"prettier\",\n\t\t\t\"tsup\",\n\t\t\t\"typescript-eslint\",\n\t\t\t\"typescript\",\n\t\t\t...(options.excludeAllContributors ? [] : [\"all-contributors-cli\"]),\n\t\t\t...(options.excludeLintESLint\n\t\t\t\t? []\n\t\t\t\t: [\"@eslint-community/eslint-plugin-eslint-comments\"]),\n\t\t\t...(options.excludeLintJSDoc ? [] : [\"eslint-plugin-jsdoc\"]),\n\t\t\t...(options.excludeLintJson ? [] : [\"eslint-plugin-jsonc\"]),\n\t\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t\t...(options.excludeLintMd\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t\"@types/eslint-plugin-markdown\",\n\t\t\t\t\t\t\"eslint-plugin-markdown\",\n\t\t\t\t\t\t\"markdownlint\",\n\t\t\t\t\t\t\"markdownlint-cli\",\n\t\t\t\t\t\t\"sentences-per-line\",\n\t\t\t\t\t]),\n\t\t\t...(options.excludeLintPackageJson ? [] : [\"eslint-plugin-package-json\"]),\n\t\t\t...(options.excludeLintPerfectionist\n\t\t\t\t? []\n\t\t\t\t: [\"eslint-plugin-perfectionist\"]),\n\t\t\t...(options.excludeLintRegex ? [] : [\"eslint-plugin-regexp\"]),\n\t\t\t...(options.excludeLintSpelling ? [] : [\"cspell\"]),\n\t\t\t...(options.excludeLintYml ? [] : [\"eslint-plugin-yml\"]),\n\t\t\t...(options.excludeReleases\n\t\t\t\t? []\n\t\t\t\t: [\"@release-it/conventional-changelog\", \"release-it\"]),\n\t\t\t...(options.excludeTests\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t\"@vitest/coverage-v8\",\n\t\t\t\t\t\t\"@vitest/eslint-plugin\",\n\t\t\t\t\t\t\"console-fail-test\",\n\t\t\t\t\t\t\"vitest\",\n\t\t\t\t\t]),\n\t\t]\n\t\t\t.filter(Boolean)\n\t\t\t.sort()\n\t\t\t.map((packageName) => `${packageName}@latest`)\n\t\t\t.join(\" \");\n\n\t\tawait execaCommand(\n\t\t\t`pnpm add ${devDependencies} -D${options.offline ? \" --offline\" : \"\"}`,\n\t\t);\n\t}\n\n\tif (!options.excludeAllContributors) {\n\t\tawait execaCommand(`npx all-contributors-cli generate`);\n\t\tawait removeDependencies(\n\t\t\t[\"all-contributors-cli\", \"all-contributors-for-repository\"],\n\t\t\t(await readPackageData()).devDependencies,\n\t\t\t\"-D\",\n\t\t);\n\t}\n\n\tawait execaCommand(`pnpm dedupe --offline`);\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,SAAS,2BAA2B;AACpC,SAAS,iBAAiB,0BAA0B;AAGpD,eAAsB,qBAAqB,SAAkB;AAC5D,MAAI,oBAAoB,GAAG;AAG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ACrE;AAAA,EACD;AAEA,MAAI,CAAC,QAAQ,wBAAwB;AACpC,UAAM,aAAa,mCAAmC;AACtD,UAAM;AAAA,MACL,CAAC,wBAAwB,iCAAiC;AAAA,OACzD,MAAM,gBAAgB,GAAG;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAEA,QAAM,aAAa,uBAAuB;AAC3C;","names":[]}
1
+ {"version":3,"sources":["../../src/steps/finalizeDependencies.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function finalizeDependencies(options: Options) {\n\tconst devDependencies = [\n\t\t\"@eslint/js\",\n\t\t\"@types/node\",\n\t\t\"eslint-plugin-n\",\n\t\t\"eslint\",\n\t\t\"husky\",\n\t\t\"lint-staged\",\n\t\t\"prettier-plugin-curly\",\n\t\t\"prettier-plugin-packagejson\",\n\t\t\"prettier-plugin-sh\",\n\t\t\"prettier\",\n\t\t\"tsup\",\n\t\t\"typescript-eslint\",\n\t\t\"typescript\",\n\t\t...(options.excludeAllContributors ? [] : [\"all-contributors-cli\"]),\n\t\t...(options.excludeLintESLint\n\t\t\t? []\n\t\t\t: [\"@eslint-community/eslint-plugin-eslint-comments\"]),\n\t\t...(options.excludeLintJSDoc ? [] : [\"eslint-plugin-jsdoc\"]),\n\t\t...(options.excludeLintJson ? [] : [\"eslint-plugin-jsonc\"]),\n\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t...(options.excludeLintMd\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"@types/eslint-plugin-markdown\",\n\t\t\t\t\t\"eslint-plugin-markdown\",\n\t\t\t\t\t\"markdownlint\",\n\t\t\t\t\t\"markdownlint-cli\",\n\t\t\t\t\t\"sentences-per-line\",\n\t\t\t\t]),\n\t\t...(options.excludeLintPackageJson ? [] : [\"eslint-plugin-package-json\"]),\n\t\t...(options.excludeLintPerfectionist\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-perfectionist\"]),\n\t\t...(options.excludeLintRegex ? [] : [\"eslint-plugin-regexp\"]),\n\t\t...(options.excludeLintSpelling ? [] : [\"cspell\"]),\n\t\t...(options.excludeLintYml ? [] : [\"eslint-plugin-yml\"]),\n\t\t...(options.excludeReleases\n\t\t\t? []\n\t\t\t: [\"@release-it/conventional-changelog\", \"release-it\"]),\n\t\t...(options.excludeTests\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"@vitest/coverage-v8\",\n\t\t\t\t\t\"@vitest/eslint-plugin\",\n\t\t\t\t\t\"console-fail-test\",\n\t\t\t\t\t\"vitest\",\n\t\t\t\t]),\n\t]\n\t\t.filter(Boolean)\n\t\t.sort()\n\t\t.map((packageName) => `${packageName}@latest`)\n\t\t.join(\" \");\n\n\tawait execaCommand(\n\t\t`pnpm add ${devDependencies} -D${options.offline ? \" --offline\" : \"\"}`,\n\t);\n\n\tif (!options.excludeAllContributors) {\n\t\tawait execaCommand(`npx all-contributors-cli generate`);\n\t\tawait removeDependencies(\n\t\t\t[\"all-contributors-cli\"],\n\t\t\t(await readPackageData()).devDependencies,\n\t\t\t\"-D\",\n\t\t);\n\t}\n\n\tawait execaCommand(`pnpm dedupe --offline`);\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB,0BAA0B;AAGpD,eAAsB,qBAAqB,SAAkB;AAC5D,QAAM,kBAAkB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,sBAAsB;AAAA,IACjE,GAAI,QAAQ,oBACT,CAAC,IACD,CAAC,iDAAiD;AAAA,IACrD,GAAI,QAAQ,mBAAmB,CAAC,IAAI,CAAC,qBAAqB;AAAA,IAC1D,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,qBAAqB;AAAA,IACzD,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,MAAM;AAAA,IAC1C,GAAI,QAAQ,gBACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACF,GAAI,QAAQ,yBAAyB,CAAC,IAAI,CAAC,4BAA4B;AAAA,IACvE,GAAI,QAAQ,2BACT,CAAC,IACD,CAAC,6BAA6B;AAAA,IACjC,GAAI,QAAQ,mBAAmB,CAAC,IAAI,CAAC,sBAAsB;AAAA,IAC3D,GAAI,QAAQ,sBAAsB,CAAC,IAAI,CAAC,QAAQ;AAAA,IAChD,GAAI,QAAQ,iBAAiB,CAAC,IAAI,CAAC,mBAAmB;AAAA,IACtD,GAAI,QAAQ,kBACT,CAAC,IACD,CAAC,sCAAsC,YAAY;AAAA,IACtD,GAAI,QAAQ,eACT,CAAC,IACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACH,EACE,OAAO,OAAO,EACd,KAAK,EACL,IAAI,CAAC,gBAAgB,GAAG,WAAW,SAAS,EAC5C,KAAK,GAAG;AAEV,QAAM;AAAA,IACL,YAAY,eAAe,MAAM,QAAQ,UAAU,eAAe,EAAE;AAAA,EACrE;AAEA,MAAI,CAAC,QAAQ,wBAAwB;AACpC,UAAM,aAAa,mCAAmC;AACtD,UAAM;AAAA,MACL,CAAC,sBAAsB;AAAA,OACtB,MAAM,gBAAgB,GAAG;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAEA,QAAM,aAAa,uBAAuB;AAC3C;","names":[]}
@@ -1,12 +1,17 @@
1
+ import { setGitHubRepositoryLabels } from "set-github-repository-labels";
1
2
  import { initializeGitRemote } from "../initializeGitRemote.js";
2
3
  import { initializeRepositorySettings } from "../initializeRepositorySettings.js";
3
4
  import { initializeBranchProtectionSettings } from "./initializeBranchProtectionSettings.js";
4
- import { initializeRepositoryLabels } from "./labels/initializeRepositoryLabels.js";
5
+ import { outcomeLabels } from "./outcomeLabels.js";
5
6
  async function initializeGitHubRepository(octokit, options) {
6
7
  await initializeGitRemote(options);
7
8
  await initializeRepositorySettings(octokit, options);
8
9
  await initializeBranchProtectionSettings(octokit, options);
9
- await initializeRepositoryLabels(octokit, options);
10
+ await setGitHubRepositoryLabels({
11
+ labels: outcomeLabels,
12
+ owner: options.owner,
13
+ repository: options.repository
14
+ });
10
15
  }
11
16
  export {
12
17
  initializeGitHubRepository
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/steps/initializeGitHubRepository/index.ts"],"sourcesContent":["import { Octokit } from \"octokit\";\n\nimport { Options } from \"../../shared/types.js\";\nimport { initializeGitRemote } from \"../initializeGitRemote.js\";\nimport { initializeRepositorySettings } from \"../initializeRepositorySettings.js\";\nimport { initializeBranchProtectionSettings } from \"./initializeBranchProtectionSettings.js\";\nimport { initializeRepositoryLabels } from \"./labels/initializeRepositoryLabels.js\";\n\nexport async function initializeGitHubRepository(\n\toctokit: Octokit,\n\toptions: Options,\n) {\n\tawait initializeGitRemote(options);\n\tawait initializeRepositorySettings(octokit, options);\n\tawait initializeBranchProtectionSettings(octokit, options);\n\tawait initializeRepositoryLabels(octokit, options);\n}\n"],"mappings":"AAGA,SAAS,2BAA2B;AACpC,SAAS,oCAAoC;AAC7C,SAAS,0CAA0C;AACnD,SAAS,kCAAkC;AAE3C,eAAsB,2BACrB,SACA,SACC;AACD,QAAM,oBAAoB,OAAO;AACjC,QAAM,6BAA6B,SAAS,OAAO;AACnD,QAAM,mCAAmC,SAAS,OAAO;AACzD,QAAM,2BAA2B,SAAS,OAAO;AAClD;","names":[]}
1
+ {"version":3,"sources":["../../../src/steps/initializeGitHubRepository/index.ts"],"sourcesContent":["import { Octokit } from \"octokit\";\nimport { setGitHubRepositoryLabels } from \"set-github-repository-labels\";\n\nimport { Options } from \"../../shared/types.js\";\nimport { initializeGitRemote } from \"../initializeGitRemote.js\";\nimport { initializeRepositorySettings } from \"../initializeRepositorySettings.js\";\nimport { initializeBranchProtectionSettings } from \"./initializeBranchProtectionSettings.js\";\nimport { outcomeLabels } from \"./outcomeLabels.js\";\n\nexport async function initializeGitHubRepository(\n\toctokit: Octokit,\n\toptions: Options,\n) {\n\tawait initializeGitRemote(options);\n\tawait initializeRepositorySettings(octokit, options);\n\tawait initializeBranchProtectionSettings(octokit, options);\n\tawait setGitHubRepositoryLabels({\n\t\tlabels: outcomeLabels,\n\t\towner: options.owner,\n\t\trepository: options.repository,\n\t});\n}\n"],"mappings":"AACA,SAAS,iCAAiC;AAG1C,SAAS,2BAA2B;AACpC,SAAS,oCAAoC;AAC7C,SAAS,0CAA0C;AACnD,SAAS,qBAAqB;AAE9B,eAAsB,2BACrB,SACA,SACC;AACD,QAAM,oBAAoB,OAAO;AACjC,QAAM,6BAA6B,SAAS,OAAO;AACnD,QAAM,mCAAmC,SAAS,OAAO;AACzD,QAAM,0BAA0B;AAAA,IAC/B,QAAQ;AAAA,IACR,OAAO,QAAQ;AAAA,IACf,YAAY,QAAQ;AAAA,EACrB,CAAC;AACF;","names":[]}
@@ -0,0 +1,13 @@
1
+ declare const outcomeLabels: ({
2
+ aliases: string[];
3
+ color: string;
4
+ description: string;
5
+ name: string;
6
+ } | {
7
+ color: string;
8
+ description: string;
9
+ name: string;
10
+ aliases?: undefined;
11
+ })[];
12
+
13
+ export { outcomeLabels };
@@ -1,5 +1,6 @@
1
1
  const outcomeLabels = [
2
2
  {
3
+ aliases: ["docs"],
3
4
  color: "0075ca",
4
5
  description: "Improvements or additions to docs \u{1F4DD}",
5
6
  name: "area: documentation"
@@ -25,6 +26,7 @@ const outcomeLabels = [
25
26
  name: "invalid"
26
27
  },
27
28
  {
29
+ aliases: ["help wanted"],
28
30
  color: "0E8A16",
29
31
  description: "Please, send a pull request to resolve this! \u{1F64F}",
30
32
  name: "status: accepting prs"
@@ -66,10 +68,11 @@ const outcomeLabels = [
66
68
  },
67
69
  {
68
70
  color: "d73a4a",
69
- description: "Something isn't working :( \u{1F41B}",
71
+ description: "Something isn't working \u{1F41B}",
70
72
  name: "type: bug"
71
73
  },
72
74
  {
75
+ aliases: ["enhancement"],
73
76
  color: "a2eeef",
74
77
  description: "New enhancement or request \u{1F680}",
75
78
  name: "type: feature"
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/steps/initializeGitHubRepository/outcomeLabels.ts"],"sourcesContent":["/* spellchecker: disable */\nexport const outcomeLabels = [\n\t{\n\t\taliases: [\"docs\"],\n\t\tcolor: \"0075ca\",\n\t\tdescription: \"Improvements or additions to docs 📝\",\n\t\tname: \"area: documentation\",\n\t},\n\t{\n\t\tcolor: \"1177aa\",\n\t\tdescription:\n\t\t\t\"Improving how the repository's tests are run and/or code is tested 🧪\",\n\t\tname: \"area: testing\",\n\t},\n\t{\n\t\tcolor: \"f9d0c4\",\n\t\tdescription: \"Managing the repository's maintenance 🛠️\",\n\t\tname: \"area: tooling\",\n\t},\n\t{\n\t\tcolor: \"5319E7\",\n\t\tdescription: \"Good for newcomers, please hop on! 🙌\",\n\t\tname: \"good first issue\",\n\t},\n\t{\n\t\tcolor: \"7a5901\",\n\t\tdescription: \"This doesn't seem right\",\n\t\tname: \"invalid\",\n\t},\n\t{\n\t\taliases: [\"help wanted\"],\n\t\tcolor: \"0E8A16\",\n\t\tdescription: \"Please, send a pull request to resolve this! 🙏\",\n\t\tname: \"status: accepting prs\",\n\t},\n\t{\n\t\tcolor: \"eeeeee\",\n\t\tdescription: \"Issue is stale and/or no longer valid\",\n\t\tname: \"status: aged away\",\n\t},\n\t{\n\t\tcolor: \"#ddcccc\",\n\t\tdescription: \"Waiting for something else to be resolved 🙅\",\n\t\tname: \"status: blocked\",\n\t},\n\t{\n\t\tcolor: \"cfd3d7\",\n\t\tdescription: \"This issue or pull request already exists\",\n\t\tname: \"status: duplicate\",\n\t},\n\t{\n\t\tcolor: \"#05104F\",\n\t\tdescription: \"Not yet ready for implementation or a pull request\",\n\t\tname: \"status: in discussion\",\n\t},\n\t{\n\t\tcolor: \"D3F82D\",\n\t\tdescription: \"Further research required...? 🔎\",\n\t\tname: \"status: needs investigation\",\n\t},\n\t{\n\t\tcolor: \"E4BC82\",\n\t\tdescription: \"Needs an action taken by the original poster\",\n\t\tname: \"status: waiting for author\",\n\t},\n\t{\n\t\tcolor: \"ffffff\",\n\t\tdescription: \"This will not be worked on\",\n\t\tname: \"status: wontfix\",\n\t},\n\t{\n\t\tcolor: \"d73a4a\",\n\t\tdescription: \"Something isn't working 🐛\",\n\t\tname: \"type: bug\",\n\t},\n\t{\n\t\taliases: [\"enhancement\"],\n\t\tcolor: \"a2eeef\",\n\t\tdescription: \"New enhancement or request 🚀\",\n\t\tname: \"type: feature\",\n\t},\n\t{\n\t\tcolor: \"d876e3\",\n\t\tdescription: \"Further information is requested\",\n\t\tname: \"type: question\",\n\t},\n\t{\n\t\tcolor: \"fde282\",\n\t\tdescription: \"Tech debt or other code/repository cleanups 🧹\",\n\t\tname: \"type: cleanup\",\n\t},\n];\n"],"mappings":"AACO,MAAM,gBAAgB;AAAA,EAC5B;AAAA,IACC,SAAS,CAAC,MAAM;AAAA,IAChB,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aACC;AAAA,IACD,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,SAAS,CAAC,aAAa;AAAA,IACvB,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,SAAS,CAAC,aAAa;AAAA,IACvB,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AACD;","names":[]}
@@ -6,11 +6,10 @@ async function uninstallPackages(offline) {
6
6
  [
7
7
  "@clack/prompts",
8
8
  "@prettier/sync",
9
- "all-contributors-for-repository",
9
+ "all-contributors-cli",
10
10
  "chalk",
11
11
  "create",
12
12
  "execa",
13
- "get-github-auth-token",
14
13
  "git-remote-origin-url",
15
14
  "git-url-parse",
16
15
  "input-from-file",
@@ -19,11 +18,14 @@ async function uninstallPackages(offline) {
19
18
  "lazy-value",
20
19
  "npm-user",
21
20
  "octokit",
21
+ "octokit-from-auth",
22
22
  "parse-author",
23
23
  "parse-package-name",
24
+ "populate-all-contributors-for-repository",
24
25
  "prettier",
25
26
  "replace-in-file",
26
27
  "rimraf",
28
+ "set-github-repository-labels",
27
29
  "sort-package-json",
28
30
  "title-case",
29
31
  "zod",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/steps/uninstallPackages.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\n\nexport async function uninstallPackages(offline: boolean | undefined) {\n\tconst packageData = await readPackageData();\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@clack/prompts\",\n\t\t\t\"@prettier/sync\",\n\t\t\t\"all-contributors-for-repository\",\n\t\t\t\"chalk\",\n\t\t\t\"create\",\n\t\t\t\"execa\",\n\t\t\t\"get-github-auth-token\",\n\t\t\t\"git-remote-origin-url\",\n\t\t\t\"git-url-parse\",\n\t\t\t\"input-from-file\",\n\t\t\t\"input-from-file-json\",\n\t\t\t\"js-yaml\",\n\t\t\t\"lazy-value\",\n\t\t\t\"npm-user\",\n\t\t\t\"octokit\",\n\t\t\t\"parse-author\",\n\t\t\t\"parse-package-name\",\n\t\t\t\"prettier\",\n\t\t\t\"replace-in-file\",\n\t\t\t\"rimraf\",\n\t\t\t\"sort-package-json\",\n\t\t\t\"title-case\",\n\t\t\t\"zod\",\n\t\t\t\"zod-validation-error\",\n\t\t],\n\t\tpackageData.dependencies,\n\t);\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@octokit/request-error\",\n\t\t\t\"@types/git-url-parse\",\n\t\t\t\"@types/js-yaml\",\n\t\t\t\"@types/parse-author\",\n\t\t\t\"all-contributors-cli\",\n\t\t\t\"c8\",\n\t\t\t\"create-testers\",\n\t\t\t\"eslint-config-prettier\",\n\t\t\t\"globby\",\n\t\t\t\"tsx\",\n\t\t],\n\t\tpackageData.devDependencies,\n\t\t\"-D\",\n\t);\n\n\tawait $`pnpm add prettier -D${offline ? \" --offline\" : \"\"}`;\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,0BAA0B;AAEpD,eAAsB,kBAAkB,SAA8B;AACrE,QAAM,cAAc,MAAM,gBAAgB;AAE1C,QAAM;AAAA,IACL;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,YAAY;AAAA,EACb;AAEA,QAAM;AAAA,IACL;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,EACD;AAEA,QAAM,wBAAwB,UAAU,eAAe,EAAE;AAC1D;","names":[]}
1
+ {"version":3,"sources":["../../src/steps/uninstallPackages.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\n\nexport async function uninstallPackages(offline: boolean | undefined) {\n\tconst packageData = await readPackageData();\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@clack/prompts\",\n\t\t\t\"@prettier/sync\",\n\t\t\t\"all-contributors-cli\",\n\t\t\t\"chalk\",\n\t\t\t\"create\",\n\t\t\t\"execa\",\n\t\t\t\"git-remote-origin-url\",\n\t\t\t\"git-url-parse\",\n\t\t\t\"input-from-file\",\n\t\t\t\"input-from-file-json\",\n\t\t\t\"js-yaml\",\n\t\t\t\"lazy-value\",\n\t\t\t\"npm-user\",\n\t\t\t\"octokit\",\n\t\t\t\"octokit-from-auth\",\n\t\t\t\"parse-author\",\n\t\t\t\"parse-package-name\",\n\t\t\t\"populate-all-contributors-for-repository\",\n\t\t\t\"prettier\",\n\t\t\t\"replace-in-file\",\n\t\t\t\"rimraf\",\n\t\t\t\"set-github-repository-labels\",\n\t\t\t\"sort-package-json\",\n\t\t\t\"title-case\",\n\t\t\t\"zod\",\n\t\t\t\"zod-validation-error\",\n\t\t],\n\t\tpackageData.dependencies,\n\t);\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@octokit/request-error\",\n\t\t\t\"@types/git-url-parse\",\n\t\t\t\"@types/js-yaml\",\n\t\t\t\"@types/parse-author\",\n\t\t\t\"all-contributors-cli\",\n\t\t\t\"c8\",\n\t\t\t\"create-testers\",\n\t\t\t\"eslint-config-prettier\",\n\t\t\t\"globby\",\n\t\t\t\"tsx\",\n\t\t],\n\t\tpackageData.devDependencies,\n\t\t\"-D\",\n\t);\n\n\tawait $`pnpm add prettier -D${offline ? \" --offline\" : \"\"}`;\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,0BAA0B;AAEpD,eAAsB,kBAAkB,SAA8B;AACrE,QAAM,cAAc,MAAM,gBAAgB;AAE1C,QAAM;AAAA,IACL;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,YAAY;AAAA,EACb;AAEA,QAAM;AAAA,IACL;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,EACD;AAEA,QAAM,wBAAwB,UAAU,eAAe,EAAE;AAC1D;","names":[]}
@@ -16,12 +16,11 @@ const presets = {
16
16
  async function createStructure(options, useNextEngine) {
17
17
  const preset = useNextEngine && options.base && options.base !== "prompt" && presets[options.base];
18
18
  if (preset) {
19
- const creation = await producePreset(preset, { options });
20
- return await recursivelyFormat({
21
- ...creation.files,
22
- // TODO: Add a "starting files" option in create Presets/Templates?
23
- src: await createSrc(options)
19
+ const { creation } = await producePreset(preset, {
20
+ mode: "initialize",
21
+ options
24
22
  });
23
+ return await recursivelyFormat(creation.files);
25
24
  }
26
25
  return {
27
26
  ".github": await createDotGitHub(options),