Git Product home page Git Product logo

gulp-shrinkwrap's People

Contributors

caseyhoward avatar chmontgomery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gulp-shrinkwrap's Issues

refactor to allow more developer flexibility

As a developer, I want control over where the package.json and npm-shrinkwrap.json files are generated to. I also want control over whether or not I'm modifying the package.json file and whether or not I'm running npm shrinkwrap.

The way this plugin is used is unintuitive. It would be nice if it was refactored so that the two different features are two different steps and each allows you to pipe the result to an arbitrary location.

//cc @chovy

TypeError when running single task

I have a very simple gulp task setup to run like so:

gulp.task('shrinkwrap', function() {
    return gulp.src('package.json')
        .pipe(shrinkwrap())
        .pipe(gulp.dest('./'))
        .pipe(gutil.log(gutil.colors.green('Build Successful!')));
});

But when I run it, it keeps running into the same error. I'm assuming it's a bug, because I searched the internet for solutions, none found. Since this is the only plugin affected, I figured it's most likely a bug. However, it does write the actual npm-shrinkwrap.json file.

Bug in ternminal:
gulp-shrinkwrap-bug

You can ignore the 'Connected to MEAN Developer Database' in between.

Module resolution fails

Dependency resolution fails for [email protected], which is a dependency of [email protected].

Here is the error:

module.js:474
    throw err;
    ^

Error: Cannot find module 'internal/fs'
    at Function.Module._resolveFilename (module.js:472:15)
    at Function.Module._load (module.js:420:25)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at evalmachine.<anonymous>:17:20
    at Object.<anonymous> (/Users/ethertyper/WebstormProjects/WestlakeAPC.github.io/node_modules/gulp-shrinkwrap/node_modules/npm/node_modules/graceful-fs/fs.js:11:1)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)

And here is the dependency tree:

├─┬ [email protected]
│ ├── [email protected] 
│ └─┬ [email protected]
│   └── [email protected] 

Default usage now includes dev dependencies

Using verison 2.4.0

I created a task

gulp.task('shrinkwrap', () => {
    return gulp.src('package.json')
        .pipe(shrinkwrap())
        .pipe(gulp.dest('./'));
});

But, when the npm-shrinkwrap.json file is created, it is including all of my dev dependencies.
I was able to work around this by changing the above task to:

gulp.task('shrinkwrap', () => {
    return gulp.src('package.json')
        .pipe(shrinkwrap({production: true}))
        .pipe(gulp.dest('./'));
});

I think this is due to the upgrade from [email protected] to [email protected]

Ignores package-lock.json

Directory contents:

- gulpfile.js
+ /dist
  - package.json
  - package-lock.json

gulpfile.js

const gulp = require('gulp');
const shrinkwrap = require('gulp-shrinkwrap');

gulp.task('npm-shrinkwrap', () => {
    return gulp.src('dist/package.json')
        .pipe(shrinkwrap())
        .pipe('dist/');
});

gulp.task('default', [ 'npm-shrinkwrap' ]);

Running gulp from the top level directory produces the following output:

Starting 'npm-shrinkwrap'...
npm WARN invalid config loglevel="notice"
wrote npm-shrinkwrap.json

And the contents of dist/ are:

+ /dist
  - package.json
  - package-lock.json
  - npm-shrinkwrap.json

However, if I cd into dist/ and run npm shrinkwrap this is the output and directory listing:

npm notice package-lock.json has been renamed to npm-shrinkwrap.json. npm-shrinkwrap.json will be used for future installations.
+ /dist
  - package.json
  - npm-shrinkwrap.json

Steps to reproduce:

  1. Run gulp-shrinkwrap against a package.json file that is a sibling of a package-lock.json file.

Expected results: package-lock.json is renamed to npm-shrinkwrap.json

Actual results: a new npm-shrinkwrap.json file is generated and the existing package-lock.json file is left intact.

Update readme with shrinkwrap({dev:true})

It would be great to see shrinkwrap({dev:true}) in the documentation to know it supports shrinkwrap options.

gulp.src("package.json")
    .pipe(shrinkwrap({dev:true}))

does not generate npm-shrinkwrap.json file

gulp.task('shrinkwrap', function () {
  return gulp.src('package.json')
    .pipe(shrinkwrap())
    .pipe(gulp.dest('./dist'));
});

I expect to see ./dist/npm-shrinkgwrap.json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.