create-typescript-app 1.29.52 → 1.31.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/README.md +7 -5
- package/lib/bin/index.js +5 -4
- package/lib/bin/index.js.map +1 -1
- package/lib/bin/mode.d.ts +1 -1
- package/lib/bin/mode.js.map +1 -1
- package/lib/create/createRerunSuggestion.js +15 -1
- package/lib/create/createRerunSuggestion.js.map +1 -1
- package/lib/create/index.js +2 -2
- package/lib/create/index.js.map +1 -1
- package/lib/initialize/index.js +2 -2
- package/lib/initialize/index.js.map +1 -1
- package/lib/migrate/index.js +2 -2
- package/lib/migrate/index.js.map +1 -1
- package/lib/shared/options/args.d.ts +30 -0
- package/lib/shared/options/args.js +10 -0
- package/lib/shared/options/args.js.map +1 -1
- package/lib/shared/options/augmentOptionsWithExcludes.js +30 -0
- package/lib/shared/options/augmentOptionsWithExcludes.js.map +1 -1
- package/lib/shared/options/detectEmailRedundancy.d.ts +8 -0
- package/lib/shared/options/detectEmailRedundancy.js +16 -0
- package/lib/shared/options/detectEmailRedundancy.js.map +1 -0
- package/lib/shared/options/getPrefillOrPromptedOption.js +1 -2
- package/lib/shared/options/getPrefillOrPromptedOption.js.map +1 -1
- package/lib/shared/options/optionsSchema.d.ts +174 -0
- package/lib/shared/options/optionsSchema.js +52 -0
- package/lib/shared/options/optionsSchema.js.map +1 -0
- package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/index.d.ts +8 -4
- package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/index.js +15 -10
- package/lib/shared/options/readOptionDefaults/index.js.map +1 -0
- package/lib/shared/options/readOptionDefaults/parsePackageAuthor.js.map +1 -0
- package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.d.ts +6 -0
- package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.js +16 -0
- package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.js.map +1 -0
- package/lib/shared/options/readOptions.d.ts +1 -1
- package/lib/shared/options/readOptions.js +47 -45
- package/lib/shared/options/readOptions.js.map +1 -1
- package/lib/shared/types.d.ts +18 -3
- package/lib/steps/finalizeDependencies.js +0 -2
- package/lib/steps/finalizeDependencies.js.map +1 -1
- package/lib/steps/uninstallPackages.js +1 -0
- package/lib/steps/uninstallPackages.js.map +1 -1
- package/lib/steps/updateLocalFiles.js +1 -4
- package/lib/steps/updateLocalFiles.js.map +1 -1
- package/lib/steps/writing/creation/createESLintRC.js +26 -42
- package/lib/steps/writing/creation/createESLintRC.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js +2 -2
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.d.ts +1 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/workflows.js +31 -32
- package/lib/steps/writing/creation/dotGitHub/workflows.js.map +1 -1
- package/lib/steps/writing/creation/rootFiles.js +1 -1
- package/lib/steps/writing/creation/rootFiles.js.map +1 -1
- package/lib/steps/writing/creation/writePackageJson.js +1 -2
- package/lib/steps/writing/creation/writePackageJson.js.map +1 -1
- package/package.json +2 -4
- package/lib/shared/options/readGitAndNpmDefaults/index.js.map +0 -1
- package/lib/shared/options/readGitAndNpmDefaults/parsePackageAuthor.js.map +0 -1
- package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.d.ts +0 -3
- package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.js +0 -8
- package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.js.map +0 -1
- /package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/parsePackageAuthor.d.ts +0 -0
- /package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/parsePackageAuthor.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/rootFiles.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { createESLintRC } from \"./createESLintRC.js\";\nimport { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\nimport { writeAllContributorsRC } from \"./writeAllContributorsRC.js\";\nimport { writePackageJson } from \"./writePackageJson.js\";\n\nexport async function createRootFiles(options: Options) {\n\treturn {\n\t\t\".all-contributorsrc\": await writeAllContributorsRC(options),\n\t\t\".eslintignore\": formatIgnoreFile(\n\t\t\t[\n\t\t\t\t\"!.*\",\n\t\t\t\t...(options.excludeTests ? [] : [\"coverage\"]),\n\t\t\t\t\"lib\",\n\t\t\t\t\"node_modules\",\n\t\t\t\t\"pnpm-lock.yaml\",\n\t\t\t].filter(Boolean),\n\t\t),\n\t\t\".eslintrc.cjs\": await createESLintRC(options),\n\t\t\".gitignore\": formatIgnoreFile([\n\t\t\t...(options.excludeTests ? [] : [\"coverage/\"]),\n\t\t\t\"lib/\",\n\t\t\t\"node_modules/\",\n\t\t]),\n\t\t...(!options.excludeLintMd && {\n\t\t\t\".markdownlint.json\": await formatJson({\n\t\t\t\textends: \"markdownlint/style/prettier\",\n\t\t\t\t\"first-line-h1\": false,\n\t\t\t\t\"no-inline-html\": false,\n\t\t\t}),\n\t\t\t\".markdownlintignore\": formatIgnoreFile([\n\t\t\t\t\".github/CODE_OF_CONDUCT.md\",\n\t\t\t\t\"CHANGELOG.md\",\n\t\t\t\t\"lib/\",\n\t\t\t\t\"node_modules/\",\n\t\t\t]),\n\t\t}),\n\t\t...(!options.excludeLintPackageJson && {\n\t\t\t\".npmpackagejsonlintrc.json\": await formatJson({\n\t\t\t\textends: \"npm-package-json-lint-config-default\",\n\t\t\t\trules: {\n\t\t\t\t\t\"require-description\": \"error\",\n\t\t\t\t\t\"require-license\": \"error\",\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\t\".nvmrc\": `18.
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/rootFiles.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { createESLintRC } from \"./createESLintRC.js\";\nimport { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\nimport { formatTypeScript } from \"./formatters/formatTypeScript.js\";\nimport { writeAllContributorsRC } from \"./writeAllContributorsRC.js\";\nimport { writePackageJson } from \"./writePackageJson.js\";\n\nexport async function createRootFiles(options: Options) {\n\treturn {\n\t\t\".all-contributorsrc\": await writeAllContributorsRC(options),\n\t\t\".eslintignore\": formatIgnoreFile(\n\t\t\t[\n\t\t\t\t\"!.*\",\n\t\t\t\t...(options.excludeTests ? [] : [\"coverage\"]),\n\t\t\t\t\"lib\",\n\t\t\t\t\"node_modules\",\n\t\t\t\t\"pnpm-lock.yaml\",\n\t\t\t].filter(Boolean),\n\t\t),\n\t\t\".eslintrc.cjs\": await createESLintRC(options),\n\t\t\".gitignore\": formatIgnoreFile([\n\t\t\t...(options.excludeTests ? [] : [\"coverage/\"]),\n\t\t\t\"lib/\",\n\t\t\t\"node_modules/\",\n\t\t]),\n\t\t...(!options.excludeLintMd && {\n\t\t\t\".markdownlint.json\": await formatJson({\n\t\t\t\textends: \"markdownlint/style/prettier\",\n\t\t\t\t\"first-line-h1\": false,\n\t\t\t\t\"no-inline-html\": false,\n\t\t\t}),\n\t\t\t\".markdownlintignore\": formatIgnoreFile([\n\t\t\t\t\".github/CODE_OF_CONDUCT.md\",\n\t\t\t\t\"CHANGELOG.md\",\n\t\t\t\t\"lib/\",\n\t\t\t\t\"node_modules/\",\n\t\t\t]),\n\t\t}),\n\t\t...(!options.excludeLintPackageJson && {\n\t\t\t\".npmpackagejsonlintrc.json\": await formatJson({\n\t\t\t\textends: \"npm-package-json-lint-config-default\",\n\t\t\t\trules: {\n\t\t\t\t\t\"require-description\": \"error\",\n\t\t\t\t\t\"require-license\": \"error\",\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\t\".nvmrc\": `18.18.0\\n`,\n\t\t\".prettierignore\": formatIgnoreFile([\n\t\t\t...(options.excludeContributors ? [] : [\".all-contributorsrc\"]),\n\t\t\t...(options.excludeTests ? [] : [\"coverage/\"]),\n\t\t\t\"lib/\",\n\t\t\t\"pnpm-lock.yaml\",\n\t\t]),\n\t\t\".prettierrc\": await formatJson({\n\t\t\t$schema: \"http://json.schemastore.org/prettierrc\",\n\t\t\toverrides: [\n\t\t\t\t{\n\t\t\t\t\tfiles: \".*rc\",\n\t\t\t\t\toptions: { parser: \"json\" },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfiles: \".nvmrc\",\n\t\t\t\t\toptions: { parser: \"yaml\" },\n\t\t\t\t},\n\t\t\t],\n\t\t\tplugins: [\"prettier-plugin-curly\", \"prettier-plugin-packagejson\"],\n\t\t\tuseTabs: true,\n\t\t}),\n\t\t...(!options.excludeReleases && {\n\t\t\t\".release-it.json\": await formatJson({\n\t\t\t\tgit: {\n\t\t\t\t\tcommitMessage: \"chore: release v${version}\",\n\t\t\t\t\trequireCommits: true,\n\t\t\t\t},\n\t\t\t\tgithub: {\n\t\t\t\t\tautoGenerate: true,\n\t\t\t\t\trelease: true,\n\t\t\t\t\treleaseName: \"v${version}\",\n\t\t\t\t},\n\t\t\t\tnpm: {\n\t\t\t\t\tpublishArgs: [\"--provenance\"],\n\t\t\t\t},\n\t\t\t\tplugins: {\n\t\t\t\t\t\"@release-it/conventional-changelog\": {\n\t\t\t\t\t\tinfile: \"CHANGELOG.md\",\n\t\t\t\t\t\tpreset: \"angular\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\t\"LICENSE.md\": `# MIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n`,\n\t\t...(!options.excludeLintSpelling && {\n\t\t\t\"cspell.json\": await formatJson({\n\t\t\t\tdictionaries: [\"typescript\"],\n\t\t\t\tignorePaths: [\n\t\t\t\t\t\".github\",\n\t\t\t\t\t\"CHANGELOG.md\",\n\t\t\t\t\t...(options.excludeTests ? [] : [\"coverage\"]),\n\t\t\t\t\t\"lib\",\n\t\t\t\t\t\"node_modules\",\n\t\t\t\t\t\"pnpm-lock.yaml\",\n\t\t\t\t],\n\t\t\t\twords: [\n\t\t\t\t\t\"Codecov\",\n\t\t\t\t\t\"codespace\",\n\t\t\t\t\t\"commitlint\",\n\t\t\t\t\t\"contributorsrc\",\n\t\t\t\t\t\"conventionalcommits\",\n\t\t\t\t\t...(options.excludeLintKnip ? [] : [\"knip\"]),\n\t\t\t\t\t\"lcov\",\n\t\t\t\t\t\"markdownlintignore\",\n\t\t\t\t\t\"npmpackagejsonlintrc\",\n\t\t\t\t\t\"outro\",\n\t\t\t\t\t\"packagejson\",\n\t\t\t\t\t\"tsup\",\n\t\t\t\t\t\"quickstart\",\n\t\t\t\t\t\"wontfix\",\n\t\t\t\t].sort(),\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeLintKnip && {\n\t\t\t\"knip.jsonc\": await formatJson({\n\t\t\t\t$schema: \"https://unpkg.com/knip@latest/schema.json\",\n\t\t\t\tentry: [\"src/index.ts!\"],\n\t\t\t\tignoreExportsUsedInFile: {\n\t\t\t\t\tinterface: true,\n\t\t\t\t\ttype: true,\n\t\t\t\t},\n\t\t\t\tproject: [\"src/**/*.ts!\"],\n\t\t\t}),\n\t\t}),\n\t\t\"package.json\": await writePackageJson(options),\n\t\t\"tsconfig.eslint.json\": await formatJson({\n\t\t\textends: \"./tsconfig.json\",\n\t\t\tinclude: [\".\"],\n\t\t}),\n\t\t\"tsconfig.json\": await formatJson({\n\t\t\tcompilerOptions: {\n\t\t\t\tdeclaration: true,\n\t\t\t\tdeclarationMap: true,\n\t\t\t\tesModuleInterop: true,\n\t\t\t\tmodule: \"NodeNext\",\n\t\t\t\tmoduleResolution: \"NodeNext\",\n\t\t\t\toutDir: \"lib\",\n\t\t\t\tresolveJsonModule: true,\n\t\t\t\tskipLibCheck: true,\n\t\t\t\tsourceMap: true,\n\t\t\t\tstrict: true,\n\t\t\t\ttarget: \"ES2022\",\n\t\t\t},\n\t\t\tinclude: [\"src\"],\n\t\t}),\n\t\t\"tsup.config.ts\":\n\t\t\tawait formatTypeScript(`import { defineConfig } from \"tsup\";\n\n\t\texport default defineConfig({\n\t\t\tbundle: false,\n\t\t\tclean: true,\n\t\t\tdts: true,\n\t\t\tentry: [\"src/**/*.ts\"${options.excludeTests ? \"\" : `, \"!src/**/*.test.*\"`}],\n\t\t\tformat: \"esm\",\n\t\t\toutDir: \"lib\",\n\t\t\tsourcemap: true,\n\t\t});\n\t\t`),\n\t\t...(!options.excludeTests && {\n\t\t\t\"vitest.config.ts\": `import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n\ttest: {\n\t\tclearMocks: true,\n\t\tcoverage: {\n\t\t\tall: true,\n\t\t\texclude: [\"lib\"],\n\t\t\tinclude: [\"src\"],\n\t\t\treporter: [\"html\", \"lcov\"],\n\t\t},\n\t\texclude: [\"lib\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
|
|
11
11
|
"commitlint",
|
|
12
12
|
"cson-parser",
|
|
13
13
|
"esbuild",
|
|
14
|
-
"eslint-config-prettier",
|
|
15
14
|
"eslint-plugin-jest",
|
|
16
15
|
"eslint-plugin-prettier",
|
|
17
16
|
"eslint-plugin-simple-import-sort",
|
|
@@ -31,7 +30,7 @@ async function writePackageJson(options) {
|
|
|
31
30
|
version: "0.0.0",
|
|
32
31
|
// To start, copy over all existing package fields (e.g. "dependencies")
|
|
33
32
|
...existingPackageJson,
|
|
34
|
-
author: { email: options.email, name: options.author },
|
|
33
|
+
author: { email: options.email.npm, name: options.author },
|
|
35
34
|
description: options.description,
|
|
36
35
|
// We copy all existing dev dependencies except those we know are not used anymore
|
|
37
36
|
devDependencies: copyDevDependencies(existingPackageJson),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/writePackageJson.ts"],"sourcesContent":["import { readFileSafeAsJson } from \"../../../shared/readFileSafeAsJson.js\";\nimport { Options } 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\"ava\",\n\t\"babel-jest\",\n\t\"commitlint\",\n\t\"cson-parser\",\n\t\"esbuild\",\n\t\"eslint-
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/writePackageJson.ts"],"sourcesContent":["import { readFileSafeAsJson } from \"../../../shared/readFileSafeAsJson.js\";\nimport { Options } 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\"ava\",\n\t\"babel-jest\",\n\t\"commitlint\",\n\t\"cson-parser\",\n\t\"esbuild\",\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(\"./package.json\")) as null | object) ?? {};\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\tdescription: options.description,\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: [\"lib/\", \"package.json\", \"LICENSE.md\", \"README.md\"],\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\tpackageManager: \"pnpm@8.7.0\",\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\tbuild: \"tsup\",\n\t\t\tformat: 'prettier \"**/*\" --ignore-unknown',\n\t\t\t\"format:write\": \"pnpm format --write\",\n\t\t\tlint: \"eslint . .*js --max-warnings 0 --report-unused-disable-directives\",\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.excludeLintPackageJson && {\n\t\t\t\t\"lint:package-json\": \"npmPkgJsonLint .\",\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 install\",\n\t\t\t...(!options.excludeReleases && {\n\t\t\t\t\"should-semantic-release\": \"should-semantic-release --verbose\",\n\t\t\t}),\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;AACD;AAEA,eAAsB,iBAAiB,SAAkB;AACxD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AAAA,MAC5B;AAAA,MACA,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.31.0",
|
|
4
4
|
"description": "Quickstart-friendly TypeScript template with comprehensive formatting, linting, releases, testing, and other great tooling built-in. ✨",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -75,10 +75,8 @@
|
|
|
75
75
|
"console-fail-test": "^0.2.3",
|
|
76
76
|
"cspell": "^7.0.1",
|
|
77
77
|
"eslint": "^8.48.0",
|
|
78
|
-
"eslint-config-prettier": "^9.0.0",
|
|
79
78
|
"eslint-plugin-deprecation": "^2.0.0",
|
|
80
79
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
81
|
-
"eslint-plugin-import": "^2.28.1",
|
|
82
80
|
"eslint-plugin-jsdoc": "^46.5.0",
|
|
83
81
|
"eslint-plugin-jsonc": "^2.9.0",
|
|
84
82
|
"eslint-plugin-markdown": "^3.0.1",
|
|
@@ -91,7 +89,7 @@
|
|
|
91
89
|
"globby": "^13.2.2",
|
|
92
90
|
"husky": "^8.0.3",
|
|
93
91
|
"jsonc-eslint-parser": "^2.3.0",
|
|
94
|
-
"knip": "2.
|
|
92
|
+
"knip": "2.25.2",
|
|
95
93
|
"lint-staged": "^14.0.1",
|
|
96
94
|
"markdownlint": "^0.31.0",
|
|
97
95
|
"markdownlint-cli": "^0.36.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shared/options/readGitAndNpmDefaults/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 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 { parsePackageAuthor } from \"./parsePackageAuthor.js\";\nimport { readTitleFromReadme } from \"./readTitleFromReadme.js\";\n\nexport function getGitAndNpmDefaults() {\n\tconst gitDefaults = tryCatchLazyValueAsync(async () =>\n\t\tgitUrlParse(await gitRemoteOriginUrl()),\n\t);\n\n\tconst npmDefaults = tryCatchLazyValueAsync(\n\t\tasync () => await npmUser((await $`npm whoami`).stdout),\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\tdescription: async () => (await packageData()).description,\n\t\temail: async () =>\n\t\t\t(await npmDefaults())?.email ??\n\t\t\t(await packageAuthor()).email ??\n\t\t\t(await tryCatchAsync(\n\t\t\t\tasync () => (await $`git config --get user.email`).stdout,\n\t\t\t)),\n\t\tfunding: async () =>\n\t\t\tawait tryCatchAsync(\n\t\t\t\tasync () =>\n\t\t\t\t\t(await fs.readFile(\".github/FUNDING.yml\"))\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.split(\":\")[1]\n\t\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\t(await gitDefaults())?.name ?? (await packageData()).name,\n\t\ttitle: async () => await readTitleFromReadme(),\n\t};\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,OAAO,wBAAwB;AAC/B,OAAO,iBAAiB;AACxB,OAAO,eAAe;AACtB,OAAO,QAAQ;AACf,OAAO,aAAa;AAEpB,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,2BAA2B;AAE7B,SAAS,uBAAuB;AACtC,QAAM,cAAc;AAAA,IAAuB,YAC1C,YAAY,MAAM,mBAAmB,CAAC;AAAA,EACvC;AAEA,QAAM,cAAc;AAAA,IACnB,YAAY,MAAM,SAAS,MAAM,eAAe,MAAM;AAAA,EACvD;AAEA,QAAM,cAAc,UAAU,eAAe;AAC7C,QAAM,gBAAgB;AAAA,IAAU,YAC/B,mBAAmB,MAAM,YAAY,CAAC;AAAA,EACvC;AAEA,SAAO;AAAA,IACN,QAAQ,aAAa,MAAM,cAAc,GAAG,UAAU,YAAY;AAAA,IAClE,aAAa,aAAa,MAAM,YAAY,GAAG;AAAA,IAC/C,OAAO,aACL,MAAM,YAAY,IAAI,UACtB,MAAM,cAAc,GAAG,SACvB,MAAM;AAAA,MACN,aAAa,MAAM,gCAAgC;AAAA,IACpD;AAAA,IACD,SAAS,YACR,MAAM;AAAA,MACL,aACE,MAAM,GAAG,SAAS,qBAAqB,GACtC,SAAS,EACT,MAAM,GAAG,EAAE,CAAC,GACX,KAAK;AAAA,IACV;AAAA,IACD,OAAO,aACL,MAAM,YAAY,IAAI,iBAAiB,MAAM,cAAc,GAAG;AAAA,IAChE,YAAY,aACV,MAAM,YAAY,IAAI,SAAS,MAAM,YAAY,GAAG;AAAA,IACtD,OAAO,YAAY,MAAM,oBAAoB;AAAA,EAC9C;AACD;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shared/options/readGitAndNpmDefaults/parsePackageAuthor.ts"],"sourcesContent":["import { PartialPackageData } from \"../../types.js\";\n\nexport function parsePackageAuthor(packageData: PartialPackageData) {\n\tconst [packageAuthor, packageEmail] =\n\t\ttypeof packageData.author === \"string\"\n\t\t\t? [\n\t\t\t\t\tpackageData.author.split(\"<\")[0].trim(),\n\t\t\t\t\tpackageData.author.split(/<|>/)[1]?.trim(),\n\t\t\t ]\n\t\t\t: [packageData.author?.name, packageData.author?.email];\n\n\treturn {\n\t\tauthor: packageAuthor,\n\t\temail: packageEmail,\n\t};\n}\n"],"mappings":"AAEO,SAAS,mBAAmB,aAAiC;AACnE,QAAM,CAAC,eAAe,YAAY,IACjC,OAAO,YAAY,WAAW,WAC3B;AAAA,IACA,YAAY,OAAO,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK;AAAA,IACtC,YAAY,OAAO,MAAM,KAAK,EAAE,CAAC,GAAG,KAAK;AAAA,EACzC,IACA,CAAC,YAAY,QAAQ,MAAM,YAAY,QAAQ,KAAK;AAExD,SAAO;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,EACR;AACD;","names":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { readFileSafe } from "../../readFileSafe.js";
|
|
2
|
-
async function readTitleFromReadme() {
|
|
3
|
-
return (await readFileSafe("./README.md", "")).match(/^(?:# |<h1\s+align="center">)(.*?)(?:<\/h1>)?$/i)?.[1]?.trim().replace(/<[^>]+(?:>|$)/g, "");
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
readTitleFromReadme
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=readTitleFromReadme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shared/options/readGitAndNpmDefaults/readTitleFromReadme.ts"],"sourcesContent":["import { readFileSafe } from \"../../readFileSafe.js\";\n\nexport async function readTitleFromReadme() {\n\treturn (await readFileSafe(\"./README.md\", \"\"))\n\t\t.match(/^(?:# |<h1\\s+align=\"center\">)(.*?)(?:<\\/h1>)?$/i)?.[1]\n\t\t?.trim()\n\t\t.replace(/<[^>]+(?:>|$)/g, \"\");\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,eAAsB,sBAAsB;AAC3C,UAAQ,MAAM,aAAa,eAAe,EAAE,GAC1C,MAAM,iDAAiD,IAAI,CAAC,GAC3D,KAAK,EACN,QAAQ,kBAAkB,EAAE;AAC/B;","names":[]}
|
/package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/parsePackageAuthor.d.ts
RENAMED
|
File without changes
|
/package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/parsePackageAuthor.js
RENAMED
|
File without changes
|