Skip to content

Commit bb7b85b

Browse files
author
a.zavernyaev
committed
Fix windows build and update Cargo.lock
1 parent 0ad5cb0 commit bb7b85b

10 files changed

Lines changed: 610 additions & 613 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/vite_install/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ reqwest = { workspace = true, features = ["stream", "native-tls-vendored", "json
3838

3939
[target.'cfg(not(target_os = "windows"))'.dependencies]
4040
reqwest = { workspace = true, features = ["stream", "rustls-no-provider", "json"] }
41-
rustls = { workspace = true }
4241

4342
[dev-dependencies]
4443
httpmock = { workspace = true }

crates/vite_install/src/request.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ use tar::Archive;
1111
use tokio::{fs, io::AsyncWriteExt};
1212
use vite_error::Error;
1313

14-
#[cfg(not(target_os = "windows"))]
15-
fn ensure_tls_provider() {
16-
static INIT: std::sync::OnceLock<()> = std::sync::OnceLock::new();
17-
INIT.get_or_init(|| {
18-
let _ = rustls::crypto::ring::default_provider().install_default();
19-
});
20-
}
21-
2214
/// HTTP client with built-in retry support
2315
#[derive(Clone)]
2416
pub struct HttpClient {
@@ -65,7 +57,7 @@ impl HttpClient {
6557
}
6658

6759
async fn get(&self, url: &str) -> Result<Response, Error> {
68-
ensure_tls_provider();
60+
vite_shared::ensure_tls_provider();
6961

7062
let response = (|| async { reqwest::get(url).await?.error_for_status() })
7163
.retry(

crates/vite_js_runtime/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ reqwest = { workspace = true, features = ["stream", "native-tls-vendored"] }
3333

3434
[target.'cfg(not(target_os = "windows"))'.dependencies]
3535
reqwest = { workspace = true, features = ["stream", "rustls-no-provider"] }
36-
rustls = { workspace = true }
3736

3837
[dev-dependencies]
3938
tempfile = { workspace = true }

crates/vite_js_runtime/src/download.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@ use vite_str::Str;
1515

1616
use crate::{Error, provider::ArchiveFormat};
1717

18-
#[cfg(not(target_os = "windows"))]
19-
fn ensure_tls_provider() {
20-
static INIT: std::sync::OnceLock<()> = std::sync::OnceLock::new();
21-
INIT.get_or_init(|| {
22-
let _ = rustls::crypto::ring::default_provider().install_default();
23-
});
24-
}
25-
2618
/// Response from a cached fetch operation
2719
pub struct CachedFetchResponse {
2820
/// Response body (None if 304 Not Modified)
@@ -45,7 +37,7 @@ pub async fn download_file(
4537
target_path: &AbsolutePath,
4638
message: &str,
4739
) -> Result<(), Error> {
48-
ensure_tls_provider();
40+
vite_shared::ensure_tls_provider();
4941

5042
tracing::debug!("Downloading {url} to {target_path:?}");
5143

@@ -124,7 +116,7 @@ pub async fn download_file(
124116
/// Download text content from a URL with retry logic
125117
#[expect(clippy::disallowed_types, reason = "HTTP response body is a String")]
126118
pub async fn download_text(url: &str) -> Result<String, Error> {
127-
ensure_tls_provider();
119+
vite_shared::ensure_tls_provider();
128120

129121
tracing::debug!("Downloading text from {url}");
130122

@@ -149,7 +141,7 @@ pub async fn fetch_with_cache_headers(
149141
url: &str,
150142
if_none_match: Option<&str>,
151143
) -> Result<CachedFetchResponse, Error> {
152-
ensure_tls_provider();
144+
vite_shared::ensure_tls_provider();
153145

154146
tracing::debug!("Fetching with cache headers from {url}");
155147

crates/vite_shared/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ tracing-subscriber = { workspace = true }
1818
vite_path = { workspace = true }
1919
vite_str = { workspace = true }
2020

21+
[target.'cfg(not(target_os = "windows"))'.dependencies]
22+
rustls = { workspace = true }
23+
2124
[lints]
2225
workspace = true

crates/vite_shared/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pub mod output;
88
mod package_json;
99
mod path_env;
1010
pub mod string_similarity;
11+
mod tls;
1112
mod tracing;
1213

1314
pub use env_config::{EnvConfig, TestEnvGuard};
@@ -17,4 +18,5 @@ pub use path_env::{
1718
PrependOptions, PrependResult, format_path_prepended, format_path_with_prepend,
1819
prepend_to_path_env,
1920
};
21+
pub use tls::ensure_tls_provider;
2022
pub use tracing::init_tracing;

crates/vite_shared/src/tls.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/// Ensure a TLS crypto provider is installed (no-op on Windows which uses native-tls).
2+
#[cfg(not(target_os = "windows"))]
3+
pub fn ensure_tls_provider() {
4+
static INIT: std::sync::OnceLock<()> = std::sync::OnceLock::new();
5+
INIT.get_or_init(|| {
6+
let _ = rustls::crypto::ring::default_provider().install_default();
7+
});
8+
}
9+
10+
#[cfg(target_os = "windows")]
11+
pub fn ensure_tls_provider() {}

pnpm-lock.yaml

Lines changed: 526 additions & 526 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,45 @@ packages:
55
- vite
66
- vite/packages/*
77
catalog:
8-
'@babel/core': ^7.24.7
9-
'@babel/preset-env': ^7.24.7
10-
'@babel/preset-typescript': ^7.24.7
11-
'@clack/core': ^1.0.0
12-
'@iconify/vue': ^5.0.0
13-
'@napi-rs/cli': ^3.4.1
14-
'@napi-rs/wasm-runtime': ^1.0.0
15-
'@nkzw/safe-word-list': ^3.1.0
16-
'@oxc-node/cli': ^0.0.35
17-
'@oxc-node/core': ^0.0.35
18-
'@oxc-project/runtime': =0.121.0
19-
'@oxc-project/types': =0.122.0
20-
'@pnpm/find-workspace-packages': ^6.0.9
21-
'@rollup/plugin-commonjs': ^29.0.0
22-
'@rollup/plugin-json': ^6.1.0
23-
'@rollup/plugin-node-resolve': ^16.0.0
24-
'@types/babel__core': 7.20.5
25-
'@types/connect': ^3.4.38
26-
'@types/cross-spawn': ^6.0.6
27-
'@types/fs-extra': ^11.0.4
28-
'@types/lodash-es': ^4.17.12
29-
'@types/mocha': 10.0.10
30-
'@types/node': 24.10.3
31-
'@types/picomatch': ^4.0.0
32-
'@types/react': ^19.1.8
33-
'@types/react-dom': ^19.1.6
34-
'@types/semver': ^7.7.1
35-
'@types/serve-static': ^2.0.0
36-
'@types/strip-comments': ^2.0.4
37-
'@types/validate-npm-package-name': ^4.0.2
38-
'@types/ws': ^8.18.0
39-
'@typescript/native-preview': 7.0.0-dev.20260122.2
40-
'@vitejs/plugin-react': ^5.1.2
41-
'@vitest/browser': ^4.0.9
42-
'@vitest/browser-playwright': ^4.0.9
43-
'@voidzero-dev/vitepress-theme': 4.8.3
44-
'@vueuse/core': ^14.0.0
45-
'@yarnpkg/fslib': ^3.1.3
46-
'@yarnpkg/shell': ^4.1.3
8+
"@babel/core": ^7.24.7
9+
"@babel/preset-env": ^7.24.7
10+
"@babel/preset-typescript": ^7.24.7
11+
"@clack/core": ^1.0.0
12+
"@iconify/vue": ^5.0.0
13+
"@napi-rs/cli": ^3.4.1
14+
"@napi-rs/wasm-runtime": ^1.0.0
15+
"@nkzw/safe-word-list": ^3.1.0
16+
"@oxc-node/cli": ^0.0.35
17+
"@oxc-node/core": ^0.0.35
18+
"@oxc-project/runtime": =0.121.0
19+
"@oxc-project/types": =0.122.0
20+
"@pnpm/find-workspace-packages": ^6.0.9
21+
"@rollup/plugin-commonjs": ^29.0.0
22+
"@rollup/plugin-json": ^6.1.0
23+
"@rollup/plugin-node-resolve": ^16.0.0
24+
"@types/babel__core": 7.20.5
25+
"@types/connect": ^3.4.38
26+
"@types/cross-spawn": ^6.0.6
27+
"@types/fs-extra": ^11.0.4
28+
"@types/lodash-es": ^4.17.12
29+
"@types/mocha": 10.0.10
30+
"@types/node": 24.10.3
31+
"@types/picomatch": ^4.0.0
32+
"@types/react": ^19.1.8
33+
"@types/react-dom": ^19.1.6
34+
"@types/semver": ^7.7.1
35+
"@types/serve-static": ^2.0.0
36+
"@types/strip-comments": ^2.0.4
37+
"@types/validate-npm-package-name": ^4.0.2
38+
"@types/ws": ^8.18.0
39+
"@typescript/native-preview": 7.0.0-dev.20260122.2
40+
"@vitejs/plugin-react": ^5.1.2
41+
"@vitest/browser": ^4.0.9
42+
"@vitest/browser-playwright": ^4.0.9
43+
"@voidzero-dev/vitepress-theme": 4.8.3
44+
"@vueuse/core": ^14.0.0
45+
"@yarnpkg/fslib": ^3.1.3
46+
"@yarnpkg/shell": ^4.1.3
4747
acorn: ^8.12.1
4848
acorn-import-assertions: ^1.9.0
4949
astring: ^1.9.0
@@ -124,22 +124,22 @@ catalogMode: prefer
124124
ignoreScripts: true
125125
minimumReleaseAge: 1440
126126
minimumReleaseAgeExclude:
127-
- '@napi-rs/*'
128-
- '@nkzw/*'
129-
- '@oxc-minify/*'
130-
- '@oxc-parser/*'
131-
- '@oxc-project/*'
132-
- '@oxc-resolver/*'
133-
- '@oxc-transform/*'
134-
- '@oxfmt/*'
135-
- '@oxlint-tsgolint/*'
136-
- '@oxlint/*'
137-
- '@rolldown/*'
138-
- '@tsdown/*'
139-
- '@types/*'
140-
- '@vitejs/*'
141-
- '@vitest/*'
142-
- '@voidzero-dev/*'
127+
- "@napi-rs/*"
128+
- "@nkzw/*"
129+
- "@oxc-minify/*"
130+
- "@oxc-parser/*"
131+
- "@oxc-project/*"
132+
- "@oxc-resolver/*"
133+
- "@oxc-transform/*"
134+
- "@oxfmt/*"
135+
- "@oxlint-tsgolint/*"
136+
- "@oxlint/*"
137+
- "@rolldown/*"
138+
- "@tsdown/*"
139+
- "@types/*"
140+
- "@vitejs/*"
141+
- "@vitest/*"
142+
- "@voidzero-dev/*"
143143
- oxc-minify
144144
- oxc-parser
145145
- oxc-transform
@@ -157,21 +157,21 @@ minimumReleaseAgeExclude:
157157
- vitest
158158
- vue-virtual-scroller
159159
overrides:
160-
'@rolldown/pluginutils': workspace:@rolldown/pluginutils@*
160+
"@rolldown/pluginutils": workspace:@rolldown/pluginutils@*
161161
rolldown: workspace:rolldown@*
162162
vite: workspace:@voidzero-dev/vite-plus-core@*
163163
vitest: workspace:@voidzero-dev/vite-plus-test@*
164164
vitest-dev: npm:vitest@^4.1.1
165165
packageExtensions:
166166
sass-embedded:
167167
peerDependencies:
168-
source-map-js: '*'
168+
source-map-js: "*"
169169
peerDependenciesMeta:
170170
source-map-js:
171171
optional: true
172-
'@rollup/plugin-dynamic-import-vars':
172+
"@rollup/plugin-dynamic-import-vars":
173173
dependencies:
174-
'@types/estree': ^1.0.0
174+
"@types/estree": ^1.0.0
175175
patchedDependencies:
176176
sirv@3.0.2: vite/patches/sirv@3.0.2.patch
177177
chokidar@3.6.0: vite/patches/chokidar@3.6.0.patch
@@ -182,7 +182,7 @@ peerDependencyRules:
182182
- vitest
183183
- rolldown
184184
allowedVersions:
185-
oxc-minify: '*'
186-
oxlint-tsgolint: '*'
187-
rolldown: '*'
188-
vite: '*'
185+
oxc-minify: "*"
186+
oxlint-tsgolint: "*"
187+
rolldown: "*"
188+
vite: "*"

0 commit comments

Comments
 (0)