# proactive-gulp-pack

> Gulp tasks for packaging both npm and NuGet packages controlled by package.json (and other files)

Latest version **1.2.22082411** (published 2022-08-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install proactive-gulp-pack
pnpm add proactive-gulp-pack
yarn add proactive-gulp-pack
bun add proactive-gulp-pack
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.22082411 |
| Published | 2022-08-24 |
| First published | 2017-12-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 24.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ProActive Core |
| Maintainers | pafsl, smukked, nielsbrinch_proactive, nordtorp |
| Keywords | frameworks-dev |

## Links

- npm: https://www.npmjs.com/package/proactive-gulp-pack
- Repository: https://proactive.visualstudio.com/DefaultCollection/Frameworks/_git/Gulp.Pack
- npm.io page: https://npm.io/package/proactive-gulp-pack

## Dependencies (7)

- [del](https://npm.io/package/del.md) ^2.2.2
- [gulp](https://npm.io/package/gulp.md) ^3.9.1
- [merge2](https://npm.io/package/merge2.md) ^1.0.3
- [gulp-tap](https://npm.io/package/gulp-tap.md) ^0.4.2
- [npm-utils](https://npm.io/package/npm-utils.md) ^2.0.0
- [dateformat](https://npm.io/package/dateformat.md) ^2.0.0
- [gulp-nuget-pack](https://npm.io/package/gulp-nuget-pack.md) 0.0.7

## Recent versions

- 1.2.22082411 (latest) — 2022-08-24
- 1.1.22082411 — 2022-08-24
- 1.1.22082410 — 2022-08-24
- 1.0.1707260859 — 2017-12-05

## README

Gulp tasks for packaging both npm and NuGet packages controlled by package.json (and other files)

# Usage

## Standalone
If this is the only thing you need in gulp then create your gulpfile.js like this:
```js
require("proactive-gulp-pack")();
```
This will add a 'default' task so you can build the configured packages using
```PowerShell
gulp
```

## Gulp project
If you're using Gulp for other things then the recommended way to include packaging is
```js
const gulp = require("gulp"),
      ... // Other requires

require("proactive-gulp-pack")(gulp);
```
This will add a 'pack:all' task so you can build the configured packages using
```PowerShell
gulp pack:all
```
or by setting "pack:all" as a dependency of any other gulp task.

<a name="advancedOptions"></a>
## Advanced
If you need to specify options to the packaging then use the following in the gulpfile.js:
```js
const gulp = require("gulp"),
      ... // Other requires

require("proactive-gulp-pack")(gulp, {
      // Your options
      ...
});
```
As above you need to invoke 'pack:all' "manually".

Options supported are:
|||
|-|-|
| additionalNpmFiles | An array of file globs to include in the npm package |
|||

# Configuration

## Package.json

This is of cause the main configuration for your npm package (if any), but should also be used as main configuration of NuGet packages.

The version number in package.json is the one which is:

* Used to name build
* Tagged in git (master and release builds only)
* Automatically incremented to next minor version when released

Should of cause include "proactive-gulp-pack" in devDependencies.

### npm content

By default the following is included in the npm package: 

```js
[
      "./README.md",
      `./dist/${npmMainJs}`,
      `./dist/${npmMainJs}.map`,
      `./dist/${npmMainJs.replace(/.js$/, ".d.ts")}`,
      "./style/**/*.less",
      "./tests/*Mocks.d.ts",
      "./tests/*Mocks.js",
      "./typings.json ",
]
```
where npmMainJs is the javascript file specified as `main` in package.json.

If you need more then you can add and `additionalNpmFiles` to [options](#advancedOptions)

### NoNpm

To prevent building a npm package add `NoNpm` to the keywords array.

## *nuspec.json
To build a NuGet package add a `*nuspec.json` file in any folder (Except below `.\Tests`).

The content should be an object with two properties (of which one is optional):
|||
|-|-|
| options | Parameters as specified for [gulp-nuget-pack](https://www.npmjs.com/package/gulp-nuget-pack). All except id optional (see below) |
| files(optional) | An array of file specifications (see below) |
|||

### options

| Name | Description | default value|
|-|-|-|
| id | Id (and filename of NuGetPackage) | required |
| version | The version | version from package.json |
| title | Displayed name | id |
| authors | Authors of package | author from package.json |
| owners | Owners of package | ProActive A/S |
| description | Long description of package.<br />**Can't be specified** | Content of description.md (in nuspec.json folder)<br />Content of README.md (in root folder) |
| summary | Short description of package | description from package.json |
| releaseNotes | Description of changes in release <br />**Can't be specified** | Content of releasenotes.md (in nuspec.json folder) |
| language | Locale Id for package such as en-us | |
| projectUrl | Url for home page of package | |
| iconUrl | Url for icon for package ||
| licenseUrl | Link to license the package is under ||
| requireLicenseAcceptance | Must license be accepted on install | false |
| copyright | Copyright details | ProActive A/S |
| dependencies | Array of packages of which this package is dependend each specified as an object with id and version (range) (see below) | |
| tags | Space delimited list of keyword for package | keywords from package.json |
| excludes | Array of globs to exclude from package ||
| outputDir | Path where package will be generated<br />**Can't be specified**| ./dist |
| baseDir | Path relative to which files are specified | root |

#### dependencies
Dependencies can be specified like this:
```json
{
      "options": {
            ...
            "dependencies": [
                  {"id": "dependency1", "version": "1.0"},
                  {"id": "dependency2", "version": "(1.0,)"},
                  {"id": "dependency3", "version": "(1.0,2.0)"},
            ],
            ...
      }
}
```

### files

List of files to include and where to place them like this (which is the default):
```json
{
      "options": {
            ...
      },
      "files": [
            {
                  "dest": "/content/",
                  "src": "nuspec.json folder/content/*"
            },
            {
                  "dest": "/deployment/",
                  "src": "nuspec.json folder/deployment/*"
            },
            {
                  "dest": "/tools/",
                  "src": "nuspec.json folder/tools/*"
            },
      ]
}
```
# Build and Test
Build using 
```PowerShell
npm run build gulp
```
Test using 
```PowerShell
npm run test
```

Lint using 
```PowerShell
npm run lint
```

Do all of above using
```PowerShell
npm start
```

# Debugging
If build fails then you can debug this using the `self` configuration in Code

If a test fail then you can debug this using the corresponding configuration in Code

In both cases source maps are set up to point to `src\index.ts`.

---
_Source: https://npm.io/package/proactive-gulp-pack · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
