Skip to content

Commit

Permalink
Merge pull request #102 from MichaelCurrin/build-deps-upgrade
Browse files Browse the repository at this point in the history
build(deps): upgrade Node, NPM, and deps
  • Loading branch information
MichaelCurrin authored Aug 24, 2023
2 parents ad4cd99 + d654424 commit 6dd973a
Show file tree
Hide file tree
Showing 16 changed files with 727 additions and 4,562 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ q test-quick:
build:
npm run build

# Global install.
# Build then install in VS Code.
e ext:
npm run checks
npm run ext
Expand Down
4,818 changes: 493 additions & 4,325 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@
"sb": "bin/reset_sandbox.sh"
},
"engines": {
"node": ">=16",
"npm": ">=8",
"vscode": "^1.74.0"
"node": ">=20",
"npm": ">=9",
"vscode": "^1.81.0"
},
"devDependencies": {
"@types/mocha": "^10.0.1",
"@types/node": "^16.11.1",
"@types/node": "^20.5.4",
"@types/vscode": "^1.74.0",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"@vscode/vsce": "^2.19.0",
"eslint": "^8.31.0",
"mocha": "^10.0.0",
"nyc": "^15.1.0",
"prettier": "^2.7.0",
"prettier": "^3.0.2",
"source-map-support": "^0.5.20",
"typescript": "^4.7.2",
"typescript": "^5.1.6",
"vscode-test": "^1.6.1"
},
"displayName": "Auto Commit Message",
Expand Down Expand Up @@ -77,9 +77,6 @@
"color": "#f0efe7",
"theme": "light"
},
"activationEvents": [
"onCommand:commitMsg.autofill"
],
"contributes": {
"commands": [
{
Expand Down
14 changes: 7 additions & 7 deletions src/api/git.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ export interface Repository {

getObjectDetails(
treeish: string,
path: string
path: string,
): Promise<{ mode: string; object: string; size: number }>;
detectObjectType(
object: string
object: string,
): Promise<{ mimetype: string; encoding?: string }>;
buffer(ref: string, path: string): Promise<Buffer>;
show(ref: string, path: string): Promise<string>;
Expand Down Expand Up @@ -231,13 +231,13 @@ export interface Repository {
getBranch(name: string): Promise<Branch>;
getBranches(
query: BranchQuery,
cancellationToken?: CancellationToken
cancellationToken?: CancellationToken,
): Promise<Ref[]>;
setBranchUpstream(name: string, upstream: string): Promise<void>;

getRefs(
query: RefQuery,
cancellationToken?: CancellationToken
cancellationToken?: CancellationToken,
): Promise<Ref[]>;

getMergeBase(ref1: string, ref2: string): Promise<string>;
Expand All @@ -259,7 +259,7 @@ export interface Repository {
remoteName?: string,
branchName?: string,
setUpstream?: boolean,
force?: ForcePushMode
force?: ForcePushMode,
): Promise<void>;

blame(path: string): Promise<string>;
Expand Down Expand Up @@ -307,7 +307,7 @@ export interface PushErrorHandler {
repository: Repository,
remote: Remote,
refspec: string,
error: Error & { gitErrorCode: GitErrorCodes }
error: Error & { gitErrorCode: GitErrorCodes },
): Promise<boolean>;
}

Expand Down Expand Up @@ -336,7 +336,7 @@ export interface API {
registerRemoteSourceProvider(provider: RemoteSourceProvider): Disposable;
registerCredentialsProvider(provider: CredentialsProvider): Disposable;
registerPostCommitCommandsProvider(
provider: PostCommitCommandsProvider
provider: PostCommitCommandsProvider,
): Disposable;
registerPushErrorHandler(handler: PushErrorHandler): Disposable;
}
Expand Down
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function _validateFoundRepos(git: API) {
*/
async function _handleRepos(
git: API,
sourceControl: vscode.SourceControl
sourceControl: vscode.SourceControl,
): Promise<Repository | false> {
const selectedRepo = git.repositories.find(repository => {
const uri = sourceControl.rootUri;
Expand Down Expand Up @@ -85,7 +85,7 @@ async function _chooseRepoForAutofill(sourceControl?: vscode.SourceControl) {
export function activate(context: vscode.ExtensionContext) {
const disposable = vscode.commands.registerCommand(
"commitMsg.autofill",
_chooseRepoForAutofill
_chooseRepoForAutofill,
);

context.subscriptions.push(disposable);
Expand Down
2 changes: 1 addition & 1 deletion src/generate/convCommit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class ConventionalCommit {
*/
export function getConventionType(
action: ACTION,
filePath: string
filePath: string,
): CONVENTIONAL_TYPE {
if (action === ACTION.R || action === ACTION.D) {
return CONVENTIONAL_TYPE.CHORE;
Expand Down
4 changes: 2 additions & 2 deletions src/git/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function _execute(cwd: string, subcommand: string, options: string[] = []) {
*/
async function _diffIndex(
repository: Repository,
options: string[] = []
options: string[] = [],
): Promise<Array<string>> {
const cwd = repository.rootUri.fsPath;
const cmd = "diff-index";
Expand Down Expand Up @@ -77,7 +77,7 @@ export async function getChanges(repository: Repository) {
}

console.debug(
"Staging area is empty. Using unstaged files (tracked files only still)."
"Staging area is empty. Using unstaged files (tracked files only still).",
);

const allChanges = await _diffIndex(repository);
Expand Down
4 changes: 2 additions & 2 deletions src/git/parseOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const GIT_STATUS_SPLIT = " -> ";
export function parseStatus(line: string): FileChange {
if (line.length <= 4) {
throw new Error(
`Input string must be at least 4 characters. Got: '${line}'`
`Input string must be at least 4 characters. Got: '${line}'`,
);
}
const x = line[0];
Expand Down Expand Up @@ -56,7 +56,7 @@ export function parseStatus(line: string): FileChange {
export function parseDiffIndex(line: string): FileChange {
if (line.length <= 4) {
throw new Error(
`Invalid input. Input string must be at least 4 characters. Got: '${line}'`
`Invalid input. Input string must be at least 4 characters. Got: '${line}'`,
);
}
const x = line[0];
Expand Down
2 changes: 1 addition & 1 deletion src/lib/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function humanList(paths: string[]) {
*/
export function moveOrRenameFromPaths(
oldP: SplitPathResult,
newP: SplitPathResult
newP: SplitPathResult,
) {
let result: MoveOrRename;

Expand Down
8 changes: 4 additions & 4 deletions src/prepareCommitMsg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export function _newMsg(lines: string[]) {
*/
export function _joinOldAndNew(
autoMsgPieces: ConvCommitMsg,
oldMsgPieces: MsgPieces
oldMsgPieces: MsgPieces,
): string {
let typePrefix = "";

Expand All @@ -205,7 +205,7 @@ export function _joinOldAndNew(

const descResult = _joinWithSpace(
autoMsgPieces.description,
oldMsgPieces.description
oldMsgPieces.description,
);

if (!typePrefix) {
Expand Down Expand Up @@ -239,7 +239,7 @@ export function _joinOldAndNew(
export function _combineOldAndNew(
autoType: CONVENTIONAL_TYPE,
autoDesc: string,
oldMsg: string
oldMsg: string,
): string {
if (!oldMsg) {
const autoCommitMsg: ConvCommitMsg = {
Expand Down Expand Up @@ -273,7 +273,7 @@ export function _combineOldAndNew(
export function _generateMsgWithOld(lines: string[], oldMsg: string) {
if (oldMsg === "") {
throw new Error(
"`oldMsg` must be non-empty here, or use `generateNewMsg` instead."
"`oldMsg` must be non-empty here, or use `generateNewMsg` instead.",
);
}
const { typePrefix, description } = _msgFromChanges(lines);
Expand Down
22 changes: 11 additions & 11 deletions src/test/generate/action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,63 +37,63 @@ describe("Desribe a file using two paths", function () {
it("can describe a renamed file", function () {
assert.strictEqual(
moveOrRenameMsg("foo.txt", "bar.txt"),
"rename foo.txt to bar.txt"
"rename foo.txt to bar.txt",
);

assert.strictEqual(
moveOrRenameMsg("buzz/foo.txt", "buzz/bar.txt"),
"rename foo.txt to bar.txt"
"rename foo.txt to bar.txt",
);

assert.strictEqual(
moveOrRenameMsg("fizz buzz/foo.txt", "fizz buzz/bar.txt"),
"rename foo.txt to bar.txt"
"rename foo.txt to bar.txt",
);
});

it("can describe a moved file", function () {
assert.strictEqual(
moveOrRenameMsg("buzz/foo.txt", "fizz/foo.txt"),
"move foo.txt to fizz"
"move foo.txt to fizz",
);

assert.strictEqual(
moveOrRenameMsg("buzz/foo bar.txt", "fizz/foo bar.txt"),
"move 'foo bar.txt' to fizz"
"move 'foo bar.txt' to fizz",
);

assert.strictEqual(
moveOrRenameMsg("buzz/foo.txt", "foo.txt"),
"move foo.txt to repo root"
"move foo.txt to repo root",
);

assert.strictEqual(
moveOrRenameMsg("buzz/foo bar.txt", "foo bar.txt"),
"move 'foo bar.txt' to repo root"
"move 'foo bar.txt' to repo root",
);
});

it("can describe a remamed and moved file", function () {
assert.strictEqual(
moveOrRenameMsg("foo.txt", "fizz/bar.txt"),
"move and rename foo.txt to fizz/bar.txt"
"move and rename foo.txt to fizz/bar.txt",
);

// This is a rare case, so don't bother trying to handle it smarter around
// paths.
assert.strictEqual(
moveOrRenameMsg("fuzz/foo.txt", "fizz/bar.txt"),
"move and rename foo.txt to fizz/bar.txt"
"move and rename foo.txt to fizz/bar.txt",
);

assert.strictEqual(
moveOrRenameMsg("fuzz/foo.txt", "fizz/bar bazz.txt"),
"move and rename foo.txt to 'fizz/bar bazz.txt'"
"move and rename foo.txt to 'fizz/bar bazz.txt'",
);

assert.strictEqual(
moveOrRenameMsg("fizz/foo.txt", "bar.txt"),
"move and rename foo.txt to bar.txt at repo root"
"move and rename foo.txt to bar.txt at repo root",
);
});
});
Expand Down
Loading

0 comments on commit 6dd973a

Please sign in to comment.