Skip to content

Commit

Permalink
feat(package): rename package
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Nov 6, 2018
1 parent bab0458 commit b46f65a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
_extends: .github

repository:
name: node-npm-install-group
name: node-install-group
description: Dependency grouping for npm-install
topics: npm,install,group
homepage: https://github.com/ahmadnassri/npm-install-group
homepage: https://github.com/ahmadnassri/node-install-group
private: false
has_issues: true
has_wiki: false
Expand Down
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# npm-install-group
# `install-group`

[![License][license-image]][license-url] [![version][npm-image]][npm-url] [![Build Status][circle-image]][circle-url]

> Dependency grouping for `npm install`
## Motivation

- npm no longer installs `peerDependencies`
- npm no longer auto installs `peerDependencies`
- npm only recognizes `dependencies`, `devDependencies` and `optionalDependencies`
- your workflow might require declaring a new type of `Dependencies` that doesn't fit any of the above

## How it works

`npm-install-group [group] <options>` simply takes a `group` name, compares it against your `package.json` and runs `npm install` for any dependency listed under that group: `npm install <options> [list of group packages]`
`install-group [group] <options>` simply takes a `group` name, compares it against your `package.json` and runs `npm install` for any dependency listed under that group: `npm install <options> [list of group packages]`

### Example

Expand All @@ -34,7 +34,7 @@
###### command

```bash
npm-install-group foo --global
install-group foo --global
```

###### will result in
Expand All @@ -45,20 +45,38 @@ npm install --global xyz@~3.1.5 abc@^2.2.1

## Install

```bash
npm install install-group
```

## CLI

> use as a CLI
### Usage

```bash
npm install @ahmadnassri/npm-install-group
install-group [group] <options>
```

| argument | required | default | description |
| --------- | -------- | ------- | -------------------------------------------- |
| `group` || `-` | `*Dependencies` prefix in `package.json` |
| `options` || `-` | list of CLI options to pass to `npm install` |

## API

> use as a module
### packages(cwd, group)

| argument | required | default | description |
| --------- | -------- | --------------- | -------------------------------------------- |
| `cwd` || `process.cwd()` | working directory |
| `group` || `prod` | `*Dependencies` prefix in `package.json` |

```js
const packages = require('@ahmadnassri/npm-install-group')
const packages = require('install-group')

packages(process.cwd(), 'foo')
```
Expand All @@ -79,10 +97,10 @@ packages(process.cwd(), 'foo')
> Twitter: [@AhmadNassri](https://twitter.com/AhmadNassri)
[license-url]: LICENSE
[license-image]: https://img.shields.io/github/license/ahmadnassri/node-npm-install-group.svg?style=for-the-badge&logo=circleci
[license-image]: https://img.shields.io/github/license/ahmadnassri/node-install-group.svg?style=for-the-badge&logo=circleci

[circle-url]: https://circleci.com/gh/ahmadnassri/workflows/node-npm-install-group
[circle-image]: https://img.shields.io/circleci/project/github/ahmadnassri/node-npm-install-group/master.svg?style=for-the-badge&logo=circleci
[circle-url]: https://circleci.com/gh/ahmadnassri/workflows/node-install-group
[circle-image]: https://img.shields.io/circleci/project/github/ahmadnassri/node-install-group/master.svg?style=for-the-badge&logo=circleci

[npm-url]: https://www.npmjs.com/package/@ahmadnassri/npm-install-group
[npm-image]: https://img.shields.io/npm/v/@ahmadnassri/npm-install-group.svg?style=for-the-badge&logo=npm
[npm-url]: https://www.npmjs.com/package/install-group
[npm-image]: https://img.shields.io/npm/v/install-group.svg?style=for-the-badge&logo=npm
2 changes: 1 addition & 1 deletion lib/scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = function (cwd, group) {
}

// return install format
const packages = Object.entries(pkg[group]).map(([name, version]) => `${name}@${version}`)
const packages = Object.keys(pkg[group]).map(name => `${name}@${pkg[group][name]}`)

if (packages.length === 0) {
throw new Error('no packages found')
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"version": "0.0.0-development",
"name": "@ahmadnassri/npm-install-group",
"name": "install-group",
"description": "Dependency grouping for npm-install",
"author": "Ahmad Nassri <[email protected]> (https://www.ahmadnassri.com/)",
"homepage": "https://github.com/ahmadnassri/npm-install-group",
"homepage": "https://github.com/ahmadnassri/node-install-group",
"repository": {
"type": "git",
"url": "https://github.com/ahmadnassri/npm-install-group.git"
"url": "https://github.com/ahmadnassri/node-install-group.git"
},
"license": "MIT",
"main": "lib/scan.js",
Expand All @@ -24,7 +24,7 @@
"index.js"
],
"bugs": {
"url": "https://github.com/ahmadnassri/npm-install-group/issues"
"url": "https://github.com/ahmadnassri/node-install-group/issues"
},
"scripts": {
"lint:deps": "npx updated",
Expand Down

0 comments on commit b46f65a

Please sign in to comment.