Skip to content

Commit 0ef0c52

Browse files
authored
Merge branch 'main' into rss1102/issue-2603-private-registry-auth
2 parents 27d5247 + 5030f07 commit 0ef0c52

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_pack_tsdown_023/snapshots.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ steps = [
8484
[[case]]
8585
name = "migration_pack_tsdown_023_no_external"
8686
vp = "global"
87+
local-registry = true
8788
comment = "Migrate noExternal patterns, references, and callbacks and confirm the dependency remains bundled."
8889
steps = [
8990
{ argv = ["vpt", "cp", "no-external.config.txt", "vite.config.ts"], snapshot = false },

crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_stale_vitest_alias_startup/pnpm-workspace.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ packages:
22
- .
33

44
catalog:
5-
vite: npm:@voidzero-dev/vite-plus-core@0.3.0
6-
vite-plus: 0.3.0
5+
vite: npm:@voidzero-dev/vite-plus-core@__VITE_PLUS_VERSION__
6+
vite-plus: __VITE_PLUS_VERSION__
77
vitest: npm:@voidzero-dev/vite-plus-test@0.1.24
88

99
overrides:

crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_stale_vitest_alias_startup/setup-local.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ const localPackageDir = path.join('node_modules', 'vite-plus');
99
fs.mkdirSync('node_modules', { recursive: true });
1010
fs.cpSync(sourcePackageDir, localPackageDir, { recursive: true, dereference: true });
1111

12+
// Keep Vite+ current so the fixture tests only the stale Vitest alias.
13+
const { version } = JSON.parse(fs.readFileSync(path.join(sourcePackageDir, 'package.json'), 'utf8'));
14+
const workspaceConfig = fs.readFileSync('pnpm-workspace.yaml', 'utf8');
15+
fs.writeFileSync('pnpm-workspace.yaml', workspaceConfig.replaceAll('__VITE_PLUS_VERSION__', version));
16+
1217
const fakeVitestDir = path.join('node_modules', 'vitest');
1318
fs.mkdirSync(fakeVitestDir, { recursive: true });
1419
fs.writeFileSync(
@@ -28,6 +33,6 @@ fs.writeFileSync(
2833
"throw new Error('stale Vitest alias was loaded before command dispatch');\n",
2934
);
3035

31-
// This file only prepares node_modules. Remove the staged copy so migration's
32-
// source-import pass measures the project fixture rather than its test harness.
36+
// Remove the staged copy so migration's source-import pass measures the
37+
// project fixture rather than its test harness.
3338
fs.rmSync(new URL(import.meta.url));

packages/tools/src/local-npm-registry.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,8 @@ const server = createServer(async (req, res) => {
523523

524524
// Registry env for every package manager, each of which reads its own
525525
// spelling: npm and bun honor NPM_CONFIG_REGISTRY, pnpm >= 10.6 only reads
526-
// PNPM_CONFIG_* (older pnpm read the lowercase npm_config_* form), and Yarn
526+
// PNPM_CONFIG_* (pnpm 11.0 requires lowercase pnpm_config_*; older pnpm
527+
// read the lowercase npm_config_* form), and Yarn
527528
// Berry only reads YARN_-prefixed settings and refuses plain-http registries
528529
// unless the host is whitelisted.
529530
//
@@ -549,6 +550,7 @@ function buildRegistryEnv(registry: string): Record<string, string> {
549550
NPM_CONFIG_REGISTRY: registry,
550551
npm_config_registry: registry,
551552
PNPM_CONFIG_REGISTRY: registry,
553+
pnpm_config_registry: registry,
552554
YARN_NPM_REGISTRY_SERVER: registry,
553555
YARN_UNSAFE_HTTP_WHITELIST: '127.0.0.1',
554556
NO_PROXY: noProxy,

0 commit comments

Comments
 (0)