Skip to content

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

Merged
merged 2 commits into from
Sep 21, 2018
Merged

Conversation

ryanbrandenburg
Copy link
Contributor

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.

@ryanbrandenburg
Copy link
Contributor Author

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" />
Copy link
Member

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.

Copy link
Contributor Author

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)*.*;"/>
Copy link
Member

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?

Copy link
Member

@SteveSandersonMS SteveSandersonMS left a 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.

@ryanbrandenburg
Copy link
Contributor Author

🆙📅'ed with @SteveSandersonMS's suggestion.

@SteveSandersonMS
Copy link
Member

Nicely done!

@ryanbrandenburg ryanbrandenburg merged commit dd69746 into master Sep 21, 2018
@ryanbrandenburg ryanbrandenburg deleted the rybrande/license branch September 21, 2018 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants