Skip to content

Commit

Permalink
Replace default export of esMain by named export
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Nov 14, 2023
1 parent e792e6f commit e8f8a65
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion scripts/combine-compodoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion scripts/event-log-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion scripts/get-report-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion scripts/get-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/cancel-preparation-runs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/ensure-next-ahead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion scripts/release/generate-pr-description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/get-changelog-from-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/get-current-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/get-version-changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion scripts/release/is-pr-frozen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion scripts/release/is-prerelease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/is-version-published.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/label-patches.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/pick-patches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion scripts/release/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/unreleased-changes-exists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion scripts/release/write-changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/sandbox/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/esmain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e8f8a65

Please sign in to comment.