UNPKG

crediful-bower

Version:

Grunt plugin which helps migrating from Bower to npm.

105 lines (67 loc) 3.63 kB
<p align="center"><img src="https://i.imgur.com/DXlAPfh.png" width="300" height="300"></p> <h1 align="center">crediful-bower</h1> <div align="center"> <a href="https://www.npmjs.com/package/crediful-bower"><img src="https://img.shields.io/npm/v/crediful-bower.svg" alt="npm" /></a> <a href="https://travis-ci.org/crediful/crediful-bower?branch=master"><img src="http://travis-ci.org/crediful/crediful-bower.svg?branch=master" alt="Travis CI" /></a> <a href="https://greenkeeper.io"><img src="https://badges.greenkeeper.io/crediful/crediful-bower.svg" alt="Greenkeeper badge" /></a> <a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" alt="Styled with Prettier" /></a> </div> # Crediful This repository is part of the source code of Crediful. You can find more information at [crediful.io](https://crediful.io or by contacting opensource@crediful.io. You can find the published source code at [github.com/crediful](https://github.com/crediful). For licensing information, see the attached LICENSE file and the list of third-party licenses at [crediful.io/legal/licenses/](https://crediful.io/legal/licenses/). ## Description Grunt plugin which helps migrating from [Bower](https://bower.io) to [npm](https://www.npmjs.com). ## Installation ```bash npm install --save-dev crediful-bower ``` ```javascript grunt.loadNpmTasks('crediful-bower'); ``` ## Workflow Using [crediful-bower](https://github.com/crediful/crediful-bower) is as simple as this: 1. Run [bower-away](https://github.com/sheerun/bower-away) command in the project you want to migrate (but don't delete your `bower.json` yet!). 2. Run [crediful-bower](https://github.com/crediful/crediful-bower) task (from your `Gruntfile.js`) 3. Finally, delete your `bower.json` (☠) An exemplary task configuration: **Gruntfile.js** ```javascript module.exports = grunt => { grunt.initConfig({ npmBower: { options: { cleanTargetDir: true, targetDir: './lib', verbose: true, } }); grunt.loadNpmTasks('crediful-bower'); grunt.registerTask('default', ['npmBower']); }; ``` ## Options ### `bowerConfig` - Type: `String` - Default: `bower.json` Location of your Bower configuration (relative to your project's root directory). ### `componentDir` - Type: `String` - Default: `node_modules` Location where your Bower components are installed. When using `bower install` this will be `bower_components`. If you are using `npm install` (or `yarn`), it's `node_modules`. If you are using a [.bowerrc](https://bower.io/docs/config/) file, it might be something else. ### `npmConfig` - Type: `String` - Default: `package.json` Location of your npm configuration (relative to your project's root directory). ### `cleanTargetDir` - Type: `Boolean` - Default: `false` If setted to `true`, the specified `targetDir` will be removed before copying Bower components there. ### `overrideProp` - Type: `String` - Default: `exportsOverride` Key name that is being used for export overrides (if defined). Read more about `exportsOverride` in "[Advanced usage](https://github.com/yatskevich/grunt-bower-task#advanced-usage)". ### `resolveName` - Type: `Boolean` - Default: `true` If setted to `true`, the plugin tries to resolve the names of your dependencies from a `bower.json`, `.bower.json` or `package.json` file (in this order). If setted to `false`, it resolves the names from your `package.json` (Example: `@bower_components/dexie`).