Skip to content

Commit

Permalink
chore(deps): update dependency @types/luxon to v3.3.0 (#21418)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
  • Loading branch information
renovate[bot] and RahulGautamSingh committed Apr 12, 2023
1 parent 3ded278 commit da29ed1
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 26 deletions.
4 changes: 3 additions & 1 deletion lib/modules/datasource/npm/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export async function getDependency(
const cacheMinutes = process.env.RENOVATE_CACHE_NPM_MINUTES
? parseInt(process.env.RENOVATE_CACHE_NPM_MINUTES, 10)
: 15;
const softExpireAt = DateTime.local().plus({ minutes: cacheMinutes }).toISO();
const softExpireAt = DateTime.local()
.plus({ minutes: cacheMinutes })
.toISO()!;
let { cacheHardTtlMinutes } = GlobalConfig.get();
if (!(is.number(cacheHardTtlMinutes) && cacheHardTtlMinutes > cacheMinutes)) {
cacheHardTtlMinutes = cacheMinutes;
Expand Down
10 changes: 5 additions & 5 deletions lib/modules/platform/github/api-cache.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { ApiCache } from './api-cache';

describe('modules/platform/github/api-cache', () => {
const now = DateTime.fromISO('2000-01-01T00:00:00.000+00:00');
const t1 = now.plus({ years: 1 }).toISO();
const t1 = now.plus({ years: 1 }).toISO()!;
const t1_http = now.plus({ years: 1 }).toHTTP();

const t2 = now.plus({ years: 2 }).toISO();
const t2 = now.plus({ years: 2 }).toISO()!;
const t2_http = now.plus({ years: 2 }).toHTTP();

const t3 = now.plus({ years: 3 }).toISO();
const t3 = now.plus({ years: 3 }).toISO()!;
const t3_http = now.plus({ years: 3 }).toHTTP();

const t4 = now.plus({ years: 4 }).toISO();
const t4 = now.plus({ years: 4 }).toISO()!;
const t4_http = now.plus({ years: 4 }).toHTTP();

const t5 = now.plus({ years: 5 }).toISO();
const t5 = now.plus({ years: 5 }).toISO()!;
const t5_http = now.plus({ years: 5 }).toHTTP();

it('stores and retrieves items', () => {
Expand Down
8 changes: 4 additions & 4 deletions lib/modules/platform/github/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,10 +642,10 @@ describe('modules/platform/github/index', () => {

describe('getPrList()', () => {
const t = DateTime.fromISO('2000-01-01T00:00:00.000+00:00');
const t1 = t.plus({ minutes: 1 }).toISO();
const t2 = t.plus({ minutes: 2 }).toISO();
const t3 = t.plus({ minutes: 3 }).toISO();
const t4 = t.plus({ minutes: 4 }).toISO();
const t1 = t.plus({ minutes: 1 }).toISO()!;
const t2 = t.plus({ minutes: 2 }).toISO()!;
const t3 = t.plus({ minutes: 3 }).toISO()!;
const t4 = t.plus({ minutes: 4 }).toISO()!;

const pr1: GhRestPr = {
number: 1,
Expand Down
2 changes: 1 addition & 1 deletion lib/util/cache/package/decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function cache<T>({

if (!is.undefined(newData)) {
const newRecord: DecoratorCachedRecord = {
cachedAt: DateTime.local().toISO(),
cachedAt: DateTime.local().toISO()!,
value: newData,
};
await packageCache.set(finalNamespace, finalKey, newRecord, hardTtl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export abstract class AbstractGithubGraphqlCacheStrategy<

let result: GithubGraphqlCacheRecord<GithubItem> = {
items: {},
createdAt: this.createdAt.toISO(),
createdAt: this.createdAt.toISO()!,
};

const storedData = await this.load();
Expand Down Expand Up @@ -150,7 +150,7 @@ export abstract class AbstractGithubGraphqlCacheStrategy<
private async store(cachedItems: Record<string, GithubItem>): Promise<void> {
const cacheRecord: GithubGraphqlCacheRecord<GithubItem> = {
items: cachedItems,
createdAt: this.createdAt.toISO(),
createdAt: this.createdAt.toISO()!,
};
await this.persist(cacheRecord);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { clone } from '../../../clone';
import type { GithubDatasourceItem, GithubGraphqlCacheRecord } from '../types';
import { GithubGraphqlMemoryCacheStrategy } from './memory-cache-strategy';

const isoTs = (t: string) => DateTime.fromJSDate(new Date(t)).toISO();
const isoTs = (t: string) => DateTime.fromJSDate(new Date(t)).toISO()!;

const mockTime = (input: string): void => {
const now = DateTime.fromISO(isoTs(input)).valueOf();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { clone } from '../../../clone';
import type { GithubDatasourceItem, GithubGraphqlCacheRecord } from '../types';
import { GithubGraphqlPackageCacheStrategy } from './package-cache-strategy';

const isoTs = (t: string) => DateTime.fromJSDate(new Date(t)).toISO();
const isoTs = (t: string) => DateTime.fromJSDate(new Date(t)).toISO()!;

const mockTime = (input: string): void => {
const now = DateTime.fromISO(isoTs(input)).valueOf();
Expand Down
2 changes: 1 addition & 1 deletion lib/util/github/graphql/util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { parse as graphqlParse } from 'graphql';
import { DateTime } from 'luxon';
import { isDateExpired, prepareQuery } from './util';

const isoTs = (t: string) => DateTime.fromJSDate(new Date(t)).toISO();
const isoTs = (t: string) => DateTime.fromJSDate(new Date(t)).toISO()!;

describe('util/github/graphql/util', () => {
describe('prepareQuery', () => {
Expand Down
4 changes: 2 additions & 2 deletions lib/util/http/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ function getGraphqlPageSize(
if (now > expiry) {
const newPageSize = Math.min(oldPageSize * 2, MAX_GRAPHQL_PAGE_SIZE);
if (newPageSize < MAX_GRAPHQL_PAGE_SIZE) {
const timestamp = now.toISO();
const timestamp = now.toISO()!;

logger.debug(
{ fieldName, oldPageSize, newPageSize, timestamp },
Expand Down Expand Up @@ -241,7 +241,7 @@ function setGraphqlPageSize(fieldName: string, newPageSize: number): void {
const oldPageSize = getGraphqlPageSize(fieldName);
if (newPageSize !== oldPageSize) {
const now = DateTime.local();
const pageLastResizedAt = now.toISO();
const pageLastResizedAt = now.toISO()!;
logger.debug(
{ fieldName, oldPageSize, newPageSize, timestamp: pageLastResizedAt },
'GraphQL page size: shrinking'
Expand Down
4 changes: 2 additions & 2 deletions lib/workers/repository/update/branch/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function isScheduledNow(
return true;
}
let now = DateTime.local();
logger.trace(`now=${now.toISO()}`);
logger.trace(`now=${now.toISO()!}`);
// Adjust the time if repo is in a different timezone to renovate
if (config.timezone) {
logger.debug(`Found timezone: ${config.timezone}`);
Expand All @@ -153,7 +153,7 @@ export function isScheduledNow(
}
logger.debug('Adjusting now for timezone');
now = now.setZone(config.timezone);
logger.trace(`now=${now.toISO()}`);
logger.trace(`now=${now.toISO()!}`);
}
const currentDay = now.weekday;
logger.trace(`currentDay=${currentDay}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => {
[now.minus({ weeks: 2 }), 1435],
[now.minus({ years: 1 }), 14495],
])('works with string date (%s, %i)', (date, minutes) => {
expect(releaseNotesCacheMinutes(date?.toISO())).toEqual(minutes);
expect(releaseNotesCacheMinutes(date.toISO()!)).toEqual(minutes);
});

it('handles date object', () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
"@types/json-dup-key-validator": "1.0.0",
"@types/linkify-markdown": "1.0.1",
"@types/lodash": "4.14.192",
"@types/luxon": "3.2.2",
"@types/luxon": "3.3.0",
"@types/markdown-it": "12.2.3",
"@types/markdown-table": "2.0.0",
"@types/marshal": "0.5.1",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3026,10 +3026,10 @@
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.192.tgz#5790406361a2852d332d41635d927f1600811285"
integrity sha512-km+Vyn3BYm5ytMO13k9KTp27O75rbQ0NFw+U//g+PX7VZyjCioXaRFisqSIJRECljcTv73G3i6BpglNGHgUQ5A==

"@types/luxon@3.2.2":
version "3.2.2"
resolved "https://registry.yarnpkg.com/@types/luxon/-/luxon-3.2.2.tgz#c30b369d4cbacbf4617c6c2d8bb1532c83cc3df7"
integrity sha512-CuF9hIlsxGpJO4EztrW23/q1L9ctQfb5JM9mnLCJhhA8z81K2b4LTVjQYySXWhFV5SMyUsPYH/IcvvXDCKwa2g==
"@types/luxon@3.3.0":
version "3.3.0"
resolved "https://registry.yarnpkg.com/@types/luxon/-/luxon-3.3.0.tgz#a61043a62c0a72696c73a0a305c544c96501e006"
integrity sha512-uKRI5QORDnrGFYgcdAVnHvEIvEZ8noTpP/Bg+HeUzZghwinDlIS87DEenV5r1YoOF9G4x600YsUXLWZ19rmTmg==

"@types/markdown-it@12.2.3":
version "12.2.3"
Expand Down

0 comments on commit da29ed1

Please sign in to comment.