diff --git a/lib/auth.js b/lib/auth.js index 481d5b8f..6a76a16e 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -50,7 +50,8 @@ async function tryCreateGitHubToken(githubAuth) { credentials = await githubAuth({ noSave: true, scopes: ['user:email', 'read:org'], - note: 'node-core-utils CLI tools' + note: 'node-core-utils CLI tools', + noDeviceFlow: true }); } catch (e) { errorExit(`Could not get token: ${e.message}`); diff --git a/lib/session.js b/lib/session.js index 18256c56..b59005ff 100644 --- a/lib/session.js +++ b/lib/session.js @@ -1,7 +1,7 @@ import path from 'node:path'; import fs from 'node:fs'; -import rimraf from 'rimraf'; +import { rimrafSync } from 'rimraf'; import { getMergedConfig, getNcuDir } from './config.js'; import { readJson, writeJson, readFile, writeFile } from './file.js'; @@ -148,13 +148,13 @@ export default class Session { try { sess = this.session; } catch (err) { - return rimraf.sync(this.sessionPath); + return rimrafSync(this.sessionPath); } if (sess.prid && sess.prid === this.prid) { - rimraf.sync(this.pullDir); + rimrafSync(this.pullDir); } - rimraf.sync(this.sessionPath); + rimrafSync(this.sessionPath); } get statusPath() { diff --git a/package.json b/package.json index b419bd43..7d8e5224 100644 --- a/package.json +++ b/package.json @@ -34,38 +34,37 @@ ], "license": "MIT", "dependencies": { - "branch-diff": "^1.10.5", - "chalk": "^5.0.1", - "changelog-maker": "^2.8.0", + "branch-diff": "^2.1.0", + "chalk": "^5.2.0", + "changelog-maker": "^3.2.1", "cheerio": "^1.0.0-rc.10", "clipboardy": "^3.0.0", - "core-validate-commit": "^3.16.0", + "core-validate-commit": "^3.18.0", "enquirer": "^2.3.6", - "execa": "^6.1.0", - "figures": "^4.0.1", + "execa": "^7.0.0", + "figures": "^5.0.0", "form-data": "^4.0.0", - "ghauth": "^4.0.0", - "inquirer": "^8.2.4", - "listr2": "^4.0.5", + "ghauth": "^5.0.1", + "inquirer": "^9.1.4", + "listr2": "^5.0.7", "lodash": "^4.17.21", "log-symbols": "^5.1.0", - "ora": "^6.1.0", + "ora": "^6.1.2", "proxy-agent": "^5.0.0", - "replace-in-file": "^6.3.2", - "rimraf": "^3.0.2", + "replace-in-file": "^6.3.5", + "rimraf": "^4.1.2", "undici": "^5.20.0", - "which": "^2.0.2", - "yargs": "^17.5.0" + "which": "^3.0.0", + "yargs": "^17.7.1" }, "devDependencies": { - "c8": "^7.11.2", - "eslint": "^8.15.0", + "c8": "^7.13.0", + "eslint": "^8.34.0", "eslint-config-standard": "^17.0.0", - "eslint-plugin-import": "^2.26.0", + "eslint-plugin-import": "^2.27.5", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^6.0.0", - "eslint-plugin-standard": "^4.1.0", - "mocha": "^10.0.0", - "sinon": "^14.0.0" + "eslint-plugin-promise": "^6.1.1", + "mocha": "^10.2.0", + "sinon": "^15.0.1" } } diff --git a/test/common.js b/test/common.js index 464883b8..5b3ad369 100644 --- a/test/common.js +++ b/test/common.js @@ -2,7 +2,7 @@ import path from 'node:path'; import fs from 'node:fs'; import { fileURLToPath } from 'node:url'; -import rimraf from 'rimraf'; +import { rimrafSync } from 'rimraf'; const tmpdirPath = fileURLToPath(new URL('tmp', import.meta.url)); @@ -11,7 +11,7 @@ export const tmpdir = { return tmpdirPath; }, refresh() { - rimraf.sync(this.path); + rimrafSync(this.path); fs.mkdirSync(this.path, { recursive: true }); } }; diff --git a/test/fixtures/run-auth-github.js b/test/fixtures/run-auth-github.js index 25cd4bb2..d7151ea6 100644 --- a/test/fixtures/run-auth-github.js +++ b/test/fixtures/run-auth-github.js @@ -4,7 +4,8 @@ async function mockCredentials(options) { assert.deepStrictEqual(options, { noSave: true, scopes: ['user:email', 'read:org'], - note: 'node-core-utils CLI tools' + note: 'node-core-utils CLI tools', + noDeviceFlow: true }); return { user: 'nyancat', diff --git a/test/unit/auth.test.js b/test/unit/auth.test.js index d933d4ca..0722dffa 100644 --- a/test/unit/auth.test.js +++ b/test/unit/auth.test.js @@ -4,7 +4,7 @@ import fs from 'node:fs'; import { fileURLToPath } from 'node:url'; import assert from 'node:assert'; -import rimraf from 'rimraf'; +import { rimrafSync } from 'rimraf'; let testCounter = 0; // for tmp directories @@ -136,7 +136,7 @@ function runAuthScript( if (ncurc[envVar] === undefined) continue; newEnv[envVar] = fileURLToPath(new URL(`tmp-${testCounter++}`, import.meta.url)); - rimraf.sync(newEnv[envVar]); + rimrafSync(newEnv[envVar]); fs.mkdirSync(newEnv[envVar], { recursive: true }); const ncurcPath = path.resolve(newEnv[envVar], @@ -169,8 +169,8 @@ function runAuthScript( try { assert.strictEqual(stderr, error); assert.strictEqual(expect.length, 0); - if (newEnv.HOME) rimraf.sync(newEnv.HOME); - if (newEnv.XDG_CONFIG_HOME) rimraf.sync(newEnv.XDG_CONFIG_HOME); + if (newEnv.HOME) rimrafSync(newEnv.HOME); + if (newEnv.XDG_CONFIG_HOME) rimrafSync(newEnv.XDG_CONFIG_HOME); } catch (err) { reject(err); }