From d477f6aa33a8ea11088de8539dc12d72a9bd1b00 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Thu, 7 Mar 2024 19:41:04 +0000 Subject: [PATCH] tools: fix scripts - use run-time-error instead of run-time-error-cjs 1. The `-cjs` version of the package was put into place because in the production packages we needed it to be able to import the dependency despite us not using ESM just yet. 2. We did a blanket search and replace at the time which seemed like a good idea but turns out it wasn't because there are some tooling scripts (the ones in this diff) that are already using ESM and for those the -cjs flavored package started breaking the code. 3. So this change is just a partial/selective/surgical revert of the earlier project-wide migratin from run-time-error to run-time-error-cjs. Signed-off-by: Peter Somogyvari --- tools/bump-openapi-spec-dep-versions.ts | 2 +- tools/create-production-only-archive.ts | 2 +- tools/generate-sbom.ts | 2 +- tools/get-latest-sem-ver-git-tag.ts | 2 +- tools/npm-list.ts | 2 +- tools/sync-npm-deps-to-tsc-projects.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/bump-openapi-spec-dep-versions.ts b/tools/bump-openapi-spec-dep-versions.ts index cbdbde0226..6baf9b1055 100644 --- a/tools/bump-openapi-spec-dep-versions.ts +++ b/tools/bump-openapi-spec-dep-versions.ts @@ -5,7 +5,7 @@ import yargs from "yargs"; import { hideBin } from "yargs/helpers"; import fs from "fs-extra"; import { globby, Options as GlobbyOptions } from "globby"; -import { RuntimeError } from "run-time-error-cjs"; +import { RuntimeError } from "run-time-error"; import prettier from "prettier"; import { OpenAPIV3_1 } from "openapi-types"; import { isValidSemVer } from "semver-parser"; diff --git a/tools/create-production-only-archive.ts b/tools/create-production-only-archive.ts index a749d99f8c..5dfcc2269f 100644 --- a/tools/create-production-only-archive.ts +++ b/tools/create-production-only-archive.ts @@ -5,7 +5,7 @@ import { fileURLToPath } from "url"; import { deleteAsync } from "del"; import fs from "fs-extra"; import { globby, Options as GlobbyOptions } from "globby"; -import { RuntimeError } from "run-time-error-cjs"; +import { RuntimeError } from "run-time-error"; import yargs from "yargs"; import { hideBin } from "yargs/helpers"; import { simpleGit, SimpleGit, SimpleGitOptions } from "simple-git"; diff --git a/tools/generate-sbom.ts b/tools/generate-sbom.ts index 7ee2710dbf..e84329196a 100644 --- a/tools/generate-sbom.ts +++ b/tools/generate-sbom.ts @@ -5,7 +5,7 @@ import { promisify } from "util"; import { exec, ExecOptions } from "child_process"; import fs from "fs-extra"; import { globby, Options as GlobbyOptions } from "globby"; -import { RuntimeError } from "run-time-error-cjs"; +import { RuntimeError } from "run-time-error"; import fastSafeStringify from "fast-safe-stringify"; import { INpmListDependencyV1, npmList } from "./npm-list"; diff --git a/tools/get-latest-sem-ver-git-tag.ts b/tools/get-latest-sem-ver-git-tag.ts index 7fc367a280..9d3676c841 100644 --- a/tools/get-latest-sem-ver-git-tag.ts +++ b/tools/get-latest-sem-ver-git-tag.ts @@ -2,7 +2,7 @@ import path from "path"; import { fileURLToPath } from "url" import { simpleGit, SimpleGit, SimpleGitOptions } from "simple-git"; import { compareSemVer, isValidSemVer } from "semver-parser"; -import { RuntimeError } from "run-time-error-cjs"; +import { RuntimeError } from "run-time-error"; const TAG = "[tools/get-latest-sem-ver-git-tag.ts]"; diff --git a/tools/npm-list.ts b/tools/npm-list.ts index 9798fdae23..9bcb0758e7 100644 --- a/tools/npm-list.ts +++ b/tools/npm-list.ts @@ -2,7 +2,7 @@ import { ExecOptions, exec } from "child_process"; import { promisify } from "util"; import fastSafeStringify from "fast-safe-stringify"; -import { RuntimeError } from "run-time-error-cjs"; +import { RuntimeError } from "run-time-error"; import { hasKey } from "./has-key"; const execAsync = promisify(exec); diff --git a/tools/sync-npm-deps-to-tsc-projects.ts b/tools/sync-npm-deps-to-tsc-projects.ts index 9cdcec2858..bb4327796b 100644 --- a/tools/sync-npm-deps-to-tsc-projects.ts +++ b/tools/sync-npm-deps-to-tsc-projects.ts @@ -4,7 +4,7 @@ import path from "path"; import JSON5 from "json5"; import fs from "fs-extra"; import { globby, Options as GlobbyOptions } from "globby"; -import { RuntimeError } from "run-time-error-cjs"; +import { RuntimeError } from "run-time-error"; import { readFile } from "fs/promises"; const __filename = fileURLToPath(import.meta.url);