diff --git a/.meta-updater/src/index.ts b/.meta-updater/src/index.ts index b3ed6afee..6177100e1 100644 --- a/.meta-updater/src/index.ts +++ b/.meta-updater/src/index.ts @@ -13,7 +13,7 @@ const NEXT_TAG = 'next-7' const CLI_PKG_NAME = 'pnpm' export default async (workspaceDir: string) => { - const pnpmManifest = loadJsonFile.sync(path.join(workspaceDir, 'pnpm/package.json')) + const pnpmManifest = loadJsonFile.sync(path.join(workspaceDir, 'pnpm/package.json')) const pnpmVersion = pnpmManifest!['version'] // eslint-disable-line const pnpmMajorKeyword = `pnpm${pnpmVersion.split('.')[0]}` const utilsDir = path.join(workspaceDir, '__utils__') @@ -108,8 +108,10 @@ async function updateTSConfig ( }, { indent: 2 }) return { ...tsConfig, + extends: '@pnpm/tsconfig', + composite: true, compilerOptions: { - ...tsConfig['compilerOptions'], + ...(tsConfig as any)['compilerOptions'], rootDir: 'src', }, references: references.sort((r1, r2) => r1.path.localeCompare(r2.path)), diff --git a/.meta-updater/tsconfig.json b/.meta-updater/tsconfig.json index 9d2d32cc5..0e21c3a40 100644 --- a/.meta-updater/tsconfig.json +++ b/.meta-updater/tsconfig.json @@ -13,5 +13,6 @@ { "path": "../lockfile/lockfile-file" } - ] + ], + "composite": true } diff --git a/.npmrc b/.npmrc index 8f4f9f4d2..97cec6c2f 100644 --- a/.npmrc +++ b/.npmrc @@ -12,3 +12,4 @@ save-workspace-protocol=rolling save-prefix= resolution-mode=time-based auto-install-peers=true +resolve-peers-from-workspace-root=true diff --git a/__utils__/assert-project/package.json b/__utils__/assert-project/package.json index 13c4df16e..ff119914d 100644 --- a/__utils__/assert-project/package.json +++ b/__utils__/assert-project/package.json @@ -32,7 +32,7 @@ }, "repository": "https://github.com/pnpm/pnpm/blob/master/privatePackages/assert-project", "scripts": { - "lint": "tslint -c ../../tslint.json --project .", + "lint": "eslint src/**/*.ts test/**/*.ts", "lint-test": "tslint -c tslint.json --project test", "compile": "rimraf tsconfig.tsbuildinfo lib && tsc --build", "prepublishOnly": "pnpm run compile", diff --git a/__utils__/assert-project/tsconfig.json b/__utils__/assert-project/tsconfig.json index 40bb1baa2..4ac8ad2a9 100644 --- a/__utils__/assert-project/tsconfig.json +++ b/__utils__/assert-project/tsconfig.json @@ -24,5 +24,6 @@ { "path": "../assert-store" } - ] + ], + "composite": true } diff --git a/__utils__/assert-store/package.json b/__utils__/assert-store/package.json index df814d849..97620588e 100644 --- a/__utils__/assert-store/package.json +++ b/__utils__/assert-store/package.json @@ -34,7 +34,7 @@ "repository": "https://github.com/pnpm/pnpm/blob/master/privatePackages/assert-store", "scripts": { "compile": "tsc --build", - "lint": "tslint -c ../../tslint.json src/**/*.ts test/**/*.ts", + "lint": "eslint src/**/*.ts test/**/*.ts", "prepublishOnly": "pnpm run compile", "pretest": "pnpm install -C test/fixture/project --force --no-shared-workspace-lockfile", "test": "pnpm pretest && pnpm run compile && jest" diff --git a/__utils__/assert-store/tsconfig.json b/__utils__/assert-store/tsconfig.json index 198734478..a4d846bb7 100644 --- a/__utils__/assert-store/tsconfig.json +++ b/__utils__/assert-store/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../store/cafs" } - ] + ], + "composite": true } diff --git a/__utils__/eslint-config/eslint.json b/__utils__/eslint-config/eslint.json index c5e758b83..48322f097 100644 --- a/__utils__/eslint-config/eslint.json +++ b/__utils__/eslint-config/eslint.json @@ -29,6 +29,7 @@ } ], "@typescript-eslint/consistent-indexed-object-style": "off", + "@typescript-eslint/prefer-reduce-type-parameter": "off", "@typescript-eslint/naming-convention": "error", "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/no-explicit-any": "error", diff --git a/__utils__/eslint-config/package.json b/__utils__/eslint-config/package.json index c1802bd01..d1ef5ad6f 100644 --- a/__utils__/eslint-config/package.json +++ b/__utils__/eslint-config/package.json @@ -25,7 +25,7 @@ "dependencies": { "@typescript-eslint/eslint-plugin": "^5.48.1", "@typescript-eslint/parser": "^5.48.1", - "eslint": "^8.31.0", + "eslint": "^8.32.0", "eslint-config-standard-with-typescript": "^26.0.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-n": "^15.6.0", diff --git a/__utils__/get-release-text/tsconfig.json b/__utils__/get-release-text/tsconfig.json index 82729a530..f0127abb1 100644 --- a/__utils__/get-release-text/tsconfig.json +++ b/__utils__/get-release-text/tsconfig.json @@ -9,5 +9,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/__utils__/prepare/package.json b/__utils__/prepare/package.json index e1de16c53..2f03c2958 100644 --- a/__utils__/prepare/package.json +++ b/__utils__/prepare/package.json @@ -16,7 +16,7 @@ "@types/node": "^14.18.36" }, "scripts": { - "lint": "tslint -c ../../tslint.json --project .", + "lint": "eslint src/**/*.ts", "prepublishOnly": "pnpm run compile", "test": "pnpm run compile", "compile": "rimraf tsconfig.tsbuildinfo lib && tsc --build" diff --git a/__utils__/prepare/src/index.ts b/__utils__/prepare/src/index.ts index 46c5e0635..902f84f2f 100644 --- a/__utils__/prepare/src/index.ts +++ b/__utils__/prepare/src/index.ts @@ -27,8 +27,13 @@ export function tempDir (chdir: boolean = true) { return tmpDir } +interface LocationAndManifest { + location: string + package: ProjectManifest +} + export function preparePackages ( - pkgs: Array<{ location: string, package: ProjectManifest } | ProjectManifest>, + pkgs: Array, opts?: { manifestFormat?: ManifestFormat tempDir?: string @@ -40,15 +45,15 @@ export function preparePackages ( const dirname = path.dirname(pkgTmpPath) const result: { [name: string]: Project } = {} for (const aPkg of pkgs) { - if (typeof aPkg['location'] === 'string') { - result[aPkg['package']['name']] = prepare(aPkg['package'], { + if (typeof (aPkg as LocationAndManifest).location === 'string') { + result[(aPkg as LocationAndManifest).package.name!] = prepare((aPkg as LocationAndManifest).package, { manifestFormat, - tempDir: path.join(dirname, aPkg['location']), + tempDir: path.join(dirname, (aPkg as LocationAndManifest).location), }) } else { - result[aPkg['name']] = prepare(aPkg as ProjectManifest, { + result[(aPkg as ProjectManifest).name!] = prepare(aPkg as ProjectManifest, { manifestFormat, - tempDir: path.join(dirname, aPkg['name']), + tempDir: path.join(dirname, (aPkg as ProjectManifest).name!), }) } } diff --git a/__utils__/prepare/tsconfig.json b/__utils__/prepare/tsconfig.json index b6f10467f..b9ab37c80 100644 --- a/__utils__/prepare/tsconfig.json +++ b/__utils__/prepare/tsconfig.json @@ -15,5 +15,6 @@ { "path": "../assert-project" } - ] + ], + "composite": true } diff --git a/__utils__/test-fixtures/package.json b/__utils__/test-fixtures/package.json index bc082e576..78ab5294c 100644 --- a/__utils__/test-fixtures/package.json +++ b/__utils__/test-fixtures/package.json @@ -27,7 +27,7 @@ }, "repository": "https://github.com/pnpm/pnpm/blob/master/privatePackages/test-fixtures", "scripts": { - "lint": "tslint -c ../../tslint.json --project .", + "lint": "eslint src/**/*.ts", "compile": "rimraf tsconfig.tsbuildinfo lib && tsc --build", "test": "pnpm run compile" }, diff --git a/__utils__/test-fixtures/tsconfig.json b/__utils__/test-fixtures/tsconfig.json index 7b1ede671..5696622ff 100644 --- a/__utils__/test-fixtures/tsconfig.json +++ b/__utils__/test-fixtures/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../prepare" } - ] + ], + "composite": true } diff --git a/__utils__/tsconfig/tsconfig.json b/__utils__/tsconfig/tsconfig.json index d70619104..50260d3b3 100644 --- a/__utils__/tsconfig/tsconfig.json +++ b/__utils__/tsconfig/tsconfig.json @@ -12,7 +12,6 @@ "removeComments": false, "sourceMap": true, "strict": true, - "suppressImplicitAnyIndexErrors": true, "target": "es2020" }, "atom": { diff --git a/cli/cli-meta/tsconfig.json b/cli/cli-meta/tsconfig.json index d37dd6eef..7302e6eab 100644 --- a/cli/cli-meta/tsconfig.json +++ b/cli/cli-meta/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/cli/cli-utils/src/style.ts b/cli/cli-utils/src/style.ts index f8394356e..494c536b4 100644 --- a/cli/cli-utils/src/style.ts +++ b/cli/cli-utils/src/style.ts @@ -25,5 +25,6 @@ export const TABLE_OPTIONS = { } for (const [key, value] of Object.entries(TABLE_OPTIONS.border)) { + // @ts-expect-error TABLE_OPTIONS.border[key] = chalk.grey(value) } diff --git a/cli/cli-utils/tsconfig.json b/cli/cli-utils/tsconfig.json index 37b02db46..5662a4680 100644 --- a/cli/cli-utils/tsconfig.json +++ b/cli/cli-utils/tsconfig.json @@ -33,5 +33,6 @@ { "path": "../default-reporter" } - ] + ], + "composite": true } diff --git a/cli/command/tsconfig.json b/cli/command/tsconfig.json index c6f0399f6..441d43d55 100644 --- a/cli/command/tsconfig.json +++ b/cli/command/tsconfig.json @@ -8,5 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/cli/common-cli-options-help/tsconfig.json b/cli/common-cli-options-help/tsconfig.json index c6f0399f6..441d43d55 100644 --- a/cli/common-cli-options-help/tsconfig.json +++ b/cli/common-cli-options-help/tsconfig.json @@ -8,5 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/cli/default-reporter/src/reporterForClient/index.ts b/cli/default-reporter/src/reporterForClient/index.ts index 309fd12f2..34a5f0d97 100644 --- a/cli/default-reporter/src/reporterForClient/index.ts +++ b/cli/default-reporter/src/reporterForClient/index.ts @@ -101,7 +101,7 @@ export function reporterForClient ( outputs.push(reportContext(log$, { cwd })) } - if (PRINT_EXECUTION_TIME_IN_COMMANDS[opts.cmd]) { + if (opts.cmd in PRINT_EXECUTION_TIME_IN_COMMANDS) { outputs.push(reportExecutionTime(log$.executionTime)) } diff --git a/cli/default-reporter/src/reporterForClient/pkgsDiff.ts b/cli/default-reporter/src/reporterForClient/pkgsDiff.ts index f34e210af..2831944ee 100644 --- a/cli/default-reporter/src/reporterForClient/pkgsDiff.ts +++ b/cli/default-reporter/src/reporterForClient/pkgsDiff.ts @@ -58,16 +58,16 @@ export function getPkgsDiff ( const deprecationSet = args[1] as Set let action: '-' | '+' | undefined let log!: any // eslint-disable-line - if (rootLog['added']) { + if ('added' in rootLog) { action = '+' log = rootLog['added'] - } else if (rootLog['removed']) { + } else if ('removed' in rootLog) { action = '-' log = rootLog['removed'] } else { return pkgsDiff } - const depType = log.dependencyType || 'nodeModulesOnly' + const depType = (log.dependencyType || 'nodeModulesOnly') as keyof typeof pkgsDiff const oppositeKey = `${action === '-' ? '+' : '-'}${log.name as string}` const previous = pkgsDiff[depType][oppositeKey] if (previous && previous.version === log.version) { @@ -126,7 +126,7 @@ export function getPkgsDiff ( const initialPackageManifest = removeOptionalFromProdDeps(packageManifests['initial']) const updatedPackageManifest = removeOptionalFromProdDeps(packageManifests['updated']) - for (const depType of ['peer', 'prod', 'optional', 'dev']) { + for (const depType of ['peer', 'prod', 'optional', 'dev'] as const) { const prop = propertyByDependencyType[depType] const initialDeps = Object.keys(initialPackageManifest[prop] || {}) const updatedDeps = Object.keys(updatedPackageManifest[prop] || {}) diff --git a/cli/default-reporter/src/reporterForClient/reportSummary.ts b/cli/default-reporter/src/reporterForClient/reportSummary.ts index 1782d093c..4aaf5f596 100644 --- a/cli/default-reporter/src/reporterForClient/reportSummary.ts +++ b/cli/default-reporter/src/reporterForClient/reportSummary.ts @@ -52,8 +52,8 @@ export function reportSummary ( take(1), map(([pkgsDiff]) => { let msg = '' - for (const depType of ['prod', 'optional', 'peer', 'dev', 'nodeModulesOnly']) { - const diffs: PackageDiff[] = Object.values(pkgsDiff[depType]) + for (const depType of ['prod', 'optional', 'peer', 'dev', 'nodeModulesOnly'] as const) { + const diffs: PackageDiff[] = Object.values(pkgsDiff[depType as keyof typeof pkgsDiff]) if (diffs.length > 0) { msg += EOL if (opts.pnpmConfig?.global) { diff --git a/cli/default-reporter/test/reportingErrors.ts b/cli/default-reporter/test/reportingErrors.ts index 4e4783178..d38407413 100644 --- a/cli/default-reporter/test/reportingErrors.ts +++ b/cli/default-reporter/test/reportingErrors.ts @@ -181,9 +181,10 @@ test('prints test error', (done) => { }, }) - const err = new Error('Tests failed') - err['stage'] = 'test' - err['code'] = 'ELIFECYCLE' + const err = Object.assign(new Error('Tests failed'), { + code: 'ELIFECYCLE', + stage: 'test', + }) logger.error(err, err) }) diff --git a/cli/default-reporter/tsconfig.json b/cli/default-reporter/tsconfig.json index 7ff4b840a..5d5d82e8e 100644 --- a/cli/default-reporter/tsconfig.json +++ b/cli/default-reporter/tsconfig.json @@ -2,7 +2,8 @@ "extends": "@pnpm/tsconfig", "compilerOptions": { "outDir": "lib", - "rootDir": "src" + "rootDir": "src", + "suppressImplicitAnyIndexErrors": true }, "include": [ "src/**/*.ts", @@ -24,5 +25,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/cli/parse-cli-args/src/index.ts b/cli/parse-cli-args/src/index.ts index 22a0acbdf..93d09e0f2 100644 --- a/cli/parse-cli-args/src/index.ts +++ b/cli/parse-cli-args/src/index.ts @@ -187,7 +187,7 @@ const CUSTOM_OPTION_PREFIX = 'config.' function normalizeOptions (options: Record, knownOptions: Set) { const standardOptionNames = [] - const normalizedOptions = {} + const normalizedOptions: Record = {} for (const [optionName, optionValue] of Object.entries(options)) { if (optionName.startsWith(CUSTOM_OPTION_PREFIX)) { normalizedOptions[optionName.substring(CUSTOM_OPTION_PREFIX.length)] = optionValue diff --git a/cli/parse-cli-args/tsconfig.json b/cli/parse-cli-args/tsconfig.json index 0e4ad314c..61f7715d5 100644 --- a/cli/parse-cli-args/tsconfig.json +++ b/cli/parse-cli-args/tsconfig.json @@ -15,5 +15,6 @@ { "path": "../../workspace/find-workspace-dir" } - ] + ], + "composite": true } diff --git a/config/config/src/getScopeRegistries.ts b/config/config/src/getScopeRegistries.ts index 9cdbf1b77..fe41dcd10 100644 --- a/config/config/src/getScopeRegistries.ts +++ b/config/config/src/getScopeRegistries.ts @@ -1,10 +1,10 @@ import normalizeRegistryUrl from 'normalize-registry-url' -export function getScopeRegistries (rawConfig: Object) { - const registries = {} +export function getScopeRegistries (rawConfig: Record) { + const registries: Record = {} for (const configKey of Object.keys(rawConfig)) { if (configKey[0] === '@' && configKey.endsWith(':registry')) { - registries[configKey.slice(0, configKey.indexOf(':'))] = normalizeRegistryUrl(rawConfig[configKey]) + registries[configKey.slice(0, configKey.indexOf(':'))] = normalizeRegistryUrl(rawConfig[configKey] as unknown as string) } } return registries diff --git a/config/config/src/index.ts b/config/config/src/index.ts index 4a85cd22d..dcac6fe16 100644 --- a/config/config/src/index.ts +++ b/config/config/src/index.ts @@ -262,6 +262,7 @@ export async function getConfig ( const cwd = (cliOptions.dir && path.resolve(cliOptions.dir)) ?? npmConfig.localPrefix pnpmConfig.maxSockets = npmConfig.maxsockets + // @ts-expect-error delete pnpmConfig['maxsockets'] pnpmConfig.configDir = configDir @@ -286,11 +287,14 @@ export async function getConfig ( ...getScopeRegistries(pnpmConfig.rawConfig), } pnpmConfig.useLockfile = (() => { + // @ts-expect-error if (typeof pnpmConfig['lockfile'] === 'boolean') return pnpmConfig['lockfile'] + // @ts-expect-error if (typeof pnpmConfig['packageLock'] === 'boolean') return pnpmConfig['packageLock'] return false })() pnpmConfig.useGitBranchLockfile = (() => { + // @ts-expect-error if (typeof pnpmConfig['gitBranchLockfile'] === 'boolean') return pnpmConfig['gitBranchLockfile'] return false })() @@ -309,7 +313,9 @@ export async function getConfig ( if (cliOptions['global']) { let globalDirRoot + // @ts-expect-error if (pnpmConfig['globalDir']) { + // @ts-expect-error globalDirRoot = pnpmConfig['globalDir'] } else { globalDirRoot = path.join(pnpmConfig.pnpmHomeDir, 'global') @@ -427,6 +433,7 @@ export async function getConfig ( } } + // @ts-expect-error if (pnpmConfig['shamefullyFlatten']) { warnings.push('The "shamefully-flatten" setting has been renamed to "shamefully-hoist". Also, in most cases you won\'t need "shamefully-hoist". Since v4, a semistrict node_modules structure is on by default (via hoist-pattern=[*]).') pnpmConfig.shamefullyHoist = true @@ -437,6 +444,7 @@ export async function getConfig ( if (!pnpmConfig.stateDir) { pnpmConfig.stateDir = getStateDir(process) } + // @ts-expect-error if (pnpmConfig['hoist'] === false) { delete pnpmConfig.hoistPattern } @@ -486,6 +494,7 @@ export async function getConfig ( pnpmConfig.httpProxy = pnpmConfig.httpsProxy ?? getProcessEnv('http_proxy') ?? getProcessEnv('proxy') } if (!pnpmConfig.noProxy) { + // @ts-expect-error pnpmConfig.noProxy = pnpmConfig['noproxy'] ?? getProcessEnv('no_proxy') } switch (pnpmConfig.nodeLinker) { @@ -526,7 +535,7 @@ export async function getConfig ( pnpmConfig.hooks = requireHooks(pnpmConfig.lockfileDir ?? pnpmConfig.dir, pnpmConfig) } pnpmConfig.rootProjectManifest = await safeReadProjectManifestOnly(pnpmConfig.lockfileDir ?? pnpmConfig.workspaceDir ?? pnpmConfig.dir) ?? undefined - if (pnpmConfig.rootProjectManifest?.['workspaces']?.length && !pnpmConfig.workspaceDir) { + if (pnpmConfig.rootProjectManifest?.workspaces?.length && !pnpmConfig.workspaceDir) { warnings.push('The "workspaces" field in package.json is not supported by pnpm. Create a "pnpm-workspace.yaml" file instead.') } diff --git a/config/config/test/index.ts b/config/config/test/index.ts index a26967827..e5675ff1e 100644 --- a/config/config/test/index.ts +++ b/config/config/test/index.ts @@ -588,6 +588,7 @@ test('read only supported settings from config', async () => { }) expect(config.storeDir).toEqual('__store__') + // @ts-expect-error expect(config['foo']).toBeUndefined() expect(config.rawConfig['foo']).toEqual('bar') }) @@ -603,6 +604,7 @@ test('all CLI options are added to the config', async () => { }, }) + // @ts-expect-error expect(config['fooBar']).toEqual('qar') }) @@ -858,7 +860,7 @@ test('getConfig() sets merge-git-branch-lockfiles when branch matches merge-git- await fs.writeFile('.npmrc', npmrc, 'utf8') - getCurrentBranch['mockReturnValue']('develop') + ;(getCurrentBranch as jest.Mock).mockReturnValue('develop') const { config } = await getConfig({ cliOptions: { global: false, @@ -873,7 +875,7 @@ test('getConfig() sets merge-git-branch-lockfiles when branch matches merge-git- expect(config.mergeGitBranchLockfiles).toBe(false) } { - getCurrentBranch['mockReturnValue']('main') + (getCurrentBranch as jest.Mock).mockReturnValue('main') const { config } = await getConfig({ cliOptions: { global: false, @@ -886,7 +888,7 @@ test('getConfig() sets merge-git-branch-lockfiles when branch matches merge-git- expect(config.mergeGitBranchLockfiles).toBe(true) } { - getCurrentBranch['mockReturnValue']('release/1.0.0') + (getCurrentBranch as jest.Mock).mockReturnValue('release/1.0.0') const { config } = await getConfig({ cliOptions: { global: false, diff --git a/config/config/tsconfig.json b/config/config/tsconfig.json index 1c04274cf..0689a9097 100644 --- a/config/config/tsconfig.json +++ b/config/config/tsconfig.json @@ -36,5 +36,6 @@ { "path": "../matcher" } - ] + ], + "composite": true } diff --git a/config/matcher/tsconfig.json b/config/matcher/tsconfig.json index c6f0399f6..441d43d55 100644 --- a/config/matcher/tsconfig.json +++ b/config/matcher/tsconfig.json @@ -8,5 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/config/normalize-registries/tsconfig.json b/config/normalize-registries/tsconfig.json index d37dd6eef..7302e6eab 100644 --- a/config/normalize-registries/tsconfig.json +++ b/config/normalize-registries/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/config/package-is-installable/src/getSystemNodeVersion.ts b/config/package-is-installable/src/getSystemNodeVersion.ts index 1da8f2a5b..9a05e9f5f 100644 --- a/config/package-is-installable/src/getSystemNodeVersion.ts +++ b/config/package-is-installable/src/getSystemNodeVersion.ts @@ -2,6 +2,7 @@ import mem from 'mem' import * as execa from 'execa' export function getSystemNodeVersionNonCached () { + // @ts-expect-error if (process['pkg'] != null) { return execa.sync('node', ['--version']).stdout.toString() } diff --git a/config/package-is-installable/test/getSystemNodeVersion.test.ts b/config/package-is-installable/test/getSystemNodeVersion.test.ts index 72a8a061d..5a7c0e93d 100644 --- a/config/package-is-installable/test/getSystemNodeVersion.test.ts +++ b/config/package-is-installable/test/getSystemNodeVersion.test.ts @@ -8,12 +8,14 @@ jest.mock('execa', () => ({ })) test('getSystemNodeVersion() executed from an executable pnpm CLI', () => { + // @ts-expect-error process['pkg'] = {} expect(getSystemNodeVersionNonCached()).toBe('v10.0.0') expect(execa.sync).toHaveBeenCalledWith('node', ['--version']) }) test('getSystemNodeVersion() from a non-executable pnpm CLI', () => { + // @ts-expect-error delete process['pkg'] expect(getSystemNodeVersionNonCached()).toBe(process.version) }) diff --git a/config/package-is-installable/tsconfig.json b/config/package-is-installable/tsconfig.json index 3e087a40c..84b76ed17 100644 --- a/config/package-is-installable/tsconfig.json +++ b/config/package-is-installable/tsconfig.json @@ -18,5 +18,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/config/parse-overrides/tsconfig.json b/config/parse-overrides/tsconfig.json index 5872b8e95..a93ea4232 100644 --- a/config/parse-overrides/tsconfig.json +++ b/config/parse-overrides/tsconfig.json @@ -15,5 +15,6 @@ { "path": "../../packages/parse-wanted-dependency" } - ] + ], + "composite": true } diff --git a/config/pick-registry-for-package/tsconfig.json b/config/pick-registry-for-package/tsconfig.json index d37dd6eef..7302e6eab 100644 --- a/config/pick-registry-for-package/tsconfig.json +++ b/config/pick-registry-for-package/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/config/plugin-commands-config/src/configSet.ts b/config/plugin-commands-config/src/configSet.ts index 9451411be..c38ec1337 100644 --- a/config/plugin-commands-config/src/configSet.ts +++ b/config/plugin-commands-config/src/configSet.ts @@ -15,9 +15,9 @@ export async function configSet (opts: ConfigCommandOptions, key: string, value: await writeIniFile(configPath, settings) } -async function safeReadIniFile (configPath: string) { +async function safeReadIniFile (configPath: string): Promise> { try { - return await readIniFile(configPath) + return await readIniFile(configPath) as Record } catch (err: any) { // eslint-disable-line @typescript-eslint/no-explicit-any if (err.code === 'ENOENT') return {} throw err diff --git a/config/plugin-commands-config/tsconfig.json b/config/plugin-commands-config/tsconfig.json index 1da7d909e..dfb3722d8 100644 --- a/config/plugin-commands-config/tsconfig.json +++ b/config/plugin-commands-config/tsconfig.json @@ -21,5 +21,6 @@ { "path": "../config" } - ] + ], + "composite": true } diff --git a/env/node.fetcher/src/index.ts b/env/node.fetcher/src/index.ts index aa5e12b25..2d8a92825 100644 --- a/env/node.fetcher/src/index.ts +++ b/env/node.fetcher/src/index.ts @@ -42,7 +42,7 @@ export async function fetchNode (fetch: FetchFromRegistry, version: string, targ }) const cafs = createCafsStore(opts.cafsDir) const fetchTarball = pickFetcher(fetchers, { tarball }) - const { filesIndex } = await fetchTarball(cafs, { tarball }, { + const { filesIndex } = await fetchTarball(cafs, { tarball } as any, { // eslint-disable-line @typescript-eslint/no-explicit-any lockfileDir: process.cwd(), }) await cafs.importPackage(targetDir, { diff --git a/env/node.fetcher/test/node.test.ts b/env/node.fetcher/test/node.test.ts index 955dbf901..ab4705e4b 100644 --- a/env/node.fetcher/test/node.test.ts +++ b/env/node.fetcher/test/node.test.ts @@ -25,7 +25,7 @@ const fetchMock = jest.fn(async (url: string) => { }) beforeEach(() => { - isNonGlibcLinux['mockReturnValue'](Promise.resolve(false)) + (isNonGlibcLinux as jest.Mock).mockReturnValue(Promise.resolve(false)) fetchMock.mockClear() }) @@ -60,7 +60,7 @@ test('install Node using the default node mirror', async () => { }) test('install Node using a custom node mirror', async () => { - isNonGlibcLinux['mockReturnValue'](Promise.resolve(true)) + (isNonGlibcLinux as jest.Mock).mockReturnValue(Promise.resolve(true)) tempDir() const opts: FetchNodeOptions = { diff --git a/env/node.fetcher/tsconfig.json b/env/node.fetcher/tsconfig.json index d1490551a..7ab977ed0 100644 --- a/env/node.fetcher/tsconfig.json +++ b/env/node.fetcher/tsconfig.json @@ -33,5 +33,6 @@ { "path": "../../store/create-cafs-store" } - ] + ], + "composite": true } diff --git a/env/node.resolver/tsconfig.json b/env/node.resolver/tsconfig.json index 49cc36128..beb5b1fb5 100644 --- a/env/node.resolver/tsconfig.json +++ b/env/node.resolver/tsconfig.json @@ -18,5 +18,6 @@ { "path": "../node.fetcher" } - ] + ], + "composite": true } diff --git a/env/plugin-commands-env/tsconfig.json b/env/plugin-commands-env/tsconfig.json index 5a909aea9..17ed056c0 100644 --- a/env/plugin-commands-env/tsconfig.json +++ b/env/plugin-commands-env/tsconfig.json @@ -36,5 +36,6 @@ { "path": "../node.resolver" } - ] + ], + "composite": true } diff --git a/exec/build-modules/src/index.ts b/exec/build-modules/src/index.ts index 90954e2b5..d450c5373 100644 --- a/exec/build-modules/src/index.ts +++ b/exec/build-modules/src/index.ts @@ -47,9 +47,10 @@ export async function buildModules ( } // postinstall hooks - const buildDepOpts = { ...opts, warn } - if (opts.hoistedLocations) { - buildDepOpts['builtHoistedDeps'] = {} + const buildDepOpts = { + ...opts, + builtHoistedDeps: opts.hoistedLocations ? {} : undefined, + warn, } const chunks = buildSequence(depGraph, rootDepPaths) const groups = chunks.map((chunk) => { diff --git a/exec/build-modules/tsconfig.json b/exec/build-modules/tsconfig.json index 1295f003d..30ec8d3b1 100644 --- a/exec/build-modules/tsconfig.json +++ b/exec/build-modules/tsconfig.json @@ -36,5 +36,6 @@ { "path": "../lifecycle" } - ] + ], + "composite": true } diff --git a/exec/lifecycle/src/index.ts b/exec/lifecycle/src/index.ts index 434497c8e..8e07cebd8 100644 --- a/exec/lifecycle/src/index.ts +++ b/exec/lifecycle/src/index.ts @@ -3,6 +3,7 @@ import { safeReadPackageJsonFromDir } from '@pnpm/read-package-json' import exists from 'path-exists' import { runLifecycleHook, RunLifecycleHookOptions } from './runLifecycleHook' import { runLifecycleHooksConcurrently, RunLifecycleHooksConcurrentlyOptions } from './runLifecycleHooksConcurrently' +import { PackageScripts } from '@pnpm/types' export function makeNodeRequireOption (modulePath: string) { let { NODE_OPTIONS } = process.env @@ -51,9 +52,9 @@ export async function runPostinstallHooks ( */ async function checkBindingGyp ( root: string, - scripts: {} + scripts: PackageScripts ) { if (await exists(path.join(root, 'binding.gyp'))) { - scripts['install'] = 'node-gyp rebuild' + scripts.install = 'node-gyp rebuild' } } diff --git a/exec/lifecycle/tsconfig.json b/exec/lifecycle/tsconfig.json index cd15192e1..875171dfc 100644 --- a/exec/lifecycle/tsconfig.json +++ b/exec/lifecycle/tsconfig.json @@ -30,5 +30,6 @@ { "path": "../../store/store-controller-types" } - ] + ], + "composite": true } diff --git a/exec/plugin-commands-rebuild/src/implementation/extendRebuildOptions.ts b/exec/plugin-commands-rebuild/src/implementation/extendRebuildOptions.ts index acbf3154b..8781b385d 100644 --- a/exec/plugin-commands-rebuild/src/implementation/extendRebuildOptions.ts +++ b/exec/plugin-commands-rebuild/src/implementation/extendRebuildOptions.ts @@ -82,8 +82,8 @@ export async function extendRebuildOptions ( ): Promise { if (opts) { for (const key in opts) { - if (opts[key] === undefined) { - delete opts[key] + if (opts[key as keyof RebuildOptions] === undefined) { + delete opts[key as keyof RebuildOptions] } } } diff --git a/exec/plugin-commands-rebuild/tsconfig.json b/exec/plugin-commands-rebuild/tsconfig.json index fa291a77d..88ec4648a 100644 --- a/exec/plugin-commands-rebuild/tsconfig.json +++ b/exec/plugin-commands-rebuild/tsconfig.json @@ -81,5 +81,6 @@ { "path": "../lifecycle" } - ] + ], + "composite": true } diff --git a/exec/plugin-commands-script-runners/test/exec.e2e.ts b/exec/plugin-commands-script-runners/test/exec.e2e.ts index 526551e0c..5d4c2e152 100644 --- a/exec/plugin-commands-script-runners/test/exec.e2e.ts +++ b/exec/plugin-commands-script-runners/test/exec.e2e.ts @@ -436,7 +436,7 @@ test('pnpm exec on single project should return non-zero exit code when the proc selectedProjectsGraph: {}, }, ['node']) - expect(runResult['exitCode']).toBe(1) + expect(runResult).toHaveProperty(['exitCode'], 1) } }) diff --git a/exec/plugin-commands-script-runners/tsconfig.json b/exec/plugin-commands-script-runners/tsconfig.json index e75531119..68bf3b7f2 100644 --- a/exec/plugin-commands-script-runners/tsconfig.json +++ b/exec/plugin-commands-script-runners/tsconfig.json @@ -54,5 +54,6 @@ { "path": "../lifecycle" } - ] + ], + "composite": true } diff --git a/exec/prepare-package/tsconfig.json b/exec/prepare-package/tsconfig.json index ccc2d013c..3b4598c1a 100644 --- a/exec/prepare-package/tsconfig.json +++ b/exec/prepare-package/tsconfig.json @@ -24,5 +24,6 @@ { "path": "../lifecycle" } - ] + ], + "composite": true } diff --git a/exec/run-npm/tsconfig.json b/exec/run-npm/tsconfig.json index c6f0399f6..441d43d55 100644 --- a/exec/run-npm/tsconfig.json +++ b/exec/run-npm/tsconfig.json @@ -8,5 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/fetching/directory-fetcher/tsconfig.json b/fetching/directory-fetcher/tsconfig.json index c92a4056a..a95636e8c 100644 --- a/fetching/directory-fetcher/tsconfig.json +++ b/fetching/directory-fetcher/tsconfig.json @@ -21,5 +21,6 @@ { "path": "../fetcher-base" } - ] + ], + "composite": true } diff --git a/fetching/fetcher-base/tsconfig.json b/fetching/fetcher-base/tsconfig.json index 2d93b9bf1..aa68c0e17 100644 --- a/fetching/fetcher-base/tsconfig.json +++ b/fetching/fetcher-base/tsconfig.json @@ -18,5 +18,6 @@ { "path": "../../store/cafs-types" } - ] + ], + "composite": true } diff --git a/fetching/git-fetcher/tsconfig.json b/fetching/git-fetcher/tsconfig.json index f10b9513b..f80bc0239 100644 --- a/fetching/git-fetcher/tsconfig.json +++ b/fetching/git-fetcher/tsconfig.json @@ -24,5 +24,6 @@ { "path": "../fetcher-base" } - ] + ], + "composite": true } diff --git a/fetching/pick-fetcher/src/index.ts b/fetching/pick-fetcher/src/index.ts index 48acbd466..aea145996 100644 --- a/fetching/pick-fetcher/src/index.ts +++ b/fetching/pick-fetcher/src/index.ts @@ -14,7 +14,7 @@ export function pickFetcher (fetcherByHostingType: Partial, resolution } } - const fetch = fetcherByHostingType[fetcherType!] + const fetch = fetcherByHostingType[fetcherType! as keyof Fetchers] if (!fetch) { throw new Error(`Fetching for dependency type "${resolution.type ?? 'undefined'}" is not supported`) diff --git a/fetching/pick-fetcher/tsconfig.json b/fetching/pick-fetcher/tsconfig.json index 6ab0000b8..d98b6fd69 100644 --- a/fetching/pick-fetcher/tsconfig.json +++ b/fetching/pick-fetcher/tsconfig.json @@ -15,5 +15,6 @@ { "path": "../fetcher-base" } - ] + ], + "composite": true } diff --git a/fetching/tarball-fetcher/src/localTarballFetcher.ts b/fetching/tarball-fetcher/src/localTarballFetcher.ts index a997a3090..7a2ae42cc 100644 --- a/fetching/tarball-fetcher/src/localTarballFetcher.ts +++ b/fetching/tarball-fetcher/src/localTarballFetcher.ts @@ -57,6 +57,7 @@ async function fetchFromLocalTarball ( sri: err['sri'], url: tarball, }) + // @ts-expect-error error['resource'] = tarball throw error } diff --git a/fetching/tarball-fetcher/tsconfig.json b/fetching/tarball-fetcher/tsconfig.json index 2b72dc90b..8c58454e9 100644 --- a/fetching/tarball-fetcher/tsconfig.json +++ b/fetching/tarball-fetcher/tsconfig.json @@ -39,5 +39,6 @@ { "path": "../fetcher-base" } - ] + ], + "composite": true } diff --git a/fs/find-packages/tsconfig.json b/fs/find-packages/tsconfig.json index 5892f86ac..b05e10417 100644 --- a/fs/find-packages/tsconfig.json +++ b/fs/find-packages/tsconfig.json @@ -15,5 +15,6 @@ { "path": "../../pkg-manifest/read-project-manifest" } - ] + ], + "composite": true } diff --git a/fs/graceful-fs/tsconfig.json b/fs/graceful-fs/tsconfig.json index c6f0399f6..441d43d55 100644 --- a/fs/graceful-fs/tsconfig.json +++ b/fs/graceful-fs/tsconfig.json @@ -8,5 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/fs/hard-link-dir/tsconfig.json b/fs/hard-link-dir/tsconfig.json index af17a88f3..cd716028d 100644 --- a/fs/hard-link-dir/tsconfig.json +++ b/fs/hard-link-dir/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../__utils__/prepare" } - ] + ], + "composite": true } diff --git a/fs/indexed-pkg-importer/src/importIndexedDir.ts b/fs/indexed-pkg-importer/src/importIndexedDir.ts index 5b5994bfb..43587e784 100644 --- a/fs/indexed-pkg-importer/src/importIndexedDir.ts +++ b/fs/indexed-pkg-importer/src/importIndexedDir.ts @@ -99,12 +99,12 @@ async function tryImportIndexedDir (importFile: ImportFile, newDir: string, file function getUniqueFileMap (fileMap: Record) { const lowercaseFiles = new Map() - const conflictingFileNames = {} - const uniqueFileMap = {} + const conflictingFileNames: Record = {} + const uniqueFileMap: Record = {} for (const filename of Object.keys(fileMap).sort()) { const lowercaseFilename = filename.toLowerCase() if (lowercaseFiles.has(lowercaseFilename)) { - conflictingFileNames[filename] = lowercaseFiles.get(lowercaseFilename) + conflictingFileNames[filename] = lowercaseFiles.get(lowercaseFilename)! continue } lowercaseFiles.set(lowercaseFilename, filename) diff --git a/fs/indexed-pkg-importer/test/createImportPackage.test.ts b/fs/indexed-pkg-importer/test/createImportPackage.test.ts index b9222dc58..8e3683813 100644 --- a/fs/indexed-pkg-importer/test/createImportPackage.test.ts +++ b/fs/indexed-pkg-importer/test/createImportPackage.test.ts @@ -128,9 +128,7 @@ test('packageImportMethod=hardlink: fall back to copying if hardlinking fails', const importPackage = createIndexedPkgImporter('hardlink') fsMock.promises.link = jest.fn((src: string, dest: string) => { if (dest.endsWith('license')) { - const err = new Error('') - err['code'] = 'EEXIST' - throw err + throw Object.assign(new Error(''), { code: 'EEXIST' }) } throw new Error('This file system does not support hard linking') }) @@ -207,9 +205,7 @@ test('packageImportMethod=hardlink links packages when they are not found', asyn fsMock.promises.rename = jest.fn() fsMock.promises.stat = jest.fn((file) => { if (file === path.join('project/package', 'package.json')) { - const err = new Error() - err['code'] = 'ENOENT' - throw err + throw Object.assign(new Error(), { code: 'ENOENT' }) } return { ino: 0 } }) diff --git a/fs/indexed-pkg-importer/tsconfig.json b/fs/indexed-pkg-importer/tsconfig.json index ad8c8bd76..bc6ba6bff 100644 --- a/fs/indexed-pkg-importer/tsconfig.json +++ b/fs/indexed-pkg-importer/tsconfig.json @@ -18,5 +18,6 @@ { "path": "../../store/store-controller-types" } - ] + ], + "composite": true } diff --git a/fs/read-modules-dir/tsconfig.json b/fs/read-modules-dir/tsconfig.json index c6f0399f6..441d43d55 100644 --- a/fs/read-modules-dir/tsconfig.json +++ b/fs/read-modules-dir/tsconfig.json @@ -8,5 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/fs/symlink-dependency/tsconfig.json b/fs/symlink-dependency/tsconfig.json index ee6a9a23d..539da4fdf 100644 --- a/fs/symlink-dependency/tsconfig.json +++ b/fs/symlink-dependency/tsconfig.json @@ -18,5 +18,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/hooks/pnpmfile/src/requireHooks.ts b/hooks/pnpmfile/src/requireHooks.ts index 50c812f3a..e41403d75 100644 --- a/hooks/pnpmfile/src/requireHooks.ts +++ b/hooks/pnpmfile/src/requireHooks.ts @@ -60,16 +60,16 @@ export function requireHooks ( filterLog: [], readPackage: [], } - for (const hookName of ['readPackage', 'afterAllResolved']) { + for (const hookName of ['readPackage', 'afterAllResolved'] as const) { if (globalHooks[hookName]) { const globalHook = globalHooks[hookName] const context = createReadPackageHookContext(globalPnpmfile.filename, prefix, hookName) - cookedHooks[hookName].push((pkg: object) => globalHook(pkg, context)) + cookedHooks[hookName]!.push((pkg: object) => globalHook!(pkg as any, context)) // eslint-disable-line @typescript-eslint/no-explicit-any } if (hooks[hookName]) { const hook = hooks[hookName] const context = createReadPackageHookContext(pnpmFile.filename, prefix, hookName) - cookedHooks[hookName].push((pkg: object) => hook(pkg, context)) + cookedHooks[hookName]!.push((pkg: object) => hook!(pkg as any, context)) // eslint-disable-line @typescript-eslint/no-explicit-any } } if (globalHooks.filterLog != null) { diff --git a/hooks/pnpmfile/tsconfig.json b/hooks/pnpmfile/tsconfig.json index 4497b43b4..e92139335 100644 --- a/hooks/pnpmfile/tsconfig.json +++ b/hooks/pnpmfile/tsconfig.json @@ -30,5 +30,6 @@ { "path": "../../store/store-controller-types" } - ] + ], + "composite": true } diff --git a/hooks/read-package-hook/src/createPackageExtender.ts b/hooks/read-package-hook/src/createPackageExtender.ts index ca6b81f36..89f1fe098 100644 --- a/hooks/read-package-hook/src/createPackageExtender.ts +++ b/hooks/read-package-hook/src/createPackageExtender.ts @@ -32,12 +32,12 @@ function extendPkgHook (extensionsByPkgName: Record { @@ -9,8 +10,8 @@ test('createPeerDependencyPatcher() ignores missing', () => { foo: '*', bar: '*', }, - }) - expect(patchedPkg['peerDependenciesMeta']).toStrictEqual({ + }) as ProjectManifest + expect(patchedPkg.peerDependenciesMeta).toStrictEqual({ foo: { optional: true, }, @@ -26,8 +27,8 @@ test('createPeerDependencyPatcher() pattern matches to ignore missing', () => { foobar: '*', bar: '*', }, - }) - expect(patchedPkg['peerDependenciesMeta']).toStrictEqual({ + }) as ProjectManifest + expect(patchedPkg.peerDependenciesMeta).toStrictEqual({ foobar: { optional: true, }, @@ -49,8 +50,8 @@ test('createPeerDependencyPatcher() extends peer ranges', () => { qar: '*', baz: '1', }, - }) - expect(patchedPkg['peerDependencies']).toStrictEqual({ + }) as ProjectManifest + expect(patchedPkg.peerDependencies).toStrictEqual({ foo: '0 || 1', bar: '0', qar: '*', @@ -69,8 +70,8 @@ test('createPeerDependencyPatcher() ignores peer versions from allowAny', () => qar: '2', baz: '2', }, - }) - expect(patchedPkg['peerDependencies']).toStrictEqual({ + }) as ProjectManifest + expect(patchedPkg.peerDependencies).toStrictEqual({ foo: '*', bar: '*', qar: '2', @@ -102,8 +103,8 @@ test('createPeerDependencyPatcher() does not create duplicate extended ranges', // double apply the same patch to the same package // this can occur in a monorepo when several packages // all try to apply the same patch - const patchedAgainPkg = patcher(await patchedPkg) - expect(patchedAgainPkg['peerDependencies']).toStrictEqual({ + const patchedAgainPkg = patcher(await patchedPkg) as ProjectManifest + expect(patchedAgainPkg.peerDependencies).toStrictEqual({ // the patch is applied only once (not 0 || 1 || 1) foo: '0 || 1', same: '12', diff --git a/hooks/read-package-hook/tsconfig.json b/hooks/read-package-hook/tsconfig.json index 2ca4d0c8f..ce90ab69e 100644 --- a/hooks/read-package-hook/tsconfig.json +++ b/hooks/read-package-hook/tsconfig.json @@ -21,5 +21,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/lockfile/audit/src/lockfileToAuditTree.ts b/lockfile/audit/src/lockfileToAuditTree.ts index 74e603b5a..b435bacd8 100644 --- a/lockfile/audit/src/lockfileToAuditTree.ts +++ b/lockfile/audit/src/lockfileToAuditTree.ts @@ -1,5 +1,5 @@ import path from 'path' -import { Lockfile } from '@pnpm/lockfile-types' +import { Lockfile, TarballResolution } from '@pnpm/lockfile-types' import { nameVerFromPkgSnapshot } from '@pnpm/lockfile-utils' import { lockfileWalkerGroupImporterSteps, LockfileWalkerStep } from '@pnpm/lockfile-walker' import { DependenciesField } from '@pnpm/types' @@ -29,7 +29,7 @@ export async function lockfileToAuditTree ( } ): Promise { const importerWalkers = lockfileWalkerGroupImporterSteps(lockfile, Object.keys(lockfile.importers), { include: opts?.include }) - const dependencies = {} + const dependencies: Record = {} await Promise.all( importerWalkers.map(async (importerWalker) => { const importerDeps = lockfileToAuditNode(importerWalker.step) @@ -39,6 +39,7 @@ export async function lockfileToAuditTree ( const { manifest } = await readProjectManifest(path.join(opts.lockfileDir, importerWalker.importerId)) dependencies[depName] = { dependencies: importerDeps, + dev: false, requires: toRequires(importerDeps), version: manifest.version ?? '0.0.0', } @@ -59,14 +60,14 @@ export async function lockfileToAuditTree ( return auditTree } -function lockfileToAuditNode (step: LockfileWalkerStep) { - const dependencies = {} +function lockfileToAuditNode (step: LockfileWalkerStep): Record { + const dependencies: Record = {} for (const { depPath, pkgSnapshot, next } of step.dependencies) { const { name, version } = nameVerFromPkgSnapshot(depPath, pkgSnapshot) const subdeps = lockfileToAuditNode(next()) const dep: AuditNode = { dev: pkgSnapshot.dev === true, - integrity: pkgSnapshot.resolution['integrity'], + integrity: (pkgSnapshot.resolution as TarballResolution).integrity, version, } if (Object.keys(subdeps).length > 0) { diff --git a/lockfile/audit/test/index.ts b/lockfile/audit/test/index.ts index 5dffb0893..11ffe1eaa 100644 --- a/lockfile/audit/test/index.ts +++ b/lockfile/audit/test/index.ts @@ -59,6 +59,7 @@ describe('audit', () => { version: '1.0.0', }, }, + dev: false, requires: { foo: '1.0.0', }, @@ -125,6 +126,7 @@ describe('audit', () => { version: '1.0.0', }, }, + dev: false, requires: { foo: '1.0.0', }, diff --git a/lockfile/audit/tsconfig.json b/lockfile/audit/tsconfig.json index 68d01fab5..044657a17 100644 --- a/lockfile/audit/tsconfig.json +++ b/lockfile/audit/tsconfig.json @@ -45,5 +45,6 @@ { "path": "../lockfile-walker" } - ] + ], + "composite": true } diff --git a/lockfile/filter-lockfile/tsconfig.json b/lockfile/filter-lockfile/tsconfig.json index 47b7e27d7..5e31ead3b 100644 --- a/lockfile/filter-lockfile/tsconfig.json +++ b/lockfile/filter-lockfile/tsconfig.json @@ -33,5 +33,6 @@ { "path": "../lockfile-walker" } - ] + ], + "composite": true } diff --git a/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts b/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts index d46381893..030f211ca 100644 --- a/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts +++ b/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts @@ -239,7 +239,7 @@ function revertProjectSnapshot (from: InlineSpecifiersProjectSnapshot): ProjectS } function mapValues (obj: Record, mapper: (val: T, key: string) => U): Record { - const result = {} + const result: Record = {} for (const [key, value] of Object.entries(obj)) { result[key] = mapper(value, key) } diff --git a/lockfile/lockfile-file/src/read.ts b/lockfile/lockfile-file/src/read.ts index 0f1b503ed..b604cc514 100644 --- a/lockfile/lockfile-file/src/read.ts +++ b/lockfile/lockfile-file/src/read.ts @@ -145,7 +145,7 @@ export function createLockfileObject ( specifiers: {}, } return acc - }, {}) + }, {} as Lockfile['importers']) return { importers, lockfileVersion: opts.lockfileVersion || LOCKFILE_VERSION, diff --git a/lockfile/lockfile-file/src/sortLockfileKeys.ts b/lockfile/lockfile-file/src/sortLockfileKeys.ts index b148fbc9d..06fadb4a6 100644 --- a/lockfile/lockfile-file/src/sortLockfileKeys.ts +++ b/lockfile/lockfile-file/src/sortLockfileKeys.ts @@ -77,9 +77,9 @@ export function sortLockfileKeys (lockfile: LockfileFile) { }) } } - for (const key of ['specifiers', 'dependencies', 'devDependencies', 'optionalDependencies', 'time']) { + for (const key of ['specifiers', 'dependencies', 'devDependencies', 'optionalDependencies', 'time'] as const) { if (!lockfile[key]) continue - lockfile[key] = sortKeys(lockfile[key]) + lockfile[key] = sortKeys(lockfile[key]!) } return sortKeys(lockfile, { compare: compareRootKeys }) } diff --git a/lockfile/lockfile-file/src/write.ts b/lockfile/lockfile-file/src/write.ts index 81cb9c541..afc5fd124 100644 --- a/lockfile/lockfile-file/src/write.ts +++ b/lockfile/lockfile-file/src/write.ts @@ -177,9 +177,8 @@ function pruneTimeInLockfileV6 (time: Record, importers: Record< for (const importer of Object.values(importers)) { for (const depType of DEPENDENCIES_FIELDS) { for (let [depName, ref] of Object.entries(importer[depType] ?? {})) { - if (ref['version']) { - ref = ref['version'] - } + // @ts-expect-error + if (ref['version']) ref = ref['version'] const suffixStart = ref.indexOf('(') const refWithoutPeerSuffix = suffixStart === -1 ? ref : ref.slice(0, suffixStart) const depPath = refToRelative(refWithoutPeerSuffix, depName) @@ -212,9 +211,8 @@ function pruneTime (time: Record, importers: Record ({ getCurrentBranch: jest.fn() })) describe('lockfileName', () => { afterEach(() => { - getCurrentBranch['mockReset']() + (getCurrentBranch as jest.Mock).mockReset() }) test('returns default lockfile name if useGitBranchLockfile is off', async () => { @@ -14,17 +14,17 @@ describe('lockfileName', () => { }) test('returns git branch lockfile name', async () => { - getCurrentBranch['mockReturnValue']('main') + (getCurrentBranch as jest.Mock).mockReturnValue('main') await expect(getWantedLockfileName({ useGitBranchLockfile: true })).resolves.toBe('pnpm-lock.main.yaml') }) test('returns git branch lockfile name when git branch contains clashes', async () => { - getCurrentBranch['mockReturnValue']('a/b/c') + (getCurrentBranch as jest.Mock).mockReturnValue('a/b/c') await expect(getWantedLockfileName({ useGitBranchLockfile: true })).resolves.toBe('pnpm-lock.a!b!c.yaml') }) test('returns git branch lockfile name when git branch contains uppercase', async () => { - getCurrentBranch['mockReturnValue']('aBc') + (getCurrentBranch as jest.Mock).mockReturnValue('aBc') await expect(getWantedLockfileName({ useGitBranchLockfile: true })).resolves.toBe('pnpm-lock.abc.yaml') }) }) diff --git a/lockfile/lockfile-file/test/read.test.ts b/lockfile/lockfile-file/test/read.test.ts index 66c5fdcc9..109ae9d9d 100644 --- a/lockfile/lockfile-file/test/read.test.ts +++ b/lockfile/lockfile-file/test/read.test.ts @@ -196,7 +196,7 @@ test('existsWantedLockfile()', async () => { }) test('readWantedLockfile() when useGitBranchLockfile', async () => { - getCurrentBranch['mockReturnValue']('branch') + (getCurrentBranch as jest.Mock).mockReturnValue('branch') const lockfile = await readWantedLockfile(path.join('fixtures', '6'), { ignoreIncompatible: false, }) @@ -236,7 +236,7 @@ test('readWantedLockfile() when useGitBranchLockfile', async () => { }) test('readWantedLockfile() when useGitBranchLockfile and mergeGitBranchLockfiles', async () => { - getCurrentBranch['mockReturnValue']('branch') + (getCurrentBranch as jest.Mock).mockReturnValue('branch') const lockfile = await readWantedLockfile(path.join('fixtures', '6'), { ignoreIncompatible: false, useGitBranchLockfile: true, diff --git a/lockfile/lockfile-file/test/write.test.ts b/lockfile/lockfile-file/test/write.test.ts index 63fd0474d..256acae91 100644 --- a/lockfile/lockfile-file/test/write.test.ts +++ b/lockfile/lockfile-file/test/write.test.ts @@ -198,7 +198,7 @@ test('writeLockfiles() does not fail if the lockfile has undefined properties', test('writeLockfiles() when useGitBranchLockfile', async () => { const branchName: string = 'branch' - getCurrentBranch['mockReturnValue'](branchName) + ;(getCurrentBranch as jest.Mock).mockReturnValue(branchName) const projectPath = tempy.directory() const wantedLockfile = { importers: { diff --git a/lockfile/lockfile-file/tsconfig.json b/lockfile/lockfile-file/tsconfig.json index 1c2737064..b4f03691a 100644 --- a/lockfile/lockfile-file/tsconfig.json +++ b/lockfile/lockfile-file/tsconfig.json @@ -30,5 +30,6 @@ { "path": "../merge-lockfile-changes" } - ] + ], + "composite": true } diff --git a/lockfile/lockfile-to-pnp/tsconfig.json b/lockfile/lockfile-to-pnp/tsconfig.json index 7571eae99..49ee4875d 100644 --- a/lockfile/lockfile-to-pnp/tsconfig.json +++ b/lockfile/lockfile-to-pnp/tsconfig.json @@ -21,5 +21,6 @@ { "path": "../lockfile-utils" } - ] + ], + "composite": true } diff --git a/lockfile/lockfile-types/src/index.ts b/lockfile/lockfile-types/src/index.ts index 0d550bd73..558bf5ce3 100644 --- a/lockfile/lockfile-types/src/index.ts +++ b/lockfile/lockfile-types/src/index.ts @@ -91,7 +91,7 @@ export interface PackageSnapshot { } transitivePeerDependencies?: string[] bundledDependencies?: string[] - engines?: { + engines?: Record & { node: string } os?: string[] diff --git a/lockfile/lockfile-types/tsconfig.json b/lockfile/lockfile-types/tsconfig.json index d37dd6eef..56f4a1238 100644 --- a/lockfile/lockfile-types/tsconfig.json +++ b/lockfile/lockfile-types/tsconfig.json @@ -1,5 +1,6 @@ { "extends": "@pnpm/tsconfig", + "composite": true, "compilerOptions": { "outDir": "lib", "rootDir": "src" diff --git a/lockfile/lockfile-utils/src/extendProjectsWithTargetDirs.ts b/lockfile/lockfile-utils/src/extendProjectsWithTargetDirs.ts index 654e6364e..90662a5af 100644 --- a/lockfile/lockfile-utils/src/extendProjectsWithTargetDirs.ts +++ b/lockfile/lockfile-utils/src/extendProjectsWithTargetDirs.ts @@ -1,5 +1,5 @@ import path from 'path' -import { Lockfile } from '@pnpm/lockfile-types' +import { Lockfile, TarballResolution } from '@pnpm/lockfile-types' import { depPathToFilename } from '@pnpm/dependency-path' type GetLocalLocations = (depPath: string, pkgName: string) => string[] @@ -19,7 +19,7 @@ export function extendProjectsWithTargetDirs ( Object.fromEntries(projects.map((project) => [project.id, { ...project, targetDirs: [] as string[] }])) Object.entries(lockfile.packages ?? {}) .forEach(([depPath, pkg]) => { - if (pkg.resolution?.['type'] !== 'directory') return + if ((pkg.resolution as TarballResolution)?.type !== 'directory') return const pkgId = pkg.id ?? depPath const importerId = pkgId.replace(/^file:/, '') if (projectsById[importerId] == null) return diff --git a/lockfile/lockfile-utils/src/pkgSnapshotToResolution.ts b/lockfile/lockfile-utils/src/pkgSnapshotToResolution.ts index 625207267..0e39c0ac2 100644 --- a/lockfile/lockfile-utils/src/pkgSnapshotToResolution.ts +++ b/lockfile/lockfile-utils/src/pkgSnapshotToResolution.ts @@ -1,5 +1,5 @@ import url from 'url' -import { PackageSnapshot } from '@pnpm/lockfile-types' +import { PackageSnapshot, TarballResolution } from '@pnpm/lockfile-types' import { Resolution } from '@pnpm/resolver-base' import { Registries } from '@pnpm/types' import * as dp from '@pnpm/dependency-path' @@ -11,18 +11,21 @@ export function pkgSnapshotToResolution ( pkgSnapshot: PackageSnapshot, registries: Registries ): Resolution { - if (pkgSnapshot.resolution['type'] || pkgSnapshot.resolution['tarball']?.startsWith('file:')) { + if ( + Boolean((pkgSnapshot.resolution as TarballResolution).type) || + (pkgSnapshot.resolution as TarballResolution).tarball?.startsWith('file:') + ) { return pkgSnapshot.resolution as Resolution } const { name } = nameVerFromPkgSnapshot(depPath, pkgSnapshot) - const registry: string = pkgSnapshot.resolution['registry'] || + const registry: string = (pkgSnapshot.resolution as TarballResolution).registry || // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing (name[0] === '@' && registries[name.split('/')[0]]) || registries.default let tarball!: string - if (!pkgSnapshot.resolution['tarball']) { + if (!(pkgSnapshot.resolution as TarballResolution).tarball) { tarball = getTarball(registry) } else { - tarball = new url.URL(pkgSnapshot.resolution['tarball'], + tarball = new url.URL((pkgSnapshot.resolution as TarballResolution).tarball, registry.endsWith('/') ? registry : `${registry}/` ).toString() } diff --git a/lockfile/lockfile-utils/tsconfig.json b/lockfile/lockfile-utils/tsconfig.json index 24f82f89d..74c1cb4f0 100644 --- a/lockfile/lockfile-utils/tsconfig.json +++ b/lockfile/lockfile-utils/tsconfig.json @@ -21,5 +21,6 @@ { "path": "../lockfile-types" } - ] + ], + "composite": true } diff --git a/lockfile/lockfile-walker/tsconfig.json b/lockfile/lockfile-walker/tsconfig.json index 6b302513f..094bb740c 100644 --- a/lockfile/lockfile-walker/tsconfig.json +++ b/lockfile/lockfile-walker/tsconfig.json @@ -18,5 +18,6 @@ { "path": "../lockfile-types" } - ] + ], + "composite": true } diff --git a/lockfile/merge-lockfile-changes/src/index.ts b/lockfile/merge-lockfile-changes/src/index.ts index e0fcd6236..24f986dc4 100644 --- a/lockfile/merge-lockfile-changes/src/index.ts +++ b/lockfile/merge-lockfile-changes/src/index.ts @@ -1,4 +1,4 @@ -import { Lockfile } from '@pnpm/lockfile-types' +import { Lockfile, PackageSnapshot, PackageSnapshots } from '@pnpm/lockfile-types' import comverToSemver from 'comver-to-semver' import semver from 'semver' @@ -14,13 +14,13 @@ export function mergeLockfileChanges (ours: Lockfile, theirs: Lockfile) { newLockfile.importers[importerId] = { specifiers: {}, } - for (const key of ['dependencies', 'devDependencies', 'optionalDependencies']) { + for (const key of ['dependencies', 'devDependencies', 'optionalDependencies'] as const) { newLockfile.importers[importerId][key] = mergeDict( ours.importers[importerId]?.[key] ?? {}, theirs.importers[importerId]?.[key] ?? {}, mergeVersions ) - if (Object.keys(newLockfile.importers[importerId][key]).length === 0) { + if (Object.keys(newLockfile.importers[importerId][key] ?? {}).length === 0) { delete newLockfile.importers[importerId][key] } } @@ -31,7 +31,7 @@ export function mergeLockfileChanges (ours: Lockfile, theirs: Lockfile) { ) } - const packages = {} + const packages: PackageSnapshots = {} for (const depPath of Array.from(new Set([...Object.keys(ours.packages ?? {}), ...Object.keys(theirs.packages ?? {})]))) { const ourPkg = ours.packages?.[depPath] const theirPkg = theirs.packages?.[depPath] @@ -39,17 +39,17 @@ export function mergeLockfileChanges (ours: Lockfile, theirs: Lockfile) { ...ourPkg, ...theirPkg, } - for (const key of ['dependencies', 'optionalDependencies']) { + for (const key of ['dependencies', 'optionalDependencies'] as const) { pkg[key] = mergeDict( ourPkg?.[key] ?? {}, theirPkg?.[key] ?? {}, mergeVersions ) - if (Object.keys(pkg[key]).length === 0) { + if (Object.keys(pkg[key] ?? {}).length === 0) { delete pkg[key] } } - packages[depPath] = pkg + packages[depPath] = pkg as PackageSnapshot } newLockfile.packages = packages @@ -63,7 +63,7 @@ function mergeDict ( theirDict: Record, valueMerger: ValueMerger ) { - const newDict = {} + const newDict: Record = {} for (const key of Object.keys(ourDict).concat(Object.keys(theirDict))) { const changedValue = valueMerger( ourDict[key], diff --git a/lockfile/merge-lockfile-changes/tsconfig.json b/lockfile/merge-lockfile-changes/tsconfig.json index 114148dcb..538ec286b 100644 --- a/lockfile/merge-lockfile-changes/tsconfig.json +++ b/lockfile/merge-lockfile-changes/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../lockfile-types" } - ] + ], + "composite": true } diff --git a/lockfile/plugin-commands-audit/tsconfig.json b/lockfile/plugin-commands-audit/tsconfig.json index eec3ab864..c620912d2 100644 --- a/lockfile/plugin-commands-audit/tsconfig.json +++ b/lockfile/plugin-commands-audit/tsconfig.json @@ -2,7 +2,8 @@ "extends": "@pnpm/tsconfig", "compilerOptions": { "outDir": "lib", - "rootDir": "src" + "rootDir": "src", + "suppressImplicitAnyIndexErrors": true }, "include": [ "src/**/*.ts", @@ -42,5 +43,6 @@ { "path": "../lockfile-file" } - ] + ], + "composite": true } diff --git a/lockfile/prune-lockfile/src/index.ts b/lockfile/prune-lockfile/src/index.ts index 8d4eebee6..0d237b953 100644 --- a/lockfile/prune-lockfile/src/index.ts +++ b/lockfile/prune-lockfile/src/index.ts @@ -52,18 +52,18 @@ export function pruneLockfile ( const optionalDependencies = Object.keys(pkg.optionalDependencies ?? {}) const dependencies = difference(Object.keys(pkg.dependencies ?? {}), optionalDependencies) const devDependencies = difference(difference(Object.keys(pkg.devDependencies ?? {}), optionalDependencies), dependencies) - const allDeps = [ + const allDeps = new Set([ ...optionalDependencies, ...devDependencies, ...dependencies, - ] + ]) const specifiers: ResolvedDependencies = {} const lockfileDependencies: ResolvedDependencies = {} const lockfileOptionalDependencies: ResolvedDependencies = {} const lockfileDevDependencies: ResolvedDependencies = {} Object.entries(lockfileSpecs).forEach(([depName, spec]) => { - if (!allDeps.includes(depName)) return + if (!allDeps.has(depName)) return specifiers[depName] = spec if (importer.dependencies?.[depName]) { lockfileDependencies[depName] = importer.dependencies[depName] @@ -79,7 +79,7 @@ export function pruneLockfile ( !lockfileDependencies[alias] && dep.startsWith('link:') && // If the linked dependency was removed from package.json // then it is removed from pnpm-lock.yaml as well - !(lockfileSpecs[alias] && !allDeps[alias]) + !(lockfileSpecs[alias] && !allDeps.has(alias)) ) { lockfileDependencies[alias] = dep } diff --git a/lockfile/prune-lockfile/tsconfig.json b/lockfile/prune-lockfile/tsconfig.json index 68cac1263..cc5db9d65 100644 --- a/lockfile/prune-lockfile/tsconfig.json +++ b/lockfile/prune-lockfile/tsconfig.json @@ -21,5 +21,6 @@ { "path": "../lockfile-types" } - ] + ], + "composite": true } diff --git a/network/auth-header/src/getAuthHeadersFromConfig.ts b/network/auth-header/src/getAuthHeadersFromConfig.ts index ec2c7fddb..64a5871bd 100644 --- a/network/auth-header/src/getAuthHeadersFromConfig.ts +++ b/network/auth-header/src/getAuthHeadersFromConfig.ts @@ -10,7 +10,7 @@ export function getAuthHeadersFromConfig ( userSettings: Record } ) { - const authHeaderValueByURI = {} + const authHeaderValueByURI: Record = {} for (const [key, value] of Object.entries(allSettings)) { const [uri, authType] = splitKey(key) switch (authType) { diff --git a/network/auth-header/tsconfig.json b/network/auth-header/tsconfig.json index 019cba19e..e16204313 100644 --- a/network/auth-header/tsconfig.json +++ b/network/auth-header/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../packages/error" } - ] + ], + "composite": true } diff --git a/network/fetch/src/fetchFromRegistry.ts b/network/fetch/src/fetchFromRegistry.ts index 57ab2c6d3..e59c9b60f 100644 --- a/network/fetch/src/fetchFromRegistry.ts +++ b/network/fetch/src/fetchFromRegistry.ts @@ -19,6 +19,7 @@ export function fetchWithAgent (url: RequestInfo, opts: FetchWithAgentOptions) { strictSsl: opts.agentOptions.strictSsl ?? true, } as any) as any // eslint-disable-line const headers = opts.headers ?? {} + // @ts-expect-error headers['connection'] = agent ? 'keep-alive' : 'close' return fetch(url, { ...opts, diff --git a/network/fetch/tsconfig.json b/network/fetch/tsconfig.json index f7b2fd19f..91494baa7 100644 --- a/network/fetch/tsconfig.json +++ b/network/fetch/tsconfig.json @@ -15,5 +15,6 @@ { "path": "../fetching-types" } - ] + ], + "composite": true } diff --git a/network/fetching-types/tsconfig.json b/network/fetching-types/tsconfig.json index c6f0399f6..441d43d55 100644 --- a/network/fetching-types/tsconfig.json +++ b/network/fetching-types/tsconfig.json @@ -8,5 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/package.json b/package.json index b6fa5790a..336ed48a4 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "@types/node": "^14.18.36", "c8": "^7.12.0", "cross-env": "^7.0.3", - "eslint": "^8.31.0", + "eslint": "^8.32.0", "husky": "^8.0.3", "jest": "^29.3.1", "keyv": "4.5.2", diff --git a/packages/calc-dep-state/tsconfig.json b/packages/calc-dep-state/tsconfig.json index f5069582b..198571354 100644 --- a/packages/calc-dep-state/tsconfig.json +++ b/packages/calc-dep-state/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../constants" } - ] + ], + "composite": true } diff --git a/packages/constants/tsconfig.json b/packages/constants/tsconfig.json index c6f0399f6..51580dbed 100644 --- a/packages/constants/tsconfig.json +++ b/packages/constants/tsconfig.json @@ -1,5 +1,6 @@ { "extends": "@pnpm/tsconfig", + "composite": true, "compilerOptions": { "outDir": "lib", "rootDir": "src" diff --git a/packages/core-loggers/tsconfig.json b/packages/core-loggers/tsconfig.json index 64c25a32e..d32e34a5c 100644 --- a/packages/core-loggers/tsconfig.json +++ b/packages/core-loggers/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../types" } - ] + ], + "composite": true } diff --git a/packages/crypto.base32-hash/tsconfig.json b/packages/crypto.base32-hash/tsconfig.json index af17a88f3..cd716028d 100644 --- a/packages/crypto.base32-hash/tsconfig.json +++ b/packages/crypto.base32-hash/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../__utils__/prepare" } - ] + ], + "composite": true } diff --git a/packages/dependency-path/tsconfig.json b/packages/dependency-path/tsconfig.json index 6e13e37d3..854d55d9a 100644 --- a/packages/dependency-path/tsconfig.json +++ b/packages/dependency-path/tsconfig.json @@ -15,5 +15,6 @@ { "path": "../types" } - ] + ], + "composite": true } diff --git a/packages/error/tsconfig.json b/packages/error/tsconfig.json index f5069582b..198571354 100644 --- a/packages/error/tsconfig.json +++ b/packages/error/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../constants" } - ] + ], + "composite": true } diff --git a/packages/git-utils/tsconfig.json b/packages/git-utils/tsconfig.json index 6c62e9dd3..441d43d55 100644 --- a/packages/git-utils/tsconfig.json +++ b/packages/git-utils/tsconfig.json @@ -8,6 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [ - ] + "references": [], + "composite": true } diff --git a/packages/make-dedicated-lockfile/tsconfig.json b/packages/make-dedicated-lockfile/tsconfig.json index 8113a6a5d..12e09034f 100644 --- a/packages/make-dedicated-lockfile/tsconfig.json +++ b/packages/make-dedicated-lockfile/tsconfig.json @@ -33,5 +33,6 @@ { "path": "../types" } - ] + ], + "composite": true } diff --git a/packages/mount-modules/src/createFuseHandlers.ts b/packages/mount-modules/src/createFuseHandlers.ts index d1f1ec2c5..65255d68b 100644 --- a/packages/mount-modules/src/createFuseHandlers.ts +++ b/packages/mount-modules/src/createFuseHandlers.ts @@ -1,6 +1,6 @@ import fs from 'fs' import { getFilePathInCafs, getFilePathByModeInCafs, PackageFilesIndex } from '@pnpm/cafs' -import { Lockfile, readWantedLockfile, PackageSnapshot } from '@pnpm/lockfile-file' +import { Lockfile, readWantedLockfile, PackageSnapshot, TarballResolution } from '@pnpm/lockfile-file' import { nameVerFromPkgSnapshot, } from '@pnpm/lockfile-utils' @@ -169,7 +169,7 @@ export function createFuseHandlersFromLockfile (lockfile: Lockfile, cafsDir: str if (!pkgSnapshotCache.has(depPath)) { const pkgSnapshot = lockfile.packages?.[depPath] if (pkgSnapshot == null) return undefined - const indexPath = getFilePathInCafs(cafsDir, pkgSnapshot.resolution['integrity'], 'index') + const indexPath = getFilePathInCafs(cafsDir, (pkgSnapshot.resolution as TarballResolution).integrity!, 'index') pkgSnapshotCache.set(depPath, { ...nameVerFromPkgSnapshot(depPath, pkgSnapshot), pkgSnapshot, diff --git a/packages/mount-modules/src/makeVirtualNodeModules.ts b/packages/mount-modules/src/makeVirtualNodeModules.ts index 5d238f743..ed2055f9c 100644 --- a/packages/mount-modules/src/makeVirtualNodeModules.ts +++ b/packages/mount-modules/src/makeVirtualNodeModules.ts @@ -5,16 +5,18 @@ import { nameVerFromPkgSnapshot } from '@pnpm/lockfile-utils' import * as dp from '@pnpm/dependency-path' import normalize from 'normalize-path' +interface DirDirEntry { + entryType: 'directory' + entries: Record +} + type DirEntry = { entryType: 'index' depPath: string } | { entryType: 'symlink' target: string -} | { - entryType: 'directory' - entries: Record -} +} | DirDirEntry export function makeVirtualNodeModules (lockfile: Lockfile): DirEntry { const entries: Record = { @@ -81,7 +83,7 @@ function addDirEntry (target: Record, subPath: string[] | stri } else if (target[p].entryType !== 'directory') { throw new Error() } - addDirEntry(target[p]['entries'], subPathArray, newEntry) + addDirEntry((target[p] as DirDirEntry).entries, subPathArray, newEntry) } else { target[p] = newEntry } diff --git a/packages/mount-modules/tsconfig.json b/packages/mount-modules/tsconfig.json index b0d9f8e9f..5f811b5fb 100644 --- a/packages/mount-modules/tsconfig.json +++ b/packages/mount-modules/tsconfig.json @@ -30,5 +30,6 @@ { "path": "../types" } - ] + ], + "composite": true } diff --git a/packages/parse-wanted-dependency/tsconfig.json b/packages/parse-wanted-dependency/tsconfig.json index c6f0399f6..441d43d55 100644 --- a/packages/parse-wanted-dependency/tsconfig.json +++ b/packages/parse-wanted-dependency/tsconfig.json @@ -8,5 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/packages/plugin-commands-doctor/tsconfig.json b/packages/plugin-commands-doctor/tsconfig.json index a7ad6d2a5..e3f7eae93 100644 --- a/packages/plugin-commands-doctor/tsconfig.json +++ b/packages/plugin-commands-doctor/tsconfig.json @@ -15,5 +15,6 @@ { "path": "../../config/config" } - ] + ], + "composite": true } diff --git a/packages/plugin-commands-init/tsconfig.json b/packages/plugin-commands-init/tsconfig.json index e15badd15..f71707b10 100644 --- a/packages/plugin-commands-init/tsconfig.json +++ b/packages/plugin-commands-init/tsconfig.json @@ -27,5 +27,6 @@ { "path": "../error" } - ] + ], + "composite": true } diff --git a/packages/plugin-commands-setup/src/setup.ts b/packages/plugin-commands-setup/src/setup.ts index e8b16a268..5eae681c5 100644 --- a/packages/plugin-commands-setup/src/setup.ts +++ b/packages/plugin-commands-setup/src/setup.ts @@ -41,6 +41,7 @@ export function help () { } function getExecPath () { + // @ts-expect-error if (process['pkg'] != null) { // If the pnpm CLI was bundled by vercel/pkg then we cannot use the js path for npm_execpath // because in that case the js is in a virtual filesystem inside the executor. diff --git a/packages/plugin-commands-setup/test/setup.test.ts b/packages/plugin-commands-setup/test/setup.test.ts index df5823156..18d6b01ca 100644 --- a/packages/plugin-commands-setup/test/setup.test.ts +++ b/packages/plugin-commands-setup/test/setup.test.ts @@ -9,7 +9,7 @@ jest.mock('@pnpm/os.env.path-extender', () => ({ jest.mock('fs') test('setup makes no changes', async () => { - addDirToEnvPath['mockReturnValue'](Promise.resolve({ + (addDirToEnvPath as jest.Mock).mockReturnValue(Promise.resolve({ oldSettings: 'PNPM_HOME=dir', newSettings: 'PNPM_HOME=dir', })) @@ -18,7 +18,7 @@ test('setup makes no changes', async () => { }) test('setup makes changes on POSIX', async () => { - addDirToEnvPath['mockReturnValue'](Promise.resolve({ + (addDirToEnvPath as jest.Mock).mockReturnValue(Promise.resolve({ configFile: { changeType: 'created', path: '~/.bashrc', @@ -38,7 +38,7 @@ source ~/.bashrc }) test('setup makes changes on Windows', async () => { - addDirToEnvPath['mockReturnValue'](Promise.resolve({ + (addDirToEnvPath as jest.Mock).mockReturnValue(Promise.resolve({ oldSettings: 'export PNPM_HOME=dir1', newSettings: 'export PNPM_HOME=dir2', })) @@ -50,7 +50,7 @@ Setup complete. Open a new terminal to start using pnpm.`) }) test('hint is added to ERR_PNPM_BAD_ENV_FOUND error object', async () => { - addDirToEnvPath['mockReturnValue'](Promise.reject(new PnpmError('BAD_ENV_FOUND', ''))) + (addDirToEnvPath as jest.Mock).mockReturnValue(Promise.reject(new PnpmError('BAD_ENV_FOUND', ''))) let err!: PnpmError try { await setup.handler({ pnpmHomeDir: '' }) @@ -61,7 +61,7 @@ test('hint is added to ERR_PNPM_BAD_ENV_FOUND error object', async () => { }) test('hint is added to ERR_PNPM_BAD_SHELL_SECTION error object', async () => { - addDirToEnvPath['mockReturnValue'](Promise.reject(new PnpmError('BAD_SHELL_SECTION', ''))) + (addDirToEnvPath as jest.Mock).mockReturnValue(Promise.reject(new PnpmError('BAD_SHELL_SECTION', ''))) let err!: PnpmError try { await setup.handler({ pnpmHomeDir: '' }) diff --git a/packages/plugin-commands-setup/tsconfig.json b/packages/plugin-commands-setup/tsconfig.json index f8e64f1ae..e5d325ff0 100644 --- a/packages/plugin-commands-setup/tsconfig.json +++ b/packages/plugin-commands-setup/tsconfig.json @@ -19,5 +19,6 @@ { "path": "../error" } - ] + ], + "composite": true } diff --git a/packages/render-peer-issues/tsconfig.json b/packages/render-peer-issues/tsconfig.json index 64c25a32e..d32e34a5c 100644 --- a/packages/render-peer-issues/tsconfig.json +++ b/packages/render-peer-issues/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../types" } - ] + ], + "composite": true } diff --git a/packages/types/src/package.ts b/packages/types/src/package.ts index 4592e2d97..1d297b2bd 100644 --- a/packages/types/src/package.ts +++ b/packages/types/src/package.ts @@ -120,6 +120,7 @@ export interface PeerDependencyRules { export type AllowedDeprecatedVersions = Record export type ProjectManifest = BaseManifest & { + workspaces?: string[] pnpm?: { neverBuiltDependencies?: string[] onlyBuiltDependencies?: string[] diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index c6f0399f6..51580dbed 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -1,5 +1,6 @@ { "extends": "@pnpm/tsconfig", + "composite": true, "compilerOptions": { "outDir": "lib", "rootDir": "src" diff --git a/packages/which-version-is-pinned/tsconfig.json b/packages/which-version-is-pinned/tsconfig.json index c6f0399f6..441d43d55 100644 --- a/packages/which-version-is-pinned/tsconfig.json +++ b/packages/which-version-is-pinned/tsconfig.json @@ -8,5 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/patching/apply-patch/tsconfig.json b/patching/apply-patch/tsconfig.json index 019cba19e..e16204313 100644 --- a/patching/apply-patch/tsconfig.json +++ b/patching/apply-patch/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../packages/error" } - ] + ], + "composite": true } diff --git a/patching/plugin-commands-patching/tsconfig.json b/patching/plugin-commands-patching/tsconfig.json index 1d4f73c6c..37ff768ca 100644 --- a/patching/plugin-commands-patching/tsconfig.json +++ b/patching/plugin-commands-patching/tsconfig.json @@ -42,5 +42,6 @@ { "path": "../apply-patch" } - ] + ], + "composite": true } diff --git a/pkg-manager/client/tsconfig.json b/pkg-manager/client/tsconfig.json index 2e02d3572..93e36d6af 100644 --- a/pkg-manager/client/tsconfig.json +++ b/pkg-manager/client/tsconfig.json @@ -36,5 +36,6 @@ { "path": "../../resolving/resolver-base" } - ] + ], + "composite": true } diff --git a/pkg-manager/core/src/install/allProjectsAreUpToDate.ts b/pkg-manager/core/src/install/allProjectsAreUpToDate.ts index 1d9c825b4..2c70c5ae4 100644 --- a/pkg-manager/core/src/install/allProjectsAreUpToDate.ts +++ b/pkg-manager/core/src/install/allProjectsAreUpToDate.ts @@ -45,7 +45,7 @@ export async function allProjectsAreUpToDate ( } function getWorkspacePackagesByDirectory (workspacePackages: WorkspacePackages) { - const workspacePackagesByDirectory = {} + const workspacePackagesByDirectory: Record = {} Object.keys(workspacePackages || {}).forEach((pkgName) => { Object.keys(workspacePackages[pkgName] || {}).forEach((pkgVersion) => { workspacePackagesByDirectory[workspacePackages[pkgName][pkgVersion].dir] = workspacePackages[pkgName][pkgVersion].manifest diff --git a/pkg-manager/core/src/install/extendInstallOptions.ts b/pkg-manager/core/src/install/extendInstallOptions.ts index ffbf466d5..1bb61888b 100644 --- a/pkg-manager/core/src/install/extendInstallOptions.ts +++ b/pkg-manager/core/src/install/extendInstallOptions.ts @@ -60,7 +60,7 @@ export interface StrictInstallOptions { depth: number lockfileDir: string modulesDir: string - rawConfig: object + rawConfig: Record // eslint-disable-line @typescript-eslint/no-explicit-any verifyStoreIntegrity: boolean engineStrict: boolean neverBuiltDependencies?: string[] @@ -222,8 +222,8 @@ export async function extendOptions ( ): Promise { if (opts) { for (const key in opts) { - if (opts[key] === undefined) { - delete opts[key] + if (opts[key as keyof InstallOptions] === undefined) { + delete opts[key as keyof InstallOptions] } } } diff --git a/pkg-manager/core/src/install/getPreferredVersions.ts b/pkg-manager/core/src/install/getPreferredVersions.ts index 16e79a0bf..49ac775d6 100644 --- a/pkg-manager/core/src/install/getPreferredVersions.ts +++ b/pkg-manager/core/src/install/getPreferredVersions.ts @@ -31,5 +31,5 @@ export function getPreferredVersionsFromLockfile (snapshots: PackageSnapshots): preferredVersions[name][version] = 'version' } return preferredVersions - }, {}) + }, {} as PreferredVersions) } diff --git a/pkg-manager/core/src/install/index.ts b/pkg-manager/core/src/install/index.ts index 91618da8f..33d2b884b 100644 --- a/pkg-manager/core/src/install/index.ts +++ b/pkg-manager/core/src/install/index.ts @@ -197,6 +197,7 @@ export async function mutateModules ( const installsOnly = projects.every((project) => project.mutation === 'install') if (!installsOnly) opts.strictPeerDependencies = false + // @ts-expect-error opts['forceNewModules'] = installsOnly const rootProjectManifest = opts.allProjects.find(({ rootDir }) => rootDir === opts.lockfileDir)?.manifest ?? // When running install/update on a subset of projects, the root project might not be included, @@ -230,7 +231,9 @@ export async function mutateModules ( const result = await _install() + // @ts-expect-error if (global['verifiedFileIntegrity'] > 1000) { + // @ts-expect-error globalInfo(`The integrity of ${global['verifiedFileIntegrity']} files was checked. This might have caused installation to take longer.`) // eslint-disable-line } if ((reporter != null) && typeof reporter === 'function') { @@ -1048,7 +1051,7 @@ const _installInContext: InstallFunction = async (projects, ctx, opts) => { prev[alias] = node } return prev - }, {}) + }, {} as Record) linkedPackages = await linkBins(project.modulesDir, project.binsDir, { allowExoticManifests: true, preferSymlinkedExecutables: opts.preferSymlinkedExecutables, @@ -1118,7 +1121,7 @@ const _installInContext: InstallFunction = async (projects, ctx, opts) => { if (result.currentLockfile.packages === undefined && result.removedDepPaths.size === 0) { return Promise.resolve() } - const injectedDeps = {} + const injectedDeps: Record = {} for (const project of projectsWithTargetDirs) { if (project.targetDirs.length > 0) { injectedDeps[project.id] = project.targetDirs.map((targetDir) => path.relative(opts.lockfileDir, targetDir)) diff --git a/pkg-manager/core/src/install/link.ts b/pkg-manager/core/src/install/link.ts index 8b6838d15..3afccf6ce 100644 --- a/pkg-manager/core/src/install/link.ts +++ b/pkg-manager/core/src/install/link.ts @@ -20,7 +20,7 @@ import { DependenciesGraphNode, LinkedDependency, } from '@pnpm/resolve-dependencies' -import { StoreController } from '@pnpm/store-controller-types' +import { StoreController, TarballResolution } from '@pnpm/store-controller-types' import { symlinkDependency } from '@pnpm/symlink-dependency' import { HoistedDependencies, @@ -380,7 +380,7 @@ async function selectNewFromWantedDeps ( const prevDep = prevDeps[depPath] if ( prevDep && - depNode.resolution['integrity'] === prevDep.resolution['integrity'] + (depNode.resolution as TarballResolution).integrity === (prevDep.resolution as TarballResolution).integrity ) { if (await pathExists(depNode.dir)) { return diff --git a/pkg-manager/core/src/link/options.ts b/pkg-manager/core/src/link/options.ts index e8e7828fc..8f38c3155 100644 --- a/pkg-manager/core/src/link/options.ts +++ b/pkg-manager/core/src/link/options.ts @@ -42,8 +42,8 @@ export type LinkOptions = export async function extendOptions (opts: LinkOptions): Promise { if (opts) { for (const key in opts) { - if (opts[key] === undefined) { - delete opts[key] + if (opts[key as keyof LinkOptions] === undefined) { + delete opts[key as keyof LinkOptions] } } } diff --git a/pkg-manager/core/test/brokenLockfileIntegrity.ts b/pkg-manager/core/test/brokenLockfileIntegrity.ts index b169656dc..6f2191e5f 100644 --- a/pkg-manager/core/test/brokenLockfileIntegrity.ts +++ b/pkg-manager/core/test/brokenLockfileIntegrity.ts @@ -1,4 +1,5 @@ import { WANTED_LOCKFILE } from '@pnpm/constants' +import { TarballResolution } from '@pnpm/lockfile-file' import { prepareEmpty } from '@pnpm/prepare' import { addDistTag } from '@pnpm/registry-mock' import rimraf from '@zkochan/rimraf' @@ -24,7 +25,7 @@ test('installation breaks if the lockfile contains the wrong checksum', async () const corruptedLockfile = await project.readLockfile() const correctLockfile = clone(corruptedLockfile) // breaking the lockfile - corruptedLockfile.packages['/@pnpm.e2e/pkg-with-1-dep/100.0.0'].resolution['integrity'] = corruptedLockfile.packages['/@pnpm.e2e/dep-of-pkg-with-1-dep/100.0.0'].resolution['integrity'] + ;(corruptedLockfile.packages['/@pnpm.e2e/pkg-with-1-dep/100.0.0'].resolution as TarballResolution).integrity = (corruptedLockfile.packages['/@pnpm.e2e/dep-of-pkg-with-1-dep/100.0.0'].resolution as TarballResolution).integrity await writeYamlFile(WANTED_LOCKFILE, corruptedLockfile, { lineWidth: 1000 }) await expect(mutateModulesInSingleProject({ @@ -67,9 +68,9 @@ test('installation breaks if the lockfile contains the wrong checksum and the st ) const corruptedLockfile = await project.readLockfile() - const correctIntegrity = corruptedLockfile.packages['/@pnpm.e2e/pkg-with-1-dep/100.0.0'].resolution['integrity'] + const correctIntegrity = (corruptedLockfile.packages['/@pnpm.e2e/pkg-with-1-dep/100.0.0'].resolution as TarballResolution).integrity // breaking the lockfile - corruptedLockfile.packages['/@pnpm.e2e/pkg-with-1-dep/100.0.0'].resolution['integrity'] = 'sha512-pl8WtlGAnoIQ7gPxT187/YwhKRnsFBR4h0YY+v0FPQjT5WPuZbI9dPRaKWgKBFOqWHylJ8EyPy34V5u9YArfng==' + ;(corruptedLockfile.packages['/@pnpm.e2e/pkg-with-1-dep/100.0.0'].resolution as TarballResolution).integrity = 'sha512-pl8WtlGAnoIQ7gPxT187/YwhKRnsFBR4h0YY+v0FPQjT5WPuZbI9dPRaKWgKBFOqWHylJ8EyPy34V5u9YArfng==' await writeYamlFile(WANTED_LOCKFILE, corruptedLockfile, { lineWidth: 1000 }) await expect( @@ -88,7 +89,7 @@ test('installation breaks if the lockfile contains the wrong checksum and the st { const lockfile = await project.readLockfile() - expect(lockfile.packages['/@pnpm.e2e/pkg-with-1-dep/100.0.0'].resolution['integrity']).toBe(correctIntegrity) + expect((lockfile.packages['/@pnpm.e2e/pkg-with-1-dep/100.0.0'].resolution as TarballResolution).integrity).toBe(correctIntegrity) } // Breaking the lockfile again @@ -111,6 +112,6 @@ test('installation breaks if the lockfile contains the wrong checksum and the st })) { const lockfile = await project.readLockfile() - expect(lockfile.packages['/@pnpm.e2e/pkg-with-1-dep/100.0.0'].resolution['integrity']).toBe(correctIntegrity) + expect((lockfile.packages['/@pnpm.e2e/pkg-with-1-dep/100.0.0'].resolution as TarballResolution).integrity).toBe(correctIntegrity) } }) diff --git a/pkg-manager/core/test/install/autoInstallPeers.ts b/pkg-manager/core/test/install/autoInstallPeers.ts index 9c38950c6..9139f3ff5 100644 --- a/pkg-manager/core/test/install/autoInstallPeers.ts +++ b/pkg-manager/core/test/install/autoInstallPeers.ts @@ -553,11 +553,11 @@ test('do not override the direct dependency with an auto installed peer dependen // The only reason the hook was added to remove the packages that aren't needed for the tests and make the test faster. readPackage: [ (pkg: PackageManifest) => { - for (const depType of ['dependencies', 'optionalDependencies', 'peerDependencies', 'peerDependenciesMeta']) { + for (const depType of ['dependencies', 'optionalDependencies', 'peerDependencies', 'peerDependenciesMeta'] as const) { if (pkg[depType]) { - for (const depName of Object.keys(pkg[depType])) { + for (const depName of Object.keys(pkg[depType] ?? {})) { if (!includedDeps.has(depName)) { - delete pkg[depType][depName] + delete pkg[depType]![depName] } } } diff --git a/pkg-manager/core/test/install/gitBranchLockfile.test.ts b/pkg-manager/core/test/install/gitBranchLockfile.test.ts index c490bb70d..9452807c6 100644 --- a/pkg-manager/core/test/install/gitBranchLockfile.test.ts +++ b/pkg-manager/core/test/install/gitBranchLockfile.test.ts @@ -14,7 +14,7 @@ test('install with git-branch-lockfile = true', async () => { prepareEmpty() const branchName: string = 'main-branch' - getCurrentBranch['mockReturnValue'](branchName) + ;(getCurrentBranch as jest.Mock).mockReturnValue(branchName) const opts = await testDefaults({ useGitBranchLockfile: true, @@ -34,7 +34,7 @@ test('install with git-branch-lockfile = true and no lockfile changes', async () prepareEmpty() const branchName: string = 'main-branch' - getCurrentBranch['mockReturnValue'](branchName) + ;(getCurrentBranch as jest.Mock).mockReturnValue(branchName) const manifest: ProjectManifest = { dependencies: { @@ -86,7 +86,7 @@ test('install a workspace with git-branch-lockfile = true', async () => { ]) const branchName: string = 'main-branch' - getCurrentBranch['mockReturnValue'](branchName) + ;(getCurrentBranch as jest.Mock).mockReturnValue(branchName) const opts = await testDefaults({ useGitBranchLockfile: true, @@ -132,7 +132,7 @@ test('install with --merge-git-branch-lockfiles', async () => { prepareEmpty() const branchName: string = 'main-branch' - getCurrentBranch['mockReturnValue'](branchName) + ;(getCurrentBranch as jest.Mock).mockReturnValue(branchName) const otherLockfilePath: string = path.resolve('pnpm-lock.other.yaml') await writeYamlFile(otherLockfilePath, { @@ -178,7 +178,7 @@ test('install with --merge-git-branch-lockfiles when merged lockfile is up to da }, { lineWidth: 1000 }) const branchName: string = 'main-branch' - getCurrentBranch['mockReturnValue'](branchName) + ;(getCurrentBranch as jest.Mock).mockReturnValue(branchName) // is-positive installed in the other branch const otherLockfilePath: string = path.resolve('pnpm-lock.other.yaml') diff --git a/pkg-manager/core/test/install/hooks.ts b/pkg-manager/core/test/install/hooks.ts index f5513e92f..75c9ff122 100644 --- a/pkg-manager/core/test/install/hooks.ts +++ b/pkg-manager/core/test/install/hooks.ts @@ -27,7 +27,7 @@ test('readPackage, afterAllResolved hooks', async () => { } const afterAllResolved = jest.fn((lockfile: Lockfile) => { - lockfile['foo'] = 'foo' + Object.assign(lockfile, { foo: 'foo' }) return lockfile }) @@ -43,7 +43,7 @@ test('readPackage, afterAllResolved hooks', async () => { expect(afterAllResolved.mock.calls[0][0].lockfileVersion).toEqual(LOCKFILE_VERSION) const wantedLockfile = await project.readLockfile() - expect(wantedLockfile['foo']).toEqual('foo') + expect(wantedLockfile).toHaveProperty(['foo'], 'foo') }) test('readPackage, afterAllResolved async hooks', async () => { @@ -65,7 +65,7 @@ test('readPackage, afterAllResolved async hooks', async () => { } const afterAllResolved = jest.fn(async (lockfile: Lockfile) => { - lockfile['foo'] = 'foo' + Object.assign(lockfile, { foo: 'foo' }) return lockfile }) @@ -81,7 +81,7 @@ test('readPackage, afterAllResolved async hooks', async () => { expect(afterAllResolved.mock.calls[0][0].lockfileVersion).toEqual(LOCKFILE_VERSION) const wantedLockfile = await project.readLockfile() - expect(wantedLockfile['foo']).toEqual('foo') + expect(wantedLockfile).toHaveProperty(['foo'], 'foo') }) test('readPackage hooks array', async () => { diff --git a/pkg-manager/core/test/install/injectLocalPackages.ts b/pkg-manager/core/test/install/injectLocalPackages.ts index 63724871d..494b7bd1c 100644 --- a/pkg-manager/core/test/install/injectLocalPackages.ts +++ b/pkg-manager/core/test/install/injectLocalPackages.ts @@ -1,7 +1,7 @@ import fs from 'fs' import path from 'path' import { assertProject } from '@pnpm/assert-project' -import { MutatedProject, mutateModules } from '@pnpm/core' +import { MutatedProject, mutateModules, ProjectOptions } from '@pnpm/core' import { preparePackages } from '@pnpm/prepare' import rimraf from '@zkochan/rimraf' import pathExists from 'path-exists' @@ -81,7 +81,7 @@ test('inject local packages', async () => { rootDir: path.resolve('project-3'), }, ] - const allProjects = [ + const allProjects: ProjectOptions[] = [ { buildIndex: 0, manifest: project1Manifest, @@ -311,7 +311,7 @@ test('inject local packages declared via file protocol', async () => { rootDir: path.resolve('project-3'), }, ] - const allProjects = [ + const allProjects: ProjectOptions[] = [ { buildIndex: 0, manifest: project1Manifest, @@ -532,7 +532,7 @@ test('inject local packages when the file protocol is used', async () => { rootDir: path.resolve('project-3'), }, ] - const allProjects = [ + const allProjects: ProjectOptions[] = [ { buildIndex: 0, manifest: project1Manifest, diff --git a/pkg-manager/core/test/install/lockfileDir.ts b/pkg-manager/core/test/install/lockfileDir.ts index 9ff47a1d8..45a25757d 100644 --- a/pkg-manager/core/test/install/lockfileDir.ts +++ b/pkg-manager/core/test/install/lockfileDir.ts @@ -55,7 +55,7 @@ test(`tarball location is correctly saved to ${WANTED_LOCKFILE} when a shared ${ const lockfile = await readYamlFile(path.resolve('..', WANTED_LOCKFILE)) expect(lockfile.packages!['file:project/pkg.tgz']).toBeTruthy() - expect(lockfile.packages!['file:project/pkg.tgz'].resolution['tarball']).toBe('file:project/pkg.tgz') + expect(lockfile.packages!['file:project/pkg.tgz'].resolution).toHaveProperty(['tarball'], 'file:project/pkg.tgz') await rimraf('node_modules') diff --git a/pkg-manager/core/test/install/overrides.ts b/pkg-manager/core/test/install/overrides.ts index c227bdeb2..c0e1edd49 100644 --- a/pkg-manager/core/test/install/overrides.ts +++ b/pkg-manager/core/test/install/overrides.ts @@ -12,7 +12,7 @@ test('versions are replaced with versions specified through overrides option', a await addDistTag({ package: '@pnpm.e2e/bar', version: '100.0.0', distTag: 'latest' }) await addDistTag({ package: '@pnpm.e2e/foo', version: '100.0.0', distTag: 'latest' }) - const overrides = { + const overrides: Record = { '@pnpm.e2e/foobarqar>@pnpm.e2e/foo': 'npm:@pnpm.e2e/qar@100.0.0', '@pnpm.e2e/bar@^100.0.0': '100.1.0', '@pnpm.e2e/dep-of-pkg-with-1-dep': '101.0.0', diff --git a/pkg-manager/core/test/install/packageExtensions.ts b/pkg-manager/core/test/install/packageExtensions.ts index 69fd449c2..19ffdb440 100644 --- a/pkg-manager/core/test/install/packageExtensions.ts +++ b/pkg-manager/core/test/install/packageExtensions.ts @@ -1,6 +1,7 @@ import { PnpmError } from '@pnpm/error' import { prepareEmpty } from '@pnpm/prepare' import { addDependenciesToPackage, mutateModulesInSingleProject } from '@pnpm/core' +import { PackageExtension } from '@pnpm/types' import { createObjectChecksum } from '../../lib/install/index' import { testDefaults, @@ -9,7 +10,7 @@ import { test('manifests are extended with fields specified by packageExtensions', async () => { const project = prepareEmpty() - const packageExtensions = { + const packageExtensions: Record = { 'is-positive': { dependencies: { '@pnpm.e2e/bar': '100.1.0', diff --git a/pkg-manager/core/test/install/peerDependencies.ts b/pkg-manager/core/test/install/peerDependencies.ts index 257688fd1..17c8b829a 100644 --- a/pkg-manager/core/test/install/peerDependencies.ts +++ b/pkg-manager/core/test/install/peerDependencies.ts @@ -13,6 +13,7 @@ import { mutateModules, mutateModulesInSingleProject, PeerDependencyIssuesError, + ProjectOptions, } from '@pnpm/core' import rimraf from '@zkochan/rimraf' import exists from 'path-exists' @@ -244,7 +245,7 @@ test('peer dependency is resolved from the dependencies of the workspace root pr package: {}, }, ]) - const allProjects = [ + const allProjects: ProjectOptions[] = [ { buildIndex: 0, manifest: { @@ -291,7 +292,7 @@ test('peer dependency is resolved from the dependencies of the workspace root pr expect(lockfile.importers.pkg?.dependencies?.['ajv-keywords']).toBe('1.5.0_ajv@4.10.0') } - allProjects[1].manifest.dependencies['is-positive'] = '1.0.0' + allProjects[1].manifest.dependencies!['is-positive'] = '1.0.0' await mutateModules([ { mutation: 'install', diff --git a/pkg-manager/core/test/lockfile.ts b/pkg-manager/core/test/lockfile.ts index c660014f8..8e5cb592d 100644 --- a/pkg-manager/core/test/lockfile.ts +++ b/pkg-manager/core/test/lockfile.ts @@ -807,9 +807,9 @@ test('lockfile file has correct format when lockfile directory does not equal th process.chdir('..') - const modules = await readYamlFile(path.resolve('node_modules', '.modules.yaml')) + const modules = await readYamlFile(path.resolve('node_modules', '.modules.yaml')) // eslint-disable-line @typescript-eslint/no-explicit-any expect(modules).toBeTruthy() - expect(modules['pendingBuilds'].length).toBe(0) + expect(modules.pendingBuilds.length).toBe(0) { const lockfile: Lockfile = await readYamlFile(WANTED_LOCKFILE) diff --git a/pkg-manager/core/tsconfig.json b/pkg-manager/core/tsconfig.json index 9120825cf..8210b5f5f 100644 --- a/pkg-manager/core/tsconfig.json +++ b/pkg-manager/core/tsconfig.json @@ -147,5 +147,6 @@ { "path": "../resolve-dependencies" } - ] + ], + "composite": true } diff --git a/pkg-manager/direct-dep-linker/tsconfig.json b/pkg-manager/direct-dep-linker/tsconfig.json index ef2fa85d8..d3e69831a 100644 --- a/pkg-manager/direct-dep-linker/tsconfig.json +++ b/pkg-manager/direct-dep-linker/tsconfig.json @@ -18,5 +18,6 @@ { "path": "../../packages/core-loggers" } - ] + ], + "composite": true } diff --git a/pkg-manager/get-context/tsconfig.json b/pkg-manager/get-context/tsconfig.json index 973dd949d..957c02fb5 100644 --- a/pkg-manager/get-context/tsconfig.json +++ b/pkg-manager/get-context/tsconfig.json @@ -30,5 +30,6 @@ { "path": "../read-projects-context" } - ] + ], + "composite": true } diff --git a/pkg-manager/headless/src/index.ts b/pkg-manager/headless/src/index.ts index db21fc913..a08b5c16c 100644 --- a/pkg-manager/headless/src/index.ts +++ b/pkg-manager/headless/src/index.ts @@ -518,7 +518,7 @@ export async function headlessInstall (opts: HeadlessOptions) { } })) } - const injectedDeps = {} + const injectedDeps: Record = {} for (const project of projectsToBeBuilt) { if (project.targetDirs.length > 0) { injectedDeps[project.id] = project.targetDirs.map((targetDir) => path.relative(opts.lockfileDir, targetDir)) diff --git a/pkg-manager/headless/src/lockfileToDepGraph.ts b/pkg-manager/headless/src/lockfileToDepGraph.ts index af14158fe..e0fbf8bc0 100644 --- a/pkg-manager/headless/src/lockfileToDepGraph.ts +++ b/pkg-manager/headless/src/lockfileToDepGraph.ts @@ -96,7 +96,7 @@ export async function lockfileToDepGraph ( const graph: DependenciesGraph = {} const directDependenciesByImporterId: DirectDependenciesByImporterId = {} if (lockfile.packages != null) { - const pkgSnapshotByLocation = {} + const pkgSnapshotByLocation: Record = {} await Promise.all( Object.entries(lockfile.packages).map(async ([depPath, pkgSnapshot]) => { if (opts.skipped.has(depPath)) return diff --git a/pkg-manager/headless/src/lockfileToHoistedDepGraph.ts b/pkg-manager/headless/src/lockfileToHoistedDepGraph.ts index 0d76eeb11..a22fa7f70 100644 --- a/pkg-manager/headless/src/lockfileToHoistedDepGraph.ts +++ b/pkg-manager/headless/src/lockfileToHoistedDepGraph.ts @@ -114,7 +114,7 @@ function directDepsMap (directDepDirs: string[], graph: DependenciesGraph): Reco return directDepDirs.reduce((acc, dir) => { acc[graph[dir].alias!] = dir return acc - }, {}) + }, {} as Record) } function pickLinkedDirectDeps ( @@ -133,7 +133,7 @@ function pickLinkedDirectDeps ( directDeps[alias] = path.resolve(importerDir, ref.slice(5)) } return directDeps - }, {}) + }, {} as Record) } async function fetchDeps ( @@ -146,7 +146,7 @@ async function fetchDeps ( modules: string, deps: Set ): Promise { - const depHierarchy = {} + const depHierarchy: Record = {} await Promise.all(Array.from(deps).map(async (dep) => { const depPath = Array.from(dep.references)[0] if (opts.skipped.has(depPath) || depPath.startsWith('workspace:')) return @@ -257,7 +257,7 @@ function getChildren ( ...pkgSnapshot.dependencies, ...(opts.include.optionalDependencies ? pkgSnapshot.optionalDependencies : {}), } - const children = {} + const children: Record = {} for (const [childName, childRef] of Object.entries(allDeps)) { const childDepPath = dp.refToRelative(childRef, childName) if (childDepPath && pkgLocationsByDepPath[childDepPath]) { diff --git a/pkg-manager/headless/test/index.ts b/pkg-manager/headless/test/index.ts index 3eb28c3f0..17f8fd577 100644 --- a/pkg-manager/headless/test/index.ts +++ b/pkg-manager/headless/test/index.ts @@ -683,11 +683,11 @@ test.each([['isolated'], ['hoisted']])('using side effects cache with nodeLinker const cafsDir = path.join(opts.storeDir, 'files') const cacheIntegrityPath = getFilePathInCafs(cafsDir, getIntegrity('@pnpm.e2e/pre-and-postinstall-scripts-example', '1.0.0'), 'index') - const cacheIntegrity = await loadJsonFile(cacheIntegrityPath) - expect(cacheIntegrity!['sideEffects']).toBeTruthy() + const cacheIntegrity = await loadJsonFile(cacheIntegrityPath) // eslint-disable-line @typescript-eslint/no-explicit-any + expect(cacheIntegrity!.sideEffects).toBeTruthy() const sideEffectsKey = `${ENGINE_NAME}-${JSON.stringify({ '/@pnpm.e2e/hello-world-js-bin/1.0.0': {} })}` expect(cacheIntegrity).toHaveProperty(['sideEffects', sideEffectsKey, 'generated-by-postinstall.js']) - delete cacheIntegrity!['sideEffects'][sideEffectsKey]['generated-by-postinstall.js'] + delete cacheIntegrity!.sideEffects[sideEffectsKey]['generated-by-postinstall.js'] expect(cacheIntegrity).toHaveProperty(['sideEffects', sideEffectsKey, 'generated-by-preinstall.js']) await writeJsonFile(cacheIntegrityPath, cacheIntegrity) diff --git a/pkg-manager/headless/tsconfig.json b/pkg-manager/headless/tsconfig.json index cd1d0fa50..bb0bf34a3 100644 --- a/pkg-manager/headless/tsconfig.json +++ b/pkg-manager/headless/tsconfig.json @@ -105,5 +105,6 @@ { "path": "../real-hoist" } - ] + ], + "composite": true } diff --git a/pkg-manager/hoist/src/index.ts b/pkg-manager/hoist/src/index.ts index d33ed11c1..638e0aaab 100644 --- a/pkg-manager/hoist/src/index.ts +++ b/pkg-manager/hoist/src/index.ts @@ -47,7 +47,7 @@ export async function hoist ( acc[alias] = depPath } return acc - }, {}), + }, {} as Record), depPath: '', depth: -1, }, diff --git a/pkg-manager/hoist/tsconfig.json b/pkg-manager/hoist/tsconfig.json index 9d72521ae..d61d05894 100644 --- a/pkg-manager/hoist/tsconfig.json +++ b/pkg-manager/hoist/tsconfig.json @@ -36,5 +36,6 @@ { "path": "../link-bins" } - ] + ], + "composite": true } diff --git a/pkg-manager/link-bins/test/index.ts b/pkg-manager/link-bins/test/index.ts index 636b68a97..96fecaf0f 100644 --- a/pkg-manager/link-bins/test/index.ts +++ b/pkg-manager/link-bins/test/index.ts @@ -30,7 +30,7 @@ const binsConflictLogger = logger('bins-conflict') const f = fixtures(__dirname) beforeEach(() => { - binsConflictLogger.debug['mockClear']() + (binsConflictLogger.debug as jest.Mock).mockClear() }) const POWER_SHELL_IS_SUPPORTED = isWindows() diff --git a/pkg-manager/link-bins/tsconfig.json b/pkg-manager/link-bins/tsconfig.json index 101633227..af595b796 100644 --- a/pkg-manager/link-bins/tsconfig.json +++ b/pkg-manager/link-bins/tsconfig.json @@ -33,5 +33,6 @@ { "path": "../package-bins" } - ] + ], + "composite": true } diff --git a/pkg-manager/modules-cleaner/src/prune.ts b/pkg-manager/modules-cleaner/src/prune.ts index 379956c8e..92701d18f 100644 --- a/pkg-manager/modules-cleaner/src/prune.ts +++ b/pkg-manager/modules-cleaner/src/prune.ts @@ -217,7 +217,7 @@ function getPkgsDepPaths ( if (skipped.has(depPath)) return acc acc[depPath] = packageIdFromSnapshot(depPath, pkg, registries) return acc - }, {}) + }, {} as Record) } function getPkgsDepPathsOwnedOnlyByImporters ( diff --git a/pkg-manager/modules-cleaner/tsconfig.json b/pkg-manager/modules-cleaner/tsconfig.json index 16063c4b0..9eabd506c 100644 --- a/pkg-manager/modules-cleaner/tsconfig.json +++ b/pkg-manager/modules-cleaner/tsconfig.json @@ -36,5 +36,6 @@ { "path": "../remove-bins" } - ] + ], + "composite": true } diff --git a/pkg-manager/modules-yaml/test/index.ts b/pkg-manager/modules-yaml/test/index.ts index 30e9695d6..3dee1d34b 100644 --- a/pkg-manager/modules-yaml/test/index.ts +++ b/pkg-manager/modules-yaml/test/index.ts @@ -30,9 +30,9 @@ test('writeModulesManifest() and readModulesManifest()', async () => { await writeModulesManifest(modulesDir, modulesYaml) expect(await readModulesManifest(modulesDir)).toEqual(modulesYaml) - const raw = await readYamlFile(path.join(modulesDir, '.modules.yaml')) - expect(raw['virtualStoreDir']).toBeDefined() - expect(path.isAbsolute(raw['virtualStoreDir'])).toEqual(isWindows()) + const raw = await readYamlFile(path.join(modulesDir, '.modules.yaml')) // eslint-disable-line @typescript-eslint/no-explicit-any + expect(raw.virtualStoreDir).toBeDefined() + expect(path.isAbsolute(raw.virtualStoreDir)).toEqual(isWindows()) }) test('backward compatible read of .modules.yaml created with shamefully-hoist=true', async () => { diff --git a/pkg-manager/modules-yaml/tsconfig.json b/pkg-manager/modules-yaml/tsconfig.json index d37dd6eef..7302e6eab 100644 --- a/pkg-manager/modules-yaml/tsconfig.json +++ b/pkg-manager/modules-yaml/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/pkg-manager/package-bins/tsconfig.json b/pkg-manager/package-bins/tsconfig.json index d37dd6eef..7302e6eab 100644 --- a/pkg-manager/package-bins/tsconfig.json +++ b/pkg-manager/package-bins/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/pkg-manager/package-requester/src/packageRequester.ts b/pkg-manager/package-requester/src/packageRequester.ts index 743fdf65f..92a4ef2cc 100644 --- a/pkg-manager/package-requester/src/packageRequester.ts +++ b/pkg-manager/package-requester/src/packageRequester.ts @@ -13,6 +13,7 @@ import { fetchingProgressLogger, progressLogger } from '@pnpm/core-loggers' import { pickFetcher } from '@pnpm/pick-fetcher' import { PnpmError } from '@pnpm/error' import { + DirectoryFetcherResult, Fetchers, FetchOptions, FetchResult, @@ -27,6 +28,7 @@ import { Resolution, ResolveFunction, ResolveResult, + TarballResolution, } from '@pnpm/resolver-base' import { BundledManifest, @@ -106,8 +108,6 @@ export function createPackageRequester ( const requestsQueue = new PQueue({ concurrency: networkConcurrency, }) - requestsQueue['counter'] = 0 - requestsQueue['concurrency'] = networkConcurrency const cafsDir = path.join(opts.storeDir, 'files') const getFilePathInCafs = _getFilePathInCafs.bind(null, cafsDir) @@ -123,7 +123,10 @@ export function createPackageRequester ( fetchingLocker: new Map(), getFilePathByModeInCafs: _getFilePathByModeInCafs.bind(null, cafsDir), getFilePathInCafs, - requestsQueue, + requestsQueue: Object.assign(requestsQueue, { + counter: 0, + concurrency: networkConcurrency, + }), storeDir: opts.storeDir, }) const requestPackage = resolveAndFetch.bind(null, { @@ -201,7 +204,7 @@ async function resolveAndFetch ( forceFetch = Boolean( ((options.currentPkg?.resolution) != null) && pkgId?.startsWith('file:') && - options.currentPkg?.resolution['integrity'] !== resolveResult.resolution['integrity'] + (options.currentPkg?.resolution as TarballResolution).integrity !== (resolveResult.resolution as TarballResolution).integrity ) updated = pkgId !== resolveResult.id || !resolution || forceFetch @@ -314,8 +317,8 @@ function getFilesIndexFilePath ( ) { const targetRelative = depPathToFilename(opts.pkg.id) const target = path.join(ctx.storeDir, targetRelative) - const filesIndexFile = opts.pkg.resolution['integrity'] - ? ctx.getFilePathInCafs(opts.pkg.resolution['integrity'], 'index') + const filesIndexFile = (opts.pkg.resolution as TarballResolution).integrity + ? ctx.getFilePathInCafs((opts.pkg.resolution as TarballResolution).integrity!, 'index') : path.join(target, opts.ignoreScripts ? 'integrity-not-built.json' : 'integrity.json') return { filesIndexFile, target } } @@ -334,7 +337,11 @@ function fetchToStore ( fetchingLocker: Map getFilePathInCafs: (integrity: string, fileType: FileType) => string getFilePathByModeInCafs: (integrity: string, mode: number) => string - requestsQueue: { add: (fn: () => Promise, opts: { priority: number }) => Promise } + requestsQueue: { + add: (fn: () => Promise, opts: { priority: number }) => Promise + counter: number + concurrency: number + } storeDir: string }, opts: FetchPackageToStoreOptions @@ -527,7 +534,7 @@ Actual package in the store by the given integrity: ${pkgFilesIndex.name}@${pkgF // However, when one line is left available, allow it to be picked up by a metadata request. // This is done in order to avoid situations when tarballs are downloaded in chunks // As many tarballs should be downloaded simultaneously as possible. - const priority = (++ctx.requestsQueue['counter'] % ctx.requestsQueue['concurrency'] === 0 ? -1 : 1) * 1000 + const priority = (++ctx.requestsQueue.counter % ctx.requestsQueue.concurrency === 0 ? -1 : 1) * 1000 const fetchManifest = opts.fetchRawManifest ? safePromiseDefer() @@ -604,13 +611,13 @@ Actual package in the store by the given integrity: ${pkgFilesIndex.name}@${pkgF local: true, fromStore: false, filesIndex: fetchedPackage.filesIndex, - packageImportMethod: fetchedPackage['packageImportMethod'], + packageImportMethod: (fetchedPackage as DirectoryFetcherResult).packageImportMethod, } } - if (isLocalTarballDep && opts.pkg.resolution['integrity']) { + if (isLocalTarballDep && (opts.pkg.resolution as TarballResolution).integrity) { await fs.mkdir(target, { recursive: true }) - await gfs.writeFile(path.join(target, TARBALL_INTEGRITY_FILENAME), opts.pkg.resolution['integrity'], 'utf8') + await gfs.writeFile(path.join(target, TARBALL_INTEGRITY_FILENAME), (opts.pkg.resolution as TarballResolution).integrity!, 'utf8') } files.resolve(filesResult) @@ -688,7 +695,7 @@ async function fetcher ( ): Promise { const fetch = pickFetcher(fetcherByHostingType, resolution) try { - return await fetch(cafs, resolution, opts) + return await fetch(cafs, resolution as any, opts) // eslint-disable-line @typescript-eslint/no-explicit-any } catch (err: any) { // eslint-disable-line packageRequestLogger.warn({ message: `Fetching ${packageId} failed!`, diff --git a/pkg-manager/package-requester/test/index.ts b/pkg-manager/package-requester/test/index.ts index c42b965ae..e1362b589 100644 --- a/pkg-manager/package-requester/test/index.ts +++ b/pkg-manager/package-requester/test/index.ts @@ -1,7 +1,7 @@ /// import { promises as fs, statSync } from 'fs' import path from 'path' -import { getFilePathInCafs, PackageFilesIndex } from '@pnpm/cafs' +import { getFilePathInCafs, PackageFilesIndex, PackageFileInfo } from '@pnpm/cafs' import { createClient } from '@pnpm/client' import { streamParser } from '@pnpm/logger' import { createPackageRequester, PackageResponse } from '@pnpm/package-requester' @@ -489,7 +489,7 @@ test('fetchPackageToStore() concurrency check', async () => { const fetchResult = fetchResults[0] const files = await fetchResult.files() - ino1 = statSync(getFilePathInCafs(cafsDir, files.filesIndex['package.json']['integrity'], 'nonexec')).ino + ino1 = statSync(getFilePathInCafs(cafsDir, (files.filesIndex['package.json'] as PackageFileInfo).integrity, 'nonexec')).ino expect(Object.keys(files.filesIndex).sort()).toStrictEqual(['package.json', 'index.js', 'license', 'readme.md'].sort()) expect(files.fromStore).toBeFalsy() @@ -501,7 +501,7 @@ test('fetchPackageToStore() concurrency check', async () => { const fetchResult = fetchResults[1] const files = await fetchResult.files() - ino2 = statSync(getFilePathInCafs(cafsDir, files.filesIndex['package.json']['integrity'], 'nonexec')).ino + ino2 = statSync(getFilePathInCafs(cafsDir, (files.filesIndex['package.json'] as PackageFileInfo).integrity, 'nonexec')).ino expect(Object.keys(files.filesIndex).sort()).toStrictEqual(['package.json', 'index.js', 'license', 'readme.md'].sort()) expect(files.fromStore).toBeFalsy() @@ -726,7 +726,7 @@ test('refetch package to store if it has been modified', async () => { }) const { filesIndex } = await fetchResult.files() - indexJsFile = getFilePathInCafs(cafsDir, filesIndex['index.js']['integrity'], 'nonexec') + indexJsFile = getFilePathInCafs(cafsDir, (filesIndex['index.js'] as PackageFileInfo).integrity, 'nonexec') } await delay(200) diff --git a/pkg-manager/package-requester/tsconfig.json b/pkg-manager/package-requester/tsconfig.json index 094bb6265..26690c29b 100644 --- a/pkg-manager/package-requester/tsconfig.json +++ b/pkg-manager/package-requester/tsconfig.json @@ -57,5 +57,6 @@ { "path": "../client" } - ] + ], + "composite": true } diff --git a/pkg-manager/plugin-commands-installation/src/getOptionsFromRootManifest.ts b/pkg-manager/plugin-commands-installation/src/getOptionsFromRootManifest.ts index a68daa149..093d2c88b 100644 --- a/pkg-manager/plugin-commands-installation/src/getOptionsFromRootManifest.ts +++ b/pkg-manager/plugin-commands-installation/src/getOptionsFromRootManifest.ts @@ -41,6 +41,7 @@ export function getOptionsFromRootManifest (manifest: ProjectManifest): { patchedDependencies, } if (onlyBuiltDependencies) { + // @ts-expect-error settings['onlyBuiltDependencies'] = onlyBuiltDependencies } return settings diff --git a/pkg-manager/plugin-commands-installation/src/installDeps.ts b/pkg-manager/plugin-commands-installation/src/installDeps.ts index 0db7bf81b..8af909ec9 100644 --- a/pkg-manager/plugin-commands-installation/src/installDeps.ts +++ b/pkg-manager/plugin-commands-installation/src/installDeps.ts @@ -115,6 +115,7 @@ when running add/update with the --workspace option') opts.saveWorkspaceProtocol = true } } + // @ts-expect-error opts['preserveWorkspaceProtocol'] = !opts.linkWorkspacePackages } const includeDirect = opts.includeDirect ?? { @@ -173,7 +174,7 @@ when running add/update with the --workspace option') let workspacePackages!: WorkspacePackages if (opts.workspaceDir) { - workspacePackages = arrayOfWorkspacePackagesToMap(allProjects) + workspacePackages = arrayOfWorkspacePackagesToMap(allProjects) as WorkspacePackages } let { manifest, writeProjectManifest } = await tryReadProjectManifest(opts.dir, opts) diff --git a/pkg-manager/plugin-commands-installation/src/link.ts b/pkg-manager/plugin-commands-installation/src/link.ts index 83e838d45..ee648a5cd 100644 --- a/pkg-manager/plugin-commands-installation/src/link.ts +++ b/pkg-manager/plugin-commands-installation/src/link.ts @@ -30,6 +30,7 @@ import * as installCommand from './install' import { getOptionsFromRootManifest } from './getOptionsFromRootManifest' import { getSaveType } from './getSaveType' +// @ts-expect-error const isWindows = process.platform === 'win32' || global['FAKE_WINDOWS'] const isFilespec = isWindows ? /^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/ : /^(?:[.]|~[/]|[/]|[a-zA-Z]:)/ const installLimit = pLimit(4) @@ -100,7 +101,7 @@ export async function handler ( let workspacePackages!: WorkspacePackages if (opts.workspaceDir) { workspacePackagesArr = await findWorkspacePackages(opts.workspaceDir, opts) - workspacePackages = arrayOfWorkspacePackagesToMap(workspacePackagesArr) + workspacePackages = arrayOfWorkspacePackagesToMap(workspacePackagesArr) as WorkspacePackages } else { workspacePackages = {} } diff --git a/pkg-manager/plugin-commands-installation/src/recursive.ts b/pkg-manager/plugin-commands-installation/src/recursive.ts index 0310e0648..3ec65f5de 100755 --- a/pkg-manager/plugin-commands-installation/src/recursive.ts +++ b/pkg-manager/plugin-commands-installation/src/recursive.ts @@ -28,6 +28,7 @@ import { MutatedProject, mutateModules, ProjectOptions, + WorkspacePackages, } from '@pnpm/core' import isSubdir from 'is-subdir' import mem from 'mem' @@ -113,8 +114,8 @@ export async function recursive ( const store = await createOrConnectStoreController(opts) - const workspacePackages = cmdFullName !== 'unlink' - ? arrayOfWorkspacePackagesToMap(allProjects) + const workspacePackages: WorkspacePackages = cmdFullName !== 'unlink' + ? arrayOfWorkspacePackagesToMap(allProjects) as WorkspacePackages : {} const targetDependenciesField = getSaveType(opts) const installOpts = Object.assign(opts, { @@ -510,11 +511,11 @@ function getAllProjects (manifestsByPath: ManifestsByPath, allProjectsGraph: Pro interface ManifestsByPath { [dir: string]: Omit } -function getManifestsByPath (projects: Project[]) { +function getManifestsByPath (projects: Project[]): Record> { return projects.reduce((manifestsByPath, { dir, manifest, writeProjectManifest }) => { manifestsByPath[dir] = { manifest, writeProjectManifest } return manifestsByPath - }, {}) + }, {} as Record>) } function getImporters (opts: Pick) { diff --git a/pkg-manager/plugin-commands-installation/src/remove.ts b/pkg-manager/plugin-commands-installation/src/remove.ts index 5af9bb105..5b09229e0 100644 --- a/pkg-manager/plugin-commands-installation/src/remove.ts +++ b/pkg-manager/plugin-commands-installation/src/remove.ts @@ -176,6 +176,7 @@ export async function handler ( storeDir: store.dir, include, }) + // @ts-expect-error removeOpts['workspacePackages'] = opts.workspaceDir ? arrayOfWorkspacePackagesToMap(await findWorkspacePackages(opts.workspaceDir, opts)) : undefined diff --git a/pkg-manager/plugin-commands-installation/test/link.ts b/pkg-manager/plugin-commands-installation/test/link.ts index 2a924732c..b85923565 100644 --- a/pkg-manager/plugin-commands-installation/test/link.ts +++ b/pkg-manager/plugin-commands-installation/test/link.ts @@ -43,8 +43,8 @@ test('linking multiple packages', async () => { await project.has('linked-foo') await project.has('linked-bar') - const modules = await readYamlFile('../linked-bar/node_modules/.modules.yaml') - expect(modules['hoistPattern']).toStrictEqual(['*']) // the linked package used its own configs during installation // eslint-disable-line @typescript-eslint/dot-notation + const modules = await readYamlFile('../linked-bar/node_modules/.modules.yaml') // eslint-disable-line @typescript-eslint/no-explicit-any + expect(modules.hoistPattern).toStrictEqual(['*']) // the linked package used its own configs during installation // eslint-disable-line @typescript-eslint/dot-notation }) test('link global bin', async function () { diff --git a/pkg-manager/plugin-commands-installation/tsconfig.json b/pkg-manager/plugin-commands-installation/tsconfig.json index 9cefe9ee3..1b66a3c65 100644 --- a/pkg-manager/plugin-commands-installation/tsconfig.json +++ b/pkg-manager/plugin-commands-installation/tsconfig.json @@ -93,5 +93,6 @@ { "path": "../modules-yaml" } - ] + ], + "composite": true } diff --git a/pkg-manager/read-projects-context/tsconfig.json b/pkg-manager/read-projects-context/tsconfig.json index 8c72c99f2..cd29a67ae 100644 --- a/pkg-manager/read-projects-context/tsconfig.json +++ b/pkg-manager/read-projects-context/tsconfig.json @@ -21,5 +21,6 @@ { "path": "../modules-yaml" } - ] + ], + "composite": true } diff --git a/pkg-manager/real-hoist/src/index.ts b/pkg-manager/real-hoist/src/index.ts index 42976461d..55d6c8588 100644 --- a/pkg-manager/real-hoist/src/index.ts +++ b/pkg-manager/real-hoist/src/index.ts @@ -36,7 +36,7 @@ export function hoist ( // It is only needed to prevent the hoister from hoisting deps with this name to the root of node_modules. acc[dep] = 'link:' return acc - }, {}), + }, {} as Record), }), } for (const [importerId, importer] of Object.entries(lockfile.importers)) { diff --git a/pkg-manager/real-hoist/tsconfig.json b/pkg-manager/real-hoist/tsconfig.json index dee3d688a..c6a7907f4 100644 --- a/pkg-manager/real-hoist/tsconfig.json +++ b/pkg-manager/real-hoist/tsconfig.json @@ -21,5 +21,6 @@ { "path": "../../packages/error" } - ] + ], + "composite": true } diff --git a/pkg-manager/remove-bins/tsconfig.json b/pkg-manager/remove-bins/tsconfig.json index e87d2bcf8..704af73f2 100644 --- a/pkg-manager/remove-bins/tsconfig.json +++ b/pkg-manager/remove-bins/tsconfig.json @@ -21,5 +21,6 @@ { "path": "../package-bins" } - ] + ], + "composite": true } diff --git a/pkg-manager/resolve-dependencies/src/index.ts b/pkg-manager/resolve-dependencies/src/index.ts index 81bacc66d..a0f00cd9f 100644 --- a/pkg-manager/resolve-dependencies/src/index.ts +++ b/pkg-manager/resolve-dependencies/src/index.ts @@ -16,6 +16,7 @@ import { } from '@pnpm/manifest-utils' import { safeReadPackageJsonFromDir } from '@pnpm/read-package-json' import { + DependenciesField, DEPENDENCIES_FIELDS, DependencyManifest, ProjectManifest, @@ -74,10 +75,13 @@ export type ImporterToResolve = Importer<{ updateSpec?: boolean }> & { + peer?: boolean + pinnedVersion?: PinnedVersion binsDir: string manifest: ProjectManifest originalManifest?: ProjectManifest updatePackageManifest: boolean + targetDependenciesField?: DependenciesField } export async function resolveDependencies ( @@ -367,7 +371,7 @@ function addDirectDependenciesToLockfile ( const directDependenciesByAlias = directDependencies.reduce((acc, directDependency) => { acc[directDependency.alias] = directDependency return acc - }, {}) + }, {} as Record) const allDeps = Array.from(new Set(Object.keys(getAllDependenciesFromManifest(newManifest)))) @@ -413,14 +417,14 @@ function alignDependencyTypes (manifest: ProjectManifest, projectSnapshot: Proje if (projectSnapshot[depType] == null) continue for (const [alias, ref] of Object.entries(projectSnapshot[depType] ?? {})) { if (depType === depTypesOfAliases[alias] || !depTypesOfAliases[alias]) continue - projectSnapshot[depTypesOfAliases[alias]][alias] = ref + projectSnapshot[depTypesOfAliases[alias]]![alias] = ref delete projectSnapshot[depType]![alias] } } } -function getAliasToDependencyTypeMap (manifest: ProjectManifest) { - const depTypesOfAliases = {} +function getAliasToDependencyTypeMap (manifest: ProjectManifest): Record { + const depTypesOfAliases: Record = {} for (const depType of DEPENDENCIES_FIELDS) { if (manifest[depType] == null) continue for (const alias of Object.keys(manifest[depType] ?? {})) { diff --git a/pkg-manager/resolve-dependencies/src/resolveDependencies.ts b/pkg-manager/resolve-dependencies/src/resolveDependencies.ts index 87f6e18c7..5b9585af5 100644 --- a/pkg-manager/resolve-dependencies/src/resolveDependencies.ts +++ b/pkg-manager/resolve-dependencies/src/resolveDependencies.ts @@ -392,7 +392,7 @@ async function resolveDependenciesOfImporters ( } const pkgAddressesByImportersWithoutPeers = await Promise.all(zipWith(async (importer, { pkgAddresses, postponedResolutionsQueue, postponedPeersResolutionQueue }) => { const newPreferredVersions = { ...importer.preferredVersions } - const currentParentPkgAliases = {} + const currentParentPkgAliases: Record = {} for (const pkgAddress of pkgAddresses) { if (currentParentPkgAliases[pkgAddress.alias] !== true) { currentParentPkgAliases[pkgAddress.alias] = pkgAddress @@ -514,7 +514,7 @@ export async function resolveDependencies ( } }) const newPreferredVersions = { ...preferredVersions } - const currentParentPkgAliases = {} + const currentParentPkgAliases: Record = {} for (const pkgAddress of pkgAddresses) { if (currentParentPkgAliases[pkgAddress.alias] !== true) { currentParentPkgAliases[pkgAddress.alias] = pkgAddress @@ -802,9 +802,9 @@ async function resolveChildren ( })) ctx.dependenciesTree[parentPkg.nodeId] = { children: pkgAddresses.reduce((chn, child) => { - chn[child.alias] = child['nodeId'] ?? child.pkgId + chn[child.alias] = (child as PkgAddress).nodeId ?? child.pkgId return chn - }, {}), + }, {} as Record), depth: parentDepth, installable: parentPkg.installable, resolvedPackage: ctx.resolvedPackagesByDepPath[parentPkg.depPath], @@ -1302,7 +1302,7 @@ async function resolveDependency ( } const rootDir = pkgResponse.body.resolution.type === 'directory' - ? path.resolve(ctx.lockfileDir, pkgResponse.body.resolution['directory']) + ? path.resolve(ctx.lockfileDir, (pkgResponse.body.resolution as DirectoryResolution).directory) : options.prefix let missingPeersOfChildren!: MissingPeersOfChildren | undefined if (ctx.autoInstallPeers && !nodeIdContains(options.parentPkg.nodeId, depPath)) { @@ -1433,7 +1433,7 @@ function peerDependenciesWithoutOwn (pkg: PackageManifest) { ...Object.keys(pkg.dependencies ?? {}), ...Object.keys(pkg.optionalDependencies ?? {}), ]) - const result = {} + const result: Record = {} if (pkg.peerDependencies != null) { for (const [peerName, peerRange] of Object.entries(pkg.peerDependencies)) { if (ownDeps.has(peerName)) continue diff --git a/pkg-manager/resolve-dependencies/src/resolveDependencyTree.ts b/pkg-manager/resolve-dependencies/src/resolveDependencyTree.ts index 4b8725702..7c97149e0 100644 --- a/pkg-manager/resolve-dependencies/src/resolveDependencyTree.ts +++ b/pkg-manager/resolve-dependencies/src/resolveDependencyTree.ts @@ -137,7 +137,7 @@ export async function resolveDependencyTree ( // This may be optimized. // We only need to proceed resolving every dependency // if the newly added dependency has peer dependencies. - const proceed = importer.id === '.' || importer.hasRemovedDependencies === true || importer.wantedDependencies.some((wantedDep) => wantedDep['isNew']) + const proceed = importer.id === '.' || importer.hasRemovedDependencies === true || importer.wantedDependencies.some((wantedDep: any) => wantedDep.isNew) // eslint-disable-line @typescript-eslint/no-explicit-any const resolveOpts = { currentDepth: 0, parentPkg: { @@ -215,7 +215,7 @@ export async function resolveDependencyTree ( .reduce((acc, { alias, nodeId }) => { acc[alias] = nodeId return acc - }, {}), + }, {} as Record), linkedDependencies, } } @@ -244,7 +244,7 @@ function buildTree ( depth: number, installable: boolean ) { - const childrenNodeIds = {} + const childrenNodeIds: Record = {} for (const child of children) { if (child.depPath.startsWith('link:')) { childrenNodeIds[child.alias] = child.depPath diff --git a/pkg-manager/resolve-dependencies/src/resolvePeers.ts b/pkg-manager/resolve-dependencies/src/resolvePeers.ts index 93f303e96..0ab9e9b58 100644 --- a/pkg-manager/resolve-dependencies/src/resolvePeers.ts +++ b/pkg-manager/resolve-dependencies/src/resolvePeers.ts @@ -70,7 +70,7 @@ export function resolvePeers ( peerDependencyIssuesByProjects: PeerDependencyIssuesByProjects } { const depGraph: GenericDependenciesGraph = {} - const pathsByNodeId = {} + const pathsByNodeId: Record = {} const _createPkgsByName = createPkgsByName.bind(null, opts.dependenciesTree) const rootPkgsByName = opts.resolvePeersFromWorkspaceRoot ? getRootPkgsByName(opts.dependenciesTree, opts.projects) : {} const peerDependencyIssuesByProjects: PeerDependencyIssuesByProjects = {} diff --git a/pkg-manager/resolve-dependencies/src/toResolveImporter.ts b/pkg-manager/resolve-dependencies/src/toResolveImporter.ts index 2bfe8f101..387120fe9 100644 --- a/pkg-manager/resolve-dependencies/src/toResolveImporter.ts +++ b/pkg-manager/resolve-dependencies/src/toResolveImporter.ts @@ -116,7 +116,9 @@ function getPreferredVersionsFromPackage ( return getVersionSpecsByRealNames(getAllDependenciesFromManifest(pkg)) } -function getVersionSpecsByRealNames (deps: Dependencies) { +type VersionSpecsByRealNames = Record> + +function getVersionSpecsByRealNames (deps: Dependencies): VersionSpecsByRealNames { return Object.entries(deps) .reduce((acc, [depName, currentPref]) => { if (currentPref.startsWith('npm:')) { @@ -137,5 +139,5 @@ function getVersionSpecsByRealNames (deps: Dependencies) { } } return acc - }, {}) + }, {} as VersionSpecsByRealNames) } diff --git a/pkg-manager/resolve-dependencies/src/updateLockfile.ts b/pkg-manager/resolve-dependencies/src/updateLockfile.ts index 2d17e1745..0b74532ca 100644 --- a/pkg-manager/resolve-dependencies/src/updateLockfile.ts +++ b/pkg-manager/resolve-dependencies/src/updateLockfile.ts @@ -14,6 +14,7 @@ import { KeyValuePair } from 'ramda' import isEmpty from 'ramda/src/isEmpty' import mergeRight from 'ramda/src/mergeRight' import partition from 'ramda/src/partition' +import { SafePromiseDefer } from 'safe-promise-defer' import { depPathToRef } from './depPathToRef' import { ResolvedPackage } from './resolveDependencies' import { DependenciesGraph } from '.' @@ -92,7 +93,7 @@ function toLockfileDependency ( ) const result = { resolution: lockfileResolution, - } + } as PackageSnapshot if (dp.isAbsolute(opts.depPath)) { result['name'] = pkg.name @@ -126,7 +127,7 @@ function toLockfileDependency ( result['transitivePeerDependencies'] = Array.from(pkg.transitivePeerDependencies).sort() } if (pkg.peerDependenciesMeta != null) { - const normalizedPeerDependenciesMeta = {} + const normalizedPeerDependenciesMeta: Record = {} for (const [peer, { optional }] of Object.entries(pkg.peerDependenciesMeta)) { if (optional) { normalizedPeerDependenciesMeta[peer] = { optional: true } @@ -139,8 +140,8 @@ function toLockfileDependency ( if (pkg.additionalInfo.engines != null) { for (const [engine, version] of Object.entries(pkg.additionalInfo.engines)) { if (version === '*') continue - result['engines'] = result['engines'] || {} - result['engines'][engine] = version + result.engines = result.engines ?? {} as any // eslint-disable-line @typescript-eslint/no-explicit-any + result.engines![engine] = version } } if (pkg.additionalInfo.cpu != null) { @@ -185,7 +186,7 @@ function toLockfileDependency ( pending = true } if (!requiresBuildIsKnown && !pending) { - pkg.requiresBuild['resolve'](result['requiresBuild'] ?? false) + (pkg.requiresBuild as SafePromiseDefer).resolve(result.requiresBuild ?? false) } /* eslint-enable @typescript-eslint/dot-notation */ return result diff --git a/pkg-manager/resolve-dependencies/src/updateProjectManifest.ts b/pkg-manager/resolve-dependencies/src/updateProjectManifest.ts index 6b7db4b5d..1acc16ed4 100644 --- a/pkg-manager/resolve-dependencies/src/updateProjectManifest.ts +++ b/pkg-manager/resolve-dependencies/src/updateProjectManifest.ts @@ -27,7 +27,7 @@ export async function updateProjectManifest ( const wantedDep = importer.wantedDependencies[index]! return resolvedDirectDepToSpecObject({ ...rdd, isNew: wantedDep.isNew, specRaw: wantedDep.raw }, importer, { nodeExecPath: wantedDep.nodeExecPath, - pinnedVersion: wantedDep.pinnedVersion ?? importer['pinnedVersion'] ?? 'major', + pinnedVersion: wantedDep.pinnedVersion ?? importer.pinnedVersion ?? 'major', preserveWorkspaceProtocol: opts.preserveWorkspaceProtocol, saveWorkspaceProtocol: opts.saveWorkspaceProtocol, }) @@ -37,8 +37,8 @@ export async function updateProjectManifest ( specsToUpsert.push({ alias: pkgToInstall.alias, nodeExecPath: pkgToInstall.nodeExecPath, - peer: importer['peer'], - saveType: importer['targetDependenciesField'], + peer: importer.peer, + saveType: importer.targetDependenciesField, }) } } diff --git a/pkg-manager/resolve-dependencies/tsconfig.json b/pkg-manager/resolve-dependencies/tsconfig.json index 5b10dd4d6..4e45e27c0 100644 --- a/pkg-manager/resolve-dependencies/tsconfig.json +++ b/pkg-manager/resolve-dependencies/tsconfig.json @@ -54,5 +54,6 @@ { "path": "../../store/store-controller-types" } - ] + ], + "composite": true } diff --git a/pkg-manifest/exportable-manifest/src/index.ts b/pkg-manifest/exportable-manifest/src/index.ts index 439daa93e..9bc749305 100644 --- a/pkg-manifest/exportable-manifest/src/index.ts +++ b/pkg-manifest/exportable-manifest/src/index.ts @@ -29,7 +29,7 @@ export async function createExportableManifest ( if (originalManifest.scripts != null) { publishManifest.scripts = omit(PREPUBLISH_SCRIPTS, originalManifest.scripts) } - for (const depsField of ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies']) { + for (const depsField of ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies'] as const) { const deps = await makePublishDependencies(dir, originalManifest[depsField], opts?.modulesDir) if (deps != null) { publishManifest[depsField] = deps diff --git a/pkg-manifest/exportable-manifest/src/overridePublishConfig.ts b/pkg-manifest/exportable-manifest/src/overridePublishConfig.ts index f5a38dc08..87524c74e 100644 --- a/pkg-manifest/exportable-manifest/src/overridePublishConfig.ts +++ b/pkg-manifest/exportable-manifest/src/overridePublishConfig.ts @@ -33,7 +33,7 @@ export function overridePublishConfig (publishManifest: ProjectManifest): void { Object.entries(publishConfig) .filter(([key]) => PUBLISH_CONFIG_WHITELIST.has(key)) .forEach(([key, value]) => { - publishManifest[key] = value + publishManifest[key as keyof ProjectManifest] = value as any // eslint-disable-line @typescript-eslint/no-explicit-any delete publishConfig[key] }) diff --git a/pkg-manifest/exportable-manifest/test/overridePublishConfig.test.ts b/pkg-manifest/exportable-manifest/test/overridePublishConfig.test.ts index 8630a091b..9934ac570 100644 --- a/pkg-manifest/exportable-manifest/test/overridePublishConfig.test.ts +++ b/pkg-manifest/exportable-manifest/test/overridePublishConfig.test.ts @@ -26,6 +26,6 @@ test('publish config to be overridden', async () => { overridePublishConfig(publishManifest) Object.keys(publishConfig).forEach((publishConfigKey) => { - expect(publishManifest[publishConfigKey]).toEqual(publishConfig[publishConfigKey]) + expect(publishManifest[publishConfigKey as keyof PackageManifest]).toEqual(publishConfig[publishConfigKey]) }) }) diff --git a/pkg-manifest/exportable-manifest/tsconfig.json b/pkg-manifest/exportable-manifest/tsconfig.json index f714f7a81..1bca69278 100644 --- a/pkg-manifest/exportable-manifest/tsconfig.json +++ b/pkg-manifest/exportable-manifest/tsconfig.json @@ -18,5 +18,6 @@ { "path": "../read-project-manifest" } - ] + ], + "composite": true } diff --git a/pkg-manifest/manifest-utils/tsconfig.json b/pkg-manifest/manifest-utils/tsconfig.json index 3e087a40c..84b76ed17 100644 --- a/pkg-manifest/manifest-utils/tsconfig.json +++ b/pkg-manifest/manifest-utils/tsconfig.json @@ -18,5 +18,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/pkg-manifest/read-package-json/tsconfig.json b/pkg-manifest/read-package-json/tsconfig.json index 2df79e097..00894d2d6 100644 --- a/pkg-manifest/read-package-json/tsconfig.json +++ b/pkg-manifest/read-package-json/tsconfig.json @@ -15,5 +15,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/pkg-manifest/read-project-manifest/src/index.ts b/pkg-manifest/read-project-manifest/src/index.ts index 5ecab2090..bbfab19ff 100644 --- a/pkg-manifest/read-project-manifest/src/index.ts +++ b/pkg-manifest/read-project-manifest/src/index.ts @@ -105,6 +105,7 @@ export async function tryReadProjectManifest (projectDir: string): Promise<{ } if ((s != null) && !s.isDirectory()) { const err = new Error(`"${projectDir}" is not a directory`) + // @ts-expect-error err['code'] = 'ENOTDIR' throw err } @@ -214,13 +215,13 @@ const dependencyKeys = new Set([ function normalize (manifest: ProjectManifest) { manifest = JSON.parse(JSON.stringify(manifest)) - const result = {} + const result: Record = {} // eslint-disable-line @typescript-eslint/no-explicit-any - for (const key of Object.keys(manifest)) { + for (const [key, value] of Object.entries(manifest)) { if (!dependencyKeys.has(key)) { - result[key] = manifest[key] - } else if (Object.keys(manifest[key]).length !== 0) { - result[key] = sortKeys(manifest[key]) + result[key] = value + } else if (Object.keys(value).length !== 0) { + result[key] = sortKeys(value) } } diff --git a/pkg-manifest/read-project-manifest/test/index.ts b/pkg-manifest/read-project-manifest/test/index.ts index bba57a545..1f4959d29 100644 --- a/pkg-manifest/read-project-manifest/test/index.ts +++ b/pkg-manifest/read-project-manifest/test/index.ts @@ -129,7 +129,7 @@ test('do not save manifest if it had no changes', async () => { }) test('fail on invalid JSON', async () => { - let err!: Error + let err!: Error & { code: string } try { await readProjectManifest(path.join(fixtures, 'invalid-package-json')) } catch (_err: any) { // eslint-disable-line @@ -137,7 +137,7 @@ test('fail on invalid JSON', async () => { } expect(err).toBeTruthy() - expect(err['code']).toBe('ERR_PNPM_JSON_PARSE') + expect(err.code).toBe('ERR_PNPM_JSON_PARSE') const nodeMajorVersion = parseInt(process.version.slice(1).split('.')[0]) const expectedMessage = nodeMajorVersion >= 19 @@ -147,7 +147,7 @@ test('fail on invalid JSON', async () => { }) test('fail on invalid JSON5', async () => { - let err!: Error + let err!: Error & { code: string } try { await readProjectManifest(path.join(fixtures, 'invalid-package-json5')) } catch (_err: any) { // eslint-disable-line @@ -155,12 +155,12 @@ test('fail on invalid JSON5', async () => { } expect(err).toBeTruthy() - expect(err['code']).toBe('ERR_PNPM_JSON5_PARSE') + expect(err.code).toBe('ERR_PNPM_JSON5_PARSE') expect(err.message).toMatch(/^JSON5: invalid character 'v' at 3:3 in/) }) test('fail on invalid YAML', async () => { - let err!: Error + let err!: Error & { code: string } try { await readProjectManifest(path.join(fixtures, 'invalid-package-yaml')) } catch (_err: any) { // eslint-disable-line @@ -168,7 +168,7 @@ test('fail on invalid YAML', async () => { } expect(err).toBeTruthy() - expect(err['code']).toBe('ERR_PNPM_YAML_PARSE') + expect(err.code).toBe('ERR_PNPM_YAML_PARSE') expect(err.message).toMatch(/^missed comma between flow collection entries \(3:3\)/) }) diff --git a/pkg-manifest/read-project-manifest/tsconfig.json b/pkg-manifest/read-project-manifest/tsconfig.json index cd3c5ef95..b74964c52 100644 --- a/pkg-manifest/read-project-manifest/tsconfig.json +++ b/pkg-manifest/read-project-manifest/tsconfig.json @@ -24,5 +24,6 @@ { "path": "../write-project-manifest" } - ] + ], + "composite": true } diff --git a/pkg-manifest/write-project-manifest/tsconfig.json b/pkg-manifest/write-project-manifest/tsconfig.json index 2692318a4..ef94b029c 100644 --- a/pkg-manifest/write-project-manifest/tsconfig.json +++ b/pkg-manifest/write-project-manifest/tsconfig.json @@ -15,5 +15,6 @@ { "path": "../../text/comments-parser" } - ] + ], + "composite": true } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4555d2216..0b7bcf91e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -80,8 +80,8 @@ importers: specifier: ^7.0.3 version: 7.0.3 eslint: - specifier: ^8.31.0 - version: 8.31.0 + specifier: ^8.32.0 + version: 8.32.0 husky: specifier: ^8.0.3 version: 8.0.3 @@ -241,28 +241,28 @@ importers: dependencies: '@typescript-eslint/eslint-plugin': specifier: ^5.48.1 - version: 5.48.1(@typescript-eslint/parser@5.48.1)(eslint@8.31.0)(typescript@4.9.4) + version: 5.48.1(@typescript-eslint/parser@5.48.1)(eslint@8.32.0)(typescript@4.9.4) '@typescript-eslint/parser': specifier: ^5.48.1 - version: 5.48.1(eslint@8.31.0)(typescript@4.9.4) + version: 5.48.1(eslint@8.32.0)(typescript@4.9.4) eslint: - specifier: ^8.31.0 - version: 8.31.0 + specifier: ^8.32.0 + version: 8.32.0 eslint-config-standard-with-typescript: specifier: ^26.0.0 - version: 26.0.0(@typescript-eslint/eslint-plugin@5.48.1)(eslint-plugin-import@2.26.0)(eslint-plugin-n@15.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.31.0)(typescript@4.9.4) + version: 26.0.0(@typescript-eslint/eslint-plugin@5.48.1)(eslint-plugin-import@2.26.0)(eslint-plugin-n@15.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.32.0)(typescript@4.9.4) eslint-plugin-import: specifier: ^2.26.0 - version: 2.26.0(@typescript-eslint/parser@5.48.1)(eslint@8.31.0) + version: 2.26.0(@typescript-eslint/parser@5.48.1)(eslint@8.32.0) eslint-plugin-n: specifier: ^15.6.0 - version: 15.6.0(eslint@8.31.0) + version: 15.6.0(eslint@8.32.0) eslint-plugin-node: specifier: ^11.1.0 - version: 11.1.0(eslint@8.31.0) + version: 11.1.0(eslint@8.32.0) eslint-plugin-promise: specifier: ^6.1.1 - version: 6.1.1(eslint@8.31.0) + version: 6.1.1(eslint@8.32.0) typescript: specifier: 4.9.4 version: 4.9.4 @@ -7300,25 +7300,24 @@ packages: dev: false optional: true - /@pnpm/build-modules@10.1.1(@pnpm/logger@5.0.0)(typanion@3.12.1): - resolution: {integrity: sha512-3C2URIbbRrsm6aTxnYtqFDfAfrK0bUtZz7q6vQGxNpNTLdd/MBP/5cPAxfKfqmrbqh1gQiHrPKrPdw+z30DNlw==} + /@pnpm/build-modules@10.1.2(@pnpm/logger@5.0.0)(typanion@3.12.1): + resolution: {integrity: sha512-E/G1oPSWe5OsuIAQ6EVaMM/YUz6V5bq7+VNER10ROJXJqoCZOsfKcUyvZOAp8983Rt5Rv06UQgcxLhhjmNzxKw==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: '@pnpm/calc-dep-state': 3.0.2 '@pnpm/core-loggers': 8.0.3(@pnpm/logger@5.0.0) - '@pnpm/error': 4.0.1 '@pnpm/fs.hard-link-dir': 1.0.0 '@pnpm/graph-sequencer': 1.0.0 '@pnpm/lifecycle': 14.1.5(@pnpm/logger@5.0.0)(typanion@3.12.1) - '@pnpm/link-bins': 8.0.6(@pnpm/logger@5.0.0) + '@pnpm/link-bins': 8.0.7(@pnpm/logger@5.0.0) '@pnpm/logger': 5.0.0 + '@pnpm/patching.apply-patch': 1.0.0 '@pnpm/read-package-json': 7.0.5 '@pnpm/store-controller-types': 14.3.0 '@pnpm/types': 8.10.0 p-defer: 3.0.0 - patch-package: 6.5.1 ramda: /@pnpm/ramda@0.28.1 run-groups: 3.0.1 transitivePeerDependencies: @@ -7331,8 +7330,8 @@ packages: resolution: {integrity: sha512-61tmh+k7hnKK6b2XbF4GvxmiaF3l2a+xQlZyeoOGBs7mXU3Ie8iCAeAnM0+r70KiqTrgWvBCjMeM+W3JarJqaQ==} engines: {node: '>=12.17'} - /@pnpm/cafs@5.0.5: - resolution: {integrity: sha512-EhsqZFWqxgdG4HJty2lJEN4Zg0Y9q2KiEAdmUSL9z5M3blkncMgPwQgBy1D5qtBM79dW/DcuxC9AxEwWYAYyjQ==} + /@pnpm/cafs@5.0.6: + resolution: {integrity: sha512-kBEVgjRkvv1RxX6NpouXZ3bv6noJRSpsyN5B1TjH2EesTe1kTD5z8MzjcbrmnT7sfVSfooDuQ4GAD7vU76gxPg==} engines: {node: '>=14.6'} dependencies: '@pnpm/fetcher-base': 13.1.5 @@ -7345,7 +7344,7 @@ packages: p-limit: 3.1.0 path-temp: 2.0.0 rename-overwrite: 4.0.3 - ssri: 10.0.0 + ssri: 10.0.1 strip-bom: 4.0.0 tar-stream: 2.2.0 dev: true @@ -7366,15 +7365,15 @@ packages: load-json-file: 6.2.0 dev: true - /@pnpm/cli-utils@1.0.22(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1): - resolution: {integrity: sha512-B1YpW+2vlrURY0AiqDYvBRvpNOfvWIqYaAWkXfMlpoObYZymbsiRupl1OgXr1L0AJxb8TgSRsmhh9PawVIR+OQ==} + /@pnpm/cli-utils@1.0.26(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1): + resolution: {integrity: sha512-ZfaEvisXoJ5W/M9VPFiEOh/ObCPsx6k/xIr7Cz5504Q6xGQd5KFoD+RysyuIrO1vnLzvGFGQgd8qM7NbdEceKQ==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: '@pnpm/cli-meta': 4.0.3 - '@pnpm/config': 16.4.0(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) - '@pnpm/default-reporter': 11.0.22(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) + '@pnpm/config': 16.5.0(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) + '@pnpm/default-reporter': 11.0.26(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) '@pnpm/error': 4.0.1 '@pnpm/logger': 5.0.0 '@pnpm/manifest-utils': 4.1.4(@pnpm/logger@5.0.0) @@ -7402,8 +7401,8 @@ packages: resolution: {integrity: sha512-ZVPVDi1E8oeXlYqkGRtX0CkzLTwE2zt62bjWaWKaAvI8NZqHzlMvGeSNDpW+JB3+aKanYb4UETJOF1/CxGPemA==} engines: {node: '>=12.22.0'} - /@pnpm/config@16.4.0(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1): - resolution: {integrity: sha512-jNYFkbGl0fRFq8f7hz/NKYQemraoiWIBcTSdpLxjapVZs/CNSj/q9Lioq+Gbabn+5lsUFPnOGTLxI0kCQjnq5A==} + /@pnpm/config@16.5.0(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1): + resolution: {integrity: sha512-QSjAA7MaWDLeH0apu7l/NnuiRhWDORRsPTwgWuoIEikJOsPYcYhkv1Qfm8+gHzkBwRQwDSasWAYMoLVGMAuADA==} engines: {node: '>=14.6'} dependencies: '@pnpm/config.env-replace': 1.0.0 @@ -7412,7 +7411,7 @@ packages: '@pnpm/git-utils': 0.1.0 '@pnpm/matcher': 4.0.1 '@pnpm/npm-conf': 2.0.4 - '@pnpm/pnpmfile': 4.0.20(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) + '@pnpm/pnpmfile': 4.0.24(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) '@pnpm/read-project-manifest': 4.1.3 '@pnpm/types': 8.10.0 camelcase: 6.3.0 @@ -7450,47 +7449,47 @@ packages: '@pnpm/types': 8.10.0 dev: true - /@pnpm/core@7.6.0(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1): - resolution: {integrity: sha512-NqAOAZbroXST+dTpAi+Cz68O/AuqGBHRDPA5tWCm8reH1/FRMaWmbZegWj0qRnFjjJzuMwUfgIEQtykcX6uAxg==} + /@pnpm/core@7.6.4(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1): + resolution: {integrity: sha512-xzWXsuk3/P+K1rzmq9Rl+5hSsqb97akll0rLg5OBjEVCJc0UXN32c2P1AVLZaWLMmbLfAmJdOYfALox59MweJA==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: - '@pnpm/build-modules': 10.1.1(@pnpm/logger@5.0.0)(typanion@3.12.1) + '@pnpm/build-modules': 10.1.2(@pnpm/logger@5.0.0)(typanion@3.12.1) '@pnpm/calc-dep-state': 3.0.2 '@pnpm/constants': 6.2.0 '@pnpm/core-loggers': 8.0.3(@pnpm/logger@5.0.0) '@pnpm/crypto.base32-hash': 1.0.1 - '@pnpm/dependency-path': 1.1.0 + '@pnpm/dependency-path': 1.1.1 '@pnpm/error': 4.0.1 - '@pnpm/filter-lockfile': 7.0.6(@pnpm/logger@5.0.0) - '@pnpm/get-context': 8.1.0(@pnpm/logger@5.0.0) + '@pnpm/filter-lockfile': 7.0.7(@pnpm/logger@5.0.0) + '@pnpm/get-context': 8.2.0(@pnpm/logger@5.0.0) '@pnpm/graph-sequencer': 1.0.0 - '@pnpm/headless': 19.4.1(@pnpm/logger@5.0.0)(typanion@3.12.1) - '@pnpm/hoist': 7.0.9(@pnpm/logger@5.0.0) - '@pnpm/hooks.read-package-hook': 2.0.10(@yarnpkg/core@4.0.0-rc.14) + '@pnpm/headless': 19.4.5(@pnpm/logger@5.0.0)(typanion@3.12.1) + '@pnpm/hoist': 7.0.11(@pnpm/logger@5.0.0) + '@pnpm/hooks.read-package-hook': 2.0.11(@yarnpkg/core@4.0.0-rc.14) '@pnpm/lifecycle': 14.1.5(@pnpm/logger@5.0.0)(typanion@3.12.1) - '@pnpm/link-bins': 8.0.6(@pnpm/logger@5.0.0) - '@pnpm/lockfile-file': 7.0.0(@pnpm/logger@5.0.0) - '@pnpm/lockfile-to-pnp': 2.0.7(@pnpm/logger@5.0.0) - '@pnpm/lockfile-utils': 5.0.3 - '@pnpm/lockfile-walker': 6.0.5 + '@pnpm/link-bins': 8.0.7(@pnpm/logger@5.0.0) + '@pnpm/lockfile-file': 7.0.2(@pnpm/logger@5.0.0) + '@pnpm/lockfile-to-pnp': 2.0.9(@pnpm/logger@5.0.0) + '@pnpm/lockfile-utils': 5.0.4 + '@pnpm/lockfile-walker': 6.0.6 '@pnpm/logger': 5.0.0 '@pnpm/manifest-utils': 4.1.4(@pnpm/logger@5.0.0) '@pnpm/matcher': 4.0.1 - '@pnpm/modules-cleaner': 13.0.7(@pnpm/logger@5.0.0) + '@pnpm/modules-cleaner': 13.0.8(@pnpm/logger@5.0.0) '@pnpm/modules-yaml': 11.1.0 '@pnpm/normalize-registries': 4.0.3 '@pnpm/npm-package-arg': 1.0.0 - '@pnpm/package-requester': 20.1.0(@pnpm/logger@5.0.0) - '@pnpm/parse-wanted-dependency': 4.0.1 + '@pnpm/package-requester': 20.1.2(@pnpm/logger@5.0.0) + '@pnpm/parse-wanted-dependency': 4.1.0 '@pnpm/pkg-manager.direct-dep-linker': 1.0.2(@pnpm/logger@5.0.0) - '@pnpm/prune-lockfile': 4.0.21 + '@pnpm/prune-lockfile': 4.0.22 '@pnpm/read-modules-dir': 5.0.0 '@pnpm/read-package-json': 7.0.5 '@pnpm/read-project-manifest': 4.1.3 '@pnpm/remove-bins': 4.0.5(@pnpm/logger@5.0.0) - '@pnpm/resolve-dependencies': 29.2.0(@pnpm/logger@5.0.0)(typanion@3.12.1) + '@pnpm/resolve-dependencies': 29.2.2(@pnpm/logger@5.0.0)(typanion@3.12.1) '@pnpm/resolver-base': 9.1.5 '@pnpm/store-controller-types': 14.3.0 '@pnpm/symlink-dependency': 6.0.3(@pnpm/logger@5.0.0) @@ -7524,13 +7523,13 @@ packages: rfc4648: 1.5.2 dev: true - /@pnpm/default-reporter@11.0.22(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1): - resolution: {integrity: sha512-oFlVuVYTZNagUwIos5dW0o7L9Ho5N7Y0yLTHkEQ3QjSRCSrYQQRGDP/F/R59dpKQyHtmxB94O4l0YYwUCerrXg==} + /@pnpm/default-reporter@11.0.26(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1): + resolution: {integrity: sha512-NT/GBvp7Erc/lGUFjWC4+siAzpMQsAd33/eQ9OtMD9XnOilZujM1/iH98UZ/b2JN/tv9YWhma5ze7Bik9NiwaQ==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: - '@pnpm/config': 16.4.0(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) + '@pnpm/config': 16.5.0(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) '@pnpm/core-loggers': 8.0.3(@pnpm/logger@5.0.0) '@pnpm/error': 4.0.1 '@pnpm/logger': 5.0.0 @@ -7557,8 +7556,8 @@ packages: - typanion dev: true - /@pnpm/dependency-path@1.1.0: - resolution: {integrity: sha512-pLuG5zz3kjrTaWmQ79DxCSKhWAwhCjMRUa2A3vikDZKtzk+WAnvR5eLW6Op1SSAFNLwtqWRPaRpPXjHboWfGkw==} + /@pnpm/dependency-path@1.1.1: + resolution: {integrity: sha512-DISm2k/SfSTRu8zTzu8u4dg4be3rlcOq5pP12pW3fhaB4ILdPg/cTyDiX725MjxswSCgh1wMO11812cRxkNDIQ==} engines: {node: '>=14.6'} dependencies: '@pnpm/crypto.base32-hash': 1.0.1 @@ -7614,18 +7613,18 @@ packages: - domexception dev: true - /@pnpm/filter-lockfile@7.0.6(@pnpm/logger@5.0.0): - resolution: {integrity: sha512-vmPC/DHEjn9NyttG1yyDmAluuwDtItQeqwVmcDIUm8AMZ//1U2qTKr4ShRuXJT6+i9h+GPFE8PtPtE+AAaf/IA==} + /@pnpm/filter-lockfile@7.0.7(@pnpm/logger@5.0.0): + resolution: {integrity: sha512-8+tgLiz58p+MzrgzVmVdudpfezgHKHU7PrMr3kbdKnMbjGDZxpsQKTLUV2Wpxl/RcmZfuVfb+j0RrK7XoHNAow==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: '@pnpm/constants': 6.2.0 - '@pnpm/dependency-path': 1.1.0 + '@pnpm/dependency-path': 1.1.1 '@pnpm/error': 4.0.1 '@pnpm/lockfile-types': 4.3.6 - '@pnpm/lockfile-utils': 5.0.3 - '@pnpm/lockfile-walker': 6.0.5 + '@pnpm/lockfile-utils': 5.0.4 + '@pnpm/lockfile-walker': 6.0.6 '@pnpm/logger': 5.0.0 '@pnpm/package-is-installable': 7.0.4(@pnpm/logger@5.0.0) '@pnpm/types': 8.10.0 @@ -7640,11 +7639,11 @@ packages: find-up: 5.0.0 dev: true - /@pnpm/find-workspace-packages@5.0.22(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1): - resolution: {integrity: sha512-FtClFNLoGKcO62OPhc4noTvOLDzRDenQ0v/4VKnDpQeUFkUDDsXqwr4DM7j31NxU6YbmHU5dvmHjiaZecHfmjg==} + /@pnpm/find-workspace-packages@5.0.26(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1): + resolution: {integrity: sha512-x4vJMHGLUO6ui8x7XWEwCAAKR0IV/PXbP6N0bCY30xUgcTy/3E3bv+hgm4cLAWRU5o/ORuMAoe8xjkHc+iuwZw==} engines: {node: '>=14.6'} dependencies: - '@pnpm/cli-utils': 1.0.22(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) + '@pnpm/cli-utils': 1.0.26(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) '@pnpm/constants': 6.2.0 '@pnpm/fs.find-packages': 1.0.2 '@pnpm/types': 8.10.0 @@ -7675,8 +7674,8 @@ packages: engines: {node: '>=14.6'} dev: true - /@pnpm/get-context@8.1.0(@pnpm/logger@5.0.0): - resolution: {integrity: sha512-4WU19KT2ajdWgedo/QrIPPT2ZUw7r+i0hhqa+3Dqq812wgAXg+HaZCeLON/M3xxziMVPg/Puf1UcxiI9FiEl0A==} + /@pnpm/get-context@8.2.0(@pnpm/logger@5.0.0): + resolution: {integrity: sha512-nXOMlkvd0HHB2sGQq06ktGhPTxBrR3II3O/9Sd7yfzNzLsHO61zxke+l0ldoQEPf3evbBYq2XETc6Iq7EPH6LQ==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 @@ -7684,10 +7683,10 @@ packages: '@pnpm/constants': 6.2.0 '@pnpm/core-loggers': 8.0.3(@pnpm/logger@5.0.0) '@pnpm/error': 4.0.1 - '@pnpm/lockfile-file': 7.0.0(@pnpm/logger@5.0.0) + '@pnpm/lockfile-file': 7.0.2(@pnpm/logger@5.0.0) '@pnpm/logger': 5.0.0 '@pnpm/modules-yaml': 11.1.0 - '@pnpm/read-projects-context': 7.0.6(@pnpm/logger@5.0.0) + '@pnpm/read-projects-context': 7.0.8(@pnpm/logger@5.0.0) '@pnpm/types': 8.10.0 '@zkochan/rimraf': 2.1.2 ci-info: 3.7.1 @@ -7712,34 +7711,34 @@ packages: /@pnpm/graph-sequencer@1.0.0: resolution: {integrity: sha512-iIJhmi7QjmafhijaEkh34Yxhjq3S/eiZnxww9K/SRXuDB5/30QnCyihR4R7vep8ONsGIR29hNPAtaNGd1rC/VA==} - /@pnpm/headless@19.4.1(@pnpm/logger@5.0.0)(typanion@3.12.1): - resolution: {integrity: sha512-ptkqzNaC+6qV4y5KLJLRQlCypeFnGM3AIppSHrA2kgz0hSpuwuK4mUnSshnULK6vFELYUgwhyrwOLamLxcTxEw==} + /@pnpm/headless@19.4.5(@pnpm/logger@5.0.0)(typanion@3.12.1): + resolution: {integrity: sha512-3Enq7+tU+KbtKaNxOPcM2aYBqi3IHG8Z+PDMKonksS4DREQmjzqK4lXh3ZvjzZta+sJBeyX5H1wbRR97CYD/ig==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: - '@pnpm/build-modules': 10.1.1(@pnpm/logger@5.0.0)(typanion@3.12.1) + '@pnpm/build-modules': 10.1.2(@pnpm/logger@5.0.0)(typanion@3.12.1) '@pnpm/calc-dep-state': 3.0.2 '@pnpm/constants': 6.2.0 '@pnpm/core-loggers': 8.0.3(@pnpm/logger@5.0.0) - '@pnpm/dependency-path': 1.1.0 + '@pnpm/dependency-path': 1.1.1 '@pnpm/error': 4.0.1 - '@pnpm/filter-lockfile': 7.0.6(@pnpm/logger@5.0.0) - '@pnpm/hoist': 7.0.9(@pnpm/logger@5.0.0) + '@pnpm/filter-lockfile': 7.0.7(@pnpm/logger@5.0.0) + '@pnpm/hoist': 7.0.11(@pnpm/logger@5.0.0) '@pnpm/lifecycle': 14.1.5(@pnpm/logger@5.0.0)(typanion@3.12.1) - '@pnpm/link-bins': 8.0.6(@pnpm/logger@5.0.0) - '@pnpm/lockfile-file': 7.0.0(@pnpm/logger@5.0.0) - '@pnpm/lockfile-to-pnp': 2.0.7(@pnpm/logger@5.0.0) - '@pnpm/lockfile-utils': 5.0.3 + '@pnpm/link-bins': 8.0.7(@pnpm/logger@5.0.0) + '@pnpm/lockfile-file': 7.0.2(@pnpm/logger@5.0.0) + '@pnpm/lockfile-to-pnp': 2.0.9(@pnpm/logger@5.0.0) + '@pnpm/lockfile-utils': 5.0.4 '@pnpm/logger': 5.0.0 - '@pnpm/modules-cleaner': 13.0.7(@pnpm/logger@5.0.0) + '@pnpm/modules-cleaner': 13.0.8(@pnpm/logger@5.0.0) '@pnpm/modules-yaml': 11.1.0 '@pnpm/package-is-installable': 7.0.4(@pnpm/logger@5.0.0) - '@pnpm/package-requester': 20.1.0(@pnpm/logger@5.0.0) + '@pnpm/package-requester': 20.1.2(@pnpm/logger@5.0.0) '@pnpm/pkg-manager.direct-dep-linker': 1.0.2(@pnpm/logger@5.0.0) '@pnpm/read-package-json': 7.0.5 '@pnpm/read-project-manifest': 4.1.3 - '@pnpm/real-hoist': 1.1.2(typanion@3.12.1) + '@pnpm/real-hoist': 1.1.3(typanion@3.12.1) '@pnpm/store-controller-types': 14.3.0 '@pnpm/symlink-dependency': 6.0.3(@pnpm/logger@5.0.0) '@pnpm/types': 8.10.0 @@ -7755,19 +7754,19 @@ packages: - typanion dev: true - /@pnpm/hoist@7.0.9(@pnpm/logger@5.0.0): - resolution: {integrity: sha512-LulMuje/EEMZgcBALs5oEXX40B6iE0U2Y7aOf/Y4OdG1xr6CNg5ELzJUrjdaCrfAXTHS0QIzfhDvDVsQYryrCA==} + /@pnpm/hoist@7.0.11(@pnpm/logger@5.0.0): + resolution: {integrity: sha512-7PH7Z2aIRjnxgH/7L40Ow3ycsfgqoYeXsfnsvxNvJYwcTD9OqkbuJPYafJXTJ/cBb2ILX0hkS830fAtiNj9c9Q==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: '@pnpm/constants': 6.2.0 '@pnpm/core-loggers': 8.0.3(@pnpm/logger@5.0.0) - '@pnpm/dependency-path': 1.1.0 - '@pnpm/link-bins': 8.0.6(@pnpm/logger@5.0.0) + '@pnpm/dependency-path': 1.1.1 + '@pnpm/link-bins': 8.0.7(@pnpm/logger@5.0.0) '@pnpm/lockfile-types': 4.3.6 - '@pnpm/lockfile-utils': 5.0.3 - '@pnpm/lockfile-walker': 6.0.5 + '@pnpm/lockfile-utils': 5.0.4 + '@pnpm/lockfile-walker': 6.0.6 '@pnpm/logger': 5.0.0 '@pnpm/matcher': 4.0.1 '@pnpm/types': 8.10.0 @@ -7778,13 +7777,13 @@ packages: symlink-dir: 5.1.0 dev: true - /@pnpm/hooks.read-package-hook@2.0.10(@yarnpkg/core@4.0.0-rc.14): - resolution: {integrity: sha512-QIvzoEt1oiKudCircMNcMZcOUnurpvcvvIO7977CZQl+zXgvg0G62IJChG4W557WNqVUC7GiVtniTg56HkQ7dA==} + /@pnpm/hooks.read-package-hook@2.0.11(@yarnpkg/core@4.0.0-rc.14): + resolution: {integrity: sha512-Z8C0iS3/O7WsOnO+I6eNZ+fTCMgcc2T60dogIlrp7f6ILdB31sSBgRU7yR4sLhPm4siUoSFY5uaDe38AcGattQ==} engines: {node: '>=14.6'} dependencies: '@pnpm/matcher': 4.0.1 - '@pnpm/parse-overrides': 3.0.2 - '@pnpm/parse-wanted-dependency': 4.0.1 + '@pnpm/parse-overrides': 3.0.3 + '@pnpm/parse-wanted-dependency': 4.1.0 '@pnpm/types': 8.10.0 '@yarnpkg/extensions': 2.0.0-rc.9(@yarnpkg/core@4.0.0-rc.14) normalize-path: 3.0.0 @@ -7816,8 +7815,8 @@ packages: - typanion dev: true - /@pnpm/link-bins@8.0.6(@pnpm/logger@5.0.0): - resolution: {integrity: sha512-lr8XapUNi2ascimmgMgvH6guCm2T46c8xAmoOujeuCluvbBxav/Y2kE3KpYzx+4+GtJrXnxgEzo9zgDYa+NwDw==} + /@pnpm/link-bins@8.0.7(@pnpm/logger@5.0.0): + resolution: {integrity: sha512-huOg+nWHJiUBXOiPy4W2+UB0LoG6VtuV/oQOLDW5km5Aatpse4jyI2ysAMe6LXAb9e/cfbRU8NFgqUe20/i3MA==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 @@ -7830,7 +7829,7 @@ packages: '@pnpm/read-package-json': 7.0.5 '@pnpm/read-project-manifest': 4.1.3 '@pnpm/types': 8.10.0 - '@zkochan/cmd-shim': 5.4.1 + '@zkochan/cmd-shim': 5.4.0 '@zkochan/rimraf': 2.1.2 bin-links: 4.0.1 is-subdir: 1.2.0 @@ -7841,14 +7840,14 @@ packages: symlink-dir: 5.1.0 dev: true - /@pnpm/lockfile-file@7.0.0(@pnpm/logger@5.0.0): - resolution: {integrity: sha512-DTHZnWdnApk6noPyzQsFwlBI/sM0BVC34LWxs6CuRElIXKFfQtM488MuZ8I32fte7gBfljgP1oRVyPRNXR4a6w==} + /@pnpm/lockfile-file@7.0.2(@pnpm/logger@5.0.0): + resolution: {integrity: sha512-SXWjBO1Fz3VG1QgwN1kdGOiEfS1ESxzzsy9nMJ933SOdKwn1nYe+ztpyJPqMg84+cjpAj+LacYDToTPVja+b6Q==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: '@pnpm/constants': 6.2.0 - '@pnpm/dependency-path': 1.1.0 + '@pnpm/dependency-path': 1.1.1 '@pnpm/error': 4.0.1 '@pnpm/git-utils': 0.1.0 '@pnpm/lockfile-types': 4.3.6 @@ -7867,15 +7866,15 @@ packages: write-file-atomic: 5.0.0 dev: true - /@pnpm/lockfile-to-pnp@2.0.7(@pnpm/logger@5.0.0): - resolution: {integrity: sha512-552r+rYpVoyx6AvpTL4WGdHqR4JM11Dr16+vKiaRT0DaYW6uYlQkfHEuRN84genEkGmMaXeT1sVlKgWGb21uLA==} + /@pnpm/lockfile-to-pnp@2.0.9(@pnpm/logger@5.0.0): + resolution: {integrity: sha512-4RMtcINGQsvOPVo3O8PiK9Zboa86Er9dj1ffuy15YF/GaDkk6usP6duuOS8l3rX8Y7IAil3DDyacP0lvkmHtzA==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: - '@pnpm/dependency-path': 1.1.0 - '@pnpm/lockfile-file': 7.0.0(@pnpm/logger@5.0.0) - '@pnpm/lockfile-utils': 5.0.3 + '@pnpm/dependency-path': 1.1.1 + '@pnpm/lockfile-file': 7.0.2(@pnpm/logger@5.0.0) + '@pnpm/lockfile-utils': 5.0.4 '@pnpm/logger': 5.0.0 '@pnpm/types': 8.10.0 '@yarnpkg/pnp': 2.3.2 @@ -7890,11 +7889,11 @@ packages: '@pnpm/types': 8.10.0 dev: true - /@pnpm/lockfile-utils@5.0.3: - resolution: {integrity: sha512-G7fpUdcUY7tumRrGiDcpdKambj9ZQgnOkYWgri4E8j/SBxToXCg9ZiCOpaOSkzkyCuqe8WhYNCQvwg+fhU+BaA==} + /@pnpm/lockfile-utils@5.0.4: + resolution: {integrity: sha512-6KpzAFZFp411ln6SMgXXrQcznRXG0OYE7jEGovk1Y6Edywu2judFcac+4LU0eAMP0Fn+53rvLCOf3SFHfKxDgQ==} engines: {node: '>=14.6'} dependencies: - '@pnpm/dependency-path': 1.1.0 + '@pnpm/dependency-path': 1.1.1 '@pnpm/lockfile-types': 4.3.6 '@pnpm/resolver-base': 9.1.5 '@pnpm/types': 8.10.0 @@ -7902,11 +7901,11 @@ packages: ramda: /@pnpm/ramda@0.28.1 dev: true - /@pnpm/lockfile-walker@6.0.5: - resolution: {integrity: sha512-y1VkOBxnMcBnHOnhEppFy9Qni3QkMBYPlJCMEu/zKXjLouMnlvZWTl2NcKkGI+Svw3W8EfCmWZ1tC4W3V2Y24Q==} + /@pnpm/lockfile-walker@6.0.6: + resolution: {integrity: sha512-fhtk4wKC8aEpuN33zH3XMqDfICMw2aCLaqQktXnhjmVuv1TogWSeDYJ8CV4dyHVHgqv3Ity1ucDq9fxkAIpwwQ==} engines: {node: '>=14.6'} dependencies: - '@pnpm/dependency-path': 1.1.0 + '@pnpm/dependency-path': 1.1.1 '@pnpm/lockfile-types': 4.3.6 '@pnpm/types': 8.10.0 ramda: /@pnpm/ramda@0.28.1 @@ -7953,7 +7952,7 @@ packages: hasBin: true dependencies: '@pnpm/find-workspace-dir': 5.0.1 - '@pnpm/find-workspace-packages': 5.0.22(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) + '@pnpm/find-workspace-packages': 5.0.26(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) '@pnpm/logger': 5.0.0 '@pnpm/types': 8.10.0 '@yarnpkg/core': 4.0.0-rc.14(typanion@3.12.1) @@ -7969,17 +7968,17 @@ packages: - typanion dev: true - /@pnpm/modules-cleaner@13.0.7(@pnpm/logger@5.0.0): - resolution: {integrity: sha512-zDKF0fj3gcNI3yxDrh9CdgtJEcTB3T9+DTWD/xZN8tiY3ymwZNxCobBPpQIjo5d3bz6s9yX4URXciP4KlDJwCA==} + /@pnpm/modules-cleaner@13.0.8(@pnpm/logger@5.0.0): + resolution: {integrity: sha512-BAAR7Qe0TFFz5awzUbh+uZMctGoaumbQ7AFeZtX3A4k9QL6hAcloonOHsTny5kdzu/OePBfMl1kGJJjwFB3fhQ==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: '@pnpm/core-loggers': 8.0.3(@pnpm/logger@5.0.0) - '@pnpm/dependency-path': 1.1.0 - '@pnpm/filter-lockfile': 7.0.6(@pnpm/logger@5.0.0) + '@pnpm/dependency-path': 1.1.1 + '@pnpm/filter-lockfile': 7.0.7(@pnpm/logger@5.0.0) '@pnpm/lockfile-types': 4.3.6 - '@pnpm/lockfile-utils': 5.0.3 + '@pnpm/lockfile-utils': 5.0.4 '@pnpm/logger': 5.0.0 '@pnpm/read-modules-dir': 5.0.0 '@pnpm/remove-bins': 4.0.5(@pnpm/logger@5.0.0) @@ -8079,8 +8078,8 @@ packages: semver: 7.3.8 validate-npm-package-name: 4.0.0 - /@pnpm/npm-resolver@15.0.5(@pnpm/logger@5.0.0): - resolution: {integrity: sha512-6ChzNsViHTr3rcJ3sa8zgYnUNNu5m5w8GhUVLmkqhVSLUlh2h33oLd3IF3LVJgS4YW7VMQmpHkdBm/IqTH2qRg==} + /@pnpm/npm-resolver@15.0.6(@pnpm/logger@5.0.0): + resolution: {integrity: sha512-EIhV7u28MaPJQwVVxC+moDIjbC1OoVkyEsFEG1DrENQDU2R0EgdMAmOHwyf5Ou/+tN2qrBHy1zYpqBMXP2BV6w==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 @@ -8105,7 +8104,7 @@ packages: ramda: /@pnpm/ramda@0.28.1 rename-overwrite: 4.0.3 semver: 7.3.8 - ssri: 10.0.0 + ssri: 10.0.1 version-selector-type: 3.0.0 transitivePeerDependencies: - domexception @@ -8160,15 +8159,15 @@ packages: semver: 7.3.8 dev: true - /@pnpm/package-requester@20.1.0(@pnpm/logger@5.0.0): - resolution: {integrity: sha512-cUeloUc35tghqSmZP1UIjtcDnQ7k5dqD6TeJGxr4yW+w/Zr0ptVznC8ZxUY3KQNtVXF4Vxpg8v4zz5Lvfqgu4A==} + /@pnpm/package-requester@20.1.2(@pnpm/logger@5.0.0): + resolution: {integrity: sha512-KDRYIZdBsbsF/zI/dBv9ZAp2dYaCbVan9Ziew/yb2ppOOXUBzOPEJNNwc8Vs1Y8UeQxE4QSuQrTq8HfPUzZ+mw==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: - '@pnpm/cafs': 5.0.5 + '@pnpm/cafs': 5.0.6 '@pnpm/core-loggers': 8.0.3(@pnpm/logger@5.0.0) - '@pnpm/dependency-path': 1.1.0 + '@pnpm/dependency-path': 1.1.1 '@pnpm/error': 4.0.1 '@pnpm/fetcher-base': 13.1.5 '@pnpm/graceful-fs': 2.0.0 @@ -8190,24 +8189,32 @@ packages: rename-overwrite: 4.0.3 safe-promise-defer: 1.0.1 semver: 7.3.8 - ssri: 10.0.0 + ssri: 10.0.1 dev: true - /@pnpm/parse-overrides@3.0.2: - resolution: {integrity: sha512-GhA9kMrf9hGtUK7uVU61NFFFfVYjPEUr9Zb0TY7ga9wNysQg7yWyxfQxkYjxnCmjUYMyU5m2J3ONs2zVwj+6lw==} + /@pnpm/parse-overrides@3.0.3: + resolution: {integrity: sha512-8w/idmFAcEoKC5z0WOLppTUxviTsbXHZBHtPjjEUGKyt5ZkHg2MvqycKI4tUpqVDclpu04U78tcRzFz7PjAgLQ==} engines: {node: '>=14.6'} dependencies: '@pnpm/error': 4.0.1 - '@pnpm/parse-wanted-dependency': 4.0.1 + '@pnpm/parse-wanted-dependency': 4.1.0 dev: true - /@pnpm/parse-wanted-dependency@4.0.1: - resolution: {integrity: sha512-+d3VQvVtATYD9i1YpD9YBqIjCk6kPvdXS+Za/JGxegOnsVyHGwgY/E4CkCblTOeaqXVtH4U8Te+H/UMt0ATVIw==} + /@pnpm/parse-wanted-dependency@4.1.0: + resolution: {integrity: sha512-sbnsQE5gucVzBrl6QX2/cMwY8f+WpeX8ryK5dpwMpYgqwMBB5UR4KbGhveTnRrJPGs9NarPzY4RnxQdsteTXLA==} engines: {node: '>=14.6'} dependencies: validate-npm-package-name: 5.0.0 dev: true + /@pnpm/patching.apply-patch@1.0.0: + resolution: {integrity: sha512-wu44YGD7K+AnV9qR3b6nsc4OCzlSr80jn1+C6OtFC4ZYZASo5kZPUHoKW265V+jYgw0KttsUCr9V6+QUZjc0QA==} + engines: {node: '>=14.6'} + dependencies: + '@pnpm/error': 4.0.1 + patch-package: 6.5.1 + dev: true + /@pnpm/pick-fetcher@1.0.0: resolution: {integrity: sha512-hPXczLGghmqUpFgBXIfhq9Wtvn3QRYoygL1jhBIo8sWgmp0bf8wmDWxQ17Fc2G7GNUcDrPHOXrhivWpKR63EIg==} engines: {node: '>=14.6'} @@ -8235,13 +8242,13 @@ packages: resolve-link-target: 2.0.0 dev: true - /@pnpm/pnpmfile@4.0.20(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1): - resolution: {integrity: sha512-4kbntLPX2P6lS7KSfeUAr4DJO8D4M6naqqD1M6P0Lq56+omg3sHkNO7aIIA8covFIxBdzxfzlRph/Tp/uGvxkw==} + /@pnpm/pnpmfile@4.0.24(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1): + resolution: {integrity: sha512-HViee0EovmDkulWcE+C5mBaYzrbSFA+F9gzEoESWfwKNFylVPONO8imwy0G6Kjmjwg63yrMlMHCGcPqg5p4/+w==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: - '@pnpm/core': 7.6.0(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) + '@pnpm/core': 7.6.4(@pnpm/logger@5.0.0)(@yarnpkg/core@4.0.0-rc.14)(typanion@3.12.1) '@pnpm/core-loggers': 8.0.3(@pnpm/logger@5.0.0) '@pnpm/error': 4.0.1 '@pnpm/lockfile-types': 4.3.6 @@ -8258,12 +8265,12 @@ packages: - typanion dev: true - /@pnpm/prune-lockfile@4.0.21: - resolution: {integrity: sha512-Wm5GvLN+Oxj5qRRFR2Eo8jD/hX00noVZCU6tAAzF9XIh5kn+dIEGKKFfd24bIWYQTdM6epqnMpR6wgHDFVi9fQ==} + /@pnpm/prune-lockfile@4.0.22: + resolution: {integrity: sha512-/ut6KeMShLWtcjAMmz1tFj6bFaKncasPUtlxE+s+JFoba9JEOdnvkvlmaO4U7Cn5vWFkVfsvUJbmBXvWzDGnuw==} engines: {node: '>=14.6'} dependencies: '@pnpm/constants': 6.2.0 - '@pnpm/dependency-path': 1.1.0 + '@pnpm/dependency-path': 1.1.1 '@pnpm/lockfile-types': 4.3.6 '@pnpm/types': 8.10.0 ramda: /@pnpm/ramda@0.28.1 @@ -8308,13 +8315,13 @@ packages: strip-bom: 4.0.0 dev: true - /@pnpm/read-projects-context@7.0.6(@pnpm/logger@5.0.0): - resolution: {integrity: sha512-CStyWvHwYwFxuSC82P8nGmtHFPNukjU5gfRWA/pGQpXGTJN+a16wFRcpOEm5TMjv/cQBCQjiA86pwjAgPD83yg==} + /@pnpm/read-projects-context@7.0.8(@pnpm/logger@5.0.0): + resolution: {integrity: sha512-3auSQj5NIdYL/UPotVH0OzYa2NKvem+DcUzlhtz8FSjNhkS8oEizk+nx5C/KslWXPJHSN0+otukQcpQV09SFXA==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: - '@pnpm/lockfile-file': 7.0.0(@pnpm/logger@5.0.0) + '@pnpm/lockfile-file': 7.0.2(@pnpm/logger@5.0.0) '@pnpm/logger': 5.0.0 '@pnpm/modules-yaml': 11.1.0 '@pnpm/normalize-registries': 4.0.3 @@ -8322,13 +8329,13 @@ packages: realpath-missing: 1.1.0 dev: true - /@pnpm/real-hoist@1.1.2(typanion@3.12.1): - resolution: {integrity: sha512-APl7/Fc/qQ7oKWpnpckldtM+C44HeYNlH9597k7RciPNGM6buDf9VxAhikCvizGZjt+kY8CulfpdqGxrvWPm3Q==} + /@pnpm/real-hoist@1.1.3(typanion@3.12.1): + resolution: {integrity: sha512-XVqFGrI34KiBQfjcXYSllLNrd+4x09ZaChGwHJscy0WrGmHJ7CaqSHWgtSKLtF1kSC4uw3IXQ5hg9Cd29MpKjg==} engines: {node: '>=14.6'} dependencies: - '@pnpm/dependency-path': 1.1.0 + '@pnpm/dependency-path': 1.1.1 '@pnpm/error': 4.0.1 - '@pnpm/lockfile-utils': 5.0.3 + '@pnpm/lockfile-utils': 5.0.4 '@yarnpkg/nm': 4.0.0-rc.27(typanion@3.12.1) transitivePeerDependencies: - typanion @@ -8378,23 +8385,23 @@ packages: cli-columns: 4.0.0 dev: true - /@pnpm/resolve-dependencies@29.2.0(@pnpm/logger@5.0.0)(typanion@3.12.1): - resolution: {integrity: sha512-Pur3hDHZkUjz8wolFJyxb250ycGCQJy39xxQ3iQSBU4XchynYxOE1P+57LbnUQPKdvk1Y+V8jj7eRp9Tb8JVxQ==} + /@pnpm/resolve-dependencies@29.2.2(@pnpm/logger@5.0.0)(typanion@3.12.1): + resolution: {integrity: sha512-miDHMotAXBnKy3fiL91DjTt1nL1r+oyVXoU6WXZyrZVF+27rlqigVr5Co8Xsd1a17qouxWXeOr0PDYzlBm/i6g==} engines: {node: '>=14.6'} peerDependencies: '@pnpm/logger': ^5.0.0 dependencies: '@pnpm/constants': 6.2.0 '@pnpm/core-loggers': 8.0.3(@pnpm/logger@5.0.0) - '@pnpm/dependency-path': 1.1.0 + '@pnpm/dependency-path': 1.1.1 '@pnpm/error': 4.0.1 '@pnpm/lockfile-types': 4.3.6 - '@pnpm/lockfile-utils': 5.0.3 + '@pnpm/lockfile-utils': 5.0.4 '@pnpm/logger': 5.0.0 '@pnpm/manifest-utils': 4.1.4(@pnpm/logger@5.0.0) - '@pnpm/npm-resolver': 15.0.5(@pnpm/logger@5.0.0) + '@pnpm/npm-resolver': 15.0.6(@pnpm/logger@5.0.0) '@pnpm/pick-registry-for-package': 4.0.3 - '@pnpm/prune-lockfile': 4.0.21 + '@pnpm/prune-lockfile': 4.0.22 '@pnpm/read-package-json': 7.0.5 '@pnpm/resolver-base': 9.1.5 '@pnpm/store-controller-types': 14.3.0 @@ -8935,7 +8942,7 @@ packages: resolution: {integrity: sha512-8NYnGOctzsI4W0ApsP/BIHD/LnxpJ6XaGf2AZmz4EyDYJMxtprN4279dLNI1CPZcwC9H18qYcaFv4bXi0wmokg==} dev: true - /@typescript-eslint/eslint-plugin@5.48.1(@typescript-eslint/parser@5.48.1)(eslint@8.31.0)(typescript@4.9.4): + /@typescript-eslint/eslint-plugin@5.48.1(@typescript-eslint/parser@5.48.1)(eslint@8.32.0)(typescript@4.9.4): resolution: {integrity: sha512-9nY5K1Rp2ppmpb9s9S2aBiF3xo5uExCehMDmYmmFqqyxgenbHJ3qbarcLt4ITgaD6r/2ypdlcFRdcuVPnks+fQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -8946,12 +8953,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.48.1(eslint@8.31.0)(typescript@4.9.4) + '@typescript-eslint/parser': 5.48.1(eslint@8.32.0)(typescript@4.9.4) '@typescript-eslint/scope-manager': 5.48.1 - '@typescript-eslint/type-utils': 5.48.1(eslint@8.31.0)(typescript@4.9.4) - '@typescript-eslint/utils': 5.48.1(eslint@8.31.0)(typescript@4.9.4) + '@typescript-eslint/type-utils': 5.48.1(eslint@8.32.0)(typescript@4.9.4) + '@typescript-eslint/utils': 5.48.1(eslint@8.32.0)(typescript@4.9.4) debug: 4.3.4 - eslint: 8.31.0 + eslint: 8.32.0 ignore: 5.2.4 natural-compare-lite: 1.4.0 regexpp: 3.2.0 @@ -8962,7 +8969,7 @@ packages: - supports-color dev: false - /@typescript-eslint/parser@5.48.1(eslint@8.31.0)(typescript@4.9.4): + /@typescript-eslint/parser@5.48.1(eslint@8.32.0)(typescript@4.9.4): resolution: {integrity: sha512-4yg+FJR/V1M9Xoq56SF9Iygqm+r5LMXvheo6DQ7/yUWynQ4YfCRnsKuRgqH4EQ5Ya76rVwlEpw4Xu+TgWQUcdA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -8976,7 +8983,7 @@ packages: '@typescript-eslint/types': 5.48.1 '@typescript-eslint/typescript-estree': 5.48.1(typescript@4.9.4) debug: 4.3.4 - eslint: 8.31.0 + eslint: 8.32.0 typescript: 4.9.4 transitivePeerDependencies: - supports-color @@ -8990,7 +8997,7 @@ packages: '@typescript-eslint/visitor-keys': 5.48.1 dev: false - /@typescript-eslint/type-utils@5.48.1(eslint@8.31.0)(typescript@4.9.4): + /@typescript-eslint/type-utils@5.48.1(eslint@8.32.0)(typescript@4.9.4): resolution: {integrity: sha512-Hyr8HU8Alcuva1ppmqSYtM/Gp0q4JOp1F+/JH5D1IZm/bUBrV0edoewQZiEc1r6I8L4JL21broddxK8HAcZiqQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -9001,9 +9008,9 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 5.48.1(typescript@4.9.4) - '@typescript-eslint/utils': 5.48.1(eslint@8.31.0)(typescript@4.9.4) + '@typescript-eslint/utils': 5.48.1(eslint@8.32.0)(typescript@4.9.4) debug: 4.3.4 - eslint: 8.31.0 + eslint: 8.32.0 tsutils: 3.21.0(typescript@4.9.4) typescript: 4.9.4 transitivePeerDependencies: @@ -9036,7 +9043,7 @@ packages: - supports-color dev: false - /@typescript-eslint/utils@5.48.1(eslint@8.31.0)(typescript@4.9.4): + /@typescript-eslint/utils@5.48.1(eslint@8.32.0)(typescript@4.9.4): resolution: {integrity: sha512-SmQuSrCGUOdmGMwivW14Z0Lj8dxG1mOFZ7soeJ0TQZEJcs3n5Ndgkg0A4bcMFzBELqLJ6GTHnEU+iIoaD6hFGA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -9047,9 +9054,9 @@ packages: '@typescript-eslint/scope-manager': 5.48.1 '@typescript-eslint/types': 5.48.1 '@typescript-eslint/typescript-estree': 5.48.1(typescript@4.9.4) - eslint: 8.31.0 + eslint: 8.32.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0(eslint@8.31.0) + eslint-utils: 3.0.0(eslint@8.32.0) semver: 7.3.8 transitivePeerDependencies: - supports-color @@ -9166,39 +9173,6 @@ packages: transitivePeerDependencies: - typanion - /@yarnpkg/core@4.0.0-rc.35(typanion@3.12.1): - resolution: {integrity: sha512-Z2bY4rSECV9IkDyHbJjDpKug6sO3uZmFbqDcIEpxS+wpg9DYn//5B1pVTZwyWg4EG5I6IZaUp0eoexNXb7gyJQ==} - engines: {node: '>=14.15.0'} - dependencies: - '@arcanis/slice-ansi': 1.1.1 - '@types/lodash': 4.14.181 - '@types/semver': 7.3.13 - '@types/treeify': 1.0.0 - '@yarnpkg/fslib': 3.0.0-rc.25 - '@yarnpkg/libzip': 3.0.0-rc.25(@yarnpkg/fslib@3.0.0-rc.25) - '@yarnpkg/parsers': 3.0.0-rc.35 - '@yarnpkg/shell': 4.0.0-rc.35(typanion@3.12.1) - camelcase: 5.3.1 - chalk: 3.0.0 - ci-info: 3.7.1 - clipanion: 3.2.0-rc.6(typanion@3.12.1) - cross-spawn: 7.0.3 - diff: 5.1.0 - globby: 11.1.0 - got: 11.8.6 - lodash: 4.17.21 - micromatch: 4.0.5 - p-limit: 2.3.0 - semver: 7.3.8 - strip-ansi: 6.0.1 - tar: 6.1.13 - tinylogic: 2.0.0 - treeify: 1.1.0 - tslib: 2.4.1 - tunnel: 0.0.6 - transitivePeerDependencies: - - typanion - /@yarnpkg/extensions@2.0.0-rc.9(@yarnpkg/core@4.0.0-rc.14): resolution: {integrity: sha512-WWXBCKyIhG4pkpS42erPUkxgPXt3NEjGb3ha+HlEKgSVdJThNFE9CmwSyDdfdiV3QhCDkZR2R0jQVmbrCrigRw==} engines: {node: '>=14.15.0'} @@ -9240,7 +9214,7 @@ packages: resolution: {integrity: sha512-KfoYI38XY0PjpPu+LGvRHxg3OFO+5nwbQy/c5FuLR0ipQkXcinS3JbG+de17Mf6QdKnBTcghA7mdrUKs5JbxyA==} engines: {node: '>=14.15.0'} dependencies: - '@yarnpkg/core': 4.0.0-rc.35(typanion@3.12.1) + '@yarnpkg/core': 4.0.0-rc.27(typanion@3.12.1) '@yarnpkg/fslib': 3.0.0-rc.25 '@yarnpkg/pnp': 4.0.0-rc.35 transitivePeerDependencies: @@ -9316,6 +9290,14 @@ packages: transitivePeerDependencies: - typanion + /@zkochan/cmd-shim@5.4.0: + resolution: {integrity: sha512-Ldv5OxVJNNoHgwDPkJVdTT4l31hA4YLhJxpNNx3I5C9E3xXej66w6sQTL9Q/ZNVVTLplqDxTy+UjcnPx6cxwuA==} + engines: {node: '>=10.13'} + dependencies: + cmd-extension: 1.0.2 + is-windows: 1.0.2 + dev: true + /@zkochan/cmd-shim@5.4.1: resolution: {integrity: sha512-odWb1qUzt0dIOEUPyWBEpFDYQPRjEMr/dbHHAfgBkVkYR9aO7Zo+I7oYWrXIxl+cKlC7+49ftPm8uJxL1MA9kw==} engines: {node: '>=10.13'} @@ -9323,6 +9305,7 @@ packages: cmd-extension: 1.0.2 graceful-fs: 4.2.10 is-windows: 1.0.2 + dev: false /@zkochan/diable@1.0.2: resolution: {integrity: sha512-LvXkwkWyrsRulnXVfp0BfuEQqV6I2j0l3kQwvBHKFMI6Sg5j2GrUCLsEKqYB3jlxM+0ofScvlE4vB6knevdBmg==} @@ -10954,6 +10937,44 @@ packages: unbox-primitive: 1.0.2 which-typed-array: 1.1.9 + /es-abstract@1.21.1: + resolution: {integrity: sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + es-set-tostringtag: 2.0.1 + es-to-primitive: 1.2.1 + function-bind: 1.1.1 + function.prototype.name: 1.1.5 + get-intrinsic: 1.1.3 + get-symbol-description: 1.0.0 + globalthis: 1.0.3 + gopd: 1.0.1 + has: 1.0.3 + has-property-descriptors: 1.0.0 + has-proto: 1.0.1 + has-symbols: 1.0.3 + internal-slot: 1.0.4 + is-array-buffer: 3.0.1 + is-callable: 1.2.7 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-typed-array: 1.1.10 + is-weakref: 1.0.2 + object-inspect: 1.12.3 + object-keys: 1.1.1 + object.assign: 4.1.4 + regexp.prototype.flags: 1.4.3 + safe-regex-test: 1.0.0 + string.prototype.trimend: 1.0.6 + string.prototype.trimstart: 1.0.6 + typed-array-length: 1.0.4 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.9 + /es-set-tostringtag@2.0.1: resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} engines: {node: '>= 0.4'} @@ -11069,7 +11090,7 @@ packages: source-map: 0.6.1 dev: true - /eslint-config-standard-with-typescript@26.0.0(@typescript-eslint/eslint-plugin@5.48.1)(eslint-plugin-import@2.26.0)(eslint-plugin-n@15.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.31.0)(typescript@4.9.4): + /eslint-config-standard-with-typescript@26.0.0(@typescript-eslint/eslint-plugin@5.48.1)(eslint-plugin-import@2.26.0)(eslint-plugin-n@15.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.32.0)(typescript@4.9.4): resolution: {integrity: sha512-TluIWunQo76qp4MHyYIaTT+sN2q2v/jTeE3Dj4rXsSbx27GOUEOujhJaAL3v9dHVQelAK13gZ5Jy9IWnWCyFrg==} peerDependencies: '@typescript-eslint/eslint-plugin': ^5.0.0 || ^5.6.0 @@ -11079,19 +11100,19 @@ packages: eslint-plugin-promise: ^6.0.0 typescript: '*' dependencies: - '@typescript-eslint/eslint-plugin': 5.48.1(@typescript-eslint/parser@5.48.1)(eslint@8.31.0)(typescript@4.9.4) - '@typescript-eslint/parser': 5.48.1(eslint@8.31.0)(typescript@4.9.4) - eslint: 8.31.0 - eslint-config-standard: 17.0.0(eslint-plugin-import@2.26.0)(eslint-plugin-n@15.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.31.0) - eslint-plugin-import: 2.26.0(@typescript-eslint/parser@5.48.1)(eslint@8.31.0) - eslint-plugin-n: 15.6.0(eslint@8.31.0) - eslint-plugin-promise: 6.1.1(eslint@8.31.0) + '@typescript-eslint/eslint-plugin': 5.48.1(@typescript-eslint/parser@5.48.1)(eslint@8.32.0)(typescript@4.9.4) + '@typescript-eslint/parser': 5.48.1(eslint@8.32.0)(typescript@4.9.4) + eslint: 8.32.0 + eslint-config-standard: 17.0.0(eslint-plugin-import@2.26.0)(eslint-plugin-n@15.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.32.0) + eslint-plugin-import: 2.26.0(@typescript-eslint/parser@5.48.1)(eslint@8.32.0) + eslint-plugin-n: 15.6.0(eslint@8.32.0) + eslint-plugin-promise: 6.1.1(eslint@8.32.0) typescript: 4.9.4 transitivePeerDependencies: - supports-color dev: false - /eslint-config-standard@17.0.0(eslint-plugin-import@2.26.0)(eslint-plugin-n@15.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.31.0): + /eslint-config-standard@17.0.0(eslint-plugin-import@2.26.0)(eslint-plugin-n@15.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.32.0): resolution: {integrity: sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==} peerDependencies: eslint: '*' @@ -11099,10 +11120,10 @@ packages: eslint-plugin-n: ^15.0.0 eslint-plugin-promise: ^6.0.0 dependencies: - eslint: 8.31.0 - eslint-plugin-import: 2.26.0(@typescript-eslint/parser@5.48.1)(eslint@8.31.0) - eslint-plugin-n: 15.6.0(eslint@8.31.0) - eslint-plugin-promise: 6.1.1(eslint@8.31.0) + eslint: 8.32.0 + eslint-plugin-import: 2.26.0(@typescript-eslint/parser@5.48.1)(eslint@8.32.0) + eslint-plugin-n: 15.6.0(eslint@8.32.0) + eslint-plugin-promise: 6.1.1(eslint@8.32.0) dev: false /eslint-import-resolver-node@0.3.6: @@ -11113,7 +11134,7 @@ packages: transitivePeerDependencies: - supports-color - /eslint-module-utils@2.7.4(@typescript-eslint/parser@5.48.1)(eslint-import-resolver-node@0.3.6)(eslint@8.31.0): + /eslint-module-utils@2.7.4(@typescript-eslint/parser@5.48.1)(eslint-import-resolver-node@0.3.6)(eslint@8.32.0): resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} engines: {node: '>=4'} peerDependencies: @@ -11134,37 +11155,37 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.48.1(eslint@8.31.0)(typescript@4.9.4) + '@typescript-eslint/parser': 5.48.1(eslint@8.32.0)(typescript@4.9.4) debug: 3.2.7 - eslint: 8.31.0 + eslint: 8.32.0 eslint-import-resolver-node: 0.3.6 transitivePeerDependencies: - supports-color dev: false - /eslint-plugin-es@3.0.1(eslint@8.31.0): + /eslint-plugin-es@3.0.1(eslint@8.32.0): resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} engines: {node: '>=8.10.0'} peerDependencies: eslint: '*' dependencies: - eslint: 8.31.0 + eslint: 8.32.0 eslint-utils: 2.1.0 regexpp: 3.2.0 dev: false - /eslint-plugin-es@4.1.0(eslint@8.31.0): + /eslint-plugin-es@4.1.0(eslint@8.32.0): resolution: {integrity: sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==} engines: {node: '>=8.10.0'} peerDependencies: eslint: '*' dependencies: - eslint: 8.31.0 + eslint: 8.32.0 eslint-utils: 2.1.0 regexpp: 3.2.0 dev: false - /eslint-plugin-import@2.26.0(@typescript-eslint/parser@5.48.1)(eslint@8.31.0): + /eslint-plugin-import@2.26.0(@typescript-eslint/parser@5.48.1)(eslint@8.32.0): resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} engines: {node: '>=4'} peerDependencies: @@ -11174,14 +11195,14 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.48.1(eslint@8.31.0)(typescript@4.9.4) + '@typescript-eslint/parser': 5.48.1(eslint@8.32.0)(typescript@4.9.4) array-includes: 3.1.6 array.prototype.flat: 1.3.1 debug: 4.3.4 doctrine: 2.1.0 - eslint: 8.31.0 + eslint: 8.32.0 eslint-import-resolver-node: 0.3.6 - eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.48.1)(eslint-import-resolver-node@0.3.6)(eslint@8.31.0) + eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.48.1)(eslint-import-resolver-node@0.3.6)(eslint@8.32.0) has: 1.0.3 is-core-module: 2.11.0 is-glob: 4.0.3 @@ -11195,16 +11216,16 @@ packages: - supports-color dev: false - /eslint-plugin-n@15.6.0(eslint@8.31.0): + /eslint-plugin-n@15.6.0(eslint@8.32.0): resolution: {integrity: sha512-Hd/F7wz4Mj44Jp0H6Jtty13NcE69GNTY0rVlgTIj1XBnGGVI6UTdDrpE6vqu3AHo07bygq/N+7OH/lgz1emUJw==} engines: {node: '>=12.22.0'} peerDependencies: eslint: '*' dependencies: builtins: 5.0.1 - eslint: 8.31.0 - eslint-plugin-es: 4.1.0(eslint@8.31.0) - eslint-utils: 3.0.0(eslint@8.31.0) + eslint: 8.32.0 + eslint-plugin-es: 4.1.0(eslint@8.32.0) + eslint-utils: 3.0.0(eslint@8.32.0) ignore: 5.2.4 is-core-module: 2.11.0 minimatch: 3.1.2 @@ -11212,14 +11233,14 @@ packages: semver: 7.3.8 dev: false - /eslint-plugin-node@11.1.0(eslint@8.31.0): + /eslint-plugin-node@11.1.0(eslint@8.32.0): resolution: {integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==} engines: {node: '>=8.10.0'} peerDependencies: eslint: '*' dependencies: - eslint: 8.31.0 - eslint-plugin-es: 3.0.1(eslint@8.31.0) + eslint: 8.32.0 + eslint-plugin-es: 3.0.1(eslint@8.32.0) eslint-utils: 2.1.0 ignore: 5.2.4 minimatch: 3.1.2 @@ -11227,13 +11248,13 @@ packages: semver: 6.3.0 dev: false - /eslint-plugin-promise@6.1.1(eslint@8.31.0): + /eslint-plugin-promise@6.1.1(eslint@8.32.0): resolution: {integrity: sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' dependencies: - eslint: 8.31.0 + eslint: 8.32.0 dev: false /eslint-scope@5.1.1: @@ -11258,13 +11279,13 @@ packages: eslint-visitor-keys: 1.3.0 dev: false - /eslint-utils@3.0.0(eslint@8.31.0): + /eslint-utils@3.0.0(eslint@8.32.0): resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '*' dependencies: - eslint: 8.31.0 + eslint: 8.32.0 eslint-visitor-keys: 2.1.0 /eslint-visitor-keys@1.3.0: @@ -11280,8 +11301,8 @@ packages: resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - /eslint@8.31.0: - resolution: {integrity: sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA==} + /eslint@8.32.0: + resolution: {integrity: sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: @@ -11296,7 +11317,7 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 - eslint-utils: 3.0.0(eslint@8.31.0) + eslint-utils: 3.0.0(eslint@8.32.0) eslint-visitor-keys: 3.3.0 espree: 9.4.1 esquery: 1.4.0 @@ -12009,7 +12030,17 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 5.1.2 + minimatch: 5.1.0 + once: 1.4.0 + + /glob@8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.4 once: 1.4.0 /global-dirs@0.1.1: @@ -12291,7 +12322,7 @@ packages: resolution: {integrity: sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} dependencies: - minimatch: 5.1.2 + minimatch: 5.1.4 /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} @@ -13933,7 +13964,6 @@ packages: engines: {node: '>=10'} dependencies: brace-expansion: 2.0.1 - dev: true /minimatch@5.1.1: resolution: {integrity: sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==} @@ -13941,8 +13971,8 @@ packages: dependencies: brace-expansion: 2.0.1 - /minimatch@5.1.2: - resolution: {integrity: sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==} + /minimatch@5.1.4: + resolution: {integrity: sha512-U0iNYXt9wALljzfnGkhFSy5sAC6/SCR3JrHrlsdJz4kF8MvhTRQNiC59iUi1iqsitV7abrNAJWElVL9pdnoUgw==} engines: {node: '>=10'} dependencies: brace-expansion: 2.0.1 @@ -14348,7 +14378,7 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} hasBin: true dependencies: - glob: 8.0.3 + glob: 8.1.0 ignore-walk: 5.0.1 npm-bundled: 2.0.1 npm-normalize-package-bin: 2.0.0 @@ -14407,6 +14437,9 @@ packages: /object-inspect@1.12.2: resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} + /object-inspect@1.12.3: + resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} + /object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} @@ -15106,8 +15139,8 @@ packages: /punycode@1.4.1: resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} - /punycode@2.1.1: - resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} + /punycode@2.2.0: + resolution: {integrity: sha512-LN6QV1IJ9ZhxWTNdktaPClrNfp8xdSAYS0Zk2ddX7XsXZAxckMHPCBcHRo0cTcEIgYPRiGEkmji3Idkh2yFtYw==} engines: {node: '>=6'} /q@1.5.1: @@ -15962,13 +15995,6 @@ packages: safer-buffer: 2.1.2 tweetnacl: 0.14.5 - /ssri@10.0.0: - resolution: {integrity: sha512-64ghGOpqW0k+jh7m5jndBGdVEoPikWwGQmBNN5ks6jyUSMymzHDTlnNHOvzp+6MmHOljr2MokUzvRksnTwG0Iw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - minipass: 3.3.6 - dev: true - /ssri@10.0.1: resolution: {integrity: sha512-WVy6di9DlPOeBWEjMScpNipeSX2jIZBGEn5Uuo8Q7aIuFEuDX0pw8RxcOjlD1TWP4obi24ki7m/13+nFpcbXrw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -16088,7 +16114,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.1.4 - es-abstract: 1.21.0 + es-abstract: 1.21.1 get-intrinsic: 1.1.3 has-symbols: 1.0.3 is-regex: 1.1.4 @@ -16416,7 +16442,7 @@ packages: engines: {node: '>=0.8'} dependencies: psl: 1.9.0 - punycode: 2.1.1 + punycode: 2.2.0 /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} @@ -16829,7 +16855,7 @@ packages: /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: - punycode: 2.1.1 + punycode: 2.2.0 /utf8-byte-length@1.0.4: resolution: {integrity: sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==} @@ -17532,7 +17558,7 @@ time: /eslint-plugin-n@15.6.0: '2022-12-05T07:55:57.068Z' /eslint-plugin-node@11.1.0: '2020-03-28T11:46:46.795Z' /eslint-plugin-promise@6.1.1: '2022-10-19T21:06:14.552Z' - /eslint@8.31.0: '2022-12-31T05:39:56.815Z' + /eslint@8.32.0: '2023-01-15T04:15:12.648Z' /exists-link@2.0.0: '2017-03-02T20:50:23.918Z' /fast-deep-equal@3.1.3: '2020-06-08T07:27:28.474Z' /fast-glob@3.2.12: '2022-09-09T06:40:27.748Z' diff --git a/pnpm/src/checkForUpdates.test.ts b/pnpm/src/checkForUpdates.test.ts index 9669ff59c..db9eec3c8 100644 --- a/pnpm/src/checkForUpdates.test.ts +++ b/pnpm/src/checkForUpdates.test.ts @@ -10,7 +10,7 @@ jest.mock('@pnpm/core-loggers', () => ({ })) beforeEach(() => { - updateCheckLogger.debug['mockReset']() + (updateCheckLogger.debug as jest.Mock).mockReset() }) test('check for updates when no pnpm state file is present', async () => { diff --git a/pnpm/tsconfig.json b/pnpm/tsconfig.json index dc05559df..3a152dd80 100644 --- a/pnpm/tsconfig.json +++ b/pnpm/tsconfig.json @@ -5,7 +5,8 @@ "declaration": false, "outDir": "lib", "sourceMap": false, - "rootDir": "src" + "rootDir": "src", + "suppressImplicitAnyIndexErrors": true }, "include": [ "src/**/*.ts", @@ -141,5 +142,6 @@ { "path": "../workspace/pkgs-graph" } - ] + ], + "composite": true } diff --git a/releasing/plugin-commands-deploy/tsconfig.json b/releasing/plugin-commands-deploy/tsconfig.json index 749b19ee9..9fe36ce02 100644 --- a/releasing/plugin-commands-deploy/tsconfig.json +++ b/releasing/plugin-commands-deploy/tsconfig.json @@ -39,5 +39,6 @@ { "path": "../../workspace/filter-workspace-packages" } - ] + ], + "composite": true } diff --git a/releasing/plugin-commands-publishing/tsconfig.json b/releasing/plugin-commands-publishing/tsconfig.json index abaf040fd..d4bddb29f 100644 --- a/releasing/plugin-commands-publishing/tsconfig.json +++ b/releasing/plugin-commands-publishing/tsconfig.json @@ -57,5 +57,6 @@ { "path": "../../workspace/sort-packages" } - ] + ], + "composite": true } diff --git a/resolving/default-resolver/tsconfig.json b/resolving/default-resolver/tsconfig.json index d944ed631..850966e9b 100644 --- a/resolving/default-resolver/tsconfig.json +++ b/resolving/default-resolver/tsconfig.json @@ -33,5 +33,6 @@ { "path": "../tarball-resolver" } - ] + ], + "composite": true } diff --git a/resolving/git-resolver/src/index.ts b/resolving/git-resolver/src/index.ts index be06327aa..75181fb6e 100644 --- a/resolving/git-resolver/src/index.ts +++ b/resolving/git-resolver/src/index.ts @@ -67,7 +67,7 @@ async function getRepoRefs (repo: string, ref: string | null) { } // graceful-git by default retries 10 times, reduce to single retry const result = await git(['ls-remote', ...gitArgs], { retries: 1 }) - const refs = result.stdout.split('\n').reduce((obj: object, line: string) => { + const refs = result.stdout.split('\n').reduce((obj: Record, line: string) => { const [commit, refName] = line.split('\t') obj[refName] = commit return obj diff --git a/resolving/git-resolver/tsconfig.json b/resolving/git-resolver/tsconfig.json index aa41c8b8b..029ed2b60 100644 --- a/resolving/git-resolver/tsconfig.json +++ b/resolving/git-resolver/tsconfig.json @@ -15,5 +15,6 @@ { "path": "../resolver-base" } - ] + ], + "composite": true } diff --git a/resolving/local-resolver/src/parsePref.ts b/resolving/local-resolver/src/parsePref.ts index f9c3dfcc2..86439f55a 100644 --- a/resolving/local-resolver/src/parsePref.ts +++ b/resolving/local-resolver/src/parsePref.ts @@ -3,6 +3,7 @@ import path from 'path' import { PnpmError } from '@pnpm/error' import normalize from 'normalize-path' +// @ts-expect-error const isWindows = process.platform === 'win32' || global['FAKE_WINDOWS'] const isFilespec = isWindows ? /^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/ : /^(?:[.]|~[/]|[/]|[a-zA-Z]:)/ const isFilename = /[.](?:tgz|tar.gz|tar)$/i @@ -42,7 +43,9 @@ export function parsePref ( if (wd.pref.startsWith('path:')) { const err = new PnpmError('PATH_IS_UNSUPPORTED_PROTOCOL', 'Local dependencies via `path:` protocol are not supported. ' + 'Use the `link:` protocol for folder dependencies and `file:` for local tarballs') + // @ts-expect-error err['pref'] = wd.pref + // @ts-expect-error err['protocol'] = 'path:' /* eslint-enable @typescript-eslint/dot-notation */ throw err diff --git a/resolving/local-resolver/test/index.ts b/resolving/local-resolver/test/index.ts index 0412a1910..cdfa3bf54 100644 --- a/resolving/local-resolver/test/index.ts +++ b/resolving/local-resolver/test/index.ts @@ -1,6 +1,7 @@ /// import path from 'path' import { resolveFromLocal } from '@pnpm/local-resolver' +import { DirectoryResolution } from '@pnpm/resolver-base' import normalize from 'normalize-path' test('resolve directory', async () => { @@ -8,8 +9,8 @@ test('resolve directory', async () => { expect(resolveResult!.id).toEqual('link:..') expect(resolveResult!.normalizedPref).toEqual('link:..') expect(resolveResult!['manifest']!.name).toEqual('@pnpm/local-resolver') - expect(resolveResult!.resolution['directory']).toEqual(normalize(path.join(__dirname, '..'))) - expect(resolveResult!.resolution['type']).toEqual('directory') + expect((resolveResult!.resolution as DirectoryResolution).directory).toEqual(normalize(path.join(__dirname, '..'))) + expect((resolveResult!.resolution as DirectoryResolution).type).toEqual('directory') }) test('resolve directory specified using absolute path', async () => { @@ -19,8 +20,8 @@ test('resolve directory specified using absolute path', async () => { expect(resolveResult!.id).toEqual('link:..') expect(resolveResult!.normalizedPref).toEqual(`link:${normalizedLinkedDir}`) expect(resolveResult!['manifest']!.name).toEqual('@pnpm/local-resolver') - expect(resolveResult!.resolution['directory']).toEqual(normalizedLinkedDir) - expect(resolveResult!.resolution['type']).toEqual('directory') + expect((resolveResult!.resolution as DirectoryResolution).directory).toEqual(normalizedLinkedDir) + expect((resolveResult!.resolution as DirectoryResolution).type).toEqual('directory') }) test('resolve injected directory', async () => { @@ -28,8 +29,8 @@ test('resolve injected directory', async () => { expect(resolveResult!.id).toEqual('file:..') expect(resolveResult!.normalizedPref).toEqual('file:..') expect(resolveResult!['manifest']!.name).toEqual('@pnpm/local-resolver') - expect(resolveResult!.resolution['directory']).toEqual('..') - expect(resolveResult!.resolution['type']).toEqual('directory') + expect((resolveResult!.resolution as DirectoryResolution).directory).toEqual('..') + expect((resolveResult!.resolution as DirectoryResolution).type).toEqual('directory') }) test('resolve workspace directory', async () => { @@ -37,8 +38,8 @@ test('resolve workspace directory', async () => { expect(resolveResult!.id).toEqual('link:..') expect(resolveResult!.normalizedPref).toEqual('link:..') expect(resolveResult!['manifest']!.name).toEqual('@pnpm/local-resolver') - expect(resolveResult!.resolution['directory']).toEqual(normalize(path.join(__dirname, '..'))) - expect(resolveResult!.resolution['type']).toEqual('directory') + expect((resolveResult!.resolution as DirectoryResolution).directory).toEqual(normalize(path.join(__dirname, '..'))) + expect((resolveResult!.resolution as DirectoryResolution).type).toEqual('directory') }) test('resolve directory specified using the file: protocol', async () => { @@ -46,8 +47,8 @@ test('resolve directory specified using the file: protocol', async () => { expect(resolveResult!.id).toEqual('file:..') expect(resolveResult!.normalizedPref).toEqual('file:..') expect(resolveResult!['manifest']!.name).toEqual('@pnpm/local-resolver') - expect(resolveResult!.resolution['directory']).toEqual('..') - expect(resolveResult!.resolution['type']).toEqual('directory') + expect((resolveResult!.resolution as DirectoryResolution).directory).toEqual('..') + expect((resolveResult!.resolution as DirectoryResolution).type).toEqual('directory') }) test('resolve directory specified using the link: protocol', async () => { @@ -55,8 +56,8 @@ test('resolve directory specified using the link: protocol', async () => { expect(resolveResult!.id).toEqual('link:..') expect(resolveResult!.normalizedPref).toEqual('link:..') expect(resolveResult!['manifest']!.name).toEqual('@pnpm/local-resolver') - expect(resolveResult!.resolution['directory']).toEqual(normalize(path.join(__dirname, '..'))) - expect(resolveResult!.resolution['type']).toEqual('directory') + expect((resolveResult!.resolution as DirectoryResolution).directory).toEqual(normalize(path.join(__dirname, '..'))) + expect((resolveResult!.resolution as DirectoryResolution).type).toEqual('directory') }) test('resolve file', async () => { diff --git a/resolving/local-resolver/tsconfig.json b/resolving/local-resolver/tsconfig.json index 8eb65cd94..76013a7b4 100644 --- a/resolving/local-resolver/tsconfig.json +++ b/resolving/local-resolver/tsconfig.json @@ -24,5 +24,6 @@ { "path": "../resolver-base" } - ] + ], + "composite": true } diff --git a/resolving/npm-resolver/src/pickPackage.ts b/resolving/npm-resolver/src/pickPackage.ts index 8ec1adfb1..b4cfabf8a 100644 --- a/resolving/npm-resolver/src/pickPackage.ts +++ b/resolving/npm-resolver/src/pickPackage.ts @@ -190,7 +190,7 @@ export async function pickPackage ( } function clearMeta (pkg: PackageMeta): PackageMeta { - const versions = {} + const versions: PackageMeta['versions'] = {} for (const [version, info] of Object.entries(pkg.versions)) { // The list taken from https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-object versions[version] = pick([ diff --git a/resolving/npm-resolver/test/index.ts b/resolving/npm-resolver/test/index.ts index dc0dc3879..2f24bf714 100644 --- a/resolving/npm-resolver/test/index.ts +++ b/resolving/npm-resolver/test/index.ts @@ -1564,7 +1564,7 @@ test('workspace protocol: resolution fails if there is no matching local package }) const projectDir = '/home/istvan/src' - let err!: Error + let err!: Error & { code: string } try { await resolve({ alias: 'is-positive', pref: 'workspace:^3.0.0' }, { projectDir, @@ -1576,7 +1576,7 @@ test('workspace protocol: resolution fails if there is no matching local package } expect(err).toBeTruthy() - expect(err['code']).toBe('ERR_PNPM_NO_MATCHING_VERSION_INSIDE_WORKSPACE') + expect(err.code).toBe('ERR_PNPM_NO_MATCHING_VERSION_INSIDE_WORKSPACE') expect(err.message).toBe(`In ${path.relative(process.cwd(), projectDir)}: No matching version found for is-positive@^3.0.0 inside the workspace`) }) diff --git a/resolving/npm-resolver/tsconfig.json b/resolving/npm-resolver/tsconfig.json index 520494c85..2b49edaef 100644 --- a/resolving/npm-resolver/tsconfig.json +++ b/resolving/npm-resolver/tsconfig.json @@ -36,5 +36,6 @@ { "path": "../resolver-base" } - ] + ], + "composite": true } diff --git a/resolving/resolver-base/tsconfig.json b/resolving/resolver-base/tsconfig.json index d37dd6eef..7302e6eab 100644 --- a/resolving/resolver-base/tsconfig.json +++ b/resolving/resolver-base/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/resolving/tarball-resolver/tsconfig.json b/resolving/tarball-resolver/tsconfig.json index f24e79a0a..e64873824 100644 --- a/resolving/tarball-resolver/tsconfig.json +++ b/resolving/tarball-resolver/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../resolver-base" } - ] + ], + "composite": true } diff --git a/reviewing/dependencies-hierarchy/src/getPkgInfo.ts b/reviewing/dependencies-hierarchy/src/getPkgInfo.ts index 18697cb0c..abf4d0792 100644 --- a/reviewing/dependencies-hierarchy/src/getPkgInfo.ts +++ b/reviewing/dependencies-hierarchy/src/getPkgInfo.ts @@ -2,6 +2,7 @@ import path from 'path' import { PackageSnapshot, PackageSnapshots, + TarballResolution, } from '@pnpm/lockfile-file' import { nameVerFromPkgSnapshot, @@ -36,7 +37,7 @@ export interface GetPkgInfoOpts { readonly rewriteLinkVersionDir?: string } -export function getPkgInfo (opts: GetPkgInfoOpts) { +export function getPkgInfo (opts: GetPkgInfoOpts): PackageInfo { let name!: string let version!: string let resolved: string | undefined @@ -65,7 +66,7 @@ export function getPkgInfo (opts: GetPkgInfoOpts) { isMissing = true isSkipped = opts.skipped.has(depPath) } - resolved = pkgSnapshotToResolution(depPath, pkgSnapshot, opts.registries)['tarball'] + resolved = (pkgSnapshotToResolution(depPath, pkgSnapshot, opts.registries) as TarballResolution).tarball dev = pkgSnapshot.dev optional = pkgSnapshot.optional } else { @@ -80,7 +81,7 @@ export function getPkgInfo (opts: GetPkgInfoOpts) { version = `link:${normalizePath(path.relative(opts.rewriteLinkVersionDir, fullPackagePath))}` } - const packageInfo = { + const packageInfo: PackageInfo = { alias: opts.alias, isMissing, isPeer: Boolean(opts.peers?.has(opts.alias)), @@ -90,13 +91,26 @@ export function getPkgInfo (opts: GetPkgInfoOpts) { version, } if (resolved) { - packageInfo['resolved'] = resolved + packageInfo.resolved = resolved } if (optional === true) { - packageInfo['optional'] = true + packageInfo.optional = true } if (typeof dev === 'boolean') { - packageInfo['dev'] = dev + packageInfo.dev = dev } return packageInfo } + +interface PackageInfo { + alias: string + isMissing: boolean + isPeer: boolean + isSkipped: boolean + name: string + path: string + version: string + resolved?: string + optional?: true + dev?: boolean +} diff --git a/reviewing/dependencies-hierarchy/test/index.ts b/reviewing/dependencies-hierarchy/test/index.ts index 7ebdc12af..3c4fbc677 100644 --- a/reviewing/dependencies-hierarchy/test/index.ts +++ b/reviewing/dependencies-hierarchy/test/index.ts @@ -557,7 +557,7 @@ test('dependency without a package.json', async () => { expect(tree[withNonPackageDepFixture].dependencies!.length).toBeGreaterThan(0) expect(tree[withNonPackageDepFixture].dependencies![0]).toBeDefined() // verify that dependency without a package.json has no further dependencies - expect(tree[withNonPackageDepFixture].dependencies![0]['dependencies']).toBeUndefined() - expect(tree[withNonPackageDepFixture].dependencies![0]['devDependencies']).toBeUndefined() - expect(tree[withNonPackageDepFixture].dependencies![0]['optionalDependencies']).toBeUndefined() + expect(tree[withNonPackageDepFixture].dependencies![0]).not.toHaveProperty(['dependencies']) + expect(tree[withNonPackageDepFixture].dependencies![0]).not.toHaveProperty(['devDependencies']) + expect(tree[withNonPackageDepFixture].dependencies![0]).not.toHaveProperty(['optionalDependencies']) }) diff --git a/reviewing/dependencies-hierarchy/tsconfig.json b/reviewing/dependencies-hierarchy/tsconfig.json index f2871dbac..6bfe1a253 100644 --- a/reviewing/dependencies-hierarchy/tsconfig.json +++ b/reviewing/dependencies-hierarchy/tsconfig.json @@ -39,5 +39,6 @@ { "path": "../../pkg-manifest/read-package-json" } - ] + ], + "composite": true } diff --git a/reviewing/license-scanner/src/lockfileToLicenseNodeTree.ts b/reviewing/license-scanner/src/lockfileToLicenseNodeTree.ts index 99c9bf7df..25f59935d 100644 --- a/reviewing/license-scanner/src/lockfileToLicenseNodeTree.ts +++ b/reviewing/license-scanner/src/lockfileToLicenseNodeTree.ts @@ -1,4 +1,4 @@ -import { Lockfile } from '@pnpm/lockfile-types' +import { Lockfile, TarballResolution } from '@pnpm/lockfile-types' import { nameVerFromPkgSnapshot } from '@pnpm/lockfile-utils' import { packageIsInstallable } from '@pnpm/package-is-installable' import { @@ -42,7 +42,7 @@ export async function lockfileToLicenseNode ( step: LockfileWalkerStep, options: LicenseExtractOptions ) { - const dependencies = {} + const dependencies: Record = {} for (const dependency of step.dependencies) { const { depPath, pkgSnapshot, next } = dependency const { name, version } = nameVerFromPkgSnapshot(depPath, pkgSnapshot) @@ -85,7 +85,7 @@ export async function lockfileToLicenseNode ( const dep: LicenseNode = { name, dev: pkgSnapshot.dev === true, - integrity: pkgSnapshot.resolution['integrity'], + integrity: (pkgSnapshot.resolution as TarballResolution).integrity, version, license: packageInfo.license, licenseContents: packageInfo.licenseContents, @@ -126,7 +126,7 @@ export async function lockfileToLicenseNodeTree ( Object.keys(lockfile.importers), { include: opts?.include } ) - const dependencies = {} + const dependencies: any = {} // eslint-disable-line @typescript-eslint/no-explicit-any for (const importerWalker of importerWalkers) { const importerDeps = await lockfileToLicenseNode(importerWalker.step, { @@ -142,6 +142,7 @@ export async function lockfileToLicenseNodeTree ( dependencies: importerDeps, requires: toRequires(importerDeps), version: '0.0.0', + license: undefined, } } diff --git a/reviewing/license-scanner/tsconfig.json b/reviewing/license-scanner/tsconfig.json index c7145fe39..45c267a98 100644 --- a/reviewing/license-scanner/tsconfig.json +++ b/reviewing/license-scanner/tsconfig.json @@ -45,5 +45,6 @@ { "path": "../../store/cafs" } - ] + ], + "composite": true } diff --git a/reviewing/list/src/getPkgInfo.ts b/reviewing/list/src/getPkgInfo.ts index 210ef8a2b..08f30e4be 100644 --- a/reviewing/list/src/getPkgInfo.ts +++ b/reviewing/list/src/getPkgInfo.ts @@ -1,15 +1,21 @@ +import { ProjectManifest } from '@pnpm/types' import path from 'path' import { readPkg } from './readPkg' -export async function getPkgInfo ( - pkg: { - alias: string - name: string - version: string - path: string - resolved?: string - } -) { +interface PkgData { + alias: string | undefined + name: string + version: string + path: string + resolved?: string +} + +export type PkgInfo = Omit & Pick & { + from: string + repository?: string +} + +export async function getPkgInfo (pkg: PkgData): Promise { let manifest try { manifest = await readPkg(path.join(pkg.path, 'node_modules', pkg.name, 'package.json')) diff --git a/reviewing/list/src/index.ts b/reviewing/list/src/index.ts index bb7baa9e9..c9eb18c33 100644 --- a/reviewing/list/src/index.ts +++ b/reviewing/list/src/index.ts @@ -103,7 +103,7 @@ export async function list ( ? projectPaths.reduce((acc, projectPath) => { acc[projectPath] = {} return acc - }, {}) + }, {} as Record) : await buildDependenciesHierarchy(projectPaths, { depth: opts.depth, include: maybeOpts?.include, diff --git a/reviewing/list/src/renderJson.ts b/reviewing/list/src/renderJson.ts index d0f28213c..31a0fbb63 100644 --- a/reviewing/list/src/renderJson.ts +++ b/reviewing/list/src/renderJson.ts @@ -3,11 +3,20 @@ import { PackageNode } from '@pnpm/reviewing.dependencies-hierarchy' import sortBy from 'ramda/src/sortBy' import path from 'ramda/src/path' import { Ord } from 'ramda' -import { getPkgInfo } from './getPkgInfo' +import { getPkgInfo, PkgInfo } from './getPkgInfo' import { PackageDependencyHierarchy } from './types' const sortPackages = sortBy(path(['pkg', 'alias']) as (pkg: PackageNode) => Ord) +type RenderJsonResultItem = Pick & +Required> & +{ + dependencies?: Record + devDependencies?: Record + optionalDependencies?: Record + unsavedDependencies?: Record +} + export async function renderJson ( pkgs: PackageDependencyHierarchy[], opts: { @@ -15,17 +24,17 @@ export async function renderJson ( long: boolean search: boolean } -) { +): Promise { const jsonArr = await Promise.all(pkgs.map(async (pkg) => { - const jsonObj = { + const jsonObj: RenderJsonResultItem = { name: pkg.name, version: pkg.version, path: pkg.path, private: !!pkg.private, } - for (const dependenciesField of [...DEPENDENCIES_FIELDS.sort(), 'unsavedDependencies']) { + for (const dependenciesField of [...DEPENDENCIES_FIELDS.sort(), 'unsavedDependencies'] as const) { if (pkg[dependenciesField]?.length) { - jsonObj[dependenciesField] = await toJsonResult(pkg[dependenciesField], { long: opts.long }) + jsonObj[dependenciesField] = await toJsonResult(pkg[dependenciesField]!, { long: opts.long }) } } @@ -40,12 +49,12 @@ export async function toJsonResult ( opts: { long: boolean } -): Promise<{}> { - const dependencies = {} +): Promise> { + const dependencies: Record = {} await Promise.all( sortPackages(entryNodes).map(async (node) => { const subDependencies = await toJsonResult(node.dependencies ?? [], opts) - const dep = opts.long + const dep: PackageJsonListItem = opts.long ? await getPkgInfo(node) : { alias: node.alias as string | undefined, @@ -55,7 +64,7 @@ export async function toJsonResult ( resolved: node.resolved, } if (Object.keys(subDependencies).length > 0) { - dep['dependencies'] = subDependencies + dep.dependencies = subDependencies } if (!dep.resolved) { delete dep.resolved @@ -66,3 +75,7 @@ export async function toJsonResult ( ) return dependencies } + +interface PackageJsonListItem extends PkgInfo { + dependencies?: Record +} diff --git a/reviewing/list/src/renderTree.ts b/reviewing/list/src/renderTree.ts index 16f7caffc..b527ff1f8 100644 --- a/reviewing/list/src/renderTree.ts +++ b/reviewing/list/src/renderTree.ts @@ -1,6 +1,6 @@ import path from 'path' import { PackageNode } from '@pnpm/reviewing.dependencies-hierarchy' -import { DEPENDENCIES_FIELDS } from '@pnpm/types' +import { DEPENDENCIES_FIELDS, DependenciesField } from '@pnpm/types' import archy from 'archy' import chalk from 'chalk' import cliColumns from 'cli-columns' @@ -66,7 +66,7 @@ async function renderTreeForPackage ( } let output = `${chalk.bold.underline(label)}\n` const useColumns = opts.depth === 0 && !opts.long && !opts.search - const dependenciesFields: string[] = [ + const dependenciesFields: Array = [ ...DEPENDENCIES_FIELDS.sort(), ] if (opts.showExtraneous) { @@ -81,8 +81,8 @@ async function renderTreeForPackage ( ) output += `\n${depsLabel}\n` const gPkgColor = dependenciesField === 'unsavedDependencies' ? () => NOT_SAVED_DEP_CLR : getPkgColor - if (useColumns && pkg[dependenciesField].length > 10) { - output += cliColumns(pkg[dependenciesField].map(printLabel.bind(printLabel, gPkgColor))) + '\n' + if (useColumns && pkg[dependenciesField]!.length > 10) { + output += cliColumns(pkg[dependenciesField]!.map(printLabel.bind(printLabel, gPkgColor))) + '\n' continue } const data = await toArchyTree(gPkgColor, pkg[dependenciesField]!, { diff --git a/reviewing/list/tsconfig.json b/reviewing/list/tsconfig.json index 1e9dae525..90b39c346 100644 --- a/reviewing/list/tsconfig.json +++ b/reviewing/list/tsconfig.json @@ -27,5 +27,6 @@ { "path": "../dependencies-hierarchy" } - ] + ], + "composite": true } diff --git a/reviewing/outdated/src/outdated.ts b/reviewing/outdated/src/outdated.ts index 7e0b4ccc8..8d179af2d 100644 --- a/reviewing/outdated/src/outdated.ts +++ b/reviewing/outdated/src/outdated.ts @@ -3,6 +3,7 @@ import { PnpmError } from '@pnpm/error' import { getLockfileImporterId, Lockfile, + ProjectSnapshot, } from '@pnpm/lockfile-file' import { nameVerFromPkgSnapshot } from '@pnpm/lockfile-utils' import { getAllDependenciesFromManifest } from '@pnpm/manifest-utils' @@ -93,7 +94,7 @@ export async function outdated ( throw new Error(`Invalid ${WANTED_LOCKFILE} file. ${relativeDepPath} not found in packages field`) } - const currentRef = currentLockfile.importers[importerId]?.[depType]?.[alias] + const currentRef = (currentLockfile.importers[importerId] as ProjectSnapshot)?.[depType]?.[alias] const currentRelative = currentRef && dp.refToRelative(currentRef, alias) const current = (currentRelative && dp.parse(currentRelative).version) ?? currentRef const wanted = dp.parse(relativeDepPath).version ?? ref diff --git a/reviewing/outdated/tsconfig.json b/reviewing/outdated/tsconfig.json index 8b050e8f5..ca2e85c38 100644 --- a/reviewing/outdated/tsconfig.json +++ b/reviewing/outdated/tsconfig.json @@ -45,5 +45,6 @@ { "path": "../../resolving/npm-resolver" } - ] + ], + "composite": true } diff --git a/reviewing/plugin-commands-licenses/tsconfig.json b/reviewing/plugin-commands-licenses/tsconfig.json index 22115d48c..bd22331cc 100644 --- a/reviewing/plugin-commands-licenses/tsconfig.json +++ b/reviewing/plugin-commands-licenses/tsconfig.json @@ -45,5 +45,6 @@ { "path": "../license-scanner" } - ] + ], + "composite": true } diff --git a/reviewing/plugin-commands-listing/tsconfig.json b/reviewing/plugin-commands-listing/tsconfig.json index 15b960847..82e7db75b 100644 --- a/reviewing/plugin-commands-listing/tsconfig.json +++ b/reviewing/plugin-commands-listing/tsconfig.json @@ -39,5 +39,6 @@ { "path": "../list" } - ] + ], + "composite": true } diff --git a/reviewing/plugin-commands-outdated/src/outdated.ts b/reviewing/plugin-commands-outdated/src/outdated.ts index 8d2c134e8..d1ce92e20 100644 --- a/reviewing/plugin-commands-outdated/src/outdated.ts +++ b/reviewing/plugin-commands-outdated/src/outdated.ts @@ -289,7 +289,7 @@ function renderOutdatedJSON (outdatedPackages: readonly OutdatedPackage[], opts: acc[outdatedPkg.packageName].latestManifest = outdatedPkg.latestManifest } return acc - }, {}) + }, {} as Record) return JSON.stringify(outdatedPackagesJSON, null, 2) } diff --git a/reviewing/plugin-commands-outdated/src/recursive.ts b/reviewing/plugin-commands-outdated/src/recursive.ts index 0af882652..c8721c44b 100644 --- a/reviewing/plugin-commands-outdated/src/recursive.ts +++ b/reviewing/plugin-commands-outdated/src/recursive.ts @@ -189,13 +189,13 @@ function renderOutdatedJSON ( wanted: outdatedPkg.wanted, isDeprecated: Boolean(outdatedPkg.latestManifest?.deprecated), dependencyType: outdatedPkg.belongsTo, - dependentPackages: outdatedPkg.dependentPkgs.map(({ manifest, location }) => ({ name: manifest.name, location })), + dependentPackages: outdatedPkg.dependentPkgs.map(({ manifest, location }) => ({ name: manifest.name!, location })), } if (opts.long) { acc[outdatedPkg.packageName].latestManifest = outdatedPkg.latestManifest } return acc - }, {}) + }, {} as Record) return JSON.stringify(outdatedPackagesJSON, null, 2) } diff --git a/reviewing/plugin-commands-outdated/tsconfig.json b/reviewing/plugin-commands-outdated/tsconfig.json index cdc10b473..fc73fc253 100644 --- a/reviewing/plugin-commands-outdated/tsconfig.json +++ b/reviewing/plugin-commands-outdated/tsconfig.json @@ -60,5 +60,6 @@ { "path": "../outdated" } - ] + ], + "composite": true } diff --git a/store/cafs-types/tsconfig.json b/store/cafs-types/tsconfig.json index d37dd6eef..7302e6eab 100644 --- a/store/cafs-types/tsconfig.json +++ b/store/cafs-types/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/store/cafs/src/addFilesFromTarball.ts b/store/cafs/src/addFilesFromTarball.ts index 0256904fa..8c4dbf48a 100644 --- a/store/cafs/src/addFilesFromTarball.ts +++ b/store/cafs/src/addFilesFromTarball.ts @@ -12,7 +12,7 @@ export async function addFilesFromTarball ( ): Promise { const ignore = _ignore ?? (() => false) const extract = tar.extract() - const filesIndex = {} + const filesIndex: FilesIndex = {} await new Promise((resolve, reject) => { extract.on('entry', (header, fileStream, next) => { // There are some edge cases, where the same files are extracted multiple times. @@ -32,7 +32,7 @@ export async function addFilesFromTarball ( const writeResult = addStreamToCafs(fileStream, header.mode!) filesIndex[filename] = { mode: header.mode!, - size: header.size, + size: header.size!, writeResult, } next() diff --git a/store/cafs/src/checkPkgFilesIntegrity.ts b/store/cafs/src/checkPkgFilesIntegrity.ts index 93b1ece83..3006ea29f 100644 --- a/store/cafs/src/checkPkgFilesIntegrity.ts +++ b/store/cafs/src/checkPkgFilesIntegrity.ts @@ -14,6 +14,7 @@ const MAX_BULK_SIZE = 1 * 1024 * 1024 // 1MB // It should be rare that a files content should be checked. // If it happens too frequently, something is wrong. // Checking a file's integrity is an expensive operation! +// @ts-expect-error global['verifiedFileIntegrity'] = 0 export interface PackageFilesIndex { @@ -114,6 +115,7 @@ export async function verifyFileIntegrity ( expectedFile: FileInfo, deferredManifest?: DeferredManifestPromise ) { + // @ts-expect-error global['verifiedFileIntegrity']++ try { if (expectedFile.size > MAX_BULK_SIZE && (deferredManifest == null)) { diff --git a/store/cafs/tsconfig.json b/store/cafs/tsconfig.json index 9444b8a13..c47ea6481 100644 --- a/store/cafs/tsconfig.json +++ b/store/cafs/tsconfig.json @@ -24,5 +24,6 @@ { "path": "../store-controller-types" } - ] + ], + "composite": true } diff --git a/store/create-cafs-store/tsconfig.json b/store/create-cafs-store/tsconfig.json index 7b79eca81..19b745ad2 100644 --- a/store/create-cafs-store/tsconfig.json +++ b/store/create-cafs-store/tsconfig.json @@ -27,5 +27,6 @@ { "path": "../store-controller-types" } - ] + ], + "composite": true } diff --git a/store/package-store/tsconfig.json b/store/package-store/tsconfig.json index 90ea66a0b..7a25f02eb 100644 --- a/store/package-store/tsconfig.json +++ b/store/package-store/tsconfig.json @@ -36,5 +36,6 @@ { "path": "../store-controller-types" } - ] + ], + "composite": true } diff --git a/store/plugin-commands-server/tsconfig.json b/store/plugin-commands-server/tsconfig.json index b6afa608d..3131ec252 100644 --- a/store/plugin-commands-server/tsconfig.json +++ b/store/plugin-commands-server/tsconfig.json @@ -33,5 +33,6 @@ { "path": "../store-path" } - ] + ], + "composite": true } diff --git a/store/plugin-commands-store/src/storeStatus/extendStoreStatusOptions.ts b/store/plugin-commands-store/src/storeStatus/extendStoreStatusOptions.ts index 57b3627d9..9a1b4b35f 100644 --- a/store/plugin-commands-store/src/storeStatus/extendStoreStatusOptions.ts +++ b/store/plugin-commands-store/src/storeStatus/extendStoreStatusOptions.ts @@ -46,8 +46,8 @@ export async function extendStoreStatusOptions ( ): Promise { if (opts) { for (const key in opts) { - if (opts[key] === undefined) { - delete opts[key] + if (opts[key as keyof StoreStatusOptions] === undefined) { + delete opts[key as keyof StoreStatusOptions] } } } diff --git a/store/plugin-commands-store/src/storeStatus/index.ts b/store/plugin-commands-store/src/storeStatus/index.ts index aa937cebb..b637d8635 100644 --- a/store/plugin-commands-store/src/storeStatus/index.ts +++ b/store/plugin-commands-store/src/storeStatus/index.ts @@ -14,6 +14,7 @@ import { extendStoreStatusOptions, StoreStatusOptions, } from './extendStoreStatusOptions' +import { TarballResolution } from '@pnpm/store-controller-types' export async function storeStatus (maybeOpts: StoreStatusOptions) { const reporter = maybeOpts?.reporter @@ -40,7 +41,7 @@ export async function storeStatus (maybeOpts: StoreStatusOptions) { return { depPath, id, - integrity: pkgSnapshot.resolution['integrity'], + integrity: (pkgSnapshot.resolution as TarballResolution).integrity, pkgPath: dp.resolve(registries, depPath), ...nameVerFromPkgSnapshot(depPath, pkgSnapshot), } diff --git a/store/plugin-commands-store/test/storeStatus.ts b/store/plugin-commands-store/test/storeStatus.ts index 917d7e63c..2c4216c4a 100644 --- a/store/plugin-commands-store/test/storeStatus.ts +++ b/store/plugin-commands-store/test/storeStatus.ts @@ -27,7 +27,7 @@ test('CLI fails when store status finds modified packages', async () => { await rimraf('node_modules/.pnpm/is-positive@3.1.0/node_modules/is-positive/index.js') - let err!: PnpmError + let err!: PnpmError & { modified: string[] } const modulesState = await project.readModulesManifest() try { await store.handler({ @@ -45,8 +45,8 @@ test('CLI fails when store status finds modified packages', async () => { err = _err } expect(err.code).toBe('ERR_PNPM_MODIFIED_DEPENDENCY') - expect(err['modified'].length).toBe(1) - expect(err['modified'][0]).toMatch(/is-positive/) + expect(err.modified.length).toBe(1) + expect(err.modified[0]).toMatch(/is-positive/) }) test('CLI does not fail when store status does not find modified packages', async () => { diff --git a/store/plugin-commands-store/tsconfig.json b/store/plugin-commands-store/tsconfig.json index aef7c48f7..e459f50f8 100644 --- a/store/plugin-commands-store/tsconfig.json +++ b/store/plugin-commands-store/tsconfig.json @@ -60,5 +60,6 @@ { "path": "../store-path" } - ] + ], + "composite": true } diff --git a/store/server/src/connectStoreController.ts b/store/server/src/connectStoreController.ts index d7b42eb02..e8175f60e 100644 --- a/store/server/src/connectStoreController.ts +++ b/store/server/src/connectStoreController.ts @@ -96,7 +96,7 @@ async function requestPackage ( options, wantedDependency, }) - .then((packageResponseBody: object) => { + .then((packageResponseBody: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any const fetchingBundledManifest = !packageResponseBody['fetchingBundledManifestInProgress'] // eslint-disable-line ? undefined : limitedFetch(`${remotePrefix}/rawManifestResponse`, { diff --git a/store/server/src/createServer.ts b/store/server/src/createServer.ts index 908767ef0..dbcb70ed8 100644 --- a/store/server/src/createServer.ts +++ b/store/server/src/createServer.ts @@ -1,6 +1,8 @@ import http, { IncomingMessage, Server, ServerResponse } from 'http' import { globalInfo } from '@pnpm/logger' import { + BundledManifestFunction, + PackageFilesResponse, RequestPackageOptions, StoreController, WantedDependency, @@ -32,8 +34,8 @@ export function createServer ( ignoreUploadRequests?: boolean } ) { - const rawManifestPromises = {} - const filesPromises = {} + const rawManifestPromises: Record = {} + const filesPromises: Record Promise> = {} // eslint-disable-next-line @typescript-eslint/no-invalid-void-type const lock = locking() @@ -73,12 +75,13 @@ export function createServer ( try { body = await bodyPromise const pkgResponse = await store.requestPackage(body.wantedDependency, body.options) - if (pkgResponse['bundledManifest']) { // eslint-disable-line - rawManifestPromises[body.msgId] = pkgResponse['bundledManifest'] // eslint-disable-line - pkgResponse.body['fetchingBundledManifestInProgress'] = true // eslint-disable-line + if (pkgResponse['bundledManifest']) { + rawManifestPromises[body.msgId] = pkgResponse['bundledManifest'] + // @ts-expect-error + pkgResponse.body['fetchingBundledManifestInProgress'] = true } - if (pkgResponse['files']) { // eslint-disable-line - filesPromises[body.msgId] = pkgResponse['files'] // eslint-disable-line + if (pkgResponse['files']) { + filesPromises[body.msgId] = pkgResponse['files'] } res.end(JSON.stringify(pkgResponse.body)) } catch (err: any) { // eslint-disable-line diff --git a/store/server/test/index.ts b/store/server/test/index.ts index e9f8b7c88..b45293e89 100644 --- a/store/server/test/index.ts +++ b/store/server/test/index.ts @@ -174,7 +174,7 @@ test('server upload', async () => { filesIndexFile, }) - const cacheIntegrity = await loadJsonFile(filesIndexFile) + const cacheIntegrity = await loadJsonFile(filesIndexFile) // eslint-disable-line @typescript-eslint/no-explicit-any expect(Object.keys(cacheIntegrity?.['sideEffects'][fakeEngine]).sort()).toStrictEqual(['side-effect.js', 'side-effect.txt']) await server.close() diff --git a/store/server/tsconfig.json b/store/server/tsconfig.json index 4b2e5cd54..54970e83d 100644 --- a/store/server/tsconfig.json +++ b/store/server/tsconfig.json @@ -27,5 +27,6 @@ { "path": "../store-controller-types" } - ] + ], + "composite": true } diff --git a/store/store-connection-manager/tsconfig.json b/store/store-connection-manager/tsconfig.json index 4b184c881..1f6f94fd2 100644 --- a/store/store-connection-manager/tsconfig.json +++ b/store/store-connection-manager/tsconfig.json @@ -30,5 +30,6 @@ { "path": "../store-path" } - ] + ], + "composite": true } diff --git a/store/store-controller-types/tsconfig.json b/store/store-controller-types/tsconfig.json index f4837c731..938a04ed4 100644 --- a/store/store-controller-types/tsconfig.json +++ b/store/store-controller-types/tsconfig.json @@ -21,5 +21,6 @@ { "path": "../cafs-types" } - ] + ], + "composite": true } diff --git a/store/store-path/tsconfig.json b/store/store-path/tsconfig.json index c6f0399f6..441d43d55 100644 --- a/store/store-path/tsconfig.json +++ b/store/store-path/tsconfig.json @@ -8,5 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/text/comments-parser/src/insertComments.ts b/text/comments-parser/src/insertComments.ts index 6e444eb86..27cfa3168 100644 --- a/text/comments-parser/src/insertComments.ts +++ b/text/comments-parser/src/insertComments.ts @@ -6,7 +6,7 @@ export function insertComments (json: string, comments: CommentSpecifier[]) { // We eliminate whitespace and quotes in the index entries, // because pnpm may have changed them. const jsonLines = json.split('\n') - const index = {} + const index: Record = {} const canonicalizer = /[\s'"]/g for (let i = 0; i < jsonLines.length; ++i) { const key = jsonLines[i].replace(canonicalizer, '') diff --git a/text/comments-parser/tsconfig.json b/text/comments-parser/tsconfig.json index c6f0399f6..441d43d55 100644 --- a/text/comments-parser/tsconfig.json +++ b/text/comments-parser/tsconfig.json @@ -8,5 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/workspace/filter-workspace-packages/tsconfig.json b/workspace/filter-workspace-packages/tsconfig.json index fabb0d299..c9c3a1b13 100644 --- a/workspace/filter-workspace-packages/tsconfig.json +++ b/workspace/filter-workspace-packages/tsconfig.json @@ -21,5 +21,6 @@ { "path": "../pkgs-graph" } - ] + ], + "composite": true } diff --git a/workspace/find-workspace-dir/tsconfig.json b/workspace/find-workspace-dir/tsconfig.json index 019cba19e..e16204313 100644 --- a/workspace/find-workspace-dir/tsconfig.json +++ b/workspace/find-workspace-dir/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../packages/error" } - ] + ], + "composite": true } diff --git a/workspace/find-workspace-packages/src/index.ts b/workspace/find-workspace-packages/src/index.ts index 1e543b2e9..307bfb6da 100644 --- a/workspace/find-workspace-packages/src/index.ts +++ b/workspace/find-workspace-packages/src/index.ts @@ -53,9 +53,11 @@ async function requirePackagesManifest (dir: string): Promise<{ packages?: strin } } +type ArrayOfWorkspacePackagesToMapResult = Record>> + export function arrayOfWorkspacePackagesToMap ( pkgs: Array> -) { +): ArrayOfWorkspacePackagesToMapResult { return pkgs.reduce((acc, pkg) => { if (!pkg.manifest.name) return acc if (!acc[pkg.manifest.name]) { @@ -63,5 +65,5 @@ export function arrayOfWorkspacePackagesToMap ( } acc[pkg.manifest.name][pkg.manifest.version ?? '0.0.0'] = pkg return acc - }, {}) + }, {} as ArrayOfWorkspacePackagesToMapResult) } diff --git a/workspace/find-workspace-packages/tsconfig.json b/workspace/find-workspace-packages/tsconfig.json index 16f278f0c..852ff7717 100644 --- a/workspace/find-workspace-packages/tsconfig.json +++ b/workspace/find-workspace-packages/tsconfig.json @@ -21,5 +21,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true } diff --git a/workspace/pkgs-graph/src/index.ts b/workspace/pkgs-graph/src/index.ts index cca11114f..daefddbe5 100644 --- a/workspace/pkgs-graph/src/index.ts +++ b/workspace/pkgs-graph/src/index.ts @@ -107,7 +107,7 @@ export function createPkgGraph (pkgs: Array, opts?: { } function createPkgMap (pkgs: Package[]): Record { - const pkgMap = {} + const pkgMap: Record = {} for (const pkg of pkgs) { pkgMap[pkg.dir] = pkg } diff --git a/workspace/pkgs-graph/tsconfig.json b/workspace/pkgs-graph/tsconfig.json index 2ec81e6d6..cb9338b22 100644 --- a/workspace/pkgs-graph/tsconfig.json +++ b/workspace/pkgs-graph/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../resolve-workspace-range" } - ] + ], + "composite": true } diff --git a/workspace/resolve-workspace-range/tsconfig.json b/workspace/resolve-workspace-range/tsconfig.json index c6f0399f6..441d43d55 100644 --- a/workspace/resolve-workspace-range/tsconfig.json +++ b/workspace/resolve-workspace-range/tsconfig.json @@ -8,5 +8,6 @@ "src/**/*.ts", "../../__typings__/**/*.d.ts" ], - "references": [] + "references": [], + "composite": true } diff --git a/workspace/sort-packages/tsconfig.json b/workspace/sort-packages/tsconfig.json index d37dd6eef..7302e6eab 100644 --- a/workspace/sort-packages/tsconfig.json +++ b/workspace/sort-packages/tsconfig.json @@ -12,5 +12,6 @@ { "path": "../../packages/types" } - ] + ], + "composite": true }