chore(deps): update dependency typescript to v4

PR #2788

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
renovate[bot]
2020-08-22 02:44:21 +03:00
committed by GitHub
parent b617bb7379
commit 9550b0505a
10 changed files with 42 additions and 29 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/lockfile-file": patch
---
Remove the `packages` field before saving, if it equals `undefined`.

View File

@@ -31,7 +31,7 @@
"tape": "^4.13.3",
"ts-node": "^8.10.2",
"tslint": "^6.1.3",
"typescript": "^3.9.7",
"typescript": "^4.0.0",
"verdaccio": "^4.8.1",
"yarn": "^1.22.4"
},

View File

@@ -42,16 +42,23 @@ export async function toJsonResult (
await Promise.all(
sortPackages(entryNodes).map(async (node) => {
const subDependencies = await toJsonResult(node.dependencies || [], opts)
const dep = opts.long ? await getPkgInfo(node) : { alias: node.alias, from: node.name, version: node.version, resolved: node.resolved }
const dep = opts.long
? await getPkgInfo(node)
: {
alias: node.alias as string | undefined,
from: node.name,
version: node.version,
resolved: node.resolved,
}
if (Object.keys(subDependencies).length) {
dep['dependencies'] = subDependencies
}
if (!dep.resolved) {
delete dep.resolved
}
const alias = dep.alias
delete dep.alias
dependencies[alias] = dep
dependencies[node.alias] = dep
})
)
return dependencies

View File

@@ -1,5 +1,5 @@
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { Lockfile } from '@pnpm/lockfile-types'
import { Lockfile, ProjectSnapshot } from '@pnpm/lockfile-types'
import { DEPENDENCIES_FIELDS } from '@pnpm/types'
import rimraf = require('@zkochan/rimraf')
import yaml = require('js-yaml')
@@ -65,9 +65,11 @@ function isEmptyLockfile (lockfile: Lockfile) {
return R.values(lockfile.importers).every((importer) => R.isEmpty(importer.specifiers || {}) && R.isEmpty(importer.dependencies || {}))
}
type LockfileFile = Omit<Lockfile, 'importers'> & Partial<ProjectSnapshot> & Partial<Pick<Lockfile, 'importers'>>
function normalizeLockfile (lockfile: Lockfile, forceSharedFormat: boolean) {
if (forceSharedFormat === false && R.equals(R.keys(lockfile.importers), ['.'])) {
const lockfileToSave = {
const lockfileToSave: LockfileFile = {
...lockfile,
...lockfile.importers['.'],
}
@@ -77,7 +79,7 @@ function normalizeLockfile (lockfile: Lockfile, forceSharedFormat: boolean) {
delete lockfileToSave[depType]
}
}
if (R.isEmpty(lockfileToSave.packages)) {
if (R.isEmpty(lockfileToSave.packages) || !lockfileToSave.packages) {
delete lockfileToSave.packages
}
return lockfileToSave
@@ -98,7 +100,7 @@ function normalizeLockfile (lockfile: Lockfile, forceSharedFormat: boolean) {
return acc
}, {}),
}
if (R.isEmpty(lockfileToSave.packages)) {
if (R.isEmpty(lockfileToSave.packages) || !lockfileToSave.packages) {
delete lockfileToSave.packages
}
return lockfileToSave

View File

@@ -217,7 +217,7 @@ async function interactiveUpdate (
// For Vim users (related: https://github.com/enquirer/enquirer/pull/163)
j () { return this.down() },
k () { return this.up() },
} as any) // tslint:disable-line:no-any
} as any) as any // tslint:disable-line:no-any
return update(updateDependencies, opts)
}

View File

@@ -101,7 +101,7 @@ export async function handler (
message: `You are not on ${branch} branch, do you want to continue?`,
name: 'confirm',
type: 'confirm',
} as any)// tslint:disable-line:no-any
} as any) as any // tslint:disable-line:no-any
if (!confirm) {
throw new PnpmError('GIT_NOT_CORRECT_BRANCH', `Branch is not on '${branch}'.`)

View File

@@ -1,4 +1,4 @@
import { getFilePathInCafs } from '@pnpm/cafs'
import { getFilePathInCafs, PackageFilesIndex } from '@pnpm/cafs'
import { getContextForSingleImporter } from '@pnpm/get-context'
import { nameVerFromPkgSnapshot } from '@pnpm/lockfile-utils'
import { streamParser } from '@pnpm/logger'
@@ -47,7 +47,7 @@ export default async function (maybeOpts: StoreStatusOptions) {
const pkgIndexFilePath = integrity
? getFilePathInCafs(cafsDir, integrity, 'index')
: path.join(storeDir, pkgPath, 'integrity.json')
const { files } = await loadJsonFile(pkgIndexFilePath)
const { files } = await loadJsonFile<PackageFilesIndex>(pkgIndexFilePath)
return (await dint.check(path.join(virtualStoreDir, pkgIdToFilename(depPath, opts.dir), 'node_modules', name), files)) === false
})

