-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(*): 用 lerna 转 teambition-sdk 为多包单项目(monorepos)
主要包为: - teambition-sdk-core:包含较基础的代码 - teambition-sdk-request:包含接口代码,期待能够更快地相应应用需求,独 立更新 将使用 lift 的接口也包含在 fetches 包内 ...并将相关 helper 函数和类型定义移到 fetches 包内。 save sdk-request: 添加扩充 SDK 和 SDKFetch 对象的机制 sdk-request: 令现有测试跑起来 初步实现在跟目录上跑全局测试的脚本 ...待完成:完善 teambition-sdk-request 的测试。 基本完成 teambition-sdk-request 相关测试,同时令mock成为packaege之一 基本完成对测试的分离和整理,并令 fixture 成为一个私有包 修复 core 和 reuqest 包的 watch 脚本,这两个包都可以执行 yarn watch 避免 watch 生成的 background process 在退出测试后继续跑 ...相关命令: `npm run watch_test & ts-node ../../tools/tasks/test.ts $!` 即:令 watch_test 作为 background process 跑,及时将 test 目录下的代码 更新编译到 spec-js 目录,同时有 test.ts 的 nodejs 进程作为 foreground process 在跑,及时在最新的 spec-js 目录上运行测试代码。当用户输入 Ctrl+C,即:SIGINT 信号,作为 foreground process 跑的 test.ts 会被终结。 而作为 background process 跑的 watch_test 通过 process.kill($!) 也终结 掉。注:$! 符号记录最近创建的 background process 的 pid。 修复跑全局测试的脚本,在根目录跑 yarn test,会跑所有测试 ...包括每个 package 内的测试,以及根目录下 test/ 里的测试。 调整个别测试 修复 circle.yml,“修复” coverage,修复 .travis.yml 将顶层 test 里包含的 asyncLoadRDB 测试下移至 teambition-sdk-request 内 ...简化项目结构 将 fixture 和 mock 放置到 teambition-sdk-testutil 包内 ...简化项目结构。 修复 lint,并在代码中做相应调整,消除 lint 报错:no-shadowed-variables
- Loading branch information
Showing
151 changed files
with
1,891 additions
and
470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"exclude": [ | ||
"**/teambition-sdk-testutil/**", | ||
"**/teambition-sdk-core/spec-js/src/teambition.js", | ||
"**/teambition-sdk-core/spec-js/src/utils/internalTypes.js" | ||
], | ||
"include": [ | ||
"**/spec-js/src/**" | ||
], | ||
"extension": [ | ||
".ts" | ||
], | ||
"reporter": ["html", "lcov"], | ||
"all": true, | ||
"cache": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
registry "https://registry.npmjs.org" | ||
|
||
workspaces-experimental true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"lerna": "2.0.0", | ||
"version": "independent", | ||
"npmClient": "yarn", | ||
"useWorkSpaces": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ | ||
"name": "teambition-sdk-core", | ||
"version": "0.8.13", | ||
"description": "Front-End SDK (Core) for Teambition", | ||
"main": "./dist/cjs/index.js", | ||
"typings": "./dist/cjs/index.d.ts", | ||
"scripts": { | ||
"build_all": "rm -rf dist && mkdir dist && mkdir dist/bundle && npm run build_es6 && npm run build_cjs && npm run build_bundle && npm run build_mock && npm run build_mock_cjs && npm run build_test && npm run build_socket", | ||
"build_bundle": "rm -rf dist/bundle/tbsdk.umd.js && ts-node ./tools/tasks/bundle.sdk.ts", | ||
"build_cjs": "rm -rf dist/cjs && tsc src/index.ts -m commonjs --outDir dist/cjs --sourcemap --inlineSources --target ES5 -d --diagnostics --pretty --strict --noUnusedLocals --noUnusedParameters --experimentalDecorators --suppressImplicitAnyIndexErrors --moduleResolution node --importHelpers --noEmitHelpers --lib es5,es2015.iterable,es2015.collection,es2015.promise,es2015.core,dom", | ||
"build_es6": "rm -rf dist/es6 && tsc src/index.ts -m es2015 --outDir dist/es6 --sourcemap --inlineSources --target ES2015 -d --diagnostics --pretty --strict --noUnusedLocals --noUnusedParameters --experimentalDecorators --suppressImplicitAnyIndexErrors --moduleResolution node --importHelpers --noEmitHelpers --lib es5,es2015.iterable,es2015.collection,es2015.promise,es2015.core,dom", | ||
"build_mock": "rm -rf dist/mock-es6 && tsc mock/index.ts -m es2015 --outDir dist/mock-es6 --sourcemap --inlineSources --target ES5 -d --diagnostics --pretty --strict --noUnusedLocals --noUnusedParameters --experimentalDecorators --suppressImplicitAnyIndexErrors --moduleResolution node --lib es5,es2015.iterable,es2015.collection,es2015.promise,es2015.core,dom && ts-node ./tools/tasks/bundle.mock.ts", | ||
"build_mock_cjs": "rm -rf dist/mock-cjs && tsc mock/index.ts -m commonjs --outDir dist/mock-cjs --sourcemap --inlineSources --target ES5 -d --diagnostics --pretty --strict --noUnusedLocals --noUnusedParameters --experimentalDecorators --suppressImplicitAnyIndexErrors --moduleResolution node --lib es5,es2015.iterable,es2015.collection,es2015.promise,es2015.core,dom", | ||
"build_socket": "rm -rf dist/bundle/tbsdk.socket.js && tsc ./src/SocketApp.ts ./src/teambition.ts -m commonjs --outDir dist/socket --sourcemap --inlineSources --target ES5 -d --diagnostics --pretty --experimentalDecorators --suppressImplicitAnyIndexErrors --moduleResolution node --lib es5,es2015.iterable,es2015.collection,es2015.promise,es2015.core,dom && ts-node ./tools/tasks/bundle.socket.ts", | ||
"build_test": "rm -rf spec-js && tsc --project test", | ||
"copy_files": "cp README.md package.json ./dist/cjs/", | ||
"lint": "tslint --project . --config ../../tslint.json", | ||
"publish_sdk": "npm run build_all && npm run copy_files && npm publish ./dist/cjs", | ||
"publish_all": "npm run publish_sdk && ts-node ./tools/tasks/publish.ts && cp -r ./dist/mock-cjs/** ./.tmp/mock && cp -r ./dist/socket/** ./.tmp/socket && npm publish .tmp/mock/ && npm publish .tmp/socket/", | ||
"test": "npm run lint && npm run build_test && tman --mocha spec-js/test/app.js", | ||
"version": "ts-node tools/tasks/version.ts && git add .", | ||
"watch": "npm run watch_test & ts-node ../../tools/tasks/test.ts $!", | ||
"watch_cjs": "tsc src/index.ts -m commonjs --outDir dist/cjs --sourcemap --inlineSources --target ES5 -d --diagnostics --pretty --experimentalDecorators --strict --noUnusedLocals --noUnusedParameters --suppressImplicitAnyIndexErrors --moduleResolution node --skipLibCheck -w --lib es5,es2015.iterable,es2015.collection,es2015.promise,es2015.core,dom", | ||
"watch_test": "tsc --project test --watch --skipLibCheck" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://[email protected]/teambition/teambition-sdk.git" | ||
}, | ||
"keywords": [ | ||
"teambition", | ||
"sdk", | ||
"teambition-sdk" | ||
], | ||
"author": "[email protected]", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/teambition/teambition-sdk/issues" | ||
}, | ||
"homepage": "https://github.com/teambition/teambition-sdk#readme", | ||
"peerDependencies": { | ||
"reactivedb": "~0.9.9", | ||
"rrule": "2.2.0", | ||
"rxjs": "^5.2.0", | ||
"snapper-consumer": "^1.3.6", | ||
"tslib": "^1.6.0" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.0.1", | ||
"@types/lodash": "^4.14.64", | ||
"@types/lovefield": "^2.0.32", | ||
"@types/node": "^8.0.14", | ||
"@types/sinon": "^2.3.3", | ||
"@types/sinon-chai": "^2.7.28", | ||
"chai": "^4.1.0", | ||
"coveralls": "^2.13.1", | ||
"engine.io-client": "^3.1.0", | ||
"fetch-mock": "^5.10.0", | ||
"google-closure-compiler-js": "^20170521.0.0", | ||
"isomorphic-fetch": "^2.2.1", | ||
"jsonrpc-lite": "^1.2.3", | ||
"madge": "^1.6.0", | ||
"moment": "^2.18.1", | ||
"node-watch": "^0.5.4", | ||
"nyc": "^11.0.1", | ||
"reactivedb": "~0.9.9", | ||
"rollup": "^0.42.0", | ||
"rollup-plugin-alias": "^1.3.1", | ||
"rollup-plugin-commonjs": "^8.0.2", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"rrule": "2.2.0", | ||
"rxjs": "^5.4.2", | ||
"sinon": "^2.3.8", | ||
"sinon-chai": "^2.11.0", | ||
"snapper-consumer": "^1.3.6", | ||
"teambition-sdk-testutil": "^0.8.13", | ||
"tman": "^1.7.1", | ||
"ts-node": "^3.2.0", | ||
"tslib": "^1.7.1", | ||
"tslint": "^5.5.0", | ||
"tslint-eslint-rules": "^4.1.1", | ||
"typescript": "^2.4.2" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
test/mock/MockFetch.ts → ...eambition-sdk-core/test/mock/MockFetch.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
1 change: 0 additions & 1 deletion
1
test/net/index.ts → ...ges/teambition-sdk-core/test/net/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
import './asyncLoadRDB' | ||
import './net' | ||
import './http' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
test/sockets/eventParser.spec.ts → ...sdk-core/test/sockets/eventParser.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 2 additions & 1 deletion
3
test/sockets/sockets.spec.ts → ...ion-sdk-core/test/sockets/sockets.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.