cstefanache / angular2-img-cropper

Angular 2 Image Cropper
MIT License
364 stars 135 forks source link

Clean the distributable package #167

Closed leosvelperez closed 7 years ago

cstefanache commented 7 years ago

unfortunately this will break AOT compiler. can you please check ngc compilation on pull request. On Fri, 31 Mar 2017 at 22:21, Leosvel Pérez Espinosa < notifications@github.com> wrote:


You can view, comment on, or merge this pull request online at:

https://github.com/cstefanache/angular2-img-cropper/pull/167 Commit Summary

  • ignored .ts files

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cstefanache/angular2-img-cropper/pull/167, or mute the thread https://github.com/notifications/unsubscribe-auth/AC7c4Vg7JMd17m-wyZ0TTjJ3kHOyjRFyks5rrVIrgaJpZM4MwDqy .

leosvelperez commented 7 years ago

@cstefanache do you mean running ngc on this project? or do you mean running it on an external project using this lib as a dependency when it has no .ts file in the package?

leosvelperez commented 7 years ago

@cstefanache I'll update this PR with other changes to make it work well with AoT and with a cleaner npm package.

leosvelperez commented 7 years ago

@cstefanache I made some updates to the tsconfig-aot.json file and the npm scripts. Now, when you do npm run build you'll have everything compiled to the dist folder, with all the metadata needed by AoT to work with and the declaration files. When you do npm run release:patch (or minor, or major) you'll have all the previous functionalities you were using and in addition, the package.json will be copied to the dist folder without the devDependencies and the scripts. The README.md and the LICENSE.md will also be copied for publishing that folder as the distributable package. If you don't use any of the npm run release:VERSION script and you publish it manually just be sure to follow this steps:

npm run build
// Before this step you must change the package version
npm run copy:release
cd dist
npm publish

I tested the generated package on a real application and it worked perfectly with JiT and AoT. I published it just for testing here https://www.npmjs.com/package/ng2-img-cropper-custom, I'll unpublish it later.

Regards!

cstefanache commented 7 years ago

Thanks!

cstefanache commented 7 years ago

will release it as 0.8.6