Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@

I highly recommend you to try [Poi](https://github.com/egoist/poi), you can develop Vue.js app with no-config until you need it. Less boilerplate code, more happiness ❤️


Here's the plan for [VuePack 4.0](https://github.com/egoist/vuepack/issues/136), you can support my work by [donating](https://github.com/egoist/donate) or joining the development.

## Features

- Vue 2 / Vue-router / Vuex
- Hot reloading for single-file components
- Split vendor code from your app
- Webpack 2
- Webpack 2 (an update to Webpack 4 will be very soon)
- [Offline Ready, perfect for progressive web app](/docs/pwa.md)
- [ESLint](/docs/eslint.md)
- [Babel 6](/docs/babel.md)
- [PostCSS](/docs/postcss.md)
- [JSX components are supported by default](/docs/jsx.md)
- [TestCafe](/docs/testcafe.md)
- [TestCafe](/docs/testcafe.md) (optional)
- [Electron support](/docs/electron.md) (optional)
- [CSS modules](/docs/css-modules.md) (optional)
- A boilerplate which is small and focusing on client-side apps
Expand All @@ -32,35 +31,26 @@ Check out [the docs](https://github.com/egoist/vuepack/tree/master/docs) for mor

## Get Started

You'd better have `node >=4` and `npm >=3` installed:
You'd better have `node >=10` and `npm >=6` installed:

## sao

This template can be used with [sao](https://github.com/egoist/sao), which also means you can use the template offline:
This template can be used with [SAO](https://github.com/egoist/sao), which also means you can use the template offline:

```bash
yarn global add sao
npm i -g sao jstransformer-handlebars
# from npm
sao vuepack new-project
# or git repo
sao egoist/vuepack new-project
```

## vue-cli
## Vue CLI

Vue CLI (`vue-cli@2` or `@vue/cli@>=3` + `@vue/cli-init`) is still supported, but it has been deprecated by Vue officially, so it is not recommended to use Vue CLI with Vuepack.
```bash
$ npm install -g vue-cli
$ vue init egoist/vuepack new-project
$ cd new-project
$ npm install

# edit files and start developing
$ npm run dev
# bundle all scripts and styles for production use
$ npm run build

# lint your code
$ npm run lint
npm i -g @vue/cli @vue/cli-init
vue init egoist/vuepack
```

### For Windows users
Expand Down
20 changes: 15 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
{
"name": "template-vuepack",
"name": "sao-vuepack",
"scripts": {
"test": "echo lol"
},
"dependencies": {},
"version": "3.3.1",
"dependencies": {
"jstransformer-handlebars": "^1.1.0"
},
"version": "4.0.0-pre1",
"repository": {
"url": "git@github.com:egoist/vuepack.git",
"url": "git+https://github.com/egoist/vuepack.git",
"type": "git"
},
"author": "EGOIST <[email protected]>",
"license": "MIT"
"license": "MIT",
"description": "VuePack is a modern Vue.js starter",
"bugs": {
"url": "https://github.com/egoist/vuepack/issues"
},
"homepage": "https://github.com/egoist/vuepack#readme",
"publishConfig": {
"registry": "https://registry.npmjs.com"
}
}
60 changes: 0 additions & 60 deletions sao.js

This file was deleted.

80 changes: 80 additions & 0 deletions saofile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
module.exports = {
transformer: 'handlebars',
prompts() {
return [
{
name: 'name',
required: true,
message: 'Project name',
default: this.outFolder
},
{
name: 'description',
required: false,
message: 'Project description',
default: 'My Superb Vue Project'
},
{
name: 'author',
message: 'Author',
default: this.gitUser.name
},
{
name: 'eslint',
type: 'confirm',
message: 'Do you want to support ESLint?'
},
{
name: 'jsx',
type: 'confirm',
message: 'Generate components in JSX format?',
default: false
},
{
name: 'electron',
type: 'confirm',
message: 'Support Electron?',
default: false
},
{
name: 'testcafe',
type: 'confirm',
message: 'Add testcafe to run integration tests?',
default: false
}
]
},
actions() {
return [
{
type: 'add',
files: '**',
filters: {
'client/components/*.vue': '!jsx',
'client/components/**/*.{js,css}': 'jsx',
'client/views/*.vue': '!jsx',
'client/views/**/*.{js,css}': 'jsx',
'app/*': 'electron',
'.eslintrc': 'eslint',
'test/e2e/*': 'testcafe'
},
transformExclude: 'build/index.html'
}
]
},
async completed() {
const { logger, gitInit, npmInstall, chalk, outFolder } = this

gitInit.call(this)
await npmInstall.call(this)

logger.success(`Your new Vue project has been successfully generated in ${chalk.underline(outFolder)}!`)
console.log()
console.log(chalk.bold(` To get started:\n`))
console.log(` cd ${outFolder}`)
console.log(` yarn`)
console.log(` yarn dev\n`)
console.log(chalk.bold(` To build for production:\n`))
console.log(` yarn build\n`)
}
}
4 changes: 2 additions & 2 deletions template/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "vue",{{#testcafe}}
"plugins": ["testcafe"],{{/testcafe}}
"extends": "vue",{{#if testcafe}}
"plugins": ["testcafe"],{{/if}}
"rules": {
"import/no-unresolved": 0,
"import/no-unassigned-import": 0
Expand Down
4 changes: 2 additions & 2 deletions template/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
node_modules
*.log
.DS_Store
{{#electron}}
{{#if electron}}
/app/index.html
/app/assets
{{/electron}}
{{/if}}
{{#unless electron}}
/dist
{{/unless}}
2 changes: 1 addition & 1 deletion template/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# {{ name }}
# {{name}}

To start:

Expand Down
1 change: 0 additions & 1 deletion template/build/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict'
const pkg = require('../package')

module.exports = {
title: '{{name}}',
Expand Down
9 changes: 2 additions & 7 deletions template/client/components/App/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
body {
margin: 0;
font-size: 2rem;
font-family: -apple-system, BlinkMacSystemFont,
'avenir next', avenir,
helvetica, 'helvetica neue',
Ubuntu,
'segoe ui', arial,
sans-serif;
font-family: -apple-system, BlinkMacSystemFont, 'avenir next', avenir, helvetica, 'helvetica neue',Ubuntu, 'segoe ui', arial, sans-serif;
}
.page {
text-align: center;
Expand All @@ -17,4 +12,4 @@
padding: 3px 5px;
border-radius: 2px;
}
}
}
32 changes: 16 additions & 16 deletions template/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "{{ name }}",
"name": "{{name}}",
"version": "0.1.0",
"description": "{{ description }}",
"description": "<%= description %>",
"main": "client/index.js",
"scripts": {
"test": "{{#testcafe}}testcafe all test/e2e/index.js --app \"npm run dev\" --app-init-delay 10000{{/testcafe}}",
{{#if testcafe}}"test": "testcafe all test/e2e/index.js --app \"npm run dev\" --app-init-delay 10000",{{/if}}
"build": "webpack --config build/webpack.prod.js",
"dev": "node build/server.js"{{#electron}},
"app": "cross-env NODE_ENV=development electron app/"{{/electron}}{{#eslint}},
"lint": "xo **/client/**/*.{vue,js}{{#electron}} **/app/**/*.js{{/electron}} !node_modules/**"
{{/eslint}}
"dev": "node build/server.js"{{#if electron}},
"app": "cross-env NODE_ENV=development electron app/"{{/if}}{{#if eslint}},
"lint": "xo **/client/**/*.{vue,js}{{#if electron}} **/app/**/*.js{{/if}} !node_modules/**"
{{/if}}
},
"author": "{{ author }}",
"author": "{{author}}",
"license": "MIT",
"xo": {
"extends": "./.eslintrc",
Expand Down Expand Up @@ -51,18 +51,18 @@
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.23.1",
"cross-env": "^2.0.0",
{{#electron}}
{{#if electron}}
"electron-devtools-installer": "^2.0.1",
"electron": "^1.4.2",
{{/electron}}
{{#eslint}}
{{/if}}
{{#if eslint}}
"xo": "^0.18.0",
"eslint-config-vue": "latest",
"eslint-plugin-vue": "latest",
{{#testcafe}}
{{#if testcafe}}
"eslint-plugin-testcafe": "^0.2.0",
{{/testcafe}}
{{/eslint}}
{{/if}}
{{/if}}
"express": "^4.14.0",
"extract-text-webpack-plugin": "^2.0.0-rc.3",
"file-loader": "^0.9.0",
Expand All @@ -74,9 +74,9 @@
"postcss-nested": "^1.0.0",
"rimraf": "^2.6.1",
"style-loader": "^0.13.1",
{{#testcafe}}
{{#if testcafe}}
"testcafe": "^0.12.1",
{{/testcafe}}
{{/if}}
"vue-loader": "^11.0.0",
"vue-template-compiler": "^2.2.0",
"webpack": "2.2.0",
Expand Down
Loading