Skip to content

Commit

Permalink
feat: Remove default export
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The default export has been removed, please use a named export instead.
  • Loading branch information
evocateur committed Dec 8, 2020
1 parent e5cf30c commit e2f1ec3
Show file tree
Hide file tree
Showing 65 changed files with 1 addition and 75 deletions.
1 change: 0 additions & 1 deletion commands/__mocks__/@lerna/check-working-tree.js
Expand Up @@ -4,7 +4,6 @@ const mockCheckWorkingTree = jest.fn(() => Promise.resolve());
const mockThrowIfReleased = jest.fn(() => Promise.resolve());
const mockThrowIfUncommitted = jest.fn(() => Promise.resolve());

module.exports = mockCheckWorkingTree;
module.exports.checkWorkingTree = mockCheckWorkingTree;
module.exports.throwIfReleased = mockThrowIfReleased;
module.exports.throwIfUncommitted = mockThrowIfUncommitted;
2 changes: 0 additions & 2 deletions commands/__mocks__/@lerna/collect-updates.js
Expand Up @@ -20,9 +20,7 @@ afterEach(() => {
updated.clear();
});

module.exports = mockCollectUpdates;
module.exports.collectUpdates = mockCollectUpdates;
module.exports.setUpdated = setUpdated;
module.exports.collectUpdates.setUpdated = setUpdated;
module.exports.collectPackages = collectPackages;
module.exports.getPackagesForOption = getPackagesForOption;
1 change: 0 additions & 1 deletion commands/__mocks__/@lerna/github-client.js
Expand Up @@ -6,7 +6,6 @@ const client = {
},
};

module.exports.client = client;
module.exports.createGitHubClient = () => client;
module.exports.parseGitRepo = () => ({
owner: "lerna",
Expand Down
1 change: 0 additions & 1 deletion commands/__mocks__/@lerna/gitlab-client.js
Expand Up @@ -6,5 +6,4 @@ const client = {
},
};

module.exports = () => client;
module.exports.createGitLabClient = () => client;
1 change: 0 additions & 1 deletion commands/__mocks__/@lerna/has-npm-version.js
Expand Up @@ -3,6 +3,5 @@
const mockHasNpmVersion = jest.fn(() => true);
const mockMakePredicate = jest.fn(() => (range) => mockHasNpmVersion(range));

module.exports = mockHasNpmVersion;
module.exports.hasNpmVersion = mockHasNpmVersion;
module.exports.makePredicate = mockMakePredicate;
3 changes: 0 additions & 3 deletions commands/__mocks__/@lerna/npm-publish.js
Expand Up @@ -19,9 +19,6 @@ afterEach(() => {
registry.clear();
});

module.exports = mockNpmPublish;
module.exports.npmPublish = mockNpmPublish;
module.exports.order = order;
module.exports.registry = registry;
module.exports.npmPublish.order = order;
module.exports.npmPublish.registry = registry;
2 changes: 0 additions & 2 deletions commands/__mocks__/@lerna/output.js
Expand Up @@ -13,7 +13,5 @@ function logged() {
return mockOutput.mock.calls.map((args) => multiLineTrimRight(args[0])).join("\n");
}

module.exports = mockOutput;
module.exports.logged = logged;
module.exports.output = mockOutput;
module.exports.output.logged = logged;
2 changes: 0 additions & 2 deletions commands/__mocks__/@lerna/pack-directory.js
Expand Up @@ -16,7 +16,5 @@ afterEach(() => {
registry.clear();
});

module.exports = mockPackDirectory;
module.exports.packDirectory = mockPackDirectory;
module.exports.registry = registry;
module.exports.packDirectory.registry = registry;
2 changes: 0 additions & 2 deletions commands/__mocks__/@lerna/run-lifecycle.js
Expand Up @@ -14,8 +14,6 @@ function getOrderedCalls() {
return mockRunLifecycle.mock.calls.map(([pkg, script]) => [pkg.name, script]);
}

module.exports = mockRunLifecycle;
module.exports.runLifecycle = mockRunLifecycle;
module.exports.createRunner = mockCreateRunner;
module.exports.getOrderedCalls = getOrderedCalls;
module.exports.runLifecycle.getOrderedCalls = getOrderedCalls;
2 changes: 1 addition & 1 deletion commands/version/__tests__/version-command.test.js
Expand Up @@ -34,7 +34,7 @@ const { getCommitMessage } = require("@lerna-test/get-commit-message");
const lernaVersion = require("@lerna-test/command-runner")(require("../command"));

// certain tests need to use the real thing
const collectUpdatesActual = jest.requireActual("@lerna/collect-updates");
const collectUpdatesActual = jest.requireActual("@lerna/collect-updates").collectUpdates;

// assertion helpers
const listDirty = (cwd) =>
Expand Down
1 change: 0 additions & 1 deletion core/command/index.js
Expand Up @@ -287,5 +287,4 @@ class Command {
}
}

