fix(smartnpm): Fix file extraction & streaming, types and caching; update deps and CI; skip flaky tests

This commit is contained in:
2025-08-18 02:12:19 +00:00
parent 80e50b7391
commit a27a5c53c8
11 changed files with 9005 additions and 3850 deletions

View File

@@ -75,7 +75,7 @@ export class NpmRegistry {
distTag?: string;
version?: string;
}
): Promise<plugins.smartfile.Smartfile> {
): Promise<plugins.smartfile.SmartFile> {
// lets create a cache descriptor
const cacheDescriptor: ICacheDescriptor = {
registryUrl: this.options.npmRegistryUrl,
@@ -86,7 +86,7 @@ export class NpmRegistry {
};
// lets see if we have something cached
const cachedFile: plugins.smartfile.Smartfile = await this.registryCache.getCachedFile(
const cachedFile: plugins.smartfile.SmartFile = await this.registryCache.getCachedFile(
cacheDescriptor
);
@@ -120,7 +120,7 @@ export class NpmRegistry {
distTag?: string;
version?: string;
}
): Promise<plugins.smartfile.Smartfile[]> {
): Promise<plugins.smartfile.SmartFile[]> {
const npmPackage = await this.getPackageInfo(packageNameArg);
if (!optionsArg?.version && !optionsArg?.distTag) {
const latestAvailable = npmPackage.allDistTags.find(
@@ -226,8 +226,10 @@ export class NpmRegistry {
let body: any;
try {
const response = await plugins.smartrequest.getJson(this.searchDomain + searchString, {});
body = response.body;
const response = await plugins.smartrequest.SmartRequest.create()
.url(this.searchDomain + searchString)
.get();
body = await response.json();
} catch {
// we do nothing
}