-
Notifications
You must be signed in to change notification settings - Fork 72
feat: ES Module #526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
babblebey
wants to merge
23
commits into
beta
Choose a base branch
from
esm
base: beta
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+10,094
−23,721
Open
feat: ES Module #526
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
14c71b4
refactor: Update code to use ES6 module syntax
babblebey d634740
refactor: replace `lodash` with `lodash-es`
babblebey dd8c485
refactor: modify `"package.json".homepage` import; remove `#readme` f…
babblebey c62b8db
fix: add missing `function` keyword
babblebey e0b8550
refactor: adapt `debug` import in `git.js` and `prepare.js`
babblebey 8885350
refactor: replace `xo` with `prettier`
babblebey 58907a0
Merge branch 'master' into esm
babblebey 6fb2c75
chore: update dependencies and devDependencies; improve Node.js engin…
babblebey 5736bef
refactor: migrate to ES modules and improve code readability in git-u…
babblebey 228998d
refactor: migrate tests to use ES module syntax and improve readability
babblebey 3bddb49
chore: update GitHub Actions workflows to use latest action versions …
babblebey 2a57c5b
refactor: standardize code formatting and improve readability across …
babblebey e8bf6e4
chore: enhance Node.js compatibility check by cleaning npm cache befo…
babblebey 6efc38b
chore: update dependencies and improve test scripts
babblebey 65cf115
chore: update Node.js versions and improve workflow steps in test.yml
babblebey 99ee085
chore: add .nvmrc file to specify Node.js version
babblebey 6e3e268
chore: update peer dependency for semantic-release to allow earlier v…
babblebey c399438
chore: exclude integration tests from AVA test files
babblebey eac13f1
test: update AVA configuration for integration tests and adjust timeo…
babblebey 18b3c3c
refactor: simplify homepage retrieval in error definitions
babblebey 8daf453
fix(test): set default git user configuration for test repositories
babblebey 440b9a4
fix(git): set default user configuration for shallow clone and detach…
babblebey 709c976
chore: update dependencies and enhance linting scripts
babblebey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,34 @@ | ||
| const {defaultTo, castArray} = require('lodash'); | ||
| const verifyGit = require('./lib/verify.js'); | ||
| const prepareGit = require('./lib/prepare.js'); | ||
| import { defaultTo, castArray } from "lodash-es"; | ||
| import verifyGit from "./lib/verify.js"; | ||
| import prepareGit from "./lib/prepare.js"; | ||
|
|
||
| let verified; | ||
|
|
||
| function verifyConditions(pluginConfig, context) { | ||
| const {options} = context; | ||
| export function verifyConditions(pluginConfig, context) { | ||
| const { options } = context; | ||
| // If the Git prepare plugin is used and has `assets` or `message` configured, validate them now in order to prevent any release if the configuration is wrong | ||
| if (options.prepare) { | ||
| const preparePlugin = | ||
| castArray(options.prepare).find((config) => config.path && config.path === '@semantic-release/git') || {}; | ||
| castArray(options.prepare).find( | ||
| (config) => config.path && config.path === "@semantic-release/git", | ||
| ) || {}; | ||
|
|
||
| pluginConfig.assets = defaultTo(pluginConfig.assets, preparePlugin.assets); | ||
| pluginConfig.message = defaultTo(pluginConfig.message, preparePlugin.message); | ||
| pluginConfig.message = defaultTo( | ||
| pluginConfig.message, | ||
| preparePlugin.message, | ||
| ); | ||
| } | ||
|
|
||
| verifyGit(pluginConfig); | ||
| verified = true; | ||
| } | ||
|
|
||
| async function prepare(pluginConfig, context) { | ||
| export async function prepare(pluginConfig, context) { | ||
| if (!verified) { | ||
| verifyGit(pluginConfig); | ||
| verified = true; | ||
| } | ||
|
|
||
| await prepareGit(pluginConfig, context); | ||
| } | ||
|
|
||
| module.exports = {verifyConditions, prepare}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| const SemanticReleaseError = require('@semantic-release/error'); | ||
| const ERROR_DEFINITIONS = require('./definitions/errors.js'); | ||
| import SemanticReleaseError from "@semantic-release/error"; | ||
| import ERROR_DEFINITIONS from "./definitions/errors.js"; | ||
|
|
||
| module.exports = (code, ctx) => { | ||
| const {message, details} = ERROR_DEFINITIONS[code](ctx); | ||
| export default function getError(code, ctx) { | ||
| const { message, details } = ERROR_DEFINITIONS[code](ctx); | ||
| return new SemanticReleaseError(message, code, details); | ||
| }; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.