create-typescript-app 1.65.0 → 1.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/create/createRerunSuggestion.js.map +1 -1
- package/lib/create/index.js.map +1 -1
- package/lib/shared/options/createOptionDefaults/index.js.map +1 -1
- package/lib/shared/options/ensureRepositoryExists.js.map +1 -1
- package/lib/shared/options/optionsSchema.d.ts +2 -2
- package/lib/shared/options/readOptions.js.map +1 -1
- package/lib/steps/addOwnerAsAllContributor.js.map +1 -1
- package/lib/steps/clearUnnecessaryFiles.js +1 -0
- package/lib/steps/clearUnnecessaryFiles.js.map +1 -1
- package/lib/steps/createJoshuaKGoldbergReplacement.js.map +1 -1
- package/lib/steps/finalizeDependencies.js.map +1 -1
- package/lib/steps/updateLocalFiles.js +1 -1
- package/lib/steps/updateLocalFiles.js.map +1 -1
- package/lib/steps/writing/creation/createESLintConfig.js +5 -0
- package/lib/steps/writing/creation/createESLintConfig.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDevelopment/index.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js.map +1 -1
- package/lib/steps/writing/creation/dotHusky.js +1 -5
- package/lib/steps/writing/creation/dotHusky.js.map +1 -1
- package/lib/steps/writing/creation/dotVSCode.js.map +1 -1
- package/lib/steps/writing/creation/writePackageJson.js +3 -1
- package/lib/steps/writing/creation/writePackageJson.js.map +1 -1
- package/package.json +40 -40
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { allArgOptions } from \"../shared/options/args.js\";\nimport {\n\tExclusionKey,\n\tgetExclusions,\n} from \"../shared/options/exclusionKeys.js\";\nimport { Options } from \"../shared/types.js\";\n\nfunction getFirstMatchingArg(key: string) {\n\treturn Object.keys(allArgOptions).find(\n\t\t(arg) => arg.replaceAll(\"-\", \"\") === key.toLowerCase(),\n\t);\n}\n\nconst defaultValues = new Map([[\"access\", \"public\"]]);\n\nexport function createRerunSuggestion(options: Partial<Options>): string {\n\tconst optionsNormalized = {\n\t\t...options,\n\t\temail: undefined,\n\t\t...(options.email && {\n\t\t\temailGitHub: options.email.github,\n\t\t\temailNpm: options.email.npm,\n\t\t}),\n\t\t...(options.guide\n\t\t\t? {\n\t\t\t\t\tguide: options.guide.href,\n\t\t\t\t\tguideTitle: options.guide.title,\n\t\t\t
|
|
1
|
+
{"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { allArgOptions } from \"../shared/options/args.js\";\nimport {\n\tExclusionKey,\n\tgetExclusions,\n} from \"../shared/options/exclusionKeys.js\";\nimport { Options } from \"../shared/types.js\";\n\nfunction getFirstMatchingArg(key: string) {\n\treturn Object.keys(allArgOptions).find(\n\t\t(arg) => arg.replaceAll(\"-\", \"\") === key.toLowerCase(),\n\t);\n}\n\nconst defaultValues = new Map([[\"access\", \"public\"]]);\n\nexport function createRerunSuggestion(options: Partial<Options>): string {\n\tconst optionsNormalized = {\n\t\t...options,\n\t\temail: undefined,\n\t\t...(options.email && {\n\t\t\temailGitHub: options.email.github,\n\t\t\temailNpm: options.email.npm,\n\t\t}),\n\t\t...(options.guide\n\t\t\t? {\n\t\t\t\t\tguide: options.guide.href,\n\t\t\t\t\tguideTitle: options.guide.title,\n\t\t\t\t}\n\t\t\t: { guide: undefined }),\n\t\t...(options.logo\n\t\t\t? {\n\t\t\t\t\tlogo: options.logo.src,\n\t\t\t\t\tlogoAlt: options.logo.alt,\n\t\t\t\t}\n\t\t\t: { logo: undefined }),\n\t\t...(options.offline && {\n\t\t\tskipAllContributorsApi: undefined,\n\t\t\tskipGitHubApi: undefined,\n\t\t}),\n\t};\n\n\tconst args = Object.entries(optionsNormalized)\n\t\t// Sort so the base is first, then the rest are sorted alphabetically\n\t\t.sort(([a], [b]) =>\n\t\t\ta === \"base\" ? -1 : b === \"base\" ? 1 : a.localeCompare(b),\n\t\t)\n\t\t// Filter out entries with an excluded key or a default or falsy value\n\t\t.filter(\n\t\t\t([key, value]) =>\n\t\t\t\tgetExclusions(options, optionsNormalized.base)[key as ExclusionKey] ==\n\t\t\t\t\tundefined &&\n\t\t\t\t!!value &&\n\t\t\t\tvalue !== defaultValues.get(key),\n\t\t)\n\t\t.map(([key, value]) => {\n\t\t\treturn `--${getFirstMatchingArg(key)}${stringifyValue(value)}`;\n\t\t})\n\t\t.join(\" \");\n\n\treturn [\"npx create-typescript-app\", args].filter(Boolean).join(\" \");\n}\n\nfunction stringifyValue(\n\tvalue: boolean | string | string[] | undefined,\n): string {\n\tif (Array.isArray(value)) {\n\t\treturn stringifyValue(value.join(\" \"));\n\t}\n\n\tif (typeof value === \"boolean\" && value) {\n\t\treturn \"\";\n\t}\n\n\tconst valueStringified = `${value}`;\n\n\treturn valueStringified.includes(\" \")\n\t\t? ` \"${valueStringified}\"`\n\t\t: ` ${valueStringified}`;\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAC9B;AAAA,EAEC;AAAA,OACM;AAGP,SAAS,oBAAoB,KAAa;AACzC,SAAO,OAAO,KAAK,aAAa,EAAE;AAAA,IACjC,CAAC,QAAQ,IAAI,WAAW,KAAK,EAAE,MAAM,IAAI,YAAY;AAAA,EACtD;AACD;AAEA,MAAM,gBAAgB,oBAAI,IAAI,CAAC,CAAC,UAAU,QAAQ,CAAC,CAAC;AAE7C,SAAS,sBAAsB,SAAmC;AACxE,QAAM,oBAAoB;AAAA,IACzB,GAAG;AAAA,IACH,OAAO;AAAA,IACP,GAAI,QAAQ,SAAS;AAAA,MACpB,aAAa,QAAQ,MAAM;AAAA,MAC3B,UAAU,QAAQ,MAAM;AAAA,IACzB;AAAA,IACA,GAAI,QAAQ,QACT;AAAA,MACA,OAAO,QAAQ,MAAM;AAAA,MACrB,YAAY,QAAQ,MAAM;AAAA,IAC3B,IACC,EAAE,OAAO,OAAU;AAAA,IACtB,GAAI,QAAQ,OACT;AAAA,MACA,MAAM,QAAQ,KAAK;AAAA,MACnB,SAAS,QAAQ,KAAK;AAAA,IACvB,IACC,EAAE,MAAM,OAAU;AAAA,IACrB,GAAI,QAAQ,WAAW;AAAA,MACtB,wBAAwB;AAAA,MACxB,eAAe;AAAA,IAChB;AAAA,EACD;AAEA,QAAM,OAAO,OAAO,QAAQ,iBAAiB,EAE3C;AAAA,IAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MACb,MAAM,SAAS,KAAK,MAAM,SAAS,IAAI,EAAE,cAAc,CAAC;AAAA,EACzD,EAEC;AAAA,IACA,CAAC,CAAC,KAAK,KAAK,MACX,cAAc,SAAS,kBAAkB,IAAI,EAAE,GAAmB,KACjE,UACD,CAAC,CAAC,SACF,UAAU,cAAc,IAAI,GAAG;AAAA,EACjC,EACC,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AACtB,WAAO,KAAK,oBAAoB,GAAG,CAAC,GAAG,eAAe,KAAK,CAAC;AAAA,EAC7D,CAAC,EACA,KAAK,GAAG;AAEV,SAAO,CAAC,6BAA6B,IAAI,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AACpE;AAEA,SAAS,eACR,OACS;AACT,MAAI,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAO,eAAe,MAAM,KAAK,GAAG,CAAC;AAAA,EACtC;AAEA,MAAI,OAAO,UAAU,aAAa,OAAO;AACxC,WAAO;AAAA,EACR;AAEA,QAAM,mBAAmB,GAAG,KAAK;AAEjC,SAAO,iBAAiB,SAAS,GAAG,IACjC,KAAK,gBAAgB,MACrB,IAAI,gBAAgB;AACxB;","names":[]}
|
package/lib/create/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/create/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { generateNextSteps } from \"../shared/generateNextSteps.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { ModeRunner } from \"../shared/types.js\";\nimport { createAndEnterGitDirectory } from \"./createAndEnterGitDirectory.js\";\nimport { createRerunSuggestion } from \"./createRerunSuggestion.js\";\nimport { createWithOptions } from \"./createWithOptions.js\";\n\nexport const create: ModeRunner = async (args, promptedOptions) => {\n\tconst inputs = await readOptions(args, \"create\", promptedOptions);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\terror: inputs.error,\n\t\t\toptions: inputs.options,\n\t\t};\n\t}\n\n\tif (!(await createAndEnterGitDirectory(inputs.options.directory))) {\n\t\tprompts.outro(\n\t\t\tchalk.red(\n\t\t\t\t`The ${inputs.options.directory} directory already exists and is not empty. Please clear the directory, run with --mode initialize, or try a different directory.`,\n\t\t\t),\n\t\t);\n\t\treturn { code: StatusCodes.Failure, options: inputs.options };\n\t}\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tconst { sentToGitHub } = await createWithOptions(inputs);\n\t\t\t\tconst nextSteps = generateNextSteps(inputs.options);\n\n\t\t\t\toutro(\n\t\t\t\t\tsentToGitHub\n\t\t\t\t\t\t? nextSteps\n\t\t\t\t\t\t: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"Consider creating a GitHub repository from the new directory:\",\n\t\t\t\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t\t\t\t`cd ${inputs.options.repository}`,\n\t\t\t\t\t\t\t\t\t\tcreateRerunSuggestion({\n\t\t\t\t\t\t\t\t\t\t\t...inputs.options,\n\t\t\t\t\t\t\t\t\t\t\tmode: \"initialize\",\n\t\t\t\t\t\t\t\t\t\t\tskipGitHubApi: false,\n\t\t\t\t\t\t\t\t\t\t\tskipInstall: false,\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t\t\t\t`git commit -m \"feat: initial commit ✨\"`,\n\t\t\t\t\t\t\t\t\t\t`git push -u origin main`,\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\tvariant: \"code\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t...nextSteps,\n\t\t\t\t\t\t
|
|
1
|
+
{"version":3,"sources":["../../src/create/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { generateNextSteps } from \"../shared/generateNextSteps.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { ModeRunner } from \"../shared/types.js\";\nimport { createAndEnterGitDirectory } from \"./createAndEnterGitDirectory.js\";\nimport { createRerunSuggestion } from \"./createRerunSuggestion.js\";\nimport { createWithOptions } from \"./createWithOptions.js\";\n\nexport const create: ModeRunner = async (args, promptedOptions) => {\n\tconst inputs = await readOptions(args, \"create\", promptedOptions);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\terror: inputs.error,\n\t\t\toptions: inputs.options,\n\t\t};\n\t}\n\n\tif (!(await createAndEnterGitDirectory(inputs.options.directory))) {\n\t\tprompts.outro(\n\t\t\tchalk.red(\n\t\t\t\t`The ${inputs.options.directory} directory already exists and is not empty. Please clear the directory, run with --mode initialize, or try a different directory.`,\n\t\t\t),\n\t\t);\n\t\treturn { code: StatusCodes.Failure, options: inputs.options };\n\t}\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tconst { sentToGitHub } = await createWithOptions(inputs);\n\t\t\t\tconst nextSteps = generateNextSteps(inputs.options);\n\n\t\t\t\toutro(\n\t\t\t\t\tsentToGitHub\n\t\t\t\t\t\t? nextSteps\n\t\t\t\t\t\t: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"Consider creating a GitHub repository from the new directory:\",\n\t\t\t\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t\t\t\t`cd ${inputs.options.repository}`,\n\t\t\t\t\t\t\t\t\t\tcreateRerunSuggestion({\n\t\t\t\t\t\t\t\t\t\t\t...inputs.options,\n\t\t\t\t\t\t\t\t\t\t\tmode: \"initialize\",\n\t\t\t\t\t\t\t\t\t\t\tskipGitHubApi: false,\n\t\t\t\t\t\t\t\t\t\t\tskipInstall: false,\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t\t\t\t`git commit -m \"feat: initial commit ✨\"`,\n\t\t\t\t\t\t\t\t\t\t`git push -u origin main`,\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\tvariant: \"code\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t...nextSteps,\n\t\t\t\t\t\t\t],\n\t\t\t\t);\n\t\t\t},\n\t\t\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n};\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAElB,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAE7B,SAAS,kCAAkC;AAC3C,SAAS,6BAA6B;AACtC,SAAS,yBAAyB;AAE3B,MAAM,SAAqB,OAAO,MAAM,oBAAoB;AAClE,QAAM,SAAS,MAAM,YAAY,MAAM,UAAU,eAAe;AAChE,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,OAAO,OAAO;AAAA,MACd,SAAS,OAAO;AAAA,IACjB;AAAA,EACD;AAEA,MAAI,CAAE,MAAM,2BAA2B,OAAO,QAAQ,SAAS,GAAI;AAClE,YAAQ;AAAA,MACP,MAAM;AAAA,QACL,OAAO,OAAO,QAAQ,SAAS;AAAA,MAChC;AAAA,IACD;AACA,WAAO,EAAE,MAAM,YAAY,SAAS,SAAS,OAAO,QAAQ;AAAA,EAC7D;AAEA,SAAO;AAAA,IACN,MAAM,MAAM,aAAa;AAAA,MACxB,KAAK,YAAY;AAChB,cAAM,EAAE,aAAa,IAAI,MAAM,kBAAkB,MAAM;AACvD,cAAM,YAAY,kBAAkB,OAAO,OAAO;AAElD;AAAA,UACC,eACG,YACA;AAAA,YACA;AAAA,cACC,OACC;AAAA,cACD,OAAO;AAAA,gBACN,MAAM,OAAO,QAAQ,UAAU;AAAA,gBAC/B,sBAAsB;AAAA,kBACrB,GAAG,OAAO;AAAA,kBACV,MAAM;AAAA,kBACN,eAAe;AAAA,kBACf,aAAa;AAAA,gBACd,CAAC;AAAA,gBACD;AAAA,gBACA;AAAA,gBACA;AAAA,cACD;AAAA,cACA,SAAS;AAAA,YACV;AAAA,YACA,GAAG;AAAA,UACJ;AAAA,QACH;AAAA,MACD;AAAA,MACA,aAAa,OAAO,QAAQ;AAAA,IAC7B,CAAC;AAAA,IACD,SAAS,OAAO;AAAA,EACjB;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shared/options/createOptionDefaults/index.ts"],"sourcesContent":["import { $ } from \"execa\";\nimport gitRemoteOriginUrl from \"git-remote-origin-url\";\nimport gitUrlParse from \"git-url-parse\";\nimport lazyValue from \"lazy-value\";\nimport * as fs from \"node:fs/promises\";\nimport npmUser from \"npm-user\";\n\nimport { readPackageData } from \"../../packages.js\";\nimport { tryCatchAsync } from \"../../tryCatchAsync.js\";\nimport { tryCatchLazyValueAsync } from \"../../tryCatchLazyValueAsync.js\";\nimport { PromptedOptions } from \"../../types.js\";\nimport { parsePackageAuthor } from \"./parsePackageAuthor.js\";\nimport { readDefaultsFromDevelopment } from \"./readDefaultsFromDevelopment.js\";\nimport { readDefaultsFromReadme } from \"./readDefaultsFromReadme.js\";\n\nexport function createOptionDefaults(promptedOptions?: PromptedOptions) {\n\tconst gitDefaults = tryCatchLazyValueAsync(async () =>\n\t\tgitUrlParse(await gitRemoteOriginUrl()),\n\t);\n\n\tconst npmDefaults = tryCatchLazyValueAsync(async () => {\n\t\tconst whoami = (await $`npm whoami`).stdout;\n\t\treturn whoami ? await npmUser(whoami) : undefined;\n\t});\n\n\tconst packageData = lazyValue(readPackageData);\n\tconst packageAuthor = lazyValue(async () =>\n\t\tparsePackageAuthor(await packageData()),\n\t);\n\n\treturn {\n\t\tauthor: async () => (await packageAuthor()).author ?? npmDefaults.name,\n\t\tbin: async () => (await packageData()).bin,\n\t\tdescription: async () => (await packageData()).description,\n\t\temail: async () => {\n\t\t\tconst gitEmail = await tryCatchAsync(\n\t\t\t\tasync () => (await $`git config --get user.email`).stdout,\n\t\t\t);\n\t\t\tconst npmEmail =\n\t\t\t\t(await npmDefaults())?.email ?? (await packageAuthor()).email;\n\n\t\t\t/* eslint-disable @typescript-eslint/no-non-null-assertion */\n\t\t\treturn gitEmail || npmEmail\n\t\t\t\t? { github: (gitEmail || npmEmail)!, npm: (npmEmail || gitEmail)! }\n\t\t\t\t: undefined;\n\t\t\t/* eslint-enable @typescript-eslint/no-non-null-assertion */\n\t\t},\n\t\tfunding: async () =>\n\t\t\tawait tryCatchAsync(
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/options/createOptionDefaults/index.ts"],"sourcesContent":["import { $ } from \"execa\";\nimport gitRemoteOriginUrl from \"git-remote-origin-url\";\nimport gitUrlParse from \"git-url-parse\";\nimport lazyValue from \"lazy-value\";\nimport * as fs from \"node:fs/promises\";\nimport npmUser from \"npm-user\";\n\nimport { readPackageData } from \"../../packages.js\";\nimport { tryCatchAsync } from \"../../tryCatchAsync.js\";\nimport { tryCatchLazyValueAsync } from \"../../tryCatchLazyValueAsync.js\";\nimport { PromptedOptions } from \"../../types.js\";\nimport { parsePackageAuthor } from \"./parsePackageAuthor.js\";\nimport { readDefaultsFromDevelopment } from \"./readDefaultsFromDevelopment.js\";\nimport { readDefaultsFromReadme } from \"./readDefaultsFromReadme.js\";\n\nexport function createOptionDefaults(promptedOptions?: PromptedOptions) {\n\tconst gitDefaults = tryCatchLazyValueAsync(async () =>\n\t\tgitUrlParse(await gitRemoteOriginUrl()),\n\t);\n\n\tconst npmDefaults = tryCatchLazyValueAsync(async () => {\n\t\tconst whoami = (await $`npm whoami`).stdout;\n\t\treturn whoami ? await npmUser(whoami) : undefined;\n\t});\n\n\tconst packageData = lazyValue(readPackageData);\n\tconst packageAuthor = lazyValue(async () =>\n\t\tparsePackageAuthor(await packageData()),\n\t);\n\n\treturn {\n\t\tauthor: async () => (await packageAuthor()).author ?? npmDefaults.name,\n\t\tbin: async () => (await packageData()).bin,\n\t\tdescription: async () => (await packageData()).description,\n\t\temail: async () => {\n\t\t\tconst gitEmail = await tryCatchAsync(\n\t\t\t\tasync () => (await $`git config --get user.email`).stdout,\n\t\t\t);\n\t\t\tconst npmEmail =\n\t\t\t\t(await npmDefaults())?.email ?? (await packageAuthor()).email;\n\n\t\t\t/* eslint-disable @typescript-eslint/no-non-null-assertion */\n\t\t\treturn gitEmail || npmEmail\n\t\t\t\t? { github: (gitEmail || npmEmail)!, npm: (npmEmail || gitEmail)! }\n\t\t\t\t: undefined;\n\t\t\t/* eslint-enable @typescript-eslint/no-non-null-assertion */\n\t\t},\n\t\tfunding: async () =>\n\t\t\tawait tryCatchAsync(async () =>\n\t\t\t\t(await fs.readFile(\".github/FUNDING.yml\"))\n\t\t\t\t\t.toString()\n\t\t\t\t\t.split(\":\")[1]\n\t\t\t\t\t?.trim(),\n\t\t\t),\n\t\towner: async () =>\n\t\t\t(await gitDefaults())?.organization ?? (await packageAuthor()).author,\n\t\trepository: async () =>\n\t\t\tpromptedOptions?.repository ??\n\t\t\t(await gitDefaults())?.name ??\n\t\t\t(await packageData()).name,\n\t\t...readDefaultsFromDevelopment(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YAAY,YACX,iBAAiB,eAChB,MAAM,YAAY,IAAI,SACtB,MAAM,YAAY,GAAG;AAAA,IACvB,GAAG,4BAA4B;AAAA,IAC/B,GAAG,uBAAuB;AAAA,EAC3B;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/options/ensureRepositoryExists.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { doesRepositoryExist } from \"../doesRepositoryExist.js\";\nimport { filterPromptCancel } from \"../prompts.js\";\nimport { Options } from \"../types.js\";\nimport { createRepositoryWithApi } from \"./createRepositoryWithApi.js\";\nimport { GitHub } from \"./getGitHub.js\";\n\nexport type EnsureRepositoryExistsOptions = Pick<\n\tOptions,\n\t\"mode\" | \"owner\" | \"preserveGeneratedFrom\" | \"repository\"\n>;\n\nexport interface RepositoryExistsResult {\n\tgithub: GitHub | undefined;\n\trepository: string;\n}\n\nexport async function ensureRepositoryExists(\n\tgithub: GitHub | undefined,\n\toptions: EnsureRepositoryExistsOptions,\n): Promise<Partial<RepositoryExistsResult>> {\n\t// We'll only respect input options once before prompting for them\n\tlet { repository } = options;\n\tlet createRepository = options.mode === \"create\";\n\n\t// We'll continuously pester the user for a repository\n\t// until they bail, create a new one, or it exists.\n\twhile (github) {\n\t\tif (await doesRepositoryExist(github.octokit, options)) {\n\t\t\treturn { github, repository };\n\t\t}\n\n\t\tconst selection = createRepository\n\t\t\t? \"create\"\n\t\t\t: filterPromptCancel(\n\t\t\t\t\t(await prompts.select({\n\t\t\t\t\t\tmessage: `Repository ${options.repository} doesn't seem to exist under ${options.owner}. What would you like to do?`,\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{ label: \"Create a new repository\", value: \"create\" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: \"Switch to a different repository name\",\n\t\t\t\t\t\t\t\tvalue: \"different\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: \"Keep changes local\",\n\t\t\t\t\t\t\t\tvalue: \"local\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ label: \"Bail out and maybe try again later\", value: \"bail\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t})) as \"bail\" | \"create\" | \"different\" | \"local\",\n\t\t\t
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/options/ensureRepositoryExists.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { doesRepositoryExist } from \"../doesRepositoryExist.js\";\nimport { filterPromptCancel } from \"../prompts.js\";\nimport { Options } from \"../types.js\";\nimport { createRepositoryWithApi } from \"./createRepositoryWithApi.js\";\nimport { GitHub } from \"./getGitHub.js\";\n\nexport type EnsureRepositoryExistsOptions = Pick<\n\tOptions,\n\t\"mode\" | \"owner\" | \"preserveGeneratedFrom\" | \"repository\"\n>;\n\nexport interface RepositoryExistsResult {\n\tgithub: GitHub | undefined;\n\trepository: string;\n}\n\nexport async function ensureRepositoryExists(\n\tgithub: GitHub | undefined,\n\toptions: EnsureRepositoryExistsOptions,\n): Promise<Partial<RepositoryExistsResult>> {\n\t// We'll only respect input options once before prompting for them\n\tlet { repository } = options;\n\tlet createRepository = options.mode === \"create\";\n\n\t// We'll continuously pester the user for a repository\n\t// until they bail, create a new one, or it exists.\n\twhile (github) {\n\t\tif (await doesRepositoryExist(github.octokit, options)) {\n\t\t\treturn { github, repository };\n\t\t}\n\n\t\tconst selection = createRepository\n\t\t\t? \"create\"\n\t\t\t: filterPromptCancel(\n\t\t\t\t\t(await prompts.select({\n\t\t\t\t\t\tmessage: `Repository ${options.repository} doesn't seem to exist under ${options.owner}. What would you like to do?`,\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{ label: \"Create a new repository\", value: \"create\" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: \"Switch to a different repository name\",\n\t\t\t\t\t\t\t\tvalue: \"different\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: \"Keep changes local\",\n\t\t\t\t\t\t\t\tvalue: \"local\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ label: \"Bail out and maybe try again later\", value: \"bail\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t})) as \"bail\" | \"create\" | \"different\" | \"local\",\n\t\t\t\t);\n\n\t\tcreateRepository = false;\n\n\t\tswitch (selection) {\n\t\t\tcase undefined:\n\t\t\tcase \"bail\":\n\t\t\t\treturn {};\n\n\t\t\tcase \"create\":\n\t\t\t\tawait createRepositoryWithApi(github.octokit, {\n\t\t\t\t\towner: options.owner,\n\t\t\t\t\tpreserveGeneratedFrom: options.preserveGeneratedFrom,\n\t\t\t\t\trepository,\n\t\t\t\t});\n\t\t\t\treturn { github, repository };\n\n\t\t\tcase \"different\": {\n\t\t\t\tconst newRepository = filterPromptCancel(\n\t\t\t\t\tawait prompts.text({\n\t\t\t\t\t\tmessage: `What would you like to call the repository?`,\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\tif (!newRepository) {\n\t\t\t\t\treturn {};\n\t\t\t\t}\n\n\t\t\t\trepository = newRepository;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase \"local\":\n\t\t\t\tgithub = undefined;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn { github, repository };\n}\n"],"mappings":"AAAA,YAAY,aAAa;AAEzB,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AAEnC,SAAS,+BAA+B;AAaxC,eAAsB,uBACrB,QACA,SAC2C;AAE3C,MAAI,EAAE,WAAW,IAAI;AACrB,MAAI,mBAAmB,QAAQ,SAAS;AAIxC,SAAO,QAAQ;AACd,QAAI,MAAM,oBAAoB,OAAO,SAAS,OAAO,GAAG;AACvD,aAAO,EAAE,QAAQ,WAAW;AAAA,IAC7B;AAEA,UAAM,YAAY,mBACf,WACA;AAAA,MACC,MAAM,QAAQ,OAAO;AAAA,QACrB,SAAS,cAAc,QAAQ,UAAU,gCAAgC,QAAQ,KAAK;AAAA,QACtF,SAAS;AAAA,UACR,EAAE,OAAO,2BAA2B,OAAO,SAAS;AAAA,UACpD;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,UACR;AAAA,UACA,EAAE,OAAO,sCAAsC,OAAO,OAAO;AAAA,QAC9D;AAAA,MACD,CAAC;AAAA,IACF;AAEF,uBAAmB;AAEnB,YAAQ,WAAW;AAAA,MAClB,KAAK;AAAA,MACL,KAAK;AACJ,eAAO,CAAC;AAAA,MAET,KAAK;AACJ,cAAM,wBAAwB,OAAO,SAAS;AAAA,UAC7C,OAAO,QAAQ;AAAA,UACf,uBAAuB,QAAQ;AAAA,UAC/B;AAAA,QACD,CAAC;AACD,eAAO,EAAE,QAAQ,WAAW;AAAA,MAE7B,KAAK,aAAa;AACjB,cAAM,gBAAgB;AAAA,UACrB,MAAM,QAAQ,KAAK;AAAA,YAClB,SAAS;AAAA,UACV,CAAC;AAAA,QACF;AAEA,YAAI,CAAC,eAAe;AACnB,iBAAO,CAAC;AAAA,QACT;AAEA,qBAAa;AACb;AAAA,MACD;AAAA,MAEA,KAAK;AACJ,iBAAS;AACT;AAAA,IACF;AAAA,EACD;AAEA,SAAO,EAAE,QAAQ,WAAW;AAC7B;","names":[]}
|
|
@@ -112,8 +112,8 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
112
112
|
skipUninstall: z.ZodOptional<z.ZodBoolean>;
|
|
113
113
|
title: z.ZodOptional<z.ZodString>;
|
|
114
114
|
}, "strip", z.ZodTypeAny, {
|
|
115
|
-
description?: string | undefined;
|
|
116
115
|
offline?: boolean | undefined;
|
|
116
|
+
description?: string | undefined;
|
|
117
117
|
access?: "public" | "restricted" | undefined;
|
|
118
118
|
author?: string | undefined;
|
|
119
119
|
auto?: boolean | undefined;
|
|
@@ -161,8 +161,8 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
161
161
|
guideTitle?: string | undefined;
|
|
162
162
|
logoAlt?: string | undefined;
|
|
163
163
|
}, {
|
|
164
|
-
description?: string | undefined;
|
|
165
164
|
offline?: boolean | undefined;
|
|
165
|
+
description?: string | undefined;
|
|
166
166
|
access?: "public" | "restricted" | undefined;
|
|
167
167
|
author?: string | undefined;
|
|
168
168
|
auto?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Mode, OptionsGuide, PromptedOptions } from \"../types.js\";\nimport { Options, OptionsLogo } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { createOptionDefaults } from \"./createOptionDefaults/index.js\";\nimport { detectEmailRedundancy } from \"./detectEmailRedundancy.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { getBase } from \"./getBase.js\";\nimport { getGitHub, GitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { logInferredOptions } from \"./logInferredOptions.js\";\nimport { optionsSchema } from \"./optionsSchema.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\terror?: string | z.ZodError<object>;\n\toptions: object;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(\n\targs: string[],\n\tmode: Mode,\n\tpromptedOptions: PromptedOptions = {},\n): Promise<OptionsParseResult> {\n\tconst defaults = createOptionDefaults(promptedOptions);\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tif (mode === \"migrate\" && !values.base) {\n\t\tvalues.base = await getBase();\n\t}\n\n\tconst mappedOptions = {\n\t\taccess: values.access,\n\t\tauthor: values.author,\n\t\tauto: !!values.auto,\n\t\tbase: values.base,\n\t\tbin: values.bin,\n\t\tdescription: values.description,\n\t\tdirectory: values.directory,\n\t\temail:\n\t\t\tvalues.email ?? values[\"email-github\"] ?? values[\"email-npm\"]\n\t\t\t\t? {\n\t\t\t\t\t\tgithub: values.email ?? values[\"email-github\"],\n\t\t\t\t\t\tnpm: values.email ?? values[\"email-npm\"],\n\t\t\t\t }\n\t\t\t\t: undefined,\n\t\texcludeAllContributors: values[\"exclude-all-contributors\"],\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeLintESLint: values[\"exclude-lint-eslint\"],\n\t\texcludeLintJSDoc: values[\"exclude-lint-jsdoc\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintRegex: values[\"exclude-lint-regex\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintStrict: values[\"exclude-lint-strict\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\tguide: values.guide,\n\t\tguideTitle: values[\"guide-title\"],\n\t\tlogo: values.logo,\n\t\tlogoAlt: values[\"logo-alt\"],\n\t\toffline: values.offline,\n\t\towner: values.owner,\n\t\tpreserveGeneratedFrom:\n\t\t\tvalues[\"preserve-generated-from\"] ?? values.owner === \"JoshuaKGoldberg\",\n\t\trepository: values.repository,\n\t\tskipAllContributorsApi:\n\t\t\tvalues[\"skip-all-contributors-api\"] ?? values.offline,\n\t\tskipGitHubApi: values[\"skip-github-api\"] ?? values.offline,\n\t\tskipInstall: values[\"skip-install\"],\n\t\tskipRemoval: values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst emailError = detectEmailRedundancy(values);\n\tif (emailError) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: emailError,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: optionsParseResult.error,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\tconst ownerOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.owner,\n\t\tmessage: \"What organization or user will the repository be under?\",\n\t\tname: \"owner\",\n\t\tprovided: options.owner,\n\t});\n\n\toptions.owner ??= ownerOption.value;\n\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: ownerOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst repositoryOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.repository,\n\t\tmessage: \"What will the kebab-case name of the repository be?\",\n\t\tname: \"repository\",\n\t\tprovided: options.repository,\n\t});\n\n\toptions.repository ??= repositoryOption.value;\n\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: repositoryOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { github, repository } = await ensureRepositoryExists(\n\t\toptions.skipGitHubApi\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", getGitHub),\n\t\t{\n\t\t\tmode,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\n\tif (!repository) {\n\t\treturn { cancelled: true, error: repositoryOption.error, options };\n\t}\n\n\tconst descriptionOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t\tmessage: \"How would you describe the new package?\",\n\t\tname: \"description\",\n\t\tprovided: options.description,\n\t});\n\n\toptions.description ??= descriptionOption.value;\n\n\tif (!options.description) {\n\t\treturn { cancelled: true, error: descriptionOption.error, options };\n\t}\n\n\tconst titleOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t\tmessage: \"What will the Title Case title of the repository be?\",\n\t\tname: \"title\",\n\t\tprovided: options.title,\n\t});\n\n\toptions.title ??= titleOption.value;\n\n\tif (!options.title) {\n\t\treturn { cancelled: true, error: titleOption.error, options };\n\t}\n\n\tlet guide: OptionsGuide | undefined;\n\n\tif (options.guide) {\n\t\tif (options.guideTitle) {\n\t\t\tguide = { href: options.guide, title: options.guideTitle };\n\t\t} else {\n\t\t\tconst titleOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the title text for the guide?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!titleOption.value) {\n\t\t\t\treturn { cancelled: true, error: titleOption.error, options };\n\t\t\t}\n\n\t\t\tguide = { href: options.guide, title: titleOption.value };\n\t\t}\n\t}\n\n\tlet logo: OptionsLogo | undefined;\n\n\tif (options.logo) {\n\t\tif (options.logoAlt) {\n\t\t\tlogo = { alt: options.logoAlt, src: options.logo };\n\t\t} else {\n\t\t\tconst logoAltOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the alt text (non-visual description) of the logo?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!logoAltOption.value) {\n\t\t\t\treturn { cancelled: true, error: logoAltOption.error, options };\n\t\t\t}\n\n\t\t\tlogo = { alt: logoAltOption.value, src: options.logo };\n\t\t}\n\t}\n\n\tlet email = options.email ?? (await defaults.email());\n\n\tif (!email) {\n\t\tconst emailOption = await getPrefillOrPromptedOption({\n\t\t\tauto: !!mappedOptions.auto,\n\t\t\tmessage: \"What email should be used in package.json and .md files?\",\n\t\t\tname: \"email\",\n\t\t});\n\n\t\tif (!emailOption.value) {\n\t\t\treturn { cancelled: true, error: emailOption.error, options };\n\t\t}\n\n\t\temail = { github: emailOption.value, npm: emailOption.value };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\taccess: options.access ?? \"public\",\n\t\tauthor: options.author ?? (await defaults.owner()),\n\t\tdescription: options.description,\n\t\tdirectory:\n\t\t\toptions.directory ?? promptedOptions.directory ?? options.repository,\n\t\temail,\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\tguide,\n\t\tlogo,\n\t\tmode,\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tif (options.auto) {\n\t\tlogInferredOptions(augmentedOptions);\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAG1B,SAAS,mBAAmB;AAG5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;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,OAAO;AACvB,aAAO,EAAE,WAAW,MAAM,OAAO,YAAY,OAAO,QAAQ;AAAA,IAC7D;AAEA,YAAQ,EAAE,QAAQ,YAAY,OAAO,KAAK,YAAY,MAAM;AAAA,EAC7D;AAEA,QAAM,mBAAmB,MAAM,2BAA2B;AAAA,IACzD,GAAG;AAAA,IACH,QAAQ,QAAQ,UAAU;AAAA,IAC1B,QAAQ,QAAQ,UAAW,MAAM,SAAS,MAAM;AAAA,IAChD,aAAa,QAAQ;AAAA,IACrB,WACC,QAAQ,aAAa,gBAAgB,aAAa,QAAQ;AAAA,IAC3D;AAAA,IACA,SAAS,QAAQ,WAAY,MAAM,SAAS,QAAQ;AAAA,IACpD;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,QAAQ;AAAA,IACf;AAAA,IACA,OAAO,QAAQ;AAAA,EAChB,CAAC;AAED,MAAI,CAAC,kBAAkB;AACtB,WAAO;AAAA,MACN,WAAW;AAAA,MACX;AAAA,IACD;AAAA,EACD;AAEA,MAAI,QAAQ,MAAM;AACjB,uBAAmB,gBAAgB;AAAA,EACpC;AAEA,SAAO;AAAA,IACN,WAAW;AAAA,IACX;AAAA,IACA,SAAS;AAAA,EACV;AACD;","names":["titleOption"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Mode, OptionsGuide, PromptedOptions } from \"../types.js\";\nimport { Options, OptionsLogo } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { createOptionDefaults } from \"./createOptionDefaults/index.js\";\nimport { detectEmailRedundancy } from \"./detectEmailRedundancy.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { getBase } from \"./getBase.js\";\nimport { getGitHub, GitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { logInferredOptions } from \"./logInferredOptions.js\";\nimport { optionsSchema } from \"./optionsSchema.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\terror?: string | z.ZodError<object>;\n\toptions: object;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(\n\targs: string[],\n\tmode: Mode,\n\tpromptedOptions: PromptedOptions = {},\n): Promise<OptionsParseResult> {\n\tconst defaults = createOptionDefaults(promptedOptions);\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tif (mode === \"migrate\" && !values.base) {\n\t\tvalues.base = await getBase();\n\t}\n\n\tconst mappedOptions = {\n\t\taccess: values.access,\n\t\tauthor: values.author,\n\t\tauto: !!values.auto,\n\t\tbase: values.base,\n\t\tbin: values.bin,\n\t\tdescription: values.description,\n\t\tdirectory: values.directory,\n\t\temail:\n\t\t\t(values.email ?? values[\"email-github\"] ?? values[\"email-npm\"])\n\t\t\t\t? {\n\t\t\t\t\t\tgithub: values.email ?? values[\"email-github\"],\n\t\t\t\t\t\tnpm: values.email ?? values[\"email-npm\"],\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\texcludeAllContributors: values[\"exclude-all-contributors\"],\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeLintESLint: values[\"exclude-lint-eslint\"],\n\t\texcludeLintJSDoc: values[\"exclude-lint-jsdoc\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintRegex: values[\"exclude-lint-regex\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintStrict: values[\"exclude-lint-strict\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\tguide: values.guide,\n\t\tguideTitle: values[\"guide-title\"],\n\t\tlogo: values.logo,\n\t\tlogoAlt: values[\"logo-alt\"],\n\t\toffline: values.offline,\n\t\towner: values.owner,\n\t\tpreserveGeneratedFrom:\n\t\t\tvalues[\"preserve-generated-from\"] ?? values.owner === \"JoshuaKGoldberg\",\n\t\trepository: values.repository,\n\t\tskipAllContributorsApi:\n\t\t\tvalues[\"skip-all-contributors-api\"] ?? values.offline,\n\t\tskipGitHubApi: values[\"skip-github-api\"] ?? values.offline,\n\t\tskipInstall: values[\"skip-install\"],\n\t\tskipRemoval: values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst emailError = detectEmailRedundancy(values);\n\tif (emailError) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: emailError,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: optionsParseResult.error,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\tconst ownerOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.owner,\n\t\tmessage: \"What organization or user will the repository be under?\",\n\t\tname: \"owner\",\n\t\tprovided: options.owner,\n\t});\n\n\toptions.owner ??= ownerOption.value;\n\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: ownerOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst repositoryOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: defaults.repository,\n\t\tmessage: \"What will the kebab-case name of the repository be?\",\n\t\tname: \"repository\",\n\t\tprovided: options.repository,\n\t});\n\n\toptions.repository ??= repositoryOption.value;\n\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: repositoryOption.error,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { github, repository } = await ensureRepositoryExists(\n\t\toptions.skipGitHubApi\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", getGitHub),\n\t\t{\n\t\t\tmode,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\n\tif (!repository) {\n\t\treturn { cancelled: true, error: repositoryOption.error, options };\n\t}\n\n\tconst descriptionOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t\tmessage: \"How would you describe the new package?\",\n\t\tname: \"description\",\n\t\tprovided: options.description,\n\t});\n\n\toptions.description ??= descriptionOption.value;\n\n\tif (!options.description) {\n\t\treturn { cancelled: true, error: descriptionOption.error, options };\n\t}\n\n\tconst titleOption = await getPrefillOrPromptedOption({\n\t\tauto: !!mappedOptions.auto,\n\t\tgetDefaultValue: async () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t\tmessage: \"What will the Title Case title of the repository be?\",\n\t\tname: \"title\",\n\t\tprovided: options.title,\n\t});\n\n\toptions.title ??= titleOption.value;\n\n\tif (!options.title) {\n\t\treturn { cancelled: true, error: titleOption.error, options };\n\t}\n\n\tlet guide: OptionsGuide | undefined;\n\n\tif (options.guide) {\n\t\tif (options.guideTitle) {\n\t\t\tguide = { href: options.guide, title: options.guideTitle };\n\t\t} else {\n\t\t\tconst titleOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the title text for the guide?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!titleOption.value) {\n\t\t\t\treturn { cancelled: true, error: titleOption.error, options };\n\t\t\t}\n\n\t\t\tguide = { href: options.guide, title: titleOption.value };\n\t\t}\n\t}\n\n\tlet logo: OptionsLogo | undefined;\n\n\tif (options.logo) {\n\t\tif (options.logoAlt) {\n\t\t\tlogo = { alt: options.logoAlt, src: options.logo };\n\t\t} else {\n\t\t\tconst logoAltOption = await getPrefillOrPromptedOption({\n\t\t\t\tauto: !!mappedOptions.auto,\n\t\t\t\tmessage: \"What is the alt text (non-visual description) of the logo?\",\n\t\t\t\tname: \"getPrefillOrPromptedOption\",\n\t\t\t});\n\n\t\t\tif (!logoAltOption.value) {\n\t\t\t\treturn { cancelled: true, error: logoAltOption.error, options };\n\t\t\t}\n\n\t\t\tlogo = { alt: logoAltOption.value, src: options.logo };\n\t\t}\n\t}\n\n\tlet email = options.email ?? (await defaults.email());\n\n\tif (!email) {\n\t\tconst emailOption = await getPrefillOrPromptedOption({\n\t\t\tauto: !!mappedOptions.auto,\n\t\t\tmessage: \"What email should be used in package.json and .md files?\",\n\t\t\tname: \"email\",\n\t\t});\n\n\t\tif (!emailOption.value) {\n\t\t\treturn { cancelled: true, error: emailOption.error, options };\n\t\t}\n\n\t\temail = { github: emailOption.value, npm: emailOption.value };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\taccess: options.access ?? \"public\",\n\t\tauthor: options.author ?? (await defaults.owner()),\n\t\tdescription: options.description,\n\t\tdirectory:\n\t\t\toptions.directory ?? promptedOptions.directory ?? options.repository,\n\t\temail,\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\tguide,\n\t\tlogo,\n\t\tmode,\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tif (options.auto) {\n\t\tlogInferredOptions(augmentedOptions);\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAG1B,SAAS,mBAAmB;AAG5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AACvC,SAAS,eAAe;AACxB,SAAS,iBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAmB9B,eAAsB,YACrB,MACA,MACA,kBAAmC,CAAC,GACN;AAC9B,QAAM,WAAW,qBAAqB,eAAe;AACrD,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT,CAAC;AAED,MAAI,SAAS,aAAa,CAAC,OAAO,MAAM;AACvC,WAAO,OAAO,MAAM,QAAQ;AAAA,EAC7B;AAEA,QAAM,gBAAgB;AAAA,IACrB,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,IACf,MAAM,CAAC,CAAC,OAAO;AAAA,IACf,MAAM,OAAO;AAAA,IACb,KAAK,OAAO;AAAA,IACZ,aAAa,OAAO;AAAA,IACpB,WAAW,OAAO;AAAA,IAClB,OACE,OAAO,SAAS,OAAO,cAAc,KAAK,OAAO,WAAW,IAC1D;AAAA,MACA,QAAQ,OAAO,SAAS,OAAO,cAA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;AAAA,EACV;AACD;","names":["titleOption"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/addOwnerAsAllContributor.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nimport { getGitHubUserAsAllContributor } from \"../shared/getGitHubUserAsAllContributor.js\";\nimport { readFileAsJson } from \"../shared/readFileAsJson.js\";\nimport { AllContributorsData, Options } from \"../shared/types.js\";\nimport { formatJson } from \"./writing/creation/formatters/formatJson.js\";\n\nexport async function addOwnerAsAllContributor(\n\toptions: Pick<Options, \"offline\" | \"owner\">,\n) {\n\tconst user = await getGitHubUserAsAllContributor(options);\n\n\tconst existingContributors = (await readFileAsJson(\n\t\t\"./.all-contributorsrc\",\n\t)) as AllContributorsData;\n\tif (!isValidAllContributorsData(existingContributors)) {\n\t\tthrow new Error(\n\t\t\t`Invalid .all-contributorsrc: ${JSON.stringify(existingContributors)}`,\n\t\t);\n\t}\n\n\tconst contributors = existingContributors.contributors\n\t\t.filter(({ login }) => [\"JoshuaKGoldberg\", user].includes(login))\n\t\t.map((contributor) =>\n\t\t\tcontributor.login === \"JoshuaKGoldberg\"\n\t\t\t\t? { ...contributor, contributions: [\"tool\"] }\n\t\t\t\t: {\n\t\t\t\t\t\t...contributor,\n\t\t\t\t\t\tcontributions: Array.from(\n\t\t\t\t\t\t\tnew Set([...contributor.contributions, \"tool\"]),\n\t\t\t\t\t\t),\n\t\t\t\t
|
|
1
|
+
{"version":3,"sources":["../../src/steps/addOwnerAsAllContributor.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nimport { getGitHubUserAsAllContributor } from \"../shared/getGitHubUserAsAllContributor.js\";\nimport { readFileAsJson } from \"../shared/readFileAsJson.js\";\nimport { AllContributorsData, Options } from \"../shared/types.js\";\nimport { formatJson } from \"./writing/creation/formatters/formatJson.js\";\n\nexport async function addOwnerAsAllContributor(\n\toptions: Pick<Options, \"offline\" | \"owner\">,\n) {\n\tconst user = await getGitHubUserAsAllContributor(options);\n\n\tconst existingContributors = (await readFileAsJson(\n\t\t\"./.all-contributorsrc\",\n\t)) as AllContributorsData;\n\tif (!isValidAllContributorsData(existingContributors)) {\n\t\tthrow new Error(\n\t\t\t`Invalid .all-contributorsrc: ${JSON.stringify(existingContributors)}`,\n\t\t);\n\t}\n\n\tconst contributors = existingContributors.contributors\n\t\t.filter(({ login }) => [\"JoshuaKGoldberg\", user].includes(login))\n\t\t.map((contributor) =>\n\t\t\tcontributor.login === \"JoshuaKGoldberg\"\n\t\t\t\t? { ...contributor, contributions: [\"tool\"] }\n\t\t\t\t: {\n\t\t\t\t\t\t...contributor,\n\t\t\t\t\t\tcontributions: Array.from(\n\t\t\t\t\t\t\tnew Set([...contributor.contributions, \"tool\"]),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t);\n\n\tif (!contributors.some((contributor) => contributor.login === user)) {\n\t\tcontributors.push({\n\t\t\tcontributions: [\"tool\"],\n\t\t\tlogin: user,\n\t\t});\n\t}\n\n\tawait fs.writeFile(\n\t\t\"./.all-contributorsrc\",\n\t\tawait formatJson({\n\t\t\t...existingContributors,\n\t\t\tcontributors,\n\t\t}),\n\t);\n}\n\nfunction isValidAllContributorsData(\n\tvalue: unknown,\n): value is AllContributorsData {\n\treturn !!value && typeof value === \"object\" && \"contributors\" in value;\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,SAAS,qCAAqC;AAC9C,SAAS,sBAAsB;AAE/B,SAAS,kBAAkB;AAE3B,eAAsB,yBACrB,SACC;AACD,QAAM,OAAO,MAAM,8BAA8B,OAAO;AAExD,QAAM,uBAAwB,MAAM;AAAA,IACnC;AAAA,EACD;AACA,MAAI,CAAC,2BAA2B,oBAAoB,GAAG;AACtD,UAAM,IAAI;AAAA,MACT,gCAAgC,KAAK,UAAU,oBAAoB,CAAC;AAAA,IACrE;AAAA,EACD;AAEA,QAAM,eAAe,qBAAqB,aACxC,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC,mBAAmB,IAAI,EAAE,SAAS,KAAK,CAAC,EAC/D;AAAA,IAAI,CAAC,gBACL,YAAY,UAAU,oBACnB,EAAE,GAAG,aAAa,eAAe,CAAC,MAAM,EAAE,IAC1C;AAAA,MACA,GAAG;AAAA,MACH,eAAe,MAAM;AAAA,QACpB,oBAAI,IAAI,CAAC,GAAG,YAAY,eAAe,MAAM,CAAC;AAAA,MAC/C;AAAA,IACD;AAAA,EACH;AAED,MAAI,CAAC,aAAa,KAAK,CAAC,gBAAgB,YAAY,UAAU,IAAI,GAAG;AACpE,iBAAa,KAAK;AAAA,MACjB,eAAe,CAAC,MAAM;AAAA,MACtB,OAAO;AAAA,IACR,CAAC;AAAA,EACF;AAEA,QAAM,GAAG;AAAA,IACR;AAAA,IACA,MAAM,WAAW;AAAA,MAChB,GAAG;AAAA,MACH;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAEA,SAAS,2BACR,OAC+B;AAC/B,SAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,kBAAkB;AAClE;","names":[]}
|
|
@@ -2,6 +2,7 @@ import * as fs from "node:fs/promises";
|
|
|
2
2
|
const globPaths = [
|
|
3
3
|
...extensions(".babelrc", "cjs", "cts", "js", "json", "mjs"),
|
|
4
4
|
...extensions(".eslintrc", "js", "json", "yml"),
|
|
5
|
+
...extensions(".mocha", "cjs", "js", "json", "jsonc", "yaml", "yml"),
|
|
5
6
|
...extensions(".prettierrc", "json", "json5", "yaml", "yml"),
|
|
6
7
|
...extensions("prettier.config", "js", "mjs", "cjs"),
|
|
7
8
|
...extensions("babel.config", "cjs", "cts", "js", "json", "mjs"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/clearUnnecessaryFiles.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nconst globPaths = [\n\t...extensions(\".babelrc\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\".eslintrc\", \"js\", \"json\", \"yml\"),\n\t...extensions(\".prettierrc\", \"json\", \"json5\", \"yaml\", \"yml\"),\n\t...extensions(\"prettier.config\", \"js\", \"mjs\", \"cjs\"),\n\t...extensions(\"babel.config\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\"jest.config\", \"cjs\", \"js\", \"json\", \"mjs\", \"ts\"),\n\t\"./src/**/*.js\",\n\t\".circleci/config.yml\",\n\t\".github/codecov.yml\",\n\t\".babelrc\",\n\t\".npmignore\",\n\t\".eslintignore\",\n\t\".eslintrc\",\n\t\"CODE_OF_CONDUCT.md\",\n\t\"CONTRIBUTING.md\",\n\t\".npmpackagejsonlintrc.json\",\n\t\"codecov.yml\",\n\t\"DEVELOPMENT.md\",\n\t\"dist\",\n\t\"lib\",\n\t\"package-lock.json\",\n\t\"travis.yml\",\n\t\"yarn.lock\",\n];\n\nfunction extensions(base: string, ...extensions: string[]) {\n\treturn extensions.map((extension) => [base, extension].join(\".\"));\n}\n\nexport async function clearUnnecessaryFiles() {\n\tfor (const globPath of globPaths) {\n\t\tawait fs.rm(globPath, { force: true, recursive: true });\n\t}\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,MAAM,YAAY;AAAA,EACjB,GAAG,WAAW,YAAY,OAAO,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC3D,GAAG,WAAW,aAAa,MAAM,QAAQ,KAAK;AAAA,EAC9C,GAAG,WAAW,eAAe,QAAQ,SAAS,QAAQ,KAAK;AAAA,EAC3D,GAAG,WAAW,mBAAmB,MAAM,OAAO,KAAK;AAAA,EACnD,GAAG,WAAW,gBAAgB,OAAO,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC/D,GAAG,WAAW,eAAe,OAAO,MAAM,QAAQ,OAAO,IAAI;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,SAAS,WAAW,SAAiBA,aAAsB;AAC1D,SAAOA,YAAW,IAAI,CAAC,cAAc,CAAC,MAAM,SAAS,EAAE,KAAK,GAAG,CAAC;AACjE;AAEA,eAAsB,wBAAwB;AAC7C,aAAW,YAAY,WAAW;AACjC,UAAM,GAAG,GAAG,UAAU,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,EACvD;AACD;","names":["extensions"]}
|
|
1
|
+
{"version":3,"sources":["../../src/steps/clearUnnecessaryFiles.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nconst globPaths = [\n\t...extensions(\".babelrc\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\".eslintrc\", \"js\", \"json\", \"yml\"),\n\t...extensions(\".mocha\", \"cjs\", \"js\", \"json\", \"jsonc\", \"yaml\", \"yml\"),\n\t...extensions(\".prettierrc\", \"json\", \"json5\", \"yaml\", \"yml\"),\n\t...extensions(\"prettier.config\", \"js\", \"mjs\", \"cjs\"),\n\t...extensions(\"babel.config\", \"cjs\", \"cts\", \"js\", \"json\", \"mjs\"),\n\t...extensions(\"jest.config\", \"cjs\", \"js\", \"json\", \"mjs\", \"ts\"),\n\t\"./src/**/*.js\",\n\t\".circleci/config.yml\",\n\t\".github/codecov.yml\",\n\t\".babelrc\",\n\t\".npmignore\",\n\t\".eslintignore\",\n\t\".eslintrc\",\n\t\"CODE_OF_CONDUCT.md\",\n\t\"CONTRIBUTING.md\",\n\t\".npmpackagejsonlintrc.json\",\n\t\"codecov.yml\",\n\t\"DEVELOPMENT.md\",\n\t\"dist\",\n\t\"lib\",\n\t\"package-lock.json\",\n\t\"travis.yml\",\n\t\"yarn.lock\",\n];\n\nfunction extensions(base: string, ...extensions: string[]) {\n\treturn extensions.map((extension) => [base, extension].join(\".\"));\n}\n\nexport async function clearUnnecessaryFiles() {\n\tfor (const globPath of globPaths) {\n\t\tawait fs.rm(globPath, { force: true, recursive: true });\n\t}\n}\n"],"mappings":"AAAA,YAAY,QAAQ;AAEpB,MAAM,YAAY;AAAA,EACjB,GAAG,WAAW,YAAY,OAAO,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC3D,GAAG,WAAW,aAAa,MAAM,QAAQ,KAAK;AAAA,EAC9C,GAAG,WAAW,UAAU,OAAO,MAAM,QAAQ,SAAS,QAAQ,KAAK;AAAA,EACnE,GAAG,WAAW,eAAe,QAAQ,SAAS,QAAQ,KAAK;AAAA,EAC3D,GAAG,WAAW,mBAAmB,MAAM,OAAO,KAAK;AAAA,EACnD,GAAG,WAAW,gBAAgB,OAAO,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC/D,GAAG,WAAW,eAAe,OAAO,MAAM,QAAQ,OAAO,IAAI;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,SAAS,WAAW,SAAiBA,aAAsB;AAC1D,SAAOA,YAAW,IAAI,CAAC,cAAc,CAAC,MAAM,SAAS,EAAE,KAAK,GAAG,CAAC;AACjE;AAEA,eAAsB,wBAAwB;AAC7C,aAAW,YAAY,WAAW;AACjC,UAAM,GAAG,GAAG,UAAU,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,EACvD;AACD;","names":["extensions"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/createJoshuaKGoldbergReplacement.ts"],"sourcesContent":["import { Options } from \"../shared/types.js\";\n\n/**\n * Creates a replace-in-file replacement for JoshuaKGoldberg/... matches,\n * keeping repository names not being migrated (e.g. for GitHub actions).\n */\nexport const createJoshuaKGoldbergReplacement = (\n\toptions: Pick<Options, \"owner\" | \"repository\">,\n): [RegExp, ToCallback] => [\n\t/JoshuaKGoldberg(?:\\/(.+))?/g,\n\t(full: string, capture: string | undefined) =>\n\t\tcapture\n\t\t\t? // If this was a \"JoshuaKGoldberg/...\" repository link,\n\t\t\t
|
|
1
|
+
{"version":3,"sources":["../../src/steps/createJoshuaKGoldbergReplacement.ts"],"sourcesContent":["import { Options } from \"../shared/types.js\";\n\n/**\n * Creates a replace-in-file replacement for JoshuaKGoldberg/... matches,\n * keeping repository names not being migrated (e.g. for GitHub actions).\n */\nexport const createJoshuaKGoldbergReplacement = (\n\toptions: Pick<Options, \"owner\" | \"repository\">,\n): [RegExp, ToCallback] => [\n\t/JoshuaKGoldberg(?:\\/(.+))?/g,\n\t(full: string, capture: string | undefined) =>\n\t\tcapture\n\t\t\t? // If this was a \"JoshuaKGoldberg/...\" repository link,\n\t\t\t\t// swap the owner if it's the repository being migrated.\n\t\t\t\tcapture.startsWith(options.repository)\n\t\t\t\t? `${options.owner}/${capture}`\n\t\t\t\t: full\n\t\t\t: // Otherwise it's just \"JoshuaKGoldberg\" standalone,\n\t\t\t\t// so swap to the new owner.\n\t\t\t\toptions.owner,\n];\n"],"mappings":"AAMO,MAAM,mCAAmC,CAC/C,YAC0B;AAAA,EAC1B;AAAA,EACA,CAAC,MAAc,YACd;AAAA;AAAA;AAAA,IAGE,QAAQ,WAAW,QAAQ,UAAU,IACnC,GAAG,QAAQ,KAAK,IAAI,OAAO,KAC3B;AAAA;AAAA;AAAA;AAAA,IAGF,QAAQ;AAAA;AACZ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/finalizeDependencies.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function finalizeDependencies(options: Options) {\n\tconst devDependencies = [\n\t\t\"@eslint/js\",\n\t\t\"@eslint-community/eslint-plugin-eslint-comments\",\n\t\t\"@types/eslint-plugin-markdown\",\n\t\t\"@types/eslint__js\",\n\t\t\"@types/node\",\n\t\t\"eslint\",\n\t\t\"eslint-plugin-jsdoc\",\n\t\t\"eslint-plugin-n\",\n\t\t\"eslint-plugin-regexp\",\n\t\t\"husky\",\n\t\t\"lint-staged\",\n\t\t\"prettier\",\n\t\t\"prettier-plugin-curly\",\n\t\t\"prettier-plugin-sh\",\n\t\t\"prettier-plugin-packagejson\",\n\t\t\"tsup\",\n\t\t\"typescript\",\n\t\t\"typescript-eslint\",\n\t\t...(options.excludeAllContributors ? [] : [\"all-contributors-cli\"]),\n\t\t...(options.excludeLintJson ? [] : [\"eslint-plugin-jsonc\"]),\n\t\t...(options.excludeLintJson && options.excludeLintPackageJson\n\t\t\t? []\n\t\t\t: [\"jsonc-eslint-parser\"]),\n\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t...(options.excludeLintMd\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"eslint-plugin-markdown\",\n\t\t\t\t\t\"markdownlint\",\n\t\t\t\t\t\"markdownlint-cli\",\n\t\t\t\t\t\"sentences-per-line\",\n\t\t\t
|
|
1
|
+
{"version":3,"sources":["../../src/steps/finalizeDependencies.ts"],"sourcesContent":["import { execaCommand } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport async function finalizeDependencies(options: Options) {\n\tconst devDependencies = [\n\t\t\"@eslint/js\",\n\t\t\"@eslint-community/eslint-plugin-eslint-comments\",\n\t\t\"@types/eslint-plugin-markdown\",\n\t\t\"@types/eslint__js\",\n\t\t\"@types/node\",\n\t\t\"eslint\",\n\t\t\"eslint-plugin-jsdoc\",\n\t\t\"eslint-plugin-n\",\n\t\t\"eslint-plugin-regexp\",\n\t\t\"husky\",\n\t\t\"lint-staged\",\n\t\t\"prettier\",\n\t\t\"prettier-plugin-curly\",\n\t\t\"prettier-plugin-sh\",\n\t\t\"prettier-plugin-packagejson\",\n\t\t\"tsup\",\n\t\t\"typescript\",\n\t\t\"typescript-eslint\",\n\t\t...(options.excludeAllContributors ? [] : [\"all-contributors-cli\"]),\n\t\t...(options.excludeLintJson ? [] : [\"eslint-plugin-jsonc\"]),\n\t\t...(options.excludeLintJson && options.excludeLintPackageJson\n\t\t\t? []\n\t\t\t: [\"jsonc-eslint-parser\"]),\n\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t...(options.excludeLintMd\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"eslint-plugin-markdown\",\n\t\t\t\t\t\"markdownlint\",\n\t\t\t\t\t\"markdownlint-cli\",\n\t\t\t\t\t\"sentences-per-line\",\n\t\t\t\t]),\n\t\t...(options.excludeLintPackageJson ? [] : [\"eslint-plugin-package-json\"]),\n\t\t...(options.excludeLintPerfectionist\n\t\t\t? []\n\t\t\t: [\"eslint-plugin-perfectionist\"]),\n\t\t...(options.excludeLintSpelling ? [] : [\"cspell\"]),\n\t\t...(options.excludeLintYml ? [] : [\"eslint-plugin-yml\"]),\n\t\t...(options.excludeReleases\n\t\t\t? []\n\t\t\t: [\"@release-it/conventional-changelog\", \"release-it\"]),\n\t\t...(options.excludeTests\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t\"@vitest/coverage-v8\",\n\t\t\t\t\t\"console-fail-test\",\n\t\t\t\t\t\"eslint-plugin-vitest\",\n\t\t\t\t\t\"vitest\",\n\t\t\t\t]),\n\t]\n\t\t.filter(Boolean)\n\t\t.sort()\n\t\t.map((packageName) => `${packageName}@latest`)\n\t\t.join(\" \");\n\n\tawait execaCommand(\n\t\t`pnpm add ${devDependencies} -D${options.offline ? \" --offline\" : \"\"}`,\n\t);\n\n\tif (!options.excludeAllContributors) {\n\t\tawait execaCommand(`npx all-contributors-cli generate`);\n\t\tawait removeDependencies(\n\t\t\t[\"all-contributors-cli\", \"all-contributors-for-repository\"],\n\t\t\t(await readPackageData()).devDependencies,\n\t\t\t\"-D\",\n\t\t);\n\t}\n\n\tawait execaCommand(`pnpm dedupe`);\n}\n"],"mappings":"AAA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QAAQ,wBAAwB;AACpC,UAAM,aAAa,mCAAmC;AACtD,UAAM;AAAA,MACL,CAAC,wBAAwB,iCAAiC;AAAA,OACzD,MAAM,gBAAgB,GAAG;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAEA,QAAM,aAAa,aAAa;AACjC;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import replaceInFile from "replace-in-file";
|
|
1
|
+
import { replaceInFile } from "replace-in-file";
|
|
2
2
|
import { readFileSafeAsJson } from "../shared/readFileSafeAsJson.js";
|
|
3
3
|
import { createJoshuaKGoldbergReplacement } from "./createJoshuaKGoldbergReplacement.js";
|
|
4
4
|
import { endOfReadmeTemplateLine } from "./updateReadme.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/updateLocalFiles.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../src/steps/updateLocalFiles.ts"],"sourcesContent":["import { From, replaceInFile, To } from \"replace-in-file\";\n\nimport { readFileSafeAsJson } from \"../shared/readFileSafeAsJson.js\";\nimport { Options } from \"../shared/types.js\";\nimport { createJoshuaKGoldbergReplacement } from \"./createJoshuaKGoldbergReplacement.js\";\nimport { endOfReadmeTemplateLine } from \"./updateReadme.js\";\n\ninterface ExistingPackageData {\n\tdescription?: string;\n\tversion?: string;\n}\n\nexport async function updateLocalFiles(options: Options) {\n\tconst existingPackage = ((await readFileSafeAsJson(\"./package.json\")) ??\n\t\t{}) as ExistingPackageData;\n\n\tconst replacements: [From, To, (string | string[])?][] = [\n\t\t[/Create TypeScript App/g, options.title],\n\t\tcreateJoshuaKGoldbergReplacement(options),\n\t\t[/JoshuaKGoldberg/g, options.owner, \"package.json\"],\n\t\t[/create-typescript-app/g, options.repository],\n\t\t[/\\/\\*\\n.+\\*\\/\\n\\n/gs, ``, \"eslint.config.js\"],\n\t\t[/\"author\": \".+\"/g, `\"author\": \"${options.author}\"`, \"./package.json\"],\n\t\t...(options.mode === \"migrate\"\n\t\t\t? []\n\t\t\t: ([\n\t\t\t\t\t// Only creating a new repository should remove these parts.\n\t\t\t\t\t// Existing ones might coincidentally have them too.\n\t\t\t\t\t[/\"test:create\": \".+\\n/g, ``, \"./package.json\"],\n\t\t\t\t\t[/\"test:initialize\": \".*/g, ``, \"./package.json\"],\n\t\t\t\t\t[/\"initialize\": \".*/g, ``, \"./package.json\"],\n\t\t\t\t\t[/\"test:migrate\": \".+\\n/g, ``, \"./package.json\"],\n\t\t\t\t\t[\n\t\t\t\t\t\t/## Getting Started.*## Development/gs,\n\t\t\t\t\t\t`## Development`,\n\t\t\t\t\t\t\"./README.md\",\n\t\t\t\t\t],\n\t\t\t\t\t[/\\n## Setup Scripts.*$/gs, \"\", \"./.github/DEVELOPMENT.md\"],\n\t\t\t\t\t[`\\t\\t\"src/initialize/index.ts\",\\n`, ``, \"./knip.json\"],\n\t\t\t\t\t[`\\t\\t\"src/migrate/index.ts\",\\n`, ``, \"./knip.json\"],\n\t\t\t\t\t[\n\t\t\t\t\t\t`[\"src/index.ts!\", \"script/initialize*.js\"]`,\n\t\t\t\t\t\t`\"src/index.ts!\"`,\n\t\t\t\t\t\t\"./knip.json\",\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t`[\"src/**/*.ts!\", \"script/**/*.js\"]`,\n\t\t\t\t\t\t`\"src/**/*.ts!\"`,\n\t\t\t\t\t\t\"./knip.json\",\n\t\t\t\t\t],\n\t\t\t\t\t// Edge case: migration scripts will rewrite README.md attribution\n\t\t\t\t\t[\n\t\t\t\t\t\t/> 💙 This package was templated with .+\\./g,\n\t\t\t\t\t\tendOfReadmeTemplateLine,\n\t\t\t\t\t\t\"./README.md\",\n\t\t\t\t\t],\n\t\t\t\t] as typeof replacements)),\n\t];\n\n\tif (existingPackage.description) {\n\t\treplacements.push([existingPackage.description, options.description]);\n\t}\n\n\tif (options.mode !== \"migrate\") {\n\t\treplacements.push([/\"bin\": \".+\\n/g, ``, \"./package.json\"]);\n\n\t\tif (options.mode === \"initialize\" && existingPackage.version) {\n\t\t\treplacements.push([\n\t\t\t\tnew RegExp(`\"version\": \"${existingPackage.version}\"`, \"g\"),\n\t\t\t\t`\"version\": \"0.0.0\"`,\n\t\t\t\t\"./package.json\",\n\t\t\t]);\n\t\t}\n\t}\n\n\tfor (const [from, to, files = [\"./.github/**/*\", \"./*.*\"]] of replacements) {\n\t\ttry {\n\t\t\tawait replaceInFile({\n\t\t\t\tallowEmptyPaths: true,\n\t\t\t\tfiles,\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst toString = typeof to === \"function\" ? \"(function)\" : to;\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to replace ${from.toString()} with ${toString} in ${files.toString()}`,\n\t\t\t\t{\n\t\t\t\t\tcause: error,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n}\n"],"mappings":"AAAA,SAAe,qBAAyB;AAExC,SAAS,0BAA0B;AAEnC,SAAS,wCAAwC;AACjD,SAAS,+BAA+B;AAOxC,eAAsB,iBAAiB,SAAkB;AACxD,QAAM,kBAAoB,MAAM,mBAAmB,gBAAgB,KAClE,CAAC;AAEF,QAAM,eAAmD;AAAA,IACxD,CAAC,0BAA0B,QAAQ,KAAK;AAAA,IACxC,iCAAiC,OAAO;AAAA,IACxC,CAAC,oBAAoB,QAAQ,OAAO,cAAc;AAAA,IAClD,CAAC,0BAA0B,QAAQ,UAAU;AAAA,IAC7C,CAAC,sBAAsB,IAAI,kBAAkB;AAAA,IAC7C,CAAC,mBAAmB,cAAc,QAAQ,MAAM,KAAK,gBAAgB;AAAA,IACrE,GAAI,QAAQ,SAAS,YAClB,CAAC,IACA;AAAA;AAAA;AAAA,MAGD,CAAC,yBAAyB,IAAI,gBAAgB;AAAA,MAC9C,CAAC,2BAA2B,IAAI,gBAAgB;AAAA,MAChD,CAAC,sBAAsB,IAAI,gBAAgB;AAAA,MAC3C,CAAC,0BAA0B,IAAI,g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assignment": "error",`}
|
|
73
73
|
|
|
74
74
|
// These on-by-default rules don't work well for this repo and we like them off.${options.excludeLintJSDoc ? "" : `
|
|
75
|
+
"jsdoc/lines-before-block": "off",
|
|
75
76
|
"jsdoc/require-jsdoc": "off",
|
|
76
77
|
"jsdoc/require-param": "off",
|
|
77
78
|
"jsdoc/require-property": "off",
|
|
@@ -80,6 +81,10 @@ export default tseslint.config(
|
|
|
80
81
|
|
|
81
82
|
// These on-by-default rules work well for this repo if configured
|
|
82
83
|
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],${options.excludeLintPerfectionist ? "" : `
|
|
84
|
+
"n/no-unsupported-features/node-builtins": [
|
|
85
|
+
"error",
|
|
86
|
+
{ allowExperimental: true },
|
|
87
|
+
],
|
|
83
88
|
"perfectionist/sort-objects": [
|
|
84
89
|
"error",
|
|
85
90
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/createESLintConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintConfig(options: Options) {\n\tconst tseslintBase = options.excludeLintStrict ? \"recommended\" : \"strict\";\n\n\tconst imports = [\n\t\t`import eslint from \"@eslint/js\";`,\n\t\t!options.excludeLintESLint &&\n\t\t\t`import comments from \"@eslint-community/eslint-plugin-eslint-comments/configs\";`,\n\t\t!options.excludeLintJSDoc && `import jsdoc from \"eslint-plugin-jsdoc\";`,\n\t\t!options.excludeLintJson && `import jsonc from \"eslint-plugin-jsonc\";`,\n\t\t!options.excludeLintMd && `import markdown from \"eslint-plugin-markdown\";`,\n\t\t`import n from \"eslint-plugin-n\";`,\n\t\t!options.excludeLintPackageJson &&\n\t\t\t`import packageJson from \"eslint-plugin-package-json/configs/recommended\";`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`import perfectionist from \"eslint-plugin-perfectionist\";`,\n\t\t!options.excludeLintRegex &&\n\t\t\t`import * as regexp from \"eslint-plugin-regexp\";`,\n\t\t!options.excludeTests && `import vitest from \"eslint-plugin-vitest\";`,\n\t\t!options.excludeLintYml && `import yml from \"eslint-plugin-yml\";`,\n\t\t`import tseslint from \"typescript-eslint\";`,\n\t].filter(Boolean);\n\n\tconst elements = [\n\t\t`eslint.configs.recommended,`,\n\t\t!options.excludeLintJson &&\n\t\t\t`\t...jsonc.configs[\"flat/recommended-with-json\"],`,\n\t\t!options.excludeLintMd && `\t...markdown.configs.recommended,`,\n\t\t!options.excludeLintYml && `\t...yml.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintYml && `\t...yml.configs[\"flat/prettier\"],`,\n\t\t!options.excludeLintESLint && `\tcomments.recommended,`,\n\t\t!options.excludeLintJSDoc &&\n\t\t\t`\tjsdoc.configs[\"flat/recommended-typescript-error\"],`,\n\t\t`\tn.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintPackageJson && `\tpackageJson,`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`\tperfectionist.configs[\"recommended-natural\"],`,\n\t\t!options.excludeLintRegex && `\tregexp.configs[\"flat/recommended\"],`,\n\t].filter(Boolean);\n\n\treturn await formatTypeScript(`${imports.join(\"\\n\")}\n\nexport default tseslint.config(\n\t{\n\t\tignores: [${\n\t\t\toptions.excludeTests\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\t\t\"coverage*\",`\n\t\t}\n\t\t\t\"lib\",\n\t\t\t\"node_modules\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t\t\"**/*.snap\",\n\t\t],\n\t},\n\t{\n\t\tlinterOptions: {\n\t\t\treportUnusedDisableDirectives: \"error\",\n\t\t},\n\t},\n\t${elements.join(\"\\n\")}\n\t...tseslint.config({\n\t\textends: ${\n\t\t\toptions.excludeLintStylistic\n\t\t\t\t? `tseslint.configs.${tseslintBase}TypeChecked`\n\t\t\t\t: `[\n\t\t\t...tseslint.configs.${tseslintBase}TypeChecked,\n\t\t\t...tseslint.configs.stylisticTypeChecked,\n\t\t]`\n\t\t},\n\t\tfiles: [\"**/*.js\", \"**/*.ts\"],\n\t\tlanguageOptions: {\n\t\t\tparserOptions: {\n\t\t\t\tprojectService: {\n\t\t\t\t\tallowDefaultProject: [\"*.*s\", \"eslint.config.js\"],\n\t\t\t\t\tdefaultProject: \"./tsconfig.json\",\n\t\t\t\t},\n\t\t\t\ttsconfigRootDir: import.meta.dirname\n\t\t\t},\n\t\t},\n\t\trules: {\n\t\t\t${\n\t\t\t\t!options.excludeLintJSDoc || !options.excludeLintStylistic\n\t\t\t\t\t? \"// These off-by-default rules work well for this repo and we like them on.\"\n\t\t\t\t\t: \"\"\n\t\t\t}${\n\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"jsdoc/informative-docs\": \"error\",`\n\t\t\t}${\n\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"logical-assignment-operators\": [\n\t\t\t\t\"error\",\n\t\t\t\t\"always\",\n\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t],\n\t\t\t\"operator-assignment\": \"error\",`\n\t\t\t}\n\n\t\t\t// These on-by-default rules don't work well for this repo and we like them off.${\n\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"jsdoc/require-jsdoc\": \"off\",\n\t\t\t\"jsdoc/require-param\": \"off\",\n\t\t\t\"jsdoc/require-property\": \"off\",\n\t\t\t\"jsdoc/require-returns\": \"off\",`\n\t\t\t}\n\t\t\t\"no-constant-condition\": \"off\",\n\n\t\t\t// These on-by-default rules work well for this repo if configured\n\t\t\t\"@typescript-eslint/no-unused-vars\": [\"error\", { caughtErrors: \"all\" }],${\n\t\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"perfectionist/sort-objects\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: \"asc\",\n\t\t\t\t\tpartitionByComment: true,\n\t\t\t\t\ttype: \"natural\",\n\t\t\t\t},\n\t\t\t],`\n\t\t\t}${\n\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\n\t\t\t// Stylistic concerns that don't interfere with Prettier\n\t\t\t\"no-useless-rename\": \"error\",\n\t\t\t\"object-shorthand\": \"error\",`\n\t\t\t}\n\t\t},\n\t}),\n\t{\n\t\tfiles: [\"*.jsonc\"],\n\t\trules: {\n\t\t\t\"jsonc/comma-dangle\": \"off\",\n\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t\"jsonc/sort-keys\": \"error\",\n\t\t},\n\t},\n\t{\n\t\textends: [tseslint.configs.disableTypeChecked],\n\t\tfiles: [\"**/*.md/*.ts\"],\n\t\trules: {\n\t\t\t\"n/no-missing-import\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ allowModules: [\"${options.repository}\"] },\n\t\t\t],\n\t\t},\n\t},${\n\t\toptions.excludeTests\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\tfiles: [\"**/*.test.*\"],\n\t\tlanguageOptions: {\n\t\t\tglobals: vitest.environments.env.globals,\n\t\t},\n\t\tplugins: { vitest, },\n\t\trules: {\n\t\t\t...vitest.configs.recommended.rules,\n\n\t\t\t// These on-by-default rules aren't useful in test files.\n\t\t\t\"@typescript-eslint/no-unsafe-assignment\": \"off\",\n\t\t\t\"@typescript-eslint/no-unsafe-call\": \"off\",\n\t\t},\n\t},`\n\t}${\n\t\toptions.excludeLintYml\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\tfiles: [\"**/*.{yml,yaml}\"],\n\t\trules: {\n\t\t\t\"yml/file-extension\": [\"error\", { extension: \"yml\" }],\n\t\t\t\"yml/sort-keys\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\tpathPattern: \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A;AAAA;AAAA;AAAA,GAYC,SAAS,KAAK,IAAI,CAAC;AAAA;AAAA,aAGnB,QAAQ,uBACL,oBAAoB,YAAY,gBAChC;AAAA,yBACmB,YAAY;AAAA;AAAA,IAGnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAaE,CAAC,QAAQ,oBAAoB,CAAC,QAAQ,uBACnC,+EACA,EACJ,GACC,QAAQ,mBACL,KACA;AAAA,sCAEJ,GACC,QAAQ,uBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAOJ;AAAA;AAAA,qFAGC,QAAQ,mBACL,KACA;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/createESLintConfig.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\n\nexport async function createESLintConfig(options: Options) {\n\tconst tseslintBase = options.excludeLintStrict ? \"recommended\" : \"strict\";\n\n\tconst imports = [\n\t\t`import eslint from \"@eslint/js\";`,\n\t\t!options.excludeLintESLint &&\n\t\t\t`import comments from \"@eslint-community/eslint-plugin-eslint-comments/configs\";`,\n\t\t!options.excludeLintJSDoc && `import jsdoc from \"eslint-plugin-jsdoc\";`,\n\t\t!options.excludeLintJson && `import jsonc from \"eslint-plugin-jsonc\";`,\n\t\t!options.excludeLintMd && `import markdown from \"eslint-plugin-markdown\";`,\n\t\t`import n from \"eslint-plugin-n\";`,\n\t\t!options.excludeLintPackageJson &&\n\t\t\t`import packageJson from \"eslint-plugin-package-json/configs/recommended\";`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`import perfectionist from \"eslint-plugin-perfectionist\";`,\n\t\t!options.excludeLintRegex &&\n\t\t\t`import * as regexp from \"eslint-plugin-regexp\";`,\n\t\t!options.excludeTests && `import vitest from \"eslint-plugin-vitest\";`,\n\t\t!options.excludeLintYml && `import yml from \"eslint-plugin-yml\";`,\n\t\t`import tseslint from \"typescript-eslint\";`,\n\t].filter(Boolean);\n\n\tconst elements = [\n\t\t`eslint.configs.recommended,`,\n\t\t!options.excludeLintJson &&\n\t\t\t`\t...jsonc.configs[\"flat/recommended-with-json\"],`,\n\t\t!options.excludeLintMd && `\t...markdown.configs.recommended,`,\n\t\t!options.excludeLintYml && `\t...yml.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintYml && `\t...yml.configs[\"flat/prettier\"],`,\n\t\t!options.excludeLintESLint && `\tcomments.recommended,`,\n\t\t!options.excludeLintJSDoc &&\n\t\t\t`\tjsdoc.configs[\"flat/recommended-typescript-error\"],`,\n\t\t`\tn.configs[\"flat/recommended\"],`,\n\t\t!options.excludeLintPackageJson && `\tpackageJson,`,\n\t\t!options.excludeLintPerfectionist &&\n\t\t\t`\tperfectionist.configs[\"recommended-natural\"],`,\n\t\t!options.excludeLintRegex && `\tregexp.configs[\"flat/recommended\"],`,\n\t].filter(Boolean);\n\n\treturn await formatTypeScript(`${imports.join(\"\\n\")}\n\nexport default tseslint.config(\n\t{\n\t\tignores: [${\n\t\t\toptions.excludeTests\n\t\t\t\t? \"\"\n\t\t\t\t: `\n\t\t\t\"coverage*\",`\n\t\t}\n\t\t\t\"lib\",\n\t\t\t\"node_modules\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t\t\"**/*.snap\",\n\t\t],\n\t},\n\t{\n\t\tlinterOptions: {\n\t\t\treportUnusedDisableDirectives: \"error\",\n\t\t},\n\t},\n\t${elements.join(\"\\n\")}\n\t...tseslint.config({\n\t\textends: ${\n\t\t\toptions.excludeLintStylistic\n\t\t\t\t? `tseslint.configs.${tseslintBase}TypeChecked`\n\t\t\t\t: `[\n\t\t\t...tseslint.configs.${tseslintBase}TypeChecked,\n\t\t\t...tseslint.configs.stylisticTypeChecked,\n\t\t]`\n\t\t},\n\t\tfiles: [\"**/*.js\", \"**/*.ts\"],\n\t\tlanguageOptions: {\n\t\t\tparserOptions: {\n\t\t\t\tprojectService: {\n\t\t\t\t\tallowDefaultProject: [\"*.*s\", \"eslint.config.js\"],\n\t\t\t\t\tdefaultProject: \"./tsconfig.json\",\n\t\t\t\t},\n\t\t\t\ttsconfigRootDir: import.meta.dirname\n\t\t\t},\n\t\t},\n\t\trules: {\n\t\t\t${\n\t\t\t\t!options.excludeLintJSDoc || !options.excludeLintStylistic\n\t\t\t\t\t? \"// These off-by-default rules work well for this repo and we like them on.\"\n\t\t\t\t\t: \"\"\n\t\t\t}${\n\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"jsdoc/informative-docs\": \"error\",`\n\t\t\t}${\n\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"logical-assignment-operators\": [\n\t\t\t\t\"error\",\n\t\t\t\t\"always\",\n\t\t\t\t{ enforceForIfStatements: true },\n\t\t\t],\n\t\t\t\"operator-assignment\": \"error\",`\n\t\t\t}\n\n\t\t\t// These on-by-default rules don't work well for this repo and we like them off.${\n\t\t\t\toptions.excludeLintJSDoc\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"jsdoc/lines-before-block\": \"off\",\n\t\t\t\"jsdoc/require-jsdoc\": \"off\",\n\t\t\t\"jsdoc/require-param\": \"off\",\n\t\t\t\"jsdoc/require-property\": \"off\",\n\t\t\t\"jsdoc/require-returns\": \"off\",`\n\t\t\t}\n\t\t\t\"no-constant-condition\": \"off\",\n\n\t\t\t// These on-by-default rules work well for this repo if configured\n\t\t\t\"@typescript-eslint/no-unused-vars\": [\"error\", { caughtErrors: \"all\" }],${\n\t\t\t\toptions.excludeLintPerfectionist\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\t\t\t\"n/no-unsupported-features/node-builtins\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ allowExperimental: true },\n\t\t\t],\n\t\t\t\"perfectionist/sort-objects\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: \"asc\",\n\t\t\t\t\tpartitionByComment: true,\n\t\t\t\t\ttype: \"natural\",\n\t\t\t\t},\n\t\t\t],`\n\t\t\t}${\n\t\t\t\toptions.excludeLintStylistic\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: `\n\n\t\t\t// Stylistic concerns that don't interfere with Prettier\n\t\t\t\"no-useless-rename\": \"error\",\n\t\t\t\"object-shorthand\": \"error\",`\n\t\t\t}\n\t\t},\n\t}),\n\t{\n\t\tfiles: [\"*.jsonc\"],\n\t\trules: {\n\t\t\t\"jsonc/comma-dangle\": \"off\",\n\t\t\t\"jsonc/no-comments\": \"off\",\n\t\t\t\"jsonc/sort-keys\": \"error\",\n\t\t},\n\t},\n\t{\n\t\textends: [tseslint.configs.disableTypeChecked],\n\t\tfiles: [\"**/*.md/*.ts\"],\n\t\trules: {\n\t\t\t\"n/no-missing-import\": [\n\t\t\t\t\"error\",\n\t\t\t\t{ allowModules: [\"${options.repository}\"] },\n\t\t\t],\n\t\t},\n\t},${\n\t\toptions.excludeTests\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\tfiles: [\"**/*.test.*\"],\n\t\tlanguageOptions: {\n\t\t\tglobals: vitest.environments.env.globals,\n\t\t},\n\t\tplugins: { vitest, },\n\t\trules: {\n\t\t\t...vitest.configs.recommended.rules,\n\n\t\t\t// These on-by-default rules aren't useful in test files.\n\t\t\t\"@typescript-eslint/no-unsafe-assignment\": \"off\",\n\t\t\t\"@typescript-eslint/no-unsafe-call\": \"off\",\n\t\t},\n\t},`\n\t}${\n\t\toptions.excludeLintYml\n\t\t\t? \"\"\n\t\t\t: `\n\t{\n\t\tfiles: [\"**/*.{yml,yaml}\"],\n\t\trules: {\n\t\t\t\"yml/file-extension\": [\"error\", { extension: \"yml\" }],\n\t\t\t\"yml/sort-keys\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\torder: { type: \"asc\" },\n\t\t\t\t\t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AAA;AAAA;AAAA;AAAA;AAAA,GAYC,SAAS,KAAK,IAAI,CAAC;AAAA;AAAA,aAGnB,QAAQ,uBACL,oBAAoB,YAAY,gBAChC;AAAA,yBACmB,YAAY;AAAA;AAAA,IAGnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAaE,CAAC,QAAQ,oBAAoB,CAAC,QAAQ,uBACnC,+EACA,EACJ,GACC,QAAQ,mBACL,KACA;AAAA,sCAEJ,GACC,QAAQ,uBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAOJ;AAAA;AAAA,qFAGC,QAAQ,mBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAMJ;AAAA;AAAA;AAAA;AAAA,6EAKC,QAAQ,2BACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAaJ,GACC,QAAQ,uBACL,KACA;AAAA;AAAA;AAAA;AAAA,gCAKJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAiBqB,QAAQ,UAAU;AAAA;AAAA;AAAA,KAIxC,QAAQ,eACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAeJ,GACC,QAAQ,iBACL,KACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAqBJ;AAAA;AAAA,CAEA;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/steps/writing/creation/dotGitHub/createDevelopment/index.ts"],"sourcesContent":["import { readFileSafe } from \"../../../../../shared/readFileSafe.js\";\nimport { Options } from \"../../../../../shared/types.js\";\nimport { splitIntoSections } from \"./splitIntoSections.js\";\n\nconst headingAliases = new Map([\n\t[\"build\", \"Building\"],\n\t[\"builds\", \"Building\"],\n\t[\"format\", \"Formatting\"],\n\t[\"lint\", \"Linting\"],\n\t[\"test\", \"Testing\"],\n\t[\"tests\", \"Testing\"],\n]);\n\nfunction createLintingSection(options: Options) {\n\tconst lintLines = [\n\t\t!options.excludeLintKnip &&\n\t\t\t`- \\`pnpm lint:knip\\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`,\n\t\t!options.excludeLintMd &&\n\t\t\t`- \\`pnpm lint:md\\` ([Markdownlint](https://github.com/DavidAnson/markdownlint): Checks Markdown source files`,\n\t\t!options.excludeLintPackages &&\n\t\t\t`- \\`pnpm lint:packages\\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \\`pnpm-lock.yml\\` file`,\n\t\t!options.excludeLintSpelling &&\n\t\t\t`- \\`pnpm lint:spelling\\` ([cspell](https://cspell.org)): Spell checks across all source files`,\n\t].filter(Boolean);\n\n\treturn lintLines.length\n\t\t? [\n\t\t\t\t`This package includes several forms of linting to enforce consistent code quality and styling.`,\n\t\t\t\t`Each should be shown in VS Code, and can be run manually on the command-line:`,\n\t\t\t\t``,\n\t\t\t\t`- \\`pnpm lint\\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files`,\n\t\t\t\t...lintLines,\n\t\t\t\t``,\n\t\t\t\t`Read the individual documentation for each linter to understand how it can be configured and used best.`,\n\t\t\t\t``,\n\t\t\t\t`For example, ESLint can be run with \\`--fix\\` to auto-fix some lint rule complaints:`,\n\t\t
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/steps/writing/creation/dotGitHub/createDevelopment/index.ts"],"sourcesContent":["import { readFileSafe } from \"../../../../../shared/readFileSafe.js\";\nimport { Options } from \"../../../../../shared/types.js\";\nimport { splitIntoSections } from \"./splitIntoSections.js\";\n\nconst headingAliases = new Map([\n\t[\"build\", \"Building\"],\n\t[\"builds\", \"Building\"],\n\t[\"format\", \"Formatting\"],\n\t[\"lint\", \"Linting\"],\n\t[\"test\", \"Testing\"],\n\t[\"tests\", \"Testing\"],\n]);\n\nfunction createLintingSection(options: Options) {\n\tconst lintLines = [\n\t\t!options.excludeLintKnip &&\n\t\t\t`- \\`pnpm lint:knip\\` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports`,\n\t\t!options.excludeLintMd &&\n\t\t\t`- \\`pnpm lint:md\\` ([Markdownlint](https://github.com/DavidAnson/markdownlint): Checks Markdown source files`,\n\t\t!options.excludeLintPackages &&\n\t\t\t`- \\`pnpm lint:packages\\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \\`pnpm-lock.yml\\` file`,\n\t\t!options.excludeLintSpelling &&\n\t\t\t`- \\`pnpm lint:spelling\\` ([cspell](https://cspell.org)): Spell checks across all source files`,\n\t].filter(Boolean);\n\n\treturn lintLines.length\n\t\t? [\n\t\t\t\t`This package includes several forms of linting to enforce consistent code quality and styling.`,\n\t\t\t\t`Each should be shown in VS Code, and can be run manually on the command-line:`,\n\t\t\t\t``,\n\t\t\t\t`- \\`pnpm lint\\` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files`,\n\t\t\t\t...lintLines,\n\t\t\t\t``,\n\t\t\t\t`Read the individual documentation for each linter to understand how it can be configured and used best.`,\n\t\t\t\t``,\n\t\t\t\t`For example, ESLint can be run with \\`--fix\\` to auto-fix some lint rule complaints:`,\n\t\t\t].join(\"\\n\")\n\t\t: `[ESLint](https://eslint.org) is used with with [typescript-eslint](https://typescript-eslint.io)) to lint JavaScript and TypeScript source files.\nYou can run it locally on the command-line:\n\n\\`\\`\\`shell\npnpm run lint\n\\`\\`\\`\n\nESLint can be run with \\`--fix\\` to auto-fix some lint rule complaints:`;\n}\n\nexport async function createDevelopment(options: Options) {\n\tconst existingContents = await readFileSafe(\".github/DEVELOPMENT.md\", \"\");\n\n\tconst newSections = {\n\t\t\"## Building\": `Run [**tsup**](https://tsup.egoist.dev) locally to build source files from \\`src/\\` into output files in \\`lib/\\`:\n\n\\`\\`\\`shell\npnpm build\n\\`\\`\\`\n\nAdd \\`--watch\\` to run the builder in a watch mode that continuously cleans and recreates \\`lib/\\` as you save files:\n\n\\`\\`\\`shell\npnpm build --watch\n\\`\\`\\``,\n\t\t\"## Formatting\": `[Prettier](https://prettier.io) is used to format code.\nIt should be applied automatically when you save files in VS Code or make a Git commit.\n\nTo manually reformat all files, you can run:\n\n\\`\\`\\`shell\npnpm format --write\n\\`\\`\\``,\n\t\t\"## Linting\": `${createLintingSection(options)}\n\n\\`\\`\\`shell\npnpm run lint --fix\n\\`\\`\\`\n\nNote that you'll likely need to run \\`pnpm build\\` before \\`pnpm lint\\` so that lint rules which check the file system can pick up on any built files.`,\n\t\t...(!options.excludeTests && {\n\t\t\t\"## Testing\": `[Vitest](https://vitest.dev) is used for tests.\nYou can run it locally on the command-line:\n\n\\`\\`\\`shell\npnpm run test\n\\`\\`\\`\n\nAdd the \\`--coverage\\` flag to compute test coverage and place reports in the \\`coverage/\\` directory:\n\n\\`\\`\\`shell\npnpm run test --coverage\n\\`\\`\\`\n\nNote that [console-fail-test](https://github.com/JoshuaKGoldberg/console-fail-test) is enabled for all test runs.\nCalls to \\`console.log\\`, \\`console.warn\\`, and other console methods will cause a test to fail.`,\n\n\t\t\t\"### Debugging Tests\": `This repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging unit tests.\nTo launch it, open a test file, then run _Debug Current Test File_ from the VS Code Debug panel (or press F5).`,\n\t\t}),\n\t\t\"## Type Checking\": `You should be able to see suggestions from [TypeScript](https://typescriptlang.org) in your editor for all open files.\n\nHowever, it can be useful to run the TypeScript command-line (\\`tsc\\`) to type check all files in \\`src/\\`:\n\n\\`\\`\\`shell\npnpm tsc\n\\`\\`\\`\n\nAdd \\`--watch\\` to keep the type checker running in a watch mode that updates the display as you save files:\n\n\\`\\`\\`shell\npnpm tsc --watch\n\\`\\`\\``,\n\t};\n\n\tconst newSectionHeadings = new Set([\n\t\t\"Development\",\n\t\tObject.keys(newSections).map((key) => key.replace(/^#* /, \"\")),\n\t]);\n\n\tconst preservedSections = Object.fromEntries(\n\t\tsplitIntoSections(existingContents).filter(([key]) => {\n\t\t\tconst keyText = key.replace(/^#* /, \"\");\n\t\t\treturn !newSectionHeadings.has(\n\t\t\t\theadingAliases.get(keyText.toLowerCase()) ?? keyText,\n\t\t\t);\n\t\t}),\n\t);\n\n\tconst result = `# Development\n${\n\toptions.guide\n\t\t? `\n> If you'd like a more guided walkthrough, see [${options.guide.title}](${options.guide.href}).\n> It'll walk you through the common activities you'll need to contribute.\n`\n\t\t: \"\"\n}\nAfter [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation):\n\n\\`\\`\\`shell\ngit clone https://github.com/<your-name-here>/${options.repository}\ncd ${options.repository}\npnpm install\n\\`\\`\\`\n\n> This repository includes a list of suggested VS Code extensions.\n> It's a good idea to use [VS Code](https://code.visualstudio.com) and accept its suggestion to install them, as they'll help with development.\n\n${Object.entries({ ...newSections, ...preservedSections })\n\t.map(\n\t\t([heading, content]) => `${heading}\n\n${content}`,\n\t)\n\t.join(\"\\n\\n\")}\n`;\n\n\treturn result;\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAElC,MAAM,iBAAiB,oBAAI,IAAI;AAAA,EAC9B,CAAC,SAAS,UAAU;AAAA,EACpB,CAAC,UAAU,UAAU;AAAA,EACrB,CAAC,UAAU,YAAY;AAAA,EACvB,CAAC,QAAQ,SAAS;AAAA,EAClB,CAAC,QAAQ,SAAS;AAAA,EAClB,CAAC,SAAS,SAAS;AACpB,CAAC;AAED,SAAS,qBAAqB,SAAkB;AAC/C,QAAM,YAAY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QAAQ,QAAQ,EAAE;AACtC,aAAO,CAAC,mBAAmB;AAAA,QAC1B,eAAe,IAAI,QAAQ,YAAY,CAAC,KAAK;AAAA,MAC9C;AAAA,IACD,CAAC;AAAA,EACF;AAEA,QAAM,SAAS;AAAA,EAEf,QAAQ,QACL;AAAA,kDAC8C,QAAQ,MAAM,KAAK,KAAK,QAAQ,MAAM,IAAI;AAAA;AAAA,IAGxF,EACJ;AAAA;AAAA;AAAA;AAAA,gDAIgD,QAAQ,UAAU;AAAA,KAC7D,QAAQ,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOrB,OAAO,QAAQ,EAAE,GAAG,aAAa,GAAG,kBAAkB,CAAC,EACvD;AAAA,IACA,CAAC,CAAC,SAAS,OAAO,MAAM,GAAG,OAAO;AAAA;AAAA,EAElC,OAAO;AAAA,EACR,EACC,KAAK,MAAM,CAAC;AAAA;AAGb,SAAO;AACR;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createWorkflowFile.ts"],"sourcesContent":["import { formatYaml } from \"../formatters/formatYaml.js\";\n\ninterface WorkflowFileConcurrency {\n\t\"cancel-in-progress\"?: boolean;\n\tgroup: string;\n}\n\ninterface WorkflowFileOn {\n\tissue_comment?: {\n\t\ttypes?: string[];\n\t};\n\tissues?: {\n\t\ttypes?: string[];\n\t};\n\tpull_request?:\n\t\t| {\n\t\t\t\tbranches?: string | string[];\n\t\t\t\ttypes?: string[];\n\t\t }\n\t\t| null\n\t\t| string;\n\tpull_request_target?: {\n\t\ttypes: string[];\n\t};\n\tpush?: {\n\t\tbranches: string[];\n\t};\n\trelease?: {\n\t\ttypes: string[];\n\t};\n\tworkflow_dispatch?: null | string;\n}\n\ninterface WorkflowFilePermissions {\n\tcontents?: string;\n\t\"id-token\"?: string;\n\tissues?: string;\n\t\"pull-requests\"?: string;\n}\n\ninterface WorkflowFileStep {\n\tenv?: Record<string, string>;\n\tif?: string;\n\tname?: string;\n\trun?: string;\n\tuses?: string;\n\twith?: Record<string, unknown>;\n}\n\ninterface WorkflowFileOptionsBase {\n\tconcurrency?: WorkflowFileConcurrency;\n\tif?: string;\n\tname: string;\n\ton?: WorkflowFileOn;\n\tpermissions?: WorkflowFilePermissions;\n}\n\ninterface WorkflowFileOptionsRuns extends WorkflowFileOptionsBase {\n\truns: (string | WorkflowFileStep)[];\n}\n\ninterface WorkflowFileOptionsSteps extends WorkflowFileOptionsBase {\n\tsteps: WorkflowFileStep[];\n}\n\ntype WorkflowFileOptions = WorkflowFileOptionsRuns | WorkflowFileOptionsSteps;\n\nexport function createWorkflowFile({\n\tconcurrency,\n\tname,\n\ton = {\n\t\tpull_request: null,\n\t\tpush: {\n\t\t\tbranches: [\"main\"],\n\t\t},\n\t},\n\tpermissions,\n\t...options\n}: WorkflowFileOptions) {\n\treturn (\n\t\tformatYaml({\n\t\t\tconcurrency,\n\t\t\tjobs: {\n\t\t\t\t[name.replaceAll(\" \", \"_\").toLowerCase()]: {\n\t\t\t\t\t...(options.if && { if: options.if }),\n\t\t\t\t\t\"runs-on\": \"ubuntu-latest\",\n\t\t\t\t\tsteps:\n\t\t\t\t\t\t\"runs\" in options\n\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t{ uses: \"actions/checkout@v4\" },\n\t\t\t\t\t\t\t\t\t{ uses: \"./.github/actions/prepare\" },\n\t\t\t\t\t\t\t\t\t...options.runs.map((run) => ({ run })),\n\t\t\t\t\t\t\t
|
|
1
|
+
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createWorkflowFile.ts"],"sourcesContent":["import { formatYaml } from \"../formatters/formatYaml.js\";\n\ninterface WorkflowFileConcurrency {\n\t\"cancel-in-progress\"?: boolean;\n\tgroup: string;\n}\n\ninterface WorkflowFileOn {\n\tissue_comment?: {\n\t\ttypes?: string[];\n\t};\n\tissues?: {\n\t\ttypes?: string[];\n\t};\n\tpull_request?:\n\t\t| {\n\t\t\t\tbranches?: string | string[];\n\t\t\t\ttypes?: string[];\n\t\t }\n\t\t| null\n\t\t| string;\n\tpull_request_target?: {\n\t\ttypes: string[];\n\t};\n\tpush?: {\n\t\tbranches: string[];\n\t};\n\trelease?: {\n\t\ttypes: string[];\n\t};\n\tworkflow_dispatch?: null | string;\n}\n\ninterface WorkflowFilePermissions {\n\tcontents?: string;\n\t\"id-token\"?: string;\n\tissues?: string;\n\t\"pull-requests\"?: string;\n}\n\ninterface WorkflowFileStep {\n\tenv?: Record<string, string>;\n\tif?: string;\n\tname?: string;\n\trun?: string;\n\tuses?: string;\n\twith?: Record<string, unknown>;\n}\n\ninterface WorkflowFileOptionsBase {\n\tconcurrency?: WorkflowFileConcurrency;\n\tif?: string;\n\tname: string;\n\ton?: WorkflowFileOn;\n\tpermissions?: WorkflowFilePermissions;\n}\n\ninterface WorkflowFileOptionsRuns extends WorkflowFileOptionsBase {\n\truns: (string | WorkflowFileStep)[];\n}\n\ninterface WorkflowFileOptionsSteps extends WorkflowFileOptionsBase {\n\tsteps: WorkflowFileStep[];\n}\n\ntype WorkflowFileOptions = WorkflowFileOptionsRuns | WorkflowFileOptionsSteps;\n\nexport function createWorkflowFile({\n\tconcurrency,\n\tname,\n\ton = {\n\t\tpull_request: null,\n\t\tpush: {\n\t\t\tbranches: [\"main\"],\n\t\t},\n\t},\n\tpermissions,\n\t...options\n}: WorkflowFileOptions) {\n\treturn (\n\t\tformatYaml({\n\t\t\tconcurrency,\n\t\t\tjobs: {\n\t\t\t\t[name.replaceAll(\" \", \"_\").toLowerCase()]: {\n\t\t\t\t\t...(options.if && { if: options.if }),\n\t\t\t\t\t\"runs-on\": \"ubuntu-latest\",\n\t\t\t\t\tsteps:\n\t\t\t\t\t\t\"runs\" in options\n\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t{ uses: \"actions/checkout@v4\" },\n\t\t\t\t\t\t\t\t\t{ uses: \"./.github/actions/prepare\" },\n\t\t\t\t\t\t\t\t\t...options.runs.map((run) => ({ run })),\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t: options.steps,\n\t\t\t\t},\n\t\t\t},\n\t\t\tname,\n\t\t\ton,\n\t\t\tpermissions,\n\t\t})\n\t\t\t.replaceAll(/\\n(\\S)/g, \"\\n\\n$1\")\n\t\t\t// https://github.com/nodeca/js-yaml/pull/515\n\t\t\t.replaceAll(/: \"\\\\n(.+)\"/g, \": |\\n$1\")\n\t\t\t.replaceAll(\"\\\\n\", \"\\n\")\n\t\t\t.replaceAll(\"\\\\t\", \" \")\n\t);\n}\n"],"mappings":"AAAA,SAAS,kBAAkB;AAmEpB,SAAS,mBAAmB;AAAA,EAClC;AAAA,EACA;AAAA,EACA,KAAK;AAAA,IACJ,cAAc;AAAA,IACd,MAAM;AAAA,MACL,UAAU,CAAC,MAAM;AAAA,IAClB;AAAA,EACD;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAwB;AACvB,SACC,WAAW;AAAA,IACV;AAAA,IACA,MAAM;AAAA,MACL,CAAC,KAAK,WAAW,KAAK,GAAG,EAAE,YAAY,CAAC,GAAG;AAAA,QAC1C,GAAI,QAAQ,MAAM,EAAE,IAAI,QAAQ,GAAG;AAAA,QACnC,WAAW;AAAA,QACX,OACC,UAAU,UACP;AAAA,UACA,EAAE,MAAM,sBAAsB;AAAA,UAC9B,EAAE,MAAM,4BAA4B;AAAA,UACpC,GAAG,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE;AAAA,QACvC,IACC,QAAQ;AAAA,MACb;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC,EACC,WAAW,WAAW,QAAQ,EAE9B,WAAW,gBAAgB,SAAS,EACpC,WAAW,OAAO,IAAI,EACtB,WAAW,OAAO,IAAI;AAE1B;","names":[]}
|
|
@@ -2,11 +2,7 @@ import { formatIgnoreFile } from "./formatters/formatIgnoreFile.js";
|
|
|
2
2
|
function createDotHusky() {
|
|
3
3
|
return {
|
|
4
4
|
".gitignore": formatIgnoreFile(["_"]),
|
|
5
|
-
"pre-commit": formatIgnoreFile([
|
|
6
|
-
`#!/bin/sh`,
|
|
7
|
-
`. "$(dirname "$0")/_/husky.sh"`,
|
|
8
|
-
"npx lint-staged"
|
|
9
|
-
])
|
|
5
|
+
"pre-commit": formatIgnoreFile(["npx lint-staged"])
|
|
10
6
|
};
|
|
11
7
|
}
|
|
12
8
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/dotHusky.ts"],"sourcesContent":["import { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\n\nexport function createDotHusky() {\n\treturn {\n\t\t\".gitignore\": formatIgnoreFile([\"_\"]),\n\t\t\"pre-commit\": formatIgnoreFile([\
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/dotHusky.ts"],"sourcesContent":["import { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\n\nexport function createDotHusky() {\n\treturn {\n\t\t\".gitignore\": formatIgnoreFile([\"_\"]),\n\t\t\"pre-commit\": formatIgnoreFile([\"npx lint-staged\"]),\n\t};\n}\n"],"mappings":"AAAA,SAAS,wBAAwB;AAE1B,SAAS,iBAAiB;AAChC,SAAO;AAAA,IACN,cAAc,iBAAiB,CAAC,GAAG,CAAC;AAAA,IACpC,cAAc,iBAAiB,CAAC,iBAAiB,CAAC;AAAA,EACnD;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/dotVSCode.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\n/* spellchecker: disable */\nexport async function createDotVSCode(options: Options) {\n\treturn {\n\t\t\"extensions.json\": await formatJson({\n\t\t\trecommendations: [\n\t\t\t\t\"DavidAnson.vscode-markdownlint\",\n\t\t\t\t\"dbaeumer.vscode-eslint\",\n\t\t\t\t\"esbenp.prettier-vscode\",\n\t\t\t\t!options.excludeLintSpelling && \"streetsidesoftware.code-spell-checker\",\n\t\t\t].filter(Boolean),\n\t\t}),\n\t\t...(options.excludeTests && !options.bin\n\t\t\t? {}\n\t\t\t: {\n\t\t\t\t\t\"launch.json\": await formatJson({\n\t\t\t\t\t\tconfigurations: [\n\t\t\t\t\t\t\t...(options.excludeTests\n\t\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t\t: [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\targs: [\"run\", \"${relativeFile}\"],\n\t\t\t\t\t\t\t\t\t\t\tautoAttachChildProcesses: true,\n\t\t\t\t\t\t\t\t\t\t\tconsole: \"integratedTerminal\",\n\t\t\t\t\t\t\t\t\t\t\tname: \"Debug Current Test File\",\n\t\t\t\t\t\t\t\t\t\t\tprogram:\n\t\t\t\t\t\t\t\t\t\t\t\t\"${workspaceRoot}/node_modules/vitest/vitest.mjs\",\n\t\t\t\t\t\t\t\t\t\t\trequest: \"launch\",\n\t\t\t\t\t\t\t\t\t\t\tskipFiles: [\"<node_internals>/**\", \"**/node_modules/**\"],\n\t\t\t\t\t\t\t\t\t\t\tsmartStep: true,\n\t\t\t\t\t\t\t\t\t\t\ttype: \"node\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/dotVSCode.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\n/* spellchecker: disable */\nexport async function createDotVSCode(options: Options) {\n\treturn {\n\t\t\"extensions.json\": await formatJson({\n\t\t\trecommendations: [\n\t\t\t\t\"DavidAnson.vscode-markdownlint\",\n\t\t\t\t\"dbaeumer.vscode-eslint\",\n\t\t\t\t\"esbenp.prettier-vscode\",\n\t\t\t\t!options.excludeLintSpelling && \"streetsidesoftware.code-spell-checker\",\n\t\t\t].filter(Boolean),\n\t\t}),\n\t\t...(options.excludeTests && !options.bin\n\t\t\t? {}\n\t\t\t: {\n\t\t\t\t\t\"launch.json\": await formatJson({\n\t\t\t\t\t\tconfigurations: [\n\t\t\t\t\t\t\t...(options.excludeTests\n\t\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t\t: [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\targs: [\"run\", \"${relativeFile}\"],\n\t\t\t\t\t\t\t\t\t\t\tautoAttachChildProcesses: true,\n\t\t\t\t\t\t\t\t\t\t\tconsole: \"integratedTerminal\",\n\t\t\t\t\t\t\t\t\t\t\tname: \"Debug Current Test File\",\n\t\t\t\t\t\t\t\t\t\t\tprogram:\n\t\t\t\t\t\t\t\t\t\t\t\t\"${workspaceRoot}/node_modules/vitest/vitest.mjs\",\n\t\t\t\t\t\t\t\t\t\t\trequest: \"launch\",\n\t\t\t\t\t\t\t\t\t\t\tskipFiles: [\"<node_internals>/**\", \"**/node_modules/**\"],\n\t\t\t\t\t\t\t\t\t\t\tsmartStep: true,\n\t\t\t\t\t\t\t\t\t\t\ttype: \"node\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t...(options.bin\n\t\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tname: \"Debug Program\",\n\t\t\t\t\t\t\t\t\t\t\tpreLaunchTask: \"build\",\n\t\t\t\t\t\t\t\t\t\t\tprogram: options.bin,\n\t\t\t\t\t\t\t\t\t\t\trequest: \"launch\",\n\t\t\t\t\t\t\t\t\t\t\tskipFiles: [\"<node_internals>/**\"],\n\t\t\t\t\t\t\t\t\t\t\ttype: \"node\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t: []),\n\t\t\t\t\t\t],\n\t\t\t\t\t\tversion: \"0.2.0\",\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\"settings.json\": await formatJson({\n\t\t\t\"editor.codeActionsOnSave\": {\n\t\t\t\t\"source.fixAll.eslint\": \"explicit\",\n\t\t\t},\n\t\t\t\"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n\t\t\t\"editor.formatOnSave\": true,\n\t\t\t\"editor.rulers\": [80],\n\t\t\t\"eslint.probe\": [\n\t\t\t\t\"javascript\",\n\t\t\t\t\"javascriptreact\",\n\t\t\t\t\"json\",\n\t\t\t\t\"jsonc\",\n\t\t\t\t\"markdown\",\n\t\t\t\t\"typescript\",\n\t\t\t\t\"typescriptreact\",\n\t\t\t\t\"yaml\",\n\t\t\t],\n\t\t\t\"eslint.rules.customizations\": [{ rule: \"*\", severity: \"warn\" }],\n\t\t\t\"eslint.useFlatConfig\": true,\n\t\t\t\"typescript.tsdk\": \"node_modules/typescript/lib\",\n\t\t}),\n\t\t\"tasks.json\": await formatJson({\n\t\t\ttasks: [\n\t\t\t\t{\n\t\t\t\t\tdetail: \"Build the project\",\n\t\t\t\t\tlabel: \"build\",\n\t\t\t\t\tscript: \"build\",\n\t\t\t\t\ttype: \"npm\",\n\t\t\t\t},\n\t\t\t],\n\t\t\tversion: \"2.0.0\",\n\t\t}),\n\t};\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAG3B,eAAsB,gBAAgB,SAAkB;AACvD,SAAO;AAAA,IACN,mBAAmB,MAAM,WAAW;AAAA,MACnC,iBAAiB;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA,CAAC,QAAQ,uBAAuB;AAAA,MACjC,EAAE,OAAO,OAAO;AAAA,IACjB,CAAC;AAAA,IACD,GAAI,QAAQ,gBAAgB,CAAC,QAAQ,MAClC,CAAC,IACD;AAAA,MACA,eAAe,MAAM,WAAW;AAAA,QAC/B,gBAAgB;AAAA,UACf,GAAI,QAAQ,eACT,CAAC,IACD;AAAA,YACA;AAAA,cACC,MAAM,CAAC,OAAO,iBAAiB;AAAA,cAC/B,0BAA0B;AAAA,cAC1B,SAAS;AAAA,cACT,MAAM;AAAA,cACN,SACC;AAAA,cACD,SAAS;AAAA,cACT,WAAW,CAAC,uBAAuB,oBAAoB;AAAA,cACvD,WAAW;AAAA,cACX,MAAM;AAAA,YACP;AAAA,UACD;AAAA,UACF,GAAI,QAAQ,MACT;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,eAAe;AAAA,cACf,SAAS,QAAQ;AAAA,cACjB,SAAS;AAAA,cACT,WAAW,CAAC,qBAAqB;AAAA,cACjC,MAAM;AAAA,YACP;AAAA,UACD,IACC,CAAC;AAAA,QACL;AAAA,QACA,SAAS;AAAA,MACV,CAAC;AAAA,IACF;AAAA,IACF,iBAAiB,MAAM,WAAW;AAAA,MACjC,4BAA4B;AAAA,QAC3B,wBAAwB;AAAA,MACzB;AAAA,MACA,2BAA2B;AAAA,MAC3B,uBAAuB;AAAA,MACvB,iBAAiB,CAAC,EAAE;AAAA,MACpB,gBAAgB;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MACA,+BAA+B,CAAC,EAAE,MAAM,KAAK,UAAU,OAAO,CAAC;AAAA,MAC/D,wBAAwB;AAAA,MACxB,mBAAmB;AAAA,IACpB,CAAC;AAAA,IACD,cAAc,MAAM,WAAW;AAAA,MAC9B,OAAO;AAAA,QACN;AAAA,UACC,QAAQ;AAAA,UACR,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,MAAM;AAAA,QACP;AAAA,MACD;AAAA,MACA,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;","names":[]}
|
|
@@ -44,11 +44,13 @@ async function writePackageJson(options) {
|
|
|
44
44
|
// Remove fields we know we don't want, such as old or redundant configs
|
|
45
45
|
eslintConfig: void 0,
|
|
46
46
|
husky: void 0,
|
|
47
|
+
jest: void 0,
|
|
48
|
+
mocha: void 0,
|
|
47
49
|
prettierConfig: void 0,
|
|
48
50
|
types: void 0,
|
|
49
51
|
// The rest of the fields are ones we know from our template
|
|
50
52
|
engines: {
|
|
51
|
-
node: ">=18"
|
|
53
|
+
node: ">=18.3.0"
|
|
52
54
|
},
|
|
53
55
|
files: [
|
|
54
56
|
options.bin?.replace(/^\.\//, ""),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/writePackageJson.ts"],"sourcesContent":["import { readFileSafeAsJson } from \"../../../shared/readFileSafeAsJson.js\";\nimport { Options, PartialPackageData } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\nconst devDependenciesToRemove = [\n\t\"@babel/core\",\n\t\"@babel/preset-env\",\n\t\"@babel/preset-react\",\n\t\"@babel/preset-typescript\",\n\t\"@swc/jest\",\n\t\"@vitest/coverage-istanbul\",\n\t\"ava\",\n\t\"babel-jest\",\n\t\"commitlint\",\n\t\"cson-parser\",\n\t\"esbuild\",\n\t\"eslint-config-prettier\",\n\t\"eslint-plugin-import\",\n\t\"eslint-plugin-jest\",\n\t\"eslint-plugin-prettier\",\n\t\"eslint-plugin-simple-import-sort\",\n\t\"eslint-plugin-typescript-sort-keys\",\n\t\"jasmine\",\n\t\"jest\",\n\t\"mocha\",\n\t\"npm-run-all\",\n\t\"pnpm-deduplicate\",\n\t\"pretty-quick\",\n\t\"ts-jest\",\n];\n\nexport async function writePackageJson(options: Options) {\n\tconst existingPackageJson =\n\t\t((await readFileSafeAsJson(\n\t\t\t\"./package.json\",\n\t\t)) as null | PartialPackageData) ?? {};\n\n\treturn await formatJson({\n\t\t// If we didn't already have a version, set it to 0.0.0\n\t\tversion: \"0.0.0\",\n\n\t\t// To start, copy over all existing package fields (e.g. \"dependencies\")\n\t\t...existingPackageJson,\n\n\t\tauthor: { email: options.email.npm, name: options.author },\n\t\tbin: options.bin,\n\t\tdescription: options.description,\n\t\tkeywords: options.keywords?.length\n\t\t\t? options.keywords.flatMap((keyword) => keyword.split(/ /))\n\t\t\t: undefined,\n\n\t\t// We copy all existing dev dependencies except those we know are not used anymore\n\t\tdevDependencies: copyDevDependencies(existingPackageJson),\n\n\t\t// Remove fields we know we don't want, such as old or redundant configs\n\t\teslintConfig: undefined,\n\t\thusky: undefined,\n\t\tprettierConfig: undefined,\n\t\ttypes: undefined,\n\n\t\t// The rest of the fields are ones we know from our template\n\t\tengines: {\n\t\t\tnode: \">=18\",\n\t\t},\n\t\tfiles: [\n\t\t\toptions.bin?.replace(/^\\.\\//, \"\"),\n\t\t\t\"lib/\",\n\t\t\t\"package.json\",\n\t\t\t\"LICENSE.md\",\n\t\t\t\"README.md\",\n\t\t].filter(Boolean),\n\t\tlicense: \"MIT\",\n\t\t\"lint-staged\": {\n\t\t\t\"*\": \"prettier --ignore-unknown --write\",\n\t\t},\n\t\tmain: \"./lib/index.js\",\n\t\tname: options.repository,\n\t\tpublishConfig: {\n\t\t\tprovenance: true,\n\t\t},\n\t\trepository: {\n\t\t\ttype: \"git\",\n\t\t\turl: `https://github.com/${options.owner}/${options.repository}`,\n\t\t},\n\t\tscripts: {\n\t\t\t...existingPackageJson.scripts,\n\t\t\t...(!options.excludeBuild && {\n\t\t\t\tbuild: \"tsup\",\n\t\t\t}),\n\t\t\tformat: \"prettier .\",\n\t\t\tlint: \"eslint . --max-warnings 0\",\n\t\t\t...(!options.excludeLintKnip && {\n\t\t\t\t\"lint:knip\": \"knip\",\n\t\t\t}),\n\t\t\t...(!options.excludeLintMd && {\n\t\t\t\t\"lint:md\":\n\t\t\t\t\t'markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line',\n\t\t\t}),\n\t\t\t...(!options.excludeLintPackages && {\n\t\t\t\t\"lint:packages\": \"pnpm dedupe --check\",\n\t\t\t}),\n\t\t\t...(!options.excludeLintSpelling && {\n\t\t\t\t\"lint:spelling\": 'cspell \"**\" \".github/**/*\"',\n\t\t\t}),\n\t\t\tprepare: \"husky\",\n\t\t\t...(!options.excludeReleases && { test: \"vitest\" }),\n\t\t\ttsc: \"tsc\",\n\t\t},\n\t\ttype: \"module\",\n\t});\n}\n\nfunction copyDevDependencies(existingPackageJson: object) {\n\tconst devDependencies =\n\t\t\"devDependencies\" in existingPackageJson\n\t\t\t? (existingPackageJson.devDependencies as Record<string, string>)\n\t\t\t: {};\n\n\tfor (const devDependencyToRemove of devDependenciesToRemove) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete devDependencies[devDependencyToRemove];\n\t}\n\n\treturn devDependencies;\n}\n"],"mappings":"AAAA,SAAS,0BAA0B;AAEnC,SAAS,kBAAkB;AAE3B,MAAM,0BAA0B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,eAAsB,iBAAiB,SAAkB;AACxD,QAAM,sBACH,MAAM;AAAA,IACP;AAAA,EACD,KAAoC,CAAC;AAEtC,SAAO,MAAM,WAAW;AAAA;AAAA,IAEvB,SAAS;AAAA;AAAA,IAGT,GAAG;AAAA,IAEH,QAAQ,EAAE,OAAO,QAAQ,MAAM,KAAK,MAAM,QAAQ,OAAO;AAAA,IACzD,KAAK,QAAQ;AAAA,IACb,aAAa,QAAQ;AAAA,IACrB,UAAU,QAAQ,UAAU,SACzB,QAAQ,SAAS,QAAQ,CAAC,YAAY,QAAQ,MAAM,GAAG,CAAC,IACxD;AAAA;AAAA,IAGH,iBAAiB,oBAAoB,mBAAmB;AAAA;AAAA,IAGxD,cAAc;AAAA,IACd,OAAO;AAAA,IACP,gBAAgB;AAAA,IAChB,OAAO;AAAA;AAAA,IAGP,SAAS;AAAA,MACR,MAAM;AAAA,IACP;AAAA,IACA,OAAO;AAAA,MACN,QAAQ,KAAK,QAAQ,SAAS,EAAE;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,EAAE,OAAO,OAAO;AAAA,IAChB,SAAS;AAAA,IACT,eAAe;AAAA,MACd,KAAK;AAAA,IACN;AAAA,IACA,MAAM;AAAA,IACN,MAAM,QAAQ;AAAA,IACd,eAAe;AAAA,MACd,YAAY;AAAA,IACb;AAAA,IACA,YAAY;AAAA,MACX,MAAM;AAAA,MACN,KAAK,sBAAsB,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA,IAC/D;AAAA,IACA,SAAS;AAAA,MACR,GAAG,oBAAoB;AAAA,MACvB,GAAI,CAAC,QAAQ,gBAAgB;AAAA,QAC5B,OAAO;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,GAAI,CAAC,QAAQ,mBAAmB;AAAA,QAC/B,aAAa;AAAA,MACd;AAAA,MACA,GAAI,CAAC,QAAQ,iBAAiB;AAAA,QAC7B,WACC;AAAA,MACF;AAAA,MACA,GAAI,CAAC,QAAQ,uBAAuB;AAAA,QACnC,iBAAiB;AAAA,MAClB;AAAA,MACA,GAAI,CAAC,QAAQ,uBAAuB;AAAA,QACnC,iBAAiB;AAAA,MAClB;AAAA,MACA,SAAS;AAAA,MACT,GAAI,CAAC,QAAQ,mBAAmB,EAAE,MAAM,SAAS;AAAA,MACjD,KAAK;AAAA,IACN;AAAA,IACA,MAAM;AAAA,EACP,CAAC;AACF;AAEA,SAAS,oBAAoB,qBAA6B;AACzD,QAAM,kBACL,qBAAqB,sBACjB,oBAAoB,kBACrB,CAAC;AAEL,aAAW,yBAAyB,yBAAyB;AAE5D,WAAO,gBAAgB,qBAAqB;AAAA,EAC7C;AAEA,SAAO;AACR;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/writePackageJson.ts"],"sourcesContent":["import { readFileSafeAsJson } from \"../../../shared/readFileSafeAsJson.js\";\nimport { Options, PartialPackageData } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\nconst devDependenciesToRemove = [\n\t\"@babel/core\",\n\t\"@babel/preset-env\",\n\t\"@babel/preset-react\",\n\t\"@babel/preset-typescript\",\n\t\"@swc/jest\",\n\t\"@vitest/coverage-istanbul\",\n\t\"ava\",\n\t\"babel-jest\",\n\t\"commitlint\",\n\t\"cson-parser\",\n\t\"esbuild\",\n\t\"eslint-config-prettier\",\n\t\"eslint-plugin-import\",\n\t\"eslint-plugin-jest\",\n\t\"eslint-plugin-prettier\",\n\t\"eslint-plugin-simple-import-sort\",\n\t\"eslint-plugin-typescript-sort-keys\",\n\t\"jasmine\",\n\t\"jest\",\n\t\"mocha\",\n\t\"npm-run-all\",\n\t\"pnpm-deduplicate\",\n\t\"pretty-quick\",\n\t\"ts-jest\",\n];\n\nexport async function writePackageJson(options: Options) {\n\tconst existingPackageJson =\n\t\t((await readFileSafeAsJson(\n\t\t\t\"./package.json\",\n\t\t)) as null | PartialPackageData) ?? {};\n\n\treturn await formatJson({\n\t\t// If we didn't already have a version, set it to 0.0.0\n\t\tversion: \"0.0.0\",\n\n\t\t// To start, copy over all existing package fields (e.g. \"dependencies\")\n\t\t...existingPackageJson,\n\n\t\tauthor: { email: options.email.npm, name: options.author },\n\t\tbin: options.bin,\n\t\tdescription: options.description,\n\t\tkeywords: options.keywords?.length\n\t\t\t? options.keywords.flatMap((keyword) => keyword.split(/ /))\n\t\t\t: undefined,\n\n\t\t// We copy all existing dev dependencies except those we know are not used anymore\n\t\tdevDependencies: copyDevDependencies(existingPackageJson),\n\n\t\t// Remove fields we know we don't want, such as old or redundant configs\n\t\teslintConfig: undefined,\n\t\thusky: undefined,\n\t\tjest: undefined,\n\t\tmocha: undefined,\n\t\tprettierConfig: undefined,\n\t\ttypes: undefined,\n\n\t\t// The rest of the fields are ones we know from our template\n\t\tengines: {\n\t\t\tnode: \">=18.3.0\",\n\t\t},\n\t\tfiles: [\n\t\t\toptions.bin?.replace(/^\\.\\//, \"\"),\n\t\t\t\"lib/\",\n\t\t\t\"package.json\",\n\t\t\t\"LICENSE.md\",\n\t\t\t\"README.md\",\n\t\t].filter(Boolean),\n\t\tlicense: \"MIT\",\n\t\t\"lint-staged\": {\n\t\t\t\"*\": \"prettier --ignore-unknown --write\",\n\t\t},\n\t\tmain: \"./lib/index.js\",\n\t\tname: options.repository,\n\t\tpublishConfig: {\n\t\t\tprovenance: true,\n\t\t},\n\t\trepository: {\n\t\t\ttype: \"git\",\n\t\t\turl: `https://github.com/${options.owner}/${options.repository}`,\n\t\t},\n\t\tscripts: {\n\t\t\t...existingPackageJson.scripts,\n\t\t\t...(!options.excludeBuild && {\n\t\t\t\tbuild: \"tsup\",\n\t\t\t}),\n\t\t\tformat: \"prettier .\",\n\t\t\tlint: \"eslint . --max-warnings 0\",\n\t\t\t...(!options.excludeLintKnip && {\n\t\t\t\t\"lint:knip\": \"knip\",\n\t\t\t}),\n\t\t\t...(!options.excludeLintMd && {\n\t\t\t\t\"lint:md\":\n\t\t\t\t\t'markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line',\n\t\t\t}),\n\t\t\t...(!options.excludeLintPackages && {\n\t\t\t\t\"lint:packages\": \"pnpm dedupe --check\",\n\t\t\t}),\n\t\t\t...(!options.excludeLintSpelling && {\n\t\t\t\t\"lint:spelling\": 'cspell \"**\" \".github/**/*\"',\n\t\t\t}),\n\t\t\tprepare: \"husky\",\n\t\t\t...(!options.excludeReleases && { test: \"vitest\" }),\n\t\t\ttsc: \"tsc\",\n\t\t},\n\t\ttype: \"module\",\n\t});\n}\n\nfunction copyDevDependencies(existingPackageJson: object) {\n\tconst devDependencies =\n\t\t\"devDependencies\" in existingPackageJson\n\t\t\t? (existingPackageJson.devDependencies as Record<string, string>)\n\t\t\t: {};\n\n\tfor (const devDependencyToRemove of devDependenciesToRemove) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete devDependencies[devDependencyToRem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;AAAA,IACb;AAAA,IACA,YAAY;AAAA,MACX,MAAM;AAAA,MACN,KAAK,sBAAsB,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA,IAC/D;AAAA,IACA,SAAS;AAAA,MACR,GAAG,oBAAoB;AAAA,MACvB,GAAI,CAAC,QAAQ,gBAAgB;AAAA,QAC5B,OAAO;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,GAAI,CAAC,QAAQ,mBAAmB;AAAA,QAC/B,aAAa;AAAA,MACd;AAAA,MACA,GAAI,CAAC,QAAQ,iBAAiB;AAAA,QAC7B,WACC;AAAA,MACF;AAAA,MACA,GAAI,CAAC,QAAQ,uBAAuB;AAAA,QACnC,iBAAiB;AAAA,MAClB;AAAA,MACA,GAAI,CAAC,QAAQ,uBAAuB;AAAA,QACnC,iBAAiB;AAAA,MAClB;AAAA,MACA,SAAS;AAAA,MACT,GAAI,CAAC,QAAQ,mBAAmB,EAAE,MAAM,SAAS;AAAA,MACjD,KAAK;AAAA,IACN;AAAA,IACA,MAAM;AAAA,EACP,CAAC;AACF;AAEA,SAAS,oBAAoB,qBAA6B;AACzD,QAAM,kBACL,qBAAqB,sBACjB,oBAAoB,kBACrB,CAAC;AAEL,aAAW,yBAAyB,yBAAyB;AAE5D,WAAO,gBAAgB,qBAAqB;AAAA,EAC7C;AAEA,SAAO;AACR;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-typescript-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.66.0",
|
|
4
4
|
"description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,69 +42,69 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@clack/prompts": "^0.7.0",
|
|
45
|
-
"all-contributors-for-repository": "^0.2.
|
|
45
|
+
"all-contributors-for-repository": "^0.2.2",
|
|
46
46
|
"chalk": "^5.3.0",
|
|
47
|
-
"execa": "^9.
|
|
47
|
+
"execa": "^9.3.0",
|
|
48
48
|
"get-github-auth-token": "^0.1.0",
|
|
49
49
|
"git-remote-origin-url": "^4.0.0",
|
|
50
|
-
"git-url-parse": "^14.
|
|
50
|
+
"git-url-parse": "^14.1.0",
|
|
51
51
|
"js-yaml": "^4.1.0",
|
|
52
52
|
"lazy-value": "^3.0.0",
|
|
53
|
-
"npm-user": "^6.
|
|
54
|
-
"octokit": "^4.0.
|
|
53
|
+
"npm-user": "^6.1.1",
|
|
54
|
+
"octokit": "^4.0.2",
|
|
55
55
|
"parse-author": "^2.0.0",
|
|
56
|
-
"prettier": "^3.
|
|
57
|
-
"replace-in-file": "^
|
|
58
|
-
"rimraf": "^6.0.
|
|
59
|
-
"title-case": "^4.1
|
|
60
|
-
"zod": "^3.
|
|
61
|
-
"zod-validation-error": "^3.
|
|
56
|
+
"prettier": "^3.3.3",
|
|
57
|
+
"replace-in-file": "^8.1.0",
|
|
58
|
+
"rimraf": "^6.0.1",
|
|
59
|
+
"title-case": "^4.3.1",
|
|
60
|
+
"zod": "^3.23.8",
|
|
61
|
+
"zod-validation-error": "^3.3.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
|
|
65
|
-
"@eslint/js": "^9.
|
|
66
|
-
"@octokit/request-error": "^6.1.
|
|
65
|
+
"@eslint/js": "^9.8.0",
|
|
66
|
+
"@octokit/request-error": "^6.1.4",
|
|
67
67
|
"@release-it/conventional-changelog": "^8.0.1",
|
|
68
68
|
"@types/eslint-plugin-markdown": "^2.0.2",
|
|
69
69
|
"@types/eslint__js": "^8.42.3",
|
|
70
70
|
"@types/git-url-parse": "^9.0.3",
|
|
71
71
|
"@types/js-yaml": "^4.0.9",
|
|
72
|
-
"@types/node": "^
|
|
72
|
+
"@types/node": "^22.1.0",
|
|
73
73
|
"@types/parse-author": "^2.0.3",
|
|
74
|
-
"@vitest/coverage-v8": "^2.0.
|
|
75
|
-
"c8": "^10.
|
|
74
|
+
"@vitest/coverage-v8": "^2.0.5",
|
|
75
|
+
"c8": "^10.1.2",
|
|
76
76
|
"console-fail-test": "^0.4.4",
|
|
77
|
-
"cspell": "^8.1
|
|
78
|
-
"eslint": "^9.
|
|
79
|
-
"eslint-plugin-jsdoc": "^
|
|
80
|
-
"eslint-plugin-jsonc": "^2.
|
|
81
|
-
"eslint-plugin-markdown": "^5.
|
|
82
|
-
"eslint-plugin-n": "^17.
|
|
83
|
-
"eslint-plugin-package-json": "^0.15.
|
|
84
|
-
"eslint-plugin-perfectionist": "^3.1.
|
|
85
|
-
"eslint-plugin-regexp": "^2.
|
|
86
|
-
"eslint-plugin-vitest": "^0.5.
|
|
77
|
+
"cspell": "^8.13.1",
|
|
78
|
+
"eslint": "^9.8.0",
|
|
79
|
+
"eslint-plugin-jsdoc": "^50.0.0",
|
|
80
|
+
"eslint-plugin-jsonc": "^2.16.0",
|
|
81
|
+
"eslint-plugin-markdown": "^5.1.0",
|
|
82
|
+
"eslint-plugin-n": "^17.10.2",
|
|
83
|
+
"eslint-plugin-package-json": "^0.15.2",
|
|
84
|
+
"eslint-plugin-perfectionist": "^3.1.3",
|
|
85
|
+
"eslint-plugin-regexp": "^2.6.0",
|
|
86
|
+
"eslint-plugin-vitest": "^0.5.4",
|
|
87
87
|
"eslint-plugin-yml": "^1.14.0",
|
|
88
|
-
"globby": "^14.0.
|
|
89
|
-
"husky": "^9.
|
|
88
|
+
"globby": "^14.0.2",
|
|
89
|
+
"husky": "^9.1.4",
|
|
90
90
|
"jsonc-eslint-parser": "^2.4.0",
|
|
91
|
-
"knip": "5.
|
|
92
|
-
"lint-staged": "^15.2.
|
|
91
|
+
"knip": "5.27.1",
|
|
92
|
+
"lint-staged": "^15.2.8",
|
|
93
93
|
"markdownlint": "^0.34.0",
|
|
94
94
|
"markdownlint-cli": "^0.41.0",
|
|
95
|
-
"prettier-plugin-curly": "^0.2.
|
|
96
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
95
|
+
"prettier-plugin-curly": "^0.2.2",
|
|
96
|
+
"prettier-plugin-packagejson": "^2.5.1",
|
|
97
97
|
"prettier-plugin-sh": "^0.14.0",
|
|
98
|
-
"release-it": "^17.
|
|
98
|
+
"release-it": "^17.6.0",
|
|
99
99
|
"sentences-per-line": "^0.2.1",
|
|
100
|
-
"tsup": "^8.
|
|
101
|
-
"tsx": "^4.
|
|
102
|
-
"typescript": "^5.5.
|
|
103
|
-
"typescript-eslint": "^8.0.
|
|
104
|
-
"vitest": "^2.0.
|
|
100
|
+
"tsup": "^8.2.4",
|
|
101
|
+
"tsx": "^4.16.5",
|
|
102
|
+
"typescript": "^5.5.4",
|
|
103
|
+
"typescript-eslint": "^8.0.1",
|
|
104
|
+
"vitest": "^2.0.5"
|
|
105
105
|
},
|
|
106
106
|
"engines": {
|
|
107
|
-
"node": ">=18"
|
|
107
|
+
"node": ">=18.3.0"
|
|
108
108
|
},
|
|
109
109
|
"publishConfig": {
|
|
110
110
|
"provenance": true
|