create-typescript-app 1.29.22 → 1.29.23

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.
@@ -78,7 +78,7 @@ function generateTopContent(options) {
78
78
  <p align="center">${options.description}</p>
79
79
 
80
80
  <p align="center">
81
- ${badgeLines.join("")}
81
+ ${badgeLines.join("\n")}
82
82
  </p>`;
83
83
  }
84
84
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/steps/writeReadme.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\n\nimport { readFileSafe } from \"../shared/readFileSafe.js\";\nimport { Options } from \"../shared/types.js\";\nimport { endOfReadmeNotice } from \"./updateReadme.js\";\n\nconst contributorsIndicator = `<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->`;\n\nfunction generateAllContributorsContent(options: Options) {\n\treturn [\n\t\t`## Contributors`,\n\t\t``,\n\t\t`<!-- spellchecker: disable -->`,\n\t\tcontributorsIndicator,\n\t\t`<!-- prettier-ignore-start -->`,\n\t\t!options.excludeLintMd && `<!-- markdownlint-disable -->`,\n\t\t`<table>`,\n\t\t`<!-- (this will be filled in by all-contributors) -->`,\n\t\t`</table>`,\n\t\t``,\n\t\t!options.excludeLintMd && `<!-- markdownlint-restore -->`,\n\t\t`<!-- prettier-ignore-end -->`,\n\t\t``,\n\t\t`<!-- ALL-CONTRIBUTORS-LIST:END -->`,\n\t\t`<!-- spellchecker: enable -->`,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\"\\n\");\n}\n\nexport async function writeReadme(options: Options) {\n\tconst allContributorsContent =\n\t\t!options.excludeContributors && generateAllContributorsContent(options);\n\tlet contents = await readFileSafe(\"README.md\", \"\");\n\tif (!contents) {\n\t\tawait fs.writeFile(\n\t\t\t\"README.md\",\n\t\t\t[generateTopContent(options), allContributorsContent, endOfReadmeNotice]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(\"\\n\\n\"),\n\t\t);\n\t\treturn;\n\t}\n\n\tconst endOfH1 = findH1Close(contents);\n\n\tcontents = [generateTopContent(options), contents.slice(endOfH1)]\n\t\t.join(\"\")\n\t\t.replace(/\\[!\\[.+\\]\\(.+\\)\\]\\(.+\\)/g, \"\")\n\t\t.replace(/!\\[.+\\]\\(.+\\)/g, \"\")\n\t\t.replaceAll(\"\\r\", \"\")\n\t\t.replaceAll(\"\\n\\n\\n\", \"\\n\\n\");\n\n\tif (allContributorsContent && !contents.includes(contributorsIndicator)) {\n\t\tcontents = [contents, allContributorsContent].join(\"\\n\\n\");\n\t}\n\n\tif (!contents.includes(endOfReadmeNotice)) {\n\t\tcontents = [contents, endOfReadmeNotice].join(\"\\n\\n\");\n\t}\n\n\tawait fs.writeFile(\"README.md\", contents);\n}\n\nfunction findH1Close(contents: string) {\n\tconst markdownMatch = contents.match(/^#.+/);\n\tif (markdownMatch) {\n\t\treturn (markdownMatch.index ?? 0) + markdownMatch[0].length;\n\t}\n\n\treturn contents.indexOf(\"</h1>\") + \"</h1>\".length;\n}\n\nfunction generateTopContent(options: Options) {\n\tconst badgeLines = [\n\t\t!options.excludeContributors &&\n\t\t\t`<a href=\"#contributors\" target=\"_blank\">\n<!-- prettier-ignore-start -->\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n<img alt=\"All Contributors: 2\" src=\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\" />\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n<!-- prettier-ignore-end -->\n</a>`,\n\t\t!options.excludeTests &&\n\t\t\t`<a href=\"https://codecov.io/gh/${options.owner}/${options.repository}\" target=\"_blank\">\n\t<img alt=\"Codecov Test Coverage\" src=\"https://codecov.io/gh/${options.owner}/${options.repository}/branch/main/graph/badge.svg\"/>\n</a>`,\n\t\t`<a href=\"https://github.com/${options.owner}/${options.repository}/blob/main/.github/CODE_OF_CONDUCT.md\" target=\"_blank\">\n\t<img alt=\"Contributor Covenant\" src=\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\" />\n</a>`,\n\t\t`<a href=\"https://github.com/${options.owner}/${options.repository}/blob/main/LICENSE.md\" target=\"_blank\">\n\t<img alt=\"License: MIT\" src=\"https://img.shields.io/github/license/${options.owner}/${options.repository}?color=21bb42\">\n</a>`,\n\t\toptions.funding &&\n\t\t\t`\n\t\t<a href=\"https://github.com/sponsors/${options.funding}\" target=\"_blank\">\n\t\t\t<img alt=\"Sponsor: On GitHub\" src=\"https://img.shields.io/badge/sponsor-on_github-21bb42.svg\" />\n\t\t</a>`,\n\t\t`<img alt=\"Style: Prettier\" src=\"https://img.shields.io/badge/style-prettier-21bb42.svg\" />`,\n\t\t`<img alt=\"TypeScript: Strict\" src=\"https://img.shields.io/badge/typescript-strict-21bb42.svg\" />`,\n\t].filter(Boolean);\n\n\treturn `<h1 align=\"center\">${options.title}</h1>\n\n<p align=\"center\">${options.description}</p>\n\n<p align=\"center\">\n\t${badgeLines.join(\"\")}\n</p>`;\n}\n"],"mappings":"AAAA,OAAO,QAAQ;AAEf,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAElC,MAAM,wBAAwB;AAE9B,SAAS,+BAA+B,SAAkB;AACzD,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,EACE,OAAO,OAAO,EACd,KAAK,IAAI;AACZ;AAEA,eAAsB,YAAY,SAAkB;AACnD,QAAM,yBACL,CAAC,QAAQ,uBAAuB,+BAA+B,OAAO;AACvE,MAAI,WAAW,MAAM,aAAa,aAAa,EAAE;AACjD,MAAI,CAAC,UAAU;AACd,UAAM,GAAG;AAAA,MACR;AAAA,MACA,CAAC,mBAAmB,OAAO,GAAG,wBAAwB,iBAAiB,EACrE,OAAO,O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,EACD,EAAE,OAAO,OAAO;AAEhB,SAAO,sBAAsB,QAAQ,KAAK;AAAA;AAAA,oBAEvB,QAAQ,WAAW;AAAA;AAAA;AAAA,GAGpC,WAAW,KAAK,EAAE,CAAC;AAAA;AAEtB;","names":[]}
1
+ {"version":3,"sources":["../../src/steps/writeReadme.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\n\nimport { readFileSafe } from \"../shared/readFileSafe.js\";\nimport { Options } from \"../shared/types.js\";\nimport { endOfReadmeNotice } from \"./updateReadme.js\";\n\nconst contributorsIndicator = `<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->`;\n\nfunction generateAllContributorsContent(options: Options) {\n\treturn [\n\t\t`## Contributors`,\n\t\t``,\n\t\t`<!-- spellchecker: disable -->`,\n\t\tcontributorsIndicator,\n\t\t`<!-- prettier-ignore-start -->`,\n\t\t!options.excludeLintMd && `<!-- markdownlint-disable -->`,\n\t\t`<table>`,\n\t\t`<!-- (this will be filled in by all-contributors) -->`,\n\t\t`</table>`,\n\t\t``,\n\t\t!options.excludeLintMd && `<!-- markdownlint-restore -->`,\n\t\t`<!-- prettier-ignore-end -->`,\n\t\t``,\n\t\t`<!-- ALL-CONTRIBUTORS-LIST:END -->`,\n\t\t`<!-- spellchecker: enable -->`,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\"\\n\");\n}\n\nexport async function writeReadme(options: Options) {\n\tconst allContributorsContent =\n\t\t!options.excludeContributors && generateAllContributorsContent(options);\n\tlet contents = await readFileSafe(\"README.md\", \"\");\n\tif (!contents) {\n\t\tawait fs.writeFile(\n\t\t\t\"README.md\",\n\t\t\t[generateTopContent(options), allContributorsContent, endOfReadmeNotice]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(\"\\n\\n\"),\n\t\t);\n\t\treturn;\n\t}\n\n\tconst endOfH1 = findH1Close(contents);\n\n\tcontents = [generateTopContent(options), contents.slice(endOfH1)]\n\t\t.join(\"\")\n\t\t.replace(/\\[!\\[.+\\]\\(.+\\)\\]\\(.+\\)/g, \"\")\n\t\t.replace(/!\\[.+\\]\\(.+\\)/g, \"\")\n\t\t.replaceAll(\"\\r\", \"\")\n\t\t.replaceAll(\"\\n\\n\\n\", \"\\n\\n\");\n\n\tif (allContributorsContent && !contents.includes(contributorsIndicator)) {\n\t\tcontents = [contents, allContributorsContent].join(\"\\n\\n\");\n\t}\n\n\tif (!contents.includes(endOfReadmeNotice)) {\n\t\tcontents = [contents, endOfReadmeNotice].join(\"\\n\\n\");\n\t}\n\n\tawait fs.writeFile(\"README.md\", contents);\n}\n\nfunction findH1Close(contents: string) {\n\tconst markdownMatch = contents.match(/^#.+/);\n\tif (markdownMatch) {\n\t\treturn (markdownMatch.index ?? 0) + markdownMatch[0].length;\n\t}\n\n\treturn contents.indexOf(\"</h1>\") + \"</h1>\".length;\n}\n\nfunction generateTopContent(options: Options) {\n\tconst badgeLines = [\n\t\t!options.excludeContributors &&\n\t\t\t`<a href=\"#contributors\" target=\"_blank\">\n<!-- prettier-ignore-start -->\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n<img alt=\"All Contributors: 2\" src=\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\" />\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n<!-- prettier-ignore-end -->\n</a>`,\n\t\t!options.excludeTests &&\n\t\t\t`<a href=\"https://codecov.io/gh/${options.owner}/${options.repository}\" target=\"_blank\">\n\t<img alt=\"Codecov Test Coverage\" src=\"https://codecov.io/gh/${options.owner}/${options.repository}/branch/main/graph/badge.svg\"/>\n</a>`,\n\t\t`<a href=\"https://github.com/${options.owner}/${options.repository}/blob/main/.github/CODE_OF_CONDUCT.md\" target=\"_blank\">\n\t<img alt=\"Contributor Covenant\" src=\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\" />\n</a>`,\n\t\t`<a href=\"https://github.com/${options.owner}/${options.repository}/blob/main/LICENSE.md\" target=\"_blank\">\n\t<img alt=\"License: MIT\" src=\"https://img.shields.io/github/license/${options.owner}/${options.repository}?color=21bb42\">\n</a>`,\n\t\toptions.funding &&\n\t\t\t`\n\t\t<a href=\"https://github.com/sponsors/${options.funding}\" target=\"_blank\">\n\t\t\t<img alt=\"Sponsor: On GitHub\" src=\"https://img.shields.io/badge/sponsor-on_github-21bb42.svg\" />\n\t\t</a>`,\n\t\t`<img alt=\"Style: Prettier\" src=\"https://img.shields.io/badge/style-prettier-21bb42.svg\" />`,\n\t\t`<img alt=\"TypeScript: Strict\" src=\"https://img.shields.io/badge/typescript-strict-21bb42.svg\" />`,\n\t].filter(Boolean);\n\n\treturn `<h1 align=\"center\">${options.title}</h1>\n\n<p align=\"center\">${options.description}</p>\n\n<p align=\"center\">\n\t${badgeLines.join(\"\\n\")}\n</p>`;\n}\n"],"mappings":"AAAA,OAAO,QAAQ;AAEf,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAElC,MAAM,wBAAwB;AAE9B,SAAS,+BAA+B,SAAkB;AACzD,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,EACE,OAAO,OAAO,EACd,KAAK,IAAI;AACZ;AAEA,eAAsB,YAAY,SAAkB;AACnD,QAAM,yBACL,CAAC,QAAQ,uBAAuB,+BAA+B,OAAO;AACvE,MAAI,WAAW,MAAM,aAAa,aAAa,EAAE;AACjD,MAAI,CAAC,UAAU;AACd,UAAM,GAAG;AAAA,MACR;AAAA,MACA,CAAC,mBAAmB,OAAO,GAAG,wBAAwB,iBAAiB,EACrE,OAAO,OAAO,EACd,KAAK,MAAM;AAAA,IACd;AACA;AAAA,EACD;AAEA,QAAM,UAAU,YAAY,QAAQ;AAEpC,aAAW,CAAC,mBAAmB,O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A,GAGpC,WAAW,KAAK,IAAI,CAAC;AAAA;AAExB;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-typescript-app",
3
- "version": "1.29.22",
3
+ "version": "1.29.23",
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",