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
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,33 @@
"devDependencies": {
"@lavamoat/allow-scripts": "^2.0.3",
"@metamask/auto-changelog": "^2.3.0",
"@metamask/eslint-config": "^9.0.0",
"@metamask/eslint-config-jest": "^9.0.0",
"@metamask/eslint-config-nodejs": "^9.0.0",
"@metamask/eslint-config-typescript": "^9.0.1",
"@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-when": "^3.5.2",
"@types/node": "^17.0.23",
"@types/rimraf": "^3.0.2",
"@types/which": "^2.0.1",
"@types/yargs": "^17.0.10",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/parser": "^4.21.0",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"deepmerge": "^4.2.2",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.3.4",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.9.0",
"eslint-plugin-jsdoc": "^39.6.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.3.0",
"jest-it-up": "^2.0.2",
"jest-when": "^3.5.2",
"nanoid": "^3.3.4",
"prettier": "^2.2.1",
"prettier-plugin-packagejson": "^2.2.17",
"prettier-plugin-packagejson": "^2.3.0",
"rimraf": "^3.0.2",
"stdio-mock": "^1.2.0",
"ts-jest": "^29.0.3",
Expand Down
4 changes: 2 additions & 2 deletions src/command-line-arguments.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import yargs from 'yargs/yargs';
import { hideBin } from 'yargs/helpers';

export interface CommandLineArguments {
export type CommandLineArguments = {
projectDirectory: string;
tempDirectory: string | undefined;
reset: boolean;
backport: boolean;
}
};

/**
* Parses the arguments provided on the command line using `yargs`.
Expand Down
4 changes: 2 additions & 2 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { debug, resolveExecutable } from './misc-utils';
* @property args - Command-line arguments to pass to the executable when
* calling it.
*/
export interface Editor {
export type Editor = {
path: string;
args: string[];
}
};

/**
* Looks for an executable that represents a code editor on your computer. Tries
Expand Down
4 changes: 2 additions & 2 deletions src/env.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
interface Env {
type Env = {
EDITOR: string | undefined;
}
};

/**
* Returns all of the environment variables that this tool uses.
Expand Down
4 changes: 2 additions & 2 deletions src/fs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('fs', () => {

await fs.promises.writeFile(filePath, 'some content 😄');

expect(await readFile(filePath)).toStrictEqual('some content 😄');
expect(await readFile(filePath)).toBe('some content 😄');
});
});

Expand All @@ -54,7 +54,7 @@ describe('fs', () => {

await writeFile(filePath, 'some content 😄');

expect(await fs.promises.readFile(filePath, 'utf8')).toStrictEqual(
expect(await fs.promises.readFile(filePath, 'utf8')).toBe(
'some content 😄',
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/functional.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ describe('create-release-branch (functional)', () => {
'--max-count=1',
])
).stdout;
expect(latestCommitSubject).toStrictEqual('Release 2.0.0');
expect(latestCommitSubject).toBe('Release 2.0.0');
expect(latestCommitRevs).toContain('HEAD');
expect(latestCommitRevs).toContain('release/2.0.0');
expect(latestBranchCommitId).toStrictEqual(latestCommitId);
Expand Down
4 changes: 1 addition & 3 deletions src/initial-parameters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ describe('initial-parameters', () => {
stderr,
});

expect(initialParameters.tempDirectoryPath).toStrictEqual(
'/path/to/cwd/tmp',
);
expect(initialParameters.tempDirectoryPath).toBe('/path/to/cwd/tmp');
});

it('uses a default temporary directory based on the name of the package if no temporary directory was given', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/initial-parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import { readProject, Project } from './project';
*/
export type ReleaseType = 'ordinary' | 'backport';

interface InitialParameters {
type InitialParameters = {
project: Project;
tempDirectoryPath: string;
reset: boolean;
releaseType: ReleaseType;
}
};

/**
* Reads the inputs given to this tool via `process.argv` and uses them to
Expand Down
10 changes: 4 additions & 6 deletions src/misc-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('misc-utils', () => {
const originalError = new Error('oops');
const newError = wrapError('Some message', originalError);

expect(newError.message).toStrictEqual('Some message');
expect(newError.message).toBe('Some message');
expect(newError.cause).toBe(originalError);
});

Expand All @@ -95,7 +95,7 @@ describe('misc-utils', () => {
originalError.code = 'CODE';
const newError: any = wrapError('Some message', originalError);

expect(newError.code).toStrictEqual('CODE');
expect(newError.code).toBe('CODE');
});

it('returns a new Error which prefixes the given message', () => {
Expand All @@ -112,9 +112,7 @@ describe('misc-utils', () => {
.spyOn(whichModule, 'default')
.mockResolvedValue('/path/to/executable');

expect(await resolveExecutable('executable')).toStrictEqual(
'/path/to/executable',
);
expect(await resolveExecutable('executable')).toBe('/path/to/executable');
});

it('returns null if the given executable cannot be found', async () => {
Expand Down Expand Up @@ -170,7 +168,7 @@ describe('misc-utils', () => {
expect(execaSpy).toHaveBeenCalledWith('some command', ['arg1', 'arg2'], {
all: true,
});
expect(output).toStrictEqual('some output');
expect(output).toBe('some output');
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/package-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export type UnvalidatedPackageManifest = Readonly<Record<string, any>>;
* @property bundledDependencies - The set of packages that are expected to be
* bundled when publishing the package.
*/
export interface ValidatedPackageManifest {
export type ValidatedPackageManifest = {
readonly [PackageManifestFieldNames.Name]: string;
readonly [PackageManifestFieldNames.Version]: SemVer;
readonly [PackageManifestFieldNames.Private]: boolean;
readonly [PackageManifestFieldNames.Workspaces]: string[];
}
};

/**
* Constructs a validation error message for a field within the manifest.
Expand Down
6 changes: 3 additions & 3 deletions src/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ describe('package', () => {
changelogPath,
'utf8',
);
expect(newChangelogContent).toStrictEqual('new changelog');
expect(newChangelogContent).toBe('new changelog');
});
});

Expand Down Expand Up @@ -567,7 +567,7 @@ describe('package', () => {
changelogPath,
'utf8',
);
expect(newChangelogContent).toStrictEqual('existing changelog');
expect(newChangelogContent).toBe('existing changelog');
});
});

Expand Down Expand Up @@ -604,7 +604,7 @@ describe('package', () => {
changelogPath,
'utf8',
);
expect(newChangelogContent).toStrictEqual('existing changelog');
expect(newChangelogContent).toBe('existing changelog');
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions src/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ const CHANGELOG_FILE_NAME = 'CHANGELOG.md';
* @property changelogPath - The path to the changelog file (which may or may
* not exist).
*/
export interface Package {
export type Package = {
directoryPath: string;
manifestPath: string;
unvalidatedManifest: UnvalidatedPackageManifest;
validatedManifest: ValidatedPackageManifest;
changelogPath: string;
hasChangesSinceLatestRelease: boolean;
}
};

/**
* Generates the possible Git tag name for the root package of a monorepo. The
Expand Down
8 changes: 4 additions & 4 deletions src/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import { SemVer } from './semver';
* same ordinary release, starting from 1; it will be 0 if there aren't any
* backport releases for the ordinary release yet.
*/
interface ReleaseVersion {
type ReleaseVersion = {
ordinaryNumber: number;
backportNumber: number;
}
};

/**
* Represents the entire codebase on which this tool is operating.
Expand All @@ -39,14 +39,14 @@ interface ReleaseVersion {
* @property workspacePackages - Information about packages that are referenced
* via workspaces (assuming that the project is a monorepo).
*/
export interface Project {
export type Project = {
directoryPath: string;
repositoryUrl: string;
rootPackage: Package;
workspacePackages: Record<string, Package>;
isMonorepo: boolean;
releaseVersion: ReleaseVersion;
}
};

/**
* A promisified version of `glob`.
Expand Down
8 changes: 4 additions & 4 deletions src/release-plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import { ReleaseSpecification } from './release-specification';
* itself; for a monorepo package it will consist of the root package and any
* workspace packages that will be included in the release.
*/
export interface ReleasePlan {
export type ReleasePlan = {
newVersion: string;
packages: PackageReleasePlan[];
}
};

/**
* Instructions for how to update a package within a project in order to prepare
Expand All @@ -40,11 +40,11 @@ export interface ReleasePlan {
* monorepo, this will be true only for workspace packages (the root package
* doesn't have a changelog, since it is a virtual package).
*/
export interface PackageReleasePlan {
export type PackageReleasePlan = {
package: Package;
newVersion: string;
shouldUpdateChangelog: boolean;
}
};

/**
* Uses the release specification to calculate the final versions of all of the
Expand Down
4 changes: 2 additions & 2 deletions src/release-specification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ type VersionSpecifier = IncrementableVersionParts | SemVer;
* @property packages - A mapping of package names to version specifiers.
* @property path - The path to the original release specification file.
*/
export interface ReleaseSpecification {
export type ReleaseSpecification = {
packages: Record<string, VersionSpecifier>;
path: string;
}
};

const SKIP_PACKAGE_DIRECTIVE = null;
const INTENTIONALLY_SKIP_PACKAGE_DIRECTIVE = 'intentionally-skip';
Expand Down
12 changes: 6 additions & 6 deletions src/repo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ describe('repo', () => {
})
.mockResolvedValue('https://github.com/foo');

expect(
await getRepositoryHttpsUrl(repositoryDirectoryPath),
).toStrictEqual('https://github.com/foo');
expect(await getRepositoryHttpsUrl(repositoryDirectoryPath)).toBe(
'https://github.com/foo',
);
});

