create-typescript-app 2.21.3 → 2.21.4

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/base.js CHANGED
@@ -6,6 +6,7 @@ import { z } from "zod";
6
6
  import { readAccess } from "./options/readAccess.js";
7
7
  import { readAllContributors } from "./options/readAllContributors.js";
8
8
  import { readAuthor } from "./options/readAuthor.js";
9
+ import { readBin } from "./options/readBin.js";
9
10
  import { readDescription } from "./options/readDescription.js";
10
11
  import { readDocumentation } from "./options/readDocumentation.js";
11
12
  import { readEmailFromCodeOfConduct } from "./options/readEmailFromCodeOfConduct.js";
@@ -107,7 +108,7 @@ const base = createBase({
107
108
  const getAuthor = lazyValue(
108
109
  async () => await readAuthor(getPackageAuthor, getNpmDefaults, options.owner)
109
110
  );
110
- const getBin = lazyValue(async () => (await getPackageData()).bin);
111
+ const getBin = lazyValue(async () => await readBin(getPackageData));
111
112
  const getEmoji = lazyValue(async () => await readEmoji(getDescription));
112
113
  const getDescription = lazyValue(
113
114
  async () => await readDescription(getPackageData, getReadme)
@@ -1,5 +1,5 @@
1
1
  var name = "create-typescript-app";
2
- var version = "2.21.2";
2
+ var version = "2.21.3";
3
3
  var description = "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 🎁";
4
4
  var repository = {
5
5
  type: "git",
@@ -0,0 +1,5 @@
1
+ import { PartialPackageData } from '../types.js';
2
+
3
+ declare function readBin(getPackageData: () => Promise<PartialPackageData>): Promise<string | Record<string, string> | undefined>;
4
+
5
+ export { readBin };
@@ -0,0 +1,13 @@
1
+ import { trimPrecedingSlash } from "../utils/trimPrecedingSlash.js";
2
+ async function readBin(getPackageData) {
3
+ const { bin } = await getPackageData();
4
+ return typeof bin === "object" ? Object.fromEntries(
5
+ Object.entries(bin).map(([key, value]) => [
6
+ key,
7
+ trimPrecedingSlash(value)
8
+ ])
9
+ ) : trimPrecedingSlash(bin);
10
+ }
11
+ export {
12
+ readBin
13
+ };
@@ -0,0 +1,3 @@
1
+ declare function trimPrecedingSlash(filePath: string | undefined): string | undefined;
2
+
3
+ export { trimPrecedingSlash };
@@ -0,0 +1,6 @@
1
+ function trimPrecedingSlash(filePath) {
2
+ return filePath?.replace(/^\.\//, "");
3
+ }
4
+ export {
5
+ trimPrecedingSlash
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-typescript-app",
3
- "version": "2.21.3",
3
+ "version": "2.21.4",
4
4
  "description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 🎁",
5
5
  "repository": {
6
6
  "type": "git",