Skip to content

Commit

Permalink
chore: update @pnpm/meta-updater (#5360)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibezkrovnyi committed Sep 15, 2022
1 parent 223b23f commit ebf6ee0
Show file tree
Hide file tree
Showing 4 changed files with 900 additions and 255 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-adults-grow.md
@@ -0,0 +1,5 @@
---
"@pnpm-private/updater": minor
---

Changes in meta-updater scripts following @pnpm/meta-updater update
18 changes: 12 additions & 6 deletions .meta-updater/src/index.ts
Expand Up @@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -60,17 +64,19 @@ export default async (workspaceDir: string) => {
lockfile,
workspaceDir,
}),
}
})
}

async function updateTSConfig (
context: {
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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down

0 comments on commit ebf6ee0

Please sign in to comment.