Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparation for Node 14 #49

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 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
6 changes: 6 additions & 0 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require: "ts-node/register"
reporter: "spec"
spec:
- "src/**/*.spec.ts"
timeout: "80000"
watch-extensions: ts
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ os:
- windows

node_js:
- '10'
- '12'
- "10"
- "12"
- "14"
- "16"

git:
depth: 1

branches:
only:
- master
- master

install:
yarn
install: yarn install --ignore-engines

script:
yarn build && yarn test
script: yarn build && yarn test
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@

High-level Git commands for [dugite-no-gpl](https://github.com/theia-ide/dugite).

## Requirements
```
"engines": {
"node": ">=10.11.0 <13"
},
## Building
Clone or fork this repo, the run:

```shell
yarn
```
This will compile the source code and run the unit tests using your local git installation.
Test files are located alongside the sourcefiles, e.g.: `command/branch.ts` and `src/command/branch.spec.ts`.


## Requirements
- node: >= 10.11.0 < 13
- git: >= 2.15.0

4 changes: 0 additions & 4 deletions mocha.opts

This file was deleted.

34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"main": "lib/index",
"typings": "lib/index",
"engines": {
"node": ">=10.11.0 <13"
"node": ">=10.11.0"
},
"scripts": {
"build": "tsc && tslint -c ./tslint.json --project ./tsconfig.json",
"test": "cross-env USE_LOCAL_GIT=true mocha --opts ./mocha.opts src/**/*.spec.ts",
"test": "cross-env USE_LOCAL_GIT=true mocha",
"prepare": "yarn run build && yarn run test",
"test:watch": "cross-env USE_LOCAL_GIT=true mocha -w --opts ./mocha.opts src/**/*.spec.ts",
"test:ssh": "cross-env GIT_OVER_SSH_TEST=true mocha --opts ./mocha.opts src/**/*.spec.ts",
"test:watch": "cross-env USE_LOCAL_GIT=true mocha -w",
"test:ssh": "cross-env GIT_OVER_SSH_TEST=true mocha",
"clean": "rimraf ./lib",
"build:watch": "tsc -w",
"clean:all": "rimraf ./lib && rimraf ./node_modules"
Expand All @@ -35,25 +35,25 @@
"byline": "^5.0.0",
"dugite-no-gpl": "1.69.0",
"find-git-exec": "^0.0.3",
"upath": "^1.0.0"
"upath": "^2.0.1"
},
"devDependencies": {
"@types/chai": "^4.2.5",
"@types/fs-extra": "^4.0.2",
"@types/mocha": "^5.2.7",
"@types/node": "^7.0.22",
"@types/temp": "^0.8.34",
"@types/fs-extra": "^9.0.12",
"@types/mocha": "^9.0.0",
"@types/node": "^16.4.7",
"@types/temp": "^0.9.1",
"chai": "^4.2.0",
"concurrently": "^5.0.0",
"cross-env": "^6.0.3",
"fs-extra": "^4.0.2",
"mocha": "^6.2.2",
"node-ssh": "^6.0.0",
"concurrently": "^6.2.0",
"cross-env": "^7.0.3",
"fs-extra": "^10.0.0",
"mocha": "^9.0.3",
"node-ssh": "^12.0.0",
Comment on lines +47 to +51
Copy link
Member

Choose a reason for hiding this comment

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

The testing failures are due to these dev dependencies. E.g. mocha@^9 needs Node 12. Please revert the dev dependencies to the previous versions (or at least versions compatible with Node 10).

Copy link
Author

Choose a reason for hiding this comment

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

please see my comments in #46 I don't see how downgrading mocha could possibly solve the fact that the default git branch name is main on new machines, while the tests hardcode master. This means tests will fail when run locally. I'd rather fix these 4 failing tests by addressing the underlying issues, before pinning an outdated mocha version.

Copy link
Member

Choose a reason for hiding this comment

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

I see, makes sense 👍

"rimraf": "^3.0.0",
"temp": "^0.9.1",
"ts-node": "^8.5.2",
"tslint": "^5.20.1",
"ts-node": "^10.1.0",
"tslint": "^6.1.3",
"tslint-no-unused-expression-chai": "^0.1.4",
"typescript": "~3.5.3"
"typescript": "~4.3.5"
}
}
6 changes: 3 additions & 3 deletions src/command/show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const upath = require('upath');
const normalizeSafe: (path: string) => string = upath.normalizeSafe;

const successExitCodes = new Set([0, 1]);
const utf8Encoding: (process: ChildProcess) => void = cb => cb.stdout.setEncoding('utf8');
const binaryEncoding: (process: ChildProcess) => void = cb => cb.stdout.setEncoding('binary');
const utf8Encoding: (process: ChildProcess) => void = cb => cb?.stdout?.setEncoding('utf8');
const binaryEncoding: (process: ChildProcess) => void = cb => cb?.stdout?.setEncoding('binary');

/**
* Retrieve the text (UTF-8) contents of a file from the repository at a given
Expand Down Expand Up @@ -53,4 +53,4 @@ export async function getBlobContents(repositoryPath: string, commitish: string,
};
const blobContents = await git(args, repositoryPath, 'getBlobContents', opts);
return Buffer.from(blobContents.stdout, 'binary');
}
}
Loading