com.jimuwd.xian.registry-proxy 1.0.37 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -2
- package/package.json +1 -1
- package/src/index.ts +4 -2
package/dist/index.js
CHANGED
|
@@ -192,7 +192,9 @@ async function writeSuccessfulResponse(registryInfo, targetUrl, res, response, r
|
|
|
192
192
|
const tarball = data.versions[version]?.dist?.tarball;
|
|
193
193
|
if (tarball) {
|
|
194
194
|
const path = removeRegistryPrefix(tarball, registryInfos);
|
|
195
|
-
|
|
195
|
+
const proxiedTarballUrl = `${baseUrl}${path}${new URL(tarball).search || ''}`;
|
|
196
|
+
data.versions[version].dist.tarball = proxiedTarballUrl;
|
|
197
|
+
console.log("proxiedTarballUrl", proxiedTarballUrl);
|
|
196
198
|
}
|
|
197
199
|
}
|
|
198
200
|
}
|
|
@@ -316,7 +318,7 @@ export async function startProxyServer(proxyConfigPath, localYarnConfigPath, glo
|
|
|
316
318
|
proxyPort = address.port;
|
|
317
319
|
const portFile = join(process.env.PROJECT_ROOT || process.cwd(), '.registry-proxy-port');
|
|
318
320
|
writeFile(portFile, proxyPort.toString()).catch(e => console.error('Failed to write port file:', e));
|
|
319
|
-
console.log(`Proxy server running on ${proxyInfo.https ? 'https' : 'http'}://localhost:${proxyPort}${basePathPrefixedWithSlash}`);
|
|
321
|
+
console.log(`Proxy server running on ${proxyInfo.https ? 'https' : 'http'}://localhost:${proxyPort}${basePathPrefixedWithSlash === '/' ? '' : basePathPrefixedWithSlash}`);
|
|
320
322
|
resolve(server);
|
|
321
323
|
});
|
|
322
324
|
});
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -261,7 +261,9 @@ async function writeSuccessfulResponse(
|
|
|
261
261
|
const tarball = data.versions[version]?.dist?.tarball;
|
|
262
262
|
if (tarball) {
|
|
263
263
|
const path = removeRegistryPrefix(tarball, registryInfos);
|
|
264
|
-
|
|
264
|
+
const proxiedTarballUrl = `${baseUrl}${path}${new URL(tarball).search || ''}`;
|
|
265
|
+
data.versions[version]!.dist!.tarball = proxiedTarballUrl;
|
|
266
|
+
console.log("proxiedTarballUrl", proxiedTarballUrl);
|
|
265
267
|
}
|
|
266
268
|
}
|
|
267
269
|
}
|
|
@@ -394,7 +396,7 @@ export async function startProxyServer(
|
|
|
394
396
|
proxyPort = address.port;
|
|
395
397
|
const portFile = join(process.env.PROJECT_ROOT || process.cwd(), '.registry-proxy-port');
|
|
396
398
|
writeFile(portFile, proxyPort.toString()).catch(e => console.error('Failed to write port file:', e));
|
|
397
|
-
console.log(`Proxy server running on ${proxyInfo.https ? 'https' : 'http'}://localhost:${proxyPort}${basePathPrefixedWithSlash}`);
|
|
399
|
+
console.log(`Proxy server running on ${proxyInfo.https ? 'https' : 'http'}://localhost:${proxyPort}${basePathPrefixedWithSlash === '/' ? '' : basePathPrefixedWithSlash}`);
|
|
398
400
|
resolve(server);
|
|
399
401
|
});
|
|
400
402
|
});
|