diff --git a/index.ts b/index.ts index f47dfe3..fb3f6c2 100644 --- a/index.ts +++ b/index.ts @@ -1,11 +1,11 @@ import * as Commander from 'commander' -import type * as Types from './sources/types' -import {ExportArgs, IsDebug} from './sources/debug' -import {ReplaceStringWithBooleanInObject} from './sources/utility' -import {GetLatestWorkflowTime} from './sources/actions' -import {ListBranches} from './sources/branches' -import {GetChangedFilesFromSHAToHead, GetCommitSHAFromLatestWorkflowTime} from './sources/commits' -import {PurgeRequestManager} from './sources/requests' +import type * as Types from './sources/types.js' +import {ExportArgs, IsDebug} from './sources/debug.js' +import {ReplaceStringWithBooleanInObject} from './sources/utility.js' +import {GetLatestWorkflowTime} from './sources/actions.js' +import {ListBranches} from './sources/branches.js' +import {GetChangedFilesFromSHAToHead, GetCommitSHAFromLatestWorkflowTime} from './sources/commits.js' +import {PurgeRequestManager} from './sources/requests.js' const Program = new Commander.Command() diff --git a/package.json b/package.json index 90792ee..d1a5dc1 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@types/node": "^20.9.4", "check-disk-space": "^3.4.0", "commander": "^11.1.0", - "got": "^12.6.1", + "got": "^14.0.0", "luxon": "^3.4.4", "p-queue": "^7.4.1", "simple-git": "^3.21.0", diff --git a/sources/actions.ts b/sources/actions.ts index 090c8b5..e350b07 100644 --- a/sources/actions.ts +++ b/sources/actions.ts @@ -1,6 +1,6 @@ import * as GitHub from '@octokit/rest' import {DateTime} from 'luxon' -import type {ProgramOptionsType} from './types' +import type {ProgramOptionsType} from './types.js' /** * @name GetLatestWorkflowTime diff --git a/sources/branches.ts b/sources/branches.ts index b0385c2..923cd96 100644 --- a/sources/branches.ts +++ b/sources/branches.ts @@ -2,8 +2,8 @@ import * as Git from 'simple-git' import * as GitHub from '@octokit/rest' import * as Actions from '@actions/core' import * as Os from 'node:os' -import type * as Types from './types' -import {IsDebug} from './debug' +import type * as Types from './types.js' +import {IsDebug} from './debug.js' function CreateGitHubInstance(ProgramOptions: Types.ProgramOptionsType): GitHub.Octokit { const GitHubInstance = new GitHub.Octokit({auth: ProgramOptions.ghToken}) diff --git a/sources/commits.ts b/sources/commits.ts index 28a8b82..55efae0 100644 --- a/sources/commits.ts +++ b/sources/commits.ts @@ -2,7 +2,7 @@ import * as Git from 'simple-git' import * as GitHub from '@octokit/rest' import * as Os from 'node:os' import {DateTime} from 'luxon' -import type * as Types from './types' +import type * as Types from './types.js' function CreateGitHubInstance(ProgramOptions: Types.ProgramOptionsType): GitHub.Octokit { const GitHubInstance = new GitHub.Octokit({auth: ProgramOptions.ghToken}) diff --git a/sources/debug.ts b/sources/debug.ts index dc3ef86..d5fc0f0 100644 --- a/sources/debug.ts +++ b/sources/debug.ts @@ -1,5 +1,5 @@ import * as Actions from '@actions/core' -import type * as Types from './types' +import type * as Types from './types.js' export function IsDebug(Args: Types.ProgramOptionsType | Types.ProgramOptionsRawType) { const ArgsDebug = typeof Args.debug === 'string' ? Args.debug === 'true' : Args.debug diff --git a/sources/requests.ts b/sources/requests.ts index 1e12e02..7cb310d 100644 --- a/sources/requests.ts +++ b/sources/requests.ts @@ -1,13 +1,13 @@ -import * as Got from 'got' +import got from 'got' import * as Actions from '@actions/core' import * as Os from 'node:os' import PQueue from 'p-queue' -import {IsDebug} from './debug' -import * as Utility from './utility' -import type * as Types from './types' +import {IsDebug} from './debug.js' +import * as Utility from './utility.js' +import type * as Types from './types.js' async function GetCDNResponse(ProgramOptions: Types.ProgramOptionsType, ID: string): Promise { - const ResponseRaw: Types.CDNStatusResponseType = await Got.got(`https://purge.jsdelivr.net/status/${ID}`, { + const ResponseRaw: Types.CDNStatusResponseType = await got(`https://purge.jsdelivr.net/status/${ID}`, { https: { minVersion: 'TLSv1.3', ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256', @@ -22,7 +22,7 @@ async function GetCDNResponse(ProgramOptions: Types.ProgramOptionsType, ID: stri } async function PostPurgeRequest(ProgramOptions: Types.ProgramOptionsType, BranchOrTag: string[], Filenames: string[]): Promise { - const ResponseRaw: Types.CDNPostResponseType = await Got.got.post('https://purge.jsdelivr.net/', { + const ResponseRaw: Types.CDNPostResponseType = await got.post('https://purge.jsdelivr.net/', { headers: { 'cache-control': 'no-cache', }, diff --git a/tsconfig.json b/tsconfig.json index 238e5b9..7bfa7a9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,16 +1,15 @@ { "compilerOptions": { "outDir": "dist", - "module": "ES2022", + "module": "NodeNext", "target": "ES2022", - "moduleResolution": "node", + "moduleResolution": "NodeNext", "removeComments": true, "alwaysStrict": true, "skipLibCheck": true }, "include": [ "index.ts", - "calc-repo-size/**/*.ts", "sources/**/*.ts" ] } \ No newline at end of file