@nuxtjs/router
Advanced tools
Comparing version 1.3.2 to 1.4.0
@@ -1,5 +0,29 @@ | ||
# Change Log | ||
# Changelog | ||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
## [1.4.0](https://github.com/nuxt-community/router-module/compare/v1.3.2...v1.4.0) (2019-07-26) | ||
### Build System | ||
* **deps:** bump handlebars from 4.1.0 to 4.1.2 ([63e5cb7](https://github.com/nuxt-community/router-module/commit/63e5cb7)) | ||
* **deps:** bump js-yaml from 3.12.1 to 3.13.1 ([b68dad9](https://github.com/nuxt-community/router-module/commit/b68dad9)) | ||
* **deps:** bump lodash.template from 4.4.0 to 4.5.0 ([#52](https://github.com/nuxt-community/router-module/issues/52)) ([5dd8c08](https://github.com/nuxt-community/router-module/commit/5dd8c08)) | ||
* **deps:** bump webpack-bundle-analyzer from 3.0.4 to 3.3.2 ([eac68fd](https://github.com/nuxt-community/router-module/commit/eac68fd)) | ||
### Features | ||
* support `router-module` in `nuxt.config` ([3e9ecdd](https://github.com/nuxt-community/router-module/commit/3e9ecdd)) | ||
* **logger:** separate consola into logger file ([2ff54ff](https://github.com/nuxt-community/router-module/commit/2ff54ff)) | ||
### Tests | ||
* **fixture:** update configs ([55c4c4f](https://github.com/nuxt-community/router-module/commit/55c4c4f)) | ||
* **module:** update describe ([ca8d937](https://github.com/nuxt-community/router-module/commit/ca8d937)) | ||
<a name="1.3.2"></a> | ||
@@ -6,0 +30,0 @@ ## [1.3.2](https://github.com/nuxt-community/router-module/compare/v1.3.1...v1.3.2) (2019-02-15) |
const { relative, resolve } = require('path') | ||
const { existsSync } = require('fs') | ||
const consola = require('consola') | ||
const logger = require('./logger') | ||
function routerModule(moduleOptions) { | ||
module.exports = function (moduleOptions) { | ||
const defaultOptions = { | ||
@@ -13,4 +13,4 @@ path: this.options.srcDir, | ||
const options = { | ||
...{}, | ||
...defaultOptions, | ||
...this.options['router-module'], | ||
...this.options.routerModule, | ||
@@ -24,3 +24,4 @@ ...moduleOptions | ||
if (!existsSync(routerFilePath)) { | ||
return consola.warn(`No \`${options.fileName}\` file found in \`${options.path}\`.`) | ||
logger.warn(`No \`${options.fileName}\` file found in \`${options.path}\`.`) | ||
return | ||
} | ||
@@ -63,3 +64,2 @@ | ||
module.exports = routerModule | ||
module.exports.meta = require('../package.json') |
{ | ||
"name": "@nuxtjs/router", | ||
"version": "1.3.2", | ||
"description": "Nuxt module to use router.js instead of pages/ directory.", | ||
"version": "1.4.0", | ||
"description": "Nuxt module to use router.js instead of pages/ directory", | ||
"license": "MIT", | ||
@@ -11,3 +11,3 @@ "contributors": [ | ||
"main": "lib/module.js", | ||
"repository": "https://github.com/nuxt-community/router-module", | ||
"repository": "nuxt-community/router-module", | ||
"publishConfig": { | ||
@@ -17,3 +17,3 @@ "access": "public" | ||
"scripts": { | ||
"lint": "eslint lib test", | ||
"lint": "eslint --ext .js,.vue lib test", | ||
"test": "yarn lint && jest", | ||
@@ -26,21 +26,10 @@ "release": "yarn test && standard-version && git push --follow-tags && npm publish" | ||
"dependencies": { | ||
"consola": "^2.4.1" | ||
"consola": "^2.9.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "latest", | ||
"@babel/preset-env": "latest", | ||
"@commitlint/cli": "latest", | ||
"@commitlint/config-conventional": "latest", | ||
"@nuxtjs/eslint-config": "latest", | ||
"babel-eslint": "latest", | ||
"babel-jest": "latest", | ||
"codecov": "latest", | ||
"eslint": "latest", | ||
"eslint-config-standard": "latest", | ||
"eslint-plugin-import": "latest", | ||
"eslint-plugin-jest": "latest", | ||
"eslint-plugin-node": "latest", | ||
"eslint-plugin-promise": "latest", | ||
"eslint-plugin-standard": "latest", | ||
"eslint-plugin-vue": "latest", | ||
"get-port": "latest", | ||
@@ -47,0 +36,0 @@ "husky": "latest", |
@@ -1,2 +0,2 @@ | ||
# Nuxt Router Module | ||
# @nuxtjs/router | ||
@@ -7,6 +7,5 @@ [![npm version][npm-version-src]][npm-version-href] | ||
[![Codecov][codecov-src]][codecov-href] | ||
[![Dependencies][david-dm-src]][david-dm-href] | ||
[![Standard JS][standard-js-src]][standard-js-href] | ||
[![License][license-src]][license-href] | ||
> Nuxt module to use router.js instead of pages/ directory. | ||
> Nuxt module to use router.js instead of pages/ directory | ||
@@ -21,10 +20,18 @@ [📖 **Release Notes**](https://github.com/nuxt-community/router-module/releases) | ||
1. Add `@nuxtjs/router` dependency with `yarn` or `npm` into your project | ||
2. Add `@nuxtjs/router` to `modules` section of `nuxt.config.js`: | ||
3. Configure it: | ||
1. Add `@nuxtjs/router` dependency to your project | ||
```bash | ||
yarn add @nuxtjs/router # or npm install @nuxtjs/router | ||
``` | ||
2. Add `@nuxtjs/router` to the `modules` section of `nuxt.config.js` | ||
```js | ||
{ | ||
modules: [ | ||
'@nuxtjs/router' | ||
// Simple usage | ||
'@nuxtjs/router', | ||
// With options | ||
['@nuxtjs/router', { /* module options */ }] | ||
] | ||
@@ -34,3 +41,3 @@ } | ||
or | ||
### Using top level options | ||
@@ -40,4 +47,7 @@ ```js | ||
modules: [ | ||
['@nuxtjs/router', { keepDefaultRouter: true }] | ||
] | ||
'@nuxtjs/router' | ||
], | ||
routerModule: { | ||
/* module options */ | ||
} | ||
} | ||
@@ -137,6 +147,6 @@ ``` | ||
<!-- Badges --> | ||
[npm-version-src]: https://img.shields.io/npm/dt/@nuxtjs/router.svg?style=flat-square | ||
[npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/router/latest.svg?style=flat-square | ||
[npm-version-href]: https://npmjs.com/package/@nuxtjs/router | ||
[npm-downloads-src]: https://img.shields.io/npm/v/@nuxtjs/router/latest.svg?style=flat-square | ||
[npm-downloads-src]: https://img.shields.io/npm/dt/@nuxtjs/router.svg?style=flat-square | ||
[npm-downloads-href]: https://npmjs.com/package/@nuxtjs/router | ||
@@ -150,6 +160,3 @@ | ||
[david-dm-src]: https://david-dm.org/nuxt-community/router-module/status.svg?style=flat-square | ||
[david-dm-href]: https://david-dm.org/nuxt-community/router-module | ||
[standard-js-src]: https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square | ||
[standard-js-href]: https://standardjs.com | ||
[license-src]: https://img.shields.io/npm/l/@nuxtjs/router.svg?style=flat-square | ||
[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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
10967
12
7
63
157
Updatedconsola@^2.9.0