File tree 4 files changed +19
-86
lines changed
4 files changed +19
-86
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " shadcn-svelte " : patch
3
+ ---
4
+
5
+ chore: Replaced ` node-fetch ` for ` node-fetch-native `
Original file line number Diff line number Diff line change 33
33
"dev" : " tsup --watch --sourcemap" ,
34
34
"build" : " tsup --minify" ,
35
35
"check" : " tsc --noEmit" ,
36
- "start:dev" : " cross-env COMPONENTS_REGISTRY_URL=http://localhost:5173 node dist/index.js" ,
37
36
"start" : " node dist/index.js" ,
37
+ "start:dev" : " cross-env COMPONENTS_REGISTRY_URL=http://localhost:5173 node dist/index.js" ,
38
+ "start:proxy" : " pnpm dlx straightforward@latest --port 9000" ,
38
39
"format" : " prettier --write ." ,
39
40
"format:check" : " prettier --check ." ,
40
41
"release" : " changeset version" ,
46
47
"commander" : " ^10.0.1" ,
47
48
"execa" : " ^7.2.0" ,
48
49
"find-up" : " ^7.0.0" ,
49
- "https-proxy-agent" : " ^7.0.4" ,
50
50
"is-unicode-supported" : " ^2.0.0" ,
51
- "node-fetch" : " ^3.3.2 "
51
+ "node-fetch-native " : " ^1.6.4 "
52
52
},
53
53
"devDependencies" : {
54
54
"@types/node" : " ^18.19.22" ,
Original file line number Diff line number Diff line change 1
1
import path from "node:path" ;
2
2
import process from "node:process" ;
3
3
import * as v from "valibot" ;
4
- import fetch from "node-fetch" ;
5
- import { HttpsProxyAgent } from "https-proxy-agent " ;
4
+ import { fetch } from "node-fetch-native " ;
5
+ import { createProxy } from "node-fetch-native/proxy " ;
6
6
import { error } from "../errors.js" ;
7
7
import { getEnvProxy } from "../get-env-proxy.js" ;
8
8
import type { Config } from "../get-config.js" ;
@@ -125,11 +125,13 @@ export function getItemTargetPath(
125
125
126
126
async function fetchRegistry ( paths : string [ ] ) {
127
127
const proxyUrl = getEnvProxy ( ) ;
128
- const agent = proxyUrl ? new HttpsProxyAgent ( proxyUrl ) : undefined ;
128
+ const proxy = proxyUrl ? createProxy ( { url : proxyUrl } ) : { } ;
129
129
try {
130
130
const results = await Promise . all (
131
131
paths . map ( async ( path ) => {
132
- const response = await fetch ( `${ baseUrl } /registry/${ path } ` , { agent } ) ;
132
+ const response = await fetch ( `${ baseUrl } /registry/${ path } ` , {
133
+ ...proxy ,
134
+ } ) ;
133
135
return await response . json ( ) ;
134
136
} )
135
137
) ;
You can’t perform that action at this time.
0 commit comments