fix(smartnpm): Fix file extraction & streaming, types and caching; update deps and CI; skip flaky tests
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user