Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@
},
"dependencies": {
"@metamask/action-utils": "^0.0.2",
"@metamask/utils": "^3.0.3",
"@metamask/utils": "^5.0.2",
"debug": "^4.3.4",
"execa": "^5.0.0",
"glob": "^8.0.3",
"pony-cause": "^2.1.0",
"semver": "^7.3.7",
"which": "^2.0.2",
"yaml": "^2.1.1",
"yargs": "^17.5.1"
"execa": "^5.1.1",
"glob": "^10.2.2",
"pony-cause": "^2.1.9",
"semver": "^7.5.0",
"which": "^3.0.0",
"yaml": "^2.2.2",
"yargs": "^17.7.1"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^2.0.3",
"@lavamoat/allow-scripts": "^2.3.1",
"@metamask/auto-changelog": "^3.0.0",
"@metamask/eslint-config": "^10.0.0",
"@metamask/eslint-config-jest": "^10.0.0",
"@metamask/eslint-config-nodejs": "^10.0.0",
"@metamask/eslint-config-typescript": "^10.0.0",
"@types/debug": "^4.1.7",
"@types/jest": "^29.2.2",
"@types/jest": "^29.5.1",
"@types/jest-when": "^3.5.2",
"@types/node": "^17.0.23",
"@types/rimraf": "^3.0.2",
"@types/which": "^2.0.1",
"@types/rimraf": "^4.0.5",
"@types/which": "^3.0.0",
"@types/yargs": "^17.0.10",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
Expand All @@ -58,15 +58,15 @@
"eslint-plugin-jsdoc": "^39.6.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.3.0",
"jest": "^29.5.0",
"jest-it-up": "^2.0.2",
"jest-when": "^3.5.2",
"nanoid": "^3.3.4",
"prettier": "^2.2.1",
"prettier-plugin-packagejson": "^2.3.0",
"rimraf": "^3.0.2",
"rimraf": "^4.0.5",
"stdio-mock": "^1.2.0",
"ts-jest": "^29.0.3",
"ts-jest": "^29.1.0",
"ts-node": "^10.7.0",
"typescript": "~4.8.4"
},
Expand Down
7 changes: 2 additions & 5 deletions src/fs.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import fs from 'fs';
import path from 'path';
import util from 'util';
import rimraf from 'rimraf';
import { rimraf } from 'rimraf';
import { when } from 'jest-when';
import * as actionUtils from '@metamask/action-utils';
import { withSandbox } from '../tests/helpers';
Expand All @@ -17,8 +16,6 @@ import {

jest.mock('@metamask/action-utils');

const promisifiedRimraf = util.promisify(rimraf);

describe('fs', () => {
describe('readFile', () => {
it('reads the contents of the given file as a UTF-8-encoded string', async () => {
Expand Down Expand Up @@ -62,7 +59,7 @@ describe('fs', () => {

it('re-throws any error that occurs as a new error that points to the original', async () => {
await withSandbox(async (sandbox) => {
await promisifiedRimraf(sandbox.directoryPath);
await rimraf(sandbox.directoryPath);
const filePath = path.join(sandbox.directoryPath, 'test');

await expect(writeFile(filePath, 'some content 😄')).rejects.toThrow(
Expand Down
4 changes: 2 additions & 2 deletions src/functional.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,16 +654,16 @@ Error: Your release spec could not be processed due to the following issues:

* The following packages, which have changed since their latest release, are missing.

- @scope/b
- @scope/d
- @scope/b

Consider including them in the release spec so that any packages that rely on them won't break in production.

If you are ABSOLUTELY SURE that this won't occur, however, and want to postpone the release of a package, then list it with a directive of "intentionally-skip". For example:

packages:
"@scope/b": intentionally-skip
"@scope/d": intentionally-skip
"@scope/b": intentionally-skip

The release spec file has been retained for you to edit again and make the necessary fixes. Once you've done this, re-run this tool.

Expand Down
10 changes: 2 additions & 8 deletions src/project.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import util from 'util';
import glob from 'glob';
import { glob } from 'glob';
import { WriteStreamLike } from './fs';
import {
Package,
Expand Down Expand Up @@ -48,11 +47,6 @@ export type Project = {
releaseVersion: ReleaseVersion;
};

/**
* A promisified version of `glob`.
*/
const promisifiedGlob = util.promisify(glob);

/**
* Given a SemVer version object, interprets the "major" part of the version
* as the ordinary release number and the "minor" part as the backport release
Expand Down Expand Up @@ -100,7 +94,7 @@ export async function readProject(
await Promise.all(
rootPackage.validatedManifest[PackageManifestFieldNames.Workspaces].map(
async (workspacePattern) => {
return await promisifiedGlob(workspacePattern, {
return await glob(workspacePattern, {
cwd: projectDirectoryPath,
absolute: true,
});
Expand Down
10 changes: 2 additions & 8 deletions tests/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import fs from 'fs';
import os from 'os';
import path from 'path';
import util from 'util';
import { nanoid } from 'nanoid';
import rimraf from 'rimraf';
import { rimraf } from 'rimraf';
import type { ExecaError } from 'execa';
import { hasProperty, isObject } from '@metamask/utils';

/**
* A promisified version of `rimraf`.
*/
const promisifiedRimraf = util.promisify(rimraf);

/**
* Information about the sandbox provided to tests that need access to the
* filesystem.
Expand Down Expand Up @@ -66,7 +60,7 @@ export async function withSandbox(fn: (sandbox: Sandbox) => any) {
try {
await fn({ directoryPath });
} finally {
await promisifiedRimraf(directoryPath);
await rimraf(directoryPath);
}
}

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"moduleResolution": "node",
"noEmit": true,
"noErrorTruncation": true,
"skipLibCheck": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. It's a shame to disable type checking for libraries. I see that you found an error that there is no apparently solution for though. I guess we can use this as a workaround in the meantime.

"strict": true,
"target": "es2017"
},
Expand Down
Loading