Skip to content

Commit

Permalink
Node 12 (microsoft#1356)
Browse files Browse the repository at this point in the history
* Engines, types/node updates

* Update node version on CI

* Change required node version to 12

* Change contirbuting.md and substitute copyFileSync

* Revert restricted version
  • Loading branch information
Ruslan Urmeev authored Apr 1, 2021
1 parent c869e69 commit 6b6898e
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 66 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ commands that they'd like to execute. You can currently login and view/configure

## Prerequisites

App Center CLI requires Node.js version 10.
The recommended Node.js version is 12 or higher.

## Installation

Expand Down
49 changes: 28 additions & 21 deletions appcenter-file-upload-client-node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions appcenter-file-upload-client-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"main": "out/index.js",
"devDependencies": {
"@types/mocha": "8.2.1",
"@types/node": "10.x",
"@types/node": "12.x",
"@types/uuid": "7.0.3",
"@typescript-eslint/eslint-plugin": "4.0.0",
"@typescript-eslint/parser": "3.10.1",
Expand All @@ -33,14 +33,14 @@
"mocha-junit-reporter": "2.0.0",
"nock": "13.0.11",
"prettier": "2.2.1",
"ts-node": "8.9.1",
"ts-node": "9.1.1",
"typemoq": "2.1.0",
"typescript": "3.8.3",
"uuid": "7.0.3"
},
"dependencies": {
"abort-controller": "3.0.0",
"node-fetch": "2.6.0",
"node-fetch": "2.6.1",
"proxy-agent": "3.1.1"
}
}
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
versionSpec: '12.x'
displayName: 'Install Node.js'

- script: |
Expand Down
4 changes: 2 additions & 2 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local CI configurations).

## Technologies Used

App Center cli is written using Node.js version 10 and [TypeScript](http://typescriptlang.org).
App Center cli is written using Node.js version 12 and [TypeScript](http://typescriptlang.org).
Wrappers over the App Center HTTP API are generated using the [AutoRest](https://github.com/Azure/autorest) code generator.
And the usual plethora of npm modules.

Expand All @@ -18,7 +18,7 @@ is used to record and playback mock http traffic.

### Prerequisites

Install the latest version of Node 10 from [here](https://nodejs.org). If you are on a Mac, we recommend
Install the latest version of Node 12 from [here](https://nodejs.org). If you are on a Mac, we recommend
a 64-bit version.

Also have a working git installation. The code is available from this [repo](https://github.com/microsoft/appcenter-cli).
Expand Down
41 changes: 17 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"homepage": "https://github.com/microsoft/appcenter-cli#readme",
"engine": {
"node": ">=10.0.0"
"node": ">=12.0.0"
},
"main": "dist/index.js",
"bin": {
Expand Down Expand Up @@ -62,7 +62,7 @@
"@types/mkdirp": "1.0.1",
"@types/mocha": "8.2.1",
"@types/mock-require": "2.0.0",
"@types/node": "10.*",
"@types/node": "12.*",
"@types/node-fetch": "2.5.8",
"@types/opener": "1.4.0",
"@types/pumpify": "1.4.1",
Expand Down Expand Up @@ -130,7 +130,7 @@
"omelette": "0.4.15",
"opener": "1.5.2",
"p-limit": "3.1.0",
"plist": "3.0.1",
"plist": "3.0.2",
"properties": "1.2.1",
"pumpify": "2.0.1",
"qs": "6.9.6",
Expand Down
12 changes: 1 addition & 11 deletions src/util/misc/get-profile-dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,10 @@ function copyDirSync(srcPath: string, destPath: string): void {
files
.map((f: string): [string, string] => [path.join(srcPath, f), path.join(destPath, f)])
.filter(([src, dest]) => isFileSync(src))
.forEach(([src, dest]) => copyFileSync(src, dest));
.forEach(([src, dest]) => fs.copyFileSync(src, dest));
}

function isFileSync(file: string): boolean {
const stats = fs.statSync(file);
return stats.isFile();
}

//
// fs.copyFileSync is only in very new version of node 8, so implement
// it locally as compat shim
//
function copyFileSync(srcPath: string, destPath: string): void {
debug(`Copying file ${srcPath} to ${destPath}`);
const contents = fs.readFileSync(srcPath);
fs.writeFileSync(destPath, contents);
}

0 comments on commit 6b6898e

Please sign in to comment.