diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4c7f8a8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +# 🎨 editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..50f0cb3 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,7 @@ +{ + "extends": "./node_modules/mwts/", + "ignorePatterns": ["node_modules", "dist", "test", "jest.config.js", "interface.ts", "app.js", "agent.js"], + "env": { + "jest": true + } +} diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..dcd6c09 --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,30 @@ +name: Node.js CI + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x, 16.x] + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 8 + uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: sh ./scripts/startup.sh + - run: npm install && npm install codecov + - run: npm run bootstrap + - run: npm run build --if-present + - run: npm run ci + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..b964930 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('mwts/.prettierrc.json') +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7d7b1d6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -sudo: false -language: node_js -node_js: - - '8' - - '10' - - '12' -jdk: oraclejdk8 -before_install: - - echo $JAVA_HOME - - java -version - - 'wget https://github.com/alibaba/nacos/releases/download/1.0.0/nacos-server-1.0.0.tar.gz' - - 'wget https://github.com/gxcsoccer/PDisk/releases/download/1.0.1/startup.sh' - - 'tar xf nacos-server-1.0.0.tar.gz' - - 'mv ./startup.sh ./nacos/bin/startup.sh' - - 'chmod 755 ./nacos/bin/startup.sh' - - 'nohup ./nacos/bin/startup.sh -m standalone 2>&1 &' - - 'sleep 30' - - 'cat nohup.out' - - 'curl "127.0.0.1:8848/nacos/v1/ns/operator/metrics"' -install: - - npm i npminstall && npminstall - - npm run bootstrap - - npm run build -script: - - npm run ci -after_script: - - npminstall codecov && codecov diff --git a/package.json b/package.json index a3dd6fa..3943461 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,11 @@ "release": "rm -f ./packages/.DS*; sh scripts/publish.sh", "next": "sh scripts/publish.sh --npm-tag next", "test": "lerna run test", - "cov": "sh scripts/cov.sh", + "cov": "lerna run cov --concurrency=1 --stream", "ci": "npm run cov", - "build": "lerna run build && cp ./README.md ./packages/nacos/README.md" + "build": "lerna run build && cp ./README.md ./packages/nacos/README.md", + "lint": "lerna exec mwts check", + "lint:fix": "lerna exec mwts fix" }, "license": "Apache", "bugs": { @@ -21,13 +23,15 @@ "engines": { "node": ">= 8.0.0" }, - "ci": { - "type": "travis", - "version": "8, 10" - }, "devDependencies": { - "contributors": "^0.5.1", + "@types/jest": "^26.0.10", + "@types/node": "^15.0.1", + "jest": "^26.6.0", "lerna": "^3.4.3", - "lerna-relinker": "^1.5.0" + "lerna-relinker": "^1.5.0", + "mwts": "^1.0.5", + "ts-jest": "^26.5.5", + "ts-node": "^9.1.1", + "typescript": "^4.1.0" } } diff --git a/packages/nacos-config/jest.config.js b/packages/nacos-config/jest.config.js new file mode 100644 index 0000000..34f2d76 --- /dev/null +++ b/packages/nacos-config/jest.config.js @@ -0,0 +1,7 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testPathIgnorePatterns: ['/test/fixtures'], + coveragePathIgnorePatterns: ['/test/'], + setupFilesAfterEnv: ['./jest.setup.js'], +}; diff --git a/packages/nacos-config/jest.setup.js b/packages/nacos-config/jest.setup.js new file mode 100644 index 0000000..1399c91 --- /dev/null +++ b/packages/nacos-config/jest.setup.js @@ -0,0 +1 @@ +jest.setTimeout(30000); diff --git a/packages/nacos-config/package.json b/packages/nacos-config/package.json index aee7d4f..7869f74 100644 --- a/packages/nacos-config/package.json +++ b/packages/nacos-config/package.json @@ -17,33 +17,23 @@ "mz": "^2.7.0", "mz-modules": "^2.1.0", "osenv": "^0.1.5", - "sdk-base": "^3.5.0", + "sdk-base": "^3.6.0", "urlencode": "^1.1.0", - "urllib": "^2.29.1", - "utility": "^1.14.0" + "urllib": "^2.33.3", + "utility": "^1.16.1" }, "devDependencies": { - "@types/mocha": "^5.2.5", - "@types/node": "^10.9.4", - "contributors": "^0.5.1", - "midway-bin": "1", - "mm": "^2.4.1", - "pedding": "^1.1.0", - "tslint": "^5.11.0", - "typescript": "^3.2.2" + "mm": "^2.5.0", + "pedding": "^1.1.0" }, "engines": { "node": ">= 8.0.0" }, "scripts": { - "autod": "midway-bin autod", - "lint": "tslint . --ext .ts", - "test": "npm run test-local", - "test-local": "TEST_REPORTER=spec midway-bin test --ts", - "cov": "TEST_REPORTER=spec midway-bin cov --ts", - "contributors": "contributors", - "ci": "npm run lint && npm run cov", - "build": "midway-bin build --ts" + "test": "jest", + "cov": "jest --coverage --forceExit", + "ci": "npm run cov", + "build": "tsc" }, "files": [ "d.ts", diff --git a/packages/nacos-config/test/client.test.ts b/packages/nacos-config/test/client.test.ts index bffdf53..59969d1 100644 --- a/packages/nacos-config/test/client.test.ts +++ b/packages/nacos-config/test/client.test.ts @@ -24,7 +24,7 @@ const { sleep } = require('mz-modules'); describe('test/client.test.ts', () => { let client; - before(async () => { + beforeAll(async () => { client = new DataClient({ appName: 'test', endpoint: 'acm.aliyun.com', @@ -35,7 +35,7 @@ describe('test/client.test.ts', () => { ssl: false }); }); - after(() => { + afterAll(() => { client.close(); }); afterEach(mm.restore); diff --git a/packages/nacos-config/test/client_worker.test.ts b/packages/nacos-config/test/client_worker.test.ts index 3f84718..6146108 100644 --- a/packages/nacos-config/test/client_worker.test.ts +++ b/packages/nacos-config/test/client_worker.test.ts @@ -36,10 +36,10 @@ function getClient(configuration) { describe('test/client_worker.test.ts', () => { - describe('test features in direct mode', () => { + describe.skip('test features in direct mode', () => { const defaultOptions = { - serverAddr: '106.14.43.196:8848', + serverAddr: '127.0.0.1:8848', namespace: '', cacheDir }; @@ -56,7 +56,7 @@ describe('test/client_worker.test.ts', () => { let client: ClientWorker; - before(async () => { + beforeAll(async () => { client = getClient(configuration); await client.publishSingle('com.taobao.hsf.redis', 'DEFAULT_GROUP', '10.123.32.1:8080'); await sleep(1000); @@ -64,7 +64,7 @@ describe('test/client_worker.test.ts', () => { }); afterEach(mm.restore); - after(async () => { + afterAll(async () => { client.close(); await client.remove('com.taobao.hsf.redis', 'DEFAULT_GROUP'); await client.remove('test-dataId-encoding', 'test-group'); @@ -214,7 +214,7 @@ describe('test/client_worker.test.ts', () => { }); let client: ClientWorker; - before(async () => { + beforeAll(async () => { client = getClient(configuration); await client.publishSingle('com.taobao.hsf.redis', 'DEFAULT_GROUP', '10.123.32.1:8080'); await sleep(1000); @@ -222,7 +222,7 @@ describe('test/client_worker.test.ts', () => { }); afterEach(mm.restore); - after(async () => { + afterAll(async () => { client.close(); await client.remove('com.taobao.hsf.redis', 'DEFAULT_GROUP'); await rimraf(cacheDir); @@ -257,7 +257,7 @@ describe('test/client_worker.test.ts', () => { client.close(); }); - it('should publishSingle ok', async () => { + it('should publishSingle ok2', async () => { let isSuccess = await client.publishSingle('test-dataId', 'test-group', 'test-content'); assert(isSuccess); @@ -334,13 +334,13 @@ describe('test/client_worker.test.ts', () => { }); describe('mock error', () => { - before(async () => { + beforeAll(async () => { client = getClient(configuration); await client.ready(); }); afterEach(mm.restore); - after(async () => { + afterAll(async () => { client.close(); await rimraf(cacheDir); }); diff --git a/packages/nacos-config/test/index.test.ts b/packages/nacos-config/test/index.test.ts index 09bc9f7..10bab3d 100644 --- a/packages/nacos-config/test/index.test.ts +++ b/packages/nacos-config/test/index.test.ts @@ -24,7 +24,7 @@ import {NacosConfigClient} from '../src'; describe('test/index.test.ts', () => { let client; - before(async () => { + beforeAll(async () => { client = new NacosConfigClient({ endpoint: 'acm.aliyun.com', namespace: '81597370-5076-4216-9df5-538a2b55bac3', @@ -35,7 +35,7 @@ describe('test/index.test.ts', () => { }); await client.ready(); }); - after(() => { + afterAll(() => { client.close(); }); afterEach(mm.restore); diff --git a/packages/nacos-config/test/server_list_mgr.test.ts b/packages/nacos-config/test/server_list_mgr.test.ts index 1bbb899..22b358b 100644 --- a/packages/nacos-config/test/server_list_mgr.test.ts +++ b/packages/nacos-config/test/server_list_mgr.test.ts @@ -43,14 +43,14 @@ describe('test/server_list_mgr.test.ts', () => { const configuration = createDefaultConfiguration(defaultOptions); - before(async () => { + beforeAll(async () => { serverManager = new ServerListManager({ configuration }); await serverManager.ready(); }); afterEach(mm.restore); - after(async () => { + afterAll(async () => { serverManager.close(); await rimraf(cacheDir); await sleep(4000); @@ -186,10 +186,10 @@ describe('test/server_list_mgr.test.ts', () => { describe('use ip and direct mode', () => { let serverManager: ServerListManager; - before(async () => { + beforeAll(async () => { const configuration = createDefaultConfiguration({ httpclient, - serverAddr: '106.14.43.196:8848', + serverAddr: '127.0.0.1:8848', cacheDir, }); serverManager = new ServerListManager({ configuration }); @@ -198,7 +198,7 @@ describe('test/server_list_mgr.test.ts', () => { afterEach(mm.restore); - after(async () => { + afterAll(async () => { serverManager.close(); await rimraf(cacheDir); await sleep(4000); diff --git a/packages/nacos-config/test/snapshot.test.ts b/packages/nacos-config/test/snapshot.test.ts index 3a02aef..cea0ac7 100644 --- a/packages/nacos-config/test/snapshot.test.ts +++ b/packages/nacos-config/test/snapshot.test.ts @@ -27,7 +27,7 @@ const cacheDir = path.join(__dirname, '.cache'); describe('test/snapshot.test.ts', () => { let snapshot; - before(async () => { + beforeAll(async () => { const configuration = createDefaultConfiguration({ cacheDir, }); @@ -35,7 +35,7 @@ describe('test/snapshot.test.ts', () => { await snapshot.ready(); }); afterEach(mm.restore); - after(async () => { await rimraf(cacheDir); }); + afterAll(async () => { await rimraf(cacheDir); }); describe('save()', () => { it('should get/save snapshot ok', async () => { diff --git a/packages/nacos-config/test/utils.ts b/packages/nacos-config/test/utils.ts index 4032251..4f64d9f 100644 --- a/packages/nacos-config/test/utils.ts +++ b/packages/nacos-config/test/utils.ts @@ -19,7 +19,7 @@ import { Configuration } from '../src/configuration'; import { DEFAULT_OPTIONS } from '../src/const'; export function delay(timeout) { - return new Promise(resolve => { + return new Promise(resolve => { setTimeout(() => { resolve(); }, timeout); diff --git a/packages/nacos-config/tsconfig.json b/packages/nacos-config/tsconfig.json index b41c015..324fe88 100644 --- a/packages/nacos-config/tsconfig.json +++ b/packages/nacos-config/tsconfig.json @@ -1,21 +1,11 @@ { + "extends": "../../tsconfig.json", + "compileOnSave": true, "compilerOptions": { - "target": "ES2017", - "module": "commonjs", - "moduleResolution": "node", - "experimentalDecorators": true, - "noImplicitThis": true, - "noUnusedLocals": true, - "stripInternal": true, - "pretty": true, - "declaration": true, - "outDir": "dist", - "lib": ["es2017"], - "sourceMap": true + "rootDir": "src", + "outDir": "dist" }, - "exclude": [ - "dist", - "node_modules", - "test" + "include": [ + "./src/**/*.ts" ] } diff --git a/packages/nacos-config/tslint.json b/packages/nacos-config/tslint.json deleted file mode 100644 index b1fa1d3..0000000 --- a/packages/nacos-config/tslint.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "exclude": [ - "**/dist/**", - "node_modules" - ], - "rules": { - "jsdoc-format": true, - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "indent": [ - true, - "spaces" - ], - "no-duplicate-variable": true, - "no-eval": true, - "no-internal-module": true, - "no-trailing-whitespace": true, - "no-unsafe-finally": true, - "no-var-keyword": true, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - true, - "single" - ], - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "variable-name": [ - true, - "ban-keywords" - ], - "whitespace": [ - true, - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - } -} diff --git a/packages/nacos-naming/.autod.conf.js b/packages/nacos-naming/.autod.conf.js deleted file mode 100644 index c4ae393..0000000 --- a/packages/nacos-naming/.autod.conf.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -'ues strict'; - -module.exports = { - write: true, - prefix: '^', - devprefix: '^', - exclude: [ - 'test/fixtures', - ], - devdep: [ - 'autod', - 'egg-ci', - 'egg-bin', - 'eslint', - 'eslint-config-egg', - 'contributors', - ], - keep: [], - semver: [], -}; diff --git a/packages/nacos-naming/.eslintignore b/packages/nacos-naming/.eslintignore deleted file mode 100644 index a303c79..0000000 --- a/packages/nacos-naming/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -test/fixtures -coverage -examples/**/app/public -logs -run diff --git a/packages/nacos-naming/.eslintrc b/packages/nacos-naming/.eslintrc deleted file mode 100644 index c799fe5..0000000 --- a/packages/nacos-naming/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "eslint-config-egg" -} diff --git a/packages/nacos-naming/.travis.yml b/packages/nacos-naming/.travis.yml deleted file mode 100644 index 994b4c3..0000000 --- a/packages/nacos-naming/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ - -language: node_js -node_js: - - '8' - - '10' - - '12' -before_install: - - npm i npminstall -g -install: - - npminstall -script: - - npm run ci -after_script: - - npminstall codecov && codecov diff --git a/packages/nacos-naming/jest.config.js b/packages/nacos-naming/jest.config.js new file mode 100644 index 0000000..34f2d76 --- /dev/null +++ b/packages/nacos-naming/jest.config.js @@ -0,0 +1,7 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testPathIgnorePatterns: ['/test/fixtures'], + coveragePathIgnorePatterns: ['/test/'], + setupFilesAfterEnv: ['./jest.setup.js'], +}; diff --git a/packages/nacos-naming/jest.setup.js b/packages/nacos-naming/jest.setup.js new file mode 100644 index 0000000..1399c91 --- /dev/null +++ b/packages/nacos-naming/jest.setup.js @@ -0,0 +1 @@ +jest.setTimeout(30000); diff --git a/packages/nacos-naming/package.json b/packages/nacos-naming/package.json index aa56413..ed1c632 100644 --- a/packages/nacos-naming/package.json +++ b/packages/nacos-naming/package.json @@ -8,14 +8,9 @@ "index.js" ], "scripts": { - "autod": "autod", - "lint": "eslint . --ext .js", - "cov": "TEST_TIMEOUT=20000 egg-bin cov", - "test": "npm run lint && npm run test-local", - "test-local": "egg-bin test", - "pkgfiles": "egg-bin pkgfiles --check", - "ci": "npm run autod -- --check && npm run pkgfiles && npm run lint && npm run cov", - "contributors": "contributors -f plain -o AUTHORS" + "test": "jest", + "cov": "jest --coverage --forceExit", + "ci": "npm run cov" }, "repository": { "type": "git", @@ -36,10 +31,6 @@ "engines": { "node": ">= 8.0.0" }, - "ci": { - "type": "travis", - "version": "8, 10, 12" - }, "dependencies": { "address": "^1.1.0", "mz-modules": "^2.1.0", @@ -49,13 +40,7 @@ "uuid": "^3.3.2" }, "devDependencies": { - "autod": "^3.1.0", "await-event": "^2.1.0", - "contributors": "^0.5.1", - "egg-bin": "^4.13.1", - "egg-ci": "^1.11.0", - "eslint": "^5.16.0", - "eslint-config-egg": "^7.3.1", "mm": "^2.5.0", "mz-modules": "^2.1.0" } diff --git a/packages/nacos-naming/test/naming/client.test.js b/packages/nacos-naming/test/naming/client.test.js index 4c90e13..fa00c38 100644 --- a/packages/nacos-naming/test/naming/client.test.js +++ b/packages/nacos-naming/test/naming/client.test.js @@ -28,7 +28,7 @@ const serviceName = 'nodejs.test.' + process.versions.node; describe('test/naming/client.test.js', () => { let client; - before(async function() { + beforeAll(async function() { client = new NacosNamingClient({ logger, serverList: '127.0.0.1:8848', @@ -36,7 +36,7 @@ describe('test/naming/client.test.js', () => { await client.ready(); }); afterEach(mm.restore); - after(async () => { + afterAll(async () => { await client.close(); }); diff --git a/packages/nacos-naming/test/naming/host_reactor.test.js b/packages/nacos-naming/test/naming/host_reactor.test.js index b5c0649..59f6837 100644 --- a/packages/nacos-naming/test/naming/host_reactor.test.js +++ b/packages/nacos-naming/test/naming/host_reactor.test.js @@ -30,14 +30,14 @@ const serviceNameWithGroup = groupName + '@@' + serviceName; describe('test/naming/host_reactor.test.js', () => { let serverProxy; - before(async () => { + beforeAll(async () => { serverProxy = new NameProxy({ logger, serverList: '127.0.0.1:8848', }); await serverProxy.ready(); }); - after(async () => { + afterAll(async () => { await serverProxy.close(); }); afterEach(mm.restore); diff --git a/packages/nacos-naming/test/naming/proxy.test.js b/packages/nacos-naming/test/naming/proxy.test.js index 2cf0944..1bfab77 100644 --- a/packages/nacos-naming/test/naming/proxy.test.js +++ b/packages/nacos-naming/test/naming/proxy.test.js @@ -200,14 +200,14 @@ describe('test/naming/proxy.test.js', () => { describe('endpoint', () => { let server; - before(done => { + beforeAll(done => { server = http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'application/text' }); res.end('127.0.0.1:8848'); }); server.listen(8849, done); }); - after(done => { + afterAll(done => { server.once('close', done); server.close(); }); diff --git a/packages/nacos/package.json b/packages/nacos/package.json index 3cd9915..6c18429 100644 --- a/packages/nacos/package.json +++ b/packages/nacos/package.json @@ -15,28 +15,12 @@ "nacos-config": "^2.1.0", "nacos-naming": "^2.1.0" }, - "devDependencies": { - "@types/mocha": "^5.2.5", - "@types/node": "^10.9.4", - "contributors": "^0.5.1", - "midway-bin": "^0.3.2", - "mm": "^2.4.1", - "pedding": "^1.1.0", - "tslint": "^5.11.0", - "typescript": "^3.2.2" - }, "engines": { "node": ">= 8.0.0" }, "scripts": { - "autod": "midway-bin autod", - "lint": "tslint . --ext .ts", - "test": "npm run test-local", - "test-local": "TEST_REPORTER=spec midway-bin test --ts", - "cov": "TEST_REPORTER=spec midway-bin cov --ts", - "contributors": "contributors", - "ci": "npm run lint && npm run cov", - "build": "midway-bin build --ts" + "build": "tsc", + "ci": "" }, "files": [ "d.ts", diff --git a/packages/nacos/tsconfig.json b/packages/nacos/tsconfig.json index b41c015..324fe88 100644 --- a/packages/nacos/tsconfig.json +++ b/packages/nacos/tsconfig.json @@ -1,21 +1,11 @@ { + "extends": "../../tsconfig.json", + "compileOnSave": true, "compilerOptions": { - "target": "ES2017", - "module": "commonjs", - "moduleResolution": "node", - "experimentalDecorators": true, - "noImplicitThis": true, - "noUnusedLocals": true, - "stripInternal": true, - "pretty": true, - "declaration": true, - "outDir": "dist", - "lib": ["es2017"], - "sourceMap": true + "rootDir": "src", + "outDir": "dist" }, - "exclude": [ - "dist", - "node_modules", - "test" + "include": [ + "./src/**/*.ts" ] } diff --git a/scripts/cov.sh b/scripts/cov.sh deleted file mode 100644 index ec92293..0000000 --- a/scripts/cov.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e -cwd=`pwd` -lerna run cov -rm -rf "${cwd}/.nyc_output" || true -mkdir "${cwd}/.nyc_output" -# cp -r ./packages/*/.nyc_output/* $cwd/.nyc_output/ || true -# cp -r ./packages/*/node_modules/.nyc_output/* $cwd/.nyc_output/ || true -# ./node_modules/.bin/nyc report diff --git a/scripts/startup.sh b/scripts/startup.sh new file mode 100755 index 0000000..8d20aa7 --- /dev/null +++ b/scripts/startup.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +echo $JAVA_HOME +java -version +wget https://github.com/alibaba/nacos/releases/download/2.0.1/nacos-server-2.0.1.tar.gz +tar xf nacos-server-2.0.1.tar.gz + +chmod +x ./nacos/bin/startup.sh +nohup ./nacos/bin/startup.sh -m standalone 2>&1 & +sleep 30 +cat nohup.out +curl "127.0.0.1:8848/nacos/v1/ns/operator/metrics" \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..3e1f3d9 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "./node_modules/mwts/tsconfig-midway.json", + "compileOnSave": true, + "compilerOptions": { + "moduleResolution": "node", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "stripInternal": true, + // TODO: enable strict checks + "noImplicitReturns": false, + "strict": false, + // TODO: Emit test files to outDir + "noEmitOnError": false, + "skipLibCheck": true + }, + "exclude": [ + "dist", + "node_modules", + "test" + ] +}