Skip to content

Commit ceecefb

Browse files
committed
chore: refactor project
1 parent 8cea37f commit ceecefb

36 files changed

Lines changed: 229 additions & 115 deletions

Web/DEVELOPMENT.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
TODO
66

77
### 开发
8+
9+
#### 安装
10+
1. 执行 `npm run bootstrap`安装相关依赖
811
#### Dev 开发
9-
1. `npm install` 安装相关依赖
10-
2. `npm run dev` 开启 Dev 服务
11-
3. 浏览器访问 `http://localhost:3000/playground` 即可
12+
1. `npm run dev:playground` 开启 Dev 服务
13+
2. 浏览器访问 `http://localhost:3000/playground` 即可
1214

1315
#### Build
1416
1. 执行 `npm run build`即可

Web/__tests__/dokit.test.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

Web/__tests__/fixture/index.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

Web/lerna.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"packages": [
3+
"packages/*"
4+
],
5+
"version": "0.0.0",
6+
"npmClient": "npm",
7+
"command": {
8+
"publish": {
9+
"allowBranch": [
10+
"main",
11+
"release"
12+
],
13+
"ignoreChanges": [
14+
"lerna.json"
15+
],
16+
"registry": "https://registry.npmjs.org/"
17+
},
18+
"npmClientArgs": [
19+
"--no-lockfile"
20+
]
21+
}
22+
}

Web/package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@
44
"description": "a web toolkit powered by Dokit",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1",
8-
"build": "node scripts/build.js",
9-
"dev": "node scripts/dev.js"
7+
"bootstrap": "npm install && lerna bootstrap",
8+
"build": "lerna run build",
9+
"dev": "lerna run dev",
10+
"dev:playground": "node scripts/dev-playground.js & npm run dev",
11+
"clean": "lerna clean --yes && rm -rf ./packages/**/package-lock.json",
12+
"clean:lock": "rm -rf ./package-lock.json && rm -rf ./packages/**/package-lock.json"
1013
},
1114
"author": "caoenze",
1215
"license": "ISC",
1316
"devDependencies": {
1417
"@vue/compiler-sfc": "^3.0.7",
1518
"execa": "^5.0.0",
19+
"lerna": "^4.0.0",
1620
"less": "^4.1.1",
1721
"open": "^8.0.6",
1822
"rollup": "^2.41.1",
@@ -24,6 +28,7 @@
2428
"serve-handler": "^6.1.3"
2529
},
2630
"dependencies": {
31+
"rollup-plugin-terser": "^7.0.2",
2732
"vue": "^3.0.7"
2833
}
2934
}

Web/packages/core/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# `utils`
2+
3+
> TODO: description
4+
5+
## Usage
6+
7+
```
8+
const utils = require('utils');
9+
10+
// TODO: DEMONSTRATE API
11+
```
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
const utils = require('..');
4+
5+
describe('utils', () => {
6+
it('needs tests');
7+
});

Web/packages/core/package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "@dokit/web-core",
3+
"version": "0.0.0",
4+
"description": "Dokit",
5+
"keywords": [
6+
"Dokit"
7+
],
8+
"author": "duanlikang <[email protected]>",
9+
"homepage": "https://github.com/didi/DoraemonKit#readme",
10+
"license": "ISC",
11+
"main": "dist/main.js",
12+
"directories": {
13+
"lib": "lib",
14+
"test": "__tests__"
15+
},
16+
"files": [
17+
"lib"
18+
],
19+
"publishConfig": {
20+
"registry": "https://registry.npm.taobao.org/"
21+
},
22+
"repository": {
23+
"type": "git",
24+
"url": "git+https://github.com/didi/DoraemonKit.git"
25+
},
26+
"scripts": {
27+
"test": "echo \"Error: run tests from root\" && exit 1"
28+
},
29+
"bugs": {
30+
"url": "https://github.com/didi/DoraemonKit/issues"
31+
}
32+
}

Web/packages/core/src/index.js

Whitespace-only changes.

Web/packages/core/src/utils.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
module.exports = utils;
4+
5+
function utils() {
6+
// TODO
7+
}

0 commit comments

Comments
 (0)