@ui5/logger 3.0.0-alpha.0 → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.reuse/dep5 CHANGED
@@ -25,5 +25,5 @@ Disclaimer: The code in this project may include calls to APIs (“API Calls”)
25
25
  parties the right to use of access any SAP External Product, through API Calls.
26
26
 
27
27
  Files: *
28
- Copyright: 2018-2020 SAP SE or an SAP affiliate company and UI5 Tooling contributors
28
+ Copyright: 2018-2022 SAP SE or an SAP affiliate company and UI5 Tooling contributors
29
29
  License: Apache-2.0
package/CHANGELOG.md CHANGED
@@ -2,14 +2,52 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
4
4
 
5
- A list of unreleased changes can be found [here](https://github.com/SAP/ui5-logger/compare/v3.0.0-alpha.0...HEAD).
5
+ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-logger/compare/v3.0.0-beta.1...HEAD).
6
6
 
7
- <a name="v3.0.0-alpha.0"></a>
8
- ## [v3.0.0-alpha.0] - 2021-12-14
7
+ <a name="v3.0.0-beta.1"></a>
8
+ ## [v3.0.0-beta.1] - 2022-11-04
9
+
10
+ <a name="v3.0.1-alpha.3"></a>
11
+ ## [v3.0.1-alpha.3] - 2022-10-24
12
+ ### Breaking Changes
13
+ - Transform to native ESM ([#306](https://github.com/SAP/ui5-logger/issues/306)) [`c79608b`](https://github.com/SAP/ui5-logger/commit/c79608b0e432168ca8570530b63a456b9ddd12cb)
14
+
15
+ ### BREAKING CHANGE
16
+
17
+ This package has been transformed to native ESM. Therefore it no longer provides a CommonJS export.
18
+ If your project uses CommonJS, it needs to be converted to ESM or use a dynamic import.
19
+
20
+ For more information see also:
21
+ - https://sap.github.io/ui5-tooling/updates/migrate-v3/
22
+ - https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
23
+
24
+
25
+ <a name="v3.0.1-alpha.2"></a>
26
+ ## [v3.0.1-alpha.2] - 2022-07-28
27
+ ### Features
28
+ - Add new log level "perf" [`acf0c71`](https://github.com/SAP/ui5-logger/commit/acf0c717612f440ea7a114e757c05d358ae523a7)
29
+
30
+
31
+ <a name="v3.0.1-alpha.1"></a>
32
+ ## [v3.0.1-alpha.1] - 2022-01-25
33
+ ### Breaking Changes
34
+ - Require Node.js >= 16.13.2 / npm >= 8 [`a8af8a7`](https://github.com/SAP/ui5-logger/commit/a8af8a7a82c6f657ac10b5018e654939d90fd81f)
35
+
36
+ ### BREAKING CHANGE
37
+
38
+ Support for older Node.js and npm releases has been dropped.
39
+ Only Node.js v16.13.2 and npm v8 or higher are supported.
40
+
41
+
42
+ <a name="v3.0.1-alpha.0"></a>
43
+ ## [v3.0.1-alpha.0] - 2021-12-14
9
44
 
10
45
  <a name="v3.0.0-next.0"></a>
11
46
  ## [v3.0.0-next.0] - 2021-11-29
12
47
 
48
+ <a name="v3.0.0-alpha.0"></a>
49
+ ## [v3.0.0-alpha.0] - 2021-12-14
50
+
13
51
  <a name="v2.0.1"></a>
14
52
  ## [v2.0.1] - 2020-10-22
15
53
  ### Bug Fixes
@@ -57,8 +95,13 @@ Only Node.js v10 or higher is supported.
57
95
  <a name="v0.0.1"></a>
58
96
  ## v0.0.1 - 2018-06-06
59
97
 
60
- [v3.0.0-alpha.0]: https://github.com/SAP/ui5-logger/compare/v3.0.0-next.0...v3.0.0-alpha.0
61
- [v3.0.0-next.0]: https://github.com/SAP/ui5-logger/compare/v2.0.1...v3.0.0-next.0
98
+ [v3.0.0-beta.1]: https://github.com/SAP/ui5-logger/compare/v3.0.1-alpha.3...v3.0.0-beta.1
99
+ [v3.0.1-alpha.3]: https://github.com/SAP/ui5-logger/compare/v3.0.1-alpha.2...v3.0.1-alpha.3
100
+ [v3.0.1-alpha.2]: https://github.com/SAP/ui5-logger/compare/v3.0.1-alpha.1...v3.0.1-alpha.2
101
+ [v3.0.1-alpha.1]: https://github.com/SAP/ui5-logger/compare/v3.0.1-alpha.0...v3.0.1-alpha.1
102
+ [v3.0.1-alpha.0]: https://github.com/SAP/ui5-logger/compare/v3.0.0-next.0...v3.0.1-alpha.0
103
+ [v3.0.0-next.0]: https://github.com/SAP/ui5-logger/compare/v3.0.0-alpha.0...v3.0.0-next.0
104
+ [v3.0.0-alpha.0]: https://github.com/SAP/ui5-logger/compare/v2.0.1...v3.0.0-alpha.0
62
105
  [v2.0.1]: https://github.com/SAP/ui5-logger/compare/v2.0.0...v2.0.1
63
106
  [v2.0.0]: https://github.com/SAP/ui5-logger/compare/v1.0.2...v2.0.0
64
107
  [v1.0.2]: https://github.com/SAP/ui5-logger/compare/v1.0.1...v1.0.2
package/CONTRIBUTING.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # Contributing to the UI5 Tooling
2
2
 
3
- See CONTRIBUTING.md in the [SAP/ui5-tooling](https://github.com/SAP/ui5-tooling/blob/master/CONTRIBUTING.md) repository.
3
+ See CONTRIBUTING.md in the [SAP/ui5-tooling](https://github.com/SAP/ui5-tooling/blob/main/CONTRIBUTING.md) repository.
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
- ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-tooling/master/docs/images/UI5_logo_wide.png)
1
+ ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-tooling/main/docs/images/UI5_logo_wide.png)
2
2
 
3
3
  # ui5-logger
4
4
  > Internal logging module
5
5
  > Part of the [UI5 Tooling](https://github.com/SAP/ui5-tooling)
6
6
 
7
7
  [![REUSE status](https://api.reuse.software/badge/github.com/SAP/ui5-logger)](https://api.reuse.software/info/github.com/SAP/ui5-logger)
8
- [![Build Status](https://dev.azure.com/sap/opensource/_apis/build/status/SAP.ui5-logger?branchName=master)](https://dev.azure.com/sap/opensource/_build/latest?definitionId=37&branchName=master)
8
+ [![Build Status](https://dev.azure.com/sap/opensource/_apis/build/status/SAP.ui5-logger?branchName=main)](https://dev.azure.com/sap/opensource/_build/latest?definitionId=37&branchName=main)
9
9
  [![npm Package Version](https://badge.fury.io/js/%40ui5%2Flogger.svg)](https://www.npmjs.com/package/@ui5/logger)
10
10
 
11
11
  ## Documentation
@@ -15,10 +15,10 @@ General documentation can of the UI5 Tooling can be found here: [sap.github.io/u
15
15
  Used for logging purposes across the UI5 Tooling and plugins. Features log levels and progress logging. Basically, it is a wrapper of [npmlog](https://github.com/npm/npmlog).
16
16
 
17
17
  ## Contributing
18
- Please check our [Contribution Guidelines](https://github.com/SAP/ui5-tooling/blob/master/CONTRIBUTING.md).
18
+ Please check our [Contribution Guidelines](https://github.com/SAP/ui5-tooling/blob/main/CONTRIBUTING.md).
19
19
 
20
20
  ## Support
21
- Please follow our [Contribution Guidelines](https://github.com/SAP/ui5-tooling/blob/master/CONTRIBUTING.md#report-an-issue) on how to report an issue.
21
+ Please follow our [Contribution Guidelines](https://github.com/SAP/ui5-tooling/blob/main/CONTRIBUTING.md#report-an-issue) on how to report an issue.
22
22
 
23
23
  Please report issues in the main [UI5 Tooling](https://github.com/SAP/ui5-tooling) repository.
24
24
 
package/jsdoc.json CHANGED
@@ -1,60 +1,61 @@
1
1
  {
2
- "tags": {
3
- "allowUnknownTags": false
4
- },
5
- "source": {
6
- "include": ["README.md", "index.js"],
7
- "includePattern": ".+\\.js$",
8
- "excludePattern": "(node_modules(\\\\|/))"
9
- },
10
- "plugins": [],
11
- "opts": {
12
- "template": "node_modules/docdash/",
13
- "encoding": "utf8",
14
- "destination": "jsdocs/",
15
- "recurse": true,
16
- "verbose": true,
17
- "access": "public"
18
- },
19
- "templates": {
20
- "cleverLinks": false,
21
- "monospaceLinks": false,
22
- "default": {
23
- "useLongnameInNav": true
24
- }
25
- },
26
- "openGraph": {
27
- "title": "UI5 Tooling - API Reference",
28
- "type": "website",
29
- "image": "https://sap.github.io/ui5-tooling/docs/images/UI5_logo_wide.png",
30
- "site_name": "UI5 Tooling - API Reference",
31
- "url": "https://sap.github.io/ui5-tooling/"
32
- },
33
- "docdash": {
34
- "sectionOrder": [
35
- "Modules",
36
- "Namespaces",
37
- "Classes",
38
- "Externals",
39
- "Events",
40
- "Mixins",
41
- "Tutorials",
42
- "Interfaces"
43
- ],
44
- "meta": {
45
- "title": "UI5 Tooling - API Reference - UI5 Logger",
46
- "description": "UI5 Tooling - API Reference - UI5 Logger",
47
- "keyword": "openui5 sapui5 ui5 build development tool api reference"
48
- },
49
- "search": true,
50
- "wrap": true,
51
- "menu": {
52
- "GitHub": {
53
- "href": "https://github.com/SAP/ui5-logger",
54
- "target": "_blank",
55
- "class": "menu-item",
56
- "id": "github_link"
57
- }
58
- }
59
- }
2
+ "tags": {
3
+ "allowUnknownTags": false
4
+ },
5
+ "source": {
6
+ "include": ["README.md"],
7
+ "includePattern": ".+\\.js$",
8
+ "excludePattern": "(node_modules(\\\\|/))"
9
+ },
10
+ "plugins": [
11
+ "jsdoc-plugin.cjs"
12
+ ],
13
+ "opts": {
14
+ "encoding": "utf8",
15
+ "destination": "jsdocs/",
16
+ "recurse": true,
17
+ "verbose": true,
18
+ "access": "public"
19
+ },
20
+ "templates": {
21
+ "cleverLinks": false,
22
+ "monospaceLinks": false,
23
+ "default": {
24
+ "useLongnameInNav": true
25
+ }
26
+ },
27
+ "openGraph": {
28
+ "title": "UI5 Tooling - API Reference",
29
+ "type": "website",
30
+ "image": "https://sap.github.io/ui5-tooling/docs/images/UI5_logo_wide.png",
31
+ "site_name": "UI5 Tooling - API Reference",
32
+ "url": "https://sap.github.io/ui5-tooling/"
33
+ },
34
+ "docdash": {
35
+ "sectionOrder": [
36
+ "Modules",
37
+ "Namespaces",
38
+ "Classes",
39
+ "Externals",
40
+ "Events",
41
+ "Mixins",
42
+ "Tutorials",
43
+ "Interfaces"
44
+ ],
45
+ "meta": {
46
+ "title": "UI5 Tooling - API Reference - UI5 Logger",
47
+ "description": "UI5 Tooling - API Reference - UI5 Logger",
48
+ "keyword": "openui5 sapui5 ui5 build development tool api reference"
49
+ },
50
+ "search": true,
51
+ "wrap": true,
52
+ "menu": {
53
+ "GitHub": {
54
+ "href": "https://github.com/SAP/ui5-logger",
55
+ "target": "_blank",
56
+ "class": "menu-item",
57
+ "id": "github_link"
58
+ }
59
+ }
60
+ }
60
61
  }
package/lib/logger.js CHANGED
@@ -1,6 +1,6 @@
1
- const npmlog = require("npmlog");
1
+ import npmlog from "npmlog";
2
2
 
3
- const levels = ["silly", "verbose", "info", "warn", "error", "silent"];
3
+ const levels = ["silly", "verbose", "perf", "info", "warn", "error", "silent"];
4
4
  if (process.env.UI5_LOG_LVL) {
5
5
  const logLvl = process.env.UI5_LOG_LVL;
6
6
  if (!levels.includes(logLvl)) {
@@ -12,7 +12,12 @@ if (process.env.UI5_LOG_LVL) {
12
12
  npmlog.level = "info"; // Our default
13
13
  }
14
14
 
15
- npmlog.enableUnicode();
15
+ npmlog.enableUnicode(); // TODO: Check whether unicode is actually supported
16
+ npmlog.prefixStyle = {fg: "blue"};
17
+ npmlog.headingStyle = {fg: "white", bg: "black"};
18
+
19
+ // Verbose is at level 1000, info at 2000
20
+ npmlog.addLevel("perf", 1500, {fg: "white", bg: "red"}, "PERF");
16
21
 
17
22
  npmlog.on("error", (err) => {
18
23
  console.log(err);
@@ -52,6 +57,10 @@ class Logger {
52
57
  return this._logger.verbose(this._moduleName, ...messages);
53
58
  }
54
59
 
60
+ perf(...messages) {
61
+ return this._logger.perf(this._moduleName, ...messages);
62
+ }
63
+
55
64
  info(...messages) {
56
65
  return this._logger.info(this._moduleName, ...messages);
57
66
  }
@@ -151,10 +160,11 @@ const logger = {
151
160
  };
152
161
 
153
162
  // Export internal classes for testing only
163
+ /* istanbul ignore else */
154
164
  if (process.env.NODE_ENV === "test") {
155
165
  logger.__test__ = {
156
166
  Logger, GroupLogger, TaskLogger
157
167
  };
158
168
  }
159
169
 
160
- module.exports = logger;
170
+ export default logger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/logger",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-beta.1",
4
4
  "description": "UI5 Tooling - Internal Logger",
5
5
  "author": {
6
6
  "name": "SAP SE",
@@ -16,10 +16,14 @@
16
16
  "development",
17
17
  "tool"
18
18
  ],
19
- "main": "index.js",
19
+ "type": "module",
20
+ "exports": {
21
+ ".": "./lib/logger.js",
22
+ "./package.json": "./package.json"
23
+ },
20
24
  "engines": {
21
- "node": ">= 10",
22
- "npm": ">= 5"
25
+ "node": ">= 16.13.2",
26
+ "npm": ">= 8"
23
27
  },
24
28
  "scripts": {
25
29
  "test": "npm run lint && npm run jsdoc-generate && npm run coverage && npm run depcheck",
@@ -27,23 +31,23 @@
27
31
  "lint": "eslint ./",
28
32
  "unit": "rimraf test/tmp && ava",
29
33
  "unit-verbose": "rimraf test/tmp && cross-env UI5_LOG_LVL=verbose ava --verbose --serial",
30
- "unit-watch": "rimraf test/tmp && ava --watch",
31
- "unit-nyan": "rimraf test/tmp && ava --tap | tnyan",
32
- "unit-xunit": "rimraf test/tmp && ava --tap | tap-xunit --dontUseCommentsAsTestNames=true > test-results.xml",
34
+ "unit-watch": "npm run unit -- --watch",
35
+ "unit-nyan": "npm run unit -- --tap | tnyan",
36
+ "unit-xunit": "rimraf test/tmp && ava --node-arguments=\"--experimental-loader=@istanbuljs/esm-loader-hook\" --tap | tap-xunit --dontUseCommentsAsTestNames=true > test-results.xml",
33
37
  "unit-inspect": "cross-env UI5_LOG_LVL=verbose ava debug --break",
34
- "coverage": "nyc npm run unit",
38
+ "coverage": "rimraf test/tmp && nyc ava --node-arguments=\"--experimental-loader=@istanbuljs/esm-loader-hook\"",
35
39
  "coverage-xunit": "nyc --reporter=text --reporter=text-summary --reporter=cobertura npm run unit-xunit",
36
40
  "jsdoc": "npm run jsdoc-generate && open-cli jsdocs/index.html",
37
- "jsdoc-generate": "node_modules/.bin/jsdoc -c ./jsdoc.json ./lib/ || (echo 'Error during JSDoc generation! Check log.' && exit 1)",
41
+ "jsdoc-generate": "jsdoc -c ./jsdoc.json -t $(node -p 'path.dirname(require.resolve(\"docdash\"))') ./lib/ || (echo 'Error during JSDoc generation! Check log.' && exit 1)",
38
42
  "jsdoc-watch": "npm run jsdoc && chokidar \"./lib/**/*.js\" -c \"npm run jsdoc-generate\"",
39
43
  "preversion": "npm test",
40
- "version": "git-chglog --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
44
+ "version": "git-chglog --sort semver --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
41
45
  "postversion": "git push --follow-tags",
42
- "release-note": "git-chglog -c .chglog/release-config.yml v$npm_package_version",
43
- "depcheck": "depcheck --ignores docdash"
46
+ "release-note": "git-chglog --sort semver -c .chglog/release-config.yml v$npm_package_version",
47
+ "depcheck": "depcheck --ignores docdash,@istanbuljs/esm-loader-hook"
44
48
  },
45
49
  "files": [
46
- "index.js",
50
+ "CHANGELOG.md",
47
51
  "CONTRIBUTING.md",
48
52
  "jsdoc.json",
49
53
  "lib/**",
@@ -53,6 +57,10 @@
53
57
  "ava": {
54
58
  "files": [
55
59
  "test/lib/**/*.js"
60
+ ],
61
+ "nodeArguments": [
62
+ "--loader=esmock",
63
+ "--no-warnings"
56
64
  ]
57
65
  },
58
66
  "nyc": {
@@ -66,8 +74,8 @@
66
74
  "jsdocs/**",
67
75
  "coverage/**",
68
76
  "test/**",
69
- ".eslintrc.js",
70
- "jsdoc-plugin.js"
77
+ ".eslintrc.cjs",
78
+ "jsdoc-plugin.cjs"
71
79
  ],
72
80
  "check-coverage": true,
73
81
  "statements": 90,
@@ -100,24 +108,25 @@
100
108
  "url": "git@github.com:SAP/ui5-logger.git"
101
109
  },
102
110
  "dependencies": {
103
- "npmlog": "^5.0.1"
111
+ "npmlog": "^6.0.2"
104
112
  },
105
113
  "devDependencies": {
106
- "ava": "^3.15.0",
114
+ "@istanbuljs/esm-loader-hook": "^0.2.0",
115
+ "ava": "^5.0.1",
107
116
  "chokidar-cli": "^3.0.0",
108
117
  "cross-env": "^7.0.3",
109
- "depcheck": "^1.4.2",
118
+ "depcheck": "^1.4.3",
110
119
  "docdash": "^1.2.0",
111
- "eslint": "^7.32.0",
120
+ "eslint": "^8.27.0",
112
121
  "eslint-config-google": "^0.14.0",
113
- "eslint-plugin-ava": "^13.1.0",
114
- "eslint-plugin-jsdoc": "^37.2.0",
122
+ "eslint-plugin-ava": "^13.2.0",
123
+ "eslint-plugin-jsdoc": "^39.6.2",
124
+ "esmock": "^2.0.7",
115
125
  "jsdoc": "^3.6.7",
116
- "mock-require": "^3.0.3",
117
126
  "nyc": "^15.1.0",
118
- "open-cli": "^6.0.1",
127
+ "open-cli": "^7.1.0",
119
128
  "rimraf": "^3.0.2",
120
- "sinon": "^11.1.2",
129
+ "sinon": "^14.0.0",
121
130
  "tap-nyan": "^1.1.0",
122
131
  "tap-xunit": "^2.4.1"
123
132
  }
package/index.js DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * @module @ui5/logger
3
- * @private
4
- */
5
- module.exports = require("./lib/logger");