michaelbazos / angular-feather

A-la-carte integration of Feather Icons in Angular applications
MIT License
155 stars 38 forks source link

fix(): Relax angular peer dependency #64

Closed moberwasserlechner closed 1 year ago

moberwasserlechner commented 1 year ago

closes #62 closes #59

michaelbazos commented 1 year ago

Thanks Michael.

Is the changelog generated by a tool?

michaelbazos commented 1 year ago

Note, I released earlier today 6.4.1, which aligns the angular peer dependencies version in the library's package.json with the package.json file at root, that is to version ^14, but I am up for relaxing the version, as well as integrating other changes from this PR.

moberwasserlechner commented 1 year ago

Hi Michael,

re changelog) No, I added it manually but we could use sth like "standard-version" but at the time I was faster by adding it manually

re 6.4.1) I increased the PR version to 6.5.0 as that would better identify the upgrade of the "feather-icon" lib from 4.28 to 4.29

Moreover I further relaxed the peer dependency to >=11. The lib uses Angular's most basic features, therefore I think it would be save to let user with older Angular versions use the lib's new release. What do you think about that?

I can test with Angular 11, 12 and 14 tomorrow using a local build.

BR

michaelbazos commented 1 year ago

Moreover I further relaxed the peer dependency to >=11. The lib uses Angular's most basic features, therefore I think it would be save to let user with older Angular versions use the lib's new release. What do you think about that?

I agree with the approach, this is better for retro-compatibility.

moberwasserlechner commented 1 year ago

Unfortunately my idea to just change the peer dependency does not work as intended. Testing with Angular 12 results in this error.

./node_modules/angular-feather/fesm2015/angular-feather.mjs - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
TypeError: Cannot create property 'message' on string '\node_modules\angular-feather\fesm2015\angular-feather.mjs: This application depends upon a library published using Angular version 14.0.5, which requires Angular version 14.0.0 or newer to work correctly.
Consider upgrading your application to use a more recent version of Angular.
  33 | }
  34 | FeatherComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FeatherComponent, deps: [{ token: ElementRef }, { token: ChangeDetectorRef }, { token: Icons }], target: i0.ɵɵFactoryTarget.Component });
> 35 | FeatherComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: FeatherComponent, selector: "i-feather, feather-icon", inputs: { name: "name" }, usesOnChanges: true, ngImport: i0, template: "<ng-content></ng-content>\r\n", styles: [":host{display:inline-block;width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}\n"] });
     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  36 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FeatherComponent, decorators: [{
  37 |             type: Component,
  38 |             args: [{ selector: 'i-feather, feather-icon', template: "<ng-content></ng-content>\r\n", styles: [":host{display:inline-block;width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}\n"] }]'
    at run (node_modules\@babel\core\lib\transformation\index.js:37:15)
    at run.next (<anonymous>)
    at Function.transform (node_modules\@babel\core\lib\transform.js:25:41)
    at transform.next (<anonymous>)
    at step (node_modules\gensync\index.js:261:32)
    at node_modules\gensync\index.js:273:13
    at async.call.result.err.err (node_modules\gensync\index.js:223:11)
    at node_modules\gensync\index.js:189:28
    at node_modules\@babel\core\lib\gensync-utils\async.js:73:7
    at node_modules\gensync\index.js:113:33
michaelbazos commented 1 year ago

With angular 13 you get no error?

moberwasserlechner commented 1 year ago

I've not tested with Angular 13 yet but I'll give it another try on the weekend.

moberwasserlechner commented 1 year ago

I downgraded the Angular version the lib is developed with because applications using a library need to use a Angular version greater or equal than the Angular version the lib is developed in.

See https://angular.io/guide/creating-libraries#ensuring-library-version-compatibility for details.

moberwasserlechner commented 1 year ago

I tested with Angular 12, 13 and 14 applications and so far it works fine :)

moberwasserlechner commented 1 year ago

This PR is ready to be merged. I found no further problems. Please review.

moberwasserlechner commented 1 year ago

Do you know when you probably will release/publish to npm?

michaelbazos commented 1 year ago

My bad for the delay. Version 6.5.0 is now public on npm registry.