Skip to content

Commit 44a839c

Browse files
committed
fix(computed): use the cleaned package to match keys
nice-package keeps keys in the latest, just like we expect, but we made a mistake in which we assumed the schame of the original package was like a package.json (spoiler: it's not at all), and thus the test was actually pretty wrong, just because of the fact that nice-package also works for a package.json, not just a npm registry package I noticed this error when taking a look at the bootstrap, currently at 73% and noticed it didn't include the angular packages
1 parent bfab179 commit 44a839c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/formatPkg.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default function formatPkg(pkg) {
5353

5454
const owner = getOwner(repository, lastPublisher, author); // always favor the repository owner
5555
const badPackage = isBadPackage(owner);
56-
const { computedKeywords, computedMetadata } = getComputedData(cleaned, pkg);
56+
const { computedKeywords, computedMetadata } = getComputedData(cleaned);
5757
const keywords = [...getKeywords(cleaned), ...computedKeywords]; // concat with the subset for backward compat
5858

5959
const dependencies = cleaned.dependencies || {};
@@ -224,17 +224,17 @@ const registrySubsetRules = [
224224
include: /^(@vue\/|vue-|@[\w-]+\/vue-)cli-plugin-/.test(name),
225225
}),
226226

227-
(_, { schematics = '' }) => ({
227+
({ schematics = '' }) => ({
228228
name: 'angular-cli-schematic',
229229
include: schematics.length > 0,
230230
metadata: { schematics },
231231
}),
232232
];
233233

234-
function getComputedData(cleaned, original) {
234+
function getComputedData(cleaned) {
235235
const registrySubsets = registrySubsetRules.reduce(
236236
(acc, matcher) => {
237-
const { include, metadata, name } = matcher(cleaned, original);
237+
const { include, metadata, name } = matcher(cleaned);
238238
return include
239239
? {
240240
computedKeywords: [...acc.computedKeywords, name],

0 commit comments

Comments
 (0)