feat(esm): convert to esm (#2569)
for #2543 BREAKING CHANGE: semantic-release is now ESM-only. since it is used through its own executable, the impact on consuming projects should be minimal BREAKING CHANGE: references to plugin files in configs need to include the file extension because of executing in an ESM context
This commit is contained in:
Vendored
+1
-1
@@ -1 +1 @@
|
||||
module.exports = () => {};
|
||||
export default () => {}
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
const SemanticReleaseError = require('@semantic-release/error');
|
||||
import SemanticReleaseError from '@semantic-release/error';
|
||||
|
||||
class InheritedError extends SemanticReleaseError {
|
||||
constructor(message, code) {
|
||||
@@ -9,6 +9,6 @@ class InheritedError extends SemanticReleaseError {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = () => {
|
||||
export default () => {
|
||||
throw new InheritedError('Inherited error', 'EINHERITED');
|
||||
};
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -1,5 +1,5 @@
|
||||
module.exports = () => {
|
||||
export default () => {
|
||||
const error = new Error('a');
|
||||
error.errorProperty = 'errorProperty';
|
||||
throw error;
|
||||
};
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -1,5 +1,5 @@
|
||||
const AggregateError = require('aggregate-error');
|
||||
import AggregateError from 'aggregate-error';
|
||||
|
||||
module.exports = () => {
|
||||
export default () => {
|
||||
throw new AggregateError([new Error('a'), new Error('b')]);
|
||||
};
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
module.exports = (pluginConfig, context) => context;
|
||||
export default (pluginConfig, context) => context
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
module.exports = (pluginConfig, {env, logger}) => {
|
||||
export default (pluginConfig, {env, logger}) => {
|
||||
console.log(`Console: Exposing token ${env.MY_TOKEN}`);
|
||||
logger.log(`Log: Exposing token ${env.MY_TOKEN}`);
|
||||
logger.error(`Error: Console token ${env.MY_TOKEN}`);
|
||||
throw new Error(`Throw error: Exposing ${env.MY_TOKEN}`);
|
||||
};
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
module.exports = (pluginConfig, context) => ({pluginConfig, context});
|
||||
export default (pluginConfig, context) => ({pluginConfig, context})
|
||||
|
||||
Reference in New Issue
Block a user