Skip to content

Commit

Permalink
feat(ng19): remove unused modules
Browse files Browse the repository at this point in the history
  • Loading branch information
AmitMY committed Nov 27, 2024
1 parent 146b51d commit 0a6dcf8
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 124 deletions.
10 changes: 5 additions & 5 deletions functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"@firebase/database-types": "1.0.7",
"@google-cloud/storage": "7.14.0",
"@sign-mt/browsermt": "0.2.3",
"@unkey/api": "0.26.2",
"@unkey/ratelimit": "0.4.5",
"@unkey/api": "0.27.0",
"@unkey/ratelimit": "0.4.6",
"cors": "2.8.5",
"express": "4.21.1",
"express-async-errors": "3.1.1",
Expand All @@ -33,7 +33,7 @@
"http-errors": "2.0.0",
"http-proxy-middleware": "^3.0.3",
"node-fetch": "2.6.7",
"openai": "4.73.0",
"openai": "4.73.1",
"request-ip": "3.3.0"
},
"devDependencies": {
Expand All @@ -43,8 +43,8 @@
"@types/jest": "29.5.14",
"@types/node-fetch": "2.6.12",
"@types/request-ip": "0.0.41",
"@typescript-eslint/eslint-plugin": "8.15.0",
"@typescript-eslint/parser": "8.15.0",
"@typescript-eslint/eslint-plugin": "8.16.0",
"@typescript-eslint/parser": "8.16.0",
"eslint": "8.57.0",
"firebase-functions-test": "3.3.0",
"firebase-tools": "13.27.0",
Expand Down
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
},
"private": true,
"dependencies": {
"@angular/animations": "19.0.0",
"@angular/cdk": "19.0.0",
"@angular/common": "19.0.0",
"@angular/compiler": "19.0.0",
"@angular/core": "19.0.0",
"@angular/forms": "19.0.0",
"@angular/material": "19.0.0",
"@angular/platform-browser": "19.0.0",
"@angular/platform-browser-dynamic": "19.0.0",
"@angular/platform-server": "19.0.0",
"@angular/router": "19.0.0",
"@angular/service-worker": "19.0.0",
"@angular/ssr": "19.0.1",
"@angular/animations": "19.0.1",
"@angular/cdk": "19.0.1",
"@angular/common": "19.0.1",
"@angular/compiler": "19.0.1",
"@angular/core": "19.0.1",
"@angular/forms": "19.0.1",
"@angular/material": "19.0.1",
"@angular/platform-browser": "19.0.1",
"@angular/platform-browser-dynamic": "19.0.1",
"@angular/platform-server": "19.0.1",
"@angular/router": "19.0.1",
"@angular/service-worker": "19.0.1",
"@angular/ssr": "19.0.2",
"@asymmetrik/ngx-leaflet": "18.0.1",
"@capacitor-firebase/analytics": "6.2.0",
"@capacitor-firebase/app": "6.2.0",
Expand Down Expand Up @@ -106,15 +106,15 @@
"zone.js": "0.15.0"
},
"devDependencies": {
"@angular-devkit/architect": "0.1900.1",
"@angular-devkit/build-angular": "19.0.1",
"@angular-devkit/architect": "0.1900.2",
"@angular-devkit/build-angular": "19.0.2",
"@angular-eslint/builder": "18.4.2",
"@angular-eslint/eslint-plugin": "18.4.2",
"@angular-eslint/eslint-plugin-template": "18.4.2",
"@angular-eslint/schematics": "18.4.2",
"@angular-eslint/template-parser": "18.4.2",
"@angular/cli": "19.0.1",
"@angular/compiler-cli": "19.0.0",
"@angular/cli": "19.0.2",
"@angular/compiler-cli": "19.0.1",
"@capacitor/assets": "3.0.5",
"@capacitor/cli": "6.2.0",
"@ionic/angular-server": "8.4.0",
Expand All @@ -132,8 +132,8 @@
"@types/web-app-manifest": "1.0.8",
"@types/webgl2": "0.0.11",
"@types/wicg-file-system-access": "2023.10.5",
"@typescript-eslint/eslint-plugin": "8.15.0",
"@typescript-eslint/parser": "8.15.0",
"@typescript-eslint/eslint-plugin": "8.16.0",
"@typescript-eslint/parser": "8.16.0",
"browser-sync": "3.0.3",
"deepmerge": "4.3.1",
"dotenv": "16.4.5",
Expand Down
3 changes: 1 addition & 2 deletions src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const routes: Routes = [
{
path: 'playground',
loadComponent: () => import('./pages/playground/playground.component').then(m => m.PlaygroundComponent),
providers: [provideStates([VideoState, PoseState, SignWritingState, DetectorState])],
},
{
path: 'benchmark',
Expand All @@ -31,7 +30,7 @@ export const routes: Routes = [
path: '',
loadComponent: () => import('./pages/translate/translate.component').then(m => m.TranslateComponent),
providers: [
provideStates([TranslateState, VideoState, PoseState, SignWritingState, DetectorState]),
provideStates([TranslateState]),
{provide: LanguageDetectionService, useClass: MediaPipeLanguageDetectionService},
],
},
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/animation/animation.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {AfterViewInit, Component, CUSTOM_ELEMENTS_SCHEMA, ElementRef, inject, Input, viewChild} from '@angular/core';
import {Store} from '@ngxs/store';
import {AnimationStateModel} from '../../modules/animation/animation.state';
import {provideStates, Store} from '@ngxs/store';
import {AnimationState, AnimationStateModel} from '../../modules/animation/animation.state';
import {BaseComponent} from '../base/base.component';
import {map, takeUntil, tap} from 'rxjs/operators';
import {ThreeService} from '../../core/services/three.service';
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/animation/animation.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {CUSTOM_ELEMENTS_SCHEMA, NgModule} from '@angular/core';
import {AnimationComponent} from './animation.component';
import {NgxsModule} from '@ngxs/store';
import {NgxsModule, provideStates} from '@ngxs/store';
import {AnimationState} from '../../modules/animation/animation.state';

@NgModule({
exports: [AnimationComponent],
imports: [NgxsModule.forFeature([AnimationState]), AnimationComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [AnimationComponent],
providers: [provideStates([AnimationState])],
})
export class AnimationModule {}
9 changes: 7 additions & 2 deletions src/app/components/video/video.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ import {addIcons} from 'ionicons';
import {playCircleOutline} from 'ionicons/icons';
import {AsyncPipe} from '@angular/common';
import {TranslocoDirective, TranslocoPipe} from '@ngneat/transloco';
import {AnimationModule} from '../animation/animation.module';

@Component({
selector: 'app-video',
templateUrl: './video.component.html',
styleUrls: ['./video.component.scss'],
imports: [AnimationComponent, VideoControlsComponent, IonIcon, AsyncPipe, TranslocoPipe, TranslocoDirective],
imports: [AnimationModule, VideoControlsComponent, IonIcon, AsyncPipe, TranslocoPipe, TranslocoDirective],
})
export class VideoComponent extends BaseComponent implements AfterViewInit {
private store = inject(Store);
Expand All @@ -44,7 +45,7 @@ export class VideoComponent extends BaseComponent implements AfterViewInit {
readonly videoEl = viewChild<ElementRef<HTMLVideoElement>>('video');
readonly canvasEl = viewChild<ElementRef<HTMLCanvasElement>>('canvas');
readonly statsEl = viewChild<ElementRef>('stats');
appRootEl = document.querySelector('ion-app') ?? document.body;
appRootEl!: HTMLElement;

@HostBinding('class') aspectRatio = 'aspect-16-9';

Expand All @@ -61,6 +62,10 @@ export class VideoComponent extends BaseComponent implements AfterViewInit {
constructor() {
super();

if ('document' in globalThis) {
this.appRootEl = document.querySelector('ion-app') ?? document.body;
}

addIcons({playCircleOutline});
}

Expand Down
14 changes: 14 additions & 0 deletions src/app/components/video/video.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {NgModule} from '@angular/core';
import {VideoComponent} from './video.component';
import {provideStates} from '@ngxs/store';
import {VideoState} from '../../core/modules/ngxs/store/video/video.state';
import {DetectorState} from '../../modules/detector/detector.state';
import {SignWritingState} from '../../modules/sign-writing/sign-writing.state';
import {PoseState} from '../../modules/pose/pose.state';

@NgModule({
exports: [VideoComponent],
imports: [VideoComponent],
providers: [provideStates([VideoState, SignWritingState, PoseState, DetectorState])],
})
export class VideoModule {}

This file was deleted.

19 changes: 0 additions & 19 deletions src/app/core/modules/shared.module.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/app/modules/animation/animation.module.ts

This file was deleted.

9 changes: 3 additions & 6 deletions src/app/modules/animation/animation.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import {TestBed} from '@angular/core/testing';
import {AnimationService} from './animation.service';
import {EstimatedPose} from '../pose/pose.state';
import {EstimatedPose, PoseState} from '../pose/pose.state';
import {TensorflowService} from '../../core/services/tfjs/tfjs.service';
import {MediapipeHolisticService} from '../../core/services/holistic.service';
import {PoseModule} from '../pose/pose.module';
import {NgxsModule} from '@ngxs/store';
import {provideStates, provideStore} from '@ngxs/store';
import {SettingsState} from '../settings/settings.state';
import {ngxsConfig} from '../../app.config';

describe('AnimationService', () => {
let service: AnimationService;
Expand All @@ -15,8 +13,7 @@ describe('AnimationService', () => {

beforeEach(async () => {
TestBed.configureTestingModule({
imports: [NgxsModule.forRoot([SettingsState], ngxsConfig), PoseModule],
providers: [TensorflowService],
providers: [provideStore([SettingsState, PoseState])],
});
service = TestBed.inject(AnimationService);
tf = TestBed.inject(TensorflowService);
Expand Down
11 changes: 0 additions & 11 deletions src/app/modules/detector/detector.module.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/app/modules/pix2pix/pix2pix.module.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/app/modules/pose/pose.module.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/app/modules/sign-writing/sign-writing.module.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/app/pages/playground/playground.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {VideoComponent} from '../../components/video/video.component';
import {SettingsComponent} from '../../modules/settings/settings/settings.component';
import {earOutline} from 'ionicons/icons';
import {addIcons} from 'ionicons';
import {VideoModule} from '../../components/video/video.module';

@Component({
selector: 'app-playground',
Expand All @@ -22,7 +23,7 @@ import {addIcons} from 'ionicons';
IonHeader,
IonToolbar,
IonTitle,
VideoComponent,
VideoModule,
SettingsComponent,
IonIcon,
TranslocoPipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {addIcons} from 'ionicons';
import {copyOutline} from 'ionicons/icons';
import {TranslocoPipe} from '@ngneat/transloco';
import {AsyncPipe, NgTemplateOutlet} from '@angular/common';
import {VideoModule} from '../../../components/video/video.module';

const FAKE_WORDS = [
{
Expand Down Expand Up @@ -94,7 +95,7 @@ const FAKE_WORDS = [
SignWritingComponent,
IonButton,
TextToSpeechComponent,
VideoComponent,
VideoModule,
UploadComponent,
IonIcon,
TranslocoPipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {SignedLanguageOutputComponent} from '../spoken-to-signed/signed-language
import {SignedLanguageInputComponent} from '../signed-to-spoken/signed-language-input/signed-language-input.component';
import {VideoComponent} from '../../../components/video/video.component';
import {LanguageSelectorsComponent} from '../language-selectors/language-selectors.component';
import {VideoModule} from '../../../components/video/video.module';

@Component({
selector: 'app-translate-mobile',
Expand All @@ -19,7 +20,7 @@ import {LanguageSelectorsComponent} from '../language-selectors/language-selecto
SignedLanguageOutputComponent,
SignedLanguageInputComponent,
SpokenLanguageInputComponent,
VideoComponent,
VideoModule,
LanguageSelectorsComponent,
],
})
Expand Down

0 comments on commit 0a6dcf8

Please sign in to comment.