diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9cb55c51..d34fdf5a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,11 +32,11 @@ feature/bugfix PR ``` ### PR流程 -TSW团队会查看所有的PR,我们会运行一些代码检查和测试,一经测试通过,我们会接受这次PR,但不会立即将代码合并到master分支上,会有一点延迟。 +TSW团队会查看所有的PR,我们会运行一些代码检查和测试,一经测试通过,我们会接受这次PR,但不会立即将代码合并到master分支上,会有一些延迟。 当您准备PR时,请确保已经完成以下几个步骤: -1. 将仓库fork下来并基于`master`分支创建您的开发分支。 +1. 将仓库fork下来并基于`dev`分支创建您的开发分支。 2. 如果您更改了APIs请更新代码及文档。 3. 在您添加的每一个新文件头部加上版权声明。 4. 检查您的代码语法及格式。 diff --git a/CONTRIBUTING_en.md b/CONTRIBUTING_en.md index f64cc8df..13261d2b 100644 --- a/CONTRIBUTING_en.md +++ b/CONTRIBUTING_en.md @@ -37,7 +37,7 @@ The code team will monitor all pull request, we run some code check and test on Before submitting a pull request, please make sure the followings are done: -1. Fork the repo and create your branch from `master`. +1. Fork the repo and create your branch from `dev`. 2. Update code or documentation if you have changed APIs. 3. Add the copyright notice to the top of any new files you've added. 4. Check your code lints and checkstyles. diff --git a/bin/proxy/index.js b/bin/proxy/index.js index 3e8ea720..3ffffde0 100644 --- a/bin/proxy/index.js +++ b/bin/proxy/index.js @@ -10,6 +10,8 @@ const plug = require('../tsw/plug.js'); +require('./version.js'); + plug('runtime/Console.hack.js'); plug('runtime/fs.hack.js'); plug('runtime/Dns.hack.js'); diff --git a/bin/proxy/version.js b/bin/proxy/version.js new file mode 100644 index 00000000..74a49555 --- /dev/null +++ b/bin/proxy/version.js @@ -0,0 +1,23 @@ +/* ! + * Tencent is pleased to support the open source community by making Tencent Server Web available. + * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + * http://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + */ +'use strict'; + + +const arr = process.versions.node.split('.'); + +if (arr[1].length === 1) { + arr[1] = '0' + arr[1]; +} + +this.nodeVersion = parseFloat([arr[0], arr[1]].join('.')); + +if (this.nodeVersion < 8.0 || (this.nodeVersion >= 10.0 && this.nodeVersion <= 10.3)) { + console.error('The nodejs version you installed is ' + process.versions.node); + console.error('Please update to the nodejs version which greater than 10.4.0'); + process.exit(1); +}