Skip to content

Commit 6926407

Browse files
authored
chore(deps): update deps and dev deps (#669)
- Update the dependencies and developer dependencies to their latest versions. - Remove the `rimraf` dependency in favor of the built-in `fs.rmSync()` method. - Remove deprecated `eslint-plugin-standard` developer dependency as it's no longer needed.
1 parent 01d10df commit 6926407

File tree

6 files changed

+35
-40
lines changed

6 files changed

+35
-40
lines changed

lib/auth.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import fs from 'node:fs';
22
import { ClientRequest } from 'node:http';
3-
import util from 'node:util';
43

5-
import ghauthBase from 'ghauth';
4+
import ghauth from 'ghauth';
65

76
import { getMergedConfig, getNcurcPath } from './config.js';
87

9-
const ghauth = util.promisify(ghauthBase);
10-
118
export default lazy(auth);
129

1310
function errorExit(message) {
@@ -50,7 +47,8 @@ async function tryCreateGitHubToken(githubAuth) {
5047
credentials = await githubAuth({
5148
noSave: true,
5249
scopes: ['user:email', 'read:org'],
53-
note: 'node-core-utils CLI tools'
50+
note: 'node-core-utils CLI tools',
51+
noDeviceFlow: true
5452
});
5553
} catch (e) {
5654
errorExit(`Could not get token: ${e.message}`);

lib/session.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import path from 'node:path';
22
import fs from 'node:fs';
33

4-
import rimraf from 'rimraf';
5-
64
import { getMergedConfig, getNcuDir } from './config.js';
75
import { readJson, writeJson, readFile, writeFile } from './file.js';
86
import {
@@ -148,13 +146,13 @@ export default class Session {
148146
try {
149147
sess = this.session;
150148
} catch (err) {
151-
return rimraf.sync(this.sessionPath);
149+
return fs.rmSync(this.sessionPath, { recursive: true, force: true });
152150
}
153151

154152
if (sess.prid && sess.prid === this.prid) {
155-
rimraf.sync(this.pullDir);
153+
fs.rmSync(this.pullDir, { recursive: true, force: true });
156154
}
157-
rimraf.sync(this.sessionPath);
155+
fs.rmSync(this.sessionPath, { recursive: true, force: true });
158156
}
159157

160158
get statusPath() {

package.json

+19-21
Original file line numberDiff line numberDiff line change
@@ -34,38 +34,36 @@
3434
],
3535
"license": "MIT",
3636
"dependencies": {
37-
"branch-diff": "^1.10.5",
38-
"chalk": "^5.0.1",
39-
"changelog-maker": "^2.8.0",
37+
"branch-diff": "^2.1.0",
38+
"chalk": "^5.2.0",
39+
"changelog-maker": "^3.2.1",
4040
"cheerio": "^1.0.0-rc.10",
4141
"clipboardy": "^3.0.0",
42-
"core-validate-commit": "^3.16.0",
42+
"core-validate-commit": "^3.18.0",
4343
"enquirer": "^2.3.6",
44-
"execa": "^6.1.0",
45-
"figures": "^4.0.1",
44+
"execa": "^7.0.0",
45+
"figures": "^5.0.0",
4646
"form-data": "^4.0.0",
47-
"ghauth": "^4.0.0",
48-
"inquirer": "^8.2.4",
49-
"listr2": "^4.0.5",
47+
"ghauth": "^5.0.1",
48+
"inquirer": "^9.1.4",
49+
"listr2": "^5.0.7",
5050
"lodash": "^4.17.21",
5151
"log-symbols": "^5.1.0",
52-
"ora": "^6.1.0",
52+
"ora": "^6.1.2",
5353
"proxy-agent": "^5.0.0",
54-
"replace-in-file": "^6.3.2",
55-
"rimraf": "^3.0.2",
54+
"replace-in-file": "^6.3.5",
5655
"undici": "^5.20.0",
57-
"which": "^2.0.2",
58-
"yargs": "^17.5.0"
56+
"which": "^3.0.0",
57+
"yargs": "^17.7.1"
5958
},
6059
"devDependencies": {
61-
"c8": "^7.11.2",
62-
"eslint": "^8.15.0",
60+
"c8": "^7.13.0",
61+
"eslint": "^8.35.0",
6362
"eslint-config-standard": "^17.0.0",
64-
"eslint-plugin-import": "^2.26.0",
63+
"eslint-plugin-import": "^2.27.5",
6564
"eslint-plugin-node": "^11.1.0",
66-
"eslint-plugin-promise": "^6.0.0",
67-
"eslint-plugin-standard": "^4.1.0",
68-
"mocha": "^10.0.0",
69-
"sinon": "^14.0.0"
65+
"eslint-plugin-promise": "^6.1.1",
66+
"mocha": "^10.2.0",
67+
"sinon": "^15.0.1"
7068
}
7169
}

test/common.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ import path from 'node:path';
22
import fs from 'node:fs';
33
import { fileURLToPath } from 'node:url';
44

5-
import rimraf from 'rimraf';
6-
75
const tmpdirPath = fileURLToPath(new URL('tmp', import.meta.url));
86

97
export const tmpdir = {
108
get path() {
119
return tmpdirPath;
1210
},
1311
refresh() {
14-
rimraf.sync(this.path);
12+
fs.rmSync(this.path, { recursive: true, force: true });
1513
fs.mkdirSync(this.path, { recursive: true });
1614
}
1715
};

test/fixtures/run-auth-github.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ async function mockCredentials(options) {
44
assert.deepStrictEqual(options, {
55
noSave: true,
66
scopes: ['user:email', 'read:org'],
7-
note: 'node-core-utils CLI tools'
7+
note: 'node-core-utils CLI tools',
8+
noDeviceFlow: true
89
});
910
return {
1011
user: 'nyancat',

test/unit/auth.test.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import fs from 'node:fs';
44
import { fileURLToPath } from 'node:url';
55
import assert from 'node:assert';
66

7-
import rimraf from 'rimraf';
8-
97
let testCounter = 0; // for tmp directories
108

119
const FIRST_TIME_MSG =
@@ -136,7 +134,7 @@ function runAuthScript(
136134
if (ncurc[envVar] === undefined) continue;
137135
newEnv[envVar] =
138136
fileURLToPath(new URL(`tmp-${testCounter++}`, import.meta.url));
139-
rimraf.sync(newEnv[envVar]);
137+
fs.rmSync(newEnv[envVar], { recursive: true, force: true });
140138
fs.mkdirSync(newEnv[envVar], { recursive: true });
141139

142140
const ncurcPath = path.resolve(newEnv[envVar],
@@ -169,8 +167,12 @@ function runAuthScript(
169167
try {
170168
assert.strictEqual(stderr, error);
171169
assert.strictEqual(expect.length, 0);
172-
if (newEnv.HOME) rimraf.sync(newEnv.HOME);
173-
if (newEnv.XDG_CONFIG_HOME) rimraf.sync(newEnv.XDG_CONFIG_HOME);
170+
if (newEnv.HOME) {
171+
fs.rmSync(newEnv.HOME, { recursive: true, force: true });
172+
}
173+
if (newEnv.XDG_CONFIG_HOME) {
174+
fs.rmSync(newEnv.XDG_CONFIG_HOME, { recursive: true, force: true });
175+
}
174176
} catch (err) {
175177
reject(err);
176178
}

0 commit comments

Comments
 (0)