Skip to content

Commit de653c7

Browse files
authored
chore: use yarn workspace (#17)
* WIP: init yarn workspace with lerna * WIP: clean yarn.lock * WIP: reinstall * feat: tidy * feat: add $schema for lerna.json * WIP: ignore packages/*/dist * feat: add jest.config.js to every packages * feat: delete unnecessary rule * feat: modify includes path * feat: add huskyrc and lintstaged rc file * feat: remove husky, lintstaged config from pkg * feat: hosting webpack config to root * feat: hosting devDependences in root * feat: del unuse ts compilerOptions * feat: change rc file * feat: rebuild * chore: update yarn.lock * chore: update test command * feat: complete test coverage
1 parent 437dfbc commit de653c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+5233
-19423
lines changed

β€Ž.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
dist
2-
webpack.*.js
2+
config
File renamed without changes.

β€Ž.gitignore

+6-26
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,21 @@
1+
# OS junk files
2+
.DS_Store
3+
14
# Logs
25
logs
36
*.log
47
npm-debug.log*
58
yarn-debug.log*
69
yarn-error.log*
710

8-
# Runtime data
9-
pids
10-
*.pid
11-
*.seed
12-
*.pid.lock
13-
14-
# Directory for instrumented libs generated by jscoverage/JSCover
15-
lib-cov
16-
1711
# Coverage directory used by tools like istanbul
1812
coverage
1913

20-
# nyc test coverage
21-
.nyc_output
22-
23-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24-
.grunt
25-
26-
# Bower dependency directory (https://bower.io/)
27-
bower_components
28-
29-
# node-waf configuration
30-
.lock-wscript
31-
32-
# Compiled binary addons (http://nodejs.org/api/addons.html)
33-
build/Release
14+
# build
15+
dist/
3416

3517
# Dependency directories
3618
node_modules/
37-
jspm_packages/
3819

3920
# Optional npm cache directory
4021
.npm
@@ -55,6 +36,5 @@ jspm_packages/
5536
.env
5637

5738
# lerna
58-
/packages/*/node_modules
59-
6039
.changelog
40+

β€Ž.huskyrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
$schema: 'http://json.schemastore.org/huskyrc',
3+
hooks: {
4+
'pre-commit': 'lint-staged'
5+
}
6+
};

β€Ž.lintstagedrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
$schema: 'http://json.schemastore.org/lintstagedrc.schema',
3+
'**/*.{js, ts}': ['prettier --write', 'eslint --fix', 'git add']
4+
};
File renamed without changes.
File renamed without changes.

β€Žjest.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
collectCoverage: true
4+
};

β€Žlerna.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
2+
"$schema": "http://json.schemastore.org/lerna",
23
"version": "0.0.1-alpha.3",
4+
"useWorkspaces": true,
35
"npmClient": "yarn",
46
"changelog": {
57
"repo": "mjolnirjs/yab",
68
"cacheDir": ".changelog"
7-
},
8-
"packages": [
9-
"packages/*"
10-
]
9+
}
1110
}

β€Žpackage.json

+36-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "yab",
33
"private": true,
4+
"workspaces": [
5+
"packages/*"
6+
],
47
"repository": {
58
"type": "git",
69
"url": "https://github.com/mjolnirjs/yab"
@@ -11,17 +14,45 @@
1114
},
1215
"homepage": "https://github.com/mjolnirjs/yab#readme",
1316
"scripts": {
14-
"postinstall": "lerna clean --yes && lerna bootstrap",
17+
"start": "jest --watch",
1518
"clean": "lerna run clean --parallel",
1619
"changelog": "lerna-changelog",
17-
"build": "lerna exec -- npm run build",
18-
"lint": "lerna run lint",
19-
"test": "lerna run test",
20+
"build": "lerna run build",
21+
"lint": "lerna run lint --parallel",
22+
"test": "jest",
2023
"publish": "lerna publish",
2124
"release": "npm run test && npm run build && npm run publish"
2225
},
2326
"devDependencies": {
27+
"@types/jest": "^24.0.15",
28+
"@types/node": "^10.14.7",
29+
"@typescript-eslint/eslint-plugin": "^1.9.0",
30+
"@typescript-eslint/parser": "^1.9.0",
31+
"eslint": "^5.16.0",
32+
"eslint-config-airbnb-base": "^13.1.0",
33+
"eslint-config-prettier": "^6.0.0",
34+
"eslint-loader": "^2.2.1",
35+
"eslint-plugin-import": "^2.17.3",
36+
"eslint-plugin-prettier": "^3.1.0",
37+
"husky": "^3.0.1",
38+
"prettier": "^1.17.1",
2439
"lerna": "^3.15.0",
25-
"lerna-changelog": "^0.8.2"
40+
"lerna-changelog": "^0.8.2",
41+
"jest": "^24.8.0",
42+
"ts-jest": "^24.0.2",
43+
"lint-staged": "^9.2.0",
44+
"rimraf": "^2.6.3",
45+
"typescript": "^3.5.3",
46+
"cache-loader": "^4.0.1",
47+
"case-sensitive-paths-webpack-plugin": "^2.2.0",
48+
"cross-env": "^5.2.0",
49+
"fork-ts-checker-notifier-webpack-plugin": "^1.0.2",
50+
"fork-ts-checker-webpack-plugin": "^1.4.3",
51+
"friendly-errors-webpack-plugin": "^1.7.0",
52+
"terser-webpack-plugin": "^1.3.0",
53+
"ts-loader": "^6.0.4",
54+
"webpack": "^4.35.3",
55+
"webpack-cli": "^3.3.6",
56+
"webpack-merge": "^4.2.1"
2657
}
2758
}

β€Žpackages/yab-fetch-cache/.editorconfig

-6
This file was deleted.

β€Žpackages/yab-fetch-cache/.eslintignore

-2
This file was deleted.

β€Žpackages/yab-fetch-cache/.gitignore

-94
This file was deleted.

β€Žpackages/yab-fetch-cache/config/utils.js

-10
This file was deleted.

β€Žpackages/yab-fetch-cache/config/webpack.config.base.js

-36
This file was deleted.

β€Žpackages/yab-fetch-cache/config/webpack.config.dev.js

-50
This file was deleted.
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
2-
preset: 'ts-jest'
2+
preset: 'ts-jest',
3+
collectCoverage: true
34
};

0 commit comments

Comments
Β (0)