-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sebastien Chopin
committed
Sep 7, 2017
0 parents
commit f729a33
Showing
17 changed files
with
11,742 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
working_directory: /usr/src/app | ||
docker: | ||
- image: banian/node | ||
steps: | ||
# Checkout repository | ||
- checkout | ||
|
||
# Restore cache | ||
- restore_cache: | ||
key: yarn-{{ checksum "yarn.lock" }} | ||
|
||
# Install dependencies | ||
- run: | ||
name: Install Dependencies | ||
command: NODE_ENV=dev yarn | ||
|
||
# Keep cache | ||
- save_cache: | ||
key: yarn-{{ checksum "yarn.lock" }} | ||
paths: | ||
- "node_modules" | ||
|
||
# Build | ||
# - run: | ||
# name: Build | ||
# command: | | ||
# mkdir -p dist | ||
# yarn build | ||
|
||
# Test | ||
- run: | ||
name: Tests | ||
command: yarn test && yarn codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_size = 2 | ||
indent_style = space | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('nuxt-module-builder/eslint') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules | ||
*.iml | ||
.idea | ||
*.log* | ||
.nuxt | ||
.vscode | ||
.DS_STORE | ||
coverage | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) Sebastien Chopin <[email protected]> | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Nuxt Router Module | ||
[![npm (scoped with tag)](https://img.shields.io/npm/v/@nuxtjs/router-module/latest.svg?style=flat-square)](https://npmjs.com/package/@nuxtjs/router-module) | ||
[![npm](https://img.shields.io/npm/dt/@nuxtjs/router-module.svg?style=flat-square)](https://npmjs.com/package/@nuxtjs/router-module) | ||
[![CircleCI](https://img.shields.io/circleci/project/github/nuxt-community/router-module.svg?style=flat-square)](https://circleci.com/gh/nuxt-community/router-module) | ||
[![Codecov](https://img.shields.io/codecov/c/github/nuxt-community/router-module.svg?style=flat-square)](https://codecov.io/gh/nuxt-community/router-module) | ||
[![Dependencies](https://david-dm.org/nuxt-community/router-module/status.svg?style=flat-square)](https://david-dm.org/nuxt-community/router-module) | ||
|
||
|
||
[![js-standard-style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](http://standardjs.com) | ||
|
||
> Nuxt module to use router.js instead of pages/ directory | ||
[📖 **Release Notes**](./CHANGELOG.md) | ||
|
||
## Features | ||
|
||
The module features | ||
|
||
## Setup | ||
- Add `@nuxtjs/router-module` dependency using `yarn` or `npm` to your project | ||
- Add `@nuxtjs/router-module` to `modules` section of `nuxt.config.js` | ||
|
||
```js | ||
{ | ||
modules: [ | ||
// Simple usage | ||
'@nuxtjs/router-module', | ||
|
||
// With options | ||
['@nuxtjs/router-module', { /* module options */ }], | ||
] | ||
} | ||
``` | ||
|
||
## Usage | ||
|
||
This module disable the `pages/` directory into Nuxt and will use a `router.js` file at your `srcDir` directory: | ||
|
||
```bash | ||
components/ | ||
my-page.vue | ||
router.js | ||
``` | ||
|
||
`router.js` need to export a `createRouter` method like this: | ||
|
||
```js | ||
import Vue from 'vue' | ||
import Router from 'vue-router' | ||
|
||
import MyPage from '~/components/my-page' | ||
|
||
Vue.use(Router) | ||
|
||
export function createRouter() { | ||
return new Router({ | ||
mode: 'history', | ||
routes: [ | ||
{ | ||
path: '/', | ||
component: MyPage | ||
} | ||
] | ||
}) | ||
} | ||
``` | ||
|
||
## License | ||
|
||
[MIT License](./LICENSE) | ||
|
||
Copyright (c) Sebastien Chopin <[email protected]> |
Oops, something went wrong.