mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-24 07:38:12 -05:00
refactor: rootProjectManifestDir is a required option
This commit is contained in:
5
.changeset/kind-toys-prove.md
Normal file
5
.changeset/kind-toys-prove.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-installation": patch
|
||||
---
|
||||
|
||||
`pnpm fetch` read settings from root project manifest.
|
||||
14
.changeset/silver-rice-battle.md
Normal file
14
.changeset/silver-rice-battle.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-installation": major
|
||||
"@pnpm/plugin-commands-script-runners": major
|
||||
"@pnpm/plugin-commands-licenses": major
|
||||
"@pnpm/plugin-commands-outdated": major
|
||||
"@pnpm/plugin-commands-patching": major
|
||||
"@pnpm/plugin-commands-listing": major
|
||||
"@pnpm/plugin-commands-deploy": major
|
||||
"@pnpm/plugin-commands-audit": major
|
||||
"@pnpm/plugin-commands-rebuild": major
|
||||
"@pnpm/config": minor
|
||||
---
|
||||
|
||||
`rootProjectManifestDir` is a required field.
|
||||
@@ -169,7 +169,7 @@ export interface Config {
|
||||
|
||||
testPattern?: string[]
|
||||
changedFilesIgnorePattern?: string[]
|
||||
rootProjectManifestDir?: string
|
||||
rootProjectManifestDir: string
|
||||
rootProjectManifest?: ProjectManifest
|
||||
userConfig: Record<string, string>
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ export async function extendRebuildOptions (
|
||||
...defaultOpts,
|
||||
...opts,
|
||||
storeDir: defaultOpts.storeDir,
|
||||
...(opts.rootProjectManifest ? getOptionsFromRootManifest(opts.rootProjectManifestDir!, opts.rootProjectManifest) : {}),
|
||||
...(opts.rootProjectManifest ? getOptionsFromRootManifest(opts.rootProjectManifestDir, opts.rootProjectManifest) : {}),
|
||||
}
|
||||
extendedOpts.registries = normalizeRegistries(extendedOpts.registries)
|
||||
return extendedOpts
|
||||
|
||||
@@ -79,6 +79,8 @@ export async function handler (
|
||||
| 'lockfileDir'
|
||||
| 'nodeLinker'
|
||||
| 'rawLocalConfig'
|
||||
| 'rootProjectManifest'
|
||||
| 'rootProjectManifestDir'
|
||||
| 'registries'
|
||||
| 'scriptShell'
|
||||
| 'selectedProjectsGraph'
|
||||
|
||||
@@ -25,6 +25,8 @@ type RecursiveRebuildOpts = CreateStoreControllerOptions & Pick<Config,
|
||||
| 'nodeLinker'
|
||||
| 'rawLocalConfig'
|
||||
| 'registries'
|
||||
| 'rootProjectManifest'
|
||||
| 'rootProjectManifestDir'
|
||||
| 'sharedWorkspaceLockfile'
|
||||
> & {
|
||||
pending?: boolean
|
||||
|
||||
@@ -38,6 +38,7 @@ export const DEFAULT_OPTS = {
|
||||
rawLocalConfig: {},
|
||||
registries: { default: REGISTRY },
|
||||
registry: REGISTRY,
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
storeDir: '../store',
|
||||
strictSsl: false,
|
||||
|
||||
@@ -90,10 +90,11 @@ export async function handler (
|
||||
await add.handler({
|
||||
// Ideally the config reader should ignore these settings when the dlx command is executed.
|
||||
// This is a temporary solution until "@pnpm/config" is refactored.
|
||||
...omit(['workspaceDir', 'rootProjectManifest', 'rootProjectManifestDir'], opts),
|
||||
...omit(['workspaceDir', 'rootProjectManifest'], opts),
|
||||
bin: binsDir,
|
||||
dir: prefix,
|
||||
lockfileDir: prefix,
|
||||
rootProjectManifestDir: prefix, // This property won't be used as rootProjectManifest will be undefined
|
||||
}, pkgs)
|
||||
const binName = opts.package
|
||||
? command
|
||||
|
||||
@@ -40,6 +40,7 @@ export const DEFAULT_OPTS = {
|
||||
proxy: undefined,
|
||||
rawConfig: { registry: REGISTRY_URL },
|
||||
rawLocalConfig: {},
|
||||
rootProjectManifestDir: '',
|
||||
registries: { default: REGISTRY_URL },
|
||||
registry: REGISTRY_URL,
|
||||
sort: true,
|
||||
@@ -74,6 +75,7 @@ export const DLX_DEFAULT_OPTS = {
|
||||
registries: {
|
||||
default: REGISTRY_URL,
|
||||
},
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
storeDir: path.join(tmp, 'store'),
|
||||
userConfig: {},
|
||||
|
||||
@@ -50,6 +50,7 @@ export const DEFAULT_OPTS = {
|
||||
rawConfig,
|
||||
rawLocalConfig: {},
|
||||
registries,
|
||||
rootProjectManifestDir: '',
|
||||
// registry: REGISTRY,
|
||||
sort: true,
|
||||
storeDir: '../store',
|
||||
|
||||
@@ -39,6 +39,7 @@ export const DEFAULT_OPTS = {
|
||||
rawLocalConfig: {},
|
||||
registries: { default: REGISTRY },
|
||||
registry: REGISTRY,
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
storeDir: '../store',
|
||||
strictSsl: false,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { docsUrl } from '@pnpm/cli-utils'
|
||||
import { UNIVERSAL_OPTIONS } from '@pnpm/common-cli-options-help'
|
||||
import { type Config } from '@pnpm/config'
|
||||
import { type Config, getOptionsFromRootManifest } from '@pnpm/config'
|
||||
import { createOrConnectStoreController, type CreateStoreControllerOptions } from '@pnpm/store-connection-manager'
|
||||
import { type InstallOptions, mutateModulesInSingleProject } from '@pnpm/core'
|
||||
import renderHelp from 'render-help'
|
||||
@@ -45,7 +45,7 @@ export function help () {
|
||||
}
|
||||
|
||||
export async function handler (
|
||||
opts: Pick<Config, 'production' | 'dev'> & CreateStoreControllerOptions
|
||||
opts: Pick<Config, 'production' | 'dev' | 'rootProjectManifest' | 'rootProjectManifestDir'> & CreateStoreControllerOptions
|
||||
) {
|
||||
const store = await createOrConnectStoreController(opts)
|
||||
const include = {
|
||||
@@ -61,6 +61,7 @@ export async function handler (
|
||||
rootDir: process.cwd(),
|
||||
}, {
|
||||
...opts,
|
||||
...getOptionsFromRootManifest(opts.rootProjectManifestDir, opts.rootProjectManifest ?? {}),
|
||||
ignorePackageManifest: true,
|
||||
include,
|
||||
modulesCacheMaxAge: 0,
|
||||
|
||||
@@ -271,6 +271,7 @@ export type InstallCommandOptions = Pick<Config,
|
||||
| 'production'
|
||||
| 'registries'
|
||||
| 'rootProjectManifest'
|
||||
| 'rootProjectManifestDir'
|
||||
| 'save'
|
||||
| 'saveDev'
|
||||
| 'saveExact'
|
||||
|
||||
@@ -32,6 +32,7 @@ const DEFAULT_OPTIONS = {
|
||||
registries: {
|
||||
default: REGISTRY_URL,
|
||||
},
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
storeDir: path.join(tmp, 'store'),
|
||||
userConfig: {},
|
||||
|
||||
@@ -28,6 +28,7 @@ const DEFAULT_OPTIONS = {
|
||||
registries: {
|
||||
default: REGISTRY_URL,
|
||||
},
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
userConfig: {},
|
||||
workspaceConcurrency: 1,
|
||||
|
||||
@@ -31,6 +31,7 @@ const DEFAULT_OPTIONS = {
|
||||
registries: {
|
||||
default: REGISTRY_URL,
|
||||
},
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
storeDir: path.join(tmp, 'store'),
|
||||
userConfig: {},
|
||||
|
||||
@@ -33,6 +33,7 @@ const DEFAULT_OPTS = {
|
||||
rawConfig: { registry: REGISTRY },
|
||||
registries: { default: REGISTRY },
|
||||
registry: REGISTRY,
|
||||
rootProjectManifestDir: '',
|
||||
storeDir: path.join(TMP, 'store'),
|
||||
strictSsl: false,
|
||||
userAgent: 'pnpm',
|
||||
|
||||
@@ -31,6 +31,7 @@ const DEFAULT_OPTS = {
|
||||
rawConfig: { registry: REGISTRY },
|
||||
registries: { default: REGISTRY },
|
||||
registry: REGISTRY,
|
||||
rootProjectManifestDir: '',
|
||||
storeDir: path.join(TMP, 'store'),
|
||||
strictSsl: false,
|
||||
userAgent: 'pnpm',
|
||||
|
||||
@@ -30,6 +30,7 @@ const DEFAULT_OPTIONS = {
|
||||
registries: {
|
||||
default: REGISTRY_URL,
|
||||
},
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
storeDir: path.join(TMP, 'store'),
|
||||
userConfig: {},
|
||||
|
||||
@@ -30,6 +30,7 @@ const DEFAULT_OPTIONS = {
|
||||
registries: {
|
||||
default: REGISTRY_URL,
|
||||
},
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
userConfig: {},
|
||||
workspaceConcurrency: 1,
|
||||
|
||||
@@ -37,6 +37,7 @@ const DEFAULT_OPTIONS = {
|
||||
registries: {
|
||||
default: REGISTRY_URL,
|
||||
},
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
userConfig: {},
|
||||
workspaceConcurrency: 1,
|
||||
|
||||
@@ -40,6 +40,7 @@ export const DEFAULT_OPTS = {
|
||||
rawLocalConfig: {},
|
||||
registries: { default: REGISTRY },
|
||||
registry: REGISTRY,
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
storeDir: '../store',
|
||||
strictSsl: false,
|
||||
|
||||
@@ -40,6 +40,7 @@ export const DEFAULT_OPTS = {
|
||||
rawLocalConfig: {},
|
||||
registries: { default: REGISTRY },
|
||||
registry: REGISTRY,
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
storeDir: '../store',
|
||||
strictSsl: false,
|
||||
|
||||
@@ -25,6 +25,8 @@ Config,
|
||||
| 'modulesDir'
|
||||
| 'pnpmHomeDir'
|
||||
| 'selectedProjectsGraph'
|
||||
| 'rootProjectManifest'
|
||||
| 'rootProjectManifestDir'
|
||||
> &
|
||||
Partial<Pick<Config, 'userConfig'>>
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ export const DEFAULT_OPTS = {
|
||||
rawConfig: { registry: REGISTRY },
|
||||
rawLocalConfig: {},
|
||||
registries: { default: REGISTRY },
|
||||
rootProjectManifestDir: '',
|
||||
// registry: REGISTRY,
|
||||
sort: true,
|
||||
storeDir: '../store',
|
||||
|
||||
@@ -38,6 +38,7 @@ export const DEFAULT_OPTS = {
|
||||
rawLocalConfig: {},
|
||||
registries: { default: REGISTRY },
|
||||
registry: REGISTRY,
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
storeDir: '../store',
|
||||
strictSsl: false,
|
||||
|
||||
@@ -41,6 +41,7 @@ export const DEFAULT_OPTS = {
|
||||
rawLocalConfig: {},
|
||||
registries: { default: REGISTRY },
|
||||
registry: REGISTRY,
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
storeDir: '../store',
|
||||
strictSsl: false,
|
||||
|
||||
Reference in New Issue
Block a user