create-typescript-app 2.5.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/lib/base.d.ts +7 -6
- package/lib/base.js +122 -96
- package/lib/blocks/blockAllContributors.d.ts +1 -0
- package/lib/blocks/blockAreTheTypesWrong.d.ts +1 -0
- package/lib/blocks/blockCSpell.d.ts +1 -0
- package/lib/blocks/blockCodecov.d.ts +1 -0
- package/lib/blocks/blockContributingDocs.d.ts +1 -0
- package/lib/blocks/blockContributingDocs.js +2 -2
- package/lib/blocks/blockContributorCovenant.d.ts +1 -0
- package/lib/blocks/blockDevelopmentDocs.d.ts +1 -0
- package/lib/blocks/blockESLint.d.ts +1 -0
- package/lib/blocks/blockESLintComments.d.ts +1 -0
- package/lib/blocks/blockESLintJSDoc.d.ts +1 -0
- package/lib/blocks/blockESLintJSONC.d.ts +1 -0
- package/lib/blocks/blockESLintMarkdown.d.ts +1 -0
- package/lib/blocks/blockESLintMoreStyling.d.ts +1 -0
- package/lib/blocks/blockESLintNode.d.ts +1 -0
- package/lib/blocks/blockESLintNode.js +2 -9
- package/lib/blocks/blockESLintPackageJson.d.ts +1 -0
- package/lib/blocks/blockESLintPerfectionist.d.ts +1 -0
- package/lib/blocks/blockESLintRegexp.d.ts +1 -0
- package/lib/blocks/blockESLintYML.d.ts +1 -0
- package/lib/blocks/blockExampleFiles.d.ts +1 -0
- package/lib/blocks/blockFunding.d.ts +1 -0
- package/lib/blocks/blockGitHubActionsCI.d.ts +1 -0
- package/lib/blocks/blockGitHubApps.d.ts +1 -0
- package/lib/blocks/blockGitHubIssueTemplates.d.ts +1 -0
- package/lib/blocks/blockGitHubPRTemplate.d.ts +1 -0
- package/lib/blocks/blockGitHubPRTemplate.js +1 -1
- package/lib/blocks/blockGitignore.d.ts +1 -0
- package/lib/blocks/blockKnip.d.ts +1 -0
- package/lib/blocks/blockMITLicense.d.ts +1 -0
- package/lib/blocks/blockMarkdownlint.d.ts +1 -0
- package/lib/blocks/blockNvmrc.d.ts +1 -0
- package/lib/blocks/blockPRCompliance.d.ts +1 -0
- package/lib/blocks/blockPackageJson.d.ts +1 -0
- package/lib/blocks/blockPnpmDedupe.d.ts +1 -0
- package/lib/blocks/blockPrettier.d.ts +1 -0
- package/lib/blocks/blockPrettierPluginCurly.d.ts +1 -0
- package/lib/blocks/blockPrettierPluginPackageJson.d.ts +1 -0
- package/lib/blocks/blockPrettierPluginSh.d.ts +1 -0
- package/lib/blocks/blockREADME.d.ts +1 -0
- package/lib/blocks/blockREADME.js +1 -1
- package/lib/blocks/blockReleaseIt.d.ts +1 -0
- package/lib/blocks/blockRenovate.d.ts +1 -0
- package/lib/blocks/blockRepositoryBranchRuleset.d.ts +1 -0
- package/lib/blocks/blockRepositoryLabels.d.ts +1 -0
- package/lib/blocks/blockRepositorySecrets.d.ts +1 -0
- package/lib/blocks/blockRepositorySettings.d.ts +1 -0
- package/lib/blocks/blockSecurityDocs.d.ts +1 -0
- package/lib/blocks/blockTSup.d.ts +1 -0
- package/lib/blocks/blockTemplatedWith.d.ts +1 -0
- package/lib/blocks/blockTypeScript.d.ts +1 -0
- package/lib/blocks/blockVSCode.d.ts +1 -0
- package/lib/blocks/blockVitest.d.ts +1 -0
- package/lib/blocks/index.d.ts +43 -0
- package/lib/blocks/options.fakes.d.ts +1 -0
- package/lib/blocks/options.fakes.js +1 -0
- package/lib/constants.d.ts +8 -0
- package/lib/constants.js +9 -0
- package/lib/data/packageData.d.ts +3 -3
- package/lib/index.d.ts +2 -0
- package/lib/inputs/inputFromOctokit.js +1 -0
- package/lib/options/readAuthor.d.ts +7 -0
- package/lib/options/readAuthor.js +6 -0
- package/lib/options/readEmailFromCodeOfConduct.d.ts +5 -0
- package/lib/options/readEmailFromCodeOfConduct.js +10 -0
- package/lib/options/readEmailFromGit.d.ts +5 -0
- package/lib/options/readEmailFromGit.js +7 -0
- package/lib/options/readEmailFromNpm.d.ts +7 -0
- package/lib/options/readEmailFromNpm.js +6 -0
- package/lib/options/readEmails.d.ts +1 -6
- package/lib/options/readEmails.js +3 -8
- package/lib/options/readEmoji.d.ts +3 -0
- package/lib/options/readEmoji.js +6 -0
- package/lib/options/readExistingLabels.d.ts +9 -0
- package/lib/options/{getExistingLabels.js → readExistingLabels.js} +3 -2
- package/lib/options/readExplainer.d.ts +3 -0
- package/lib/options/readExplainer.js +12 -0
- package/lib/options/readFunding.d.ts +3 -1
- package/lib/options/readFunding.js +6 -6
- package/lib/options/readGitDefaults.d.ts +5 -0
- package/lib/options/readGitDefaults.js +12 -0
- package/lib/options/readGuide.d.ts +3 -1
- package/lib/options/readGuide.js +8 -3
- package/lib/options/readLogo.d.ts +8 -0
- package/lib/options/readLogo.js +19 -0
- package/lib/options/readNode.d.ts +8 -0
- package/lib/options/readNode.js +12 -0
- package/lib/options/readNpmDefaults.d.ts +6 -0
- package/lib/options/readNpmDefaults.js +9 -0
- package/lib/options/readOwner.d.ts +8 -0
- package/lib/options/readOwner.js +9 -0
- package/lib/options/readPackageAuthor.d.ts +8 -0
- package/lib/options/{parsePackageAuthor.js → readPackageAuthor.js} +3 -2
- package/lib/options/readPackageData.d.ts +5 -1
- package/lib/options/readPackageData.js +7 -3
- package/lib/options/readPackageDataFull.d.ts +6 -0
- package/lib/options/readPackageDataFull.js +9 -0
- package/lib/options/readRepository.d.ts +9 -0
- package/lib/options/readRepository.js +6 -0
- package/lib/options/readRulesetId.d.ts +5 -0
- package/lib/options/readRulesetId.js +16 -0
- package/lib/options/readTitle.d.ts +3 -0
- package/lib/options/readTitle.js +13 -0
- package/lib/options/readUsage.d.ts +3 -0
- package/lib/options/readUsage.js +14 -0
- package/lib/options/readUsageFromReadme.d.ts +3 -0
- package/lib/options/{getUsageFromReadme.js → readUsageFromReadme.js} +2 -2
- package/lib/presets/common.d.ts +1 -0
- package/lib/presets/everything.d.ts +1 -0
- package/lib/presets/index.d.ts +3 -0
- package/lib/presets/minimal.d.ts +1 -0
- package/lib/template.d.ts +1 -0
- package/lib/utils/swallowErrorAsync.d.ts +3 -0
- package/lib/utils/swallowErrorAsync.js +10 -0
- package/package.json +3 -3
- package/lib/options/getExistingLabels.d.ts +0 -9
- package/lib/options/getUsageFromReadme.d.ts +0 -3
- package/lib/options/parsePackageAuthor.d.ts +0 -8
- package/lib/options/readDefaultsFromReadme.d.ts +0 -13
- package/lib/options/readDefaultsFromReadme.js +0 -57
- package/lib/options/readGitHubEmail.d.ts +0 -3
- package/lib/options/readGitHubEmail.js +0 -11
- package/lib/utils/tryCatchAsync.d.ts +0 -3
- package/lib/utils/tryCatchAsync.js +0 -10
- package/lib/utils/tryCatchLazyValueAsync.d.ts +0 -3
- package/lib/utils/tryCatchLazyValueAsync.js +0 -8
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import lazyValue from "lazy-value";
|
|
2
|
-
import { titleCase } from "title-case";
|
|
3
|
-
import { getUsageFromReadme } from "./getUsageFromReadme.js";
|
|
4
|
-
import { readLogoSizing } from "./readLogoSizing.js";
|
|
5
|
-
function readDefaultsFromReadme(readme, repository) {
|
|
6
|
-
const imageTag = lazyValue(
|
|
7
|
-
async () => /\n<img.+src=.+>/.exec(await readme())?.[0]
|
|
8
|
-
);
|
|
9
|
-
return {
|
|
10
|
-
explainer: async () => {
|
|
11
|
-
const readmeText = await readme();
|
|
12
|
-
const indexOfH2 = readmeText.indexOf("##");
|
|
13
|
-
if (indexOfH2 === -1) {
|
|
14
|
-
return void 0;
|
|
15
|
-
}
|
|
16
|
-
const lastTag = readmeText.slice(0, indexOfH2).lastIndexOf(">");
|
|
17
|
-
return readmeText.slice(lastTag + 1, indexOfH2).split("\n").map((line) => line.trim()).filter(Boolean);
|
|
18
|
-
},
|
|
19
|
-
logo: async () => {
|
|
20
|
-
const tag = await imageTag();
|
|
21
|
-
if (!tag) {
|
|
22
|
-
return void 0;
|
|
23
|
-
}
|
|
24
|
-
const src = /src\s*=(.+)['"/]>/.exec(tag)?.[1]?.split(/\s*\w+=/)[0].replaceAll(/^['"]|['"]$/g, "");
|
|
25
|
-
if (!src) {
|
|
26
|
-
return void 0;
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
alt: /alt=['"](.+)['"]\s*src=/.exec(tag)?.[1].split(/['"]?\s*\w+=/)[0] ?? "Project logo",
|
|
30
|
-
src,
|
|
31
|
-
...readLogoSizing(src)
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
title: async () => {
|
|
35
|
-
const text = await readme();
|
|
36
|
-
const fromText = (/^<h1\s+align="center">(.+)<\/h1>/.exec(text) ?? /^# (.+)/.exec(text))?.[1];
|
|
37
|
-
if (fromText) {
|
|
38
|
-
return fromText;
|
|
39
|
-
}
|
|
40
|
-
const repositoryValue = await repository();
|
|
41
|
-
return repositoryValue && titleCase(repositoryValue).replaceAll("Eslint", "ESLint").replaceAll("Typescript", "TypeScript").replaceAll("-", " ");
|
|
42
|
-
},
|
|
43
|
-
usage: async () => {
|
|
44
|
-
return getUsageFromReadme(await readme()) ?? `\`\`\`shell
|
|
45
|
-
npm i ${await repository()}
|
|
46
|
-
\`\`\`
|
|
47
|
-
\`\`\`ts
|
|
48
|
-
import { greet } from "${await repository()}";
|
|
49
|
-
|
|
50
|
-
greet("Hello, world! \u{1F496}");
|
|
51
|
-
\`\`\``;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
export {
|
|
56
|
-
readDefaultsFromReadme
|
|
57
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { readFileSafe } from "./readFileSafe.js";
|
|
2
|
-
async function readGitHubEmail() {
|
|
3
|
-
const codeOfConduct = await readFileSafe(".github/CODE_OF_CONDUCT.md", "");
|
|
4
|
-
if (!codeOfConduct.includes("Contributor Covenant Code of Conduct")) {
|
|
5
|
-
return void 0;
|
|
6
|
-
}
|
|
7
|
-
return /for enforcement at[\r\n]+(.+)\.[\r\n]+All/.exec(codeOfConduct)?.[1];
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
readGitHubEmail
|
|
11
|
-
};
|