From e8f8a65aee104fa384c0d7505fc470c1804267e6 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Tue, 14 Nov 2023 17:15:47 +0100 Subject: [PATCH] Replace default export of esMain by named export --- scripts/combine-compodoc.ts | 2 +- scripts/event-log-checker.ts | 2 +- scripts/get-report-message.ts | 2 +- scripts/get-template.ts | 2 +- scripts/release/cancel-preparation-runs.ts | 2 +- scripts/release/ensure-next-ahead.ts | 2 +- scripts/release/generate-pr-description.ts | 2 +- scripts/release/get-changelog-from-file.ts | 2 +- scripts/release/get-current-version.ts | 2 +- scripts/release/get-version-changelog.ts | 2 +- scripts/release/is-pr-frozen.ts | 2 +- scripts/release/is-prerelease.ts | 2 +- scripts/release/is-version-published.ts | 2 +- scripts/release/label-patches.ts | 2 +- scripts/release/pick-patches.ts | 2 +- scripts/release/publish.ts | 2 +- scripts/release/unreleased-changes-exists.ts | 2 +- scripts/release/version.ts | 2 +- scripts/release/write-changelog.ts | 2 +- scripts/sandbox/generate.ts | 2 +- scripts/utils/esmain.ts | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/scripts/combine-compodoc.ts b/scripts/combine-compodoc.ts index 3eaad97df6d0..c355cc242831 100755 --- a/scripts/combine-compodoc.ts +++ b/scripts/combine-compodoc.ts @@ -7,7 +7,7 @@ import { realpath, readFile, writeFile, lstat } from 'fs-extra'; import { globSync } from 'glob'; import { directory } from 'tempy'; import { execaCommand } from 'execa'; -import esMain from './utils/esmain'; +import { esMain } from './utils/esmain'; const logger = console; diff --git a/scripts/event-log-checker.ts b/scripts/event-log-checker.ts index 2812dc089697..681e54f7dfe4 100644 --- a/scripts/event-log-checker.ts +++ b/scripts/event-log-checker.ts @@ -2,7 +2,7 @@ import chalk from 'chalk'; import assert from 'assert'; import fetch from 'node-fetch'; -import esMain from './utils/esmain'; +import { esMain } from './utils/esmain'; import { allTemplates } from '../code/lib/cli/src/sandbox-templates'; import versions from '../code/lib/cli/src/versions'; import { oneWayHash } from '../code/lib/telemetry/src/one-way-hash'; diff --git a/scripts/get-report-message.ts b/scripts/get-report-message.ts index a10bbdd276e1..d118bfed3b61 100644 --- a/scripts/get-report-message.ts +++ b/scripts/get-report-message.ts @@ -2,7 +2,7 @@ import { readJson } from 'fs-extra'; import { join } from 'path'; import { execaCommand } from 'execa'; -import esMain from './utils/esmain'; +import { esMain } from './utils/esmain'; import { CODE_DIRECTORY } from './utils/constants'; type Branch = 'main' | 'next' | 'alpha' | 'next-release' | 'latest-release'; diff --git a/scripts/get-template.ts b/scripts/get-template.ts index 0b54568b3143..ee3b81b13025 100644 --- a/scripts/get-template.ts +++ b/scripts/get-template.ts @@ -4,7 +4,7 @@ import { program } from 'commander'; import dedent from 'ts-dedent'; import chalk from 'chalk'; import yaml from 'yaml'; -import esMain from './utils/esmain'; +import { esMain } from './utils/esmain'; import { allTemplates, templatesByCadence, diff --git a/scripts/release/cancel-preparation-runs.ts b/scripts/release/cancel-preparation-runs.ts index 811de60bfa52..56cca697d1d9 100644 --- a/scripts/release/cancel-preparation-runs.ts +++ b/scripts/release/cancel-preparation-runs.ts @@ -6,7 +6,7 @@ import chalk from 'chalk'; import program from 'commander'; import dedent from 'ts-dedent'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import { githubRestClient } from './utils/github-client'; program diff --git a/scripts/release/ensure-next-ahead.ts b/scripts/release/ensure-next-ahead.ts index 4bc4bfbab35b..308004f031cf 100644 --- a/scripts/release/ensure-next-ahead.ts +++ b/scripts/release/ensure-next-ahead.ts @@ -14,7 +14,7 @@ import program from 'commander'; import semver from 'semver'; import { z } from 'zod'; import { readJson } from 'fs-extra'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import { run as bumpVersion } from './version'; import { git } from './utils/git-client'; diff --git a/scripts/release/generate-pr-description.ts b/scripts/release/generate-pr-description.ts index 31bcc3c63c1a..438c13fb4a91 100644 --- a/scripts/release/generate-pr-description.ts +++ b/scripts/release/generate-pr-description.ts @@ -5,7 +5,7 @@ import { z } from 'zod'; import dedent from 'ts-dedent'; import semver from 'semver'; import { setOutput } from '@actions/core'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import type { Change } from './utils/get-changes'; import { getChanges, LABELS_BY_IMPORTANCE, RELEASED_LABELS } from './utils/get-changes'; import { getCurrentVersion } from './get-current-version'; diff --git a/scripts/release/get-changelog-from-file.ts b/scripts/release/get-changelog-from-file.ts index 62a248f06d97..d400ad581507 100644 --- a/scripts/release/get-changelog-from-file.ts +++ b/scripts/release/get-changelog-from-file.ts @@ -6,7 +6,7 @@ import { readFile } from 'fs-extra'; import path from 'path'; import semver from 'semver'; import dedent from 'ts-dedent'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import { getCurrentVersion } from './get-current-version'; program diff --git a/scripts/release/get-current-version.ts b/scripts/release/get-current-version.ts index 7fa283d4f08e..fffa703ab088 100644 --- a/scripts/release/get-current-version.ts +++ b/scripts/release/get-current-version.ts @@ -3,7 +3,7 @@ import chalk from 'chalk'; import { setOutput } from '@actions/core'; import path from 'path'; import { readJson } from 'fs-extra'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; const CODE_DIR_PATH = path.join(__dirname, '..', '..', 'code'); const CODE_PACKAGE_JSON_PATH = path.join(CODE_DIR_PATH, 'package.json'); diff --git a/scripts/release/get-version-changelog.ts b/scripts/release/get-version-changelog.ts index a3c6e645f793..ce0464d62517 100644 --- a/scripts/release/get-version-changelog.ts +++ b/scripts/release/get-version-changelog.ts @@ -2,7 +2,7 @@ import { setOutput } from '@actions/core'; import chalk from 'chalk'; import { program } from 'commander'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import { getCurrentVersion } from './get-current-version'; import { getChanges } from './utils/get-changes'; diff --git a/scripts/release/is-pr-frozen.ts b/scripts/release/is-pr-frozen.ts index 2eb52528dda7..70d04c9509f2 100644 --- a/scripts/release/is-pr-frozen.ts +++ b/scripts/release/is-pr-frozen.ts @@ -4,7 +4,7 @@ import program from 'commander'; import { setOutput } from '@actions/core'; import path from 'path'; import { readJson } from 'fs-extra'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import { getPullInfoFromCommit } from './utils/get-github-info'; import { git } from './utils/git-client'; diff --git a/scripts/release/is-prerelease.ts b/scripts/release/is-prerelease.ts index ef15bf6c40b2..b35f423820ea 100644 --- a/scripts/release/is-prerelease.ts +++ b/scripts/release/is-prerelease.ts @@ -3,7 +3,7 @@ import chalk from 'chalk'; import program from 'commander'; import { setOutput } from '@actions/core'; import semver from 'semver'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import { getCurrentVersion } from './get-current-version'; program diff --git a/scripts/release/is-version-published.ts b/scripts/release/is-version-published.ts index 6a57efa92d55..54c19a465eb7 100644 --- a/scripts/release/is-version-published.ts +++ b/scripts/release/is-version-published.ts @@ -3,7 +3,7 @@ import chalk from 'chalk'; import program from 'commander'; import { setOutput } from '@actions/core'; import fetch from 'node-fetch'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import { getCurrentVersion } from './get-current-version'; program diff --git a/scripts/release/label-patches.ts b/scripts/release/label-patches.ts index 68572d45c87c..453e64105abf 100644 --- a/scripts/release/label-patches.ts +++ b/scripts/release/label-patches.ts @@ -1,7 +1,7 @@ import program from 'commander'; import { v4 as uuidv4 } from 'uuid'; import ora from 'ora'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import { getLabelIds, githubGraphQlClient, getUnpickedPRs } from './utils/github-client'; import { getPullInfoFromCommits, getRepo } from './utils/get-changes'; import { getLatestTag, git } from './utils/git-client'; diff --git a/scripts/release/pick-patches.ts b/scripts/release/pick-patches.ts index 9bdbf53977ec..be713f5f5d51 100644 --- a/scripts/release/pick-patches.ts +++ b/scripts/release/pick-patches.ts @@ -5,7 +5,7 @@ import chalk from 'chalk'; import ora from 'ora'; import { setOutput } from '@actions/core'; import invariant from 'tiny-invariant'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import { git } from './utils/git-client'; import { getUnpickedPRs } from './utils/github-client'; diff --git a/scripts/release/publish.ts b/scripts/release/publish.ts index c5f509ccd00a..cd69f5260ce8 100644 --- a/scripts/release/publish.ts +++ b/scripts/release/publish.ts @@ -9,7 +9,7 @@ import fetch from 'node-fetch'; import dedent from 'ts-dedent'; import pRetry from 'p-retry'; import { execaCommand } from 'execa'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; program .name('publish') diff --git a/scripts/release/unreleased-changes-exists.ts b/scripts/release/unreleased-changes-exists.ts index e076e640d302..7944edbac73f 100644 --- a/scripts/release/unreleased-changes-exists.ts +++ b/scripts/release/unreleased-changes-exists.ts @@ -4,7 +4,7 @@ import program from 'commander'; import { z } from 'zod'; import { setOutput } from '@actions/core'; import { intersection } from 'lodash'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import type { Change } from './utils/get-changes'; import { RELEASED_LABELS, getChanges } from './utils/get-changes'; import { getCurrentVersion } from './get-current-version'; diff --git a/scripts/release/version.ts b/scripts/release/version.ts index db3f30fa8a80..c56d7afa5b54 100644 --- a/scripts/release/version.ts +++ b/scripts/release/version.ts @@ -7,7 +7,7 @@ import program from 'commander'; import semver from 'semver'; import { z } from 'zod'; import { execaCommand } from 'execa'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import type { Workspace } from '../utils/workspace'; import { getWorkspaces } from '../utils/workspace'; diff --git a/scripts/release/write-changelog.ts b/scripts/release/write-changelog.ts index 30a64dd366ee..5af64eba3a8e 100644 --- a/scripts/release/write-changelog.ts +++ b/scripts/release/write-changelog.ts @@ -5,7 +5,7 @@ import program from 'commander'; import semver from 'semver'; import { z } from 'zod'; import { readFile, writeFile, writeJson } from 'fs-extra'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import { getChanges } from './utils/get-changes'; program diff --git a/scripts/sandbox/generate.ts b/scripts/sandbox/generate.ts index e94459e4d915..8f7ae78fb0d2 100755 --- a/scripts/sandbox/generate.ts +++ b/scripts/sandbox/generate.ts @@ -7,7 +7,7 @@ import { copy, emptyDir, ensureDir, move, remove, rename, writeFile } from 'fs-e import { program } from 'commander'; import { directory } from 'tempy'; import { execaCommand } from 'execa'; -import esMain from '../utils/esmain'; +import { esMain } from '../utils/esmain'; import type { OptionValues } from '../utils/options'; import { createOptions } from '../utils/options'; diff --git a/scripts/utils/esmain.ts b/scripts/utils/esmain.ts index 286f8b250276..edc9d07b4322 100644 --- a/scripts/utils/esmain.ts +++ b/scripts/utils/esmain.ts @@ -21,7 +21,7 @@ export function stripExt(name: string) { * Check if a module was run directly with node as opposed to being * imported from another module. */ -export default function esMain(url: string) { +export function esMain(url: string) { if (!url || !process.argv[1]) { return false; }