Skip to content
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

Replace unmaintained uid-number package with passwd-user. #124

Merged
merged 3 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ jobs:
cd test
npm run coverage-ci
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: ./test/coverage/lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# `@bedrock/core` ChangeLog

## 6.1.4 - 2024-10-dd

### Fixed
- Replace unmaintained `uid-number` package with `passwd-user`.

## 6.1.3 - 2024-03-06

### Fixed
Expand Down
6 changes: 2 additions & 4 deletions lib/loggers/fileLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@
import * as formatters from './formatters.js';
import {config} from '../config.js';
import {promises as fs} from 'node:fs';
import {passwdUser} from 'passwd-user';
import path from 'node:path';
import {promisify} from 'node:util';
import uidNumber from 'uid-number';
import winston from 'winston';

const cc = brUtil.config.main.computer();
const getUserId = promisify(uidNumber);

// config filenames
// configured here instead of config.js due to util dependency issues
Expand Down Expand Up @@ -89,7 +87,7 @@
uid = process.getuid();
} else {
try {
uid = await getUserId(uid);
({userIdentifier: uid} = await passwdUser(uid));

Check warning on line 90 in lib/loggers/fileLogger.js

View check run for this annotation

Codecov / codecov/patch

lib/loggers/fileLogger.js#L90

Added line #L90 was not covered by tests
} catch(e) {
throw new brUtil.BedrockError(
`Unable to convert user "${uid}" to a numeric user id. ` +
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
"commander": "^9.2.0",
"cycle": "^1.0.3",
"fast-safe-stringify": "^2.1.1",
"passwd-user": "^4.0.0",
"serialize-error": "^10.0.0",
"triple-beam": "^1.3.0",
"uid-number": "^0.0.6",
"winston": "^3.7.2",
"winston-transport": "^4.5.0"
},
"devDependencies": {
"eslint": "^8.57.0",
"eslint-config-digitalbazaar": "^5.0.1",
"eslint-plugin-jsdoc": "^48.2.0",
"eslint-plugin-unicorn": "^51.0.1",
"eslint-plugin-jsdoc": "^50.4.1",
"eslint-plugin-unicorn": "^56.0.0",
"jsdoc": "^4.0.2",
"jsdoc-to-markdown": "^8.0.1"
"jsdoc-to-markdown": "^9.0.2"
},
"engines": {
"node": ">=18"
Expand Down