mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 23:16:26 +00:00
feat(dart): allow custom registryUrls (#25987)
This commit is contained in:
parent
2bc920181b
commit
c4bb98ab90
2 changed files with 6 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
||||||
exports[`modules/datasource/dart/index getReleases processes real data 1`] = `
|
exports[`modules/datasource/dart/index getReleases processes real data 1`] = `
|
||||||
{
|
{
|
||||||
"homepage": "https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences",
|
"homepage": "https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences",
|
||||||
"registryUrl": "https://pub.dartlang.org/",
|
"registryUrl": "https://pub.dartlang.org",
|
||||||
"releases": [
|
"releases": [
|
||||||
{
|
{
|
||||||
"releaseTimestamp": "2017-05-09T18:25:24.268Z",
|
"releaseTimestamp": "2017-05-09T18:25:24.268Z",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import type { HttpResponse } from '../../../util/http/types';
|
import type { HttpResponse } from '../../../util/http/types';
|
||||||
|
import { ensureTrailingSlash } from '../../../util/url';
|
||||||
import { Datasource } from '../datasource';
|
import { Datasource } from '../datasource';
|
||||||
import type { GetReleasesConfig, ReleaseResult } from '../types';
|
import type { GetReleasesConfig, ReleaseResult } from '../types';
|
||||||
import type { DartResult } from './types';
|
import type { DartResult } from './types';
|
||||||
|
@ -10,7 +11,7 @@ export class DartDatasource extends Datasource {
|
||||||
super(DartDatasource.id);
|
super(DartDatasource.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
override readonly customRegistrySupport = false;
|
override readonly customRegistrySupport = true;
|
||||||
|
|
||||||
override readonly defaultRegistryUrls = ['https://pub.dartlang.org/'];
|
override readonly defaultRegistryUrls = ['https://pub.dartlang.org/'];
|
||||||
|
|
||||||
|
@ -23,7 +24,9 @@ export class DartDatasource extends Datasource {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
let result: ReleaseResult | null = null;
|
let result: ReleaseResult | null = null;
|
||||||
const pkgUrl = `${registryUrl}api/packages/${packageName}`;
|
const pkgUrl = `${ensureTrailingSlash(
|
||||||
|
registryUrl,
|
||||||
|
)}api/packages/${packageName}`;
|
||||||
|
|
||||||
let raw: HttpResponse<DartResult> | null = null;
|
let raw: HttpResponse<DartResult> | null = null;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue