Repository: vue-land/create-vue-app
Branch: master
Commit: 61f52182bcb3
Files: 25
Total size: 15.2 KB
Directory structure:
gitextract_cly6_6tk/
├── .editorconfig
├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
├── circle.yml
├── cli.js
├── docs/
│ └── unit-test.md
├── package.json
├── sao.js
├── template/
│ ├── .editorconfig
│ ├── README.md
│ ├── gitignore
│ ├── index.ejs
│ ├── package.json
│ ├── poi.config.js
│ ├── src/
│ │ ├── components/
│ │ │ ├── App.test.js
│ │ │ └── App.vue
│ │ ├── index.js
│ │ ├── polyfills.js
│ │ └── pwa.js
│ └── static/
│ └── manifest.json
└── test/
├── snapshots/
│ ├── test.js.md
│ └── test.js.snap
└── test.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
================================================
FILE: .gitattributes
================================================
* text=auto
================================================
FILE: .gitignore
================================================
node_modules
packages/*/yarn.lock
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) egoist <0x142857@gmail.com> (https://egoistian.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: README.md
================================================
# create-vue-app
[](https://npmjs.com/package/create-vue-app) [](https://npmjs.com/package/create-vue-app) [](https://circleci.com/gh/vue-land/create-vue-app/tree/master) [](https://github.com/egoist/donate) [](https://chat.egoist.moe)
## Features
- No config until you need, thanks to [Poi](https://github.com/egoist/poi).
- Support all CSS preprocessors and CSS modules
- Hot mode reloading
- Unit tests with [Jest](https://github.com/avajs/ava) with no config by default thanks to [Tyu](https://github.com/egoist/tyu).
- Progressive Web App by default, thanks to [poi-preset-offline](https://github.com/egoist/poi/tree/master/packages/poi-preset-offline) and [offline-plugin](https://github.com/NekR/offline-plugin).
## Install
```bash
yarn global add create-vue-app
```
## Usage
```bash
# Generate project in cwd
mkdir my-vue-app && cd my-vue-app
create-vue-app .
# Generate project in specific folder
create-vue-app my-vue-app
cd my-vue-app
```
Alternatively, if you have Yarn^0.24, you can use the `yarn create` command:
```bash
yarn create vue-app my-vue-app
```
### Folder structure
```bash
.
├── README.md
├── index.ejs
├── package.json
├── poi.config.js
├── src
│ ├── components
│ │ ├── App.test.js
│ │ └── App.vue
│ ├── index.js
│ └── polyfills.js
├── static
│ └── favicon.ico
└── yarn.lock
```
## Recipes
- [Unit Test](./docs/unit-test.md)
## FAQ
### Where are the docs?
**This project is using Poi under the hood**, so for most questions, hopefully go to [this page](https://poi.js.org/#/home) and you will get the answer.
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D
## Author
**create-vue-app** © [egoist](https://github.com/egoist), Released under the [MIT](./LICENSE) License.
Authored and maintained by egoist with help from contributors ([list](https://github.com/egoist/create-vue-app/contributors)).
> [egoistian.com](https://egoistian.com) · GitHub [@egoist](https://github.com/egoist) · Twitter [@_egoistlily](https://twitter.com/_egoistlily)
================================================
FILE: circle.yml
================================================
machine:
node:
version: 7
environment:
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
dependencies:
override:
- yarn
cache_directories:
- ~/.cache/yarn
test:
override:
- yarn test
================================================
FILE: cli.js
================================================
#!/usr/bin/env node
const path = require('path')
const cac = require('cac')
const sao = require('sao')
const update = require('update-notifier')
const pkg = require('./package')
const cli = cac()
cli.command('*', 'Generate a new project', input => {
if (input.length === 0) {
return cli.showHelp()
}
const folderName = input[0]
const targetPath = path.resolve(folderName)
console.log(`> Generating project in ${targetPath}`)
return sao({
template: __dirname,
targetPath
})
})
cli.parse()
update({
pkg
}).notify()
================================================
FILE: docs/unit-test.md
================================================
# Unit Test
Refer to [Tyu](https://github.com/egoist/tyu) which is using Jest under the hood.
================================================
FILE: package.json
================================================
{
"name": "create-vue-app",
"version": "2.0.0",
"description": "Create Vue app with no build configurations",
"scripts": {
"test": "npm run lint && npm run ava",
"ava": "ava test/test.js",
"lint": "xo"
},
"bin": {
"cva": "cli.js",
"create-vue-app": "cli.js"
},
"files": [
"sao.js",
"cli.js",
"template"
],
"repository": "git@github.com:egoist/create-vue-app.git",
"author": "EGOIST <0x142857@gmail.com>",
"license": "MIT",
"devDependencies": {
"ava": "^0.24.0",
"eslint-config-rem": "^3.1.0",
"lerna": "^2.0.0-rc.5",
"xo": "^0.18.2"
},
"dependencies": {
"cac": "^4.2.0",
"sao": "^0.22.2",
"superb": "^1.3.0",
"update-notifier": "^2.1.0"
},
"xo": {
"extends": "rem/prettier",
"ignores": [
"template/**"
],
"rules": {
"ava/no-ignored-test-files": 0
}
}
}
================================================
FILE: sao.js
================================================
const superb = require('superb')
module.exports = {
prompts: {
name: {
message: `What's the name of your new project`,
default: ':folderName:'
},
description: {
message: 'How would your describe your superb project',
default: `My ${superb()} Vue project`
},
pwa: {
type: 'confirm',
default: true,
message: 'Add Progressive Web App (PWA) support',
store: true
},
manifest: {
type: 'confirm',
default: true,
when: 'pwa',
message: 'Use default manifest.json and icons for PWA',
store: true
},
unitTest: {
type: 'confirm',
default: true,
message: 'Use Tyu(Jest) to run unit tests',
store: true
},
username: {
message: `What's your GitHub username`,
default: ':gitUser:',
store: true
},
email: {
message: `What's your GitHub email`,
default: ':gitEmail:',
store: true
}
},
move: {
gitignore: '.gitignore'
},
filters: {
'src/pwa.js': 'pwa',
'static/manifest.json': 'manifest',
'static/icons/**': 'manifest',
'src/components/App.test.js': 'unitTest'
},
gitInit: true,
installDependencies: true,
post(_) {
_.showTip()
console.log(_.chalk.cyan('\n To develop it:'))
console.log('\n yarn dev')
console.log(_.chalk.cyan('\n To build for production:'))
console.log('\n yarn build')
console.log(
_.chalk.dim('\n For more usages, please check out ./README.md')
)
console.log()
}
}
================================================
FILE: template/.editorconfig
================================================
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
================================================
FILE: template/README.md
================================================
# <%= name %>
> <%= description %>
## Commands
You can replace `yarn` with `npm run` here.
```bash
# build for production
yarn build
# development mode
yarn dev
# run unit tests
yarn test
# serve the bundled dist folder in production mode
yarn serve
```
## Polyfills
By default we only polyfill `window.Promise` and `Object.assign`. You can add more polyfills in `./src/polyfills.js`.
## Analyze bundle size
Run `yarn report` to get a report of bundle size which helps you:
- Realize what's really inside your bundle
- Find out what modules make up the most of it's size
- Find modules that got there by mistake
- Optimize it!
<% if (pwa){ -%>
## Progressive Web App
Your app is now offline-ready (only in production bundle), which means you can visit it without network.<% if (manifest) { %>
Here we use a default [manifest.json](./static/manifest.json) to configurure your pwa, for example, to enable *Add to Home Screen* feature on Android. It will be copied directly to `./dist/manifest.json`.
<% } %>
For all the available options, please head to [poi-preset-offline](https://github.com/egoist/poi/tree/master/packages/poi-preset-offline#api).
<% } %>
---
This project is generated by [create-vue-app](https://github.com/vue-land/create-vue-app).
================================================
FILE: template/gitignore
================================================
node_modules
*.log
.DS_Store
# poi dist
dist
================================================
FILE: template/index.ejs
================================================
./src/components/App.vue and save to reload../README.md for more usages.