Skip to content

Commit

Permalink
fix(computed): use the cleaned package to match keys
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Haroenv committed Mar 31, 2018
1 parent bfab179 commit 44a839c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/formatPkg.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function formatPkg(pkg) {

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

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

(_, { schematics = '' }) => ({
({ schematics = '' }) => ({
name: 'angular-cli-schematic',
include: schematics.length > 0,
metadata: { schematics },
}),
];

function getComputedData(cleaned, original) {
function getComputedData(cleaned) {
const registrySubsets = registrySubsetRules.reduce(
(acc, matcher) => {
const { include, metadata, name } = matcher(cleaned, original);
const { include, metadata, name } = matcher(cleaned);
return include
? {
computedKeywords: [...acc.computedKeywords, name],
Expand Down

0 comments on commit 44a839c

Please sign in to comment.