Merge pull request #961 from crazy-max/esm
switch to ESM and update config/test wiring
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2023 actions-toolkit authors
|
||||
* Copyright 2025 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,6 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Context as GitHubContext} from '@actions/github/lib/context';
|
||||
import {jest} from '@jest/globals';
|
||||
import os from 'os';
|
||||
|
||||
export type Context = GitHubContext;
|
||||
export const mockPlatform = (platform: NodeJS.Platform) => {
|
||||
return jest.spyOn(os, 'platform').mockImplementation(() => platform);
|
||||
};
|
||||
|
||||
export const mockArch = (arch: string) => {
|
||||
return jest.spyOn(os, 'arch').mockImplementation(() => arch);
|
||||
};
|
||||
|
||||
export const mockHomedir = (dir: string) => {
|
||||
return jest.spyOn(os, 'homedir').mockImplementation(() => dir);
|
||||
};
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {describe, expect, it, jest, test, afterEach} from '@jest/globals';
|
||||
import {describe, expect, it, test, afterEach} from '@jest/globals';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import * as rimraf from 'rimraf';
|
||||
import osm = require('os');
|
||||
|
||||
import {mockArch, mockPlatform} from '../.helpers/os';
|
||||
|
||||
import {Install} from '../../src/buildx/install';
|
||||
|
||||
@@ -85,8 +86,8 @@ describe('download', () => {
|
||||
['linux', 's390x'],
|
||||
])(
|
||||
'acquires buildx for %s/%s', async (os, arch) => {
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
||||
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
||||
mockPlatform(os as NodeJS.Platform);
|
||||
mockArch(arch);
|
||||
const install = new Install();
|
||||
const buildxBin = await install.download('latest');
|
||||
expect(fs.existsSync(buildxBin)).toBe(true);
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {describe, expect, it, jest, test, afterEach} from '@jest/globals';
|
||||
import {describe, expect, it, test, afterEach} from '@jest/globals';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import * as rimraf from 'rimraf';
|
||||
import osm = require('os');
|
||||
|
||||
import {mockArch, mockPlatform} from '../.helpers/os';
|
||||
|
||||
import {Install} from '../../src/compose/install';
|
||||
|
||||
@@ -85,8 +86,8 @@ describe('download', () => {
|
||||
['linux', 's390x'],
|
||||
])(
|
||||
'acquires compose for %s/%s', async (os, arch) => {
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
||||
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
||||
mockPlatform(os as NodeJS.Platform);
|
||||
mockArch(arch);
|
||||
const install = new Install();
|
||||
const composeBin = await install.download('latest');
|
||||
expect(fs.existsSync(composeBin)).toBe(true);
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {describe, expect, it, jest, test, afterEach} from '@jest/globals';
|
||||
import {describe, expect, it, test, afterEach} from '@jest/globals';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import * as rimraf from 'rimraf';
|
||||
import osm = require('os');
|
||||
|
||||
import {mockArch, mockPlatform} from '../.helpers/os';
|
||||
|
||||
import {Install} from '../../src/cosign/install';
|
||||
|
||||
@@ -80,8 +81,8 @@ describe('download', () => {
|
||||
['linux', 'arm64']
|
||||
])(
|
||||
'acquires undock for %s/%s', async (os, arch) => {
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
||||
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
||||
mockPlatform(os as NodeJS.Platform);
|
||||
mockArch(arch);
|
||||
const install = new Install();
|
||||
const cosignBin = await install.download({
|
||||
version: 'latest'
|
||||
|
||||
@@ -19,9 +19,10 @@ import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import * as io from '@actions/io';
|
||||
import osm = require('os');
|
||||
import * as rimraf from 'rimraf';
|
||||
|
||||
import {mockHomedir} from '../.helpers/os';
|
||||
|
||||
import {Docker} from '../../src/docker/docker';
|
||||
|
||||
import {ConfigFile} from '../../src/types/docker/docker';
|
||||
@@ -47,7 +48,7 @@ describe('configDir', () => {
|
||||
});
|
||||
it('returns default', async () => {
|
||||
process.env.DOCKER_CONFIG = '';
|
||||
jest.spyOn(osm, 'homedir').mockImplementation(() => path.join('/tmp', 'home'));
|
||||
mockHomedir(path.join('/tmp', 'home'));
|
||||
expect(Docker.configDir).toEqual(path.join('/tmp', 'home', '.docker'));
|
||||
});
|
||||
it('returns from env', async () => {
|
||||
|
||||
@@ -19,7 +19,8 @@ import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import * as rimraf from 'rimraf';
|
||||
import osm = require('os');
|
||||
|
||||
import {mockArch, mockPlatform} from '../.helpers/os';
|
||||
|
||||
import {Install, InstallSourceArchive, InstallSourceImage} from '../../src/docker/install';
|
||||
|
||||
@@ -60,8 +61,8 @@ describe('download', () => {
|
||||
[image('27.3.1'), 'win32'],
|
||||
])(
|
||||
'acquires %p of docker (%s)', async (source, platformOS) => {
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => platformOS as NodeJS.Platform);
|
||||
jest.spyOn(osm, 'arch').mockImplementation(() => 'x64');
|
||||
mockPlatform(platformOS as NodeJS.Platform);
|
||||
mockArch('x64');
|
||||
const install = new Install({
|
||||
source: source,
|
||||
runDir: tmpDir
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {afterEach, describe, expect, jest, test} from '@jest/globals';
|
||||
import {afterEach, describe, expect, test} from '@jest/globals';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import * as rimraf from 'rimraf';
|
||||
import osm = require('os');
|
||||
|
||||
import {mockArch, mockPlatform} from '../.helpers/os';
|
||||
|
||||
import {OCI} from '../../src/oci/oci';
|
||||
|
||||
@@ -44,8 +45,8 @@ describe('defaultPlatform', () => {
|
||||
['linux', 'ppc64', {architecture: 'ppc64le', os: 'linux'}],
|
||||
['linux', 's390x', {architecture: 's390x', os: 'linux'}]
|
||||
])('default platform for %s/%s', async (os: string, arch: string, expected: Platform) => {
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
||||
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
||||
mockPlatform(os as NodeJS.Platform);
|
||||
mockArch(arch);
|
||||
const res = OCI.defaultPlatform();
|
||||
expect(res).toEqual(expected);
|
||||
});
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {describe, expect, it, jest, test, afterEach} from '@jest/globals';
|
||||
import {describe, expect, it, test, afterEach} from '@jest/globals';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import * as rimraf from 'rimraf';
|
||||
import osm = require('os');
|
||||
|
||||
import {mockArch, mockPlatform} from '../.helpers/os';
|
||||
|
||||
import {Install} from '../../src/regclient/install';
|
||||
|
||||
@@ -75,8 +76,8 @@ describe('download', () => {
|
||||
['linux', 's390x'],
|
||||
])(
|
||||
'acquires regclient for %s/%s', async (os, arch) => {
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
||||
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
||||
mockPlatform(os as NodeJS.Platform);
|
||||
mockArch(arch);
|
||||
const install = new Install();
|
||||
const regclientBin = await install.download('latest');
|
||||
expect(fs.existsSync(regclientBin)).toBe(true);
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {describe, expect, it, jest, test, afterEach} from '@jest/globals';
|
||||
import {describe, expect, it, test, afterEach} from '@jest/globals';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import * as rimraf from 'rimraf';
|
||||
import osm = require('os');
|
||||
|
||||
import {mockArch, mockPlatform} from '../.helpers/os';
|
||||
|
||||
import {Install} from '../../src/undock/install';
|
||||
|
||||
@@ -80,8 +81,8 @@ describe('download', () => {
|
||||
['linux', 's390x'],
|
||||
])(
|
||||
'acquires undock for %s/%s', async (os, arch) => {
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
||||
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
||||
mockPlatform(os as NodeJS.Platform);
|
||||
mockArch(arch);
|
||||
const install = new Install();
|
||||
const undockBin = await install.download('latest');
|
||||
expect(fs.existsSync(undockBin)).toBe(true);
|
||||
|
||||
@@ -62,7 +62,7 @@ module.exports = defineConfig([
|
||||
},
|
||||
parser: tsParser,
|
||||
ecmaVersion: 2023,
|
||||
sourceType: 'commonjs'
|
||||
sourceType: 'module'
|
||||
},
|
||||
|
||||
rules: {
|
||||
@@ -75,7 +75,7 @@ module.exports = defineConfig([
|
||||
'import/no-unresolved': [
|
||||
'error',
|
||||
{
|
||||
ignore: ['csv-parse/sync', '@octokit/openapi-types']
|
||||
ignore: ['\\.js$', 'csv-parse/sync', '@octokit/openapi-types', '@octokit/core', '@octokit/plugin-rest-endpoint-methods']
|
||||
}
|
||||
],
|
||||
'jest/no-disabled-tests': 0
|
||||
@@ -38,13 +38,20 @@ module.exports = {
|
||||
setupFiles: ['dotenv/config'],
|
||||
testMatch: ['**/*.test.ts'],
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
'^.+\\.ts$': [
|
||||
'ts-jest',
|
||||
{
|
||||
useESM: true,
|
||||
tsconfig: '<rootDir>/tsconfig.test.json'
|
||||
}
|
||||
]
|
||||
},
|
||||
moduleNameMapper: {
|
||||
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
|
||||
'^(\\.{1,2}/.*)\\.js$': '$1'
|
||||
},
|
||||
extensionsToTreatAsEsm: ['.ts'],
|
||||
collectCoverageFrom: ['src/**/{!(index.ts),}.ts'],
|
||||
coveragePathIgnorePatterns: ['lib/', 'node_modules/', '__mocks__/', '__tests__/'],
|
||||
testResultsProcessor: '<rootDir>/__tests__/testResultsProcessor.js',
|
||||
testResultsProcessor: '<rootDir>/__tests__/testResultsProcessor.cjs',
|
||||
verbose: true
|
||||
};
|
||||
@@ -21,11 +21,18 @@ module.exports = {
|
||||
testMatch: ['**/*.test.itg.ts'],
|
||||
testTimeout: 1800000, // 30 minutes
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
'^.+\\.ts$': [
|
||||
'ts-jest',
|
||||
{
|
||||
useESM: true,
|
||||
tsconfig: '<rootDir>/tsconfig.test.json'
|
||||
}
|
||||
]
|
||||
},
|
||||
moduleNameMapper: {
|
||||
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
|
||||
'^(\\.{1,2}/.*)\\.js$': '$1'
|
||||
},
|
||||
testResultsProcessor: '<rootDir>/__tests__/testResultsProcessor.js',
|
||||
extensionsToTreatAsEsm: ['.ts'],
|
||||
testResultsProcessor: '<rootDir>/__tests__/testResultsProcessor.cjs',
|
||||
verbose: false
|
||||
};
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "@docker/actions-toolkit",
|
||||
"version": "0.0.0+unknown",
|
||||
"description": "Toolkit for Docker (GitHub) Actions",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"lint": "yarn run prettier && yarn run eslint",
|
||||
@@ -12,9 +13,9 @@
|
||||
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
||||
"test": "jest",
|
||||
"test:coverage": "jest --coverage",
|
||||
"test:itg": "jest -c jest.config.itg.js --runInBand",
|
||||
"test:itg-list": "jest -c jest.config.itg.js --listTests",
|
||||
"test:itg-coverage": "jest -c jest.config.itg.js --coverage --runInBand"
|
||||
"test:itg": "jest -c jest.config.itg.cjs --runInBand",
|
||||
"test:itg-list": "jest -c jest.config.itg.cjs --listTests",
|
||||
"test:itg-coverage": "jest -c jest.config.itg.cjs --coverage --runInBand"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
import * as core from '@actions/core';
|
||||
import * as semver from 'semver';
|
||||
|
||||
import {Buildx} from '../buildx/buildx';
|
||||
import {Builder} from '../buildx/builder';
|
||||
import {Docker} from '../docker/docker';
|
||||
import {Config} from './config';
|
||||
import {Buildx} from '../buildx/buildx.js';
|
||||
import {Builder} from '../buildx/builder.js';
|
||||
import {Docker} from '../docker/docker.js';
|
||||
import {Config} from './config.js';
|
||||
|
||||
import {BuilderInfo, NodeInfo} from '../types/buildx/builder';
|
||||
import {BuilderInfo, NodeInfo} from '../types/buildx/builder.js';
|
||||
|
||||
export interface BuildKitOpts {
|
||||
buildx?: Buildx;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import fs from 'fs';
|
||||
|
||||
import {Context} from '../context';
|
||||
import {Context} from '../context.js';
|
||||
|
||||
export class Config {
|
||||
public resolveFromString(s: string): string {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {GitRef, GitURL, GitURLFragment, URLUserInfo} from '../types/buildkit/git';
|
||||
import {GitRef, GitURL, GitURLFragment, URLUserInfo} from '../types/buildkit/git.js';
|
||||
|
||||
export class Git {
|
||||
private static protoRegexp = new RegExp('^[a-zA-Z0-9]+://');
|
||||
|
||||
@@ -18,15 +18,15 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
import {parse} from 'csv-parse/sync';
|
||||
|
||||
import {Buildx} from './buildx';
|
||||
import {Context} from '../context';
|
||||
import {Exec} from '../exec';
|
||||
import {Util} from '../util';
|
||||
import {Buildx} from './buildx.js';
|
||||
import {Context} from '../context.js';
|
||||
import {Exec} from '../exec.js';
|
||||
import {Util} from '../util.js';
|
||||
|
||||
import {ExecOptions} from '@actions/exec';
|
||||
import {AttestEntry, BakeDefinition, CacheEntry, ExportEntry, SecretEntry, SSHEntry} from '../types/buildx/bake';
|
||||
import {BuildMetadata} from '../types/buildx/build';
|
||||
import {VertexWarning} from '../types/buildkit/client';
|
||||
import {AttestEntry, BakeDefinition, CacheEntry, ExportEntry, SecretEntry, SSHEntry} from '../types/buildx/bake.js';
|
||||
import {BuildMetadata} from '../types/buildx/build.js';
|
||||
import {VertexWarning} from '../types/buildkit/client.js';
|
||||
|
||||
export interface BakeOpts {
|
||||
buildx?: Buildx;
|
||||
|
||||
@@ -19,14 +19,14 @@ import path from 'path';
|
||||
import * as core from '@actions/core';
|
||||
import {parse} from 'csv-parse/sync';
|
||||
|
||||
import {Buildx} from './buildx';
|
||||
import {Context} from '../context';
|
||||
import {GitHub} from '../github';
|
||||
import {Util} from '../util';
|
||||
import {Buildx} from './buildx.js';
|
||||
import {Context} from '../context.js';
|
||||
import {GitHub} from '../github.js';
|
||||
import {Util} from '../util.js';
|
||||
|
||||
import {BuildMetadata} from '../types/buildx/build';
|
||||
import {VertexWarning} from '../types/buildkit/client';
|
||||
import {ProvenancePredicate} from '../types/intoto/slsa_provenance/v0.2/provenance';
|
||||
import {BuildMetadata} from '../types/buildx/build.js';
|
||||
import {VertexWarning} from '../types/buildkit/client.js';
|
||||
import {ProvenancePredicate} from '../types/intoto/slsa_provenance/v0.2/provenance.js';
|
||||
|
||||
export interface BuildOpts {
|
||||
buildx?: Buildx;
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import {Buildx} from './buildx';
|
||||
import {Exec} from '../exec';
|
||||
import {Buildx} from './buildx.js';
|
||||
import {Exec} from '../exec.js';
|
||||
|
||||
import {BuilderInfo, Device, GCPolicy, NodeInfo} from '../types/buildx/builder';
|
||||
import {BuilderInfo, Device, GCPolicy, NodeInfo} from '../types/buildx/builder.js';
|
||||
|
||||
export interface BuilderOpts {
|
||||
buildx?: Buildx;
|
||||
|
||||
@@ -19,16 +19,16 @@ import path from 'path';
|
||||
import * as core from '@actions/core';
|
||||
import * as semver from 'semver';
|
||||
|
||||
import {Git} from '../buildkit/git';
|
||||
import {Docker} from '../docker/docker';
|
||||
import {GitHub} from '../github';
|
||||
import {Exec} from '../exec';
|
||||
import {Util} from '../util';
|
||||
import {Git} from '../buildkit/git.js';
|
||||
import {Docker} from '../docker/docker.js';
|
||||
import {GitHub} from '../github.js';
|
||||
import {Exec} from '../exec.js';
|
||||
import {Util} from '../util.js';
|
||||
|
||||
import {VertexWarning} from '../types/buildkit/client';
|
||||
import {GitURL} from '../types/buildkit/git';
|
||||
import {Cert, LocalRefsOpts, LocalRefsResponse, LocalState} from '../types/buildx/buildx';
|
||||
import {GitHubAnnotation} from '../types/github';
|
||||
import {VertexWarning} from '../types/buildkit/client.js';
|
||||
import {GitURL} from '../types/buildkit/git.js';
|
||||
import {Cert, LocalRefsOpts, LocalRefsResponse, LocalState} from '../types/buildx/buildx.js';
|
||||
import {GitHubAnnotation} from '../types/github.js';
|
||||
|
||||
export interface BuildxOpts {
|
||||
standalone?: boolean;
|
||||
|
||||
@@ -21,14 +21,14 @@ import path from 'path';
|
||||
import {Readable, Writable} from 'stream';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import {Buildx} from './buildx';
|
||||
import {Context} from '../context';
|
||||
import {Docker} from '../docker/docker';
|
||||
import {Exec} from '../exec';
|
||||
import {GitHub} from '../github';
|
||||
import {Util} from '../util';
|
||||
import {Buildx} from './buildx.js';
|
||||
import {Context} from '../context.js';
|
||||
import {Docker} from '../docker/docker.js';
|
||||
import {Exec} from '../exec.js';
|
||||
import {GitHub} from '../github.js';
|
||||
import {Util} from '../util.js';
|
||||
|
||||
import {ExportOpts, ExportResponse, InspectOpts, InspectResponse, Summaries} from '../types/buildx/history';
|
||||
import {ExportOpts, ExportResponse, InspectOpts, InspectResponse, Summaries} from '../types/buildx/history.js';
|
||||
|
||||
export interface HistoryOpts {
|
||||
buildx?: Buildx;
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Buildx} from './buildx';
|
||||
import {Exec} from '../exec';
|
||||
import {Buildx} from './buildx.js';
|
||||
import {Exec} from '../exec.js';
|
||||
|
||||
import {Manifest as ImageToolsManifest} from '../types/buildx/imagetools';
|
||||
import {Image} from '../types/oci/config';
|
||||
import {Descriptor, Platform} from '../types/oci/descriptor';
|
||||
import {Digest} from '../types/oci/digest';
|
||||
import {Manifest as ImageToolsManifest} from '../types/buildx/imagetools.js';
|
||||
import {Image} from '../types/oci/config.js';
|
||||
import {Descriptor, Platform} from '../types/oci/descriptor.js';
|
||||
import {Digest} from '../types/oci/digest.js';
|
||||
|
||||
export interface ImageToolsOpts {
|
||||
buildx?: Buildx;
|
||||
|
||||
@@ -22,17 +22,17 @@ import * as tc from '@actions/tool-cache';
|
||||
import * as semver from 'semver';
|
||||
import * as util from 'util';
|
||||
|
||||
import {Buildx} from './buildx';
|
||||
import {Cache} from '../cache';
|
||||
import {Context} from '../context';
|
||||
import {Exec} from '../exec';
|
||||
import {Docker} from '../docker/docker';
|
||||
import {Git} from '../git';
|
||||
import {GitHub} from '../github';
|
||||
import {Util} from '../util';
|
||||
import {Buildx} from './buildx.js';
|
||||
import {Cache} from '../cache.js';
|
||||
import {Context} from '../context.js';
|
||||
import {Exec} from '../exec.js';
|
||||
import {Docker} from '../docker/docker.js';
|
||||
import {Git} from '../git.js';
|
||||
import {GitHub} from '../github.js';
|
||||
import {Util} from '../util.js';
|
||||
|
||||
import {DownloadVersion} from '../types/buildx/buildx';
|
||||
import {GitHubRelease} from '../types/github';
|
||||
import {DownloadVersion} from '../types/buildx/buildx.js';
|
||||
import {GitHubRelease} from '../types/github.js';
|
||||
|
||||
export interface InstallOpts {
|
||||
standalone?: boolean;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import {Docker} from '../docker/docker';
|
||||
import {Exec} from '../exec';
|
||||
import {Docker} from '../docker/docker.js';
|
||||
import {Exec} from '../exec.js';
|
||||
|
||||
export interface ComposeOpts {
|
||||
standalone?: boolean;
|
||||
|
||||
@@ -22,13 +22,13 @@ import * as tc from '@actions/tool-cache';
|
||||
import * as semver from 'semver';
|
||||
import * as util from 'util';
|
||||
|
||||
import {Cache} from '../cache';
|
||||
import {Context} from '../context';
|
||||
import {Docker} from '../docker/docker';
|
||||
import {GitHub} from '../github';
|
||||
import {Cache} from '../cache.js';
|
||||
import {Context} from '../context.js';
|
||||
import {Docker} from '../docker/docker.js';
|
||||
import {GitHub} from '../github.js';
|
||||
|
||||
import {DownloadVersion} from '../types/compose/compose';
|
||||
import {GitHubRelease} from '../types/github';
|
||||
import {DownloadVersion} from '../types/compose/compose.js';
|
||||
import {GitHubRelease} from '../types/github.js';
|
||||
|
||||
export interface InstallOpts {
|
||||
standalone?: boolean;
|
||||
|
||||
@@ -20,7 +20,7 @@ import path from 'path';
|
||||
import * as tmp from 'tmp';
|
||||
import * as github from '@actions/github';
|
||||
|
||||
import {GitHub} from './github';
|
||||
import {GitHub} from './github.js';
|
||||
|
||||
export class Context {
|
||||
private static readonly _tmpDir = fs.mkdtempSync(path.join(Context.ensureDirExists(process.env.RUNNER_TEMP || os.tmpdir()), 'docker-actions-toolkit-'));
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
import * as core from '@actions/core';
|
||||
import {BUNDLE_V03_MEDIA_TYPE, SerializedBundle} from '@sigstore/bundle';
|
||||
|
||||
import {Exec} from '../exec';
|
||||
import {Exec} from '../exec.js';
|
||||
import * as semver from 'semver';
|
||||
import {MEDIATYPE_EMPTY_JSON_V1} from '../types/oci/mediatype';
|
||||
import {MEDIATYPE_EMPTY_JSON_V1} from '../types/oci/mediatype.js';
|
||||
|
||||
export interface CosignOpts {
|
||||
binPath?: string;
|
||||
|
||||
@@ -25,17 +25,17 @@ import {toSignedEntity, toTrustMaterial, Verifier} from '@sigstore/verify';
|
||||
import * as semver from 'semver';
|
||||
import * as util from 'util';
|
||||
|
||||
import {Buildx} from '../buildx/buildx';
|
||||
import {Cache} from '../cache';
|
||||
import {Context} from '../context';
|
||||
import {Exec} from '../exec';
|
||||
import {Git} from '../git';
|
||||
import {GitHub} from '../github';
|
||||
import {Util} from '../util';
|
||||
import {Buildx} from '../buildx/buildx.js';
|
||||
import {Cache} from '../cache.js';
|
||||
import {Context} from '../context.js';
|
||||
import {Exec} from '../exec.js';
|
||||
import {Git} from '../git.js';
|
||||
import {GitHub} from '../github.js';
|
||||
import {Util} from '../util.js';
|
||||
|
||||
import {DownloadVersion} from '../types/cosign/cosign';
|
||||
import {GitHubRelease} from '../types/github';
|
||||
import {dockerfileContent} from './dockerfile';
|
||||
import {DownloadVersion} from '../types/cosign/cosign.js';
|
||||
import {GitHubRelease} from '../types/github.js';
|
||||
import {dockerfileContent} from './dockerfile.js';
|
||||
|
||||
export interface DownloadOpts {
|
||||
version: string;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import {Context} from '../context';
|
||||
import {Context} from '../context.js';
|
||||
|
||||
export const setupDockerWinPs1 = (): string => {
|
||||
return get('docker-setup-win.ps1', setupDockerWinPs1Data);
|
||||
|
||||
@@ -21,12 +21,12 @@ import * as core from '@actions/core';
|
||||
import {ExecOptions, ExecOutput} from '@actions/exec';
|
||||
import * as io from '@actions/io';
|
||||
|
||||
import {Context} from '../context';
|
||||
import {Cache} from '../cache';
|
||||
import {Exec} from '../exec';
|
||||
import {Util} from '../util';
|
||||
import {Context} from '../context.js';
|
||||
import {Cache} from '../cache.js';
|
||||
import {Exec} from '../exec.js';
|
||||
import {Util} from '../util.js';
|
||||
|
||||
import {ConfigFile, ContextInfo} from '../types/docker/docker';
|
||||
import {ConfigFile, ContextInfo} from '../types/docker/docker.js';
|
||||
|
||||
export class Docker {
|
||||
static get configDir(): string {
|
||||
|
||||
@@ -25,18 +25,18 @@ import * as core from '@actions/core';
|
||||
import * as io from '@actions/io';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
|
||||
import {Context} from '../context';
|
||||
import {Docker} from './docker';
|
||||
import {Exec} from '../exec';
|
||||
import {GitHub} from '../github';
|
||||
import {Regctl} from '../regclient/regctl';
|
||||
import {Undock} from '../undock/undock';
|
||||
import {Util} from '../util';
|
||||
import {Context} from '../context.js';
|
||||
import {Docker} from './docker.js';
|
||||
import {Exec} from '../exec.js';
|
||||
import {GitHub} from '../github.js';
|
||||
import {Regctl} from '../regclient/regctl.js';
|
||||
import {Undock} from '../undock/undock.js';
|
||||
import {Util} from '../util.js';
|
||||
|
||||
import {limaYamlData, dockerServiceLogsPs1, setupDockerWinPs1} from './assets';
|
||||
import {limaYamlData, dockerServiceLogsPs1, setupDockerWinPs1} from './assets.js';
|
||||
|
||||
import {GitHubRelease} from '../types/github';
|
||||
import {Image} from '../types/oci/config';
|
||||
import {GitHubRelease} from '../types/github.js';
|
||||
import {Image} from '../types/oci/config.js';
|
||||
|
||||
export interface InstallSourceImage {
|
||||
type: 'image';
|
||||
|
||||
@@ -18,7 +18,7 @@ import * as core from '@actions/core';
|
||||
import * as httpm from '@actions/http-client';
|
||||
import {HttpCodes} from '@actions/http-client';
|
||||
|
||||
import {RepositoryRequest, RepositoryResponse, RepositoryTagsRequest, RepositoryTagsResponse, TokenRequest, TokenResponse, UpdateRepoDescriptionRequest} from './types/dockerhub';
|
||||
import {RepositoryRequest, RepositoryResponse, RepositoryTagsRequest, RepositoryTagsResponse, TokenRequest, TokenResponse, UpdateRepoDescriptionRequest} from './types/dockerhub.js';
|
||||
|
||||
export interface DockerHubOpts {
|
||||
credentials: TokenRequest;
|
||||
|
||||
10
src/git.ts
10
src/git.ts
@@ -15,18 +15,18 @@
|
||||
*/
|
||||
|
||||
import * as core from '@actions/core';
|
||||
import * as github from '@actions/github';
|
||||
import {Octokit} from '@octokit/core';
|
||||
import {restEndpointMethods} from '@octokit/plugin-rest-endpoint-methods';
|
||||
|
||||
import {Exec} from './exec';
|
||||
import {GitHub} from './github';
|
||||
import {Context} from '@actions/github/lib/context';
|
||||
import {Exec} from './exec.js';
|
||||
import {GitHub} from './github.js';
|
||||
|
||||
import {Context as GitContext} from './types/git';
|
||||
export type GitContext = typeof github.context;
|
||||
|
||||
export class Git {
|
||||
public static async context(): Promise<GitContext> {
|
||||
const ctx = new Context();
|
||||
const ctx = {...github.context} as GitContext;
|
||||
ctx.ref = await Git.ref();
|
||||
ctx.sha = await Git.fullCommit();
|
||||
return ctx;
|
||||
|
||||
@@ -27,18 +27,15 @@ import {getBackendIdsFromToken} from '@actions/artifact/lib/internal/shared/util
|
||||
import {getExpiration} from '@actions/artifact/lib/internal/upload/retention';
|
||||
import {InvalidResponseError, NetworkError} from '@actions/artifact';
|
||||
import * as core from '@actions/core';
|
||||
import {SummaryTableCell} from '@actions/core/lib/summary';
|
||||
import * as github from '@actions/github';
|
||||
import {GitHub as Octokit} from '@actions/github/lib/utils';
|
||||
import {Context} from '@actions/github/lib/context';
|
||||
import * as httpm from '@actions/http-client';
|
||||
import {TransferProgressEvent} from '@azure/core-rest-pipeline';
|
||||
import {BlobClient, BlobHTTPHeaders} from '@azure/storage-blob';
|
||||
import {jwtDecode, JwtPayload} from 'jwt-decode';
|
||||
|
||||
import {Util} from './util';
|
||||
import {Util} from './util.js';
|
||||
|
||||
import {BuildSummaryOpts, GitHubActionsRuntimeToken, GitHubActionsRuntimeTokenAC, GitHubContentOpts, GitHubRelease, GitHubRepo, UploadArtifactOpts, UploadArtifactResponse} from './types/github';
|
||||
import {BuildSummaryOpts, GitHubActionsRuntimeToken, GitHubActionsRuntimeTokenAC, GitHubContentOpts, GitHubRelease, GitHubRepo, SummaryTableCell, UploadArtifactOpts, UploadArtifactResponse} from './types/github.js';
|
||||
|
||||
export interface GitHubOpts {
|
||||
token?: string;
|
||||
@@ -46,7 +43,7 @@ export interface GitHubOpts {
|
||||
|
||||
export class GitHub {
|
||||
private readonly githubToken?: string;
|
||||
public readonly octokit: InstanceType<typeof Octokit>;
|
||||
public readonly octokit: ReturnType<typeof github.getOctokit>;
|
||||
|
||||
constructor(opts?: GitHubOpts) {
|
||||
this.githubToken = opts?.token || process.env.GITHUB_TOKEN;
|
||||
@@ -87,7 +84,7 @@ export class GitHub {
|
||||
return <Record<string, GitHubRelease>>JSON.parse(dt);
|
||||
}
|
||||
|
||||
static get context(): Context {
|
||||
static get context(): typeof github.context {
|
||||
return github.context;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import {Cache} from './cache';
|
||||
import {Cache} from './cache.js';
|
||||
|
||||
const isPost = !!process.env['STATE_isPost'];
|
||||
if (!isPost) {
|
||||
|
||||
@@ -20,13 +20,13 @@ import * as path from 'path';
|
||||
import {Readable} from 'stream';
|
||||
import * as tar from 'tar-stream';
|
||||
|
||||
import {Archive, LoadArchiveOpts} from '../types/oci/oci';
|
||||
import {Index} from '../types/oci';
|
||||
import {Platform} from '../types/oci/descriptor';
|
||||
import {Manifest} from '../types/oci/manifest';
|
||||
import {Image} from '../types/oci/config';
|
||||
import {IMAGE_BLOBS_DIR_V1, IMAGE_INDEX_FILE_V1, IMAGE_LAYOUT_FILE_V1, ImageLayout} from '../types/oci/layout';
|
||||
import {MEDIATYPE_IMAGE_INDEX_V1, MEDIATYPE_IMAGE_MANIFEST_V1} from '../types/oci/mediatype';
|
||||
import {Archive, LoadArchiveOpts} from '../types/oci/oci.js';
|
||||
import {Index} from '../types/oci/index.js';
|
||||
import {Platform} from '../types/oci/descriptor.js';
|
||||
import {Manifest} from '../types/oci/manifest.js';
|
||||
import {Image} from '../types/oci/config.js';
|
||||
import {IMAGE_BLOBS_DIR_V1, IMAGE_INDEX_FILE_V1, IMAGE_LAYOUT_FILE_V1, ImageLayout} from '../types/oci/layout.js';
|
||||
import {MEDIATYPE_IMAGE_INDEX_V1, MEDIATYPE_IMAGE_MANIFEST_V1} from '../types/oci/mediatype.js';
|
||||
|
||||
export class OCI {
|
||||
public static defaultPlatform(): Platform {
|
||||
|
||||
@@ -22,12 +22,12 @@ import * as tc from '@actions/tool-cache';
|
||||
import * as semver from 'semver';
|
||||
import * as util from 'util';
|
||||
|
||||
import {Cache} from '../cache';
|
||||
import {Context} from '../context';
|
||||
import {GitHub} from '../github';
|
||||
import {Cache} from '../cache.js';
|
||||
import {Context} from '../context.js';
|
||||
import {GitHub} from '../github.js';
|
||||
|
||||
import {GitHubRelease} from '../types/github';
|
||||
import {DownloadVersion} from '../types/regclient/regclient';
|
||||
import {GitHubRelease} from '../types/github.js';
|
||||
import {DownloadVersion} from '../types/regclient/regclient.js';
|
||||
|
||||
export interface InstallOpts {
|
||||
githubToken?: string;
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
import * as core from '@actions/core';
|
||||
import * as semver from 'semver';
|
||||
|
||||
import {Exec} from '../exec';
|
||||
import {Exec} from '../exec.js';
|
||||
|
||||
import {Manifest} from '../types/oci/manifest';
|
||||
import {Manifest} from '../types/oci/manifest.js';
|
||||
|
||||
export interface RegctlOpts {
|
||||
binPath?: string;
|
||||
|
||||
@@ -22,13 +22,13 @@ import * as core from '@actions/core';
|
||||
import {bundleFromJSON, bundleToJSON} from '@sigstore/bundle';
|
||||
import {Artifact, Bundle, CIContextProvider, DSSEBundleBuilder, FulcioSigner, RekorWitness, TSAWitness, Witness} from '@sigstore/sign';
|
||||
|
||||
import {Context} from '../context';
|
||||
import {Cosign} from '../cosign/cosign';
|
||||
import {Exec} from '../exec';
|
||||
import {GitHub} from '../github';
|
||||
import {ImageTools} from '../buildx/imagetools';
|
||||
import {Context} from '../context.js';
|
||||
import {Cosign} from '../cosign/cosign.js';
|
||||
import {Exec} from '../exec.js';
|
||||
import {GitHub} from '../github.js';
|
||||
import {ImageTools} from '../buildx/imagetools.js';
|
||||
|
||||
import {MEDIATYPE_PAYLOAD as INTOTO_MEDIATYPE_PAYLOAD, Subject} from '../types/intoto/intoto';
|
||||
import {MEDIATYPE_PAYLOAD as INTOTO_MEDIATYPE_PAYLOAD, Subject} from '../types/intoto/intoto.js';
|
||||
import {
|
||||
Endpoints,
|
||||
FULCIO_URL,
|
||||
@@ -44,7 +44,7 @@ import {
|
||||
VerifySignedArtifactsResult,
|
||||
VerifySignedManifestsOpts,
|
||||
VerifySignedManifestsResult
|
||||
} from '../types/sigstore/sigstore';
|
||||
} from '../types/sigstore/sigstore.js';
|
||||
|
||||
export interface SigstoreOpts {
|
||||
cosign?: Cosign;
|
||||
|
||||
@@ -14,22 +14,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {GitHub} from './github';
|
||||
import {Buildx} from './buildx/buildx';
|
||||
import {Build as BuildxBuild} from './buildx/build';
|
||||
import {Bake as BuildxBake} from './buildx/bake';
|
||||
import {Install as BuildxInstall} from './buildx/install';
|
||||
import {Builder} from './buildx/builder';
|
||||
import {BuildKit} from './buildkit/buildkit';
|
||||
import {Compose} from './compose/compose';
|
||||
import {Install as ComposeInstall} from './compose/install';
|
||||
import {Cosign} from './cosign/cosign';
|
||||
import {Install as CosignInstall} from './cosign/install';
|
||||
import {Regctl} from './regclient/regctl';
|
||||
import {Install as RegctlInstall} from './regclient/install';
|
||||
import {Undock} from './undock/undock';
|
||||
import {Install as UndockInstall} from './undock/install';
|
||||
import {Sigstore} from './sigstore/sigstore';
|
||||
import {GitHub} from './github.js';
|
||||
import {Buildx} from './buildx/buildx.js';
|
||||
import {Build as BuildxBuild} from './buildx/build.js';
|
||||
import {Bake as BuildxBake} from './buildx/bake.js';
|
||||
import {Install as BuildxInstall} from './buildx/install.js';
|
||||
import {Builder} from './buildx/builder.js';
|
||||
import {BuildKit} from './buildkit/buildkit.js';
|
||||
import {Compose} from './compose/compose.js';
|
||||
import {Install as ComposeInstall} from './compose/install.js';
|
||||
import {Cosign} from './cosign/cosign.js';
|
||||
import {Install as CosignInstall} from './cosign/install.js';
|
||||
import {Regctl} from './regclient/regctl.js';
|
||||
import {Install as RegctlInstall} from './regclient/install.js';
|
||||
import {Undock} from './undock/undock.js';
|
||||
import {Install as UndockInstall} from './undock/install.js';
|
||||
import {Sigstore} from './sigstore/sigstore.js';
|
||||
|
||||
export interface ToolkitOpts {
|
||||
/**
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Digest} from '../oci/digest';
|
||||
import {ProgressGroup, Range, SourceInfo} from './ops';
|
||||
import {Digest} from '../oci/digest.js';
|
||||
import {ProgressGroup, Range, SourceInfo} from './ops.js';
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/client/graph.go#L10-L19
|
||||
export interface Vertex {
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Descriptor} from '../oci/descriptor';
|
||||
import {Digest} from '../oci/digest';
|
||||
import {ProgressGroup, Range, SourceInfo} from './ops';
|
||||
import {RpcStatus} from './rpc';
|
||||
import {Descriptor} from '../oci/descriptor.js';
|
||||
import {Digest} from '../oci/digest.js';
|
||||
import {ProgressGroup, Range, SourceInfo} from './ops.js';
|
||||
import {RpcStatus} from './rpc.js';
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/api/services/control/control.pb.go#L1504-L1525
|
||||
export interface BuildHistoryRecord {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {GitHubContentOpts} from '../github';
|
||||
import {GitHubContentOpts} from '../github.js';
|
||||
|
||||
export interface Cert {
|
||||
cacert?: string;
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Versioned} from '../oci/versioned';
|
||||
import {Descriptor} from '../oci/descriptor';
|
||||
import {Digest} from '../oci/digest';
|
||||
import {Versioned} from '../oci/versioned.js';
|
||||
import {Descriptor} from '../oci/descriptor.js';
|
||||
import {Digest} from '../oci/digest.js';
|
||||
|
||||
// https://github.com/docker/buildx/blob/62857022a08552bee5cad0c3044a9a3b185f0b32/util/imagetools/printers.go#L109-L123
|
||||
export interface Manifest extends Versioned {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {GitHubContentOpts} from '../github';
|
||||
import {GitHubContentOpts} from '../github.js';
|
||||
|
||||
export interface DownloadVersion {
|
||||
key: string;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {GitHubContentOpts} from '../github';
|
||||
import {GitHubContentOpts} from '../github.js';
|
||||
|
||||
export interface DownloadVersion {
|
||||
version: string;
|
||||
|
||||
@@ -14,12 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as core from '@actions/core';
|
||||
import {AnnotationProperties} from '@actions/core';
|
||||
import {components as OctoOpenApiTypes} from '@octokit/openapi-types';
|
||||
import {JwtPayload} from 'jwt-decode';
|
||||
|
||||
import {BakeDefinition} from './buildx/bake';
|
||||
import {ExportResponse} from './buildx/history';
|
||||
import {BakeDefinition} from './buildx/bake.js';
|
||||
import {ExportResponse} from './buildx/history.js';
|
||||
|
||||
export type SummaryTableRow = Parameters<typeof core.summary.addTable>[0][number];
|
||||
export type SummaryTableCell = Exclude<SummaryTableRow[number], string>;
|
||||
|
||||
export interface GitHubRelease {
|
||||
id: number;
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Digest} from './digest';
|
||||
import {Platform} from './descriptor';
|
||||
import {Digest} from './digest.js';
|
||||
import {Platform} from './descriptor.js';
|
||||
|
||||
export interface ImageConfig {
|
||||
User?: string;
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Digest} from './digest';
|
||||
import {Digest} from './digest.js';
|
||||
|
||||
import {MEDIATYPE_EMPTY_JSON_V1} from './mediatype';
|
||||
import {MEDIATYPE_EMPTY_JSON_V1} from './mediatype.js';
|
||||
|
||||
export interface Descriptor {
|
||||
mediaType: string;
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Versioned} from './versioned';
|
||||
import {Descriptor} from './descriptor';
|
||||
import {Versioned} from './versioned.js';
|
||||
import {Descriptor} from './descriptor.js';
|
||||
|
||||
export interface Index extends Versioned {
|
||||
mediaType?: string;
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Descriptor} from './descriptor';
|
||||
import {Versioned} from './versioned';
|
||||
import {Descriptor} from './descriptor.js';
|
||||
import {Versioned} from './versioned.js';
|
||||
|
||||
export interface Manifest extends Versioned {
|
||||
mediaType?: string;
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Index} from './index';
|
||||
import {ImageLayout} from './layout';
|
||||
import {Manifest} from './manifest';
|
||||
import {Image} from './config';
|
||||
import {Index} from './index.js';
|
||||
import {ImageLayout} from './layout.js';
|
||||
import {Manifest} from './manifest.js';
|
||||
import {Image} from './config.js';
|
||||
|
||||
export interface LoadArchiveOpts {
|
||||
file: string;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {GitHubContentOpts} from '../github';
|
||||
import {GitHubContentOpts} from '../github.js';
|
||||
|
||||
export interface DownloadVersion {
|
||||
version: string;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
import type {SerializedBundle} from '@sigstore/bundle';
|
||||
|
||||
import {Subject} from '../intoto/intoto';
|
||||
import {Platform} from '../oci/descriptor';
|
||||
import {Subject} from '../intoto/intoto.js';
|
||||
import {Platform} from '../oci/descriptor.js';
|
||||
|
||||
export const FULCIO_URL = 'https://fulcio.sigstore.dev';
|
||||
export const REKOR_URL = 'https://rekor.sigstore.dev';
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {GitHubContentOpts} from '../github';
|
||||
import {GitHubContentOpts} from '../github.js';
|
||||
|
||||
export interface DownloadVersion {
|
||||
version: string;
|
||||
|
||||
@@ -22,12 +22,12 @@ import * as tc from '@actions/tool-cache';
|
||||
import * as semver from 'semver';
|
||||
import * as util from 'util';
|
||||
|
||||
import {Cache} from '../cache';
|
||||
import {Context} from '../context';
|
||||
import {GitHub} from '../github';
|
||||
import {Cache} from '../cache.js';
|
||||
import {Context} from '../context.js';
|
||||
import {GitHub} from '../github.js';
|
||||
|
||||
import {GitHubRelease} from '../types/github';
|
||||
import {DownloadVersion} from '../types/undock/undock';
|
||||
import {GitHubRelease} from '../types/github.js';
|
||||
import {DownloadVersion} from '../types/undock/undock.js';
|
||||
|
||||
export interface InstallOpts {
|
||||
githubToken?: string;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import * as core from '@actions/core';
|
||||
import * as semver from 'semver';
|
||||
|
||||
import {Exec} from '../exec';
|
||||
import {Exec} from '../exec.js';
|
||||
|
||||
export interface UndockOpts {
|
||||
binPath?: string;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "es2020",
|
||||
"moduleResolution": "bundler",
|
||||
"esModuleInterop": true,
|
||||
"target": "es6",
|
||||
"module": "node16",
|
||||
"isolatedModules": true,
|
||||
"strict": true,
|
||||
"declaration": true,
|
||||
@@ -14,6 +14,7 @@
|
||||
"noImplicitAny": false,
|
||||
"resolveJsonModule": true,
|
||||
"useUnknownInCatchVariables": false,
|
||||
"skipLibCheck": true,
|
||||
},
|
||||
"exclude": [
|
||||
"./__mocks__/**/*",
|
||||
|
||||
15
tsconfig.test.json
Normal file
15
tsconfig.test.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": ".",
|
||||
"noEmit": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"__tests__/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"lib",
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user