WIP convert CJS to ESM using https://github.com/homer0/cjs2esm
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
const {isString, remove, omit, mapValues, template} = require('lodash');
|
||||
const micromatch = require('micromatch');
|
||||
const {getBranches} = require('../git');
|
||||
import {isString, remove, omit, mapValues, template} from 'lodash';
|
||||
import micromatch from 'micromatch';
|
||||
import {getBranches} from '../git.js';
|
||||
|
||||
module.exports = async (repositoryUrl, {cwd}, branches) => {
|
||||
export default async (repositoryUrl, {cwd}, branches) => {
|
||||
const gitBranches = await getBranches(repositoryUrl, {cwd});
|
||||
|
||||
return branches.reduce(
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
const {template, escapeRegExp} = require('lodash');
|
||||
const semver = require('semver');
|
||||
const pReduce = require('p-reduce');
|
||||
const debug = require('debug')('semantic-release:get-tags');
|
||||
const {getTags, getNote} = require('../../lib/git');
|
||||
import {template, escapeRegExp} from 'lodash';
|
||||
import semver from 'semver';
|
||||
import pReduce from 'p-reduce';
|
||||
import debugFactory from 'debug';
|
||||
const debug = debugFactory('semantic-release:get-tags');
|
||||
import {getTags, getNote} from '../../lib/git.js';
|
||||
|
||||
module.exports = async ({cwd, env, options: {tagFormat}}, branches) => {
|
||||
export default async ({cwd, env, options: {tagFormat}}, branches) => {
|
||||
// Generate a regex to parse tags formatted with `tagFormat`
|
||||
// by replacing the `version` variable in the template by `(.+)`.
|
||||
// The `tagFormat` is compiled with space as the `version` as it's an invalid tag character,
|
||||
|
||||
+10
-10
@@ -1,14 +1,14 @@
|
||||
const {isString, isRegExp} = require('lodash');
|
||||
const AggregateError = require('aggregate-error');
|
||||
const pEachSeries = require('p-each-series');
|
||||
const DEFINITIONS = require('../definitions/branches');
|
||||
const getError = require('../get-error');
|
||||
const {fetch, fetchNotes, verifyBranchName} = require('../git');
|
||||
const expand = require('./expand');
|
||||
const getTags = require('./get-tags');
|
||||
const normalize = require('./normalize');
|
||||
import {isString, isRegExp} from 'lodash';
|
||||
import AggregateError from 'aggregate-error';
|
||||
import pEachSeries from 'p-each-series';
|
||||
import DEFINITIONS from '../definitions/branches.js';
|
||||
import getError from '../get-error.js';
|
||||
import {fetch, fetchNotes, verifyBranchName} from '../git.js';
|
||||
import expand from './expand.js';
|
||||
import getTags from './get-tags.js';
|
||||
import normalize from './normalize.js';
|
||||
|
||||
module.exports = async (repositoryUrl, ciBranch, context) => {
|
||||
export default async (repositoryUrl, ciBranch, context) => {
|
||||
const {cwd, env} = context;
|
||||
|
||||
const remoteBranches = await expand(
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
const {sortBy, isNil} = require('lodash');
|
||||
const semverDiff = require('semver-diff');
|
||||
const {FIRST_RELEASE, RELEASE_TYPE} = require('../definitions/constants');
|
||||
const {
|
||||
import {sortBy, isNil} from 'lodash';
|
||||
import semverDiff from 'semver-diff';
|
||||
import {FIRST_RELEASE, RELEASE_TYPE} from '../definitions/constants.js';
|
||||
|
||||
import {
|
||||
tagsToVersions,
|
||||
isMajorRange,
|
||||
getUpperBound,
|
||||
@@ -11,7 +12,7 @@ const {
|
||||
getLatestVersion,
|
||||
getFirstVersion,
|
||||
getRange,
|
||||
} = require('../utils');
|
||||
} from '../utils.js';
|
||||
|
||||
function maintenance({maintenance, release}) {
|
||||
return sortBy(
|
||||
@@ -103,4 +104,11 @@ function prerelease({prerelease}) {
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {maintenance, release, prerelease};
|
||||
const exported = {
|
||||
maintenance,
|
||||
release,
|
||||
prerelease,
|
||||
};
|
||||
|
||||
export default exported;
|
||||
export {maintenance, release, prerelease};
|
||||
|
||||
Reference in New Issue
Block a user