module.exports = Command;
module.exports.Command = Command;
1 change: 0 additions & 1 deletion core/filter-options/index.js
Expand Up @@ -4,7 +4,6 @@ const log = require("npmlog");
const dedent = require("dedent");
const { getFilteredPackages } = require("./lib/get-filtered-packages");

module.exports = filterOptions;
module.exports.filterOptions = filterOptions;
module.exports.getFilteredPackages = getFilteredPackages;

Expand Down
1 change: 0 additions & 1 deletion core/global-options/index.js
Expand Up @@ -2,7 +2,6 @@

const os = require("os");

module.exports = globalOptions;
module.exports.globalOptions = globalOptions;

function globalOptions(yargs) {
Expand Down
1 change: 0 additions & 1 deletion core/otplease/otplease.js
Expand Up @@ -35,7 +35,6 @@ const semaphore = {
},
};

module.exports = otplease;
module.exports.otplease = otplease;
module.exports.getOneTimePassword = getOneTimePassword;

Expand Down
1 change: 0 additions & 1 deletion core/package-graph/index.js
Expand Up @@ -298,5 +298,4 @@ class PackageGraph extends Map {
}
}

module.exports = PackageGraph;
module.exports.PackageGraph = PackageGraph;
1 change: 0 additions & 1 deletion core/package/index.js
Expand Up @@ -253,5 +253,4 @@ class Package {
}
}

module.exports = Package;
module.exports.Package = Package;
1 change: 0 additions & 1 deletion core/project/index.js
Expand Up @@ -228,7 +228,6 @@ class Project {
Project.PACKAGE_GLOB = "packages/*";
Project.LICENSE_GLOB = "LICEN{S,C}E{,.*}";

module.exports = Project;
module.exports.Project = Project;
module.exports.getPackages = Project.getPackages;
module.exports.getPackagesSync = Project.getPackagesSync;
1 change: 0 additions & 1 deletion core/validation-error/validation-error.js
Expand Up @@ -12,5 +12,4 @@ class ValidationError extends Error {
}
}

module.exports = ValidationError;
module.exports.ValidationError = ValidationError;
1 change: 0 additions & 1 deletion helpers/calls-back/index.js
@@ -1,6 +1,5 @@
"use strict";

module.exports = callsBack;
module.exports.callsBack = callsBack;

// for mocking the behaviour of methods that accept a callback
Expand Down
1 change: 0 additions & 1 deletion helpers/cli-runner/index.js
Expand Up @@ -5,7 +5,6 @@ const execa = require("execa");
// eslint-disable-next-line node/no-unpublished-require
const LERNA_BIN = require.resolve("../../core/lerna/cli");

module.exports = cliRunner;
module.exports.cliRunner = cliRunner;

