create-typescript-app 1.49.1 → 1.49.2

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.
@@ -1,4 +1,10 @@
1
- declare function getPrefillOrPromptedOption(name: string, auto: boolean, message: string, getDefaultValue?: () => Promise<string | undefined>): Promise<{
1
+ interface GetPrefillOrPromptedOptionOptions {
2
+ auto: boolean;
3
+ getDefaultValue?: () => Promise<string | undefined>;
4
+ message: string;
5
+ name: string;
6
+ }
7
+ declare function getPrefillOrPromptedOption({ auto, getDefaultValue, message, name, }: GetPrefillOrPromptedOptionOptions): Promise<{
2
8
  error: string | undefined;
3
9
  value: string | undefined;
4
10
  } | {
@@ -6,4 +12,4 @@ declare function getPrefillOrPromptedOption(name: string, auto: boolean, message
6
12
  error?: undefined;
7
13
  }>;
8
14
 
9
- export { getPrefillOrPromptedOption };
15
+ export { type GetPrefillOrPromptedOptionOptions, getPrefillOrPromptedOption };
@@ -1,6 +1,11 @@
1
1
  import * as prompts from "@clack/prompts";
2
2
  import { filterPromptCancel } from "../prompts.js";
3
- async function getPrefillOrPromptedOption(name, auto, message, getDefaultValue) {
3
+ async function getPrefillOrPromptedOption({
4
+ auto,
5
+ getDefaultValue,
6
+ message,
7
+ name
8
+ }) {
4
9
  const defaultValue = await getDefaultValue?.();
5
10
  if (auto || defaultValue) {
6
11
  return {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/options/getPrefillOrPromptedOption.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { filterPromptCancel } from \"../prompts.js\";\n\nexport async function getPrefillOrPromptedOption(\n\tname: string,\n\tauto: boolean,\n\tmessage: string,\n\tgetDefaultValue?: () => Promise<string | undefined>,\n) {\n\tconst defaultValue = await getDefaultValue?.();\n\n\tif (auto || defaultValue) {\n\t\treturn {\n\t\t\terror: defaultValue\n\t\t\t\t? undefined\n\t\t\t\t: `Could not infer a default value for ${name}.`,\n\t\t\tvalue: defaultValue,\n\t\t};\n\t}\n\n\treturn {\n\t\tvalue: filterPromptCancel(\n\t\t\tawait prompts.text({\n\t\t\t\tmessage,\n\t\t\t\tplaceholder: defaultValue,\n\t\t\t\tvalidate: (val) => {\n\t\t\t\t\tif (val.length === 0) {\n\t\t\t\t\t\treturn \"Please enter a value.\";\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t),\n\t};\n}\n"],"mappings":"AAAA,YAAY,aAAa;AAEzB,SAAS,0BAA0B;AAEnC,eAAsB,2BACrB,MACA,MACA,SACA,iBACC;AACD,QAAM,eAAe,MAAM,kBAAkB;AAE7C,MAAI,QAAQ,cAAc;AACzB,WAAO;AAAA,MACN,OAAO,eACJ,SACA,uCAAuC,IAAI;AAAA,MAC9C,OAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AAAA,IACN,OAAO;AAAA,MACN,MAAM,QAAQ,KAAK;AAAA,QAClB;AAAA,QACA,aAAa;AAAA,QACb,UAAU,CAAC,QAAQ;AAClB,cAAI,IAAI,WAAW,GAAG;AACrB,mBAAO;AAAA,UACR;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../src/shared/options/getPrefillOrPromptedOption.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { filterPromptCancel } from \"../prompts.js\";\n\nexport interface GetPrefillOrPromptedOptionOptions {\n\tauto: boolean;\n\tgetDefaultValue?: () => Promise<string | undefined>;\n\tmessage: string;\n\tname: string;\n}\n\nexport async function getPrefillOrPromptedOption({\n\tauto,\n\tgetDefaultValue,\n\tmessage,\n\tname,\n}: GetPrefillOrPromptedOptionOptions) {\n\tconst defaultValue = await getDefaultValue?.();\n\n\tif (auto || defaultValue) {\n\t\treturn {\n\t\t\terror: defaultValue\n\t\t\t\t? undefined\n\t\t\t\t: `Could not infer a default value for ${name}.`,\n\t\t\tvalue: defaultValue,\n\t\t};\n\t}\n\n\treturn {\n\t\tvalue: filterPromptCancel(\n\t\t\tawait prompts.text({\n\t\t\t\tmessage,\n\t\t\t\tplaceholder: defaultValue,\n\t\t\t\tvalidate: (val) => {\n\t\t\t\t\tif (val.length === 0) {\n\t\t\t\t\t\treturn \"Please enter a value.\";\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t),\n\t};\n}\n"],"mappings":"AAAA,YAAY,aAAa;AAEzB,SAAS,0BAA0B;AASnC,eAAsB,2BAA2B;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAsC;AACrC,QAAM,eAAe,MAAM,kBAAkB;AAE7C,MAAI,QAAQ,cAAc;AACzB,WAAO;AAAA,MACN,OAAO,eACJ,SACA,uCAAuC,IAAI;AAAA,MAC9C,OAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AAAA,IACN,OAAO;AAAA,MACN,MAAM,QAAQ,KAAK;AAAA,QAClB;AAAA,QACA,aAAa;AAAA,QACb,UAAU,CAAC,QAAQ;AAClB,cAAI,IAAI,WAAW,GAAG;AACrB,mBAAO;AAAA,UACR;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AACD;","names":[]}
@@ -84,12 +84,12 @@ async function readOptions(args, mode, promptedOptions = {}) {
84
84
  };
85
85
  }
86
86
  const options = optionsParseResult.data;
87
- const ownerOption = await getPrefillOrPromptedOption(
88
- "owner",
89
- !!mappedOptions.auto,
90
- "What organization or user will the repository be under?",
91
- defaults.owner
92
- );
87
+ const ownerOption = await getPrefillOrPromptedOption({
88
+ auto: !!mappedOptions.auto,
89
+ getDefaultValue: async () => options.owner ?? await defaults.owner(),
90
+ message: "What organization or user will the repository be under?",
91
+ name: "owner"
92
+ });
93
93
  options.owner ??= ownerOption.value;
94
94
  if (!options.owner) {
95
95
  return {
@@ -98,12 +98,12 @@ async function readOptions(args, mode, promptedOptions = {}) {
98
98
  options
99
99
  };
100
100
  }
101
- const repositoryOption = await getPrefillOrPromptedOption(
102
- "repository",
103
- !!mappedOptions.auto,
104
- "What will the kebab-case name of the repository be?",
105
- defaults.repository
106
- );
101
+ const repositoryOption = await getPrefillOrPromptedOption({
102
+ auto: !!mappedOptions.auto,
103
+ getDefaultValue: async () => options.repository ?? await defaults.repository(),
104
+ message: "What will the kebab-case name of the repository be?",
105
+ name: "repository"
106
+ });
107
107
  options.repository ??= repositoryOption.value;
108
108
  if (!options.repository) {
109
109
  return {
@@ -123,22 +123,22 @@ async function readOptions(args, mode, promptedOptions = {}) {
123
123
  if (!repository) {
124
124
  return { cancelled: true, error: repositoryOption.error, options };
125
125
  }
126
- const descriptionOption = await getPrefillOrPromptedOption(
127
- "description",
128
- !!mappedOptions.auto,
129
- "How would you describe the new package?",
130
- async () => await defaults.description() ?? "A very lovely package. Hooray!"
131
- );
126
+ const descriptionOption = await getPrefillOrPromptedOption({
127
+ auto: !!mappedOptions.auto,
128
+ getDefaultValue: async () => options.description ?? await defaults.description() ?? "A very lovely package. Hooray!",
129
+ message: "How would you describe the new package?",
130
+ name: "description"
131
+ });
132
132
  options.description ??= descriptionOption.value;
133
133
  if (!options.description) {
134
134
  return { cancelled: true, error: descriptionOption.error, options };
135
135
  }
136
- const titleOption = await getPrefillOrPromptedOption(
137
- "title",
138
- !!mappedOptions.auto,
139
- "What will the Title Case title of the repository be?",
140
- async () => await defaults.title() ?? titleCase(repository).replaceAll("-", " ")
141
- );
136
+ const titleOption = await getPrefillOrPromptedOption({
137
+ auto: !!mappedOptions.auto,
138
+ getDefaultValue: async () => options.title ?? await defaults.title() ?? titleCase(repository).replaceAll("-", " "),
139
+ message: "What will the Title Case title of the repository be?",
140
+ name: "title"
141
+ });
142
142
  options.title ??= titleOption.value;
143
143
  if (!options.title) {
144
144
  return { cancelled: true, error: titleOption.error, options };
@@ -148,11 +148,11 @@ async function readOptions(args, mode, promptedOptions = {}) {
148
148
  if (options.guideTitle) {
149
149
  guide = { href: options.guide, title: options.guideTitle };
150
150
  } else {
151
- const titleOption2 = await getPrefillOrPromptedOption(
152
- "getPrefillOrPromptedOption",
153
- !!mappedOptions.auto,
154
- "What is the title text for the guide?"
155
- );
151
+ const titleOption2 = await getPrefillOrPromptedOption({
152
+ auto: !!mappedOptions.auto,
153
+ message: "What is the title text for the guide?",
154
+ name: "getPrefillOrPromptedOption"
155
+ });
156
156
  if (!titleOption2.value) {
157
157
  return { cancelled: true, error: titleOption2.error, options };
158
158
  }
@@ -164,11 +164,11 @@ async function readOptions(args, mode, promptedOptions = {}) {
164
164
  if (options.logoAlt) {
165
165
  logo = { alt: options.logoAlt, src: options.logo };
166
166
  } else {
167
- const logoAltOption = await getPrefillOrPromptedOption(
168
- "getPrefillOrPromptedOption",
169
- !!mappedOptions.auto,
170
- "What is the alt text (non-visual description) of the logo?"
171
- );
167
+ const logoAltOption = await getPrefillOrPromptedOption({
168
+ auto: !!mappedOptions.auto,
169
+ message: "What is the alt text (non-visual description) of the logo?",
170
+ name: "getPrefillOrPromptedOption"
171
+ });
172
172
  if (!logoAltOption.value) {
173
173
  return { cancelled: true, error: logoAltOption.error, options };
174
174
  }
@@ -177,11 +177,11 @@ async function readOptions(args, mode, promptedOptions = {}) {
177
177
  }
178
178
  let email = options.email ?? await defaults.email();
179
179
  if (!email) {
180
- const emailOption = await getPrefillOrPromptedOption(
181
- "email",
182
- !!mappedOptions.auto,
183
- "What email should be used in package.json and .md files?"
184
- );
180
+ const emailOption = await getPrefillOrPromptedOption({
181
+ auto: !!mappedOptions.auto,
182
+ message: "What email should be used in package.json and .md files?",
183
+ name: "email"
184
+ });
185
185
  if (!emailOption.value) {
186
186
  return { cancelled: true, error: emailOption.error, options };
187
187
  }
@@ -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 { GitHub, getGitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { logInferredOptions } from \"./logInferredOptions.js\";\nimport { optionsSchema } from \"./optionsSchema.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\terror?: string | z.ZodError<object>;\n\toptions: object;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(\n\targs: string[],\n\tmode: Mode,\n\tpromptedOptions: PromptedOptions = {},\n): Promise<OptionsParseResult> {\n\tconst defaults = createOptionDefaults(promptedOptions);\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tif (mode === \"migrate\" && !values.base) {\n\t\tvalues.base = await getBase();\n\t}\n\n\tconst mappedOptions = {\n\t\taccess: values.access,\n\t\tauthor: values.author,\n\t\tauto: !!values.auto,\n\t\tbase: values.base,\n\t\tbin: values.bin,\n\t\tdescription: values.description,\n\t\tdirectory: values.directory,\n\t\temail:\n\t\t\tvalues.email ?? values[\"email-github\"] ?? values[\"email-npm\"]\n\t\t\t\t? {\n\t\t\t\t\t\tgithub: values.email ?? values[\"email-github\"],\n\t\t\t\t\t\tnpm: values.email ?? values[\"email-npm\"],\n\t\t\t\t }\n\t\t\t\t: undefined,\n\t\texcludeAllContributors: values[\"exclude-all-contributors\"],\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeLintDeprecation: values[\"exclude-lint-deprecation\"],\n\t\texcludeLintESLint: values[\"exclude-lint-eslint\"],\n\t\texcludeLintJSDoc: values[\"exclude-lint-jsdoc\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintRegex: values[\"exclude-lint-regex\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintStrict: values[\"exclude-lint-strict\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\tguide: values.guide,\n\t\tlogo: values.logo,\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\t\"owner\",\n\t\t!!mappedOptions.auto,\n\t\t\"What organization or user will the repository be under?\",\n\t\tdefaults.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\t\"repository\",\n\t\t!!mappedOptions.auto,\n\t\t\"What will the kebab-case name of the repository be?\",\n\t\tdefaults.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\t\"description\",\n\t\t!!mappedOptions.auto,\n\t\t\"How would you describe the new package?\",\n\t\tasync () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\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\t\"title\",\n\t\t!!mappedOptions.auto,\n\t\t\"What will the Title Case title of the repository be?\",\n\t\tasync () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\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\t\"getPrefillOrPromptedOption\",\n\t\t\t\t!!mappedOptions.auto,\n\t\t\t\t\"What is the title text for the guide?\",\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\t\"getPrefillOrPromptedOption\",\n\t\t\t\t!!mappedOptions.auto,\n\t\t\t\t\"What is the alt text (non-visual description) of the logo?\",\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\t\"email\",\n\t\t\t!!mappedOptions.auto,\n\t\t\t\"What email should be used in package.json and .md files?\",\n\t\t);\n\n\t\tif (!emailOption.value) {\n\t\t\treturn { cancelled: true, error: emailOption.error, options };\n\t\t}\n\n\t\temail = { github: emailOption.value, npm: emailOption.value };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\taccess: options.access ?? \"public\",\n\t\tauthor: options.author ?? (await defaults.owner()),\n\t\tdescription: options.description,\n\t\tdirectory:\n\t\t\toptions.directory ?? promptedOptions.directory ?? options.repository,\n\t\temail,\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\tguide,\n\t\tlogo,\n\t\tmode,\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tif (options.auto) {\n\t\tlogInferredOptions(augmentedOptions);\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAG1B,SAAS,mBAAmB;AAG5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AACvC,SAAS,eAAe;AACxB,SAAiB,iBAAiB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAmB9B,eAAsB,YACrB,MACA,MACA,kBAAmC,CAAC,GACN;AAC9B,QAAM,WAAW,qBAAqB,eAAe;AACrD,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT,CAAC;AAED,MAAI,SAAS,aAAa,CAAC,OAAO,MAAM;AACvC,WAAO,OAAO,MAAM,QAAQ;AAAA,EAC7B;AAEA,QAAM,gBAAgB;AAAA,IACrB,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,IACf,MAAM,CAAC,CAAC,OAAO;AAAA,IACf,MAAM,OAAO;AAAA,IACb,KAAK,OAAO;AAAA,IACZ,aAAa,OAAO;AAAA,IACpB,WAAW,OAAO;AAAA,IAClB,OACC,OAAO,SAAS,OAAO,cAAc,KAAK,OAAO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,QAAQ,SAAU,MAAM,SAAS,MAAM;AAEnD,MAAI,CAAC,OAAO;AACX,UAAM,cAAc,MAAM;AAAA,MACzB;AAAA,MACA,CAAC,CAAC,cAAc;AAAA,MAChB;AAAA,IACD;AAEA,QAAI,CAAC,YAAY,OAAO;AACvB,aAAO,EAAE,WAAW,MAAM,OAAO,YAAY,OAAO,QAAQ;AAAA,IAC7D;AAEA,YAAQ,EAAE,QAAQ,YAAY,OAAO,KAAK,YAAY,MAAM;AAAA,EAC7D;AAEA,QAAM,mBAAmB,MAAM,2BAA2B;AAAA,IACzD,GAAG;AAAA,IACH,QAAQ,QAAQ,UAAU;AAAA,IAC1B,QAAQ,QAAQ,UAAW,MAAM,SAAS,MAAM;AAAA,IAChD,aAAa,QAAQ;AAAA,IACrB,WACC,QAAQ,aAAa,gBAAgB,aAAa,QAAQ;AAAA,IAC3D;AAAA,IACA,SAAS,QAAQ,WAAY,MAAM,SAAS,QAAQ;AAAA,IACpD;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,QAAQ;AAAA,IACf;AAAA,IACA,OAAO,QAAQ;AAAA,EAChB,CAAC;AAED,MAAI,CAAC,kBAAkB;AACtB,WAAO;AAAA,MACN,WAAW;AAAA,MACX;AAAA,IACD;AAAA,EACD;AAEA,MAAI,QAAQ,MAAM;AACjB,uBAAmB,gBAAgB;AAAA,EACpC;AAEA,SAAO;AAAA,IACN,WAAW;AAAA,IACX;AAAA,IACA,SAAS;AAAA,EACV;AACD;","names":["titleOption"]}
1
+ {"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Mode, OptionsGuide, PromptedOptions } from \"../types.js\";\nimport { Options, OptionsLogo } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { createOptionDefaults } from \"./createOptionDefaults/index.js\";\nimport { detectEmailRedundancy } from \"./detectEmailRedundancy.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { getBase } from \"./getBase.js\";\nimport { GitHub, getGitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { logInferredOptions } from \"./logInferredOptions.js\";\nimport { optionsSchema } from \"./optionsSchema.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\terror?: string | z.ZodError<object>;\n\toptions: object;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(\n\targs: string[],\n\tmode: Mode,\n\tpromptedOptions: PromptedOptions = {},\n): Promise<OptionsParseResult> {\n\tconst defaults = createOptionDefaults(promptedOptions);\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tif (mode === \"migrate\" && !values.base) {\n\t\tvalues.base = await getBase();\n\t}\n\n\tconst mappedOptions = {\n\t\taccess: values.access,\n\t\tauthor: values.author,\n\t\tauto: !!values.auto,\n\t\tbase: values.base,\n\t\tbin: values.bin,\n\t\tdescription: values.description,\n\t\tdirectory: values.directory,\n\t\temail:\n\t\t\tvalues.email ?? values[\"email-github\"] ?? values[\"email-npm\"]\n\t\t\t\t? {\n\t\t\t\t\t\tgithub: values.email ?? values[\"email-github\"],\n\t\t\t\t\t\tnpm: values.email ?? values[\"email-npm\"],\n\t\t\t\t }\n\t\t\t\t: undefined,\n\t\texcludeAllContributors: values[\"exclude-all-contributors\"],\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeLintDeprecation: values[\"exclude-lint-deprecation\"],\n\t\texcludeLintESLint: values[\"exclude-lint-eslint\"],\n\t\texcludeLintJSDoc: values[\"exclude-lint-jsdoc\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintRegex: values[\"exclude-lint-regex\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintStrict: values[\"exclude-lint-strict\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\tguide: values.guide,\n\t\tlogo: values.logo,\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: async () => options.owner ?? (await defaults.owner()),\n\t\tmessage: \"What organization or user will the repository be under?\",\n\t\tname: \"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: async () =>\n\t\t\toptions.repository ?? (await defaults.repository()),\n\t\tmessage: \"What will the kebab-case name of the repository be?\",\n\t\tname: \"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\toptions.description ??\n\t\t\t(await defaults.description()) ??\n\t\t\t\"A very lovely package. Hooray!\",\n\t\tmessage: \"How would you describe the new package?\",\n\t\tname: \"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\toptions.title ??\n\t\t\t(await defaults.title()) ??\n\t\t\ttitleCase(repository).replaceAll(\"-\", \" \"),\n\t\tmessage: \"What will the Title Case title of the repository be?\",\n\t\tname: \"title\",\n\t});\n\n\toptions.title ??= titleOption.value;\n\n\tif (!options.title) {\n\t\treturn { cancelled: true, error: titleOption.error, options };\n\t}\n\n\tlet guide: OptionsGuide | undefined;\n\n\tif (options.guide) {\n\t\tif (options.guideTitle) {\n\t\t\tguide = { href: options.guide, title: options.guideTitle };\n\t\t} else {\n\t\t\tconst titleOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the title text for the guide?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!titleOption.value) {\n\t\t\t\treturn { cancelled: true, error: titleOption.error, options };\n\t\t\t}\n\n\t\t\tguide = { href: options.guide, title: titleOption.value };\n\t\t}\n\t}\n\n\tlet logo: OptionsLogo | undefined;\n\n\tif (options.logo) {\n\t\tif (options.logoAlt) {\n\t\t\tlogo = { alt: options.logoAlt, src: options.logo };\n\t\t} else {\n\t\t\tconst logoAltOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the alt text (non-visual description) of the logo?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!logoAltOption.value) {\n\t\t\t\treturn { cancelled: true, error: logoAltOption.error, options };\n\t\t\t}\n\n\t\t\tlogo = { alt: logoAltOption.value, src: options.logo };\n\t\t}\n\t}\n\n\tlet email = options.email ?? (await defaults.email());\n\n\tif (!email) {\n\t\tconst emailOption = await getPrefillOrPromptedOption({\n\t\t\tauto: !!mappedOptions.auto,\n\t\t\tmessage: \"What email should be used in package.json and .md files?\",\n\t\t\tname: \"email\",\n\t\t});\n\n\t\tif (!emailOption.value) {\n\t\t\treturn { cancelled: true, error: emailOption.error, options };\n\t\t}\n\n\t\temail = { github: emailOption.value, npm: emailOption.value };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\taccess: options.access ?? \"public\",\n\t\tauthor: options.author ?? (await defaults.owner()),\n\t\tdescription: options.description,\n\t\tdirectory:\n\t\t\toptions.directory ?? promptedOptions.directory ?? options.repository,\n\t\temail,\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\tguide,\n\t\tlogo,\n\t\tmode,\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tif (options.auto) {\n\t\tlogInferredOptions(augmentedOptions);\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAG1B,SAAS,mBAAmB;AAG5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AACvC,SAAS,eAAe;AACxB,SAAiB,iBAAiB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAmB9B,eAAsB,YACrB,MACA,MACA,kBAAmC,CAAC,GACN;AAC9B,QAAM,WAAW,qBAAqB,eAAe;AACrD,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT,CAAC;AAED,MAAI,SAAS,aAAa,CAAC,OAAO,MAAM;AACvC,WAAO,OAAO,MAAM,QAAQ;AAAA,EAC7B;AAEA,QAAM,gBAAgB;AAAA,IACrB,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,IACf,MAAM,CAAC,CAAC,OAAO;AAAA,IACf,MAAM,OAAO;AAAA,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ACD;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"]}
@@ -6,6 +6,6 @@ import '../shared/codes.js';
6
6
  * Creates a replace-in-file replacement for JoshuaKGoldberg/... matches,
7
7
  * keeping repository names not being migrated (e.g. for GitHub actions).
8
8
  */
9
- declare const createJoshuaKGoldbergReplacement: (options: Pick<Options, "owner" | "repository">) => readonly [RegExp, (full: string, capture: string | undefined) => string];
9
+ declare const createJoshuaKGoldbergReplacement: (options: Pick<Options, "owner" | "repository">) => [RegExp, ToCallback];
10
10
 
11
11
  export { createJoshuaKGoldbergReplacement };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/steps/createJoshuaKGoldbergReplacement.ts"],"sourcesContent":["import { Options } from \"../shared/types.js\";\n\n/**\n * Creates a replace-in-file replacement for JoshuaKGoldberg/... matches,\n * keeping repository names not being migrated (e.g. for GitHub actions).\n */\nexport const createJoshuaKGoldbergReplacement = (\n\toptions: Pick<Options, \"owner\" | \"repository\">,\n) =>\n\t[\n\t\t/JoshuaKGoldberg(?:\\/(.+))?/g,\n\t\t(full: string, capture: string | undefined) =>\n\t\t\tcapture\n\t\t\t\t? // If this was a \"JoshuaKGoldberg/...\" repository link,\n\t\t\t\t // swap the owner if it's the repository being migrated.\n\t\t\t\t capture.startsWith(options.repository)\n\t\t\t\t\t? `${options.owner}/${capture}`\n\t\t\t\t\t: full\n\t\t\t\t: // Otherwise it's just \"JoshuaKGoldberg\" standalone,\n\t\t\t\t // so swap to the new owner.\n\t\t\t\t options.owner,\n\t] as const;\n"],"mappings":"AAMO,MAAM,mCAAmC,CAC/C,YAEA;AAAA,EACC;AAAA,EACA,CAAC,MAAc,YACd;AAAA;AAAA;AAAA,IAGG,QAAQ,WAAW,QAAQ,UAAU,IACpC,GAAG,QAAQ,KAAK,IAAI,OAAO,KAC3B;AAAA;AAAA;AAAA;AAAA,IAGD,QAAQ;AAAA;AACb;","names":[]}
1
+ {"version":3,"sources":["../../src/steps/createJoshuaKGoldbergReplacement.ts"],"sourcesContent":["import { Options } from \"../shared/types.js\";\n\n/**\n * Creates a replace-in-file replacement for JoshuaKGoldberg/... matches,\n * keeping repository names not being migrated (e.g. for GitHub actions).\n */\nexport const createJoshuaKGoldbergReplacement = (\n\toptions: Pick<Options, \"owner\" | \"repository\">,\n): [RegExp, ToCallback] => [\n\t/JoshuaKGoldberg(?:\\/(.+))?/g,\n\t(full: string, capture: string | undefined) =>\n\t\tcapture\n\t\t\t? // If this was a \"JoshuaKGoldberg/...\" repository link,\n\t\t\t // swap the owner if it's the repository being migrated.\n\t\t\t capture.startsWith(options.repository)\n\t\t\t\t? `${options.owner}/${capture}`\n\t\t\t\t: full\n\t\t\t: // Otherwise it's just \"JoshuaKGoldberg\" standalone,\n\t\t\t // so swap to the new owner.\n\t\t\t options.owner,\n];\n"],"mappings":"AAMO,MAAM,mCAAmC,CAC/C,YAC0B;AAAA,EAC1B;AAAA,EACA,CAAC,MAAc,YACd;AAAA;AAAA;AAAA,IAGG,QAAQ,WAAW,QAAQ,UAAU,IACpC,GAAG,QAAQ,KAAK,IAAI,OAAO,KAC3B;AAAA;AAAA;AAAA;AAAA,IAGD,QAAQ;AAAA;AACb;","names":[]}
@@ -11,7 +11,6 @@ async function updateLocalFiles(options) {
11
11
  [/create-typescript-app/g, options.repository],
12
12
  [/\/\*\n.+\*\/\n\n/gs, ``, ".eslintrc.cjs"],
13
13
  [/"author": ".+"/g, `"author": "${options.author}"`, "./package.json"],
14
- ...options.mode === "migrate" ? [] : [[/"bin": ".+\n/g, ``, "./package.json"]],
15
14
  [/"test:create": ".+\n/g, ``, "./package.json"],
16
15
  [/"test:initialize": ".*/g, ``, "./package.json"],
17
16
  [/"initialize": ".*/g, ``, "./package.json"],
@@ -38,12 +37,15 @@ async function updateLocalFiles(options) {
38
37
  if (existingPackage.description) {
39
38
  replacements.push([existingPackage.description, options.description]);
40
39
  }
41
- if (options.mode === "initialize" && existingPackage.version) {
42
- replacements.push([
43
- new RegExp(`"version": "${existingPackage.version}"`, "g"),
44
- `"version": "0.0.0"`,
45
- "./package.json"
46
- ]);
40
+ if (options.mode !== "migrate") {
41
+ replacements.push([/"bin": ".+\n/g, ``, "./package.json"]);
42
+ if (options.mode === "initialize" && existingPackage.version) {
43
+ replacements.push([
44
+ new RegExp(`"version": "${existingPackage.version}"`, "g"),
45
+ `"version": "0.0.0"`,
46
+ "./package.json"
47
+ ]);
48
+ }
47
49
  }
48
50
  for (const [from, to, files = ["./.github/**/*", "./*.*"]] of replacements) {
49
51
  try {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/steps/updateLocalFiles.ts"],"sourcesContent":["import replaceInFile from \"replace-in-file\";\n\nimport { readFileSafeAsJson } from \"../shared/readFileSafeAsJson.js\";\nimport { Options } from \"../shared/types.js\";\nimport { createJoshuaKGoldbergReplacement } from \"./createJoshuaKGoldbergReplacement.js\";\nimport { endOfReadmeTemplateLine } from \"./updateReadme.js\";\n\ninterface ExistingPackageData {\n\tdescription?: string;\n\tversion?: string;\n}\n\nexport async function updateLocalFiles(options: Options) {\n\tconst existingPackage = ((await readFileSafeAsJson(\"./package.json\")) ??\n\t\t{}) as ExistingPackageData;\n\n\tconst replacements = [\n\t\t[/Create TypeScript App/g, options.title],\n\t\tcreateJoshuaKGoldbergReplacement(options),\n\t\t[/JoshuaKGoldberg/g, options.owner, \"package.json\"],\n\t\t[/create-typescript-app/g, options.repository],\n\t\t[/\\/\\*\\n.+\\*\\/\\n\\n/gs, ``, \".eslintrc.cjs\"],\n\t\t[/\"author\": \".+\"/g, `\"author\": \"${options.author}\"`, \"./package.json\"],\n\t\t...(options.mode === \"migrate\"\n\t\t\t? []\n\t\t\t: [[/\"bin\": \".+\\n/g, ``, \"./package.json\"]]),\n\t\t[/\"test:create\": \".+\\n/g, ``, \"./package.json\"],\n\t\t[/\"test:initialize\": \".*/g, ``, \"./package.json\"],\n\t\t[/\"initialize\": \".*/g, ``, \"./package.json\"],\n\t\t[/\"test:migrate\": \".+\\n/g, ``, \"./package.json\"],\n\t\t[/## Getting Started.*## Development/gs, `## Development`, \"./README.md\"],\n\t\t[/\\n## Setup Scripts.*$/gs, \"\", \"./.github/DEVELOPMENT.md\"],\n\t\t[`\\t\\t\"src/initialize/index.ts\",\\n`, ``, \"./knip.jsonc\"],\n\t\t[`\\t\\t\"src/migrate/index.ts\",\\n`, ``, \"./knip.jsonc\"],\n\t\t[\n\t\t\t`[\"src/index.ts!\", \"script/initialize*.js\"]`,\n\t\t\t`\"src/index.ts!\"`,\n\t\t\t\"./knip.jsonc\",\n\t\t],\n\t\t[`[\"src/**/*.ts!\", \"script/**/*.js\"]`, `\"src/**/*.ts!\"`, \"./knip.jsonc\"],\n\t\t// Edge case: migration scripts will rewrite README.md attribution\n\t\t[\n\t\t\t/> 💙 This package was templated with .+\\./g,\n\t\t\tendOfReadmeTemplateLine,\n\t\t\t\"./README.md\",\n\t\t],\n\t];\n\n\tif (existingPackage.description) {\n\t\treplacements.push([existingPackage.description, options.description]);\n\t}\n\n\tif (options.mode === \"initialize\" && existingPackage.version) {\n\t\treplacements.push([\n\t\t\tnew RegExp(`\"version\": \"${existingPackage.version}\"`, \"g\"),\n\t\t\t`\"version\": \"0.0.0\"`,\n\t\t\t\"./package.json\",\n\t\t]);\n\t}\n\n\tfor (const [from, to, files = [\"./.github/**/*\", \"./*.*\"]] of replacements) {\n\t\ttry {\n\t\t\t// @ts-expect-error -- https://github.com/microsoft/TypeScript/issues/54342\n\t\t\tawait replaceInFile({\n\t\t\t\tallowEmptyPaths: true,\n\t\t\t\tfiles,\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst toString = typeof to === \"function\" ? \"(function)\" : to;\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to replace ${from.toString()} with ${toString} in ${files.toString()}`,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,QAAQ,SAAS,gBAAgB,gBAAgB,SAAS;AAC7D,iBAAa,KAAK;AAAA,MACjB,IAAI,OAAO,eAAe,gBAAgB,OAAO,KAAK,GAAG;AAAA,MACzD;AAAA,MACA;AAAA,IACD,CAAC;AAAA,EACF;AAEA,aAAW,CAAC,MAAM,IAAI,QAAQ,CAAC,kBAAkB,OAAO,CAAC,KAAK,cAAc;AAC3E,QAAI;AAEH,YAAM,cAAc;AAAA,QACnB,iBAAiB;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAC;AAAA,IACF,SAAS,OAAO;AACf,YAAM,WAAW,OAAO,OAAO,aAAa,eAAe;AAC3D,YAAM,IAAI;AAAA,QACT,qBAAqB,KAAK,SAAS,CAAC,SAAS,QAAQ,OAAO,MAAM,SAAS,CAAC;AAAA,QAC5E;AAAA,UACC,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../src/steps/updateLocalFiles.ts"],"sourcesContent":["import replaceInFile, { From, To } from \"replace-in-file\";\n\nimport { readFileSafeAsJson } from \"../shared/readFileSafeAsJson.js\";\nimport { Options } from \"../shared/types.js\";\nimport { createJoshuaKGoldbergReplacement } from \"./createJoshuaKGoldbergReplacement.js\";\nimport { endOfReadmeTemplateLine } from \"./updateReadme.js\";\n\ninterface ExistingPackageData {\n\tdescription?: string;\n\tversion?: string;\n}\n\nexport async function updateLocalFiles(options: Options) {\n\tconst existingPackage = ((await readFileSafeAsJson(\"./package.json\")) ??\n\t\t{}) as ExistingPackageData;\n\n\tconst replacements: [From, To, (string | string[])?][] = [\n\t\t[/Create TypeScript App/g, options.title],\n\t\tcreateJoshuaKGoldbergReplacement(options),\n\t\t[/JoshuaKGoldberg/g, options.owner, \"package.json\"],\n\t\t[/create-typescript-app/g, options.repository],\n\t\t[/\\/\\*\\n.+\\*\\/\\n\\n/gs, ``, \".eslintrc.cjs\"],\n\t\t[/\"author\": \".+\"/g, `\"author\": \"${options.author}\"`, \"./package.json\"],\n\t\t[/\"test:create\": \".+\\n/g, ``, \"./package.json\"],\n\t\t[/\"test:initialize\": \".*/g, ``, \"./package.json\"],\n\t\t[/\"initialize\": \".*/g, ``, \"./package.json\"],\n\t\t[/\"test:migrate\": \".+\\n/g, ``, \"./package.json\"],\n\t\t[/## Getting Started.*## Development/gs, `## Development`, \"./README.md\"],\n\t\t[/\\n## Setup Scripts.*$/gs, \"\", \"./.github/DEVELOPMENT.md\"],\n\t\t[`\\t\\t\"src/initialize/index.ts\",\\n`, ``, \"./knip.jsonc\"],\n\t\t[`\\t\\t\"src/migrate/index.ts\",\\n`, ``, \"./knip.jsonc\"],\n\t\t[\n\t\t\t`[\"src/index.ts!\", \"script/initialize*.js\"]`,\n\t\t\t`\"src/index.ts!\"`,\n\t\t\t\"./knip.jsonc\",\n\t\t],\n\t\t[`[\"src/**/*.ts!\", \"script/**/*.js\"]`, `\"src/**/*.ts!\"`, \"./knip.jsonc\"],\n\t\t// Edge case: migration scripts will rewrite README.md attribution\n\t\t[\n\t\t\t/> 💙 This package was templated with .+\\./g,\n\t\t\tendOfReadmeTemplateLine,\n\t\t\t\"./README.md\",\n\t\t],\n\t];\n\n\tif (existingPackage.description) {\n\t\treplacements.push([existingPackage.description, options.description]);\n\t}\n\n\tif (options.mode !== \"migrate\") {\n\t\treplacements.push([/\"bin\": \".+\\n/g, ``, \"./package.json\"]);\n\n\t\tif (options.mode === \"initialize\" && existingPackage.version) {\n\t\t\treplacements.push([\n\t\t\t\tnew RegExp(`\"version\": \"${existingPackage.version}\"`, \"g\"),\n\t\t\t\t`\"version\": \"0.0.0\"`,\n\t\t\t\t\"./package.json\",\n\t\t\t]);\n\t\t}\n\t}\n\n\tfor (const [from, to, files = [\"./.github/**/*\", \"./*.*\"]] of replacements) {\n\t\ttry {\n\t\t\tawait replaceInFile({\n\t\t\t\tallowEmptyPaths: true,\n\t\t\t\tfiles,\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst toString = typeof to === \"function\" ? \"(function)\" : to;\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to replace ${from.toString()} with ${toString} in ${files.toString()}`,\n\t\t\t\t{\n\t\t\t\t\tcause: error,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n}\n"],"mappings":"AAAA,OAAO,mBAAiC;AAExC,SAAS,0BAA0B;AAEnC,SAAS,wCAAwC;AACjD,SAAS,+BAA+B;AAOxC,eAAsB,iBAAiB,SAAkB;AACxD,QAAM,kBAAoB,MAAM,mBAAmB,gBAAgB,KAClE,CAAC;AAEF,QAAM,eAAmD;AAAA,IACxD,CAAC,0BAA0B,QAAQ,KAAK;AAAA,IACxC,iCAAiC,OAAO;AAAA,IACxC,CAAC,oBAAoB,QAAQ,OAAO,cAAc;AAAA,IAClD,CAAC,0BAA0B,QAAQ,UAAU;AAAA,IAC7C,CAAC,sBAAsB,IAAI,eAAe;AAAA,IAC1C,CAAC,mBAAmB,cAAc,QAAQ,MAAM,KAAK,gBAAgB;AAAA,IACrE,CAAC,yBAAyB,IAAI,gBAAgB;AAAA,IAC9C,CAAC,2BAA2B,IAAI,gBAAgB;AAAA,IAChD,CAAC,sBAAsB,IAAI,gBAAgB;AAAA,IAC3C,CAAC,0BAA0B,IAAI,gBAAgB;AAAA,IAC/C,CAAC,wCAAwC,kBAAkB,aAAa;AAAA,IACxE,CAAC,2BAA2B,IAAI,0BAA0B;AAAA,IAC1D,CAAC;AAAA,GAAoC,IAAI,cAAc;AAAA,IACvD,CAAC;AAAA,GAAiC,IAAI,cAAc;AAAA,IACpD;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,CAAC,sCAAsC,kBAAkB,cAAc;AAAA;AAAA,IAEvE;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAEA,MAAI,gBAAgB,aAAa;AAChC,iBAAa,KAAK,CAAC,gBAAgB,aAAa,QAAQ,WAAW,CAAC;AAAA,EACrE;AAEA,MAAI,QAAQ,SAAS,WAAW;AAC/B,iBAAa,KAAK,CAAC,iBAAiB,IAAI,gBAAgB,CAAC;AAEzD,QAAI,QAAQ,SAAS,gBAAgB,gBAAgB,SAAS;AAC7D,mBAAa,KAAK;AAAA,QACjB,IAAI,OAAO,eAAe,gBAAgB,OAAO,KAAK,GAAG;AAAA,QACzD;AAAA,QACA;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AAEA,aAAW,CAAC,MAAM,IAAI,QAAQ,CAAC,kBAAkB,OAAO,CAAC,KAAK,cAAc;AAC3E,QAAI;AACH,YAAM,cAAc;AAAA,QACnB,iBAAiB;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAC;AAAA,IACF,SAAS,OAAO;AACf,YAAM,WAAW,OAAO,OAAO,aAAa,eAAe;AAC3D,YAAM,IAAI;AAAA,QACT,qBAAqB,KAAK,SAAS,CAAC,SAAS,QAAQ,OAAO,MAAM,SAAS,CAAC;AAAA,QAC5E;AAAA,UACC,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-typescript-app",
3
- "version": "1.49.1",
3
+ "version": "1.49.2",
4
4
  "description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,67 +44,67 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@clack/prompts": "^0.7.0",
47
- "all-contributors-for-repository": "^0.2.0",
47
+ "all-contributors-for-repository": "^0.2.1",
48
48
  "chalk": "^5.3.0",
49
49
  "execa": "^8.0.1",
50
50
  "git-remote-origin-url": "^4.0.0",
51
- "git-url-parse": "^13.1.0",
51
+ "git-url-parse": "^13.1.1",
52
52
  "js-yaml": "^4.1.0",
53
53
  "lazy-value": "^3.0.0",
54
54
  "npm-user": "^5.0.1",
55
- "octokit": "^3.1.0",
55
+ "octokit": "^3.1.2",
56
56
  "parse-author": "^2.0.0",
57
- "prettier": "^3.0.2",
58
- "replace-in-file": "^7.0.1",
59
- "title-case": "^4.0.0",
60
- "zod": "^3.22.2",
61
- "zod-validation-error": "^2.0.0"
57
+ "prettier": "^3.1.0",
58
+ "replace-in-file": "^7.0.2",
59
+ "title-case": "^4.1.2",
60
+ "zod": "^3.22.4",
61
+ "zod-validation-error": "^2.1.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@octokit/request-error": "^5.0.0",
65
- "@release-it/conventional-changelog": "^8.0.0",
66
- "@types/eslint": "^8.44.2",
67
- "@types/git-url-parse": "^9.0.1",
68
- "@types/js-yaml": "^4.0.5",
69
- "@types/node": "^20.5.6",
70
- "@types/parse-author": "^2.0.1",
64
+ "@octokit/request-error": "^5.0.1",
65
+ "@release-it/conventional-changelog": "^8.0.1",
66
+ "@types/eslint": "^8.44.8",
67
+ "@types/git-url-parse": "^9.0.3",
68
+ "@types/js-yaml": "^4.0.9",
69
+ "@types/node": "^20.10.4",
70
+ "@types/parse-author": "^2.0.3",
71
71
  "@types/prettier": "^2.7.3",
72
- "@typescript-eslint/eslint-plugin": "^6.5.0",
73
- "@typescript-eslint/parser": "^6.5.0",
74
- "@vitest/coverage-v8": "^0.34.3",
72
+ "@typescript-eslint/eslint-plugin": "^6.13.2",
73
+ "@typescript-eslint/parser": "^6.13.2",
74
+ "@vitest/coverage-v8": "^1.0.2",
75
75
  "c8": "^8.0.1",
76
76
  "console-fail-test": "^0.2.3",
77
- "cspell": "^8.0.0",
78
- "eslint": "^8.48.0",
77
+ "cspell": "^8.1.3",
78
+ "eslint": "^8.55.0",
79
79
  "eslint-plugin-deprecation": "^2.0.0",
80
80
  "eslint-plugin-eslint-comments": "^3.2.0",
81
- "eslint-plugin-jsdoc": "^46.5.0",
82
- "eslint-plugin-jsonc": "^2.9.0",
81
+ "eslint-plugin-jsdoc": "^46.9.0",
82
+ "eslint-plugin-jsonc": "^2.10.0",
83
83
  "eslint-plugin-markdown": "^3.0.1",
84
- "eslint-plugin-n": "^16.0.2",
84
+ "eslint-plugin-n": "^16.3.1",
85
85
  "eslint-plugin-no-only-tests": "^3.1.0",
86
- "eslint-plugin-perfectionist": "^2.0.0",
87
- "eslint-plugin-regexp": "^2.0.0",
88
- "eslint-plugin-vitest": "^0.3.0",
89
- "eslint-plugin-yml": "^1.8.0",
86
+ "eslint-plugin-perfectionist": "^2.5.0",
87
+ "eslint-plugin-regexp": "^2.1.2",
88
+ "eslint-plugin-vitest": "^0.3.10",
89
+ "eslint-plugin-yml": "^1.10.0",
90
90
  "globby": "^14.0.0",
91
91
  "husky": "^8.0.3",
92
- "jsonc-eslint-parser": "^2.3.0",
93
- "knip": "3.4.0",
94
- "lint-staged": "^15.0.0",
95
- "markdownlint": "^0.32.0",
92
+ "jsonc-eslint-parser": "^2.4.0",
93
+ "knip": "3.6.0",
94
+ "lint-staged": "^15.2.0",
95
+ "markdownlint": "^0.32.1",
96
96
  "markdownlint-cli": "^0.37.0",
97
- "npm-package-json-lint": "^7.0.0",
97
+ "npm-package-json-lint": "^7.1.0",
98
98
  "npm-package-json-lint-config-default": "^6.0.0",
99
- "prettier-plugin-curly": "^0.1.2",
100
- "prettier-plugin-packagejson": "^2.4.5",
99
+ "prettier-plugin-curly": "^0.1.3",
100
+ "prettier-plugin-packagejson": "^2.4.7",
101
101
  "release-it": "^17.0.0",
102
102
  "sentences-per-line": "^0.2.1",
103
- "should-semantic-release": "^0.2.0",
104
- "tsup": "^8.0.0",
105
- "tsx": "^4.0.0",
106
- "typescript": "^5.1.6",
107
- "vitest": "^0.34.3",
103
+ "should-semantic-release": "^0.2.1",
104
+ "tsup": "^8.0.1",
105
+ "tsx": "^4.6.2",
106
+ "typescript": "^5.3.3",
107
+ "vitest": "^1.0.2",
108
108
  "yaml-eslint-parser": "^1.2.2"
109
109
  },
110
110
  "packageManager": "pnpm@8.11.0",