Convert to ESM.

Context: https://github.com/actions/typescript-action/pull/969
This commit is contained in:
Fabio Niephaus
2025-09-16 13:20:56 +02:00
committed by Fabio Niephaus
parent 59f089d81e
commit b4c67abb33
35 changed files with 118600 additions and 129021 deletions

7
__fixtures__/cache.ts Normal file
View File

@@ -0,0 +1,7 @@
import * as cache from '@actions/cache'
import { jest } from '@jest/globals'
export const ReserveCacheError = cache.ReserveCacheError
export const restoreCache = jest.fn<typeof cache.restoreCache>()
export const saveCache = jest.fn<typeof cache.saveCache>()
export const ValidationError = cache.ValidationError

13
__fixtures__/core.ts Normal file
View File

@@ -0,0 +1,13 @@
import type * as core from '@actions/core'
import { jest } from '@jest/globals'
export const debug = jest.fn<typeof core.debug>()
export const error = jest.fn<typeof core.error>()
export const exportVariable = jest.fn<typeof core.exportVariable>()
export const getInput = jest.fn<typeof core.getInput>()
export const getState = jest.fn<typeof core.getState>()
export const info = jest.fn<typeof core.info>()
export const saveState = jest.fn<typeof core.saveState>()
export const setFailed = jest.fn<typeof core.setFailed>()
export const setOutput = jest.fn<typeof core.setOutput>()
export const warning = jest.fn<typeof core.warning>()

15
__fixtures__/github.ts Normal file
View File

@@ -0,0 +1,15 @@
import * as github from '@actions/github'
import { jest } from '@jest/globals'
export const context = {
repo: {
owner: 'test-owner',
repo: 'test-repo'
},
sha: 'test-sha',
ref: 'test-ref',
workflow: 'test-workflow',
job: 'test-job',
runId: '12345'
}
export const getOctokit = jest.fn<typeof github.getOctokit>()

4
__fixtures__/glob.ts Normal file
View File

@@ -0,0 +1,4 @@
import * as glob from '@actions/glob'
import { jest } from '@jest/globals'
export const create = jest.fn<typeof glob.create>()

View File

