angular-esri-components icon indicating copy to clipboard operation
angular-esri-components copied to clipboard

ng-packagr

Open TheKeithStewart opened this issue 7 years ago • 12 comments

Migrate Library to the ng-packagr Format

The following wiki describes how to do this with the angular-cli:

https://github.com/angular/angular-cli/wiki/stories-create-library

Requirements

  • [x] Upgrade to v6 of the angular-cli and migrate existing library files to the new structure
  • [x] Create an example app that uses the library
  • [x] Add NPM scripts for managing the library
    • [x] Build
    • [x] Test
  • [x] Update the package.json new library with the current version of the library
  • [x] Update the CHANGELOG.md with notes about the changes
  • [x] Test in existing applications
  • [ ] Update README.md in root of the project with information about the project

TheKeithStewart avatar Mar 11 '18 19:03 TheKeithStewart

@JordeyWijnbergen @slackinator @rrdlpl

I have created a branch for moving this library over to using ng-packagr. The branch can be found at https://github.com/TheKeithStewart/angular-esri-components/tree/ng-packagr. Since you all have contributed to this library I'd like to get feedback from you about the new structure.

Some things to note:

  • the project now contains an application that is using the angular-esri-components library and can be used as an example application
  • you can run the example application by executing the following:
npm install
npm run build
npm start

This installs dependencies, builds the library, and runs the application that is using the library.

  • the library itself is now located in the projects/angular-esri-components folder

Please take a look at the branch and let me know what you think.

TheKeithStewart avatar May 04 '18 22:05 TheKeithStewart

@JordeyWijnbergen @slackinator @rrdlpl

I believe that I have all of the substantial changes done on the library for the new structure and for the upgrade to Angular v6. I have tested it out in a couple of apps that I have that are using the library and it seems to work well. If possible I'd like to test it in other apps that you guys are using.

If you have the time could you please try it out in your applications as well? You can install it by doing the following:

  1. checkout the latest from the following branch: https://github.com/TheKeithStewart/angular-esri-components/tree/ng-packagr
  2. from the root of the library directory execute the following commands:
npm install
npm run build
cd dist/angular-esri-components
npm pack
  1. install the tarball that was generated from the npm pack in your project

As mentioned above this version of the library is dependent on Angular v6. With that in mind you will need to upgrade your project to version 6 of Angular as well. If you need some info about that upgrade take a look at the following article https://dev.to/chiangs/upgrading-to-angular-6-309p. There are a few breaking changes in this version of Angular but using ng update makes it so easy to do!

One other note, in this update of the library the angular-esri-loader module has been removed. If you were using this in your projects you can replace it with EsriModuleProvider that is provide by this library.

Let me know if you need any help with this. I really appreciate you any help you can give!

TheKeithStewart avatar May 09 '18 01:05 TheKeithStewart

Hi Keith,

Im planning to work on it tomorrow!

Kind regards Jordey

Verzonden vanaf mijn Windows 10-telefoon


