From dd227cab7dc482b971003f9b020744cfb70dc75f Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Fri, 6 Sep 2024 17:15:52 +0800 Subject: [PATCH 01/27] esm --- package.json | 1 + tsconfig.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8acadf8f3..767c1f3c0 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,5 @@ { + "type": "module", "name": "gitlab-ci-local", "description": "Tired of pushing to test your .gitlab-ci.yml?", "main": "src/index.js", diff --git a/tsconfig.json b/tsconfig.json index 50e8c0fe6..785537ac3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "target": "ES2022", - "moduleResolution": "node", - "module": "commonjs", + "moduleResolution": "nodenext", + "module": "nodenext", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "inlineSourceMap": true, From c7e24ab53b788f9b5574b259e160680be8c4695b Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Fri, 6 Sep 2024 17:16:17 +0800 Subject: [PATCH 02/27] ts2esm vodoo --- src/argv.ts | 4 ++-- src/commander.ts | 12 +++++----- src/data-expander.ts | 4 ++-- src/executor.ts | 4 ++-- src/git-data.ts | 4 ++-- src/handler.ts | 14 +++++------ src/index.ts | 18 +++++++------- src/job.ts | 14 +++++------ src/parser-includes.ts | 8 +++---- src/parser.ts | 24 +++++++++---------- src/predefined-variables.ts | 2 +- src/producers.ts | 4 ++-- src/utils.ts | 6 ++--- src/validator.ts | 6 ++--- src/variables-from-files.ts | 8 +++---- tests/cases.test.ts | 4 ++-- tests/expand.test.ts | 4 ++-- tests/git-data.test.ts | 6 ++--- tests/mocks/utils.mock.ts | 2 +- tests/print-funcs.test.ts | 4 ++-- tests/process-write-streams.test.ts | 2 +- tests/rules.test.ts | 6 ++--- .../integration.after-script.test.ts | 8 +++---- ...ration.artifacts-after-afterscript.test.ts | 10 ++++---- ...ration.artifacts-after-afterscript.test.ts | 8 +++---- .../integration.artifacts-docker.test.ts | 8 +++---- .../integration.artifacts-dotenv.test.ts | 8 +++---- .../integration.artifacts-exclude.test.ts | 8 +++---- .../integration.artifacts-globstar.test.ts | 8 +++---- ...integration.artifacts-no-shell-out.test.ts | 8 +++---- ...tegration.artifacts-reports-dotenv.test.ts | 8 +++---- .../integration.artifacts-sequence.test.ts | 8 +++---- ...ration.artifacts-shell-fail-always.test.ts | 8 +++---- .../integration.artifacts-shell-fail.test.ts | 8 +++---- .../integration.artifacts-shell.test.ts | 8 +++---- ...integration.artifacts-to-source-no.test.ts | 8 +++---- .../integration.artifacts-with-cache.test.ts | 8 +++---- .../integration.before-script-default.test.ts | 8 +++---- .../integration.before-script.test.ts | 8 +++---- ...tegration.cache-conditional-policy.test.ts | 8 +++---- .../integration.cache-directives.test.ts | 8 +++---- ...gration.cache-docker-mount-invalid.test.ts | 8 +++---- .../integration.cache-docker-mount.test.ts | 10 ++++---- .../integration.cache-docker.test.ts | 8 +++---- .../integration.cache-double-run.test.ts | 8 +++---- .../integration.key-files.test.ts | 8 +++---- .../integration.key-invalid-files.test.ts | 8 +++---- .../integration.cache-paths-not-array.test.ts | 8 +++---- ...ration.cache-paths-undefined-array.test.ts | 8 +++---- .../integration.cache-shell-fail.test.ts | 8 +++---- .../integration.cache-shell.test.ts | 8 +++---- .../cache-when/integration.cache-when.test.ts | 8 +++---- .../integration.cli-option-variables.test.ts | 8 +++---- .../integration.concurrency.test.ts | 8 +++---- .../container-executable.test.ts | 8 +++---- .../coverage/integration.coverage.test.ts | 8 +++---- .../integration.custom-home.test.ts | 8 +++---- ...integration.dependencies-not-found.test.ts | 8 +++---- .../integration.dind-no-tls.test.ts | 8 +++---- .../dind-tls/integration.dind-tls.test.ts | 8 +++---- .../dotenv/integration.dotenv.test.ts | 8 +++---- .../integration.environment.test.ts | 8 +++---- .../integration.environment.test.ts | 8 +++---- .../extends/integration.extends.test.ts | 8 +++---- .../extra-host/integration.extra-host.test.ts | 8 +++---- .../integration.emulate-runner.test.ts | 12 +++++----- .../integration.hang-forever.test.ts | 8 +++---- .../image/integration.image.test.ts | 10 ++++---- .../integration.include-component.test.ts | 8 +++---- .../integration.include-inputs.test.ts | 8 +++---- .../integration.include-invalid-local.test.ts | 8 +++---- ...n.include-invalid-project-ref-file.test.ts | 8 +++---- ...integration.include-invalid-remote.test.ts | 8 +++---- .../integration.include-local.test.ts | 8 +++---- .../integration.include-local.test.ts | 8 +++---- .../integration.needs-empty.test.ts | 10 ++++---- ...-project-file-ref-with-inner-local.test.ts | 8 +++---- ...tegration.include-project-file-ref.test.ts | 8 +++---- .../integration.include-remote.test.ts | 8 +++---- .../integration.include-rules.test.ts | 8 +++---- .../integration.include-template.test.ts | 8 +++---- .../integration.interactive-image.test.ts | 8 +++---- .../integration.interactive.test.ts | 8 +++---- .../integration.invalid-stages.test.ts | 8 +++---- .../list-case/integration.list-case.test.ts | 8 +++---- .../integration.list-case.test.ts | 8 +++---- .../integration.plain.log-padding.test.ts | 8 +++---- .../integration.plain.log-timestamps.test.ts | 8 +++---- .../long-running-silent-build-job.test.ts | 8 +++---- .../long-running-silent-test-job.test.ts | 8 +++---- .../integration.environment.test.ts | 8 +++---- .../manual/integration.manual.test.ts | 8 +++---- .../integration.needs-artifacts.test.ts | 8 +++---- ...ration.needs-contains-dependencies.test.ts | 8 +++---- .../integration.needs-empty.test.ts | 8 +++---- .../integration.needs-invalid-stage.test.ts | 8 +++---- ...integration.needs-optional-complex.test.ts | 8 +++---- .../integration.needs-optional.test.ts | 8 +++---- .../integration.needs-parallel.test.ts | 8 +++---- .../integration.needs-pipeline.test.ts | 8 +++---- .../integration.needs-same-stage.test.ts | 8 +++---- .../integration.needs-sequence.test.ts | 8 +++---- .../integration.needs-unspecified-job.test.ts | 8 +++---- .../integration.network-alias-build.test.ts | 8 +++---- .../integration.network-arg.test.ts | 10 ++++---- .../integration.never-needs.test.ts | 8 +++---- .../never/integration.never.test.ts | 8 +++---- .../no-script/integration.no-script.test.ts | 8 +++---- .../integration.parallel-matrix.test.ts | 4 ++-- .../parallel/integration.parallel.test.ts | 4 ++-- .../plain/integration.plain.test.ts | 8 +++---- .../integration.predefined-variables.test.ts | 8 +++---- .../preview/integration.preview.test.ts | 8 +++---- ...integration.project-variables-file.test.ts | 8 +++---- .../integration.pull-policy.test.ts | 10 ++++---- ...tegration.reference-circular-chain.test.ts | 8 +++---- .../reference/integration.reference.test.ts | 8 +++---- ...integration.project-variables-file.test.ts | 8 +++---- .../integration.rules-changes.test.ts | 8 +++---- .../integration.rules-exists.test.ts | 8 +++---- .../integration.schema-validation.test.ts | 10 ++++---- .../integration.script-blank.test.ts | 8 +++---- .../integration.script-failures.test.ts | 8 +++---- .../integration.script-multidimension.test.ts | 8 +++---- .../integration.scripts-as-string.test.ts | 8 +++---- .../services/integration.services.test.ts | 8 +++---- .../integration.stage-not-found.test.ts | 8 +++---- .../trigger/integration.trigger.test.ts | 8 +++---- .../umask/integration.umask.test.ts | 8 +++---- .../integration.variable-escaping.test.ts | 8 +++---- .../integration.variable-expansion.test.ts | 8 +++---- .../integration.variable-order.test.ts | 8 +++---- .../integration.variables-null.test.ts | 8 +++---- .../integration.when-always.test.ts | 8 +++---- .../integration.on-failure.test.ts | 8 +++---- .../test-cases/when/integration.when.test.ts | 8 +++---- tests/utils.test.ts | 8 +++---- 137 files changed, 545 insertions(+), 545 deletions(-) diff --git a/src/argv.ts b/src/argv.ts index 931c79423..ad04720ff 100644 --- a/src/argv.ts +++ b/src/argv.ts @@ -3,8 +3,8 @@ import * as fs from "fs-extra"; import * as dotenv from "dotenv"; import * as path from "path"; import camelCase from "camelcase"; -import {Utils} from "./utils"; -import {WriteStreams} from "./write-streams"; +import {Utils} from "./utils.js"; +import {WriteStreams} from "./write-streams.js"; import chalk from "chalk"; async function isInGitRepository () { diff --git a/src/commander.ts b/src/commander.ts index 80ce74d97..4fbbe2a44 100644 --- a/src/commander.ts +++ b/src/commander.ts @@ -1,11 +1,11 @@ import chalk from "chalk"; -import {Job} from "./job"; -import {Parser} from "./parser"; -import {Utils} from "./utils"; -import {WriteStreams} from "./write-streams"; -import {Executor} from "./executor"; +import {Job} from "./job.js"; +import {Parser} from "./parser.js"; +import {Utils} from "./utils.js"; +import {WriteStreams} from "./write-streams.js"; +import {Executor} from "./executor.js"; import fs from "fs-extra"; -import {Argv} from "./argv"; +import {Argv} from "./argv.js"; import {AssertionError} from "assert"; export class Commander { diff --git a/src/data-expander.ts b/src/data-expander.ts index 4b91c357b..a9f11ba38 100644 --- a/src/data-expander.ts +++ b/src/data-expander.ts @@ -1,9 +1,9 @@ import chalk from "chalk"; import deepExtend from "deep-extend"; import assert, {AssertionError} from "assert"; -import {Job, Need} from "./job"; +import {Job, Need} from "./job.js"; import {traverse} from "object-traversal"; -import {Utils} from "./utils"; +import {Utils} from "./utils.js"; const extendsMaxDepth = 11; const extendsRecurse = (gitlabData: any, jobName: string, jobData: any, parents: any[], depth: number) => { diff --git a/src/executor.ts b/src/executor.ts index cba09c41e..db70300d3 100644 --- a/src/executor.ts +++ b/src/executor.ts @@ -1,7 +1,7 @@ import chalk from "chalk"; -import {Job} from "./job"; +import {Job} from "./job.js"; import assert, {AssertionError} from "assert"; -import {Argv} from "./argv"; +import {Argv} from "./argv.js"; import pMap from "p-map"; export class Executor { diff --git a/src/git-data.ts b/src/git-data.ts index 9c0e2882d..b32b5d5df 100644 --- a/src/git-data.ts +++ b/src/git-data.ts @@ -1,6 +1,6 @@ -import {Utils} from "./utils"; +import {Utils} from "./utils.js"; import assert, {AssertionError} from "assert"; -import {WriteStreams} from "./write-streams"; +import {WriteStreams} from "./write-streams.js"; import chalk from "chalk"; export type GitSchema = "git" | "http" | "https" | "ssh"; diff --git a/src/handler.ts b/src/handler.ts index a18534b2e..eaf7dc710 100644 --- a/src/handler.ts +++ b/src/handler.ts @@ -3,14 +3,14 @@ import chalk from "chalk"; import path from "path"; import * as fs from "fs-extra"; import * as yargs from "yargs"; -import {Commander} from "./commander"; -import {Parser} from "./parser"; -import * as state from "./state"; +import {Commander} from "./commander.js"; +import {Parser} from "./parser.js"; +import * as state from "./state.js"; import prettyHrtime from "pretty-hrtime"; -import {WriteStreams} from "./write-streams"; -import {cleanupJobResources, Job} from "./job"; -import {Utils} from "./utils"; -import {Argv} from "./argv"; +import {WriteStreams} from "./write-streams.js"; +import {cleanupJobResources, Job} from "./job.js"; +import {Utils} from "./utils.js"; +import {Argv} from "./argv.js"; import assert from "assert"; const generateGitIgnore = (cwd: string, stateDir: string) => { diff --git a/src/index.ts b/src/index.ts index 5266b3966..08b4f6339 100755 --- a/src/index.ts +++ b/src/index.ts @@ -1,18 +1,18 @@ #!/usr/bin/env node -import "source-map-support/register"; +import "source-map-support/register.js"; import chalk from "chalk"; import * as fs from "fs-extra"; import * as path from "path"; import yargs from "yargs"; -import {Parser} from "./parser"; -import * as state from "./state"; -import {WriteStreamsProcess, WriteStreamsMock} from "./write-streams"; -import {handler} from "./handler"; -import {Executor} from "./executor"; -import {Argv} from "./argv"; +import {Parser} from "./parser.js"; +import * as state from "./state.js"; +import {WriteStreamsProcess, WriteStreamsMock} from "./write-streams.js"; +import {handler} from "./handler.js"; +import {Executor} from "./executor.js"; +import {Argv} from "./argv.js"; import {AssertionError} from "assert"; -import {Job, cleanupJobResources} from "./job"; -import {GitlabRunnerPresetValues} from "./gitlab-preset"; +import {Job, cleanupJobResources} from "./job.js"; +import {GitlabRunnerPresetValues} from "./gitlab-preset.js"; const jobs: Job[] = []; diff --git a/src/job.ts b/src/job.ts index 899bc707b..e4193634f 100644 --- a/src/job.ts +++ b/src/job.ts @@ -3,15 +3,15 @@ import * as dotenv from "dotenv"; import * as fs from "fs-extra"; import prettyHrtime from "pretty-hrtime"; import split2 from "split2"; -import {Utils} from "./utils"; -import {WriteStreams} from "./write-streams"; -import {GitData} from "./git-data"; +import {Utils} from "./utils.js"; +import {WriteStreams} from "./write-streams.js"; +import {GitData} from "./git-data.js"; import assert, {AssertionError} from "assert"; -import {Mutex} from "./mutex"; -import {Argv} from "./argv"; +import {Mutex} from "./mutex.js"; +import {Argv} from "./argv.js"; import execa from "execa"; -import {CICDVariable} from "./variables-from-files"; -import {GitlabRunnerCPUsPresetValue, GitlabRunnerMemoryPresetValue, GitlabRunnerPresetValues} from "./gitlab-preset"; +import {CICDVariable} from "./variables-from-files.js"; +import {GitlabRunnerCPUsPresetValue, GitlabRunnerMemoryPresetValue, GitlabRunnerPresetValues} from "./gitlab-preset.js"; const CI_PROJECT_DIR = "/gcl-builds"; interface JobOptions { diff --git a/src/parser-includes.ts b/src/parser-includes.ts index f43f41579..de6be4df9 100644 --- a/src/parser-includes.ts +++ b/src/parser-includes.ts @@ -1,10 +1,10 @@ -import {Utils} from "./utils"; +import {Utils} from "./utils.js"; import fs from "fs-extra"; -import {WriteStreams} from "./write-streams"; -import {GitData} from "./git-data"; +import {WriteStreams} from "./write-streams.js"; +import {GitData} from "./git-data.js"; import assert, {AssertionError} from "assert"; import chalk from "chalk"; -import {Parser} from "./parser"; +import {Parser} from "./parser.js"; import axios from "axios"; import globby from "globby"; import path from "path"; diff --git a/src/parser.ts b/src/parser.ts index 02f67f8ac..f20d88e11 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -4,19 +4,19 @@ import deepExtend from "deep-extend"; import * as fs from "fs-extra"; import * as yaml from "js-yaml"; import prettyHrtime from "pretty-hrtime"; -import {Job} from "./job"; -import * as DataExpander from "./data-expander"; -import {Utils} from "./utils"; +import {Job} from "./job.js"; +import * as DataExpander from "./data-expander.js"; +import {Utils} from "./utils.js"; import assert from "assert"; -import {Validator} from "./validator"; -import * as parallel from "./parallel"; -import {GitData} from "./git-data"; -import {ParserIncludes} from "./parser-includes"; -import {Producers} from "./producers"; -import {VariablesFromFiles} from "./variables-from-files"; -import {Argv} from "./argv"; -import {WriteStreams} from "./write-streams"; -import {init as initPredefinedVariables} from "./predefined-variables"; +import {Validator} from "./validator.js"; +import * as parallel from "./parallel.js"; +import {GitData} from "./git-data.js"; +import {ParserIncludes} from "./parser-includes.js"; +import {Producers} from "./producers.js"; +import {VariablesFromFiles} from "./variables-from-files.js"; +import {Argv} from "./argv.js"; +import {WriteStreams} from "./write-streams.js"; +import {init as initPredefinedVariables} from "./predefined-variables.js"; const MAX_FUNCTIONS = 3; const INCLUDE_INPUTS_SUPPORTED_TYPES = ["string", "boolean", "number", "array"] as const; diff --git a/src/predefined-variables.ts b/src/predefined-variables.ts index 02ade0bf1..94e0e6a86 100644 --- a/src/predefined-variables.ts +++ b/src/predefined-variables.ts @@ -1,5 +1,5 @@ import camelCase from "camelcase"; -import {GitData} from "./git-data"; +import {GitData} from "./git-data.js"; type PredefinedVariablesOpts = { gitData: GitData; diff --git a/src/producers.ts b/src/producers.ts index e0f1472fd..f75433cbc 100644 --- a/src/producers.ts +++ b/src/producers.ts @@ -1,5 +1,5 @@ -import {Utils} from "./utils"; -import {Job} from "./job"; +import {Utils} from "./utils.js"; +import {Job} from "./job.js"; export class Producers { diff --git a/src/utils.ts b/src/utils.ts index 19b6ad5fc..feb5a85d2 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,12 +1,12 @@ import chalk from "chalk"; -import {Job, JobRule} from "./job"; +import {Job, JobRule} from "./job.js"; import * as fs from "fs-extra"; import checksum from "checksum"; import base64url from "base64url"; import execa from "execa"; import assert from "assert"; -import {CICDVariable} from "./variables-from-files"; -import {GitData, GitSchema} from "./git-data"; +import {CICDVariable} from "./variables-from-files.js"; +import {GitData, GitSchema} from "./git-data.js"; import globby from "globby"; import micromatch from "micromatch"; import axios from "axios"; diff --git a/src/validator.ts b/src/validator.ts index a98127e20..e258f4c02 100644 --- a/src/validator.ts +++ b/src/validator.ts @@ -1,9 +1,9 @@ import Ajv from "ajv"; -import {Job} from "./job"; +import {Job} from "./job.js"; import assert from "assert"; import chalk from "chalk"; -import schema from "./schema"; -import {betterAjvErrors} from "./schema-error"; +import schema from "./schema/index.js"; +import {betterAjvErrors} from "./schema-error.js"; import terminalLink from "terminal-link"; const MAX_ERRORS = 5; diff --git a/src/variables-from-files.ts b/src/variables-from-files.ts index cc5d472ca..facf23ff0 100644 --- a/src/variables-from-files.ts +++ b/src/variables-from-files.ts @@ -1,11 +1,11 @@ -import {WriteStreams} from "./write-streams"; -import {GitData} from "./git-data"; +import {WriteStreams} from "./write-streams.js"; +import {GitData} from "./git-data.js"; import * as fs from "fs-extra"; import * as yaml from "js-yaml"; import chalk from "chalk"; -import {Argv} from "./argv"; +import {Argv} from "./argv.js"; import assert from "assert"; -import {Utils} from "./utils"; +import {Utils} from "./utils.js"; export interface CICDVariable { type: "file" | "variable"; diff --git a/tests/cases.test.ts b/tests/cases.test.ts index e548b2105..e49431bfb 100644 --- a/tests/cases.test.ts +++ b/tests/cases.test.ts @@ -1,6 +1,6 @@ -import {WriteStreamsMock} from "../src/write-streams"; +import {WriteStreamsMock} from "../src/write-streams.js"; import chalk from "chalk"; -import {handler} from "../src/handler"; +import {handler} from "../src/handler.js"; import assert from "assert"; import {AssertionError} from "assert"; import fs from "fs-extra"; diff --git a/tests/expand.test.ts b/tests/expand.test.ts index b02778f0d..0e9fea304 100644 --- a/tests/expand.test.ts +++ b/tests/expand.test.ts @@ -1,6 +1,6 @@ import chalk from "chalk"; -import * as DataExpander from "../src/data-expander"; -import {Utils} from "../src/utils"; +import * as DataExpander from "../src/data-expander.js"; +import {Utils} from "../src/utils.js"; import assert from "assert"; import {AssertionError} from "assert"; diff --git a/tests/git-data.test.ts b/tests/git-data.test.ts index 51b5beae4..92c5ab35a 100644 --- a/tests/git-data.test.ts +++ b/tests/git-data.test.ts @@ -1,6 +1,6 @@ -import {GitData} from "../src/git-data"; -import {WriteStreamsMock} from "../src/write-streams"; -import {initSpawnSpy, initSpawnSpyReject} from "./mocks/utils.mock"; +import {GitData} from "../src/git-data.js"; +import {WriteStreamsMock} from "../src/write-streams.js"; +import {initSpawnSpy, initSpawnSpyReject} from "./mocks/utils.mock.js"; const tests = [ diff --git a/tests/mocks/utils.mock.ts b/tests/mocks/utils.mock.ts index 533be6b79..7e73c0223 100644 --- a/tests/mocks/utils.mock.ts +++ b/tests/mocks/utils.mock.ts @@ -1,5 +1,5 @@ import {when} from "jest-when"; -import {Utils} from "../../src/utils"; +import {Utils} from "../../src/utils.js"; export function initBashSpyReject (spyMocks: {cmd: string; rejection: any}[]) { const spyOn = jest.spyOn(Utils, "bash"); diff --git a/tests/print-funcs.test.ts b/tests/print-funcs.test.ts index a11d4185d..dcb35d686 100644 --- a/tests/print-funcs.test.ts +++ b/tests/print-funcs.test.ts @@ -1,5 +1,5 @@ -import {Utils} from "../src/utils"; -import {WriteStreamsMock} from "../src/write-streams"; +import {Utils} from "../src/utils.js"; +import {WriteStreamsMock} from "../src/write-streams.js"; test("Print job on first index", () => { const writeStreams = new WriteStreamsMock(); diff --git a/tests/process-write-streams.test.ts b/tests/process-write-streams.test.ts index a2c947cb4..92b8fcf27 100644 --- a/tests/process-write-streams.test.ts +++ b/tests/process-write-streams.test.ts @@ -1,4 +1,4 @@ -import {WriteStreamsProcess} from "../src/write-streams"; +import {WriteStreamsProcess} from "../src/write-streams.js"; const spyStdout = jest.spyOn(process.stdout, "write").mockImplementation(); const spyStderr = jest.spyOn(process.stderr, "write").mockImplementation(); diff --git a/tests/rules.test.ts b/tests/rules.test.ts index c1936ac5c..52044f00d 100644 --- a/tests/rules.test.ts +++ b/tests/rules.test.ts @@ -1,6 +1,6 @@ -import {Utils} from "../src/utils"; -import {GitData} from "../src/git-data"; -import {WriteStreamsMock} from "../src/write-streams"; +import {Utils} from "../src/utils.js"; +import {GitData} from "../src/git-data.js"; +import {WriteStreamsMock} from "../src/write-streams.js"; let writeStreams; let gitData: GitData; diff --git a/tests/test-cases/after-script/integration.after-script.test.ts b/tests/test-cases/after-script/integration.after-script.test.ts index cea2665a3..460600d34 100644 --- a/tests/test-cases/after-script/integration.after-script.test.ts +++ b/tests/test-cases/after-script/integration.after-script.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/argv-cwd/integration.artifacts-after-afterscript.test.ts b/tests/test-cases/argv-cwd/integration.artifacts-after-afterscript.test.ts index db7f7e03b..6d70cd3cc 100644 --- a/tests/test-cases/argv-cwd/integration.artifacts-after-afterscript.test.ts +++ b/tests/test-cases/argv-cwd/integration.artifacts-after-afterscript.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; -import {Utils} from "../../../src/utils"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; +import {Utils} from "../../../src/utils.js"; import fs from "fs-extra"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; diff --git a/tests/test-cases/artifacts-after-afterscript/integration.artifacts-after-afterscript.test.ts b/tests/test-cases/artifacts-after-afterscript/integration.artifacts-after-afterscript.test.ts index f44fb6f1f..bd68b6821 100644 --- a/tests/test-cases/artifacts-after-afterscript/integration.artifacts-after-afterscript.test.ts +++ b/tests/test-cases/artifacts-after-afterscript/integration.artifacts-after-afterscript.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; beforeAll(() => { diff --git a/tests/test-cases/artifacts-docker/integration.artifacts-docker.test.ts b/tests/test-cases/artifacts-docker/integration.artifacts-docker.test.ts index f3e69ba63..26b3eaf31 100644 --- a/tests/test-cases/artifacts-docker/integration.artifacts-docker.test.ts +++ b/tests/test-cases/artifacts-docker/integration.artifacts-docker.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; import chalk from "chalk"; diff --git a/tests/test-cases/artifacts-dotenv/integration.artifacts-dotenv.test.ts b/tests/test-cases/artifacts-dotenv/integration.artifacts-dotenv.test.ts index f206af6d0..209be157d 100644 --- a/tests/test-cases/artifacts-dotenv/integration.artifacts-dotenv.test.ts +++ b/tests/test-cases/artifacts-dotenv/integration.artifacts-dotenv.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-exclude/integration.artifacts-exclude.test.ts b/tests/test-cases/artifacts-exclude/integration.artifacts-exclude.test.ts index 1b99ee245..99630d216 100644 --- a/tests/test-cases/artifacts-exclude/integration.artifacts-exclude.test.ts +++ b/tests/test-cases/artifacts-exclude/integration.artifacts-exclude.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-globstar/integration.artifacts-globstar.test.ts b/tests/test-cases/artifacts-globstar/integration.artifacts-globstar.test.ts index 1314e5feb..c22882662 100644 --- a/tests/test-cases/artifacts-globstar/integration.artifacts-globstar.test.ts +++ b/tests/test-cases/artifacts-globstar/integration.artifacts-globstar.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-no-shell-out/integration.artifacts-no-shell-out.test.ts b/tests/test-cases/artifacts-no-shell-out/integration.artifacts-no-shell-out.test.ts index 5f09177ee..0f2b6282a 100644 --- a/tests/test-cases/artifacts-no-shell-out/integration.artifacts-no-shell-out.test.ts +++ b/tests/test-cases/artifacts-no-shell-out/integration.artifacts-no-shell-out.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-reports-dotenv/integration.artifacts-reports-dotenv.test.ts b/tests/test-cases/artifacts-reports-dotenv/integration.artifacts-reports-dotenv.test.ts index 3de236025..5c07ac274 100644 --- a/tests/test-cases/artifacts-reports-dotenv/integration.artifacts-reports-dotenv.test.ts +++ b/tests/test-cases/artifacts-reports-dotenv/integration.artifacts-reports-dotenv.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-sequence/integration.artifacts-sequence.test.ts b/tests/test-cases/artifacts-sequence/integration.artifacts-sequence.test.ts index 4481ec8cc..bdba1fe6d 100644 --- a/tests/test-cases/artifacts-sequence/integration.artifacts-sequence.test.ts +++ b/tests/test-cases/artifacts-sequence/integration.artifacts-sequence.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-shell-fail-always/integration.artifacts-shell-fail-always.test.ts b/tests/test-cases/artifacts-shell-fail-always/integration.artifacts-shell-fail-always.test.ts index 98f2636af..19f65c34d 100644 --- a/tests/test-cases/artifacts-shell-fail-always/integration.artifacts-shell-fail-always.test.ts +++ b/tests/test-cases/artifacts-shell-fail-always/integration.artifacts-shell-fail-always.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-shell-fail/integration.artifacts-shell-fail.test.ts b/tests/test-cases/artifacts-shell-fail/integration.artifacts-shell-fail.test.ts index 0de994449..b26902e00 100644 --- a/tests/test-cases/artifacts-shell-fail/integration.artifacts-shell-fail.test.ts +++ b/tests/test-cases/artifacts-shell-fail/integration.artifacts-shell-fail.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/artifacts-shell/integration.artifacts-shell.test.ts b/tests/test-cases/artifacts-shell/integration.artifacts-shell.test.ts index e2c123a92..acc42c7ba 100644 --- a/tests/test-cases/artifacts-shell/integration.artifacts-shell.test.ts +++ b/tests/test-cases/artifacts-shell/integration.artifacts-shell.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/artifacts-to-source-no/integration.artifacts-to-source-no.test.ts b/tests/test-cases/artifacts-to-source-no/integration.artifacts-to-source-no.test.ts index db0a95241..76f53a7d8 100644 --- a/tests/test-cases/artifacts-to-source-no/integration.artifacts-to-source-no.test.ts +++ b/tests/test-cases/artifacts-to-source-no/integration.artifacts-to-source-no.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-with-cache/integration.artifacts-with-cache.test.ts b/tests/test-cases/artifacts-with-cache/integration.artifacts-with-cache.test.ts index b013260d6..92eb01258 100644 --- a/tests/test-cases/artifacts-with-cache/integration.artifacts-with-cache.test.ts +++ b/tests/test-cases/artifacts-with-cache/integration.artifacts-with-cache.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/before-script-default/integration.before-script-default.test.ts b/tests/test-cases/before-script-default/integration.before-script-default.test.ts index 0f8f6578f..129c7cc03 100644 --- a/tests/test-cases/before-script-default/integration.before-script-default.test.ts +++ b/tests/test-cases/before-script-default/integration.before-script-default.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/before-script/integration.before-script.test.ts b/tests/test-cases/before-script/integration.before-script.test.ts index 16de592fa..b8e9946b5 100644 --- a/tests/test-cases/before-script/integration.before-script.test.ts +++ b/tests/test-cases/before-script/integration.before-script.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cache-conditional-policy/integration.cache-conditional-policy.test.ts b/tests/test-cases/cache-conditional-policy/integration.cache-conditional-policy.test.ts index 5be2f6c4d..1e8049d0b 100644 --- a/tests/test-cases/cache-conditional-policy/integration.cache-conditional-policy.test.ts +++ b/tests/test-cases/cache-conditional-policy/integration.cache-conditional-policy.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/cache-directives/integration.cache-directives.test.ts b/tests/test-cases/cache-directives/integration.cache-directives.test.ts index 5b17578d0..cf7288925 100644 --- a/tests/test-cases/cache-directives/integration.cache-directives.test.ts +++ b/tests/test-cases/cache-directives/integration.cache-directives.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cache-docker-mount-globstar/integration.cache-docker-mount-invalid.test.ts b/tests/test-cases/cache-docker-mount-globstar/integration.cache-docker-mount-invalid.test.ts index 13ea22df7..685eff111 100644 --- a/tests/test-cases/cache-docker-mount-globstar/integration.cache-docker-mount-invalid.test.ts +++ b/tests/test-cases/cache-docker-mount-globstar/integration.cache-docker-mount-invalid.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import assert, {AssertionError} from "assert"; import chalk from "chalk"; diff --git a/tests/test-cases/cache-docker-mount/integration.cache-docker-mount.test.ts b/tests/test-cases/cache-docker-mount/integration.cache-docker-mount.test.ts index f6fe7ca24..03545c064 100644 --- a/tests/test-cases/cache-docker-mount/integration.cache-docker-mount.test.ts +++ b/tests/test-cases/cache-docker-mount/integration.cache-docker-mount.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; -import {Utils} from "../../../src/utils"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; +import {Utils} from "../../../src/utils.js"; jest.setTimeout(45000); diff --git a/tests/test-cases/cache-docker/integration.cache-docker.test.ts b/tests/test-cases/cache-docker/integration.cache-docker.test.ts index 517b308ec..f14ae2938 100644 --- a/tests/test-cases/cache-docker/integration.cache-docker.test.ts +++ b/tests/test-cases/cache-docker/integration.cache-docker.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cache-double-run/integration.cache-double-run.test.ts b/tests/test-cases/cache-double-run/integration.cache-double-run.test.ts index 347ec14e0..8905cb0e5 100644 --- a/tests/test-cases/cache-double-run/integration.cache-double-run.test.ts +++ b/tests/test-cases/cache-double-run/integration.cache-double-run.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cache-key-files/integration.key-files.test.ts b/tests/test-cases/cache-key-files/integration.key-files.test.ts index 13d99b3f9..62bff12f7 100644 --- a/tests/test-cases/cache-key-files/integration.key-files.test.ts +++ b/tests/test-cases/cache-key-files/integration.key-files.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/cache-key-invalid-files/integration.key-invalid-files.test.ts b/tests/test-cases/cache-key-invalid-files/integration.key-invalid-files.test.ts index 60d2b092e..a25d183de 100644 --- a/tests/test-cases/cache-key-invalid-files/integration.key-invalid-files.test.ts +++ b/tests/test-cases/cache-key-invalid-files/integration.key-invalid-files.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import {AssertionError} from "assert"; beforeAll(() => { diff --git a/tests/test-cases/cache-paths-not-array/integration.cache-paths-not-array.test.ts b/tests/test-cases/cache-paths-not-array/integration.cache-paths-not-array.test.ts index eb3dc4a74..66841800b 100644 --- a/tests/test-cases/cache-paths-not-array/integration.cache-paths-not-array.test.ts +++ b/tests/test-cases/cache-paths-not-array/integration.cache-paths-not-array.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/cache-paths-undefined-array/integration.cache-paths-undefined-array.test.ts b/tests/test-cases/cache-paths-undefined-array/integration.cache-paths-undefined-array.test.ts index 1a7366460..07dbcb61a 100644 --- a/tests/test-cases/cache-paths-undefined-array/integration.cache-paths-undefined-array.test.ts +++ b/tests/test-cases/cache-paths-undefined-array/integration.cache-paths-undefined-array.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/cache-shell-fail/integration.cache-shell-fail.test.ts b/tests/test-cases/cache-shell-fail/integration.cache-shell-fail.test.ts index d7d32da4e..562c47e16 100644 --- a/tests/test-cases/cache-shell-fail/integration.cache-shell-fail.test.ts +++ b/tests/test-cases/cache-shell-fail/integration.cache-shell-fail.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/cache-shell/integration.cache-shell.test.ts b/tests/test-cases/cache-shell/integration.cache-shell.test.ts index eb0b886b5..2a8d36e3f 100644 --- a/tests/test-cases/cache-shell/integration.cache-shell.test.ts +++ b/tests/test-cases/cache-shell/integration.cache-shell.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cache-when/integration.cache-when.test.ts b/tests/test-cases/cache-when/integration.cache-when.test.ts index ea4c74760..7e710de5d 100644 --- a/tests/test-cases/cache-when/integration.cache-when.test.ts +++ b/tests/test-cases/cache-when/integration.cache-when.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cli-option-variables/integration.cli-option-variables.test.ts b/tests/test-cases/cli-option-variables/integration.cli-option-variables.test.ts index cf8845e56..f141b25f1 100644 --- a/tests/test-cases/cli-option-variables/integration.cli-option-variables.test.ts +++ b/tests/test-cases/cli-option-variables/integration.cli-option-variables.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/concurrency/integration.concurrency.test.ts b/tests/test-cases/concurrency/integration.concurrency.test.ts index abee9a0f6..f1982958e 100644 --- a/tests/test-cases/concurrency/integration.concurrency.test.ts +++ b/tests/test-cases/concurrency/integration.concurrency.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/container-executable/container-executable.test.ts b/tests/test-cases/container-executable/container-executable.test.ts index eb9c28503..9b4a0f6ec 100644 --- a/tests/test-cases/container-executable/container-executable.test.ts +++ b/tests/test-cases/container-executable/container-executable.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/coverage/integration.coverage.test.ts b/tests/test-cases/coverage/integration.coverage.test.ts index 459a8cfbe..8674f35ac 100644 --- a/tests/test-cases/coverage/integration.coverage.test.ts +++ b/tests/test-cases/coverage/integration.coverage.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/custom-home/integration.custom-home.test.ts b/tests/test-cases/custom-home/integration.custom-home.test.ts index 43dd0f1ce..2d7d4ab06 100644 --- a/tests/test-cases/custom-home/integration.custom-home.test.ts +++ b/tests/test-cases/custom-home/integration.custom-home.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { const spyGitRemote = { diff --git a/tests/test-cases/dependencies-not-found/integration.dependencies-not-found.test.ts b/tests/test-cases/dependencies-not-found/integration.dependencies-not-found.test.ts index a74e0d422..57efda591 100644 --- a/tests/test-cases/dependencies-not-found/integration.dependencies-not-found.test.ts +++ b/tests/test-cases/dependencies-not-found/integration.dependencies-not-found.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import assert, {AssertionError} from "assert"; beforeAll(() => { diff --git a/tests/test-cases/dind-no-tls/integration.dind-no-tls.test.ts b/tests/test-cases/dind-no-tls/integration.dind-no-tls.test.ts index 4eb63d7a5..1954298db 100644 --- a/tests/test-cases/dind-no-tls/integration.dind-no-tls.test.ts +++ b/tests/test-cases/dind-no-tls/integration.dind-no-tls.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; jest.setTimeout(60000); diff --git a/tests/test-cases/dind-tls/integration.dind-tls.test.ts b/tests/test-cases/dind-tls/integration.dind-tls.test.ts index 25b5242ad..fda97e2b0 100644 --- a/tests/test-cases/dind-tls/integration.dind-tls.test.ts +++ b/tests/test-cases/dind-tls/integration.dind-tls.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; jest.setTimeout(60000); diff --git a/tests/test-cases/dotenv/integration.dotenv.test.ts b/tests/test-cases/dotenv/integration.dotenv.test.ts index 615fe7bd8..c86fa1121 100644 --- a/tests/test-cases/dotenv/integration.dotenv.test.ts +++ b/tests/test-cases/dotenv/integration.dotenv.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; beforeAll(() => { diff --git a/tests/test-cases/duplicated-keys/integration.environment.test.ts b/tests/test-cases/duplicated-keys/integration.environment.test.ts index e5d94df89..8e9f0c1f9 100644 --- a/tests/test-cases/duplicated-keys/integration.environment.test.ts +++ b/tests/test-cases/duplicated-keys/integration.environment.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/environment/integration.environment.test.ts b/tests/test-cases/environment/integration.environment.test.ts index 518a58446..268e8cb3c 100644 --- a/tests/test-cases/environment/integration.environment.test.ts +++ b/tests/test-cases/environment/integration.environment.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/extends/integration.extends.test.ts b/tests/test-cases/extends/integration.extends.test.ts index ba5f6094e..a2455d1d0 100644 --- a/tests/test-cases/extends/integration.extends.test.ts +++ b/tests/test-cases/extends/integration.extends.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/extra-host/integration.extra-host.test.ts b/tests/test-cases/extra-host/integration.extra-host.test.ts index 446a1b15f..b65b5f649 100644 --- a/tests/test-cases/extra-host/integration.extra-host.test.ts +++ b/tests/test-cases/extra-host/integration.extra-host.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; beforeAll(() => { diff --git a/tests/test-cases/gitlab-runner-emulation/integration.emulate-runner.test.ts b/tests/test-cases/gitlab-runner-emulation/integration.emulate-runner.test.ts index 0b92cf758..873b70d22 100644 --- a/tests/test-cases/gitlab-runner-emulation/integration.emulate-runner.test.ts +++ b/tests/test-cases/gitlab-runner-emulation/integration.emulate-runner.test.ts @@ -1,13 +1,13 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initBashSpy, initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; -import {cleanupJobResources, Job} from "../../../src/job"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initBashSpy, initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; +import {cleanupJobResources, Job} from "../../../src/job.js"; import { GitlabRunnerCPUsPresetValue, GitlabRunnerMemoryPresetValue, GitlabRunnerPresetValues, -} from "../../../src/gitlab-preset"; +} from "../../../src/gitlab-preset.js"; let jobs: Job[] = []; beforeAll(() => { diff --git a/tests/test-cases/hang-forever/integration.hang-forever.test.ts b/tests/test-cases/hang-forever/integration.hang-forever.test.ts index 11891e0e1..dbceeb31a 100644 --- a/tests/test-cases/hang-forever/integration.hang-forever.test.ts +++ b/tests/test-cases/hang-forever/integration.hang-forever.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/image/integration.image.test.ts b/tests/test-cases/image/integration.image.test.ts index 5c1ea842f..36aa5d872 100644 --- a/tests/test-cases/image/integration.image.test.ts +++ b/tests/test-cases/image/integration.image.test.ts @@ -1,10 +1,10 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; -import {cleanupJobResources, Job} from "../../../src/job"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; +import {cleanupJobResources, Job} from "../../../src/job.js"; jest.setTimeout(30000); diff --git a/tests/test-cases/include-component/integration.include-component.test.ts b/tests/test-cases/include-component/integration.include-component.test.ts index 3ce9281cb..d9099daab 100644 --- a/tests/test-cases/include-component/integration.include-component.test.ts +++ b/tests/test-cases/include-component/integration.include-component.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/include-inputs/integration.include-inputs.test.ts b/tests/test-cases/include-inputs/integration.include-inputs.test.ts index 69dd752a7..01810fb1f 100644 --- a/tests/test-cases/include-inputs/integration.include-inputs.test.ts +++ b/tests/test-cases/include-inputs/integration.include-inputs.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/include-invalid-local/integration.include-invalid-local.test.ts b/tests/test-cases/include-invalid-local/integration.include-invalid-local.test.ts index 10e715df6..972223739 100644 --- a/tests/test-cases/include-invalid-local/integration.include-invalid-local.test.ts +++ b/tests/test-cases/include-invalid-local/integration.include-invalid-local.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/include-invalid-project-file-ref/integration.include-invalid-project-ref-file.test.ts b/tests/test-cases/include-invalid-project-file-ref/integration.include-invalid-project-ref-file.test.ts index fdb21947c..4287ce3cf 100644 --- a/tests/test-cases/include-invalid-project-file-ref/integration.include-invalid-project-ref-file.test.ts +++ b/tests/test-cases/include-invalid-project-file-ref/integration.include-invalid-project-ref-file.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; test("include-invalid-project-file-ref", async () => { try { diff --git a/tests/test-cases/include-invalid-remote/integration.include-invalid-remote.test.ts b/tests/test-cases/include-invalid-remote/integration.include-invalid-remote.test.ts index 1e60b586f..c57c3b416 100644 --- a/tests/test-cases/include-invalid-remote/integration.include-invalid-remote.test.ts +++ b/tests/test-cases/include-invalid-remote/integration.include-invalid-remote.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import AxiosMockAdapter from "axios-mock-adapter"; import axios from "axios"; diff --git a/tests/test-cases/include-local-wildcard/integration.include-local.test.ts b/tests/test-cases/include-local-wildcard/integration.include-local.test.ts index ff71695e9..708d2ac02 100644 --- a/tests/test-cases/include-local-wildcard/integration.include-local.test.ts +++ b/tests/test-cases/include-local-wildcard/integration.include-local.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/include-local/integration.include-local.test.ts b/tests/test-cases/include-local/integration.include-local.test.ts index 518bfc6e2..4202bc119 100644 --- a/tests/test-cases/include-local/integration.include-local.test.ts +++ b/tests/test-cases/include-local/integration.include-local.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import assert, {AssertionError} from "assert"; beforeAll(() => { diff --git a/tests/test-cases/include-nested/integration.needs-empty.test.ts b/tests/test-cases/include-nested/integration.needs-empty.test.ts index 962d956e4..94c10b794 100644 --- a/tests/test-cases/include-nested/integration.needs-empty.test.ts +++ b/tests/test-cases/include-nested/integration.needs-empty.test.ts @@ -1,10 +1,10 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; import assert, {AssertionError} from "assert"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; -import {ParserIncludes} from "../../../src/parser-includes"; +import {ParserIncludes} from "../../../src/parser-includes.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/include-project-file-ref-with-inner-local/integration.include-project-file-ref-with-inner-local.test.ts b/tests/test-cases/include-project-file-ref-with-inner-local/integration.include-project-file-ref-with-inner-local.test.ts index 4f1a2e6b3..ed3c5f1b8 100644 --- a/tests/test-cases/include-project-file-ref-with-inner-local/integration.include-project-file-ref-with-inner-local.test.ts +++ b/tests/test-cases/include-project-file-ref-with-inner-local/integration.include-project-file-ref-with-inner-local.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initBashSpy, initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initBashSpy, initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; test("include-project-file-ref-with-inner-local", async () => { diff --git a/tests/test-cases/include-project-file-ref/integration.include-project-file-ref.test.ts b/tests/test-cases/include-project-file-ref/integration.include-project-file-ref.test.ts index 5e081f16d..564b32902 100644 --- a/tests/test-cases/include-project-file-ref/integration.include-project-file-ref.test.ts +++ b/tests/test-cases/include-project-file-ref/integration.include-project-file-ref.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; test("include-project-file-ref ", async () => { diff --git a/tests/test-cases/include-remote/integration.include-remote.test.ts b/tests/test-cases/include-remote/integration.include-remote.test.ts index 81cb7e1a7..1b8ab9406 100644 --- a/tests/test-cases/include-remote/integration.include-remote.test.ts +++ b/tests/test-cases/include-remote/integration.include-remote.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import AxiosMockAdapter from "axios-mock-adapter"; import axios from "axios"; import fs from "fs-extra"; diff --git a/tests/test-cases/include-rules/integration.include-rules.test.ts b/tests/test-cases/include-rules/integration.include-rules.test.ts index 350efc41b..cac109742 100644 --- a/tests/test-cases/include-rules/integration.include-rules.test.ts +++ b/tests/test-cases/include-rules/integration.include-rules.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/include-template/integration.include-template.test.ts b/tests/test-cases/include-template/integration.include-template.test.ts index 38dc6ee10..46d5a5112 100644 --- a/tests/test-cases/include-template/integration.include-template.test.ts +++ b/tests/test-cases/include-template/integration.include-template.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/interactive-image/integration.interactive-image.test.ts b/tests/test-cases/interactive-image/integration.interactive-image.test.ts index 48d7bb872..a95f5ecd5 100644 --- a/tests/test-cases/interactive-image/integration.interactive-image.test.ts +++ b/tests/test-cases/interactive-image/integration.interactive-image.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/interactive/integration.interactive.test.ts b/tests/test-cases/interactive/integration.interactive.test.ts index fb0e26ac1..6ae133497 100644 --- a/tests/test-cases/interactive/integration.interactive.test.ts +++ b/tests/test-cases/interactive/integration.interactive.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/invalid-stages/integration.invalid-stages.test.ts b/tests/test-cases/invalid-stages/integration.invalid-stages.test.ts index af341a354..403c3d093 100644 --- a/tests/test-cases/invalid-stages/integration.invalid-stages.test.ts +++ b/tests/test-cases/invalid-stages/integration.invalid-stages.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/list-case/integration.list-case.test.ts b/tests/test-cases/list-case/integration.list-case.test.ts index edcf1da69..13b2b9138 100644 --- a/tests/test-cases/list-case/integration.list-case.test.ts +++ b/tests/test-cases/list-case/integration.list-case.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/list-csv-case/integration.list-case.test.ts b/tests/test-cases/list-csv-case/integration.list-case.test.ts index 5cd429ff7..6a03e976e 100644 --- a/tests/test-cases/list-csv-case/integration.list-case.test.ts +++ b/tests/test-cases/list-csv-case/integration.list-case.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/log-padding/integration.plain.log-padding.test.ts b/tests/test-cases/log-padding/integration.plain.log-padding.test.ts index d2ad7f0d4..c80535cd8 100644 --- a/tests/test-cases/log-padding/integration.plain.log-padding.test.ts +++ b/tests/test-cases/log-padding/integration.plain.log-padding.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/log-timestamps/integration.plain.log-timestamps.test.ts b/tests/test-cases/log-timestamps/integration.plain.log-timestamps.test.ts index f7d718704..dc4705a66 100644 --- a/tests/test-cases/log-timestamps/integration.plain.log-timestamps.test.ts +++ b/tests/test-cases/log-timestamps/integration.plain.log-timestamps.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import assert from "assert"; beforeAll(() => { diff --git a/tests/test-cases/long-running-silent-build-job/long-running-silent-build-job.test.ts b/tests/test-cases/long-running-silent-build-job/long-running-silent-build-job.test.ts index efd5e5d39..96361ee75 100644 --- a/tests/test-cases/long-running-silent-build-job/long-running-silent-build-job.test.ts +++ b/tests/test-cases/long-running-silent-build-job/long-running-silent-build-job.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; jest.setTimeout(13000); diff --git a/tests/test-cases/long-running-silent-test-job/long-running-silent-test-job.test.ts b/tests/test-cases/long-running-silent-test-job/long-running-silent-test-job.test.ts index 136295d7f..f295f8f1a 100644 --- a/tests/test-cases/long-running-silent-test-job/long-running-silent-test-job.test.ts +++ b/tests/test-cases/long-running-silent-test-job/long-running-silent-test-job.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; jest.setTimeout(13000); diff --git a/tests/test-cases/mac-address/integration.environment.test.ts b/tests/test-cases/mac-address/integration.environment.test.ts index 27560d8a5..d79916784 100644 --- a/tests/test-cases/mac-address/integration.environment.test.ts +++ b/tests/test-cases/mac-address/integration.environment.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/manual/integration.manual.test.ts b/tests/test-cases/manual/integration.manual.test.ts index 8739b5552..f65c1cb37 100644 --- a/tests/test-cases/manual/integration.manual.test.ts +++ b/tests/test-cases/manual/integration.manual.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-artifacts/integration.needs-artifacts.test.ts b/tests/test-cases/needs-artifacts/integration.needs-artifacts.test.ts index b1a81b47c..ad2da6222 100644 --- a/tests/test-cases/needs-artifacts/integration.needs-artifacts.test.ts +++ b/tests/test-cases/needs-artifacts/integration.needs-artifacts.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-contains-dependencies/integration.needs-contains-dependencies.test.ts b/tests/test-cases/needs-contains-dependencies/integration.needs-contains-dependencies.test.ts index bf71277b3..2f9b049c4 100644 --- a/tests/test-cases/needs-contains-dependencies/integration.needs-contains-dependencies.test.ts +++ b/tests/test-cases/needs-contains-dependencies/integration.needs-contains-dependencies.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-empty/integration.needs-empty.test.ts b/tests/test-cases/needs-empty/integration.needs-empty.test.ts index 1bde917b2..2201d28b8 100644 --- a/tests/test-cases/needs-empty/integration.needs-empty.test.ts +++ b/tests/test-cases/needs-empty/integration.needs-empty.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-invalid-stage/integration.needs-invalid-stage.test.ts b/tests/test-cases/needs-invalid-stage/integration.needs-invalid-stage.test.ts index d98049518..0d64b9994 100644 --- a/tests/test-cases/needs-invalid-stage/integration.needs-invalid-stage.test.ts +++ b/tests/test-cases/needs-invalid-stage/integration.needs-invalid-stage.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-optional-complex/integration.needs-optional-complex.test.ts b/tests/test-cases/needs-optional-complex/integration.needs-optional-complex.test.ts index 381da04a3..f9f5bbcf2 100644 --- a/tests/test-cases/needs-optional-complex/integration.needs-optional-complex.test.ts +++ b/tests/test-cases/needs-optional-complex/integration.needs-optional-complex.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-optional/integration.needs-optional.test.ts b/tests/test-cases/needs-optional/integration.needs-optional.test.ts index 29e25ffac..cd919eb5b 100644 --- a/tests/test-cases/needs-optional/integration.needs-optional.test.ts +++ b/tests/test-cases/needs-optional/integration.needs-optional.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-parallel/integration.needs-parallel.test.ts b/tests/test-cases/needs-parallel/integration.needs-parallel.test.ts index b6b0bd5d1..de8a0ff4b 100644 --- a/tests/test-cases/needs-parallel/integration.needs-parallel.test.ts +++ b/tests/test-cases/needs-parallel/integration.needs-parallel.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-pipeline/integration.needs-pipeline.test.ts b/tests/test-cases/needs-pipeline/integration.needs-pipeline.test.ts index 97f286800..2636ac804 100644 --- a/tests/test-cases/needs-pipeline/integration.needs-pipeline.test.ts +++ b/tests/test-cases/needs-pipeline/integration.needs-pipeline.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-same-stage/integration.needs-same-stage.test.ts b/tests/test-cases/needs-same-stage/integration.needs-same-stage.test.ts index de8d1249f..ae408937f 100644 --- a/tests/test-cases/needs-same-stage/integration.needs-same-stage.test.ts +++ b/tests/test-cases/needs-same-stage/integration.needs-same-stage.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-sequence/integration.needs-sequence.test.ts b/tests/test-cases/needs-sequence/integration.needs-sequence.test.ts index dc1f74375..de4c763f8 100644 --- a/tests/test-cases/needs-sequence/integration.needs-sequence.test.ts +++ b/tests/test-cases/needs-sequence/integration.needs-sequence.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-unspecified-job/integration.needs-unspecified-job.test.ts b/tests/test-cases/needs-unspecified-job/integration.needs-unspecified-job.test.ts index 090b4ebd2..c91b8c650 100644 --- a/tests/test-cases/needs-unspecified-job/integration.needs-unspecified-job.test.ts +++ b/tests/test-cases/needs-unspecified-job/integration.needs-unspecified-job.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/network-alias-build/integration.network-alias-build.test.ts b/tests/test-cases/network-alias-build/integration.network-alias-build.test.ts index d5eb6c4a5..3fd435a0d 100644 --- a/tests/test-cases/network-alias-build/integration.network-alias-build.test.ts +++ b/tests/test-cases/network-alias-build/integration.network-alias-build.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/network-arg/integration.network-arg.test.ts b/tests/test-cases/network-arg/integration.network-arg.test.ts index ee63715a3..dcd602ffa 100644 --- a/tests/test-cases/network-arg/integration.network-arg.test.ts +++ b/tests/test-cases/network-arg/integration.network-arg.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {Job, cleanupJobResources} from "../../../src/job"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {Job, cleanupJobResources} from "../../../src/job.js"; import chalk from "chalk"; -import {initSpawnSpy, initBashSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy, initBashSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import assert from "assert"; import {AssertionError} from "assert"; diff --git a/tests/test-cases/never-needs/integration.never-needs.test.ts b/tests/test-cases/never-needs/integration.never-needs.test.ts index fcc846f77..1cc8bbc1e 100644 --- a/tests/test-cases/never-needs/integration.never-needs.test.ts +++ b/tests/test-cases/never-needs/integration.never-needs.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/never/integration.never.test.ts b/tests/test-cases/never/integration.never.test.ts index b21855275..3ae687c81 100644 --- a/tests/test-cases/never/integration.never.test.ts +++ b/tests/test-cases/never/integration.never.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/no-script/integration.no-script.test.ts b/tests/test-cases/no-script/integration.no-script.test.ts index 58f2733f6..6761bc4cf 100644 --- a/tests/test-cases/no-script/integration.no-script.test.ts +++ b/tests/test-cases/no-script/integration.no-script.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/parallel-matrix/integration.parallel-matrix.test.ts b/tests/test-cases/parallel-matrix/integration.parallel-matrix.test.ts index c8e918ca1..314cb24d8 100644 --- a/tests/test-cases/parallel-matrix/integration.parallel-matrix.test.ts +++ b/tests/test-cases/parallel-matrix/integration.parallel-matrix.test.ts @@ -1,5 +1,5 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; jest.setTimeout(60000); diff --git a/tests/test-cases/parallel/integration.parallel.test.ts b/tests/test-cases/parallel/integration.parallel.test.ts index 5c324cc22..228718763 100644 --- a/tests/test-cases/parallel/integration.parallel.test.ts +++ b/tests/test-cases/parallel/integration.parallel.test.ts @@ -1,5 +1,5 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; test("parallel ", async () => { diff --git a/tests/test-cases/plain/integration.plain.test.ts b/tests/test-cases/plain/integration.plain.test.ts index 630331879..4c35a59b8 100644 --- a/tests/test-cases/plain/integration.plain.test.ts +++ b/tests/test-cases/plain/integration.plain.test.ts @@ -1,10 +1,10 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import fs from "fs-extra"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/predefined-variables/integration.predefined-variables.test.ts b/tests/test-cases/predefined-variables/integration.predefined-variables.test.ts index 9049def31..b31aeae1b 100644 --- a/tests/test-cases/predefined-variables/integration.predefined-variables.test.ts +++ b/tests/test-cases/predefined-variables/integration.predefined-variables.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; test("predefined-variables ", async () => { const writeStreams = new WriteStreamsMock(); diff --git a/tests/test-cases/preview/integration.preview.test.ts b/tests/test-cases/preview/integration.preview.test.ts index 77cc78989..e29e9ca76 100644 --- a/tests/test-cases/preview/integration.preview.test.ts +++ b/tests/test-cases/preview/integration.preview.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/project-variables-file/integration.project-variables-file.test.ts b/tests/test-cases/project-variables-file/integration.project-variables-file.test.ts index 1ee6f17c3..edef40b1e 100644 --- a/tests/test-cases/project-variables-file/integration.project-variables-file.test.ts +++ b/tests/test-cases/project-variables-file/integration.project-variables-file.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy([...WhenStatics.all]); diff --git a/tests/test-cases/pull-policy/integration.pull-policy.test.ts b/tests/test-cases/pull-policy/integration.pull-policy.test.ts index 4f17558d3..12f7f91e3 100644 --- a/tests/test-cases/pull-policy/integration.pull-policy.test.ts +++ b/tests/test-cases/pull-policy/integration.pull-policy.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; -import {Utils} from "../../../src/utils"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; +import {Utils} from "../../../src/utils.js"; jest.setTimeout(60000); diff --git a/tests/test-cases/reference-circular-chain/integration.reference-circular-chain.test.ts b/tests/test-cases/reference-circular-chain/integration.reference-circular-chain.test.ts index f0b1a042a..5f7cca40b 100644 --- a/tests/test-cases/reference-circular-chain/integration.reference-circular-chain.test.ts +++ b/tests/test-cases/reference-circular-chain/integration.reference-circular-chain.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/reference/integration.reference.test.ts b/tests/test-cases/reference/integration.reference.test.ts index 49f72c30a..d2a4143e3 100644 --- a/tests/test-cases/reference/integration.reference.test.ts +++ b/tests/test-cases/reference/integration.reference.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/remote-variables-file/integration.project-variables-file.test.ts b/tests/test-cases/remote-variables-file/integration.project-variables-file.test.ts index 7121038cf..1b232351c 100644 --- a/tests/test-cases/remote-variables-file/integration.project-variables-file.test.ts +++ b/tests/test-cases/remote-variables-file/integration.project-variables-file.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initBashSpy, initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initBashSpy, initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { const spyGitArchive = { diff --git a/tests/test-cases/rules-changes/integration.rules-changes.test.ts b/tests/test-cases/rules-changes/integration.rules-changes.test.ts index 05afaa103..ae0d405f7 100644 --- a/tests/test-cases/rules-changes/integration.rules-changes.test.ts +++ b/tests/test-cases/rules-changes/integration.rules-changes.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy, initSyncSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy, initSyncSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/rules-exists/integration.rules-exists.test.ts b/tests/test-cases/rules-exists/integration.rules-exists.test.ts index 3cf21ec36..61dda5012 100644 --- a/tests/test-cases/rules-exists/integration.rules-exists.test.ts +++ b/tests/test-cases/rules-exists/integration.rules-exists.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/schema-validation/integration.schema-validation.test.ts b/tests/test-cases/schema-validation/integration.schema-validation.test.ts index 461f3b9de..86e58e37f 100644 --- a/tests/test-cases/schema-validation/integration.schema-validation.test.ts +++ b/tests/test-cases/schema-validation/integration.schema-validation.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import assert, {AssertionError} from "assert"; -import {stripAnsi} from "../../utils"; +import {stripAnsi} from "../../utils.js"; beforeAll(() => { diff --git a/tests/test-cases/script-blank/integration.script-blank.test.ts b/tests/test-cases/script-blank/integration.script-blank.test.ts index 8f4d37e38..bda9240d2 100644 --- a/tests/test-cases/script-blank/integration.script-blank.test.ts +++ b/tests/test-cases/script-blank/integration.script-blank.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/script-failures/integration.script-failures.test.ts b/tests/test-cases/script-failures/integration.script-failures.test.ts index 17c9f51dd..cee9976b4 100644 --- a/tests/test-cases/script-failures/integration.script-failures.test.ts +++ b/tests/test-cases/script-failures/integration.script-failures.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/script-multidimension/integration.script-multidimension.test.ts b/tests/test-cases/script-multidimension/integration.script-multidimension.test.ts index b72e57233..5dcd71d11 100644 --- a/tests/test-cases/script-multidimension/integration.script-multidimension.test.ts +++ b/tests/test-cases/script-multidimension/integration.script-multidimension.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/scripts-as-string/integration.scripts-as-string.test.ts b/tests/test-cases/scripts-as-string/integration.scripts-as-string.test.ts index 041919a7f..b557e7b3f 100644 --- a/tests/test-cases/scripts-as-string/integration.scripts-as-string.test.ts +++ b/tests/test-cases/scripts-as-string/integration.scripts-as-string.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/services/integration.services.test.ts b/tests/test-cases/services/integration.services.test.ts index c4f55f613..71b38de83 100644 --- a/tests/test-cases/services/integration.services.test.ts +++ b/tests/test-cases/services/integration.services.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; jest.setTimeout(30000); diff --git a/tests/test-cases/stage-not-found/integration.stage-not-found.test.ts b/tests/test-cases/stage-not-found/integration.stage-not-found.test.ts index 617eea2c1..bb40ca568 100644 --- a/tests/test-cases/stage-not-found/integration.stage-not-found.test.ts +++ b/tests/test-cases/stage-not-found/integration.stage-not-found.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/trigger/integration.trigger.test.ts b/tests/test-cases/trigger/integration.trigger.test.ts index 739f11ce0..d2731a121 100644 --- a/tests/test-cases/trigger/integration.trigger.test.ts +++ b/tests/test-cases/trigger/integration.trigger.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/umask/integration.umask.test.ts b/tests/test-cases/umask/integration.umask.test.ts index 9de82a404..f509382cd 100644 --- a/tests/test-cases/umask/integration.umask.test.ts +++ b/tests/test-cases/umask/integration.umask.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; jest.setTimeout(60000); diff --git a/tests/test-cases/variable-escaping/integration.variable-escaping.test.ts b/tests/test-cases/variable-escaping/integration.variable-escaping.test.ts index 234eb4e89..223bceadf 100644 --- a/tests/test-cases/variable-escaping/integration.variable-escaping.test.ts +++ b/tests/test-cases/variable-escaping/integration.variable-escaping.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/variable-expansion/integration.variable-expansion.test.ts b/tests/test-cases/variable-expansion/integration.variable-expansion.test.ts index a4a9ece6f..98a043b98 100644 --- a/tests/test-cases/variable-expansion/integration.variable-expansion.test.ts +++ b/tests/test-cases/variable-expansion/integration.variable-expansion.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/variable-order/integration.variable-order.test.ts b/tests/test-cases/variable-order/integration.variable-order.test.ts index b8cc8fe21..628a07029 100644 --- a/tests/test-cases/variable-order/integration.variable-order.test.ts +++ b/tests/test-cases/variable-order/integration.variable-order.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/variables-null/integration.variables-null.test.ts b/tests/test-cases/variables-null/integration.variables-null.test.ts index 462b6094f..e3f22b63c 100644 --- a/tests/test-cases/variables-null/integration.variables-null.test.ts +++ b/tests/test-cases/variables-null/integration.variables-null.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/when-always/integration.when-always.test.ts b/tests/test-cases/when-always/integration.when-always.test.ts index 5debd2f33..0fc1bd36e 100644 --- a/tests/test-cases/when-always/integration.when-always.test.ts +++ b/tests/test-cases/when-always/integration.when-always.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/when-on-failure/integration.on-failure.test.ts b/tests/test-cases/when-on-failure/integration.on-failure.test.ts index 46fbea992..7b9647882 100644 --- a/tests/test-cases/when-on-failure/integration.on-failure.test.ts +++ b/tests/test-cases/when-on-failure/integration.on-failure.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/when/integration.when.test.ts b/tests/test-cases/when/integration.when.test.ts index 571848fd0..d689155d1 100644 --- a/tests/test-cases/when/integration.when.test.ts +++ b/tests/test-cases/when/integration.when.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import {AssertionError} from "assert"; import {assert} from "console"; diff --git a/tests/utils.test.ts b/tests/utils.test.ts index d38426fd8..61ca82e9c 100644 --- a/tests/utils.test.ts +++ b/tests/utils.test.ts @@ -1,8 +1,8 @@ -import {GitData} from "../src/git-data"; -import {Utils} from "../src/utils"; -import {initSpawnSpyReject, initSpawnSpy} from "./mocks/utils.mock"; +import {GitData} from "../src/git-data.js"; +import {Utils} from "../src/utils.js"; +import {initSpawnSpyReject, initSpawnSpy} from "./mocks/utils.mock.js"; -import {isSshDirFound} from "./utils"; +import {isSshDirFound} from "./utils.js"; describe("remoteFileExist", () => { describe("protocol: git", () => { From d06df308016637357d191e8be74a11194fa2ad2b Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 7 Sep 2024 01:05:18 +0800 Subject: [PATCH 03/27] bump axios major version for esm support --- package-lock.json | 11 +++++------ package.json | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 606e8a9b0..d4d498973 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "ajv": "8.x.x", - "axios": "0.28.x", + "axios": "1.7.x", "base64url": "3.x.x", "camelcase": "6.x.x", "chalk": "4.x.x", @@ -2184,12 +2184,11 @@ } }, "node_modules/axios": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.28.1.tgz", - "integrity": "sha512-iUcGA5a7p0mVb4Gm/sy+FSECNkPFT4y7wt6OM/CDpO/OnNCvSs3PoMG8ibrC9jRoGYU0gUK5pXVC4NPXq6lHRQ==", - "license": "MIT", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } diff --git a/package.json b/package.json index 767c1f3c0..111f461bf 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ }, "dependencies": { "ajv": "8.x.x", - "axios": "0.28.x", + "axios": "1.7.x", "base64url": "3.x.x", "camelcase": "6.x.x", "chalk": "4.x.x", From 493a938420592451e68a935c6c2d03df4183efa6 Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 7 Sep 2024 01:15:08 +0800 Subject: [PATCH 04/27] replace ts-node with tsx --- package-lock.json | 505 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 6 +- 2 files changed, 500 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index d4d498973..8882fc5a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,7 +58,7 @@ "nodemon": "^3.1.1", "pkg": "5.x.x", "ts-jest": "29.x.x", - "ts-node": "10.x.x", + "tsx": "^4.19.0", "typescript": "5.x.x" }, "engines": { @@ -699,6 +699,8 @@ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -712,11 +714,397 @@ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", + "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", + "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", + "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", + "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", + "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", + "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", + "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", + "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", + "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", + "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", + "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", + "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", + "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", + "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", + "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", + "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", + "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", + "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", + "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", + "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", + "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", + "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", + "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", + "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -1445,28 +1833,36 @@ "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/@types/babel__core": { "version": "7.20.5", @@ -2016,6 +2412,8 @@ "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "acorn": "^8.11.0" }, @@ -2123,7 +2521,9 @@ "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/argparse": { "version": "2.0.1", @@ -2813,7 +3213,9 @@ "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/cross-spawn": { "version": "7.0.3", @@ -3075,6 +3477,8 @@ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, "license": "BSD-3-Clause", + "optional": true, + "peer": true, "engines": { "node": ">=0.3.1" } @@ -3201,6 +3605,45 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/esbuild": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" + } + }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -3859,6 +4302,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.0.tgz", + "integrity": "sha512-Pgba6TExTZ0FJAn1qkJAjIeKoDJ3CsI2ChuLohJnZl/tTU8MVrq3b+2t5UOPfRa4RMsorClBjJALkJUMjG1PAw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", @@ -6567,6 +7022,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -7176,6 +7640,8 @@ "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -7214,6 +7680,25 @@ } } }, + "node_modules/tsx": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.0.tgz", + "integrity": "sha512-bV30kM7bsLZKZIOCHeMNVMJ32/LuJzLVajkQI/qf92J2Qr08ueLQvW00PUZGiuLPP760UINwupgUj8qrSCPUKg==", + "dev": true, + "dependencies": { + "esbuild": "~0.23.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -7352,7 +7837,9 @@ "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.3.0", @@ -7528,6 +8015,8 @@ "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=6" } diff --git a/package.json b/package.json index 111f461bf..e28f6b7e9 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,8 @@ "test": "npm run build && jest --testTimeout 60000", "test-except-dind": "npm run build && jest --testTimeout 60000 --testPathIgnorePatterns=dind", "coverage": "jest --coverage --testTimeout 60000", - "start": "ts-node --log-error src/index.ts --cwd examples/docker-compose-nodejs", - "dev": "touch .gitlab-ci.yml && nodemon -e ts --watch src --watch .gitlab-ci.yml --exec ts-node src/index.ts", + "start": "tsx --log-error src/index.ts --cwd examples/docker-compose-nodejs", + "dev": "touch .gitlab-ci.yml && nodemon -e ts --watch src --watch .gitlab-ci.yml --exec tsx src/index.ts", "fetch-and-patch-schema": "curl https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json -sf | jq 'del(.. | .pattern?)' > src/schema/schema.json" }, "dependencies": { @@ -70,7 +70,7 @@ "nodemon": "^3.1.1", "pkg": "5.x.x", "ts-jest": "29.x.x", - "ts-node": "10.x.x", + "tsx": "^4.19.0", "typescript": "5.x.x" }, "engines": { From d06eda12e3fe536a17eb2810892a573670e2cf40 Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Fri, 6 Sep 2024 17:05:01 +0800 Subject: [PATCH 05/27] importing json files in esm --- src/index.ts | 4 +--- src/schema/index.ts | 9 +++++---- tsconfig.json | 3 ++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index 08b4f6339..6d6cf94d1 100755 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,6 @@ #!/usr/bin/env node import "source-map-support/register.js"; import chalk from "chalk"; -import * as fs from "fs-extra"; -import * as path from "path"; import yargs from "yargs"; import {Parser} from "./parser.js"; import * as state from "./state.js"; @@ -13,6 +11,7 @@ import {Argv} from "./argv.js"; import {AssertionError} from "assert"; import {Job, cleanupJobResources} from "./job.js"; import {GitlabRunnerPresetValues} from "./gitlab-preset.js"; +import packageJson from "../package.json" with { type: "json" }; const jobs: Job[] = []; @@ -25,7 +24,6 @@ process.on("SIGINT", async (_: string, code: number) => { process.on("SIGUSR2", async () => await cleanupJobResources(jobs)); (() => { - const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, "../package.json"), "utf8")); yargs(process.argv.slice(2)) .parserConfiguration({"greedy-arrays": false}) .showHelpOnFail(false) diff --git a/src/schema/index.ts b/src/schema/index.ts index 39245f708..52db0fdb0 100644 --- a/src/schema/index.ts +++ b/src/schema/index.ts @@ -1,15 +1,16 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires -const schema = require("./schema.json"); +import _schema from "./schema.json" with { type: "json" }; -schema.definitions.job_template.properties.gclArtifactsToSource = { +const schema: any = _schema; +schema.definitions.job_template.properties.gclInjectSSHAgent = { "type": "boolean", }; schema.definitions.job_template.properties.gclInteractive = { "type": "boolean", }; -schema.definitions.job_template.properties.gclInjectSSHAgent = { +schema.definitions.job_template.properties.gclArtifactsToSource = { "type": "boolean", }; + schema.definitions.job_template.properties.gclDescription = { "type": "string", }; diff --git a/tsconfig.json b/tsconfig.json index 785537ac3..c12efd878 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ "inlineSourceMap": true, "inlineSources": true, "strict": true, - "skipLibCheck": true + "skipLibCheck": true, + "resolveJsonModule": true } } From b26deafd780ee7ddde99ca791035bf17c977786b Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 7 Sep 2024 02:36:39 +0800 Subject: [PATCH 06/27] refactor: yargs esm --- src/handler.ts | 4 ++-- src/index.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/handler.ts b/src/handler.ts index eaf7dc710..d949ea47f 100644 --- a/src/handler.ts +++ b/src/handler.ts @@ -2,7 +2,7 @@ import * as yaml from "js-yaml"; import chalk from "chalk"; import path from "path"; import * as fs from "fs-extra"; -import * as yargs from "yargs"; +import yargs from "yargs"; import {Commander} from "./commander.js"; import {Parser} from "./parser.js"; import * as state from "./state.js"; @@ -29,7 +29,7 @@ export async function handler (args: any, writeStreams: WriteStreams, jobs: Job[ let parser: Parser | null = null; if (argv.completion) { - yargs.showCompletionScript(); + yargs(process.argv.slice(2)).showCompletionScript(); return []; } diff --git a/src/index.ts b/src/index.ts index 6d6cf94d1..e2a6ed1a9 100755 --- a/src/index.ts +++ b/src/index.ts @@ -24,11 +24,11 @@ process.on("SIGINT", async (_: string, code: number) => { process.on("SIGUSR2", async () => await cleanupJobResources(jobs)); (() => { - yargs(process.argv.slice(2)) - .parserConfiguration({"greedy-arrays": false}) + const yparser = yargs(process.argv.slice(2)); + yparser.parserConfiguration({"greedy-arrays": false}) .showHelpOnFail(false) .version(packageJson["version"]) - .wrap(yargs.terminalWidth?.()) + .wrap(yparser.terminalWidth?.()) .command({ handler: async (argv) => { try { From 8d648ec2b452b773aa2b74b88c1c809bb2365620 Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 7 Sep 2024 11:32:49 +0800 Subject: [PATCH 07/27] quickfix: downgrade axios to fix type problems with axios-mock-adapter --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8882fc5a1..177a223e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "ajv": "8.x.x", - "axios": "1.7.x", + "axios": "1.5.x", "base64url": "3.x.x", "camelcase": "6.x.x", "chalk": "4.x.x", @@ -2584,11 +2584,11 @@ } }, "node_modules/axios": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", - "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", + "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", "dependencies": { - "follow-redirects": "^1.15.6", + "follow-redirects": "^1.15.0", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } diff --git a/package.json b/package.json index e28f6b7e9..098198a2a 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ }, "dependencies": { "ajv": "8.x.x", - "axios": "1.7.x", + "axios": "1.5.x", "base64url": "3.x.x", "camelcase": "6.x.x", "chalk": "4.x.x", From 47ad0b46f8faab25f4e20074baf9327c6fd77a63 Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 7 Sep 2024 14:07:48 +0800 Subject: [PATCH 08/27] fix import issues --- src/argv.ts | 2 +- src/handler.ts | 2 +- src/job.ts | 2 +- src/parser.ts | 2 +- src/state.ts | 2 +- src/utils.ts | 4 ++-- src/validator.ts | 2 +- src/variables-from-files.ts | 2 +- tests/utils.ts | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/argv.ts b/src/argv.ts index ad04720ff..5e7028936 100644 --- a/src/argv.ts +++ b/src/argv.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import * as fs from "fs-extra"; +import fs from "fs-extra"; import * as dotenv from "dotenv"; import * as path from "path"; import camelCase from "camelcase"; diff --git a/src/handler.ts b/src/handler.ts index d949ea47f..e04530e2b 100644 --- a/src/handler.ts +++ b/src/handler.ts @@ -1,7 +1,7 @@ import * as yaml from "js-yaml"; import chalk from "chalk"; import path from "path"; -import * as fs from "fs-extra"; +import fs from "fs-extra"; import yargs from "yargs"; import {Commander} from "./commander.js"; import {Parser} from "./parser.js"; diff --git a/src/job.ts b/src/job.ts index e4193634f..92ee221ec 100644 --- a/src/job.ts +++ b/src/job.ts @@ -1,6 +1,6 @@ import chalk from "chalk"; import * as dotenv from "dotenv"; -import * as fs from "fs-extra"; +import fs from "fs-extra"; import prettyHrtime from "pretty-hrtime"; import split2 from "split2"; import {Utils} from "./utils.js"; diff --git a/src/parser.ts b/src/parser.ts index f20d88e11..ca95e4290 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -1,7 +1,7 @@ import chalk from "chalk"; import path from "path"; import deepExtend from "deep-extend"; -import * as fs from "fs-extra"; +import fs from "fs-extra"; import * as yaml from "js-yaml"; import prettyHrtime from "pretty-hrtime"; import {Job} from "./job.js"; diff --git a/src/state.ts b/src/state.ts index 9ca315bcb..26a4ad35f 100644 --- a/src/state.ts +++ b/src/state.ts @@ -1,4 +1,4 @@ -import * as fs from "fs-extra"; +import fs from "fs-extra"; import * as yaml from "js-yaml"; const loadStateYML = async (stateFile: string): Promise => { diff --git a/src/utils.ts b/src/utils.ts index feb5a85d2..e3989a79b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,6 +1,6 @@ import chalk from "chalk"; import {Job, JobRule} from "./job.js"; -import * as fs from "fs-extra"; +import fs from "fs-extra"; import checksum from "checksum"; import base64url from "base64url"; import execa from "execa"; @@ -42,7 +42,7 @@ export class Utils { static safeDockerString (jobName: string) { return jobName.replace(/[^\w-]+/g, (match) => { - return base64url.encode(match); + return base64url.default.encode(match); }); } diff --git a/src/validator.ts b/src/validator.ts index e258f4c02..9d23a2e6d 100644 --- a/src/validator.ts +++ b/src/validator.ts @@ -13,7 +13,7 @@ export class Validator { pathToExpandedGitLabCi: string; gitLabCiConfig: object; }) { - const ajv = new Ajv({ + const ajv = new Ajv.default({ verbose: true, allErrors: true, allowUnionTypes: true, diff --git a/src/variables-from-files.ts b/src/variables-from-files.ts index facf23ff0..4c301e7af 100644 --- a/src/variables-from-files.ts +++ b/src/variables-from-files.ts @@ -1,6 +1,6 @@ import {WriteStreams} from "./write-streams.js"; import {GitData} from "./git-data.js"; -import * as fs from "fs-extra"; +import fs from "fs-extra"; import * as yaml from "js-yaml"; import chalk from "chalk"; import {Argv} from "./argv.js"; diff --git a/tests/utils.ts b/tests/utils.ts index 2876db1e0..c9a3c1c6a 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -1,4 +1,4 @@ -import * as fs from "fs-extra"; +import fs from "fs-extra"; export function isSshDirFound () { try { From 1d622b050ddc50f52c1757d6c618d4adf009db7e Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 7 Sep 2024 14:17:14 +0800 Subject: [PATCH 09/27] jest + esm --- .github/workflows/build.yml | 4 +++- package.json | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3d64d36b..5ee20095d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,8 +69,10 @@ jobs: with: cache: 'npm' - run: npm ci + - name: Build + run: npm run build - name: Run Tests - run: FORCE_COLOR=1 npx jest --coverage --testTimeout 90000 --verbose + run: npm run coverage - uses: sonarsource/sonarcloud-github-action@v3.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 098198a2a..0fbae5785 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "check-all": "npm run build && npm run lint && npm run coverage && npm run audit", "audit": "npm audit --parseable", "lint": "npx eslint .", - "test": "npm run build && jest --testTimeout 60000", - "test-except-dind": "npm run build && jest --testTimeout 60000 --testPathIgnorePatterns=dind", - "coverage": "jest --coverage --testTimeout 60000", + "test": "npm run build && NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testTimeout 60000", + "test-except-dind": "npm run build && NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testTimeout 60000 --testPathIgnorePatterns=dind", + "coverage": "FORCE_COLOR=1 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --coverage --testTimeout 90000 --verbose", "start": "tsx --log-error src/index.ts --cwd examples/docker-compose-nodejs", "dev": "touch .gitlab-ci.yml && nodemon -e ts --watch src --watch .gitlab-ci.yml --exec tsx src/index.ts", "fetch-and-patch-schema": "curl https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json -sf | jq 'del(.. | .pattern?)' > src/schema/schema.json" @@ -133,6 +133,18 @@ } }, "jest": { + "extensionsToTreatAsEsm": [ + ".ts" + ], + "transform": { + "^.+\\.tsx?$": [ + "ts-jest", + { + "useESM": true + } + ], + "^.+\\.jsx?$": "babel-jest" + }, "preset": "ts-jest", "testMatch": [ "**/*.test.ts" From 2d3aa2d85732f8b2bbf1bb39367e2b64ab3d6e54 Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 7 Sep 2024 14:31:05 +0800 Subject: [PATCH 10/27] replace global jest with import.meta.jest - https://jestjs.io/docs/ecmascript-modules#differences-between-esm-and-commonjs --- tests/cases.test.ts | 2 +- tests/mocks/utils.mock.ts | 10 +++++----- tests/process-write-streams.test.ts | 4 ++-- tests/rules-regex.test.ts | 6 +++--- .../integration.artifacts-docker.test.ts | 2 +- .../integration.cache-docker-mount-invalid.test.ts | 2 +- .../integration.cache-docker-mount.test.ts | 2 +- tests/test-cases/coverage/.gitlab-ci.yml | 2 +- tests/test-cases/coverage/integration.coverage.test.ts | 6 +++--- .../dind-no-tls/integration.dind-no-tls.test.ts | 2 +- tests/test-cases/dind-tls/integration.dind-tls.test.ts | 2 +- tests/test-cases/image/integration.image.test.ts | 2 +- .../long-running-silent-build-job.test.ts | 2 +- .../long-running-silent-test-job.test.ts | 2 +- .../integration.parallel-matrix.test.ts | 2 +- .../pull-policy/integration.pull-policy.test.ts | 2 +- tests/test-cases/services/integration.services.test.ts | 2 +- tests/test-cases/umask/integration.umask.test.ts | 2 +- tests/utils.test.ts | 2 +- 19 files changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/cases.test.ts b/tests/cases.test.ts index e49431bfb..420ad97a2 100644 --- a/tests/cases.test.ts +++ b/tests/cases.test.ts @@ -15,7 +15,7 @@ afterAll(() => { }); test("--completion", async () => { - const spy = jest.spyOn(console, "log").mockImplementation(); + const spy = import.meta.jest.spyOn(console, "log").mockImplementation(); const writeStreams = new WriteStreamsMock(); await handler({ completion: true, diff --git a/tests/mocks/utils.mock.ts b/tests/mocks/utils.mock.ts index 7e73c0223..69087f568 100644 --- a/tests/mocks/utils.mock.ts +++ b/tests/mocks/utils.mock.ts @@ -2,7 +2,7 @@ import {when} from "jest-when"; import {Utils} from "../../src/utils.js"; export function initBashSpyReject (spyMocks: {cmd: string; rejection: any}[]) { - const spyOn = jest.spyOn(Utils, "bash"); + const spyOn = import.meta.jest.spyOn(Utils, "bash"); for (const spyMock of spyMocks) { when(spyOn).calledWith(spyMock.cmd, expect.any(String)).mockRejectedValue(spyMock.rejection); @@ -11,7 +11,7 @@ export function initBashSpyReject (spyMocks: {cmd: string; rejection: any}[]) { } export function initBashSpy (spyMocks: {cmd: string; returnValue: any}[]) { - const spyOn = jest.spyOn(Utils, "bash"); + const spyOn = import.meta.jest.spyOn(Utils, "bash"); for (const spyMock of spyMocks) { when(spyOn).calledWith(spyMock.cmd, expect.any(String)).mockResolvedValue(spyMock.returnValue); @@ -22,7 +22,7 @@ export function initBashSpy (spyMocks: {cmd: string; returnValue: any}[]) { } export function initSyncSpawnSpy (spyMocks: {cmdArgs: string[]; returnValue: any}[]) { - const spyOn = jest.spyOn(Utils, "syncSpawn"); + const spyOn = import.meta.jest.spyOn(Utils, "syncSpawn"); for (const spyMock of spyMocks) { when(spyOn).calledWith(spyMock.cmdArgs, expect.any(String)).mockReturnValue(spyMock.returnValue); @@ -31,7 +31,7 @@ export function initSyncSpawnSpy (spyMocks: {cmdArgs: string[]; returnValue: any } export function initSpawnSpy (spyMocks: {cmdArgs: string[]; returnValue: any}[]) { - const spyOn = jest.spyOn(Utils, "spawn"); + const spyOn = import.meta.jest.spyOn(Utils, "spawn"); for (const spyMock of spyMocks) { when(spyOn).calledWith(spyMock.cmdArgs, expect.any(String)).mockResolvedValue(spyMock.returnValue); @@ -42,7 +42,7 @@ export function initSpawnSpy (spyMocks: {cmdArgs: string[]; returnValue: any}[]) } export function initSpawnSpyReject (spyMocks: {cmdArgs: string[]; rejection: any}[]) { - const spyOn = jest.spyOn(Utils, "spawn"); + const spyOn = import.meta.jest.spyOn(Utils, "spawn"); for (const spyMock of spyMocks) { when(spyOn).calledWith(spyMock.cmdArgs, expect.any(String)).mockRejectedValue(spyMock.rejection); diff --git a/tests/process-write-streams.test.ts b/tests/process-write-streams.test.ts index 92b8fcf27..d43837b10 100644 --- a/tests/process-write-streams.test.ts +++ b/tests/process-write-streams.test.ts @@ -1,7 +1,7 @@ import {WriteStreamsProcess} from "../src/write-streams.js"; -const spyStdout = jest.spyOn(process.stdout, "write").mockImplementation(); -const spyStderr = jest.spyOn(process.stderr, "write").mockImplementation(); +const spyStdout = import.meta.jest.spyOn(process.stdout, "write").mockImplementation(); +const spyStderr = import.meta.jest.spyOn(process.stderr, "write").mockImplementation(); afterEach(() => { spyStdout.mockClear(); diff --git a/tests/rules-regex.test.ts b/tests/rules-regex.test.ts index 8ad4c65c3..476b1cc8b 100644 --- a/tests/rules-regex.test.ts +++ b/tests/rules-regex.test.ts @@ -9,7 +9,7 @@ let gitData: GitData; beforeEach(async () => { writeStreams = new WriteStreamsMock(); gitData = await GitData.init("tests", writeStreams); - jest.clearAllMocks(); + import.meta.jest.clearAllMocks(); }); /* eslint-disable @typescript-eslint/quotes */ @@ -85,8 +85,8 @@ describe("gitlab rules regex", () => { .forEach((t) => { test(`- if: '${t.rule}'\n\t => ${t.evalResult}`, async () => { const rules = [ {if: t.rule} ]; - const evalSpy = jest.spyOn(global, "eval"); - const evaluateRuleIfSpy = jest.spyOn(Utils, "evaluateRuleIf"); + const evalSpy = import.meta.jest.spyOn(global, "eval"); + const evaluateRuleIfSpy = import.meta.jest.spyOn(Utils, "evaluateRuleIf"); Utils.getRulesResult({cwd: "", rules, variables: {}}, gitData); expect(evalSpy).toHaveBeenCalledWith(t.jsExpression); diff --git a/tests/test-cases/artifacts-docker/integration.artifacts-docker.test.ts b/tests/test-cases/artifacts-docker/integration.artifacts-docker.test.ts index 26b3eaf31..5bd48d351 100644 --- a/tests/test-cases/artifacts-docker/integration.artifacts-docker.test.ts +++ b/tests/test-cases/artifacts-docker/integration.artifacts-docker.test.ts @@ -5,7 +5,7 @@ import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; import chalk from "chalk"; -jest.setTimeout(60000); +import.meta.jest.setTimeout(60000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cache-docker-mount-globstar/integration.cache-docker-mount-invalid.test.ts b/tests/test-cases/cache-docker-mount-globstar/integration.cache-docker-mount-invalid.test.ts index 685eff111..e66cfff83 100644 --- a/tests/test-cases/cache-docker-mount-globstar/integration.cache-docker-mount-invalid.test.ts +++ b/tests/test-cases/cache-docker-mount-globstar/integration.cache-docker-mount-invalid.test.ts @@ -5,7 +5,7 @@ import {WhenStatics} from "../../mocks/when-statics.js"; import assert, {AssertionError} from "assert"; import chalk from "chalk"; -jest.setTimeout(30000); +import.meta.jest.setTimeout(30000); beforeAll(() => { const spyGitRemote = { diff --git a/tests/test-cases/cache-docker-mount/integration.cache-docker-mount.test.ts b/tests/test-cases/cache-docker-mount/integration.cache-docker-mount.test.ts index 03545c064..ee3772c3d 100644 --- a/tests/test-cases/cache-docker-mount/integration.cache-docker-mount.test.ts +++ b/tests/test-cases/cache-docker-mount/integration.cache-docker-mount.test.ts @@ -5,7 +5,7 @@ import {initSpawnSpy} from "../../mocks/utils.mock.js"; import {WhenStatics} from "../../mocks/when-statics.js"; import {Utils} from "../../../src/utils.js"; -jest.setTimeout(45000); +import.meta.jest.setTimeout(45000); beforeAll(() => { const spyGitRemote = { diff --git a/tests/test-cases/coverage/.gitlab-ci.yml b/tests/test-cases/coverage/.gitlab-ci.yml index b37f56890..66369552e 100644 --- a/tests/test-cases/coverage/.gitlab-ci.yml +++ b/tests/test-cases/coverage/.gitlab-ci.yml @@ -5,7 +5,7 @@ test-job: - "echo \" Lines: 48.46% (510/650)\"" - "echo \" Lines: 78.46% (510/650)\"" -jest: +import.meta.jest: coverage: /All files.*?\|.*?\|.*?([\d\.]+)/ script: - echo "All files | 99.3 | 97.91 | 100 | 100 | " diff --git a/tests/test-cases/coverage/integration.coverage.test.ts b/tests/test-cases/coverage/integration.coverage.test.ts index 8674f35ac..2bfbcdc46 100644 --- a/tests/test-cases/coverage/integration.coverage.test.ts +++ b/tests/test-cases/coverage/integration.coverage.test.ts @@ -19,13 +19,13 @@ test("coverage ", async () => { expect(writeStreams.stdoutLines).toEqual(expect.arrayContaining(expected)); }); -test("coverage ", async () => { +test("coverage ", async () => { const writeStreams = new WriteStreamsMock(); await handler({ cwd: "tests/test-cases/coverage", - job: ["jest"], + job: ["import.meta.jest"], }, writeStreams); - const expected = [chalk`{black.bgGreenBright PASS } {blueBright jest} 97.91% {gray coverage}`]; + const expected = [chalk`{black.bgGreenBright PASS } {blueBright import.meta.jest} 97.91% {gray coverage}`]; expect(writeStreams.stdoutLines).toEqual(expect.arrayContaining(expected)); }); diff --git a/tests/test-cases/dind-no-tls/integration.dind-no-tls.test.ts b/tests/test-cases/dind-no-tls/integration.dind-no-tls.test.ts index 1954298db..7ea40092c 100644 --- a/tests/test-cases/dind-no-tls/integration.dind-no-tls.test.ts +++ b/tests/test-cases/dind-no-tls/integration.dind-no-tls.test.ts @@ -4,7 +4,7 @@ import chalk from "chalk"; import {initSpawnSpy} from "../../mocks/utils.mock.js"; import {WhenStatics} from "../../mocks/when-statics.js"; -jest.setTimeout(60000); +import.meta.jest.setTimeout(60000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/dind-tls/integration.dind-tls.test.ts b/tests/test-cases/dind-tls/integration.dind-tls.test.ts index fda97e2b0..92e06204f 100644 --- a/tests/test-cases/dind-tls/integration.dind-tls.test.ts +++ b/tests/test-cases/dind-tls/integration.dind-tls.test.ts @@ -4,7 +4,7 @@ import chalk from "chalk"; import {initSpawnSpy} from "../../mocks/utils.mock.js"; import {WhenStatics} from "../../mocks/when-statics.js"; -jest.setTimeout(60000); +import.meta.jest.setTimeout(60000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/image/integration.image.test.ts b/tests/test-cases/image/integration.image.test.ts index 36aa5d872..8c220e20a 100644 --- a/tests/test-cases/image/integration.image.test.ts +++ b/tests/test-cases/image/integration.image.test.ts @@ -6,7 +6,7 @@ import {initSpawnSpy} from "../../mocks/utils.mock.js"; import {WhenStatics} from "../../mocks/when-statics.js"; import {cleanupJobResources, Job} from "../../../src/job.js"; -jest.setTimeout(30000); +import.meta.jest.setTimeout(30000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/long-running-silent-build-job/long-running-silent-build-job.test.ts b/tests/test-cases/long-running-silent-build-job/long-running-silent-build-job.test.ts index 96361ee75..1fe4358e0 100644 --- a/tests/test-cases/long-running-silent-build-job/long-running-silent-build-job.test.ts +++ b/tests/test-cases/long-running-silent-build-job/long-running-silent-build-job.test.ts @@ -4,7 +4,7 @@ import chalk from "chalk"; import {initSpawnSpy} from "../../mocks/utils.mock.js"; import {WhenStatics} from "../../mocks/when-statics.js"; -jest.setTimeout(13000); +import.meta.jest.setTimeout(13000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/long-running-silent-test-job/long-running-silent-test-job.test.ts b/tests/test-cases/long-running-silent-test-job/long-running-silent-test-job.test.ts index f295f8f1a..1d179bd8c 100644 --- a/tests/test-cases/long-running-silent-test-job/long-running-silent-test-job.test.ts +++ b/tests/test-cases/long-running-silent-test-job/long-running-silent-test-job.test.ts @@ -4,7 +4,7 @@ import chalk from "chalk"; import {initSpawnSpy} from "../../mocks/utils.mock.js"; import {WhenStatics} from "../../mocks/when-statics.js"; -jest.setTimeout(13000); +import.meta.jest.setTimeout(13000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/parallel-matrix/integration.parallel-matrix.test.ts b/tests/test-cases/parallel-matrix/integration.parallel-matrix.test.ts index 314cb24d8..bed2a35d7 100644 --- a/tests/test-cases/parallel-matrix/integration.parallel-matrix.test.ts +++ b/tests/test-cases/parallel-matrix/integration.parallel-matrix.test.ts @@ -2,7 +2,7 @@ import {WriteStreamsMock} from "../../../src/write-streams.js"; import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -jest.setTimeout(60000); +import.meta.jest.setTimeout(60000); test("parallel-matrix - ensure successful", async () => { const writeStreams = new WriteStreamsMock(); diff --git a/tests/test-cases/pull-policy/integration.pull-policy.test.ts b/tests/test-cases/pull-policy/integration.pull-policy.test.ts index 12f7f91e3..c197a72fc 100644 --- a/tests/test-cases/pull-policy/integration.pull-policy.test.ts +++ b/tests/test-cases/pull-policy/integration.pull-policy.test.ts @@ -4,7 +4,7 @@ import {initSpawnSpy} from "../../mocks/utils.mock.js"; import {WhenStatics} from "../../mocks/when-statics.js"; import {Utils} from "../../../src/utils.js"; -jest.setTimeout(60000); +import.meta.jest.setTimeout(60000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/services/integration.services.test.ts b/tests/test-cases/services/integration.services.test.ts index 71b38de83..0974cc034 100644 --- a/tests/test-cases/services/integration.services.test.ts +++ b/tests/test-cases/services/integration.services.test.ts @@ -5,7 +5,7 @@ import {initSpawnSpy} from "../../mocks/utils.mock.js"; import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; -jest.setTimeout(30000); +import.meta.jest.setTimeout(30000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/umask/integration.umask.test.ts b/tests/test-cases/umask/integration.umask.test.ts index f509382cd..463d47791 100644 --- a/tests/test-cases/umask/integration.umask.test.ts +++ b/tests/test-cases/umask/integration.umask.test.ts @@ -4,7 +4,7 @@ import {initSpawnSpy} from "../../mocks/utils.mock.js"; import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; -jest.setTimeout(60000); +import.meta.jest.setTimeout(60000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/utils.test.ts b/tests/utils.test.ts index 61ca82e9c..4e94b3770 100644 --- a/tests/utils.test.ts +++ b/tests/utils.test.ts @@ -176,7 +176,7 @@ describe("evaluateRuleChanges", () => { ]; tests.forEach((t) => { test.concurrent(`${t.description} \t\t [input: ${t.input} pattern: ${t.pattern} hasChanges: ${t.hasChanges}]`, () => { - const spy = jest.spyOn(GitData, "changedFiles"); + const spy = import.meta.jest.spyOn(GitData, "changedFiles"); spy.mockReturnValue(t.input); expect(Utils.evaluateRuleChanges("origin/master", t.pattern)).toBe(t.hasChanges); }); From fb03e3c0bac72b784100a03c74708a183b556a54 Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 7 Sep 2024 23:47:42 +0800 Subject: [PATCH 11/27] install esbuild --- package-lock.json | 1 + package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/package-lock.json b/package-lock.json index 177a223e1..262e7ce87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,6 +52,7 @@ "@typescript-eslint/parser": "7.x.x", "axios-mock-adapter": "2.x", "depcheck": "1.x.x", + "esbuild": "^0.23.1", "eslint": "8.x.x", "jest": "29.x.x", "jest-when": "3.x.x", diff --git a/package.json b/package.json index 0fbae5785..98c4a9ae8 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "@typescript-eslint/parser": "7.x.x", "axios-mock-adapter": "2.x", "depcheck": "1.x.x", + "esbuild": "^0.23.1", "eslint": "8.x.x", "jest": "29.x.x", "jest-when": "3.x.x", From 791ca756194d976685a8e2b1ed3c4c191d34d222 Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 7 Sep 2024 23:49:27 +0800 Subject: [PATCH 12/27] pkg+esbuild --- .github/workflows/build.yml | 4 ++-- .gitignore | 1 + package.json | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ee20095d..0ec2f0b5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,9 +33,9 @@ jobs: path: ${{ env.PKG_CACHE_PATH }} key: pkg-cache-${{ matrix.node-version }} - run: npm ci - - run: npm run build + - run: npm run build:pkg - run: npm run pkg-linux - - run: node src/index.js --version + - run: node pkg/index.cjs --version - run: bin/linux/gitlab-ci-local --version - run: bin/linux/gitlab-ci-local --help diff --git a/.gitignore b/.gitignore index 4edeec9c4..82fbc3f89 100644 --- a/.gitignore +++ b/.gitignore @@ -20,5 +20,6 @@ tsconfig.tsbuildinfo .DS_Store .vscode +pkg /.gitlab-ci.yml diff --git a/package.json b/package.json index 98c4a9ae8..cbc25c050 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,10 @@ "bin": "src/index.js", "version": "4.54.0", "scripts": { - "pkg-linux": "pkg src/index.js --public -t node18-linux-x64 -o bin/linux/gitlab-ci-local && chmod +x bin/linux/gitlab-ci-local && gzip -c bin/linux/gitlab-ci-local > bin/linux.gz", - "pkg-macos": "pkg src/index.js --public -t node18-macos-x64 -o bin/macos/gitlab-ci-local && gzip -c bin/macos/gitlab-ci-local > bin/macos.gz", - "pkg-win": "pkg src/index.js --public -t node18-win-x64 -o bin/win/gitlab-ci-local && gzip -c bin/win/gitlab-ci-local.exe > bin/win.gz", + "build:pkg": "mkdir -p pkg && esbuild src/index.ts --outfile=pkg/index.cjs --bundle --platform=node --format=cjs --minify", + "pkg-linux": "pkg pkg/index.cjs --public -t node18-linux-x64 -o bin/linux/gitlab-ci-local && chmod +x bin/linux/gitlab-ci-local && gzip -c bin/linux/gitlab-ci-local > bin/linux.gz", + "pkg-macos": "pkg pkg/index.cjs --public -t node18-macos-x64 -o bin/macos/gitlab-ci-local && gzip -c bin/macos/gitlab-ci-local > bin/macos.gz", + "pkg-win": "pkg pkg/index.cjs --public -t node18-win-x64 -o bin/win/gitlab-ci-local && gzip -c bin/win/gitlab-ci-local.exe > bin/win.gz", "pkg-all": "npm run pkg-linux && npm run pkg-macos && npm run pkg-win", "pkg": "pkg", "cleanup": "git clean -fX tests/ && git clean -fX src/", From 9b1efdb5ba615dc6fc7f173c171d40ae8f28935e Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 14 Sep 2024 00:13:36 +0800 Subject: [PATCH 13/27] make it possible to run jest without npm run build --- package.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cbc25c050..d77c880b3 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "check-all": "npm run build && npm run lint && npm run coverage && npm run audit", "audit": "npm audit --parseable", "lint": "npx eslint .", - "test": "npm run build && NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testTimeout 60000", + "test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testTimeout 60000", "test-except-dind": "npm run build && NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testTimeout 60000 --testPathIgnorePatterns=dind", "coverage": "FORCE_COLOR=1 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --coverage --testTimeout 90000 --verbose", "start": "tsx --log-error src/index.ts --cwd examples/docker-compose-nodejs", @@ -144,8 +144,7 @@ { "useESM": true } - ], - "^.+\\.jsx?$": "babel-jest" + ] }, "preset": "ts-jest", "testMatch": [ @@ -155,6 +154,9 @@ "/node_modules/", "/.gitlab-ci-local/" ], + "moduleNameMapper": { + "(.+)\\.js": "$1" + }, "coverageReporters": [ "lcov", "json-summary", From 122bb8b3de61aa1acb4a38ea89c5ece2ab76b2df Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 14 Sep 2024 08:42:49 +0800 Subject: [PATCH 14/27] manage to get ts-node to work - when using tsx unable to get source-mapping to work --- package-lock.json | 82 +++++------------------------------------------ package.json | 6 ++-- 2 files changed, 11 insertions(+), 77 deletions(-) diff --git a/package-lock.json b/package-lock.json index 262e7ce87..211ac99f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,7 +59,7 @@ "nodemon": "^3.1.1", "pkg": "5.x.x", "ts-jest": "29.x.x", - "tsx": "^4.19.0", + "ts-node": "10.x.x", "typescript": "5.x.x" }, "engines": { @@ -700,8 +700,6 @@ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, "license": "MIT", - "optional": true, - "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -715,8 +713,6 @@ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, "license": "MIT", - "optional": true, - "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -1834,36 +1830,28 @@ "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", "dev": true, - "license": "MIT", - "optional": true, - "peer": true + "license": "MIT" }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true, - "license": "MIT", - "optional": true, - "peer": true + "license": "MIT" }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true, - "license": "MIT", - "optional": true, - "peer": true + "license": "MIT" }, "node_modules/@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true, - "license": "MIT", - "optional": true, - "peer": true + "license": "MIT" }, "node_modules/@types/babel__core": { "version": "7.20.5", @@ -2413,8 +2401,6 @@ "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", "dev": true, "license": "MIT", - "optional": true, - "peer": true, "dependencies": { "acorn": "^8.11.0" }, @@ -2522,9 +2508,7 @@ "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true, - "license": "MIT", - "optional": true, - "peer": true + "license": "MIT" }, "node_modules/argparse": { "version": "2.0.1", @@ -3214,9 +3198,7 @@ "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true, - "license": "MIT", - "optional": true, - "peer": true + "license": "MIT" }, "node_modules/cross-spawn": { "version": "7.0.3", @@ -3478,8 +3460,6 @@ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, "license": "BSD-3-Clause", - "optional": true, - "peer": true, "engines": { "node": ">=0.3.1" } @@ -4303,18 +4283,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-tsconfig": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.0.tgz", - "integrity": "sha512-Pgba6TExTZ0FJAn1qkJAjIeKoDJ3CsI2ChuLohJnZl/tTU8MVrq3b+2t5UOPfRa4RMsorClBjJALkJUMjG1PAw==", - "dev": true, - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, "node_modules/github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", @@ -7023,15 +6991,6 @@ "node": ">=8" } }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -7641,8 +7600,6 @@ "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "license": "MIT", - "optional": true, - "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -7681,25 +7638,6 @@ } } }, - "node_modules/tsx": { - "version": "4.19.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.0.tgz", - "integrity": "sha512-bV30kM7bsLZKZIOCHeMNVMJ32/LuJzLVajkQI/qf92J2Qr08ueLQvW00PUZGiuLPP760UINwupgUj8qrSCPUKg==", - "dev": true, - "dependencies": { - "esbuild": "~0.23.0", - "get-tsconfig": "^4.7.5" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -7838,9 +7776,7 @@ "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true, - "license": "MIT", - "optional": true, - "peer": true + "license": "MIT" }, "node_modules/v8-to-istanbul": { "version": "9.3.0", @@ -8016,8 +7952,6 @@ "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, "license": "MIT", - "optional": true, - "peer": true, "engines": { "node": ">=6" } diff --git a/package.json b/package.json index d77c880b3..30a655480 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,8 @@ "test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testTimeout 60000", "test-except-dind": "npm run build && NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testTimeout 60000 --testPathIgnorePatterns=dind", "coverage": "FORCE_COLOR=1 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --coverage --testTimeout 90000 --verbose", - "start": "tsx --log-error src/index.ts --cwd examples/docker-compose-nodejs", - "dev": "touch .gitlab-ci.yml && nodemon -e ts --watch src --watch .gitlab-ci.yml --exec tsx src/index.ts", + "start": "NODE_OPTIONS='--loader ts-node/esm' ts-node --log-error src/index.ts --cwd examples/docker-compose-nodejs", + "dev": "touch .gitlab-ci.yml && NODE_OPTIONS='--loader ts-node/esm' nodemon -e ts --watch src --watch .gitlab-ci.yml --exec ts-node src/index.ts", "fetch-and-patch-schema": "curl https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json -sf | jq 'del(.. | .pattern?)' > src/schema/schema.json" }, "dependencies": { @@ -72,7 +72,7 @@ "nodemon": "^3.1.1", "pkg": "5.x.x", "ts-jest": "29.x.x", - "tsx": "^4.19.0", + "ts-node": "10.x.x", "typescript": "5.x.x" }, "engines": { From 04accd795041cf0092e2ab2f300c77f04d79d4df Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 14 Sep 2024 13:38:09 +0800 Subject: [PATCH 15/27] fix npm run test-except-dind --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 30a655480..1507db927 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "audit": "npm audit --parseable", "lint": "npx eslint .", "test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testTimeout 60000", - "test-except-dind": "npm run build && NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testTimeout 60000 --testPathIgnorePatterns=dind", + "test-except-dind": "npm run test -- --testPathIgnorePatterns=\"/dind.*/|/node_modules/|/.gitlab-ci-local/\"", "coverage": "FORCE_COLOR=1 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --coverage --testTimeout 90000 --verbose", "start": "NODE_OPTIONS='--loader ts-node/esm' ts-node --log-error src/index.ts --cwd examples/docker-compose-nodejs", "dev": "touch .gitlab-ci.yml && NODE_OPTIONS='--loader ts-node/esm' nodemon -e ts --watch src --watch .gitlab-ci.yml --exec ts-node src/index.ts", From ac634610e9ff626ee5532449e45ce6e710d4c546 Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 14 Sep 2024 13:39:46 +0800 Subject: [PATCH 16/27] tweak tsconfig --- src/utils.ts | 2 +- src/validator.ts | 2 +- tsconfig.json | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index e3989a79b..90ceb3500 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -42,7 +42,7 @@ export class Utils { static safeDockerString (jobName: string) { return jobName.replace(/[^\w-]+/g, (match) => { - return base64url.default.encode(match); + return base64url.encode(match); }); } diff --git a/src/validator.ts b/src/validator.ts index 9d23a2e6d..e258f4c02 100644 --- a/src/validator.ts +++ b/src/validator.ts @@ -13,7 +13,7 @@ export class Validator { pathToExpandedGitLabCi: string; gitLabCiConfig: object; }) { - const ajv = new Ajv.default({ + const ajv = new Ajv({ verbose: true, allErrors: true, allowUnionTypes: true, diff --git a/tsconfig.json b/tsconfig.json index c12efd878..d27751840 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "target": "ES2022", - "moduleResolution": "nodenext", - "module": "nodenext", + "target": "esnext", + "module": "esnext", + "moduleResolution": "node", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "inlineSourceMap": true, From d5bb5ae723f786468ac129248f4eff874908b42e Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 14 Sep 2024 14:04:57 +0800 Subject: [PATCH 17/27] attempt to run npm coverage without building --- .github/workflows/build.yml | 2 -- package.json | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0ec2f0b5d..0b3f3a2b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,8 +69,6 @@ jobs: with: cache: 'npm' - run: npm ci - - name: Build - run: npm run build - name: Run Tests run: npm run coverage - uses: sonarsource/sonarcloud-github-action@v3.1 diff --git a/package.json b/package.json index 1507db927..3a2d76896 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "lint": "npx eslint .", "test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testTimeout 60000", "test-except-dind": "npm run test -- --testPathIgnorePatterns=\"/dind.*/|/node_modules/|/.gitlab-ci-local/\"", - "coverage": "FORCE_COLOR=1 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --coverage --testTimeout 90000 --verbose", + "coverage": "FORCE_COLOR=1 npm run test -- --coverage --verbose", "start": "NODE_OPTIONS='--loader ts-node/esm' ts-node --log-error src/index.ts --cwd examples/docker-compose-nodejs", "dev": "touch .gitlab-ci.yml && NODE_OPTIONS='--loader ts-node/esm' nodemon -e ts --watch src --watch .gitlab-ci.yml --exec ts-node src/index.ts", "fetch-and-patch-schema": "curl https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json -sf | jq 'del(.. | .pattern?)' > src/schema/schema.json" From 4c600b289392e64fcc1b5d09d3a7995ae1551bd6 Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Sat, 14 Sep 2024 14:27:02 +0800 Subject: [PATCH 18/27] only way i manage to get npm run coverage to work - was getting the exact same error as per https://github.com/jestjs/jest/issues/15000 --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3a2d76896..8d597279e 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "lint": "npx eslint .", "test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testTimeout 60000", "test-except-dind": "npm run test -- --testPathIgnorePatterns=\"/dind.*/|/node_modules/|/.gitlab-ci-local/\"", - "coverage": "FORCE_COLOR=1 npm run test -- --coverage --verbose", + "coverage": "npm run build && FORCE_COLOR=1 npm run test -- --coverage --verbose", "start": "NODE_OPTIONS='--loader ts-node/esm' ts-node --log-error src/index.ts --cwd examples/docker-compose-nodejs", "dev": "touch .gitlab-ci.yml && NODE_OPTIONS='--loader ts-node/esm' nodemon -e ts --watch src --watch .gitlab-ci.yml --exec ts-node src/index.ts", "fetch-and-patch-schema": "curl https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json -sf | jq 'del(.. | .pattern?)' > src/schema/schema.json" @@ -144,7 +144,8 @@ { "useESM": true } - ] + ], + "^.+\\.jsx?$": "babel-jest" }, "preset": "ts-jest", "testMatch": [ From 87408af090b83231f20aed93e678418943dbd712 Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Wed, 2 Oct 2024 11:38:47 +0800 Subject: [PATCH 19/27] resolve esbuild warning with direct eval --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 90ceb3500..d86800874 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -257,7 +257,7 @@ Refer to https://docs.gitlab.com/ee/ci/jobs/job_rules.html#unexpected-behavior-f let res; try { - res = eval(evalStr); + res = (0, eval)(evalStr); // https://esbuild.github.io/content-types/#direct-eval } catch (err) { console.log(` Error attempting to evaluate the following rules: From a627b582f2f91ff61b85a23c6ebf258679abba04 Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Wed, 2 Oct 2024 12:36:08 +0800 Subject: [PATCH 20/27] fix `pkg` warnings --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8d597279e..cee9951de 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "bin": "src/index.js", "version": "4.54.0", "scripts": { - "build:pkg": "mkdir -p pkg && esbuild src/index.ts --outfile=pkg/index.cjs --bundle --platform=node --format=cjs --minify", + "build:pkg": "mkdir -p pkg && esbuild src/index.ts --outfile=pkg/index.cjs --bundle --platform=node --format=cjs --minify --external:yargs", "pkg-linux": "pkg pkg/index.cjs --public -t node18-linux-x64 -o bin/linux/gitlab-ci-local && chmod +x bin/linux/gitlab-ci-local && gzip -c bin/linux/gitlab-ci-local > bin/linux.gz", "pkg-macos": "pkg pkg/index.cjs --public -t node18-macos-x64 -o bin/macos/gitlab-ci-local && gzip -c bin/macos/gitlab-ci-local > bin/macos.gz", "pkg-win": "pkg pkg/index.cjs --public -t node18-win-x64 -o bin/win/gitlab-ci-local && gzip -c bin/win/gitlab-ci-local.exe > bin/win.gz", From 8760e7c3304f39fd4604ac5f64ab65edb06f6e9b Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Wed, 2 Oct 2024 13:12:27 +0800 Subject: [PATCH 21/27] docs: update docs --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 337371d85..3240f5b1e 100644 --- a/README.md +++ b/README.md @@ -368,9 +368,6 @@ You need nodejs 18+ # Install node_modules npm install -# Compiled typescript to javascript -npm run build - # Run all tests npm run test From 5934211894bebcfb550a56d889142fa367591c99 Mon Sep 17 00:00:00 2001 From: Mads Jon Nielsen Date: Thu, 10 Oct 2024 20:15:30 +0200 Subject: [PATCH 22/27] Use @yao-pkg/pkg. Use bin/ instead of pkg/ folder --- .github/workflows/build.yml | 4 +- package-lock.json | 400 +++++++++++++++++------------------- package.json | 14 +- 3 files changed, 201 insertions(+), 217 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b3f3a2b8..45b751045 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,9 +33,9 @@ jobs: path: ${{ env.PKG_CACHE_PATH }} key: pkg-cache-${{ matrix.node-version }} - run: npm ci - - run: npm run build:pkg + - run: npm run esbuild - run: npm run pkg-linux - - run: node pkg/index.cjs --version + - run: node bin/index.cjs --version - run: bin/linux/gitlab-ci-local --version - run: bin/linux/gitlab-ci-local --help diff --git a/package-lock.json b/package-lock.json index 211ac99f4..adf0e7ed9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,6 +50,7 @@ "@types/yargs": "17.x.x", "@typescript-eslint/eslint-plugin": "7.x.x", "@typescript-eslint/parser": "7.x.x", + "@yao-pkg/pkg": "^5.15.0", "axios-mock-adapter": "2.x", "depcheck": "1.x.x", "esbuild": "^0.23.1", @@ -57,7 +58,6 @@ "jest": "29.x.x", "jest-when": "3.x.x", "nodemon": "^3.1.1", - "pkg": "5.x.x", "ts-jest": "29.x.x", "ts-node": "10.x.x", "typescript": "5.x.x" @@ -2372,6 +2372,198 @@ "dev": true, "license": "MIT" }, + "node_modules/@yao-pkg/pkg": { + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/@yao-pkg/pkg/-/pkg-5.15.0.tgz", + "integrity": "sha512-VKgSO7Djch98NEByNJucpuqVlGre5cyhCHeQ1CfhetMCOrl5X146lJCDNsRyq9vP7KpajPunTgVYvAIbV+Z+8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/generator": "7.23.0", + "@babel/parser": "7.23.0", + "@babel/types": "7.23.0", + "@yao-pkg/pkg-fetch": "3.5.13", + "chalk": "^4.1.2", + "fs-extra": "^9.1.0", + "globby": "^11.1.0", + "into-stream": "^6.0.0", + "minimatch": "9.0.4", + "minimist": "^1.2.6", + "multistream": "^4.1.0", + "prebuild-install": "7.1.1", + "resolve": "^1.22.0", + "stream-meter": "^1.0.4" + }, + "bin": { + "pkg": "lib-es5/bin.js" + } + }, + "node_modules/@yao-pkg/pkg-fetch": { + "version": "3.5.13", + "resolved": "https://registry.npmjs.org/@yao-pkg/pkg-fetch/-/pkg-fetch-3.5.13.tgz", + "integrity": "sha512-KFIumJxNZIXoNKxJstSXbqQjdPqsxI4CKUGL/6GntsQ4U9bBAawkpkJh4s4vMUjGmx7otPvstdgYcO/3TerzzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "fs-extra": "^9.1.0", + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.6", + "progress": "^2.0.3", + "semver": "^7.3.5", + "tar-fs": "^2.1.1", + "yargs": "^16.2.0" + }, + "bin": { + "pkg-fetch": "lib-es5/bin.js" + } + }, + "node_modules/@yao-pkg/pkg-fetch/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/@yao-pkg/pkg-fetch/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@yao-pkg/pkg-fetch/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@yao-pkg/pkg-fetch/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/@yao-pkg/pkg/node_modules/@babel/generator": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@yao-pkg/pkg/node_modules/@babel/parser": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "dev": true, + "license": "MIT", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@yao-pkg/pkg/node_modules/@babel/types": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@yao-pkg/pkg/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@yao-pkg/pkg/node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@yao-pkg/pkg/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/acorn": { "version": "8.12.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", @@ -4437,16 +4629,6 @@ "dev": true, "license": "MIT" }, - "node_modules/has": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", - "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -6369,40 +6551,6 @@ "node": ">= 6" } }, - "node_modules/pkg": { - "version": "5.8.1", - "resolved": "https://registry.npmjs.org/pkg/-/pkg-5.8.1.tgz", - "integrity": "sha512-CjBWtFStCfIiT4Bde9QpJy0KeH19jCfwZRJqHFDFXfhUklCx8JoFmMj3wgnEYIwGmZVNkhsStPHEOnrtrQhEXA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/generator": "7.18.2", - "@babel/parser": "7.18.4", - "@babel/types": "7.19.0", - "chalk": "^4.1.2", - "fs-extra": "^9.1.0", - "globby": "^11.1.0", - "into-stream": "^6.0.0", - "is-core-module": "2.9.0", - "minimist": "^1.2.6", - "multistream": "^4.1.0", - "pkg-fetch": "3.4.2", - "prebuild-install": "7.1.1", - "resolve": "^1.22.0", - "stream-meter": "^1.0.4" - }, - "bin": { - "pkg": "lib-es5/bin.js" - }, - "peerDependencies": { - "node-notifier": ">=9.0.1" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -6472,168 +6620,6 @@ "node": ">=8" } }, - "node_modules/pkg-fetch": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/pkg-fetch/-/pkg-fetch-3.4.2.tgz", - "integrity": "sha512-0+uijmzYcnhC0hStDjm/cl2VYdrmVVBpe7Q8k9YBojxmR5tG8mvR9/nooQq3QSXiQqORDVOTY3XqMEqJVIzkHA==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.2", - "fs-extra": "^9.1.0", - "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.6", - "progress": "^2.0.3", - "semver": "^7.3.5", - "tar-fs": "^2.1.1", - "yargs": "^16.2.0" - }, - "bin": { - "pkg-fetch": "lib-es5/bin.js" - } - }, - "node_modules/pkg-fetch/node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/pkg-fetch/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/pkg-fetch/node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/pkg-fetch/node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/pkg/node_modules/@babel/generator": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.2.tgz", - "integrity": "sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.18.2", - "@jridgewell/gen-mapping": "^0.3.0", - "jsesc": "^2.5.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/pkg/node_modules/@babel/parser": { - "version": "7.18.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.4.tgz", - "integrity": "sha512-FDge0dFazETFcxGw/EXzOkN8uJp0PC7Qbm+Pe9T+av2zlBpOgunFHkQPPn+eRuClU73JF+98D531UgayY89tow==", - "dev": true, - "license": "MIT", - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/pkg/node_modules/@babel/types": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.0.tgz", - "integrity": "sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.18.10", - "@babel/helper-validator-identifier": "^7.18.6", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/pkg/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/pkg/node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", - "dev": true, - "license": "MIT", - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/pkg/node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true, - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/please-upgrade-node": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", diff --git a/package.json b/package.json index cee9951de..0572a8d1e 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,11 @@ "bin": "src/index.js", "version": "4.54.0", "scripts": { - "build:pkg": "mkdir -p pkg && esbuild src/index.ts --outfile=pkg/index.cjs --bundle --platform=node --format=cjs --minify --external:yargs", - "pkg-linux": "pkg pkg/index.cjs --public -t node18-linux-x64 -o bin/linux/gitlab-ci-local && chmod +x bin/linux/gitlab-ci-local && gzip -c bin/linux/gitlab-ci-local > bin/linux.gz", - "pkg-macos": "pkg pkg/index.cjs --public -t node18-macos-x64 -o bin/macos/gitlab-ci-local && gzip -c bin/macos/gitlab-ci-local > bin/macos.gz", - "pkg-win": "pkg pkg/index.cjs --public -t node18-win-x64 -o bin/win/gitlab-ci-local && gzip -c bin/win/gitlab-ci-local.exe > bin/win.gz", + "esbuild": "esbuild src/index.ts --outfile=bin/index.cjs --bundle --platform=node --format=cjs --minify --external:yargs --sourcemap=inline", + "pkg-linux": "pkg bin/index.cjs --public -t node18-linux-x64 -o bin/linux/gitlab-ci-local && chmod +x bin/linux/gitlab-ci-local && gzip -c bin/linux/gitlab-ci-local > bin/linux.gz", + "pkg-macos": "pkg bin/index.cjs --public -t node18-macos-x64 -o bin/macos/gitlab-ci-local && gzip -c bin/macos/gitlab-ci-local > bin/macos.gz", + "pkg-win": "pkg bin/index.cjs --public -t node18-win-x64 -o bin/win/gitlab-ci-local && gzip -c bin/win/gitlab-ci-local.exe > bin/win.gz", "pkg-all": "npm run pkg-linux && npm run pkg-macos && npm run pkg-win", - "pkg": "pkg", "cleanup": "git clean -fX tests/ && git clean -fX src/", "build": " npm run cleanup && tsc", "check-all": "npm run build && npm run lint && npm run coverage && npm run audit", @@ -63,6 +62,7 @@ "@types/yargs": "17.x.x", "@typescript-eslint/eslint-plugin": "7.x.x", "@typescript-eslint/parser": "7.x.x", + "@yao-pkg/pkg": "^5.15.0", "axios-mock-adapter": "2.x", "depcheck": "1.x.x", "esbuild": "^0.23.1", @@ -70,7 +70,6 @@ "jest": "29.x.x", "jest-when": "3.x.x", "nodemon": "^3.1.1", - "pkg": "5.x.x", "ts-jest": "29.x.x", "ts-node": "10.x.x", "typescript": "5.x.x" @@ -144,8 +143,7 @@ { "useESM": true } - ], - "^.+\\.jsx?$": "babel-jest" + ] }, "preset": "ts-jest", "testMatch": [ From 972045b8ab04ec6cbc03260edadbb26eb2e9c51a Mon Sep 17 00:00:00 2001 From: Mads Jon Nielsen Date: Thu, 10 Oct 2024 20:17:52 +0200 Subject: [PATCH 23/27] Upgrade axios --- package-lock.json | 11 ++++++----- package.json | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index adf0e7ed9..5ab9f5ade 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "ajv": "8.x.x", - "axios": "1.5.x", + "axios": "^1.7.7", "base64url": "3.x.x", "camelcase": "6.x.x", "chalk": "4.x.x", @@ -2761,11 +2761,12 @@ } }, "node_modules/axios": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", - "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "license": "MIT", "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } diff --git a/package.json b/package.json index 0572a8d1e..b78516451 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ }, "dependencies": { "ajv": "8.x.x", - "axios": "1.5.x", + "axios": "^1.7.7", "base64url": "3.x.x", "camelcase": "6.x.x", "chalk": "4.x.x", From 8f0abf9b63bbe06516d20fe1a71ade94d9e8d8cd Mon Sep 17 00:00:00 2001 From: Mads Jon Nielsen Date: Thu, 10 Oct 2024 20:19:45 +0200 Subject: [PATCH 24/27] Reintroduce babel-jest --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b78516451..959b78f83 100644 --- a/package.json +++ b/package.json @@ -143,7 +143,8 @@ { "useESM": true } - ] + ], + "^.+\\.jsx?$": "babel-jest" }, "preset": "ts-jest", "testMatch": [ From de0c9ed591cbb3003f108919334cbc44e908d210 Mon Sep 17 00:00:00 2001 From: Mads Jon Nielsen Date: Thu, 10 Oct 2024 20:21:02 +0200 Subject: [PATCH 25/27] Rename github action job to smoke-test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45b751045..3ed2b0d86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: with: strict: true - pkg: + smoke-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From dd89727adc3b3aafee8ea017ff9845c00f50c2b7 Mon Sep 17 00:00:00 2001 From: Mads Jon Nielsen Date: Thu, 10 Oct 2024 20:34:43 +0200 Subject: [PATCH 26/27] Use node20 for pkg vm --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 959b78f83..10711bcc9 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,9 @@ "version": "4.54.0", "scripts": { "esbuild": "esbuild src/index.ts --outfile=bin/index.cjs --bundle --platform=node --format=cjs --minify --external:yargs --sourcemap=inline", - "pkg-linux": "pkg bin/index.cjs --public -t node18-linux-x64 -o bin/linux/gitlab-ci-local && chmod +x bin/linux/gitlab-ci-local && gzip -c bin/linux/gitlab-ci-local > bin/linux.gz", - "pkg-macos": "pkg bin/index.cjs --public -t node18-macos-x64 -o bin/macos/gitlab-ci-local && gzip -c bin/macos/gitlab-ci-local > bin/macos.gz", - "pkg-win": "pkg bin/index.cjs --public -t node18-win-x64 -o bin/win/gitlab-ci-local && gzip -c bin/win/gitlab-ci-local.exe > bin/win.gz", + "pkg-linux": "pkg bin/index.cjs --public -t node20-linux-x64 -o bin/linux/gitlab-ci-local && chmod +x bin/linux/gitlab-ci-local && gzip -c bin/linux/gitlab-ci-local > bin/linux.gz", + "pkg-macos": "pkg bin/index.cjs --public -t node20-macos-x64 -o bin/macos/gitlab-ci-local && gzip -c bin/macos/gitlab-ci-local > bin/macos.gz", + "pkg-win": "pkg bin/index.cjs --public -t node20-win-x64 -o bin/win/gitlab-ci-local && gzip -c bin/win/gitlab-ci-local.exe > bin/win.gz", "pkg-all": "npm run pkg-linux && npm run pkg-macos && npm run pkg-win", "cleanup": "git clean -fX tests/ && git clean -fX src/", "build": " npm run cleanup && tsc", From 3cc29b491d7cadaf94b2bcbf40e3472787982b43 Mon Sep 17 00:00:00 2001 From: Mads Jon Nielsen Date: Thu, 10 Oct 2024 20:48:53 +0200 Subject: [PATCH 27/27] Fix user-agent --- src/parser-includes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser-includes.ts b/src/parser-includes.ts index de6be4df9..37e2ac360 100644 --- a/src/parser-includes.ts +++ b/src/parser-includes.ts @@ -219,7 +219,7 @@ export class ParserIncludes { try { const target = `${cwd}/${stateDir}/includes/${fsUrl}`; if (await fs.pathExists(target) && !fetchIncludes) return; - const res = await axios.get(url); + const res = await axios.get(url, {headers: {"User-Agent": "gitlab-ci-local"}}); await fs.outputFile(target, res.data); } catch (e) { throw new AssertionError({message: `Remote include could not be fetched ${url}\n${e}`});