View File

@@ -41,9 +41,8 @@ function getOptionType (
shorthands: Record<string, string | string[]>,
option: string
) {
const allBools = R.fromPairs(Object.entries(optionTypes).map(([optionName]) => [optionName, Boolean]))
const result = nopt(allBools, shorthands, [option], 0)
delete result.argv
const allBools = R.fromPairs(Object.keys(optionTypes).map((optionName) => [optionName, Boolean]))
const result = R.omit(['argv'], nopt(allBools, shorthands, [option], 0))
return optionTypes[Object.entries(result)[0]?.[0]]
}

View File

@@ -24,7 +24,7 @@ export function pruneSharedLockfile (
warn: opts && opts.warn || ((msg: string) => undefined),
})
const prunnedLockfile = {
const prunnedLockfile: Lockfile = {
...lockfile,
packages: copiedPackages,
}

26
pnpm-lock.yaml generated
View File

@@ -15,9 +15,9 @@ importers:
publish-packed: 3.0.2
rimraf: 3.0.2
tape: 4.13.3
ts-node: 8.10.2_typescript@3.9.7
tslint: 6.1.3_typescript@3.9.7
typescript: 3.9.7
ts-node: 8.10.2_typescript@4.0.2
tslint: 6.1.3_typescript@4.0.2
typescript: 4.0.2
verdaccio: 4.8.1
yarn: 1.22.4
specifiers:
@@ -37,7 +37,7 @@ importers:
tape: ^4.13.3
ts-node: ^8.10.2
tslint: ^6.1.3
typescript: ^3.9.7
typescript: ^4.0.0
verdaccio: ^4.8.1
yarn: ^1.22.4
packages/audit:
@@ -11585,13 +11585,13 @@ packages:
node: '>=0.10.0'
resolution:
integrity: sha1-n5up2e+odkw4dpi8v+sshI8RrbM=
/ts-node/8.10.2_typescript@3.9.7:
/ts-node/8.10.2_typescript@4.0.2:
dependencies:
arg: 4.1.3
diff: 4.0.2
make-error: 1.3.6
source-map-support: 0.5.19
typescript: 3.9.7
typescript: 4.0.2
yn: 3.1.1
dev: true
engines:
@@ -11627,7 +11627,7 @@ packages:
typescript: ^2.2.0 || ^3.0.0
resolution:
integrity: sha512-WlSXE+J2vY/VPgIcqQuijMQiel+UtmXS+4nvK4ZzlDiqBfXse8FAvkNnTcYhnQyOTW5KFM+uRRGXxYhFpuBc6w==
/tslint/6.1.3_typescript@3.9.7:
/tslint/6.1.3_typescript@4.0.2:
dependencies:
'@babel/code-frame': 7.10.4
builtin-modules: 1.1.1
@@ -11641,8 +11641,8 @@ packages:
resolve: 1.17.0
semver: 5.7.1
tslib: 1.13.0
tsutils: 2.29.0_typescript@3.9.7
typescript: 3.9.7
tsutils: 2.29.0_typescript@4.0.2
typescript: 4.0.2
dev: true
engines:
node: '>=4.8.0'
@@ -11657,10 +11657,10 @@ packages:
node: '>=0.6.x'
resolution:
integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==
/tsutils/2.29.0_typescript@3.9.7:
/tsutils/2.29.0_typescript@4.0.2:
dependencies:
tslib: 1.13.0
typescript: 3.9.7
typescript: 4.0.2
dev: true
peerDependencies:
typescript: '>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev'
@@ -11760,13 +11760,13 @@ packages:
/typedarray/0.0.6:
resolution:
integrity: sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
/typescript/3.9.7:
/typescript/4.0.2:
dev: true
engines:
node: '>=4.2.0'
hasBin: true
resolution:
integrity: sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
integrity: sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==
/uglify-js/3.10.1:
dev: true
engines: