fireworks-js icon indicating copy to clipboard operation
fireworks-js copied to clipboard

Cannot install @fireworks-js/angular

Open Tyler-V opened this issue 1 year ago • 3 comments

Description

It looks like the dependency graph for this package is pointing to @angular/common ^12.0.0 while the latest angular version is 18.x.x

image

Which package are you using?

@fireworks-js/angular

fireworks-js version

^2.10.8

Browser

Version 127.0.6533.72 (Official Build) (64-bit)

Tyler-V avatar Jul 25 '24 18:07 Tyler-V

Hi 👋 I don't write in Angular myself and have no idea how to maintain this a package. Maybe should bump version of Angular and just release a minor update or extend semver in peer depends? 🤔

crashmax-dev avatar Jul 25 '24 18:07 crashmax-dev

Hi @crashmax-dev

Yes in the package (unless there is desire to support <18) it should be sufficient to update and publish,

https://github.com/crashmax-dev/fireworks-js/blob/master/packages/angular/projects/ng-fireworks/package.json

  "peerDependencies": {
    "@angular/common": ">= 18.0.0",
    "@angular/core": ">= 18.0.0"
  },

Tyler-V avatar Jul 25 '24 20:07 Tyler-V

I have pulled it down as a directive in my project and installed fireworks-js directly for the time being

As a standalone component, you can export the directive now and remove the module as well


import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
import type { FireworksOptions } from 'fireworks-js';
import { Fireworks } from 'fireworks-js';

@Directive({
    selector: '[ngFireworks], ng-fireworks',
    exportAs: 'ngFireworks',
    standalone: true
})
export class FireworksJsDirective extends Fireworks implements OnInit, OnDestroy {
    constructor(elRef: ElementRef) {
        super(elRef.nativeElement);
    }

    @Input() options!: FireworksOptions;

    public ngOnInit() {
        this.updateOptions(this.options);
        this.updateSize();
        this.start();
    }

    public ngOnDestroy(): void {
        this.stop();
    }
}

Tyler-V avatar Jul 26 '24 14:07 Tyler-V