Skip to content

Commit 082a14e

Browse files
authored
Merge pull request #26 from commenthol/chore-bump
Chore bump
2 parents 2b52bd9 + f3931fe commit 082a14e

22 files changed

+99
-76
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://github.com/marketplace/actions/setup-node-js-environment
1+
# @see: https://github.com/marketplace/actions/setup-node-js-environment
32

43
name: CI
54

@@ -17,14 +16,14 @@ jobs:
1716
runs-on: ubuntu-latest
1817
strategy:
1918
matrix:
20-
node-version: [18.x, 20.x]
21-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
19+
node: [ 20 ]
20+
name: Node ${{ matrix.node }}
2221
steps:
23-
- uses: actions/checkout@v3
24-
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v3
26-
with:
27-
node-version: ${{ matrix.node-version }}
28-
# cache: 'npm'
29-
- run: npm install --ignore-scripts
30-
- run: npm run all
22+
- uses: actions/checkout@v4
23+
- name: Setup node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ matrix.node }}
27+
- run: npm version
28+
- run: npm install --ignore-scripts
29+
- run: npm run all

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ tmp/
1111
package-lock.json
1212
yarn.lock
1313
pnpm-lock.yaml
14+
15+
.env*

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> debug with levels
44
55
[![NPM version](https://badge.fury.io/js/debug-level.svg)](https://www.npmjs.com/package/debug-level/)
6-
[![Build Status](https://github.com/commenthol/debug-level/workflows/CI/badge.svg?branch=main&event=push)](https://github.com/commenthol/debug-level/actions/workflows/ci.yml?query=branch%3Amain)
6+
[![CI](https://github.com/commenthol/debug-level/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/commenthol/debug-level/actions/workflows/ci.yml)
77

88
A universal JavaScript logging/ debugging utility which works in node and
99
browsers.

package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
"example": "npm run build:example && npm run start:example",
6161
"changelog": "conv-changelog -i CHANGELOG.md -o",
6262
"lint": "eslint --ext .js .",
63-
"prepublishOnly": "npm run all",
6463
"readme": "markedpp --github -i README.md -o README.md",
6564
"start:example": "DEBUG=* node examples/app/server.cjs",
6665
"test": "mocha",
@@ -79,15 +78,15 @@
7978
"flatstr": "^1.0.12",
8079
"map-lru": "^2.0.0",
8180
"ms": "^2.1.3",
82-
"sonic-boom": "^3.8.0"
81+
"sonic-boom": "^4.0.1"
8382
},
8483
"devDependencies": {
85-
"@babel/cli": "^7.23.9",
86-
"@babel/core": "^7.24.0",
87-
"@babel/preset-env": "^7.24.0",
84+
"@babel/cli": "^7.24.8",
85+
"@babel/core": "^7.24.9",
86+
"@babel/preset-env": "^7.24.8",
8887
"assert": "^2.1.0",
8988
"babel-loader": "^9.1.3",
90-
"c8": "^9.1.0",
89+
"c8": "^10.1.2",
9190
"conv-changelog": "^1.0.0",
9291
"eslint": "^8.57.0",
9392
"eslint-config-standard": "^17.1.0",
@@ -102,13 +101,13 @@
102101
"karma-sourcemap-loader": "^0.4.0",
103102
"karma-spec-reporter": "^0.0.36",
104103
"karma-webpack": "^5.0.1",
105-
"mocha": "^10.3.0",
106-
"npm-run-all2": "^6.1.2",
107-
"rimraf": "^5.0.5",
108-
"rollup": "^4.13.0",
109-
"sinon": "^17.0.1",
110-
"typescript": "^5.4.2",
111-
"webpack": "^5.90.3",
104+
"mocha": "^10.7.0",
105+
"npm-run-all2": "^6.2.2",
106+
"rimraf": "^6.0.1",
107+
"rollup": "^4.19.0",
108+
"sinon": "^18.0.0",
109+
"typescript": "^5.5.3",
110+
"webpack": "^5.93.0",
112111
"webpack-cli": "^5.1.4"
113112
},
114113
"optionalDependencies": {

src/Format.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,22 @@ export class Format {
2626
}
2727

2828
_formatOpts () {
29+
/**
30+
* @param {any} any
31+
* @returns {string}
32+
*/
33+
// @ts-expect-error
34+
const stringify = (any) => fastStringify(any, null, this.opts.spaces)
2935
this.formatOpts = {
30-
// @ts-expect-error
31-
stringify: (o) => fastStringify(o, null, this.opts.spaces),
36+
stringify,
3237
spaces: this.opts.spaces
3338
}
3439
}
3540

41+
/**
42+
* @param {...any} args
43+
* @returns {string}
44+
*/
3645
stringify (...args) {
3746
// @ts-expect-error
3847
return fastStringify(...args)

src/LogBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const time = {
1313
}
1414

1515
/**
16-
* @typedef {import('./utils').Level} Level
16+
* @typedef {import('./utils.js').Level} Level
1717
*
1818
* @typedef {object} ExtLogBaseOptions
1919
* @property {Level} [level] log level

src/Sonic.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export class Sonic {
3030

3131
const { fd, path } = streamDescriptor(stream)
3232

33+
/** @type {import('sonic-boom').SonicBoom} */
34+
// @ts-expect-error
3335
this.stream = new SonicBoom({ fd, dest: path, minLength, sync: true })
3436
this.stream.on('error', filterBrokenPipe.bind(null, this.stream))
3537

@@ -90,10 +92,13 @@ export class SonicStreams extends Map {
9092
* @returns {string}
9193
*/
9294
static hash (opts) {
93-
return 'sonic!' + Object.keys(opts || {})
94-
.sort()
95-
.map((key) => `${key}:${opts[key]}`)
96-
.join('!')
95+
return (
96+
'sonic!' +
97+
Object.keys(opts || {})
98+
.sort()
99+
.map((key) => `${key}:${opts[key]}`)
100+
.join('!')
101+
)
97102
}
98103

99104
/**

src/browser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import { wrapConsole } from './wrapConsole.js'
1616
import { errSerializer } from './serializers/err.js'
1717

1818
/**
19-
* @typedef {import('./utils').Level} Level
20-
* @typedef {import('./LogBase').LogBaseOptions} LogBaseOptions
19+
* @typedef {import('./utils.js').Level} Level
20+
* @typedef {import('./LogBase.js').LogBaseOptions} LogBaseOptions
2121
*
2222
* @typedef {object} ExtLogOptionsBrowser
2323
* @property {string} [url] url to report errors

src/httpLogs.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export function httpLogs (namespace, opts) {
4040
}
4141
options.serializers = {
4242
...serializers,
43-
// @ts-expect-error
4443
...(options.Log.serializers || {}),
4544
...(options.serializers || {})
4645
}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @typedef {import('./utils').Level} Level */
1+
/** @typedef {import('./utils.js').Level} Level */
22
/** @typedef {import('./node.js').LogOptions & {Log: typeof Log}} LogOptions */
33
/** @typedef {import('./node.js').LogOptionWrapConsole} LogOptionWrapConsole */
44
/** @typedef {import('./node.js').LogOptionHandleExitEvents} LogOptionHandleExitEvents */

0 commit comments

Comments
 (0)