mckn / gulp-nuget Goto Github PK
View Code? Open in Web Editor NEWNuget support for gulp streaming build system
License: MIT License
Nuget support for gulp streaming build system
License: MIT License
Problem
Within the company we use Gulp-nuget to publish our packages.
When we install Gulp-nuget security issues are raised because of the reference to Gulp-util.
Solution
If I went trought this code I saw some easy fixes to lose the dependency to Gulp-util.
I want to update this code.
But I'm quite hesitant because the last update to this project is from 2018.
I want to verify if you would look into the pull request and publish to npmjs.com?
Would you be open to a PR that lets you omit the feed? If the feed is not passed to nuget it defaults to the official feed which is a sensible default. Hoping this plugin would follow suit.
In order to build server, i have to run the nuget restore command before running.
It would be really great if gulp-nuget adds support for this command.
Docs:
http://docs.nuget.org/docs/reference/package-restore
http://blogs.msdn.com/b/dotnet/archive/2013/08/22/improved-package-restore.aspx
When running nuget.pack
the src files aren't being taken into account.
The example given in the readme:
gulp.src(['./*.js', './package.json'])
.pipe(nuget.pack({ nuspec: 'project.nuspec', nuget: nugetPath, version: '1.0.0' }))
.pipe(gulp.dest('project.1.0.0.nupkg'));
implies that the files specified in src
will be passed to nuget.pack
and also that the output of nuget.pack
(i.e. the package stream) will be passed to gulp.dest
.
Perhaps I've misunderstood how this works but the result I get is quite different.
In my case, a package is created based on project.nuspec
such that the output file project.nupkg is created during nuget.pack
rather than by gulp.dest
. The files specified in gulp.src
are ignored and only files supplied in the .nuspec
config are taken into account.
This means that to correctly create a package I need to specify my files in my project.nuspec
and do the following:
gulp.src('')
.pipe(nuget.pack({ nuspec: 'project.nuspec', nuget: nugetPath, version: '1.0.0' }))
This generates the package correctly but the whole thing feels a bit odd. Like I say, I'm probably missing something obvious.
Would be nice to add the functionality for delete command
I am running gulp script on windows.
I have a private nuget repository where packages get updated periodically.
I tried to update the nuget packages in my visual studio solution using gulp-nuget.
But update command could not be found with gulp-nuget.
Would you be open to a PR that allows you to run nuget from the PATH
so that the path does not need to be explicitly configured?
It would be nice if I could specify other options for nuget pack and push commands through the plugin (-IncludeReferencedProjects etc).
In order to not wrap each available option in the 'options' object, you could just allow users to specify any additional options via an array and then concat it in your createArgs functions.
I have a problem with nuget.push on Jenkins. I get an error:
c:\jenkins\workspace\my_project\node_modules\gulp-nuget\lib\push.js:22
if(err) throw new gutil.PluginError('gulp-nuget', err);
^
Error: Command failed: File does not exist (c:\jenkins\workspace\my_project\stage\project.3.5.1.32.nupkg).
at ChildProcess.exithandler (child_process.js:647:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
I've checked current location before running nuget.push:
> pwd
/c/jenkins/workspace/my_project
I've checked the content of the c:\jenkins\workspace\my_project\stage directory:
> ls stage/
app.bundle.js
app.bundle.js.map
index.html
project.3.5.1.32.nupkg
vendor.bundle.js
vendor.bundle.js.map
web.config
It seems like the file is there, but nuget.push doesn't see it. What else can cause that ? For example nupkg can be invalid and the error is misleading ?
It seems like it doesn't work with asp.net core ?
I am using the following command, but it creates 2 .nupkg
files - one at the location I specify and another one in the root directory of my project. Both files have the same name (which corresponds to {basename}.nupkg). I checked and it doesn't seem to have anything to do with the location of the .nuspec
file or the location of nuget.exe
.
Here is the code that I am using. It uses gulp-out.
var distributionFolder = './dist/';
var nuspecFile = './project.nuspec';
var nugetPath = '/nuget.exe';
var version = '1.0.0';
gulp.src('', { base: './' })
.pipe(nuget.pack({ nuspec: nuspecFile, nuget: nugetPath, version: version }))
.pipe(out(distributionFolder + '{basename}.nupkg'));
The shrink wrap file for gulp-nuget
specifies a dependency on [email protected]
.
That particular version has just disappeared from npm, so it is no longer possible to run npm install
on any project that uses gulp-nuget
. Consequently, my build which was working fine yesterday is now broken.
This can be fixed by upgrading to [email protected]
which is still valid.
Hello @mckn!
It would be great if you would add support packing on UNIX with using Mono.
Example for Grunt - https://github.com/spatools/grunt-nuget/blob/3ea24a762255d82dca3ae1fd2446b3d3f77ab3e7/libs/nuget.js#L32
Best Regards, Artem.
Your package-lock file is part of th epackage and in the resolved fields there are absolute URLs to npmjs.org. With this setting I am unable to install this package using an internal repository behind a firewall , as npm goes directly to npmjs.org to download the dependencies.
I guess it would be fine to use relative path in resolved fields.
If nuget push fails with an error, the following stack trace is shown and no error information is visible:
Error: no writecb in Transform class
at afterTransform (_stream_transform.js:90:33)
at TransformState.afterTransform (_stream_transform.js:74:12)
at \node_modules\gulp-nuget\lib\push.js:38:3
at \node_modules\gulp-nuget\lib\push-cmd.js:24:3
at ChildProcess.exithandler (child_process.js:652:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
I assume this because push-cmd calls the callback twice in case of an error.
I am looping through lots of proejcts and generating nuget packages. its throwing halfway statng Process ```
terminated with code 1.
if(err) throw new gutil.PluginError('gulp-nuget', err);
^
Error: stdout maxBuffer exceeded
at Socket. (child_process.js:266:14)
Can you please add support to provide max-buffer parameter.
Hi,
I'm trying to pack and push a package to a nuget server. Pack command creates the package but deletes the file before completion, so the push command cannot find the file specified. Is there any configuration that I am missing? Thanks
gulp.task('nuget-pack-n-push-website', function() {
return gulp.src(config.release.website)
.pipe(nuget.pack({
nuget: nugetExecutable,
version: version
}))
.pipe(nuget.push({
nuget: nugetExecutable,
source: 'http://example.com/nuget/nuget',
apiKey: '00000000-0000-0000-0000-000000000000'
}));
});
[15:19:21] MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
Attempting to build package from 'Example.nuspec'.
Successfully created package './.gulp-nuget\Example.1.0.nupkg'.
c:\example\node_modules\gulp-nuget\lib\push.js:22
if(err) throw new gutil.PluginError('gulp-nuget', err);
^
Error: Command failed: c:/Example/nuget/nuget.exe push ./.gulp-nuget\Example.1.0.nupkg -source http://example.com/nuget/nuget -apiKey 00000000-0000-0000-0000-000000000000 -noninteractive
Could not find a part of the path 'c:\Example\.gulp-nuget'.
at ChildProcess.exithandler (child_process.js:203:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
OS: Windows 7
gulp: 3.9.1
node: 4.1.2
npm: 3.7.5
gulp-nuget: 1.0.0
The README.md is near-empty, you should provide some examples or actually document how gulp-nuget is used and what its capabilities are.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.