function cliRunner(cwd, env) {
Expand Down
1 change: 0 additions & 1 deletion helpers/commit-change-to-package/index.js
Expand Up @@ -6,7 +6,6 @@ const writeJsonFile = require("write-json-file");
const { gitAdd } = require("@lerna-test/git-add");
const { gitCommit } = require("@lerna-test/git-commit");

module.exports = commitChangeToPackage;
module.exports.commitChangeToPackage = commitChangeToPackage;

function commitChangeToPackage(cwd, packageName, commitMsg, data) {
Expand Down
1 change: 0 additions & 1 deletion helpers/copy-fixture/index.js
Expand Up @@ -3,7 +3,6 @@
const { findFixture } = require("@lerna-test/find-fixture");
const fs = require("fs-extra");

module.exports = copyFixture;
module.exports.copyFixture = copyFixture;

function copyFixture(targetDir, fixtureName, cwd) {
Expand Down
1 change: 0 additions & 1 deletion helpers/find-fixture/index.js
Expand Up @@ -3,7 +3,6 @@
const findUp = require("find-up");
const path = require("path");

module.exports = findFixture;
module.exports.findFixture = findFixture;

function findFixture(cwd, fixtureName) {
Expand Down
1 change: 0 additions & 1 deletion helpers/get-commit-message/index.js
Expand Up @@ -2,7 +2,6 @@

const execa = require("execa");

module.exports = getCommitMessage;
module.exports.getCommitMessage = getCommitMessage;

function getCommitMessage(cwd, format = "%B") {
Expand Down
1 change: 0 additions & 1 deletion helpers/git-add/index.js
Expand Up @@ -2,7 +2,6 @@

const execa = require("execa");

module.exports = gitAdd;
module.exports.gitAdd = gitAdd;

function gitAdd(cwd, ...files) {
Expand Down
1 change: 0 additions & 1 deletion helpers/git-checkout/index.js
Expand Up @@ -2,7 +2,6 @@

const execa = require("execa");

module.exports = gitCheckout;
module.exports.gitCheckout = gitCheckout;

function gitCheckout(cwd, args) {
Expand Down
1 change: 0 additions & 1 deletion helpers/git-commit/index.js
Expand Up @@ -4,7 +4,6 @@ const os = require("os");
const execa = require("execa");
const tempWrite = require("temp-write");

module.exports = gitCommit;
module.exports.gitCommit = gitCommit;

function gitCommit(cwd, message) {
Expand Down
1 change: 0 additions & 1 deletion helpers/git-init/index.js
Expand Up @@ -6,7 +6,6 @@ const execa = require("execa");
// Contains all relevant git config (user, commit.gpgSign, etc)
const TEMPLATE = path.resolve(__dirname, "template");

module.exports = gitInit;
module.exports.gitInit = gitInit;

function gitInit(cwd, ...args) {
Expand Down
1 change: 0 additions & 1 deletion helpers/git-merge/index.js
Expand Up @@ -2,7 +2,6 @@

const execa = require("execa");

module.exports = gitMerge;
module.exports.gitMerge = gitMerge;

function gitMerge(cwd, args) {
Expand Down
1 change: 0 additions & 1 deletion helpers/git-status/index.js
Expand Up @@ -2,7 +2,6 @@

const cp = require("child_process");

module.exports = gitStatus;
module.exports.gitStatus = gitStatus;

function gitStatus(cwd) {
Expand Down
1 change: 0 additions & 1 deletion helpers/git-tag/index.js
Expand Up @@ -2,7 +2,6 @@

const execa = require("execa");

module.exports = gitTag;
module.exports.gitTag = gitTag;

function gitTag(cwd, tagName) {
Expand Down
1 change: 0 additions & 1 deletion helpers/load-manifests/index.js
Expand Up @@ -3,7 +3,6 @@
const globby = require("globby");
const loadJsonFile = require("load-json-file");

module.exports = loadManifests;
module.exports.loadManifests = loadManifests;

function loadManifests(cwd) {
Expand Down
1 change: 0 additions & 1 deletion helpers/logging-output/index.js
Expand Up @@ -3,7 +3,6 @@
const log = require("npmlog");
const { multiLineTrimRight } = require("@lerna-test/multi-line-trim-right");

module.exports = loggingOutput;
module.exports.loggingOutput = loggingOutput;

// clear logs between tests
Expand Down
1 change: 0 additions & 1 deletion helpers/multi-line-trim-right/index.js
Expand Up @@ -2,7 +2,6 @@

const normalizeNewline = require("normalize-newline");

module.exports = multiLineTrimRight;
module.exports.multiLineTrimRight = multiLineTrimRight;

// const { multiLineTrimRight } = require("@lerna-test/multi-line-trim-right");
Expand Down
1 change: 0 additions & 1 deletion helpers/normalize-relative-dir/index.js
Expand Up @@ -3,7 +3,6 @@
const path = require("path");
const normalizePath = require("normalize-path");

module.exports = normalizeRelativeDir;
module.exports.normalizeRelativeDir = normalizeRelativeDir;

function normalizeRelativeDir(testDir, filePath) {
Expand Down
1 change: 0 additions & 1 deletion helpers/show-commit/index.js
Expand Up @@ -3,7 +3,6 @@
const execa = require("execa");
const gitSHA = require("@lerna-test/serialize-git-sha");

module.exports = showCommit;
module.exports.showCommit = showCommit;

function showCommit(cwd, ...args) {
Expand Down
1 change: 0 additions & 1 deletion helpers/update-lerna-config/index.js
Expand Up @@ -3,7 +3,6 @@
// eslint-disable-next-line import/no-extraneous-dependencies, node/no-extraneous-require
const { Project } = require("@lerna/project");

module.exports = updateLernaConfig;
module.exports.updateLernaConfig = updateLernaConfig;

/**
Expand Down
1 change: 0 additions & 1 deletion utils/check-working-tree/lib/check-working-tree.js
Expand Up @@ -4,7 +4,6 @@ const { describeRef } = require("@lerna/describe-ref");
const { ValidationError } = require("@lerna/validation-error");
const { collectUncommitted } = require("@lerna/collect-uncommitted");

module.exports = checkWorkingTree;
module.exports.checkWorkingTree = checkWorkingTree;
module.exports.mkThrowIfUncommitted = mkThrowIfUncommitted;
module.exports.throwIfReleased = throwIfReleased;
Expand Down
2 changes: 0 additions & 2 deletions utils/collect-uncommitted/lib/collect-uncommitted.js
Expand Up @@ -4,9 +4,7 @@ const chalk = require("chalk");
const npmlog = require("npmlog");
const { exec, execSync } = require("@lerna/child-process");

module.exports = collectUncommitted;
module.exports.collectUncommitted = collectUncommitted;
module.exports.sync = collectUncommittedSync;
module.exports.collectUncommittedSync = collectUncommittedSync;

/**
Expand Down
1 change: 0 additions & 1 deletion utils/collect-updates/collect-updates.js
Expand Up @@ -8,7 +8,6 @@ const collectPackages = require("./lib/collect-packages");
const getPackagesForOption = require("./lib/get-packages-for-option");
const makeDiffPredicate = require("./lib/make-diff-predicate");

module.exports = collectUpdates;
module.exports.collectUpdates = collectUpdates;
module.exports.collectPackages = collectPackages;
module.exports.getPackagesForOption = getPackagesForOption;
Expand Down
1 change: 0 additions & 1 deletion utils/create-symlink/create-symlink.js
Expand Up @@ -5,7 +5,6 @@ const fs = require("fs-extra");
const log = require("npmlog");
const path = require("path");

module.exports = createSymlink;
module.exports.createSymlink = createSymlink;

function createSymlink(src, dest, type) {
Expand Down
2 changes: 0 additions & 2 deletions utils/describe-ref/lib/describe-ref.js
Expand Up @@ -3,9 +3,7 @@
const log = require("npmlog");
const childProcess = require("@lerna/child-process");

module.exports = describeRef;
module.exports.describeRef = describeRef;
module.exports.sync = describeRefSync;
module.exports.describeRefSync = describeRefSync;

/**
Expand Down
1 change: 0 additions & 1 deletion utils/filter-packages/filter-packages.js
Expand Up @@ -6,7 +6,6 @@ const log = require("npmlog");

const { ValidationError } = require("@lerna/validation-error");

module.exports = filterPackages;
module.exports.filterPackages = filterPackages;

/**
Expand Down
1 change: 0 additions & 1 deletion utils/get-npm-exec-opts/get-npm-exec-opts.js
Expand Up @@ -2,7 +2,6 @@

const log = require("npmlog");

module.exports = getNpmExecOpts;
module.exports.getNpmExecOpts = getNpmExecOpts;

function getNpmExecOpts(pkg, registry) {
Expand Down
1 change: 0 additions & 1 deletion utils/get-packed/lib/get-packed.js
Expand Up @@ -5,7 +5,6 @@ const path = require("path");
const ssri = require("ssri");
const tar = require("tar");

module.exports = getPacked;
module.exports.getPacked = getPacked;

function getPacked(pkg, tarFilePath) {
Expand Down
1 change: 0 additions & 1 deletion utils/gitlab-client/index.js
Expand Up @@ -4,7 +4,6 @@ const log = require("npmlog");

const GitLabClient = require("./lib/GitLabClient");

module.exports = createGitLabClient;
module.exports.createGitLabClient = createGitLabClient;

function OcktokitAdapter(client) {
Expand Down
1 change: 0 additions & 1 deletion utils/has-npm-version/lib/has-npm-version.js
Expand Up @@ -3,7 +3,6 @@
const semver = require("semver");
const childProcess = require("@lerna/child-process");

module.exports = hasNpmVersion;
module.exports.hasNpmVersion = hasNpmVersion;
module.exports.makePredicate = makePredicate;

Expand Down
1 change: 0 additions & 1 deletion utils/log-packed/lib/log-packed.js
Expand Up @@ -5,7 +5,6 @@ const columnify = require("columnify");
const hasUnicode = require("has-unicode")();
const log = require("npmlog");

module.exports = logPacked;
module.exports.logPacked = logPacked;

function logPacked(tarball) {
Expand Down
2 changes: 0 additions & 2 deletions utils/npm-install/npm-install.js
Expand Up @@ -9,8 +9,6 @@ const writePkg = require("write-pkg");
const ChildProcessUtilities = require("@lerna/child-process");
const { getNpmExecOpts } = require("@lerna/get-npm-exec-opts");

module.exports = npmInstall;
module.exports.dependencies = npmInstallDependencies;
module.exports.npmInstall = npmInstall;
module.exports.npmInstallDependencies = npmInstallDependencies;

Expand Down
1 change: 0 additions & 1 deletion utils/npm-publish/npm-publish.js
Expand Up @@ -10,7 +10,6 @@ const { runLifecycle } = require("@lerna/run-lifecycle");
const npa = require("npm-package-arg");
const { otplease } = require("@lerna/otplease");

module.exports = npmPublish;
module.exports.npmPublish = npmPublish;

const readJSONAsync = pify(readJSON);
Expand Down

0 comments on commit e2f1ec3

Please sign in to comment.