@@ -24,24 +24,28 @@
* Forked from https://github.com/actions/setup-java/blob/5b36705a13905facb447b6812d613a06a07e371d/__tests__/cache.test.ts
*/
import { jest } from '@jest/globals'
import { mkdtempSync } from 'fs'
import { tmpdir } from 'os'
import { join } from 'path'
import { restore, save } from '../src/features/cache'
import * as fs from 'fs'
import * as os from 'os'
import * as core from '@actions/core'
import * as cache from '@actions/cache'
import * as cache from '../__fixtures__/cache.js'
import * as core from '../__fixtures__/core.js'
// Mocks should be declared before the module being tested is imported.
jest.unstable_mockModule('@actions/core', () => core)
jest.unstable_mockModule('@actions/cache', () => cache)
// The module being tested should be imported dynamically. This ensures that the
// mocks are used in place of any actual dependencies.
const { restore, save } = await import('../src/features/cache.js')
describe('dependency cache', () => {
const ORIGINAL_RUNNER_OS = process.env['RUNNER_OS']
const ORIGINAL_GITHUB_WORKSPACE = process.env['GITHUB_WORKSPACE']
const ORIGINAL_CWD = process.cwd()
let workspace: string
let spyInfo: jest.SpyInstance<void, Parameters<typeof core.info>>
let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>
let spyDebug: jest.SpyInstance<void, Parameters<typeof core.debug>>
let spySaveState: jest.SpyInstance<void, Parameters<typeof core.saveState>>
beforeEach(() => {
workspace = mkdtempSync(join(tmpdir(), 'setup-graalvm-cache-'))
@@ -65,17 +69,9 @@ describe('dependency cache', () => {
})
beforeEach(() => {
spyInfo = jest.spyOn(core, 'info')
spyInfo.mockImplementation(() => null)
spyWarning = jest.spyOn(core, 'warning')
spyWarning.mockImplementation(() => null)
spyDebug = jest.spyOn(core, 'debug')
spyDebug.mockImplementation(() => null)
spySaveState = jest.spyOn(core, 'saveState')
spySaveState.mockImplementation(() => null)
core.info.mockImplementation(() => null)
core.warning.mockImplementation(() => null)
core.debug.mockImplementation(() => null)
})
afterEach(() => {
@@ -86,13 +82,8 @@ describe('dependency cache', () => {
})
describe('restore', () => {
let spyCacheRestore: jest.SpyInstance<ReturnType<typeof cache.restoreCache>, Parameters<typeof cache.restoreCache>>
beforeEach(() => {
spyCacheRestore = jest
.spyOn(cache, 'restoreCache')
.mockImplementation((_paths: string[], _primaryKey: string) => Promise.resolve(undefined))
spyWarning.mockImplementation(() => null)
cache.restoreCache.mockImplementation((_paths: string[], _primaryKey: string) => Promise.resolve(undefined))
})
it('throws error if unsupported package manager specified', () => {
@@ -111,9 +102,9 @@ describe('dependency cache', () => {
createFile(join(workspace, 'pom.xml'))
await restore('maven')
expect(spyCacheRestore).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(spyInfo).toHaveBeenCalledWith('maven cache is not found')
expect(cache.restoreCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith('maven cache is not found')
})
})
describe('for gradle', () => {
@@ -128,17 +119,17 @@ describe('dependency cache', () => {
createFile(join(workspace, 'build.gradle'))
await restore('gradle')
expect(spyCacheRestore).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found')
expect(cache.restoreCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith('gradle cache is not found')
})
it('downloads cache based on build.gradle.kts', async () => {
createFile(join(workspace, 'build.gradle.kts'))
await restore('gradle')
expect(spyCacheRestore).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found')
expect(cache.restoreCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith('gradle cache is not found')
})
})
it('downloads cache based on buildSrc/Versions.kt', async () => {
@@ -146,9 +137,9 @@ describe('dependency cache', () => {
createFile(join(workspace, 'buildSrc', 'Versions.kt'))
await restore('gradle')
expect(spyCacheRestore).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found')
expect(cache.restoreCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith('gradle cache is not found')
})
describe('for sbt', () => {
it('throws error if no build.sbt found', async () => {
@@ -162,20 +153,16 @@ describe('dependency cache', () => {
createFile(join(workspace, 'build.sbt'))
await restore('sbt')
expect(spyCacheRestore).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(spyInfo).toHaveBeenCalledWith('sbt cache is not found')
expect(cache.restoreCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith('sbt cache is not found')
})
})
})
describe('save', () => {
let spyCacheSave: jest.SpyInstance<ReturnType<typeof cache.saveCache>, Parameters<typeof cache.saveCache>>
beforeEach(() => {
spyCacheSave = jest
.spyOn(cache, 'saveCache')
.mockImplementation((_paths: string[], _key: string) => Promise.resolve(0))
spyWarning.mockImplementation(() => null)
cache.saveCache.mockImplementation((_paths: string[], _key: string) => Promise.resolve(0))
core.warning.mockImplementation(() => null)
})
it('throws error if unsupported package manager specified', () => {
@@ -183,18 +170,18 @@ describe('dependency cache', () => {
})
it('save with -1 cacheId , should not fail workflow', async () => {
spyCacheSave.mockImplementation(() => Promise.resolve(-1))
cache.saveCache.mockImplementation(() => Promise.resolve(-1))
createStateForMissingBuildFile()
await save('maven')
expect(spyCacheSave).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(spyInfo).toHaveBeenCalled()
expect(spyInfo).toHaveBeenCalledWith(expect.stringMatching(/^Cache saved with the key:.*/))
expect(cache.saveCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith(expect.stringMatching(/^Cache saved with the key:.*/))
})
it('saves with error from toolkit, should fail workflow', async () => {
spyCacheSave.mockImplementation(() => Promise.reject(new cache.ValidationError('Validation failed')))
cache.saveCache.mockImplementation(() => Promise.reject(new cache.ValidationError('Validation failed')))
createStateForMissingBuildFile()
expect.assertions(1)
@@ -205,24 +192,24 @@ describe('dependency cache', () => {
it('uploads cache even if no pom.xml found', async () => {
createStateForMissingBuildFile()
await save('maven')
expect(spyCacheSave).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(cache.saveCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
})
it('does not upload cache if no restore run before', async () => {
createFile(join(workspace, 'pom.xml'))
await save('maven')
expect(spyCacheSave).not.toHaveBeenCalled()
expect(spyWarning).toHaveBeenCalledWith('Error retrieving key from state.')
expect(cache.saveCache).not.toHaveBeenCalled()
expect(core.warning).toHaveBeenCalledWith('Error retrieving key from state.')
})
it('uploads cache', async () => {
createFile(join(workspace, 'pom.xml'))
createStateForSuccessfulRestore()
await save('maven')
expect(spyCacheSave).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(spyInfo).toHaveBeenCalledWith(expect.stringMatching(/^Cache saved with the key:.*/))
expect(cache.saveCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith(expect.stringMatching(/^Cache saved with the key:.*/))
})
})
describe('for gradle', () => {
@@ -230,33 +217,33 @@ describe('dependency cache', () => {
createStateForMissingBuildFile()
await save('gradle')
expect(spyCacheSave).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(cache.saveCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
})
it('does not upload cache if no restore run before', async () => {
createFile(join(workspace, 'build.gradle'))
await save('gradle')
expect(spyCacheSave).not.toHaveBeenCalled()
expect(spyWarning).toHaveBeenCalledWith('Error retrieving key from state.')
expect(cache.saveCache).not.toHaveBeenCalled()
expect(core.warning).toHaveBeenCalledWith('Error retrieving key from state.')
})
it('uploads cache based on build.gradle', async () => {
createFile(join(workspace, 'build.gradle'))
createStateForSuccessfulRestore()
await save('gradle')
expect(spyCacheSave).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(spyInfo).toHaveBeenCalledWith(expect.stringMatching(/^Cache saved with the key:.*/))
expect(cache.saveCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith(expect.stringMatching(/^Cache saved with the key:.*/))
})
it('uploads cache based on build.gradle.kts', async () => {
createFile(join(workspace, 'build.gradle.kts'))
createStateForSuccessfulRestore()
await save('gradle')
expect(spyCacheSave).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(spyInfo).toHaveBeenCalledWith(expect.stringMatching(/^Cache saved with the key:.*/))
expect(cache.saveCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith(expect.stringMatching(/^Cache saved with the key:.*/))
})
it('uploads cache based on buildSrc/Versions.kt', async () => {
createDirectory(join(workspace, 'buildSrc'))
@@ -264,47 +251,47 @@ describe('dependency cache', () => {
createStateForSuccessfulRestore()
await save('gradle')
expect(spyCacheSave).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(spyInfo).toHaveBeenCalledWith(expect.stringMatching(/^Cache saved with the key:.*/))
expect(cache.saveCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith(expect.stringMatching(/^Cache saved with the key:.*/))
})
})
describe('for sbt', () => {
it('uploads cache even if no build.sbt found', async () => {
createStateForMissingBuildFile()
await save('sbt')
expect(spyCacheSave).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(cache.saveCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
})
it('does not upload cache if no restore run before', async () => {
createFile(join(workspace, 'build.sbt'))
await save('sbt')
expect(spyCacheSave).not.toHaveBeenCalled()
expect(spyWarning).toHaveBeenCalledWith('Error retrieving key from state.')
expect(cache.saveCache).not.toHaveBeenCalled()
expect(core.warning).toHaveBeenCalledWith('Error retrieving key from state.')
})
it('uploads cache', async () => {
createFile(join(workspace, 'build.sbt'))
createStateForSuccessfulRestore()
await save('sbt')
expect(spyCacheSave).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(spyInfo).toHaveBeenCalledWith(expect.stringMatching(/^Cache saved with the key:.*/))
expect(cache.saveCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith(expect.stringMatching(/^Cache saved with the key:.*/))
})
})
})
})
function resetState() {
jest.spyOn(core, 'getState').mockReset()
core.getState.mockReset()
}
/**
* Create states to emulate a restore process without build file.
*/
function createStateForMissingBuildFile() {
jest.spyOn(core, 'getState').mockImplementation((name) => {
core.getState.mockImplementation((name) => {
switch (name) {
case 'cache-primary-key':
return 'setup-graalvm-cache-'
@@ -318,7 +305,7 @@ function createStateForMissingBuildFile() {
* Create states to emulate a successful restore process.
*/
function createStateForSuccessfulRestore() {
jest.spyOn(core, 'getState').mockImplementation((name) => {
core.getState.mockImplementation((name) => {
switch (name) {
case 'cache-primary-key':
return 'setup-graalvm-cache-primary-key'

View File

@@ -24,21 +24,23 @@
* Forked from https://github.com/actions/setup-java/blob/5b36705a13905facb447b6812d613a06a07e371d/__tests__/cleanup-java.test.ts
*/
import { run as cleanup } from '../src/cleanup'
import * as core from '@actions/core'
import * as cache from '@actions/cache'
import { jest } from '@jest/globals'
import * as cache from '../__fixtures__/cache.js'
import * as core from '../__fixtures__/core.js'
// Mocks should be declared before the module being tested is imported.
jest.unstable_mockModule('@actions/core', () => core)
jest.unstable_mockModule('@actions/cache', () => cache)
// The module being tested should be imported dynamically. This ensures that the
// mocks are used in place of any actual dependencies.
const { run } = await import('../src/cleanup.js')
describe('cleanup', () => {
let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>
let spyInfo: jest.SpyInstance<void, Parameters<typeof core.info>>
let spyCacheSave: jest.SpyInstance<ReturnType<typeof cache.saveCache>, Parameters<typeof cache.saveCache>>
beforeEach(() => {
spyWarning = jest.spyOn(core, 'warning')
spyWarning.mockImplementation(() => null)
spyInfo = jest.spyOn(core, 'info')
spyInfo.mockImplementation(() => null)
spyCacheSave = jest.spyOn(cache, 'saveCache')
core.info.mockImplementation(() => null)
core.warning.mockImplementation(() => null)
core.debug.mockImplementation(() => null)
createStateForSuccessfulRestore()
})
afterEach(() => {
@@ -46,38 +48,40 @@ describe('cleanup', () => {
})
it('does not fail nor warn even when the save process throws a ReserveCacheError', async () => {
spyCacheSave.mockImplementation((_paths: string[], _key: string) =>
cache.saveCache.mockImplementation((_paths: string[], _key: string) =>
Promise.reject(
new cache.ReserveCacheError('Unable to reserve cache with key, another job may be creating this cache.')
)
)
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
core.getInput.mockImplementation((name: string) => {
return name === 'cache' ? 'gradle' : ''
})
await cleanup()
expect(spyCacheSave).toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
await run()
expect(cache.saveCache).toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
})
it('does not fail even though the save process throws error', async () => {
spyCacheSave.mockImplementation((_paths: string[], _key: string) => Promise.reject(new Error('Unexpected error')))
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
cache.saveCache.mockImplementation((_paths: string[], _key: string) =>
Promise.reject(new Error('Unexpected error'))
)
core.getInput.mockImplementation((name: string) => {
return name === 'cache' ? 'gradle' : ''
})
await cleanup()
expect(spyCacheSave).toHaveBeenCalled()
await run()
expect(cache.saveCache).toHaveBeenCalled()
})
})
function resetState() {
jest.spyOn(core, 'getState').mockReset()
core.getState.mockReset()
}
/**
* Create states to emulate a successful restore process.
*/
function createStateForSuccessfulRestore() {
jest.spyOn(core, 'getState').mockImplementation((name) => {
core.getState.mockImplementation((name) => {
switch (name) {
case 'cache-primary-key':
return 'setup-java-cache-primary-key'

View File

@@ -1,10 +1,12 @@
import * as path from 'path'
import { downloadGraalVM, downloadGraalVMEELegacy, fetchArtifact, fetchArtifactEE } from '../src/gds'
import { expect, test } from '@jest/globals'
import { fileURLToPath } from 'url'
const TEST_USER_AGENT = 'GraalVMGitHubActionTest/1.0.4'
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
const dirname = path.dirname(fileURLToPath(import.meta.url))
process.env['RUNNER_TEMP'] = path.join(dirname, 'TEMP')
test('fetch artifacts', async () => {
let artifact = await fetchArtifact(TEST_USER_AGENT, 'isBase:True', '17.0.12')

View File

@@ -4,9 +4,11 @@ import { expect, test } from '@jest/globals'
import { getTaggedRelease } from '../src/utils'
import { findGraalVMVersion, findHighestJavaVersion, findLatestEABuildDownloadUrl } from '../src/graalvm'
import { GRAALVM_GH_USER, GRAALVM_RELEASES_REPO } from '../src/constants'
import { fileURLToPath } from 'url'
process.env['RUNNER_TOOL_CACHE'] = path.join(__dirname, 'TOOL_CACHE')
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
const dirname = path.dirname(fileURLToPath(import.meta.url))
process.env['RUNNER_TOOL_CACHE'] = path.join(dirname, 'TOOL_CACHE')
process.env['RUNNER_TEMP'] = path.join(dirname, 'TEMP')
test('request invalid version/javaVersion', async () => {
for (const combination of [

View File

@@ -3,9 +3,11 @@ import * as c from '../src/constants'
import * as path from 'path'
import * as semver from 'semver'
import { expect, test } from '@jest/globals'
import { fileURLToPath } from 'url'
process.env['RUNNER_TOOL_CACHE'] = path.join(__dirname, 'TOOL_CACHE')
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
const dirname = path.dirname(fileURLToPath(import.meta.url))
process.env['RUNNER_TOOL_CACHE'] = path.join(dirname, 'TOOL_CACHE')
process.env['RUNNER_TEMP'] = path.join(dirname, 'TEMP')
/* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["expect", "expectLatestToBe", "expectURL"] }] */

View File

@@ -2,9 +2,11 @@ import * as path from 'path'
import * as mandrel from '../src/mandrel'
import { expect, test } from '@jest/globals'
import { getLatestRelease } from '../src/utils'
import { fileURLToPath } from 'url'
process.env['RUNNER_TOOL_CACHE'] = path.join(__dirname, 'TOOL_CACHE')
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
const dirname = path.dirname(fileURLToPath(import.meta.url))
process.env['RUNNER_TOOL_CACHE'] = path.join(dirname, 'TOOL_CACHE')
process.env['RUNNER_TEMP'] = path.join(dirname, 'TEMP')
test('request invalid version/javaVersion combination', async () => {
for (const combination of [

View File

@@ -2,9 +2,11 @@ import * as path from 'path'
import { expect, test } from '@jest/globals'
import { needsWindowsEnvironmentSetup } from '../src/msvc'
import { VERSION_DEV, VERSION_LATEST } from '../src/constants'
import { fileURLToPath } from 'url'
process.env['RUNNER_TOOL_CACHE'] = path.join(__dirname, 'TOOL_CACHE')
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
const dirname = path.dirname(fileURLToPath(import.meta.url))
process.env['RUNNER_TOOL_CACHE'] = path.join(dirname, 'TOOL_CACHE')
process.env['RUNNER_TEMP'] = path.join(dirname, 'TEMP')
test('decide whether Window env must be set up for GraalVM for JDK', async () => {
for (const javaVersion of ['17', '17.0.8', '17.0', '21', '22', '22-ea', '23-ea', VERSION_DEV]) {

View File

@@ -1,52 +1,34 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as c from '../src/constants'
import { setUpSBOMSupport, processSBOM } from '../src/features/sbom'
import * as core from '@actions/core'
import * as github from '@actions/github'
import * as glob from '@actions/glob'
import { join } from 'path'
import { tmpdir } from 'os'
import { expect, jest } from '@jest/globals'
import { mkdtempSync, writeFileSync, rmSync } from 'fs'
import * as core from '../__fixtures__/core.js'
import * as glob from '../__fixtures__/glob.js'
import * as github from '../__fixtures__/github.js'
jest.mock('@actions/glob')
jest.mock('@actions/github', () => ({
getOctokit: jest.fn(() => ({
request: jest.fn().mockResolvedValue(undefined)
})),
context: {
repo: {
owner: 'test-owner',
repo: 'test-repo'
},
sha: 'test-sha',
ref: 'test-ref',
workflow: 'test-workflow',
job: 'test-job',
runId: '12345'
}
}))
// Mocks should be declared before the module being tested is imported.
jest.unstable_mockModule('@actions/core', () => core)
jest.unstable_mockModule('@actions/glob', () => glob)
jest.unstable_mockModule('@actions/github', () => github)
// The module being tested should be imported dynamically. This ensures that the
// mocks are used in place of any actual dependencies.
const { setUpSBOMSupport, processSBOM } = await import('../src/features/sbom.js')
function mockFindSBOM(files: string[]) {
const mockCreate = jest.fn().mockResolvedValue({
glob: jest.fn().mockResolvedValue(files)
glob.create.mockImplementation(
jest.fn<() => Promise<any>>().mockResolvedValue({
glob: jest.fn<() => Promise<string[]>>().mockResolvedValue(files)
})
;(glob.create as jest.Mock).mockImplementation(mockCreate)
)
}
// Mocks the GitHub dependency submission API return value
// 'undefined' is treated as a successful request
function mockGithubAPIReturnValue(returnValue: Error | undefined = undefined) {
const mockOctokit = {
request:
returnValue === undefined ? jest.fn().mockResolvedValue(returnValue) : jest.fn().mockRejectedValue(returnValue)
}
;(github.getOctokit as jest.Mock).mockReturnValue(mockOctokit)
return mockOctokit
}
const request = jest.fn<any>().mockResolvedValue(undefined)
describe('sbom feature', () => {
let spyInfo: jest.SpyInstance<void, Parameters<typeof core.info>>
let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>
let spyExportVariable: jest.SpyInstance<void, Parameters<typeof core.exportVariable>>
let workspace: string
let originalEnv: NodeJS.ProcessEnv
const javaVersion = '24.0.0'
@@ -62,12 +44,11 @@ describe('sbom feature', () => {
}
workspace = mkdtempSync(join(tmpdir(), 'setup-graalvm-sbom-'))
mockGithubAPIReturnValue()
spyInfo = jest.spyOn(core, 'info').mockImplementation(() => null)
spyWarning = jest.spyOn(core, 'warning').mockImplementation(() => null)
spyExportVariable = jest.spyOn(core, 'exportVariable').mockImplementation(() => null)
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
core.info.mockImplementation(() => null)
core.warning.mockImplementation(() => null)
core.debug.mockImplementation(() => null)
core.getInput.mockImplementation((name: string) => {
if (name === 'native-image-enable-sbom') {
return 'true'
}
@@ -76,14 +57,17 @@ describe('sbom feature', () => {
}
return ''
})
github.getOctokit.mockImplementation(
jest.fn<any>(() => ({
request: request
}))
)
})
afterEach(() => {
process.env = originalEnv
jest.clearAllMocks()
spyInfo.mockRestore()
spyWarning.mockRestore()
spyExportVariable.mockRestore()
rmSync(workspace, { recursive: true, force: true })
})
@@ -117,35 +101,35 @@ describe('sbom feature', () => {
it('should set the SBOM option when activated', () => {
setUpSBOMSupport(javaVersion, distribution)
expect(spyExportVariable).toHaveBeenCalledWith(
expect(core.exportVariable).toHaveBeenCalledWith(
c.NATIVE_IMAGE_OPTIONS_ENV,
expect.stringContaining('--enable-sbom=export')
)
expect(spyInfo).toHaveBeenCalledWith('Enabled SBOM generation for Native Image build')
expect(spyWarning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith('Enabled SBOM generation for Native Image build')
expect(core.warning).not.toHaveBeenCalled()
})
it('should not set the SBOM option when not activated', () => {
jest.spyOn(core, 'getInput').mockReturnValue('false')
core.getInput.mockReturnValue('false')
setUpSBOMSupport(javaVersion, distribution)
expect(spyExportVariable).not.toHaveBeenCalled()
expect(spyInfo).not.toHaveBeenCalled()
expect(spyWarning).not.toHaveBeenCalled()
expect(core.exportVariable).not.toHaveBeenCalled()
expect(core.info).not.toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
})
})
describe('process', () => {
async function setUpAndProcessSBOM(sbom: object): Promise<void> {
setUpSBOMSupport(javaVersion, distribution)
spyInfo.mockClear()
core.info.mockClear()
// Mock 'native-image' invocation by creating the SBOM file
const sbomPath = join(workspace, 'test.sbom.json')
writeFileSync(sbomPath, JSON.stringify(sbom, null, 2))
mockFindSBOM([sbomPath])
jest.spyOn(core, 'getState').mockReturnValue(javaVersion)
core.getState.mockReturnValue(javaVersion)
await processSBOM()
}
@@ -198,12 +182,12 @@ describe('sbom feature', () => {
it('should process SBOM and display components', async () => {
await setUpAndProcessSBOM(sampleSBOM)
expect(spyInfo).toHaveBeenCalledWith('Found SBOM: ' + join(workspace, 'test.sbom.json'))
expect(spyInfo).toHaveBeenCalledWith('=== SBOM Content ===')
expect(spyInfo).toHaveBeenCalledWith('- pkg:maven/org.json/json@20241224')
expect(spyInfo).toHaveBeenCalledWith('- pkg:maven/com.oracle/main-test-app@1.0-SNAPSHOT')
expect(spyInfo).toHaveBeenCalledWith(' depends on: pkg:maven/org.json/json@20241224')
expect(spyWarning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith('Found SBOM: ' + join(workspace, 'test.sbom.json'))
expect(core.info).toHaveBeenCalledWith('=== SBOM Content ===')
expect(core.info).toHaveBeenCalledWith('- pkg:maven/org.json/json@20241224')
expect(core.info).toHaveBeenCalledWith('- pkg:maven/com.oracle/main-test-app@1.0-SNAPSHOT')
expect(core.info).toHaveBeenCalledWith(' depends on: pkg:maven/org.json/json@20241224')
expect(core.warning).not.toHaveBeenCalled()
})
it('should handle components without purl', async () => {
@@ -220,14 +204,14 @@ describe('sbom feature', () => {
}
await setUpAndProcessSBOM(sbomWithoutPurl)
expect(spyInfo).toHaveBeenCalledWith('=== SBOM Content ===')
expect(spyInfo).toHaveBeenCalledWith('- no-purl-package@1.0.0')
expect(spyWarning).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith('=== SBOM Content ===')
expect(core.info).toHaveBeenCalledWith('- no-purl-package@1.0.0')
expect(core.warning).not.toHaveBeenCalled()
})
it('should handle missing SBOM file', async () => {
setUpSBOMSupport(javaVersion, distribution)
spyInfo.mockClear()
core.info.mockClear()
mockFindSBOM([])
@@ -250,10 +234,9 @@ describe('sbom feature', () => {
})
it('should submit dependencies when processing valid SBOM', async () => {
const mockOctokit = mockGithubAPIReturnValue(undefined)
await setUpAndProcessSBOM(sampleSBOM)
expect(mockOctokit.request).toHaveBeenCalledWith(
expect(request).toHaveBeenCalledWith(
'POST /repos/{owner}/{repo}/dependency-graph/snapshots',
expect.objectContaining({
owner: 'test-owner',
@@ -282,11 +265,15 @@ describe('sbom feature', () => {
})
})
)
expect(spyInfo).toHaveBeenCalledWith('Dependency snapshot submitted successfully.')
expect(core.info).toHaveBeenCalledWith('Dependency snapshot submitted successfully.')
})
it('should handle GitHub API submission errors gracefully', async () => {
mockGithubAPIReturnValue(new Error('API submission failed'))
github.getOctokit.mockImplementation(
jest.fn<any>(() => ({
request: jest.fn<(a: any, b: any) => Promise<any>>().mockRejectedValue(new Error('API submission failed'))
}))
)
await expect(setUpAndProcessSBOM(sampleSBOM)).rejects.toBeInstanceOf(Error)
})

View File

@@ -72,6 +72,6 @@ outputs:
description: 'A boolean value to indicate an exact match was found for the primary key'
runs:
using: 'node20'
main: 'dist/main/index.js'
post: 'dist/cleanup/index.js'
main: 'dist/main.js'
post: 'dist/cleanup.js'
post-if: 'success()'

115937
dist/main/index.js → dist/cleanup.js generated vendored

File diff suppressed because one or more lines are too long

116881
dist/cleanup/index.js → dist/main.js generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,14 +1,29 @@
module.exports = {
// See: https://jestjs.io/docs/configuration
/** @type {import('ts-jest').JestConfigWithTsJest} **/
export default {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: ['./src/**'],
coverageDirectory: './coverage',
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
coverageReporters: ['json-summary', 'text', 'lcov'],
moduleFileExtensions: ['js', 'ts'],
extensionsToTreatAsEsm: ['.ts'],
moduleFileExtensions: ['ts', 'js'],
preset: 'ts-jest',
reporters: ['default'],
resolver: 'ts-jest-resolver',
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testPathIgnorePatterns: ['/dist/', '/node_modules/'],
transform: {
'^.+\\.ts$': 'ts-jest'
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: 'tsconfig.eslint.json',
useESM: true
}
]
},
verbose: true
}

793
package-lock.json generated
View File

@@ -24,13 +24,16 @@
},
"devDependencies": {
"@eslint/compat": "^1.3.2",
"@rollup/plugin-commonjs": "^28.0.6",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.1",
"@rollup/plugin-typescript": "^12.1.4",
"@types/jest": "^30.0.0",
"@types/node": "^24.4.0",
"@types/semver": "^7.7.1",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.43.0",
"@typescript-eslint/parser": "^8.31.1",
"@vercel/ncc": "^0.38.3",
"eslint": "^9.35.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
@@ -43,12 +46,17 @@
"js-yaml": "^4.1.0",
"prettier": "^3.6.2",
"prettier-eslint": "^16.4.2",
"rollup": "^4.50.2",
"ts-jest": "^29.4.1",
"ts-jest-resolver": "^2.0.1",
"ts-node": "^10.9.2",
"typescript": "^5.9.2"
},
"engines": {
"node": ">=20"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "*"
}
},
"node_modules/@actions/cache": {
@@ -2033,9 +2041,9 @@
}
},
"node_modules/@jridgewell/sourcemap-codec": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
"integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
"integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
"dev": true,
"license": "MIT"
},
@@ -2378,6 +2386,466 @@
"@protobuf-ts/runtime": "^2.11.1"
}
},
"node_modules/@rollup/plugin-commonjs": {
"version": "28.0.6",
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.6.tgz",
"integrity": "sha512-XSQB1K7FUU5QP+3lOQmVCE3I0FcbbNvmNT4VJSj93iUjayaARrTQeoRdiYQoftAJBLrR9t2agwAd3ekaTgHNlw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rollup/pluginutils": "^5.0.1",
"commondir": "^1.0.1",
"estree-walker": "^2.0.2",
"fdir": "^6.2.0",
"is-reference": "1.2.1",
"magic-string": "^0.30.3",
"picomatch": "^4.0.2"
},
"engines": {
"node": ">=16.0.0 || 14 >= 14.17"
},
"peerDependencies": {
"rollup": "^2.68.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
}
},
"node_modules/@rollup/plugin-commonjs/node_modules/fdir": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
"integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12.0.0"
},
"peerDependencies": {
"picomatch": "^3 || ^4"
},
"peerDependenciesMeta": {
"picomatch": {
"optional": true
}
}
},
"node_modules/@rollup/plugin-commonjs/node_modules/picomatch": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/@rollup/plugin-json": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz",
"integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rollup/pluginutils": "^5.1.0"
},
"engines": {
"node": ">=14.0.0"
},
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
}
},
"node_modules/@rollup/plugin-node-resolve": {
"version": "16.0.1",
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.1.tgz",
"integrity": "sha512-tk5YCxJWIG81umIvNkSod2qK5KyQW19qcBF/B78n1bjtOON6gzKoVeSzAE8yHCZEDmqkHKkxplExA8KzdJLJpA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rollup/pluginutils": "^5.0.1",
"@types/resolve": "1.20.2",
"deepmerge": "^4.2.2",
"is-module": "^1.0.0",
"resolve": "^1.22.1"
},
"engines": {
"node": ">=14.0.0"
},
"peerDependencies": {
"rollup": "^2.78.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
}
},
"node_modules/@rollup/plugin-typescript": {
"version": "12.1.4",
"resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.4.tgz",
"integrity": "sha512-s5Hx+EtN60LMlDBvl5f04bEiFZmAepk27Q+mr85L/00zPDn1jtzlTV6FWn81MaIwqfWzKxmOJrBWHU6vtQyedQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rollup/pluginutils": "^5.1.0",
"resolve": "^1.22.1"
},
"engines": {
"node": ">=14.0.0"
},
"peerDependencies": {
"rollup": "^2.14.0||^3.0.0||^4.0.0",
"tslib": "*",
"typescript": ">=3.7.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
},
"tslib": {
"optional": true
}
}
},
"node_modules/@rollup/pluginutils": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz",
"integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/estree": "^1.0.0",
"estree-walker": "^2.0.2",
"picomatch": "^4.0.2"
},
"engines": {
"node": ">=14.0.0"
},
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
}
},
"node_modules/@rollup/pluginutils/node_modules/picomatch": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/@rollup/rollup-android-arm-eabi": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.50.2.tgz",
"integrity": "sha512-uLN8NAiFVIRKX9ZQha8wy6UUs06UNSZ32xj6giK/rmMXAgKahwExvK6SsmgU5/brh4w/nSgj8e0k3c1HBQpa0A==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
]
},
"node_modules/@rollup/rollup-android-arm64": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.50.2.tgz",
"integrity": "sha512-oEouqQk2/zxxj22PNcGSskya+3kV0ZKH+nQxuCCOGJ4oTXBdNTbv+f/E3c74cNLeMO1S5wVWacSws10TTSB77g==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
]
},
"node_modules/@rollup/rollup-darwin-arm64": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.50.2.tgz",
"integrity": "sha512-OZuTVTpj3CDSIxmPgGH8en/XtirV5nfljHZ3wrNwvgkT5DQLhIKAeuFSiwtbMto6oVexV0k1F1zqURPKf5rI1Q==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@rollup/rollup-darwin-x64": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.50.2.tgz",
"integrity": "sha512-Wa/Wn8RFkIkr1vy1k1PB//VYhLnlnn5eaJkfTQKivirOvzu5uVd2It01ukeQstMursuz7S1bU+8WW+1UPXpa8A==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@rollup/rollup-freebsd-arm64": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.50.2.tgz",
"integrity": "sha512-QkzxvH3kYN9J1w7D1A+yIMdI1pPekD+pWx7G5rXgnIlQ1TVYVC6hLl7SOV9pi5q9uIDF9AuIGkuzcbF7+fAhow==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
]
},
"node_modules/@rollup/rollup-freebsd-x64": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.50.2.tgz",
"integrity": "sha512-dkYXB0c2XAS3a3jmyDkX4Jk0m7gWLFzq1C3qUnJJ38AyxIF5G/dyS4N9B30nvFseCfgtCEdbYFhk0ChoCGxPog==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
]
},
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.50.2.tgz",
"integrity": "sha512-9VlPY/BN3AgbukfVHAB8zNFWB/lKEuvzRo1NKev0Po8sYFKx0i+AQlCYftgEjcL43F2h9Ui1ZSdVBc4En/sP2w==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.50.2.tgz",
"integrity": "sha512-+GdKWOvsifaYNlIVf07QYan1J5F141+vGm5/Y8b9uCZnG/nxoGqgCmR24mv0koIWWuqvFYnbURRqw1lv7IBINw==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-arm64-gnu": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.50.2.tgz",
"integrity": "sha512-df0Eou14ojtUdLQdPFnymEQteENwSJAdLf5KCDrmZNsy1c3YaCNaJvYsEUHnrg+/DLBH612/R0xd3dD03uz2dg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-arm64-musl": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.50.2.tgz",
"integrity": "sha512-iPeouV0UIDtz8j1YFR4OJ/zf7evjauqv7jQ/EFs0ClIyL+by++hiaDAfFipjOgyz6y6xbDvJuiU4HwpVMpRFDQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-loong64-gnu": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.50.2.tgz",
"integrity": "sha512-OL6KaNvBopLlj5fTa5D5bau4W82f+1TyTZRr2BdnfsrnQnmdxh4okMxR2DcDkJuh4KeoQZVuvHvzuD/lyLn2Kw==",
"cpu": [
"loong64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-ppc64-gnu": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.50.2.tgz",
"integrity": "sha512-I21VJl1w6z/K5OTRl6aS9DDsqezEZ/yKpbqlvfHbW0CEF5IL8ATBMuUx6/mp683rKTK8thjs/0BaNrZLXetLag==",
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.50.2.tgz",
"integrity": "sha512-Hq6aQJT/qFFHrYMjS20nV+9SKrXL2lvFBENZoKfoTH2kKDOJqff5OSJr4x72ZaG/uUn+XmBnGhfr4lwMRrmqCQ==",
"cpu": [
"riscv64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-riscv64-musl": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.50.2.tgz",
"integrity": "sha512-82rBSEXRv5qtKyr0xZ/YMF531oj2AIpLZkeNYxmKNN6I2sVE9PGegN99tYDLK2fYHJITL1P2Lgb4ZXnv0PjQvw==",
"cpu": [
"riscv64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-s390x-gnu": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.50.2.tgz",
"integrity": "sha512-4Q3S3Hy7pC6uaRo9gtXUTJ+EKo9AKs3BXKc2jYypEcMQ49gDPFU2P1ariX9SEtBzE5egIX6fSUmbmGazwBVF9w==",
"cpu": [
"s390x"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.50.2.tgz",
"integrity": "sha512-9Jie/At6qk70dNIcopcL4p+1UirusEtznpNtcq/u/C5cC4HBX7qSGsYIcG6bdxj15EYWhHiu02YvmdPzylIZlA==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.50.2.tgz",
"integrity": "sha512-HPNJwxPL3EmhzeAnsWQCM3DcoqOz3/IC6de9rWfGR8ZCuEHETi9km66bH/wG3YH0V3nyzyFEGUZeL5PKyy4xvw==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-openharmony-arm64": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.50.2.tgz",
"integrity": "sha512-nMKvq6FRHSzYfKLHZ+cChowlEkR2lj/V0jYj9JnGUVPL2/mIeFGmVM2mLaFeNa5Jev7W7TovXqXIG2d39y1KYA==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"openharmony"
]
},
"node_modules/@rollup/rollup-win32-arm64-msvc": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.50.2.tgz",
"integrity": "sha512-eFUvvnTYEKeTyHEijQKz81bLrUQOXKZqECeiWH6tb8eXXbZk+CXSG2aFrig2BQ/pjiVRj36zysjgILkqarS2YA==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
]
},
"node_modules/@rollup/rollup-win32-ia32-msvc": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.50.2.tgz",
"integrity": "sha512-cBaWmXqyfRhH8zmUxK3d3sAhEWLrtMjWBRwdMMHJIXSjvjLKvv49adxiEz+FJ8AP90apSDDBx2Tyd/WylV6ikA==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
]
},
"node_modules/@rollup/rollup-win32-x64-msvc": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.50.2.tgz",
"integrity": "sha512-APwKy6YUhvZaEoHyM+9xqmTpviEI+9eL7LoCH+aLcvWYHJ663qG5zx7WzWZY+a9qkg5JtzcMyJ9z0WtQBMDmgA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
]
},
"node_modules/@rtsao/scc": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz",
@@ -2496,12 +2964,22 @@
}
},
"node_modules/@types/estree": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz",
"integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==",
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
"integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/graceful-fs": {
"version": "4.1.9",
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz",
"integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/istanbul-lib-coverage": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz",
@@ -2612,6 +3090,13 @@
"undici-types": "~7.11.0"
}
},
"node_modules/@types/resolve": {
"version": "1.20.2",
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz",
"integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/semver": {
"version": "7.7.1",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.1.tgz",
@@ -3178,16 +3663,6 @@
"win32"
]
},
"node_modules/@vercel/ncc": {
"version": "0.38.3",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.3.tgz",
"integrity": "sha512-rnK6hJBS6mwc+Bkab+PGPs9OiS0i/3kdTO+CkI8V0/VrW3vmz7O2Pxjw/owOlmo6PKEIxRSeZKv/kuL9itnpYA==",
"dev": true,
"license": "MIT",
"bin": {
"ncc": "dist/ncc/cli.js"
}
},
"node_modules/abort-controller": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
@@ -3903,6 +4378,13 @@
"node": ">=4.0.0"
}
},
"node_modules/commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
"integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==",
"dev": true,
"license": "MIT"
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@@ -4923,6 +5405,13 @@
"node": ">=4.0"
}
},
"node_modules/estree-walker": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
"dev": true,
"license": "MIT"
},
"node_modules/esutils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
@@ -6033,6 +6522,13 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-module": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
"integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==",
"dev": true,
"license": "MIT"
},
"node_modules/is-negative-zero": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz",
@@ -6082,6 +6578,16 @@
"node": ">=8"
}
},
"node_modules/is-reference": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz",
"integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/estree": "*"
}
},
"node_modules/is-regex": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz",
@@ -6804,6 +7310,16 @@
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
}
},
"node_modules/jest-get-type": {
"version": "29.6.3",
"resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz",
"integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
"node_modules/jest-haste-map": {
"version": "30.1.0",
"resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.1.0.tgz",
@@ -7754,6 +8270,16 @@
"yallist": "^3.0.2"
}
},
"node_modules/magic-string": {
"version": "0.30.19",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.19.tgz",
"integrity": "sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.5.5"
}
},
"node_modules/make-dir": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",
@@ -9047,6 +9573,16 @@
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
}
},
"node_modules/resolve.exports": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz",
"integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=10"
}
},
"node_modules/reusify": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
@@ -9075,6 +9611,47 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rollup": {
"version": "4.50.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.50.2.tgz",
"integrity": "sha512-BgLRGy7tNS9H66aIMASq1qSYbAAJV6Z6WR4QYTvj5FgF15rZ/ympT1uixHXwzbZUBDbkvqUI1KR0fH1FhMaQ9w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/estree": "1.0.8"
},
"bin": {
"rollup": "dist/bin/rollup"
},
"engines": {
"node": ">=18.0.0",
"npm": ">=8.0.0"
},
"optionalDependencies": {
"@rollup/rollup-android-arm-eabi": "4.50.2",
"@rollup/rollup-android-arm64": "4.50.2",
"@rollup/rollup-darwin-arm64": "4.50.2",
"@rollup/rollup-darwin-x64": "4.50.2",
"@rollup/rollup-freebsd-arm64": "4.50.2",
"@rollup/rollup-freebsd-x64": "4.50.2",
"@rollup/rollup-linux-arm-gnueabihf": "4.50.2",
"@rollup/rollup-linux-arm-musleabihf": "4.50.2",
"@rollup/rollup-linux-arm64-gnu": "4.50.2",
"@rollup/rollup-linux-arm64-musl": "4.50.2",
"@rollup/rollup-linux-loong64-gnu": "4.50.2",
"@rollup/rollup-linux-ppc64-gnu": "4.50.2",
"@rollup/rollup-linux-riscv64-gnu": "4.50.2",
"@rollup/rollup-linux-riscv64-musl": "4.50.2",
"@rollup/rollup-linux-s390x-gnu": "4.50.2",
"@rollup/rollup-linux-x64-gnu": "4.50.2",
"@rollup/rollup-linux-x64-musl": "4.50.2",
"@rollup/rollup-openharmony-arm64": "4.50.2",
"@rollup/rollup-win32-arm64-msvc": "4.50.2",
"@rollup/rollup-win32-ia32-msvc": "4.50.2",
"@rollup/rollup-win32-x64-msvc": "4.50.2",
"fsevents": "~2.3.2"
}
},
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -9807,6 +10384,188 @@
}
}
},
"node_modules/ts-jest-resolver": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/ts-jest-resolver/-/ts-jest-resolver-2.0.1.tgz",
"integrity": "sha512-FolE73BqVZCs8/RbLKxC67iaAtKpBWx7PeLKFW2zJQlOf9j851I7JRxSDenri2NFvVH3QP7v3S8q1AmL24Zb9Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"jest-resolve": "^29.5.0"
}
},
"node_modules/ts-jest-resolver/node_modules/@jest/types": {
"version": "29.6.3",
"resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz",
"integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@jest/schemas": "^29.6.3",
"@types/istanbul-lib-coverage": "^2.0.0",
"@types/istanbul-reports": "^3.0.0",
"@types/node": "*",
"@types/yargs": "^17.0.8",
"chalk": "^4.0.0"
},
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
"node_modules/ts-jest-resolver/node_modules/camelcase": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
"integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/ts-jest-resolver/node_modules/ci-info": {
"version": "3.9.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz",
"integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/sibiraj-s"
}
],
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/ts-jest-resolver/node_modules/jest-haste-map": {
"version": "29.7.0",
"resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz",
"integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@jest/types": "^29.6.3",
"@types/graceful-fs": "^4.1.3",
"@types/node": "*",
"anymatch": "^3.0.3",
"fb-watchman": "^2.0.0",
"graceful-fs": "^4.2.9",
"jest-regex-util": "^29.6.3",
"jest-util": "^29.7.0",
"jest-worker": "^29.7.0",
"micromatch": "^4.0.4",
"walker": "^1.0.8"
},
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
},
"optionalDependencies": {
"fsevents": "^2.3.2"
}
},
"node_modules/ts-jest-resolver/node_modules/jest-regex-util": {
"version": "29.6.3",
"resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz",
"integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
"node_modules/ts-jest-resolver/node_modules/jest-resolve": {
"version": "29.7.0",
"resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz",
"integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==",
"dev": true,
"license": "MIT",
"dependencies": {
"chalk": "^4.0.0",
"graceful-fs": "^4.2.9",
"jest-haste-map": "^29.7.0",
"jest-pnp-resolver": "^1.2.2",
"jest-util": "^29.7.0",
"jest-validate": "^29.7.0",
"resolve": "^1.20.0",
"resolve.exports": "^2.0.0",
"slash": "^3.0.0"
},
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
"node_modules/ts-jest-resolver/node_modules/jest-util": {
"version": "29.7.0",
"resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz",
"integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@jest/types": "^29.6.3",
"@types/node": "*",
"chalk": "^4.0.0",
"ci-info": "^3.2.0",
"graceful-fs": "^4.2.9",
"picomatch": "^2.2.3"
},
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
"node_modules/ts-jest-resolver/node_modules/jest-validate": {
"version": "29.7.0",
"resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz",
"integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@jest/types": "^29.6.3",
"camelcase": "^6.2.0",
"chalk": "^4.0.0",
"jest-get-type": "^29.6.3",
"leven": "^3.1.0",
"pretty-format": "^29.7.0"
},
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
"node_modules/ts-jest-resolver/node_modules/jest-worker": {
"version": "29.7.0",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz",
"integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/node": "*",
"jest-util": "^29.7.0",
"merge-stream": "^2.0.0",
"supports-color": "^8.0.0"
},
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
"node_modules/ts-jest-resolver/node_modules/supports-color": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"has-flag": "^4.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/supports-color?sponsor=1"
}
},
"node_modules/ts-jest/node_modules/type-fest": {
"version": "4.41.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz",

View File

@@ -3,6 +3,7 @@
"author": "GraalVM Community",
"description": "GitHub Action for GraalVM",
"version": "1.3.7",
"type": "module",
"private": true,
"repository": {
"type": "git",
@@ -17,6 +18,9 @@
"actions",
"setup"
],
"exports": {
".": "./dist/index.js"
},
"engines": {
"node": ">=20"
},
@@ -26,9 +30,9 @@
"format:check": "npx prettier --check .",
"lint": "npx eslint .",
"package": "npm run package:main && npm run package:cleanup",
"package:main": "npx ncc build src/main.ts -o dist/main",
"package:cleanup": "npx ncc build src/cleanup.ts -o dist/cleanup",
"test": "npx jest",
"package:main": "npx rollup --config rollup.main.config.ts --configPlugin @rollup/plugin-typescript",
"package:cleanup": "npx rollup --config rollup.cleanup.config.ts --configPlugin @rollup/plugin-typescript",
"test": "NODE_OPTIONS=--experimental-vm-modules NODE_NO_WARNINGS=1 npx jest",
"all": "npm run format:write && npm run lint && npm run test && npm run package"
},
"license": "UPL",
@@ -48,13 +52,16 @@
},
"devDependencies": {
"@eslint/compat": "^1.3.2",
"@rollup/plugin-commonjs": "^28.0.6",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.1",
"@rollup/plugin-typescript": "^12.1.4",
"@types/jest": "^30.0.0",
"@types/node": "^24.4.0",
"@types/semver": "^7.7.1",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.43.0",
"@typescript-eslint/parser": "^8.31.1",
"@vercel/ncc": "^0.38.3",
"eslint": "^9.35.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
@@ -67,8 +74,13 @@
"js-yaml": "^4.1.0",
"prettier": "^3.6.2",
"prettier-eslint": "^16.4.2",
"rollup": "^4.50.2",
"ts-jest": "^29.4.1",
"ts-jest-resolver": "^2.0.1",
"ts-node": "^10.9.2",
"typescript": "^5.9.2"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "*"
}
}

19
rollup.cleanup.config.ts Normal file
View File

@@ -0,0 +1,19 @@
// See: https://rollupjs.org/introduction/
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import nodeResolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
const config = {
input: 'src/cleanup.ts',
output: {
esModule: true,
file: 'dist/cleanup.js',
format: 'es',
sourcemap: false
},
plugins: [typescript(), nodeResolve({ preferBuiltins: true }), commonjs(), json()]
}
export default config

19
rollup.main.config.ts Normal file
View File

@@ -0,0 +1,19 @@
// See: https://rollupjs.org/introduction/
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import nodeResolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
const config = {
input: 'src/main.ts',
output: {
esModule: true,
file: 'dist/main.js',
format: 'es',
sourcemap: false
},
plugins: [typescript(), nodeResolve({ preferBuiltins: true }), commonjs(), json()]
}
export default config

View File

@@ -25,10 +25,10 @@
*/
import * as core from '@actions/core'
import * as constants from './constants'
import { save } from './features/cache'
import { generateReports } from './features/reports'
import { processSBOM } from './features/sbom'
import * as constants from './constants.js'
import { save } from './features/cache.js'
import { generateReports } from './features/reports.js'
import { processSBOM } from './features/sbom.js'
/**
* Check given input and run a save process for the specified package manager

View File

@@ -1,6 +1,6 @@
import * as core from '@actions/core'
import { GRAALVM_PLATFORM } from './constants'
import { exec } from './utils'
import { GRAALVM_PLATFORM } from './constants.js'
import { exec } from './utils.js'
const APT_GET_INSTALL_BASE = 'sudo apt-get -y --no-upgrade install'
const COMPONENT_TO_DEPS = new Map<string, Map<string, string>>([

View File

@@ -1,7 +1,7 @@
import * as c from '../constants'
import * as c from '../constants.js'
import * as core from '@actions/core'
import * as tc from '@actions/tool-cache'
import { exec } from '../utils'
import { exec } from '../utils.js'
import { join } from 'path'
const MUSL_NAME = 'x86_64-linux-musl-native'

View File

@@ -1,4 +1,4 @@
import * as c from '../constants'
import * as c from '../constants.js'
import * as core from '@actions/core'
import * as fs from 'fs'
import * as github from '@actions/github'
@@ -11,7 +11,7 @@ import {
updatePRComment,
tmpfile,
setNativeImageOption
} from '../utils'
} from '../utils.js'
const BUILD_OUTPUT_JSON_PATH = tmpfile('native-image-build-output.json')
const BYTES_TO_KiB = 1024

View File

@@ -1,11 +1,11 @@
import * as c from '../constants'
import * as c from '../constants.js'
import * as core from '@actions/core'
import * as fs from 'fs'
import * as github from '@actions/github'
import * as glob from '@actions/glob'
import { basename } from 'path'
import * as semver from 'semver'
import { setNativeImageOption } from '../utils'
import { setNativeImageOption } from '../utils.js'
const INPUT_NI_SBOM = 'native-image-enable-sbom'
const SBOM_FILE_SUFFIX = '.sbom.json'

View File

@@ -1,4 +1,4 @@
import * as c from './constants'
import * as c from './constants.js'
import * as core from '@actions/core'
import * as fs from 'fs'
import * as httpClient from '@actions/http-client'
@@ -8,8 +8,8 @@ import * as stream from 'stream'
import * as util from 'util'
import * as semver from 'semver'
import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'
import { RetryHelper } from '@actions/tool-cache/lib/retry-helper'
import { calculateSHA256 } from './utils'
import { RetryHelper } from '@actions/tool-cache/lib/retry-helper.js'
import { calculateSHA256 } from './utils.js'
import { ok } from 'assert'
import { v4 as uuidv4 } from 'uuid'

View File

@@ -1,4 +1,4 @@
import * as c from './constants'
import * as c from './constants.js'
import * as core from '@actions/core'
import * as semver from 'semver'
import {
@@ -8,8 +8,8 @@ import {
getLatestRelease,
getMatchingTags,
getTaggedRelease
} from './utils'
import { downloadGraalVM, downloadGraalVMEELegacy } from './gds'
} from './utils.js'
import { downloadGraalVM, downloadGraalVMEELegacy } from './gds.js'
import { downloadTool } from '@actions/tool-cache'
import { basename } from 'path'

View File

@@ -1,8 +1,8 @@
import * as c from './constants'
import * as c from './constants.js'
import * as core from '@actions/core'
import * as semver from 'semver'
import { GRAALVM_PLATFORM } from './constants'
import { exec } from './utils'
import { GRAALVM_PLATFORM } from './constants.js'
import { exec } from './utils.js'
import { join } from 'path'
const BASE_FLAGS = ['--non-interactive', 'install', '--no-progress']

View File

@@ -1,6 +1,6 @@
import * as c from './constants'
import * as c from './constants.js'
import * as semver from 'semver'
import { downloadExtractAndCacheJDK, getTaggedRelease, getMatchingTags } from './utils'
import { downloadExtractAndCacheJDK, getTaggedRelease, getMatchingTags } from './utils.js'
import { downloadTool } from '@actions/tool-cache'
import { spawnSync } from 'child_process'

View File

@@ -1,20 +1,20 @@
import * as c from './constants'
import * as c from './constants.js'
import * as core from '@actions/core'
import * as graalvm from './graalvm'
import * as graalvm from './graalvm.js'
import * as semver from 'semver'
import { isFeatureAvailable as isCacheAvailable } from '@actions/cache'
import { basename, join } from 'path'
import { restore } from './features/cache'
import { setUpDependencies } from './dependencies'
import { setUpGUComponents } from './gu'
import { setUpMandrel } from './mandrel'
import { setUpLiberica } from './liberica'
import { checkForUpdates } from './features/check-for-updates'
import { setUpNativeImageMusl } from './features/musl'
import { setUpWindowsEnvironment } from './msvc'
import { setUpNativeImageBuildReports } from './features/reports'
import { restore } from './features/cache.js'
import { setUpDependencies } from './dependencies.js'
import { setUpGUComponents } from './gu.js'
import { setUpMandrel } from './mandrel.js'
import { setUpLiberica } from './liberica.js'
import { checkForUpdates } from './features/check-for-updates.js'
import { setUpNativeImageMusl } from './features/musl.js'
import { setUpWindowsEnvironment } from './msvc.js'
import { setUpNativeImageBuildReports } from './features/reports.js'
import { exec } from '@actions/exec'
import { setUpSBOMSupport } from './features/sbom'
import { setUpSBOMSupport } from './features/sbom.js'
async function run(): Promise<void> {
try {

View File

@@ -1,6 +1,6 @@
import * as c from './constants'
import * as c from './constants.js'
import * as httpClient from '@actions/http-client'
import { downloadExtractAndCacheJDK } from './utils'
import { downloadExtractAndCacheJDK } from './utils.js'
import { downloadTool } from '@actions/tool-cache'
import { basename } from 'path'

View File

@@ -1,7 +1,7 @@
import * as core from '@actions/core'
import { execSync } from 'child_process'
import { existsSync } from 'fs'
import { VERSION_DEV } from './constants'
import { VERSION_DEV } from './constants.js'
// Keep in sync with https://github.com/actions/virtual-environments
const KNOWN_VISUAL_STUDIO_INSTALLATIONS = [

View File

@@ -1,4 +1,4 @@
import * as c from './constants'
import * as c from './constants.js'
import * as core from '@actions/core'
import * as github from '@actions/github'
import * as semver from 'semver'
@@ -9,7 +9,7 @@ import { readFileSync, readdirSync } from 'fs'
import { createHash } from 'crypto'
import { join } from 'path'
import { tmpdir } from 'os'
import { GitHub } from '@actions/github/lib/utils'
import { GitHub } from '@actions/github/lib/utils.js'
export async function exec(commandLine: string, args?: string[], options?: ExecOptions | undefined): Promise<void> {
const exitCode = await e(commandLine, args, options)

View File

@@ -15,7 +15,7 @@
"noUnusedParameters": false,
"pretty": true,
"resolveJsonModule": true,
"sourceMap": true,
"sourceMap": false,
"strict": true,
"strictNullChecks": true,
"target": "ES2022"

View File

@@ -6,5 +6,13 @@
"noEmit": true
},
"exclude": ["dist", "node_modules"],
"include": ["__tests__", "src", "eslint.config.mjs", "jest.config.js"]
"include": [
"__fixtures__",
"__tests__",
"src",
"eslint.config.mjs",
"jest.config.js",
"rollup.cleanup.config.ts",
"rollup.main.config.ts"
]
}