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 () =>
|
|
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)
|
|
@@ -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
|
+
};
|