mirror of
https://github.com/pnpm/pnpm.git
synced 2026-02-07 13:42:10 -05:00
refactor: create @pnpm/parse-wanted-dependency
This commit is contained in:
@@ -30,9 +30,6 @@
|
||||
{
|
||||
"path": "../types"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
},
|
||||
{
|
||||
"path": "../dependency-path"
|
||||
},
|
||||
|
||||
@@ -66,9 +66,6 @@
|
||||
{
|
||||
"path": "../types"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
},
|
||||
{
|
||||
"path": "../dependency-path"
|
||||
},
|
||||
|
||||
13
packages/parse-wanted-dependency/README.md
Normal file
13
packages/parse-wanted-dependency/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# @pnpm/parse-wanted-dependency
|
||||
|
||||
> Parse dependency specifier
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
pnpm i @pnpm/parse-wanted-dependency
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
35
packages/parse-wanted-dependency/package.json
Normal file
35
packages/parse-wanted-dependency/package.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "@pnpm/parse-wanted-dependency",
|
||||
"description": "Parse dependency specifier",
|
||||
"version": "0.0.0",
|
||||
"author": "Zoltan Kochan <z@kochan.io> (https://www.kochan.io/)",
|
||||
"bugs": {
|
||||
"url": "https://github.com/pnpm/pnpm/issues"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"typings": "lib/index.d.ts",
|
||||
"files": [
|
||||
"lib",
|
||||
"!*.map"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@pnpm/parse-wanted-dependency": "link:",
|
||||
"@types/validate-npm-package-name": "3.0.0"
|
||||
},
|
||||
"keywords": [],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.13"
|
||||
},
|
||||
"repository": "https://github.com/pnpm/pnpm/blob/master/packages/parse-wanted-dependency",
|
||||
"scripts": {
|
||||
"test": "pnpm run compile",
|
||||
"lint": "tslint -c ../../tslint.json --project .",
|
||||
"prepublishOnly": "pnpm run compile",
|
||||
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build"
|
||||
},
|
||||
"dependencies": {
|
||||
"validate-npm-package-name": "3.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/pnpm/pnpm/blob/master/packages/parse-wanted-dependency#readme"
|
||||
}
|
||||
12
packages/parse-wanted-dependency/tsconfig.json
Normal file
12
packages/parse-wanted-dependency/tsconfig.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "@pnpm/tsconfig",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"../../typings/**/*.d.ts"
|
||||
],
|
||||
"references": []
|
||||
}
|
||||
@@ -66,6 +66,7 @@
|
||||
"@pnpm/find-workspace-packages": "workspace:2.1.14",
|
||||
"@pnpm/outdated": "workspace:7.0.16",
|
||||
"@pnpm/package-store": "workspace:8.0.4",
|
||||
"@pnpm/parse-wanted-dependency": "workspace:0.0.0",
|
||||
"@pnpm/plugin-commands-rebuild": "workspace:1.0.4",
|
||||
"@pnpm/pnpmfile": "workspace:0.1.7",
|
||||
"@pnpm/resolver-base": "workspace:7.0.0",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import PnpmError from '@pnpm/error'
|
||||
import parseWantedDependency from '@pnpm/parse-wanted-dependency'
|
||||
import { WorkspacePackages } from '@pnpm/resolver-base'
|
||||
import { IncludedDependencies, ProjectManifest } from '@pnpm/types'
|
||||
import { parseWantedDependency } from '@pnpm/utils'
|
||||
|
||||
export function updateToWorkspacePackagesFromManifest (manifest: ProjectManifest, include: IncludedDependencies, workspacePackages: WorkspacePackages) {
|
||||
const allDeps = {
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
{
|
||||
"path": "../package-store"
|
||||
},
|
||||
{
|
||||
"path": "../parse-wanted-dependency"
|
||||
},
|
||||
{
|
||||
"path": "../plugin-commands-rebuild"
|
||||
},
|
||||
|
||||
@@ -42,9 +42,6 @@
|
||||
{
|
||||
"path": "../types"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
},
|
||||
{
|
||||
"path": "../filter-workspace-packages"
|
||||
},
|
||||
|
||||
@@ -33,9 +33,6 @@
|
||||
{
|
||||
"path": "../types"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
},
|
||||
{
|
||||
"path": "../filter-workspace-packages"
|
||||
},
|
||||
|
||||
@@ -56,12 +56,12 @@
|
||||
"@pnpm/error": "workspace:1.2.0",
|
||||
"@pnpm/get-context": "workspace:1.1.5",
|
||||
"@pnpm/normalize-registries": "workspace:0.0.0",
|
||||
"@pnpm/parse-wanted-dependency": "workspace:0.0.0",
|
||||
"@pnpm/pick-registry-for-package": "workspace:0.0.0",
|
||||
"@pnpm/store-connection-manager": "workspace:0.2.25",
|
||||
"@pnpm/store-controller-types": "workspace:7.0.0",
|
||||
"@pnpm/store-path": "2.1.1",
|
||||
"@pnpm/types": "workspace:5.0.0",
|
||||
"@pnpm/utils": "workspace:0.13.0",
|
||||
"archy": "1.0.0",
|
||||
"common-tags": "1.8.0",
|
||||
"dependency-path": "workspace:4.0.5",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import PnpmError from '@pnpm/error'
|
||||
import logger, { globalInfo, streamParser } from '@pnpm/logger'
|
||||
import parseWantedDependency from '@pnpm/parse-wanted-dependency'
|
||||
import pickRegistryForPackage from '@pnpm/pick-registry-for-package'
|
||||
import { StoreController } from '@pnpm/store-controller-types'
|
||||
import { Registries } from '@pnpm/types'
|
||||
import { parseWantedDependency } from '@pnpm/utils'
|
||||
import { ReporterFunction } from './types'
|
||||
|
||||
export default async function (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { streamParser } from '@pnpm/logger'
|
||||
import parseWantedDependency from '@pnpm/parse-wanted-dependency'
|
||||
import { PackageUsages, StoreController } from '@pnpm/store-controller-types'
|
||||
import { parseWantedDependency } from '@pnpm/utils'
|
||||
import { ReporterFunction } from './types'
|
||||
|
||||
export default async function (
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
{
|
||||
"path": "../normalize-registries"
|
||||
},
|
||||
{
|
||||
"path": "../parse-wanted-dependency"
|
||||
},
|
||||
{
|
||||
"path": "../pick-registry-for-package"
|
||||
},
|
||||
@@ -36,9 +39,6 @@
|
||||
{
|
||||
"path": "../types"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
},
|
||||
{
|
||||
"path": "../dependency-path"
|
||||
},
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
},
|
||||
{
|
||||
"path": "../types"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
"@pnpm/modules-yaml": "workspace:6.0.1",
|
||||
"@pnpm/normalize-registries": "workspace:0.0.0",
|
||||
"@pnpm/package-requester": "workspace:11.0.4",
|
||||
"@pnpm/parse-wanted-dependency": "workspace:0.0.0",
|
||||
"@pnpm/pkgid-to-filename": "2.0.0",
|
||||
"@pnpm/prune-lockfile": "workspace:2.0.6",
|
||||
"@pnpm/read-modules-dir": "workspace:2.0.1",
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import {
|
||||
Dependencies,
|
||||
} from '@pnpm/types'
|
||||
import { parseWantedDependency } from '@pnpm/utils'
|
||||
import parseWantedDependency from '@pnpm/parse-wanted-dependency'
|
||||
import { Dependencies } from '@pnpm/types'
|
||||
import guessPinnedVersionFromExistingSpec from './guessPinnedVersionFromExistingSpec'
|
||||
import { PinnedVersion, WantedDependency } from './install/getWantedDependencies'
|
||||
|
||||
|
||||
@@ -63,6 +63,9 @@
|
||||
{
|
||||
"path": "../package-requester"
|
||||
},
|
||||
{
|
||||
"path": "../parse-wanted-dependency"
|
||||
},
|
||||
{
|
||||
"path": "../prune-lockfile"
|
||||
},
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@pnpm/logger": "3.1.0",
|
||||
"@pnpm/utils": "link:",
|
||||
"@types/mz": "^2.7.0",
|
||||
"@types/validate-npm-package-name": "3.0.0"
|
||||
"@pnpm/utils": "link:"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
@@ -38,9 +36,7 @@
|
||||
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pnpm/types": "workspace:5.0.0",
|
||||
"mz": "2.7.0",
|
||||
"validate-npm-package-name": "3.0.0"
|
||||
"@pnpm/types": "workspace:5.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/pnpm/pnpm/blob/master/packages/utils#readme"
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import getAllDependenciesFromPackage from './getAllDependenciesFromPackage'
|
||||
import parseWantedDependency from './parseWantedDependency'
|
||||
|
||||
export {
|
||||
getAllDependenciesFromPackage,
|
||||
parseWantedDependency,
|
||||
}
|
||||
export { getAllDependenciesFromPackage }
|
||||
|
||||
export * from './filterDependenciesByType'
|
||||
|
||||
26
pnpm-lock.yaml
generated
26
pnpm-lock.yaml
generated
@@ -1306,6 +1306,16 @@ importers:
|
||||
'@pnpm/parse-cli-args': 'link:'
|
||||
'@types/nopt': 3.0.29
|
||||
nopt: 4.0.3
|
||||
packages/parse-wanted-dependency:
|
||||
dependencies:
|
||||
validate-npm-package-name: 3.0.0
|
||||
devDependencies:
|
||||
'@pnpm/parse-wanted-dependency': 'link:'
|
||||
'@types/validate-npm-package-name': 3.0.0
|
||||
specifiers:
|
||||
'@pnpm/parse-wanted-dependency': 'link:'
|
||||
'@types/validate-npm-package-name': 3.0.0
|
||||
validate-npm-package-name: 3.0.0
|
||||
packages/pick-registry-for-package:
|
||||
dependencies:
|
||||
'@pnpm/types': 'link:../types'
|
||||
@@ -1412,6 +1422,7 @@ importers:
|
||||
'@pnpm/find-workspace-packages': 'link:../find-workspace-packages'
|
||||
'@pnpm/outdated': 'link:../outdated'
|
||||
'@pnpm/package-store': 'link:../package-store'
|
||||
'@pnpm/parse-wanted-dependency': 'link:../parse-wanted-dependency'
|
||||
'@pnpm/plugin-commands-rebuild': 'link:../plugin-commands-rebuild'
|
||||
'@pnpm/pnpmfile': 'link:../pnpmfile'
|
||||
'@pnpm/resolver-base': 'link:../resolver-base'
|
||||
@@ -1474,6 +1485,7 @@ importers:
|
||||
'@pnpm/matcher': 'workspace:1.0.0'
|
||||
'@pnpm/outdated': 'workspace:7.0.16'
|
||||
'@pnpm/package-store': 'workspace:8.0.4'
|
||||
'@pnpm/parse-wanted-dependency': 'workspace:0.0.0'
|
||||
'@pnpm/plugin-commands-installation': 'link:'
|
||||
'@pnpm/plugin-commands-rebuild': 'workspace:1.0.4'
|
||||
'@pnpm/pnpmfile': 'workspace:0.1.7'
|
||||
@@ -1930,12 +1942,12 @@ importers:
|
||||
'@pnpm/error': 'link:../error'
|
||||
'@pnpm/get-context': 'link:../get-context'
|
||||
'@pnpm/normalize-registries': 'link:../normalize-registries'
|
||||
'@pnpm/parse-wanted-dependency': 'link:../parse-wanted-dependency'
|
||||
'@pnpm/pick-registry-for-package': 'link:../pick-registry-for-package'
|
||||
'@pnpm/store-connection-manager': 'link:../store-connection-manager'
|
||||
'@pnpm/store-controller-types': 'link:../store-controller-types'
|
||||
'@pnpm/store-path': 2.1.1
|
||||
'@pnpm/types': 'link:../types'
|
||||
'@pnpm/utils': 'link:../utils'
|
||||
archy: 1.0.0
|
||||
common-tags: 1.8.0
|
||||
dependency-path: 'link:../dependency-path'
|
||||
@@ -1968,6 +1980,7 @@ importers:
|
||||
'@pnpm/lockfile-file': 'workspace:3.0.7'
|
||||
'@pnpm/logger': 3.1.0
|
||||
'@pnpm/normalize-registries': 'workspace:0.0.0'
|
||||
'@pnpm/parse-wanted-dependency': 'workspace:0.0.0'
|
||||
'@pnpm/pick-registry-for-package': 'workspace:0.0.0'
|
||||
'@pnpm/plugin-commands-store': 'link:'
|
||||
'@pnpm/prepare': 'workspace:0.0.0'
|
||||
@@ -1975,7 +1988,6 @@ importers:
|
||||
'@pnpm/store-controller-types': 'workspace:7.0.0'
|
||||
'@pnpm/store-path': 2.1.1
|
||||
'@pnpm/types': 'workspace:5.0.0'
|
||||
'@pnpm/utils': 'workspace:0.13.0'
|
||||
'@types/archy': 0.0.31
|
||||
'@types/common-tags': ^1.8.0
|
||||
'@types/ramda': ^0.27.3
|
||||
@@ -2484,6 +2496,7 @@ importers:
|
||||
'@pnpm/modules-yaml': 'link:../modules-yaml'
|
||||
'@pnpm/normalize-registries': 'link:../normalize-registries'
|
||||
'@pnpm/package-requester': 'link:../package-requester'
|
||||
'@pnpm/parse-wanted-dependency': 'link:../parse-wanted-dependency'
|
||||
'@pnpm/pkgid-to-filename': 2.0.0
|
||||
'@pnpm/prune-lockfile': 'link:../prune-lockfile'
|
||||
'@pnpm/read-modules-dir': 'link:../read-modules-dir'
|
||||
@@ -2590,6 +2603,7 @@ importers:
|
||||
'@pnpm/normalize-registries': 'workspace:0.0.0'
|
||||
'@pnpm/package-requester': 'workspace:11.0.4'
|
||||
'@pnpm/package-store': 'workspace:*'
|
||||
'@pnpm/parse-wanted-dependency': 'workspace:0.0.0'
|
||||
'@pnpm/pkgid-to-filename': 2.0.0
|
||||
'@pnpm/prepare': 'workspace:0.0.0'
|
||||
'@pnpm/prune-lockfile': 'workspace:2.0.6'
|
||||
@@ -2743,21 +2757,13 @@ importers:
|
||||
packages/utils:
|
||||
dependencies:
|
||||
'@pnpm/types': 'link:../types'
|
||||
mz: 2.7.0
|
||||
validate-npm-package-name: 3.0.0
|
||||
devDependencies:
|
||||
'@pnpm/logger': 3.1.0
|
||||
'@pnpm/utils': 'link:'
|
||||
'@types/mz': 2.7.0
|
||||
'@types/validate-npm-package-name': 3.0.0
|
||||
specifiers:
|
||||
'@pnpm/logger': 3.1.0
|
||||
'@pnpm/types': 'workspace:5.0.0'
|
||||
'@pnpm/utils': 'link:'
|
||||
'@types/mz': ^2.7.0
|
||||
'@types/validate-npm-package-name': 3.0.0
|
||||
mz: 2.7.0
|
||||
validate-npm-package-name: 3.0.0
|
||||
packages/write-project-manifest:
|
||||
dependencies:
|
||||
'@pnpm/types': 'link:../types'
|
||||
|
||||
Reference in New Issue
Block a user