@nuxtjs/router
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [1.5.1](https://github.com/nuxt-community/router-module/compare/v1.5.0...v1.5.1) (2021-02-18) | ||
### Bug Fixes | ||
* keepDefaultRouter option broken in nuxt 2.15 ([#92](https://github.com/nuxt-community/router-module/issues/92)) ([fb16c31](https://github.com/nuxt-community/router-module/commit/fb16c31b45bdaa49773e062e408e5fed356e5b3b)) | ||
## [1.5.0](https://github.com/nuxt-community/router-module/compare/v1.4.0...v1.5.0) (2019-08-21) | ||
@@ -7,0 +14,0 @@ |
@@ -10,4 +10,4 @@ import { createRouter as customCreateRouter } from '<%= options.routerFilePath %>' | ||
export function createRouter(ssrContext) { | ||
return customCreateRouter(ssrContext, createDefaultRouter, routerOptions) | ||
export function createRouter(ssrContext, config) { | ||
return customCreateRouter(ssrContext, createDefaultRouter, routerOptions, config) | ||
} |
{ | ||
"name": "@nuxtjs/router", | ||
"version": "1.5.0", | ||
"description": "Nuxt module to use router.js instead of pages/ directory", | ||
"version": "1.5.1", | ||
"description": "Nuxt.js module to use router.js instead of pages/ directory", | ||
"repository": "nuxt-community/router-module", | ||
"license": "MIT", | ||
@@ -11,23 +12,17 @@ "contributors": [ | ||
"main": "lib/module.js", | ||
"repository": "nuxt-community/router-module", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"lint": "eslint --ext .js,.vue lib test", | ||
"test": "yarn lint && jest", | ||
"release": "yarn test && standard-version && git push --follow-tags && npm publish" | ||
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"scripts": { | ||
"dev": "nuxt test/fixture/ok", | ||
"lint": "eslint --ext .js,.vue .", | ||
"release": "yarn test && standard-version && git push --follow-tags && npm publish", | ||
"test": "yarn lint && jest" | ||
}, | ||
"dependencies": { | ||
"consola": "^2.10.1" | ||
"consola": "^2.15.3" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "latest", | ||
"@commitlint/config-conventional": "latest", | ||
"@nuxtjs/eslint-config": "latest", | ||
"@nuxtjs/module-test-utils": "latest", | ||
"codecov": "latest", | ||
"eslint": "latest", | ||
@@ -38,3 +33,6 @@ "husky": "latest", | ||
"standard-version": "latest" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
@@ -5,7 +5,7 @@ # @nuxtjs/router | ||
[![npm downloads][npm-downloads-src]][npm-downloads-href] | ||
[![Circle CI][circle-ci-src]][circle-ci-href] | ||
[![Github Actions CI][github-actions-ci-src]][github-actions-ci-href] | ||
[![Codecov][codecov-src]][codecov-href] | ||
[![License][license-src]][license-href] | ||
> Nuxt module to use router.js instead of pages/ directory | ||
> Nuxt.js module to use router.js instead of pages/ directory | ||
@@ -23,3 +23,3 @@ [📖 **Release Notes**](./CHANGELOG.md) | ||
```bash | ||
yarn add @nuxtjs/router # or npm install @nuxtjs/router | ||
yarn add --dev @nuxtjs/router # or npm install --save-dev @nuxtjs/router | ||
``` | ||
@@ -29,6 +29,4 @@ | ||
:warning: If you are using Nuxt `< 2.9.0`, use `modules` instead. | ||
```js | ||
{ | ||
export default { | ||
buildModules: [ | ||
@@ -44,6 +42,8 @@ // Simple usage | ||
:warning: If you are using Nuxt **< v2.9** you have to install the module as a `dependency` (No `--dev` or `--save-dev` flags) and use `modules` section in `nuxt.config.js` instead of `buildModules`. | ||
### Using top level options | ||
```js | ||
{ | ||
export default { | ||
buildModules: [ | ||
@@ -61,3 +61,3 @@ '@nuxtjs/router' | ||
```js | ||
{ | ||
export default { | ||
generate: { | ||
@@ -75,2 +75,3 @@ routes: [ | ||
- Type: `String` | ||
- Default: `srcDir` | ||
@@ -82,2 +83,3 @@ | ||
- Type: `String` | ||
- Default: `router.js` | ||
@@ -89,2 +91,3 @@ | ||
- Type: `Boolean` | ||
- Default: `false` | ||
@@ -127,2 +130,4 @@ | ||
The components defined as routes have access to the same special attributes and functions (head, asyncData, validate, etc.) as the [Nuxt Page component](https://nuxtjs.org/guide/views/#pages). | ||
### Accessing default router | ||
@@ -132,5 +137,9 @@ | ||
:warning: If you are using Nuxt `< 2.9.0`, the parameter `routerOptions` is not available. | ||
:warning: If you are using Nuxt `< 2.15.0`, the parameter `config` is not available. | ||
```js | ||
export function createRouter(ssrContext, createDefaultRouter, routerOptions) { | ||
const options = routerOptions ? routerOptions : createDefaultRouter(ssrContext).options | ||
export function createRouter(ssrContext, createDefaultRouter, routerOptions, config) { | ||
const options = routerOptions ? routerOptions : createDefaultRouter(ssrContext, config).options | ||
@@ -149,2 +158,8 @@ return new Router({ | ||
## Development | ||
1. Clone this repository | ||
2. Install dependencies using `yarn install` or `npm install` | ||
3. Start development server using `npm run dev` | ||
## License | ||
@@ -157,15 +172,15 @@ | ||
<!-- Badges --> | ||
[npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/router/latest.svg?style=flat-square | ||
[npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/router/latest.svg | ||
[npm-version-href]: https://npmjs.com/package/@nuxtjs/router | ||
[npm-downloads-src]: https://img.shields.io/npm/dt/@nuxtjs/router.svg?style=flat-square | ||
[npm-downloads-src]: https://img.shields.io/npm/dt/@nuxtjs/router.svg | ||
[npm-downloads-href]: https://npmjs.com/package/@nuxtjs/router | ||
[circle-ci-src]: https://img.shields.io/circleci/project/github/nuxt-community/router-module.svg?style=flat-square | ||
[circle-ci-href]: https://circleci.com/gh/nuxt-community/router-module | ||
[github-actions-ci-src]: https://github.com/nuxt-community/router-module/workflows/ci/badge.svg | ||
[github-actions-ci-href]: https://github.com/nuxt-community/router-module/actions?query=workflow%3Aci | ||
[codecov-src]: https://img.shields.io/codecov/c/github/nuxt-community/router-module.svg?style=flat-square | ||
[codecov-src]: https://img.shields.io/codecov/c/github/nuxt-community/router-module.svg | ||
[codecov-href]: https://codecov.io/gh/nuxt-community/router-module | ||
[license-src]: https://img.shields.io/npm/l/@nuxtjs/router.svg?style=flat-square | ||
[license-src]: https://img.shields.io/npm/l/@nuxtjs/router.svg | ||
[license-href]: https://npmjs.com/package/@nuxtjs/router |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12451
7
175
Updatedconsola@^2.15.3