Skip to content

Commit

Permalink
[BREAKING] Transform to native ESM (#306)
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
This package has been transformed to native ESM. Therefore it no longer provides a CommonJS export.
If your project uses CommonJS, it needs to be converted to ESM or use a dynamic import.

For more information see also:
- https://sap.github.io/ui5-tooling/updates/migrate-v3/
- https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

Co-authored-by: Matthias Osswald <[email protected]>
Co-authored-by: Florian Vogt <[email protected]>
  • Loading branch information
3 people authored Oct 24, 2022
1 parent dc56600 commit c79608b
Show file tree
Hide file tree
Showing 10 changed files with 1,514 additions and 2,563 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
"parserOptions": {
"sourceType": "module",
},
"env": {
"node": true,
"es2021": true
Expand Down Expand Up @@ -71,7 +74,8 @@ module.exports = {
"settings": {
"jsdoc": {
"tagNamePreference": {
"return": "returns"
"return": "returns",
"augments": "extends"
}
}
},
Expand Down
5 changes: 0 additions & 5 deletions index.js

This file was deleted.

9 changes: 9 additions & 0 deletions jsdoc-plugin.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* This plugin fixes unexpected JSDoc behavior that prevents us from using types that start with an at-sign (@).
* JSDoc doesn't see "{@" as a valid type expression, probably as there's also {@link ...}.
*/
exports.handlers = {
jsdocCommentFound: function(e) {
e.comment = e.comment.replace(/{@ui5\//g, "{ @ui5/");
}
};
13 changes: 0 additions & 13 deletions jsdoc-plugin.js

This file was deleted.

4 changes: 2 additions & 2 deletions jsdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"allowUnknownTags": false
},
"source": {
"include": ["README.md", "index.js"],
"include": ["README.md"],
"includePattern": ".+\\.js$",
"excludePattern": "(node_modules(\\\\|/))"
},
"plugins": [
"./jsdoc-plugin"
"jsdoc-plugin.cjs"
],
"opts": {
"encoding": "utf8",
Expand Down
5 changes: 3 additions & 2 deletions lib/logger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const npmlog = require("npmlog");
import npmlog from "npmlog";

const levels = ["silly", "verbose", "perf", "info", "warn", "error", "silent"];
if (process.env.UI5_LOG_LVL) {
Expand Down Expand Up @@ -160,10 +160,11 @@ const logger = {
};

// Export internal classes for testing only
/* istanbul ignore else */
if (process.env.NODE_ENV === "test") {
logger.__test__ = {
Logger, GroupLogger, TaskLogger
};
}

module.exports = logger;
export default logger;
Loading

0 comments on commit c79608b

Please sign in to comment.