Van: Keith Stewart [email protected] Verzonden: Wednesday, May 9, 2018 3:11:56 AM Aan: TheKeithStewart/angular-esri-components CC: Jordey Wijnbergen; Mention Onderwerp: Re: [TheKeithStewart/angular-esri-components] ng-packagr (#26)

@JordeyWijnbergenhttps://github.com/JordeyWijnbergen @slackinatorhttps://github.com/slackinator @rrdlplhttps://github.com/rrdlpl

I believe that I have all of the substantial changes done on the library for the new structure and for the upgrade to Angular v6. I have tested it out in a couple of apps that I have that are using the library and it seems to work well. If possible I'd like to test it in other apps that you guys are using.

If you have the time could you please try it out in your applications as well? You can install it by doing the following:

  1. checkout the latest from the following branch: https://github.com/TheKeithStewart/angular-esri-components/tree/ng-packagr
  2. from the root of the library directory execute the following commands:

npm install npm run build cd dist/angular-esri-components npm pack

  1. install the tarball that was generated from the npm pack in your project

As mentioned above this version of the library is dependent on Angular v6. With that in mind you will need to upgrade your project to version 6 of Angular as well. If you need some info about that upgrade take a look at the following article https://dev.to/chiangs/upgrading-to-angular-6-309p. There are a few breaking changes in this version of Angular but using ng update makes it so easy to do!

One other note, in this update of the library the angular-esri-loader module has been removed. If you were using this in your projects you can replace it with EsriModuleProvider that is provide by this library.

Let me know if you need any help with this. I really appreciate you any help you can give!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/TheKeithStewart/angular-esri-components/issues/26#issuecomment-387589441, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AhucPr_f4epU-EOpqfjhFqN3kCZJjfSdks5twkJcgaJpZM4Sl0kB.

JordeyWijnbergen avatar May 09 '18 07:05 JordeyWijnbergen

I just fixed an issue where the LayersToggleComponent was not getting exported and therefore wasn't available in the consuming apps. If you have already started testing the library please pull down the latest.

TheKeithStewart avatar May 09 '18 10:05 TheKeithStewart

I was able to get the run build command to work and brought the updated version into the project. Needed to fix ElementRef in EsriMapService for it to work in my project. I also recreated the minimal updates to allow developers to specify a different view type. (Need SceneView for a certain project)

Will create a PR with my changes momentarily.

slackinator avatar May 09 '18 18:05 slackinator

Thanks, @slackinator! I have successfully tested and have merged in your change. Thanks for trying it out and catching those issues!

TheKeithStewart avatar May 09 '18 18:05 TheKeithStewart

Hi @TheKeithStewart ,

Thanks nice work. It works great with my code!

I ran into a breaking change with ArcGIS JavaScript 4.7 typings. The typing for the Search widget is renamed from Search into widgetsSearch. And the Search typing is changed into the web scene version.

Please let me know if there is a particular thing you would like me to test.

Kind regards,

Jordey

JordeyWijnbergen avatar May 10 '18 17:05 JordeyWijnbergen

That is great, @JordeyWijnbergen! Thanks for giving it a look.

Nothing in particular I wanted you to test other than installing it in your application does not break anything.

I'm going to put a bit more detail in the change log and update the readme and then I will cut a release. Probably won't be until early next week though.

TheKeithStewart avatar May 10 '18 17:05 TheKeithStewart

@TheKeithStewart Is there anything you need help on to get this closer to completion?

slackinator avatar Jun 01 '18 15:06 slackinator

Thanks for the offer, @slackinator! I'm working on it this weekend and hoping to cut the release. If I'm not able to get it completed then I will let you know what I could use some help with.

TheKeithStewart avatar Jun 02 '18 10:06 TheKeithStewart

@JordeyWijnbergen @slackinator

I have published version 2 of this library! I have not closed this Issue yet because I still need to update the root README appropriately and I think that there is an issue with where the library README links are pointing for what is published to npm. I'll get those fixed up soon.

Thanks for your help on this guys!!!

TheKeithStewart avatar Jun 02 '18 11:06 TheKeithStewart

Great! Thank you!

Jordey


Van: Keith Stewart [email protected] Verzonden: zaterdag 2 juni 2018 13:24 Aan: TheKeithStewart/angular-esri-components CC: Jordey Wijnbergen; Mention Onderwerp: Re: [TheKeithStewart/angular-esri-components] ng-packagr (#26)

@JordeyWijnbergenhttps://github.com/JordeyWijnbergen @slackinatorhttps://github.com/slackinator

I have published version 2 of this library! I have not closed this Issue yet because I still need to update the root README appropriately and I think that there is an issue with where the library README links are pointing for what is published to npm. I'll get those fixed up soon.

Thanks for your help on this guys!!!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/TheKeithStewart/angular-esri-components/issues/26#issuecomment-394079919, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AhucPhuoguEmmYh_45aJPhk0zkbhvkh_ks5t4nX2gaJpZM4Sl0kB.

JordeyWijnbergen avatar Jun 05 '18 07:06 JordeyWijnbergen