Skip to content

Commit 6a9983b

Browse files
committed
remove lerna to simplify folder structure
1 parent 02a8935 commit 6a9983b

30 files changed

+2562
-309
lines changed
File renamed without changes.

docs/unit-test.md

+1-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
11
# Unit Test
22

3-
To test your Vue component, you can enable either `AVA` or `Karma` during the process of generating a new project.
4-
5-
![preview](https://ooo.0o0.ooo/2017/05/23/5924596cbe646.png)
6-
7-
## AVA
8-
9-
Basically the default setup is based on AVA's offical [Vue.js recipe](https://github.com/avajs/ava/blob/master/docs/recipes/vue.md).
10-
11-
Check out `./test/test.js` for an example test case, and `./test/helpers/setup.js` for how we transform `.vue` and `.js` files.
12-
13-
## Karma
14-
15-
By default Karma uses mocha and chrome to run your tests, you can choose your own assetion library like [chai](http://chaijs.com).
16-
17-
To run it in watch mode, you can type: `yarn test -- --watch`.
18-
19-
For all the available options, please head to [poi-preset-karma](https://github.com/egoist/poi/tree/master/packages/poi-preset-karma#options)
3+
Refer to [Tyu](https://github.com/egoist/tyu) which is using Jest under the hood.

lerna.json

-16
This file was deleted.

package.json

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
11
{
2-
"private": true,
32
"name": "create-vue-app",
43
"version": "0.0.0",
5-
"description": "create-vue-app mono-repo",
6-
"main": "index.js",
4+
"description": "Create Vue app with no build configurations",
75
"scripts": {
8-
"test": "lerna bootstrap && lerna run test && npm run lint",
6+
"test": "npm run lint && ava",
7+
"ava": "ava test/test.js",
98
"lint": "xo"
109
},
10+
"bin": "cli.js",
11+
"files": [
12+
"sao.js",
13+
"cli.js",
14+
"template"
15+
],
1116
"repository": "[email protected]:egoist/create-vue-app.git",
1217
"author": "EGOIST <[email protected]>",
1318
"license": "MIT",
1419
"devDependencies": {
20+
"ava": "^0.24.0",
1521
"eslint-config-rem": "^3.1.0",
1622
"lerna": "^2.0.0-rc.5",
1723
"xo": "^0.18.2"
1824
},
25+
"dependencies": {
26+
"cac": "^4.2.0",
27+
"sao": "^0.22.2",
28+
"superb": "^1.3.0",
29+
"template-vue": "^2.5.10",
30+
"update-notifier": "^2.1.0"
31+
},
1932
"xo": {
2033
"extends": "rem/prettier",
2134
"ignores": [
22-
"packages/template-vue/template/**/*"
35+
"template/**"
2336
],
2437
"rules": {
2538
"ava/no-ignored-test-files": 0

packages/create-vue-app/package.json

-22
This file was deleted.

packages/template-vue/package.json

-25
This file was deleted.

packages/template-vue/template/package.json

-50
This file was deleted.

packages/template-vue/template/test/helpers/setup.js

-12
This file was deleted.

packages/template-vue/template/test/test.js

-11
This file was deleted.

packages/template-vue/test.js

-73
This file was deleted.

packages/template-vue/sao.js sao.js

+1-14
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@ module.exports = {
1010
message: 'How would your descripe your superb project',
1111
default: `My ${superb()} Vue project`
1212
},
13-
test: {
14-
type: 'list',
15-
default: 'disable',
16-
message: 'Choose a test runner for unit tests',
17-
choices: [
18-
{ name: 'Disable', value: 'disable' },
19-
{ name: 'AVA', value: 'ava' },
20-
{ name: 'Karma', value: 'karma' }
21-
],
22-
store: true
23-
},
2413
pwa: {
2514
type: 'confirm',
2615
default: true,
@@ -49,11 +38,9 @@ module.exports = {
4938
gitignore: '.gitignore'
5039
},
5140
filters: {
52-
'src/components/App.test.js': 'test === "karma"',
5341
'src/pwa.js': 'pwa',
5442
'static/manifest.json': 'manifest',
55-
'static/icons/**': 'manifest',
56-
'test/**': 'test === "ava"'
43+
'static/icons/**': 'manifest'
5744
},
5845
gitInit: true,
5946
installDependencies: true,
File renamed without changes.

packages/template-vue/template/README.md template/README.md

+3-22
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ You can replace `yarn` with `npm run` here.
1111
yarn build
1212

1313
# development mode
14-
yarn dev<% if (test !== 'disable') { %>
14+
yarn dev
1515

1616
# run unit tests
17-
yarn test<% } %>
17+
yarn test
1818

1919
# serve the bundled dist folder in production mode
2020
yarn serve
@@ -24,10 +24,6 @@ yarn serve
2424

2525
By default we only polyfill `window.Promise` and `Object.assign`. You can add more polyfills in `./src/polyfills.js`.
2626

27-
## Code splitting
28-
29-
As webpack supports both [dynamic import](https://webpack.js.org/guides/code-splitting-async/#dynamic-import-import-) and [`require.ensure`](https://webpack.js.org/guides/code-splitting-async/#require-ensure-) syntax, we would recommend you to stick to `require.ensure` for now because of [performance issue](https://github.com/webpack/webpack/issues/4636).
30-
3127
## Analyze bundle size
3228

3329
Run `yarn report` to get a report of bundle size which helps you:
@@ -37,21 +33,6 @@ Run `yarn report` to get a report of bundle size which helps you:
3733
- Find modules that got there by mistake
3834
- Optimize it!
3935

40-
<% if (test === 'karma') { -%>
41-
## Test
42-
43-
By default Karma uses mocha and chrome to run your tests, you can choose your own assetion library like [chai](http://chaijs.com).
44-
45-
To run it in watch mode, you can type: `yarn test -- --watch`.
46-
47-
For all the available options, please head to [poi-preset-karma](https://github.com/egoist/poi/tree/master/packages/poi-preset-karma#options).<% } else if (test === 'ava') { %>
48-
## Test
49-
50-
You can use [AVA](https://github.com/avajs/ava) to run tests, basically the default setup is based on AVA's offical [Vue.js recipe](https://github.com/avajs/ava/blob/master/docs/recipes/vue.md).
51-
52-
Check out `./test/test.js` for an example test case, and `./test/helpers/setup.js` for how we transform `.vue` and `.js` files.
53-
<% } -%>
54-
5536
<% if (pwa){ -%>
5637
## Progress Web App
5738

@@ -64,4 +45,4 @@ For all the available options, please head to [poi-preset-offline](https://githu
6445
<% } %>
6546
---
6647

67-
This project is generated by [create-vue-app](https://github.com/egoist/create-vue-app).
48+
This project is generated by [create-vue-app](https://github.com/vue-land/create-vue-app).
File renamed without changes.
File renamed without changes.

template/package.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"private": true,
3+
"name": "<%= name %>",
4+
"productName": "<%= name %>",
5+
"description": "<%= description %>",
6+
"version": "0.0.0",
7+
"license": "MIT",
8+
"scripts": {
9+
"dev": "poi",
10+
"build": "poi build",
11+
"report": "poi build --bundle-report",
12+
"serve": "serve dist --single",
13+
"test": "tyu"
14+
},
15+
"author": {
16+
"name": "<%= username %>",
17+
"email": "<%= email %>"
18+
},
19+
"dependencies": {<% if (pwa) { %>
20+
"offline-plugin": "^4.8.0",<% } %>
21+
"normalize.css": "^7.0.0",
22+
"object-assign": "^4.1.1",
23+
"promise-polyfill": "^6.0.2"
24+
},
25+
"devDependencies": {
26+
"poi": "^9.0.0",
27+
"poi-preset-bundle-report": "^2.0.0",
28+
"serve": "^6.1.0",
29+
"tyu": "^1.0.4"<% if (pwa) { %>,
30+
"poi-preset-offline": "^9.0.0"<% } %>
31+
}
32+
}

0 commit comments

Comments
 (0)