jwaliszko / ExpressiveAnnotations

Annotation-based conditional validation library.
MIT License
351 stars 123 forks source link

Add package.json for installation via npm #122

Closed galvarez421 closed 6 years ago

galvarez421 commented 8 years ago

Currently, the lack of a package.json file in the root folder causes an error when trying to install this package via npm install.

Reference: https://docs.npmjs.com/cli/install

ruant commented 7 years ago

PR: https://github.com/jwaliszko/ExpressiveAnnotations/pull/133

jwaliszko commented 7 years ago

@ruant, @galvarez421: I have a question related to version numbers of package.json.

Since this package contains expressive.annotations.validate.js script only (as opposite to MVC NuGet package, which in fact contains all 3 components - the script and 2 DLLs), shouldn't it reflect the version of the script file alone (currently it would be 2.6.8, instead the version of the entire product, i.e. 2.9.1)?

Do you have any recommendations (pros/cons) regarding versioning in such a case?

galvarez421 commented 7 years ago

That seems to make sense, assuming that you want the npm package to include only the script. It mirrors the approach for versioning being used for the "ExpressiveAnnotations core assembly" NuGet package, which is also just a part of the entire package and is versioned separately (2.7.0), right?

jwaliszko commented 7 years ago

@galvarez421: Right.

My thinking is separate versioning is better here, and reflects what such a package actually contains.

Suppose we go the other way around, and put entire product version into package.json. Next, we change some DLL, and increase product version to, e.g. 2.10. Necessity of upgrading package.json to reflect that new product would be confusing, since the actual script component, the only part of this npm package, stays unchanged.

Unless I've missed something (never used npm ;) we should most likely stick to the separate versioning.

galvarez421 commented 7 years ago

I think that makes sense.

jwaliszko commented 6 years ago

A bit late, but npm package with the EA script is published (cdnjs support should be there soon as well).