mirror of
https://github.com/pnpm/pnpm.git
synced 2026-02-01 10:42:28 -05:00
refactor!: rename store to storeDir in .modules.yaml
This commit is contained in:
10
.changeset/heavy-ghosts-doubt.md
Normal file
10
.changeset/heavy-ghosts-doubt.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
"@pnpm/get-context": major
|
||||
"@pnpm/headless": major
|
||||
"@pnpm/modules-yaml": major
|
||||
"@pnpm/plugin-commands-rebuild": major
|
||||
"supi": minor
|
||||
"@pnpm/assert-project": minor
|
||||
---
|
||||
|
||||
Rename `store` to `storeDir` in `node_modules/.modules.yaml`.
|
||||
@@ -17,10 +17,10 @@ export default function checkCompatibility (
|
||||
// is the only way to compare paths correctly on Windows
|
||||
// as of Node.js 4-9
|
||||
// See related issue: https://github.com/pnpm/pnpm/issues/996
|
||||
if (path.relative(modules.store, opts.storeDir) !== '') {
|
||||
if (path.relative(modules.storeDir, opts.storeDir) !== '') {
|
||||
throw new UnexpectedStoreError({
|
||||
actualStorePath: opts.storeDir,
|
||||
expectedStorePath: modules.store,
|
||||
expectedStorePath: modules.storeDir,
|
||||
modulesDir: opts.modulesDir,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ export default async (opts: HeadlessOptions) => {
|
||||
registries: opts.registries,
|
||||
shamefullyHoist: opts.shamefullyHoist || false,
|
||||
skipped: Array.from(skipped),
|
||||
store: opts.storeDir,
|
||||
storeDir: opts.storeDir,
|
||||
virtualStoreDir,
|
||||
})
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export interface Modules {
|
||||
registries?: Registries, // nullable for backward compatibility
|
||||
shamefullyHoist: boolean,
|
||||
skipped: string[],
|
||||
store: string,
|
||||
storeDir: string,
|
||||
virtualStoreDir: string,
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ test('write() and read()', async (t) => {
|
||||
},
|
||||
shamefullyHoist: false,
|
||||
skipped: [],
|
||||
store: '/.pnpm-store',
|
||||
storeDir: '/.pnpm-store',
|
||||
virtualStoreDir: path.join(modulesDir, '.pnpm'),
|
||||
}
|
||||
await write(modulesDir, modulesYaml)
|
||||
|
||||
@@ -182,7 +182,7 @@ export async function rebuild (
|
||||
registries: ctx.registries,
|
||||
shamefullyHoist: ctx.shamefullyHoist,
|
||||
skipped: Array.from(ctx.skipped),
|
||||
store: ctx.storeDir,
|
||||
storeDir: ctx.storeDir,
|
||||
virtualStoreDir: ctx.virtualStoreDir,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -842,7 +842,7 @@ async function installInContext (
|
||||
registries: ctx.registries,
|
||||
shamefullyHoist: ctx.shamefullyHoist,
|
||||
skipped: Array.from(ctx.skipped),
|
||||
store: ctx.storeDir,
|
||||
storeDir: ctx.storeDir,
|
||||
virtualStoreDir: ctx.virtualStoreDir,
|
||||
})
|
||||
})(),
|
||||
|
||||
@@ -108,7 +108,7 @@ test('do not fail on non-compatible store when forced during named installation'
|
||||
|
||||
async function saveModulesYaml (pnpmVersion: string, storeDir: string) {
|
||||
await fs.mkdir('node_modules')
|
||||
await fs.writeFile('node_modules/.modules.yaml', `packageManager: pnpm@${pnpmVersion}\nstore: ${storeDir}\nindependentLeaves: false`)
|
||||
await fs.writeFile('node_modules/.modules.yaml', `packageManager: pnpm@${pnpmVersion}\nstoreDir: ${storeDir}\nindependentLeaves: false`)
|
||||
}
|
||||
|
||||
test(`fail on non-compatible ${WANTED_LOCKFILE}`, async (t: tape.Test) => {
|
||||
|
||||
@@ -61,7 +61,7 @@ export default (t: Test, projectPath: string, encodedRegistryName?: string): Pro
|
||||
if (!modulesYaml) {
|
||||
throw new Error(`Cannot find module store. No .modules.yaml found at "${modules}"`)
|
||||
}
|
||||
const storePath = modulesYaml.store
|
||||
const storePath = modulesYaml.storeDir
|
||||
cachedStore = {
|
||||
storePath,
|
||||
...assertStore(t, storePath, ern),
|
||||
|
||||
Reference in New Issue
Block a user