Skip to content

Commit

Permalink
wip esm adapt lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Jul 30, 2021
1 parent 7cd9ef5 commit b1e6270
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 26 deletions.
3 changes: 2 additions & 1 deletion index.js
@@ -1,4 +1,5 @@
import {pick} from 'lodash';
import lodash from 'lodash'
const {pick} = lodash
import marked from 'marked';
import TerminalRenderer from 'marked-terminal';
import envCi from 'env-ci';
Expand Down
3 changes: 2 additions & 1 deletion lib/branches/expand.js
@@ -1,4 +1,5 @@
import {isString, remove, omit, mapValues, template} from 'lodash';
import lodash from 'lodash'
const {isString, remove, omit, mapValues, template} = lodash
import micromatch from 'micromatch';
import {getBranches} from '../git.js';

Expand Down
3 changes: 2 additions & 1 deletion lib/branches/get-tags.js
@@ -1,4 +1,5 @@
import {template, escapeRegExp} from 'lodash';
import lodash from 'lodash'
const {template, escapeRegExp} = lodash
import semver from 'semver';
import pReduce from 'p-reduce';
import debugFactory from 'debug';
Expand Down
3 changes: 2 additions & 1 deletion lib/branches/index.js
@@ -1,4 +1,5 @@
import {isString, isRegExp} from 'lodash';
import lodash from 'lodash'
const {isString, isRegExp} = lodash
import AggregateError from 'aggregate-error';
import pEachSeries from 'p-each-series';
import DEFINITIONS from '../definitions/branches.js';
Expand Down
3 changes: 2 additions & 1 deletion lib/branches/normalize.js
@@ -1,4 +1,5 @@
import {sortBy, isNil} from 'lodash';
import lodash from 'lodash'
const {sortBy, isNil} = lodash
import semverDiff from 'semver-diff';
import {FIRST_RELEASE, RELEASE_TYPE} from '../definitions/constants.js';

Expand Down
3 changes: 2 additions & 1 deletion lib/definitions/branches.js
@@ -1,4 +1,5 @@
import {isNil, uniqBy} from 'lodash';
import lodash from 'lodash'
const {isNil, uniqBy} = lodash
import semver from 'semver';
import {isMaintenanceRange} from '../utils.js';

Expand Down
3 changes: 2 additions & 1 deletion lib/definitions/errors.js
@@ -1,5 +1,6 @@
import {inspect} from 'util';
import {toLower, isString, trim} from 'lodash';
import lodash from 'lodash'
const {toLower, isString, trim} = lodash
import pkg from '../../package.json';
import {RELEASE_TYPE} from './constants.js';

Expand Down
3 changes: 2 additions & 1 deletion lib/definitions/plugins.js
@@ -1,4 +1,5 @@
import {isString, isPlainObject} from 'lodash';
import lodash from 'lodash'
const {isString, isPlainObject} = lodash

import {getGitHead} from '../git.js';
import hideSensitive from '../hide-sensitive.js';
Expand Down
3 changes: 2 additions & 1 deletion lib/get-config.js
@@ -1,4 +1,5 @@
import {castArray, pickBy, isNil, isString, isPlainObject} from 'lodash';
import lodash from 'lodash'
const {castArray, pickBy, isNil, isString, isPlainObject} = lodash
import readPkgUp from 'read-pkg-up';
import {cosmiconfig} from 'cosmiconfig';
import resolveFrom from 'resolve-from';
Expand Down
3 changes: 2 additions & 1 deletion lib/get-git-auth-url.js
@@ -1,5 +1,6 @@
import {format} from 'url';
import {isNil} from 'lodash';
import lodash from 'lodash'
const {isNil} = lodash
import hostedGitInfo from 'hosted-git-info';
import {verifyAuth} from './git.js';
import debugFactory from 'debug';
Expand Down
3 changes: 2 additions & 1 deletion lib/get-last-release.js
@@ -1,4 +1,5 @@
import {isUndefined} from 'lodash';
import lodash from 'lodash'
const {isUndefined} = lodash
import semver from 'semver';
import {makeTag, isSameChannel} from './utils.js';

Expand Down
3 changes: 2 additions & 1 deletion lib/get-release-to-add.js
@@ -1,4 +1,5 @@
import {uniqBy, intersection} from 'lodash';
import lodash from 'lodash'
const {uniqBy, intersection} = lodash
import semver from 'semver';
import semverDiff from 'semver-diff';
import getLastRelease from './get-last-release.js';
Expand Down
3 changes: 2 additions & 1 deletion lib/hide-sensitive.js
@@ -1,4 +1,5 @@
import {escapeRegExp, size, isString} from 'lodash';
import lodash from 'lodash'
const {escapeRegExp, size, isString} = lodash
import {SECRET_REPLACEMENT, SECRET_MIN_SIZE} from './definitions/constants.js';

