Skip to content

Commit

Permalink
feat: eva工程构建更新
Browse files Browse the repository at this point in the history
  • Loading branch information
yitan.lgh committed Dec 4, 2020
1 parent 7424381 commit 5d5d3fc
Show file tree
Hide file tree
Showing 420 changed files with 3,331 additions and 602 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ lib
dist
build
coverage
scripts
13 changes: 13 additions & 0 deletions README-en-Us.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# universal-api

To extend the capabilities of the Rax system, we provide a series of Universal apis that developers can use to quickly develop multiple applications.

## Quick-start
```bash
$ npm run start
```

## Build
```bash
$ npm run build
```
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,47 @@ To extend the capabilities of the Rax system, we provide a series of Universal a

## Quick-start
```bash
$ npm run start
$ npm i evapi
```

## Build
```bash
```全部构建
$ npm run build
```

```构建大包
$ npm run build:main
```

```构建全部小包
$ npm run build:all
```

```构建单个指定小包
$ npm run build env
```

### api-config
根目录下的api-config作为api的版本以及信息维护地,可以再这里增删api,指定api版本,依赖,以及名称

小包的依赖都不会被打入包内,公共依赖为universal-env

大包的构建根据api-config中配置的api自动生成index,大包只有一个依赖:@babel/runtime-corejs3


## publish
```全部发布
$ npm run pub
```

```发布大包
$ npm run pub:main
```

```发布全部小包
$ npm run pub:all
```

```发布单个指定小包
$ npm run pub env
```
68 changes: 68 additions & 0 deletions api-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
module.exports = {
env: {
path: 'packages/base/env/src/index.ts',
pkgInfo: [
{
version: '3.2.2',
name: 'universal-env',
}
]
},
'unitTool': {
path: 'packages/base/unit-tool/src/index.ts',
pkgInfo: [
{
version: '1.0.0',
name: 'universal-unit-tool',
dependencies: {
'universal-device': '^2.1.1'
},
}
]
},
'canvasContext': {
path: 'packages/canvas/canvas-context/src/index.ts',
pkgInfo: [
{
version: '1.0.0',
name: 'universal-canvas-context',
}
]
},
'accelerometer': {
path: 'packages/equipment/accelerometer/src/index.ts',
pkgInfo: [
{
version: '1.0.1',
name: 'universal-accelerometer',
}
]
},
'clipboard': {
path: 'packages/equipment/clipboard/src/index.ts',
pkgInfo: [
{
version: '1.2.0',
name: 'universal-clipboard',
}
]
},
'device': {
path: 'packages/equipment/device/src/index.ts',
pkgInfo: [
{
version: '2.3.1',
name: 'universal-device',
}
]
},
'networkInfo': {
path: 'packages/equipment/network-info/src/index.ts',
pkgInfo: [
{
version: '1.0.0',
name: 'universal-network',
}
]
},
};
60 changes: 56 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,82 @@
{
"name": "root",
"name": "evapi",
"private": true,
"scripts": {
"bootstrap": "lerna bootstrap",
"lint": "eslint --ext .js --ext .jsx --ext .ts --ext .tsx ./packages/*/src --fix",
"start": "node ./scripts/compile-packages.js --watch",
"build": "node ./scripts/compile-packages.js",
"build": "cross-env node ./scripts/build.js",
"build:all": "cross-env BUILD_TYPE=all node ./scripts/build.js",
"build:main": "cross-env BUILD_TYPE=main node ./scripts/build.js",
"pub": "cross-env node ./scripts/publish.js",
"pub:all": "cross-env BUILD_TYPE=all node ./scripts/publish.js",
"pub:main": "cross-env BUILD_TYPE=main node ./scripts/publish.js",
"build1": "node ./scripts/compile-packages.js",
"check-and-publish": "node ./scripts/check-and-publish.js",
"transform:docs": "node scripts/compile-readme.js"
},
"dependencies": {
"@babel/runtime-corejs3": "^7.11.0"
},
"devDependencies": {
"@babel/cli": "^7.10.4",
"@babel/core": "^7.6.4",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-decorators": "^7.7.4",
"@babel/plugin-proposal-do-expressions": "^7.7.4",
"@babel/plugin-proposal-export-default-from": "^7.7.4",
"@babel/plugin-proposal-export-namespace-from": "^7.7.4",
"@babel/plugin-proposal-function-bind": "^7.7.4",
"@babel/plugin-proposal-function-sent": "^7.7.4",
"@babel/plugin-proposal-json-strings": "^7.7.4",
"@babel/plugin-proposal-logical-assignment-operators": "^7.7.4",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4",
"@babel/plugin-proposal-numeric-separator": "^7.7.4",
"@babel/plugin-proposal-object-rest-spread": "^7.7.7",
"@babel/plugin-proposal-optional-chaining": "^7.7.5",
"@babel/plugin-proposal-pipeline-operator": "^7.7.7",
"@babel/plugin-proposal-throw-expressions": "^7.7.4",
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/plugin-syntax-import-meta": "^7.7.4",
"@babel/plugin-transform-runtime": "^7.7.6",
"@babel/preset-env": "^7.6.3",
"@babel/preset-react": "^7.12.7",
"@babel/preset-typescript": "^7.7.7",
"@rollup/plugin-alias": "^3.1.1",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^1.7.0",
"@typescript-eslint/parser": "^1.7.0",
"axios": "^0.19.0",
"babel-eslint": "^10.0.1",
"chalk": "^2.4.2",
"chalk": "^4.1.0",
"chokidar": "^3.1.0",
"cross-env": "^7.0.2",
"eslint": "^5.15.1",
"eslint-config-rax": "^0.0.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-react": "7.20.3",
"fs-extra": "^9.0.1",
"glob": "^7.1.4",
"husky": "^4.2.5",
"koa-compose": "^4.1.0",
"lerna": "^3.13.2",
"minimist": "^1.2.0",
"rax-scripts": "^2.0.2",
"rimraf": "^3.0.2",
"rollup": "^2.32.0",
"rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-copy": "^3.3.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-filesize": "^9.0.2",
"rollup-plugin-progress": "^1.1.2",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.29.0",
"rollup-plugin-visualizer": "^4.1.2",
"semver": "^6.3.0",
"typescript": "^3.6.3"
"shelljs": "^0.8.4",
"typescript": "^3.9.6"
}
}
33 changes: 0 additions & 33 deletions packages/accelerometer/package.json

This file was deleted.

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.
3 changes: 2 additions & 1 deletion packages/env/src/index.ts → packages/base/env/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ declare const my: any;
declare const wx: any;
declare const tt: any;
declare const global: any;
declare const process: any;

function isUndef(type): boolean {
function isUndef(type: string): boolean {
return type === 'undefined';
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 0 additions & 17 deletions packages/canvas-context/tsconfig.json

This file was deleted.

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.
13 changes: 0 additions & 13 deletions packages/clipboard/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions packages/clipboard/.npmignore

This file was deleted.

48 changes: 0 additions & 48 deletions packages/clipboard/package.json

This file was deleted.

31 changes: 0 additions & 31 deletions packages/clipboard/tsconfig.json

This file was deleted.

Loading

0 comments on commit 5d5d3fc

Please sign in to comment.