create-typescript-app 2.22.7 → 2.22.9
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
|
@@ -21,6 +21,7 @@ import { readFileSafe } from "./options/readFileSafe.js";
|
|
|
21
21
|
import { readFunding } from "./options/readFunding.js";
|
|
22
22
|
import { readGitDefaults } from "./options/readGitDefaults.js";
|
|
23
23
|
import { readGuide } from "./options/readGuide.js";
|
|
24
|
+
import { readKeywords } from "./options/readKeywords.js";
|
|
24
25
|
import { readLogo } from "./options/readLogo.js";
|
|
25
26
|
import { readNode } from "./options/readNode.js";
|
|
26
27
|
import { readNpmDefaults } from "./options/readNpmDefaults.js";
|
|
@@ -133,6 +134,9 @@ const base = createBase({
|
|
|
133
134
|
getEmailFromNpm
|
|
134
135
|
)
|
|
135
136
|
);
|
|
137
|
+
const getKeywords = lazyValue(
|
|
138
|
+
async () => await readKeywords(getPackageData)
|
|
139
|
+
);
|
|
136
140
|
const getEmailFromCodeOfConduct = lazyValue(
|
|
137
141
|
async () => await readEmailFromCodeOfConduct(take)
|
|
138
142
|
);
|
|
@@ -206,6 +210,7 @@ const base = createBase({
|
|
|
206
210
|
explainer: getExplainer,
|
|
207
211
|
funding: getFunding,
|
|
208
212
|
guide: getGuide,
|
|
213
|
+
keywords: getKeywords,
|
|
209
214
|
logo: getLogo,
|
|
210
215
|
node: getNode,
|
|
211
216
|
owner: getOwner,
|
|
@@ -49,16 +49,13 @@ const blockPackageJson = base.createBlock({
|
|
|
49
49
|
...options.pnpm && {
|
|
50
50
|
packageManager: `pnpm@${options.pnpm}`
|
|
51
51
|
},
|
|
52
|
-
files: [
|
|
52
|
+
files: processFiles([
|
|
53
53
|
...collectBinFiles(options.bin),
|
|
54
54
|
...addons.properties.files ?? [],
|
|
55
55
|
"package.json",
|
|
56
56
|
"README.md"
|
|
57
|
-
]
|
|
58
|
-
keywords: options.keywords
|
|
59
|
-
(keyword) => keyword.split(/ /)
|
|
60
|
-
),
|
|
61
|
-
license: "MIT",
|
|
57
|
+
]),
|
|
58
|
+
keywords: options.keywords,
|
|
62
59
|
name: options.repository,
|
|
63
60
|
repository: {
|
|
64
61
|
type: "git",
|
|
@@ -98,6 +95,12 @@ function collectBinFiles(bin) {
|
|
|
98
95
|
const files = typeof bin === "object" ? Object.values(bin) : [bin];
|
|
99
96
|
return files.map((file) => file.replace(/^\.\//, ""));
|
|
100
97
|
}
|
|
98
|
+
function processFiles(files) {
|
|
99
|
+
const sortedByLength = files.filter(Boolean).sort((a, b) => a.length - b.length);
|
|
100
|
+
return sortedByLength.filter(
|
|
101
|
+
(file, i) => !sortedByLength.slice(0, i).some((earlier) => earlier.endsWith("/") && file.startsWith(earlier))
|
|
102
|
+
).sort();
|
|
103
|
+
}
|
|
101
104
|
function removeRangePrefix(version) {
|
|
102
105
|
const raw = version.replaceAll(/[\^~><=]/gu, "").split(" ")[0];
|
|
103
106
|
return semver.coerce(raw) ?? raw;
|
package/lib/types.d.ts
CHANGED