mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-30 04:52:04 -04:00
fix: run prepublish scripts of packages installed from Git (#5837)
close #5826
This commit is contained in:
8
.changeset/fresh-taxis-own.md
Normal file
8
.changeset/fresh-taxis-own.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"@pnpm/prepare-package": major
|
||||
"@pnpm/git-fetcher": major
|
||||
"@pnpm/tarball-fetcher": major
|
||||
"@pnpm/client": major
|
||||
---
|
||||
|
||||
A new required option added to the prepare package function: rawConfig. It is needed in order to create a proper environment for the package manager executed during the preparation of a git-hosted dependency.
|
||||
6
.changeset/lucky-pugs-sell.md
Normal file
6
.changeset/lucky-pugs-sell.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/prepare-package": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Run the prepublish scripts of packages installed from Git [#5826](https://github.com/pnpm/pnpm/issues/5826).
|
||||
1
env/node.fetcher/src/index.ts
vendored
1
env/node.fetcher/src/index.ts
vendored
@@ -34,6 +34,7 @@ export async function fetchNode (fetch: FetchFromRegistry, version: string, targ
|
||||
}
|
||||
const getAuthHeader = () => undefined
|
||||
const fetchers = createTarballFetcher(fetch, getAuthHeader, {
|
||||
rawConfig: {}, // This is not needed for fetching Node.js
|
||||
retry: opts.retry,
|
||||
timeout: opts.fetchTimeout,
|
||||
})
|
||||
|
||||
@@ -64,10 +64,16 @@ test('rebuilds dependencies', async () => {
|
||||
|
||||
{
|
||||
const scripts = project.requireModule('test-git-fetch/output.json')
|
||||
expect(scripts[0]).toBe('preinstall')
|
||||
expect(scripts[1]).toBe('install')
|
||||
expect(scripts[2]).toBe('postinstall')
|
||||
expect(scripts[3]).toBe('prepare')
|
||||
expect(scripts).toStrictEqual([
|
||||
'preinstall',
|
||||
'install',
|
||||
'postinstall',
|
||||
'prepare',
|
||||
'prepublishOnly',
|
||||
'preinstall',
|
||||
'install',
|
||||
'postinstall',
|
||||
])
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -12,10 +12,11 @@
|
||||
"node": ">=14.6"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint src/**/*.ts",
|
||||
"test": "pnpm run compile",
|
||||
"lint": "eslint src/**/*.ts test/**/*.ts",
|
||||
"test": "pnpm run compile && pnpm run _test",
|
||||
"prepublishOnly": "pnpm run compile",
|
||||
"compile": "tsc --build && pnpm run lint --fix"
|
||||
"compile": "tsc --build && pnpm run lint --fix",
|
||||
"_test": "jest"
|
||||
},
|
||||
"repository": "https://github.com/pnpm/pnpm/blob/main/exec/prepare-package",
|
||||
"keywords": [
|
||||
@@ -29,14 +30,21 @@
|
||||
"homepage": "https://github.com/pnpm/pnpm/blob/main/exec/prepare-package#readme",
|
||||
"dependencies": {
|
||||
"@pnpm/error": "workspace:*",
|
||||
"@pnpm/npm-lifecycle": "^2.0.0",
|
||||
"@pnpm/read-package-json": "workspace:*",
|
||||
"@zkochan/rimraf": "^2.1.2",
|
||||
"execa": "npm:safe-execa@^0.1.2",
|
||||
"preferred-pm": "^3.0.3"
|
||||
"preferred-pm": "^3.0.3",
|
||||
"ramda": "npm:@pnpm/ramda@0.28.1"
|
||||
},
|
||||
"funding": "https://opencollective.com/pnpm",
|
||||
"devDependencies": {
|
||||
"@pnpm/prepare-package": "workspace:*"
|
||||
"@pnpm/prepare": "workspace:*",
|
||||
"@pnpm/prepare-package": "workspace:*",
|
||||
"@pnpm/test-fixtures": "workspace:*",
|
||||
"@pnpm/types": "workspace:*",
|
||||
"@types/ramda": "0.28.20",
|
||||
"load-json-file": "^6.2.0"
|
||||
},
|
||||
"exports": {
|
||||
".": "./lib/index.js"
|
||||
|
||||
@@ -1,19 +1,45 @@
|
||||
import path from 'path'
|
||||
import { PnpmError } from '@pnpm/error'
|
||||
import lifecycle from '@pnpm/npm-lifecycle'
|
||||
import { safeReadPackageJsonFromDir } from '@pnpm/read-package-json'
|
||||
import { PackageScripts } from '@pnpm/types'
|
||||
import rimraf from '@zkochan/rimraf'
|
||||
import execa from 'execa'
|
||||
import preferredPM from 'preferred-pm'
|
||||
import omit from 'ramda/src/omit'
|
||||
|
||||
export async function preparePackage (pkgDir: string) {
|
||||
const PREPUBLISH_SCRIPTS = [
|
||||
'prepublish',
|
||||
'prepublishOnly',
|
||||
'prepack',
|
||||
'publish',
|
||||
'postpublish',
|
||||
]
|
||||
|
||||
export async function preparePackage (opts: { rawConfig: object }, pkgDir: string) {
|
||||
const manifest = await safeReadPackageJsonFromDir(pkgDir)
|
||||
if (manifest?.scripts?.prepare != null && manifest.scripts.prepare !== '') {
|
||||
const pm = (await preferredPM(pkgDir))?.name ?? 'npm'
|
||||
try {
|
||||
await execa(pm, ['install'], { cwd: pkgDir })
|
||||
} catch (err: any) { // eslint-disable-line
|
||||
throw new PnpmError('PREPARE_PKG_FAILURE', err.shortMessage ?? err.message)
|
||||
if (manifest?.scripts == null || !packageShouldBeBuilt(manifest.scripts)) return
|
||||
const pm = (await preferredPM(pkgDir))?.name ?? 'npm'
|
||||
// We can't prepare a package without running its lifecycle scripts.
|
||||
// An alternative solution could be to throw an exception.
|
||||
const config = omit(['ignore-scripts'], opts.rawConfig)
|
||||
const env = lifecycle.makeEnv(manifest, { config })
|
||||
const execOpts = { cwd: pkgDir, env, extendEnv: true }
|
||||
try {
|
||||
await execa(pm, ['install'], execOpts)
|
||||
for (const scriptName of PREPUBLISH_SCRIPTS) {
|
||||
if (manifest.scripts[scriptName] == null || manifest.scripts[scriptName] === '') continue
|
||||
await execa(pm, ['run', scriptName], execOpts)
|
||||
}
|
||||
await rimraf(path.join(pkgDir, 'node_modules'))
|
||||
} catch (err: any) { // eslint-disable-line
|
||||
throw new PnpmError('PREPARE_PKG_FAILURE', err.shortMessage ?? err.message)
|
||||
}
|
||||
await rimraf(path.join(pkgDir, 'node_modules'))
|
||||
}
|
||||
|
||||
function packageShouldBeBuilt (packageScripts: PackageScripts): boolean {
|
||||
return [
|
||||
...PREPUBLISH_SCRIPTS,
|
||||
'prepare',
|
||||
].some((scriptName) => packageScripts[scriptName] != null && packageScripts[scriptName] !== '')
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "has-prepublish-script",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"prepublish": "node -e \"process.stdout.write('prepublish')\" | json-append output.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"json-append": "1.1.1"
|
||||
}
|
||||
}
|
||||
0
exec/prepare-package/test/__fixtures__/has-prepublish-script/pnpm-lock.yaml
generated
Normal file
0
exec/prepare-package/test/__fixtures__/has-prepublish-script/pnpm-lock.yaml
generated
Normal file
16
exec/prepare-package/test/index.ts
Normal file
16
exec/prepare-package/test/index.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import path from 'path'
|
||||
import { preparePackage } from '@pnpm/prepare-package'
|
||||
import { tempDir } from '@pnpm/prepare'
|
||||
import { fixtures } from '@pnpm/test-fixtures'
|
||||
import { sync as loadJsonFile } from 'load-json-file'
|
||||
|
||||
const f = fixtures(__dirname)
|
||||
|
||||
test('prepare package runs the prepbublish script', async () => {
|
||||
const tmp = tempDir()
|
||||
f.copy('has-prepublish-script', tmp)
|
||||
await preparePackage({ rawConfig: {} }, tmp)
|
||||
expect(loadJsonFile(path.join(tmp, 'output.json'))).toStrictEqual([
|
||||
'prepublish',
|
||||
])
|
||||
})
|
||||
@@ -9,9 +9,18 @@
|
||||
"../../__typings__/**/*.d.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../__utils__/prepare"
|
||||
},
|
||||
{
|
||||
"path": "../../__utils__/test-fixtures"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/error"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/types"
|
||||
},
|
||||
{
|
||||
"path": "../../pkg-manifest/read-package-json"
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@ import rimraf from '@zkochan/rimraf'
|
||||
import execa from 'execa'
|
||||
import { URL } from 'url'
|
||||
|
||||
export function createGitFetcher (createOpts?: { gitShallowHosts?: string[] }) {
|
||||
export function createGitFetcher (createOpts: { gitShallowHosts?: string[], rawConfig: object }) {
|
||||
const allowedHosts = new Set(createOpts?.gitShallowHosts ?? [])
|
||||
const preparePkg = preparePackage.bind(null, { rawConfig: createOpts.rawConfig })
|
||||
|
||||
const gitFetcher: GitFetcher = async (cafs, resolution, opts) => {
|
||||
const tempLocation = await cafs.tempDir()
|
||||
@@ -18,7 +19,7 @@ export function createGitFetcher (createOpts?: { gitShallowHosts?: string[] }) {
|
||||
await execGit(['clone', resolution.repo, tempLocation])
|
||||
}
|
||||
await execGit(['checkout', resolution.commit], { cwd: tempLocation })
|
||||
await preparePackage(tempLocation)
|
||||
await preparePkg(tempLocation)
|
||||
// removing /.git to make directory integrity calculation faster
|
||||
await rimraf(path.join(tempLocation, '.git'))
|
||||
const filesIndex = await cafs.addFilesFromDir(tempLocation, opts.manifest)
|
||||
|
||||
@@ -22,7 +22,7 @@ beforeEach(() => {
|
||||
|
||||
test('fetch', async () => {
|
||||
const cafsDir = tempy.directory()
|
||||
const fetch = createGitFetcher().git
|
||||
const fetch = createGitFetcher({ rawConfig: {} }).git
|
||||
const manifest = pDefer<DependencyManifest>()
|
||||
const { filesIndex } = await fetch(
|
||||
createCafsStore(cafsDir),
|
||||
@@ -43,7 +43,7 @@ test('fetch', async () => {
|
||||
|
||||
test('fetch a package from Git that has a prepare script', async () => {
|
||||
const cafsDir = tempy.directory()
|
||||
const fetch = createGitFetcher().git
|
||||
const fetch = createGitFetcher({ rawConfig: {} }).git
|
||||
const manifest = pDefer<DependencyManifest>()
|
||||
const { filesIndex } = await fetch(
|
||||
createCafsStore(cafsDir),
|
||||
@@ -62,7 +62,7 @@ test('fetch a package from Git that has a prepare script', async () => {
|
||||
// Test case for https://github.com/pnpm/pnpm/issues/1866
|
||||
test('fetch a package without a package.json', async () => {
|
||||
const cafsDir = tempy.directory()
|
||||
const fetch = createGitFetcher().git
|
||||
const fetch = createGitFetcher({ rawConfig: {} }).git
|
||||
const manifest = pDefer<DependencyManifest>()
|
||||
const { filesIndex } = await fetch(
|
||||
createCafsStore(cafsDir),
|
||||
@@ -82,7 +82,7 @@ test('fetch a package without a package.json', async () => {
|
||||
// Covers the regression reported in https://github.com/pnpm/pnpm/issues/4064
|
||||
test('fetch a big repository', async () => {
|
||||
const cafsDir = tempy.directory()
|
||||
const fetch = createGitFetcher().git
|
||||
const fetch = createGitFetcher({ rawConfig: {} }).git
|
||||
const manifest = pDefer<DependencyManifest>()
|
||||
const { filesIndex } = await fetch(createCafsStore(cafsDir),
|
||||
{
|
||||
@@ -95,7 +95,7 @@ test('fetch a big repository', async () => {
|
||||
|
||||
test('still able to shallow fetch for allowed hosts', async () => {
|
||||
const cafsDir = tempy.directory()
|
||||
const fetch = createGitFetcher({ gitShallowHosts: ['github.com'] }).git
|
||||
const fetch = createGitFetcher({ gitShallowHosts: ['github.com'], rawConfig: {} }).git
|
||||
const manifest = pDefer<DependencyManifest>()
|
||||
const resolution = {
|
||||
commit: 'c9b30e71d704cd30fa71f2edd1ecc7dcc4985493',
|
||||
|
||||
@@ -10,17 +10,17 @@ interface Resolution {
|
||||
tarball: string
|
||||
}
|
||||
|
||||
export function createGitHostedTarballFetcher (fetchRemoteTarball: FetchFunction): FetchFunction {
|
||||
export function createGitHostedTarballFetcher (fetchRemoteTarball: FetchFunction, rawConfig: object): FetchFunction {
|
||||
const fetch = async (cafs: Cafs, resolution: Resolution, opts: FetchOptions) => {
|
||||
const { filesIndex } = await fetchRemoteTarball(cafs, resolution, opts)
|
||||
|
||||
return { filesIndex: await prepareGitHostedPkg(filesIndex as FilesIndex, cafs) }
|
||||
return { filesIndex: await prepareGitHostedPkg(filesIndex as FilesIndex, cafs, rawConfig) }
|
||||
}
|
||||
|
||||
return fetch as FetchFunction
|
||||
}
|
||||
|
||||
async function prepareGitHostedPkg (filesIndex: FilesIndex, cafs: Cafs) {
|
||||
async function prepareGitHostedPkg (filesIndex: FilesIndex, cafs: Cafs, rawConfig: object) {
|
||||
const tempLocation = await cafs.tempDir()
|
||||
await cafs.importPackage(tempLocation, {
|
||||
filesResponse: {
|
||||
@@ -29,7 +29,7 @@ async function prepareGitHostedPkg (filesIndex: FilesIndex, cafs: Cafs) {
|
||||
},
|
||||
force: true,
|
||||
})
|
||||
await preparePackage(tempLocation)
|
||||
await preparePackage({ rawConfig }, tempLocation)
|
||||
const newFilesIndex = await cafs.addFilesFromDir(tempLocation)
|
||||
// Important! We cannot remove the temp location at this stage.
|
||||
// Even though we have the index of the package,
|
||||
|
||||
@@ -31,6 +31,7 @@ export function createTarballFetcher (
|
||||
fetchFromRegistry: FetchFromRegistry,
|
||||
getAuthHeader: GetAuthHeader,
|
||||
opts: {
|
||||
rawConfig: object
|
||||
timeout?: number
|
||||
retry?: RetryTimeoutOptions
|
||||
offline?: boolean
|
||||
@@ -50,7 +51,7 @@ export function createTarballFetcher (
|
||||
return {
|
||||
localTarball: createLocalTarballFetcher(),
|
||||
remoteTarball: remoteTarballFetcher,
|
||||
gitHostedTarball: createGitHostedTarballFetcher(remoteTarballFetcher),
|
||||
gitHostedTarball: createGitHostedTarballFetcher(remoteTarballFetcher, opts.rawConfig),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ const registry = 'http://example.com/'
|
||||
const fetchFromRegistry = createFetchFromRegistry({})
|
||||
const getAuthHeader = () => undefined
|
||||
const fetch = createTarballFetcher(fetchFromRegistry, getAuthHeader, {
|
||||
rawConfig: {},
|
||||
retry: {
|
||||
maxTimeout: 100,
|
||||
minTimeout: 0,
|
||||
@@ -206,6 +207,7 @@ test("don't fail when fetching a local tarball in offline mode", async () => {
|
||||
|
||||
const fetch = createTarballFetcher(fetchFromRegistry, getAuthHeader, {
|
||||
offline: true,
|
||||
rawConfig: {},
|
||||
retry: {
|
||||
maxTimeout: 100,
|
||||
minTimeout: 0,
|
||||
@@ -230,6 +232,7 @@ test('fail when trying to fetch a non-local tarball in offline mode', async () =
|
||||
|
||||
const fetch = createTarballFetcher(fetchFromRegistry, getAuthHeader, {
|
||||
offline: true,
|
||||
rawConfig: {},
|
||||
retry: {
|
||||
maxTimeout: 100,
|
||||
minTimeout: 0,
|
||||
@@ -321,6 +324,7 @@ test('accessing private packages', async () => {
|
||||
|
||||
const getAuthHeader = () => 'Bearer ofjergrg349gj3f2'
|
||||
const fetch = createTarballFetcher(fetchFromRegistry, getAuthHeader, {
|
||||
rawConfig: {},
|
||||
retry: {
|
||||
maxTimeout: 100,
|
||||
minTimeout: 0,
|
||||
|
||||
@@ -17,6 +17,7 @@ export { ResolveFunction }
|
||||
export type ClientOptions = {
|
||||
authConfig: Record<string, string>
|
||||
customFetchers?: CustomFetchers
|
||||
rawConfig: object
|
||||
retry?: RetryTimeoutOptions
|
||||
timeout?: number
|
||||
userAgent?: string
|
||||
@@ -53,7 +54,7 @@ type Fetchers = {
|
||||
function createFetchers (
|
||||
fetchFromRegistry: FetchFromRegistry,
|
||||
getAuthHeader: GetAuthHeader,
|
||||
opts: Pick<ClientOptions, 'retry' | 'gitShallowHosts' | 'resolveSymlinksInInjectedDirs'>,
|
||||
opts: Pick<ClientOptions, 'rawConfig' | 'retry' | 'gitShallowHosts' | 'resolveSymlinksInInjectedDirs'>,
|
||||
customFetchers?: CustomFetchers
|
||||
): Fetchers {
|
||||
const defaultFetchers = {
|
||||
|
||||
@@ -5,6 +5,7 @@ test('createClient()', () => {
|
||||
const client = createClient({
|
||||
authConfig: { registry: 'https://registry.npmjs.org/' },
|
||||
cacheDir: '',
|
||||
rawConfig: {},
|
||||
})
|
||||
expect(typeof client === 'object').toBeTruthy()
|
||||
})
|
||||
@@ -13,6 +14,7 @@ test('createResolver()', () => {
|
||||
const resolver = createResolver({
|
||||
authConfig: { registry: 'https://registry.npmjs.org/' },
|
||||
cacheDir: '',
|
||||
rawConfig: {},
|
||||
})
|
||||
expect(typeof resolver === 'function').toBeTruthy()
|
||||
})
|
||||
|
||||
@@ -278,6 +278,7 @@ test('run prepare script for git-hosted dependencies', async () => {
|
||||
'install',
|
||||
'postinstall',
|
||||
'prepare',
|
||||
'prepublishOnly',
|
||||
'preinstall',
|
||||
'install',
|
||||
'postinstall',
|
||||
|
||||
@@ -39,6 +39,7 @@ export async function testDefaults<T> (
|
||||
const cacheDir = path.resolve('cache')
|
||||
const { resolve, fetchers } = createClient({
|
||||
authConfig,
|
||||
rawConfig: {},
|
||||
retry: retryOpts,
|
||||
cacheDir,
|
||||
...resolveOpts,
|
||||
|
||||
@@ -45,6 +45,7 @@ export async function testDefaults (
|
||||
const authConfig = { registry }
|
||||
const { resolve, fetchers } = createClient({
|
||||
authConfig,
|
||||
rawConfig: {},
|
||||
retry: retryOpts,
|
||||
cacheDir,
|
||||
...resolveOpts,
|
||||
|
||||
@@ -26,6 +26,7 @@ const authConfig = { registry }
|
||||
const { resolve, fetchers } = createClient({
|
||||
authConfig,
|
||||
cacheDir: '.store',
|
||||
rawConfig: {},
|
||||
})
|
||||
|
||||
test('request package', async () => {
|
||||
@@ -522,6 +523,7 @@ test('fetchPackageToStore() does not cache errors', async () => {
|
||||
|
||||
const noRetry = createClient({
|
||||
authConfig,
|
||||
rawConfig: {},
|
||||
retry: { retries: 0 },
|
||||
cacheDir: '.pnpm',
|
||||
})
|
||||
|
||||
35
pnpm-lock.yaml
generated
35
pnpm-lock.yaml
generated
@@ -1226,6 +1226,9 @@ importers:
|
||||
'@pnpm/error':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/error
|
||||
'@pnpm/npm-lifecycle':
|
||||
specifier: ^2.0.0
|
||||
version: 2.0.0_typanion@3.12.1
|
||||
'@pnpm/read-package-json':
|
||||
specifier: workspace:*
|
||||
version: link:../../pkg-manifest/read-package-json
|
||||
@@ -1238,10 +1241,28 @@ importers:
|
||||
preferred-pm:
|
||||
specifier: ^3.0.3
|
||||
version: 3.0.3
|
||||
ramda:
|
||||
specifier: npm:@pnpm/ramda@0.28.1
|
||||
version: /@pnpm/ramda/0.28.1
|
||||
devDependencies:
|
||||
'@pnpm/prepare':
|
||||
specifier: workspace:*
|
||||
version: link:../../__utils__/prepare
|
||||
'@pnpm/prepare-package':
|
||||
specifier: workspace:*
|
||||
version: 'link:'
|
||||
'@pnpm/test-fixtures':
|
||||
specifier: workspace:*
|
||||
version: link:../../__utils__/test-fixtures
|
||||
'@pnpm/types':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/types
|
||||
'@types/ramda':
|
||||
specifier: 0.28.20
|
||||
version: 0.28.20
|
||||
load-json-file:
|
||||
specifier: ^6.2.0
|
||||
version: 6.2.0
|
||||
|
||||
exec/run-npm:
|
||||
dependencies:
|
||||
@@ -11819,7 +11840,7 @@ packages:
|
||||
resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==}
|
||||
engines: {node: '>= 8'}
|
||||
dependencies:
|
||||
minipass: 3.3.5
|
||||
minipass: 3.3.6
|
||||
|
||||
/fs-mkdirp-stream/1.0.0:
|
||||
resolution: {integrity: sha512-+vSd9frUnapVC2RZYfL3FCB2p3g4TBhaUmrsWlSudsGdnxIuUvBB2QM1VZeBtc49QFwrp+wQLrDs3+xxDgI5gQ==}
|
||||
@@ -14030,7 +14051,7 @@ packages:
|
||||
resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==}
|
||||
engines: {node: '>= 8'}
|
||||
dependencies:
|
||||
minipass: 3.3.5
|
||||
minipass: 3.3.6
|
||||
|
||||
/minipass-fetch/1.4.1:
|
||||
resolution: {integrity: sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==}
|
||||
@@ -14058,19 +14079,19 @@ packages:
|
||||
resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==}
|
||||
engines: {node: '>= 8'}
|
||||
dependencies:
|
||||
minipass: 3.3.5
|
||||
minipass: 3.3.6
|
||||
|
||||
/minipass-pipeline/1.2.4:
|
||||
resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==}
|
||||
engines: {node: '>=8'}
|
||||
dependencies:
|
||||
minipass: 3.3.5
|
||||
minipass: 3.3.6
|
||||
|
||||
/minipass-sized/1.0.3:
|
||||
resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==}
|
||||
engines: {node: '>=8'}
|
||||
dependencies:
|
||||
minipass: 3.3.5
|
||||
minipass: 3.3.6
|
||||
|
||||
/minipass/3.3.4:
|
||||
resolution: {integrity: sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==}
|
||||
@@ -14100,7 +14121,7 @@ packages:
|
||||
resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
|
||||
engines: {node: '>= 8'}
|
||||
dependencies:
|
||||
minipass: 3.3.5
|
||||
minipass: 3.3.6
|
||||
yallist: 4.0.0
|
||||
|
||||
/mixme/0.5.4:
|
||||
@@ -16069,7 +16090,7 @@ packages:
|
||||
resolution: {integrity: sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==}
|
||||
engines: {node: '>= 8'}
|
||||
dependencies:
|
||||
minipass: 3.3.5
|
||||
minipass: 3.3.6
|
||||
|
||||
/ssri/9.0.1:
|
||||
resolution: {integrity: sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==}
|
||||
|
||||
@@ -14,6 +14,7 @@ describe('store.importPackage()', () => {
|
||||
const { resolve, fetchers } = createClient({
|
||||
authConfig,
|
||||
cacheDir: path.join(tmp, 'cache'),
|
||||
rawConfig: {},
|
||||
})
|
||||
const storeController = await createPackageStore(resolve, fetchers, {
|
||||
storeDir,
|
||||
@@ -51,6 +52,7 @@ describe('store.importPackage()', () => {
|
||||
const { resolve, fetchers } = createClient({
|
||||
authConfig,
|
||||
cacheDir: path.join(tmp, 'cache'),
|
||||
rawConfig: {},
|
||||
})
|
||||
const storeController = await createPackageStore(resolve, fetchers, {
|
||||
packageImportMethod: 'copy',
|
||||
|
||||
@@ -23,6 +23,7 @@ async function createStoreController (storeDir?: string) {
|
||||
const { resolve, fetchers } = createClient({
|
||||
authConfig,
|
||||
cacheDir,
|
||||
rawConfig: {},
|
||||
})
|
||||
return createPackageStore(resolve, fetchers, {
|
||||
networkConcurrency: 1,
|
||||
|
||||
@@ -63,6 +63,7 @@ export async function createNewStoreController (
|
||||
noProxy: opts.noProxy,
|
||||
offline: opts.offline,
|
||||
preferOffline: opts.preferOffline,
|
||||
rawConfig: opts.rawConfig,
|
||||
retry: {
|
||||
factor: opts.fetchRetryFactor,
|
||||
maxTimeout: opts.fetchRetryMaxtimeout,
|
||||
|
||||
Reference in New Issue
Block a user