chore: update @pnpm/meta-updater (#5360)

This commit is contained in:
Igor Bezkrovnyi
2022-09-16 01:08:46 +02:00
committed by GitHub
parent 223b23fed1
commit ebf6ee09bd
4 changed files with 902 additions and 257 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm-private/updater": minor
---
Changes in meta-updater scripts following @pnpm/meta-updater update

View File

@@ -2,6 +2,7 @@ import fs from 'fs'
import path from 'path'
import { readWantedLockfile, Lockfile } from '@pnpm/lockfile-file'
import { ProjectManifest } from '@pnpm/types'
import { createUpdateOptions, FormatPluginFnOptions } from '@pnpm/meta-updater'
import isSubdir from 'is-subdir'
import loadJsonFile from 'load-json-file'
import normalizePath from 'normalize-path'
@@ -20,8 +21,11 @@ export default async (workspaceDir: string) => {
if (lockfile == null) {
throw new Error('no lockfile found')
}
return {
'package.json': (manifest: ProjectManifest & { keywords?: string[] }, dir: string) => {
return createUpdateOptions({
'package.json': (manifest: ProjectManifest & { keywords?: string[] } | null, { dir }) => {
if (!manifest) {
return manifest;
}
if (manifest.name === 'monorepo-root') {
manifest.scripts!['release'] = `pnpm --filter=@pnpm/exe publish --tag=${NEXT_TAG} --access=public && pnpm publish --filter=!pnpm --filter=!@pnpm/exe --access=public && pnpm publish --filter=pnpm --tag=${NEXT_TAG} --access=public`
return manifest
@@ -60,7 +64,7 @@ export default async (workspaceDir: string) => {
lockfile,
workspaceDir,
}),
}
})
}
async function updateTSConfig (
@@ -68,9 +72,11 @@ async function updateTSConfig (
lockfile: Lockfile
workspaceDir: string
},
tsConfig: object,
dir: string,
manifest: ProjectManifest
tsConfig: object | null,
{
dir,
manifest,
}: FormatPluginFnOptions
) {
if (tsConfig == null) return tsConfig
if (manifest.name === '@pnpm/tsconfig') return tsConfig

View File

@@ -38,7 +38,7 @@
"@commitlint/config-conventional": "^17.1.0",
"@commitlint/prompt-cli": "^17.1.2",
"@pnpm/eslint-config": "workspace:*",
"@pnpm/meta-updater": "0.0.6",
"@pnpm/meta-updater": "0.2.0",
"@pnpm/registry-mock": "3.0.0-3",
"@pnpm/tsconfig": "workspace:*",
"@types/jest": "^28.1.8",

1134
pnpm-lock.yaml generated
View File

File diff suppressed because it is too large Load Diff