export default (env) => {
Expand Down
3 changes: 2 additions & 1 deletion lib/plugins/index.js
@@ -1,4 +1,5 @@
import {identity, isPlainObject, omit, castArray, isNil, isString} from 'lodash';
import lodash from 'lodash'
const {identity, isPlainObject, omit, castArray, isNil, isString} = lodash
import AggregateError from 'aggregate-error';
import getError from '../get-error.js';
import PLUGINS_DEFINITIONS from '../definitions/plugins.js';
Expand Down
3 changes: 2 additions & 1 deletion lib/plugins/normalize.js
@@ -1,4 +1,5 @@
import {isPlainObject, isFunction, noop, cloneDeep, omit} from 'lodash';
import lodash from 'lodash'
const {isPlainObject, isFunction, noop, cloneDeep, omit} = lodash
import debugFactory from 'debug';
const debug = debugFactory('semantic-release:plugins');
import getError from '../get-error.js';
Expand Down
3 changes: 2 additions & 1 deletion lib/plugins/pipeline.js
@@ -1,4 +1,5 @@
import {identity} from 'lodash';
import lodash from 'lodash'
const {identity} = lodash
import pReduce from 'p-reduce';
import AggregateError from 'aggregate-error';
import {extractErrors} from '../utils.js';
Expand Down
3 changes: 2 additions & 1 deletion lib/plugins/utils.js
@@ -1,5 +1,6 @@
import {dirname} from 'path';
import {isString, isFunction, castArray, isArray, isPlainObject, isNil} from 'lodash';
import lodash from 'lodash'
const {isString, isFunction, castArray, isArray, isPlainObject, isNil} = lodash
import resolveFrom from 'resolve-from';

const validateSteps = (conf) => {
Expand Down
3 changes: 2 additions & 1 deletion lib/utils.js
@@ -1,4 +1,5 @@
import {isFunction, union, template} from 'lodash';
import lodash from 'lodash'
const {isFunction, union, template} = lodash
import semver from 'semver';
import hideSensitive from './hide-sensitive.js';

Expand Down
3 changes: 2 additions & 1 deletion lib/verify.js
@@ -1,4 +1,5 @@
import {template, isString, isPlainObject} from 'lodash';
import lodash from 'lodash'
const {template, isString, isPlainObject} = lodash
import AggregateError from 'aggregate-error';
import {isGitRepo, verifyTagName} from './git.js';
import getError from './get-error.js';
Expand Down
3 changes: 2 additions & 1 deletion test/branches/branches.test.js
@@ -1,5 +1,6 @@
import test from 'ava';
import {union} from 'lodash';
import lodash from 'lodash'
const {union} = lodash
import semver from 'semver';
import proxyquire from 'proxyquire';

Expand Down
3 changes: 2 additions & 1 deletion test/cli.test.js
@@ -1,5 +1,6 @@
import test from 'ava';
import {escapeRegExp} from 'lodash';
import lodash from 'lodash'
const {escapeRegExp} = lodash
const proxyquire = require('proxyquire').noPreserveCache();
import sinon from 'sinon';
import {SECRET_REPLACEMENT} from '../lib/definitions/constants.js';
Expand Down
3 changes: 2 additions & 1 deletion test/get-config.test.js
Expand Up @@ -2,7 +2,8 @@ import path from 'path';
import {format} from 'util';
import test from 'ava';
import {writeFile, outputJson} from 'fs-extra';
import {omit} from 'lodash';
import lodash from 'lodash'
const {omit} = lodash
import proxyquire from 'proxyquire';
import sinon from 'sinon';
import yaml from 'js-yaml';
Expand Down
3 changes: 2 additions & 1 deletion test/hide-sensitive.test.js
@@ -1,5 +1,6 @@
import test from 'ava';
import {repeat} from 'lodash';
import lodash from 'lodash'
const {repeat} = lodash
import hideSensitive from '../lib/hide-sensitive.js';
import {SECRET_REPLACEMENT, SECRET_MIN_SIZE} from '../lib/definitions/constants.js';

Expand Down
3 changes: 2 additions & 1 deletion test/index.test.js
@@ -1,5 +1,6 @@
import test from 'ava';
import {escapeRegExp, isString, sortBy, omit} from 'lodash';
import lodash from 'lodash'
const {escapeRegExp, isString, sortBy, omit} = lodash
import proxyquire from 'proxyquire';
import sinon from 'sinon';
import {WritableStreamBuffer} from 'stream-buffers';
Expand Down
3 changes: 2 additions & 1 deletion test/integration.test.js
@@ -1,7 +1,8 @@
import path from 'path';
import test from 'ava';
import proxyquire from 'proxyquire';
import {escapeRegExp} from 'lodash';
import lodash from 'lodash'
const {escapeRegExp} = lodash
import {writeJson, readJson} from 'fs-extra';
import execa from 'execa';
import {WritableStreamBuffer} from 'stream-buffers';
Expand Down
3 changes: 2 additions & 1 deletion test/plugins/normalize.test.js
@@ -1,5 +1,6 @@
import test from 'ava';
import {noop} from 'lodash';
import lodash from 'lodash'
const {noop} = lodash
import sinon from 'sinon';
import normalize from '../../lib/plugins/normalize.js';

Expand Down

0 comments on commit b1e6270

Please sign in to comment.