-
Notifications
You must be signed in to change notification settings - Fork 115
Make build.cmd work and do npm pack #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This produces a package with a different shape than what's published on NPM (3.2.4), and there's a version (3.2.5) published on nuget which isn't on npm. @kichalla can you shed some light on any of this? The new package shape seems to be more correct (it matches both what jquery does and what jquery.validation.unobtrusive does), so maybe we just fixed it up to meet "standards" then publishing to npm got missed or silently failed? |
build.msbuild
Outdated
<Target Name="Build"> | ||
<ReadLinesFromFile File="@(VersionFile)"> | ||
<Output TaskParameter="Lines" PropertyName="PackageVersion"/> | ||
</ReadLinesFromFile> | ||
<Exec Command="npm install" /> | ||
<Exec Command="npm version --no-git-tag-version --allow-same-version $(PackageVersion)" /> | ||
<Exec Command="npx gulp" /> | ||
<Exec Command="nuget pack $(NuspecPath) -Version $(PackageVersion)" /> | ||
<Exec Command="$(MSBuildThisFileDirectory)node_modules\.bin\gulp" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more cross-plat-friendly way to do this is npm run build
and then put the call to gulp
in the build
task in your package.json
. This takes care of knowing where to find the gulp
executable - you don't have to hardcode the node_modules\.bin\gulp
path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat!
build.msbuild
Outdated
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<DistDirFiles Include="$(DistDir)*.*;"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about the use of $(DistDir)*.*;
instead of just $(DistDir)*
. Is it possible this could be simplified, or is this glob format needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks good. I'd recommend we do make the change to use npm run build
but it's not a massive deal if we only expect this to be built on Windows.
I don't have an opinion about the resulting NPM package shape since I don't know what the requirements are.
🆙📅'ed with @SteveSandersonMS's suggestion. |
Nicely done! |
Some changes to bring building this repo in line with https://github.com/aspnet/jquery-validation-unobtrusive.
I also stopped checking in the dist folder as part of aspnet/Coherence-Signed#953.