npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

proactive-gulp-pack

v1.2.22082411

Published

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

Downloads

150

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:

require("proactive-gulp-pack")();

This will add a 'default' task so you can build the configured packages using

gulp

Gulp project

If you're using Gulp for other things then the recommended way to include packaging is

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

gulp pack:all

or by setting "pack:all" as a dependency of any other gulp task.

Advanced

If you need to specify options to the packaging then use the following in the gulpfile.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:

[
      "./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

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. 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.Can't be specified | Content of description.md (in nuspec.json folder)Content of README.md (in root folder) | | summary | Short description of package | description from package.json | | releaseNotes | Description of changes in release 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 generatedCan't be specified| ./dist | | baseDir | Path relative to which files are specified | root |

dependencies

Dependencies can be specified like this:

{
      "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):

{
      "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

npm run build gulp

Test using

npm run test

Lint using

npm run lint

Do all of above using

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.