Skip to content

feat: support package.yaml and package.json5 #1799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 1, 2019
Merged
Prev Previous commit
Next Next commit
feat: use @pnpm/read-importer-manifest in supi
  • Loading branch information
zkochan committed May 1, 2019
commit 4131c12f70589c5ef81c7ff8d0b213a740778eea
1 change: 1 addition & 0 deletions packages/supi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@pnpm/package-requester": "7.0.6",
"@pnpm/pkgid-to-filename": "2.0.0",
"@pnpm/prune-lockfile": "1.0.4",
"@pnpm/read-importer-manifest": "0.0.0",
"@pnpm/read-importers-context": "1.0.1",
"@pnpm/read-modules-dir": "2.0.0",
"@pnpm/read-package-json": "2.0.1",
Expand Down
16 changes: 8 additions & 8 deletions packages/supi/src/link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import logger, { streamParser } from '@pnpm/logger'
import { prune } from '@pnpm/modules-cleaner'
import { pruneSharedLockfile } from '@pnpm/prune-lockfile'
import readImporterManifest from '@pnpm/read-importer-manifest'
import { symlinkDirectRootDependency } from '@pnpm/symlink-dependency'
import {
DEPENDENCIES_FIELDS,
Expand All @@ -21,7 +22,6 @@ import {
import {
getSaveType,
} from '@pnpm/utils'
import loadJsonFile = require('load-json-file')
import normalize = require('normalize-path')
import path = require('path')
import pathAbsolute = require('path-absolute')
Expand Down Expand Up @@ -66,27 +66,27 @@ export default async function link (
linkFromPath = linkFrom.path
linkFromAlias = linkFrom.alias
}
const linkedPkg = await loadJsonFile<DependencyManifest>(path.join(linkFromPath, 'package.json'))
const { manifest } = await readImporterManifest(linkFromPath) as { manifest: DependencyManifest }
specsToUpsert.push({
name: linkedPkg.name,
pref: getPref(linkedPkg.name, linkedPkg.name, linkedPkg.version, {
name: manifest.name,
pref: getPref(manifest.name, manifest.name, manifest.version, {
pinnedVersion: opts.pinnedVersion,
}),
saveType: (saveType || ctx.manifest && guessDependencyType(linkedPkg.name, ctx.manifest)) as DependenciesField,
saveType: (saveType || ctx.manifest && guessDependencyType(manifest.name, ctx.manifest)) as DependenciesField,
})

const packagePath = normalize(path.relative(opts.prefix, linkFromPath))
const addLinkOpts = {
linkedPkgName: linkFromAlias || linkedPkg.name,
linkedPkgName: linkFromAlias || manifest.name,
manifest: ctx.manifest,
packagePath,
}
addLinkToLockfile(ctx.currentLockfile.importers[importerId], addLinkOpts)
addLinkToLockfile(ctx.wantedLockfile.importers[importerId], addLinkOpts)

linkedPkgs.push({
alias: linkFromAlias || linkedPkg.name,
manifest: linkedPkg,
alias: linkFromAlias || manifest.name,
manifest,
path: linkFromPath,
})
}
Expand Down
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy