diff --git a/lib/registry.js b/lib/registry.js index 1423a92b..b6a8d49b 100644 --- a/lib/registry.js +++ b/lib/registry.js @@ -127,11 +127,12 @@ class RegistryFetcher extends Fetcher { } const packument = await this.packument() + const steps = PackageJson.normalizeSteps.filter(s => s !== '_attributes') const mani = await new PackageJson().fromContent(pickManifest(packument, this.spec.fetchSpec, { ...this.opts, defaultTag: this.defaultTag, before: this.before, - })).normalize().then(p => p.content) + })).normalize({ steps }).then(p => p.content) /* XXX add ETARGET and E403 revalidation of cached packuments here */ diff --git a/test/registry.js b/test/registry.js index 61b52e15..95ea5bc7 100644 --- a/test/registry.js +++ b/test/registry.js @@ -1267,6 +1267,7 @@ t.test('option replaceRegistryHost', rhTest => { dist: { tarball: 'https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz', }, + _test: true, }, }, }) @@ -1291,6 +1292,7 @@ t.test('option replaceRegistryHost', rhTest => { const manifest = await fetcher.manifest() ct.equal(manifest.dist.tarball, 'https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz') const tarball = await fetcher.tarball() + ct.equal(manifest._test, true, 'Underscores are preserved') ct.match(tarball, abbrevTGZ) })