it('converts an SSH GitHub repo URL into an HTTPS URL', async () => {
Expand All @@ -32,9 +32,9 @@ describe('repo', () => {
})
.mockResolvedValue('git@github.com:Foo/Bar.git');

expect(
await getRepositoryHttpsUrl(repositoryDirectoryPath),
).toStrictEqual('https://github.com/Foo/Bar');
expect(await getRepositoryHttpsUrl(repositoryDirectoryPath)).toBe(
'https://github.com/Foo/Bar',
);
});

it('throws if the URL of the "origin" remote is in an invalid format', async () => {
Expand Down
8 changes: 4 additions & 4 deletions tests/functional/helpers/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import Repo from './repo';
* @property directory - The path relative to the repo's root directory that
* holds this package.
*/
export interface PackageSpecification {
export type PackageSpecification = {
name: string;
version?: string;
directoryPath: string;
}
};

/**
* A set of configuration options for an {@link Environment}.
Expand All @@ -28,10 +28,10 @@ export interface PackageSpecification {
* this option to disable that if you need to create your own commits for
* clarity.
*/
export interface EnvironmentOptions {
export type EnvironmentOptions = {
directoryPath: string;
createInitialCommit?: boolean;
}
};

/**
* This class sets up each test and acts as a facade to all of the actions that
Expand Down
5 changes: 2 additions & 3 deletions tests/functional/helpers/local-monorepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ import { knownKeysOf } from './utils';
* root).
* @property workspaces - The known workspaces within this repo.
*/
export interface LocalMonorepoOptions<WorkspacePackageNickname extends string>
extends LocalRepoOptions {
export type LocalMonorepoOptions<WorkspacePackageNickname extends string> = {
packages: Record<WorkspacePackageNickname, PackageSpecification>;
workspaces: Record<string, string[]>;
}
} & LocalRepoOptions;

/**
* Represents the repo that the tool is run against, containing logic specific
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/helpers/local-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { buildChangelog } from './utils';
* use this option to disable that if you need to create your own commits for
* clarity.
*/
export interface LocalRepoOptions extends RepoOptions {
export type LocalRepoOptions = {
remoteRepoDirectoryPath: string;
createInitialCommit: boolean;
}
} & RepoOptions;

/**
* A facade for the "local" repo, which is the repo with which the tool
Expand Down
Loading