From 7aa9f6bc9302990c5573f418a55db7e1d4485929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Jovan=C3=AD=20Gonz=C3=A1lez?= <12443324+drackp2m@users.noreply.github.com> Date: Wed, 13 Nov 2024 00:47:30 +0000 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=20refactor(app):=20remove?= =?UTF-8?q?=20not=20used=20imports,=20add=20version=20to=20"footer"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release-notes/template.hbs | 2 +- apps/app/src/app/app.component.ts | 30 ++++++++++++++++++- .../card-shape/card-shape.component.ts | 2 -- .../app/component/card/card.component.scss | 2 +- .../src/app/component/card/card.component.ts | 3 +- apps/app/src/app/layout/main/main.layout.ts | 11 ++++--- .../component/menu/example-menu.component.ts | 2 +- .../src/app/page/example/example.page.html | 10 +++---- .../src/app/page/example/example.page.scss | 8 ----- apps/app/src/app/page/example/example.page.ts | 12 ++------ .../border-radius/border-radius.page.ts | 3 +- .../page/example/section/card/card.page.scss | 3 -- .../page/example/section/card/card.page.ts | 3 +- .../example/section/color/color.page.scss | 4 --- .../page/example/section/color/color.page.ts | 4 +-- .../example/section/shadow/shadow.page.scss | 3 -- .../example/section/spacing/spacing.page.scss | 3 -- .../section/typography/typography.page.scss | 4 --- .../section/typography/typography.page.ts | 4 +-- apps/app/src/app/page/game/game.page.html | 4 +-- apps/app/src/app/page/game/game.page.scss | 3 -- apps/app/src/app/page/game/game.page.ts | 3 +- apps/app/src/app/page/home/home.page.html | 4 +-- apps/app/src/app/page/home/home.page.scss | 4 --- apps/app/src/app/page/login/login.page.html | 4 +-- apps/app/src/app/page/login/login.page.scss | 4 --- apps/app/src/app/page/login/login.page.ts | 5 ++-- apps/app/src/app/page/online/online.page.html | 4 +-- apps/app/src/app/page/online/online.page.scss | 3 -- .../src/app/page/register/register.page.html | 4 +-- .../src/app/page/register/register.page.scss | 4 --- .../src/app/page/register/register.page.ts | 5 ++-- apps/app/src/styles.scss | 6 ++++ apps/app/tsconfig.json | 1 + package.json | 2 +- release.config.js | 2 +- tsconfig.base.json | 1 + 37 files changed, 74 insertions(+), 102 deletions(-) delete mode 100644 apps/app/src/app/page/example/section/color/color.page.scss delete mode 100644 apps/app/src/app/page/example/section/typography/typography.page.scss delete mode 100644 apps/app/src/app/page/login/login.page.scss delete mode 100644 apps/app/src/app/page/register/register.page.scss diff --git a/.github/release-notes/template.hbs b/.github/release-notes/template.hbs index 484bee03..ff6409f8 100644 --- a/.github/release-notes/template.hbs +++ b/.github/release-notes/template.hbs @@ -1,4 +1,4 @@ -# v{{version}} {{date}} +# v{{version}} ({{date}}) ## What's Changed {{#each commitGroups}} diff --git a/apps/app/src/app/app.component.ts b/apps/app/src/app/app.component.ts index 06dd4b78..9e8480a3 100644 --- a/apps/app/src/app/app.component.ts +++ b/apps/app/src/app/app.component.ts @@ -5,10 +5,36 @@ import { SendPingGQL } from '@playsetonline/apollo-definitions'; import { pingValue } from './app.config'; +import { version } from '@package'; + @Component({ standalone: true, selector: 'app-root', - template: ``, + template: ` + + v{{ version }} + `, + styles: ` + :host { + display: flex; + flex-direction: column; + + #app-version { + position: fixed; + bottom: 0; + + position: fixed; + color: rgb(255 255 255 / 90%); + + &::before { + content: attr(data-text); + position: absolute; + -webkit-text-stroke: 2px rgb(0 0 0 / 30%); + z-index: -1; + } + } + } + `, imports: [RouterOutlet], providers: [SendPingGQL], }) @@ -17,6 +43,8 @@ export class AppComponent { private readonly pingValue = pingValue; + version = version; + title = 'app'; constructor() { diff --git a/apps/app/src/app/component/card-shape/card-shape.component.ts b/apps/app/src/app/component/card-shape/card-shape.component.ts index 1a1b623b..58da43b9 100644 --- a/apps/app/src/app/component/card-shape/card-shape.component.ts +++ b/apps/app/src/app/component/card-shape/card-shape.component.ts @@ -1,4 +1,3 @@ -import { NgIf } from '@angular/common'; import { Component, computed, input } from '@angular/core'; import { CardColor, CardShading, CardShape } from '@playsetonline/api-definitions'; @@ -8,7 +7,6 @@ import { CardColor, CardShading, CardShape } from '@playsetonline/api-definition selector: 'app-card-shape', templateUrl: './card-shape.component.html', styleUrl: './card-shape.component.scss', - imports: [NgIf], }) export class CardShapeComponent { shape = input.required({ diff --git a/apps/app/src/app/component/card/card.component.scss b/apps/app/src/app/component/card/card.component.scss index 3a81aa22..463da1c4 100644 --- a/apps/app/src/app/component/card/card.component.scss +++ b/apps/app/src/app/component/card/card.component.scss @@ -2,7 +2,7 @@ aspect-ratio: 1 / 0.6666; height: 100%; - background: white; + background-color: white; border: solid 0.1rem #e5e5e5; border-radius: 3.3% / 5%; diff --git a/apps/app/src/app/component/card/card.component.ts b/apps/app/src/app/component/card/card.component.ts index 1609e9d7..e44fe2bb 100644 --- a/apps/app/src/app/component/card/card.component.ts +++ b/apps/app/src/app/component/card/card.component.ts @@ -1,4 +1,3 @@ -import { NgFor, NgIf } from '@angular/common'; import { Component, computed, input } from '@angular/core'; import { CardColor, CardShading, CardShape } from '@playsetonline/api-definitions'; @@ -10,7 +9,7 @@ import { CardShapeComponent } from '../card-shape/card-shape.component'; selector: 'app-card', templateUrl: './card.component.html', styleUrl: './card.component.scss', - imports: [NgIf, NgFor, CardShapeComponent], + imports: [CardShapeComponent], }) export class CardComponent { private readonly hello = 22; diff --git a/apps/app/src/app/layout/main/main.layout.ts b/apps/app/src/app/layout/main/main.layout.ts index 5c18fdcc..f386d93b 100644 --- a/apps/app/src/app/layout/main/main.layout.ts +++ b/apps/app/src/app/layout/main/main.layout.ts @@ -1,6 +1,6 @@ -import { AsyncPipe, JsonPipe, NgIf, NgTemplateOutlet } from '@angular/common'; +import { NgTemplateOutlet } from '@angular/common'; import { Component, OnInit, inject, signal } from '@angular/core'; -import { Router, RouterModule } from '@angular/router'; +import { Router, RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router'; import { SwUpdate } from '@angular/service-worker'; import { CardColor, CardShading, CardShape } from '@playsetonline/api-definitions'; @@ -21,12 +21,11 @@ import { UserStore } from '../../store/user.store'; templateUrl: './main.layout.html', styleUrl: './main.layout.scss', imports: [ - RouterModule, + RouterOutlet, + RouterLink, + RouterLinkActive, NgTemplateOutlet, MediaDebugComponent, - NgIf, - JsonPipe, - AsyncPipe, CardShapeComponent, ], providers: [GetPingsGQL, GetUserInfoGQL], diff --git a/apps/app/src/app/page/example/component/menu/example-menu.component.ts b/apps/app/src/app/page/example/component/menu/example-menu.component.ts index 97f9a411..b8a22e7e 100644 --- a/apps/app/src/app/page/example/component/menu/example-menu.component.ts +++ b/apps/app/src/app/page/example/component/menu/example-menu.component.ts @@ -7,7 +7,7 @@ import { RouterModule } from '@angular/router'; selector: 'app-example-menu', imports: [NgTemplateOutlet, RouterModule], template: ` - + diff --git a/apps/app/src/app/page/example/example.page.html b/apps/app/src/app/page/example/example.page.html index 782c5745..77a22427 100644 --- a/apps/app/src/app/page/example/example.page.html +++ b/apps/app/src/app/page/example/example.page.html @@ -1,9 +1,9 @@ - + - {{ hello() }} + {{ hello() }} - + xs sm @@ -13,7 +13,7 @@ {{ hello() }} - + {{ hello() }} - + - Sets found: {{ setCards().length / 3 }} + Sets found: {{ setCards().length / 3 }} Wrong sets: {{ wrongSetCards().length / 3 }} - Card in deck: {{ remainingCardsCount() }} + Card in deck: {{ remainingCardsCount() }} diff --git a/apps/app/src/app/page/game/game.page.scss b/apps/app/src/app/page/game/game.page.scss index 61cdc627..b3968216 100644 --- a/apps/app/src/app/page/game/game.page.scss +++ b/apps/app/src/app/page/game/game.page.scss @@ -1,7 +1,4 @@ main { - min-height: 100%; - background-color: rgb(255 255 255 / 90%); - &.avoid-status-bar { @supports (-webkit-touch-callout: none) { padding-top: 60px; diff --git a/apps/app/src/app/page/game/game.page.ts b/apps/app/src/app/page/game/game.page.ts index 8a76ab28..a4a71446 100644 --- a/apps/app/src/app/page/game/game.page.ts +++ b/apps/app/src/app/page/game/game.page.ts @@ -1,5 +1,4 @@ /* eslint-disable max-lines */ -import { NgFor, NgIf } from '@angular/common'; import { Component, computed, effect, inject, signal } from '@angular/core'; import { toSignal } from '@angular/core/rxjs-interop'; import { ActivatedRoute, RouterLink } from '@angular/router'; @@ -17,7 +16,7 @@ import { GameOfflineStore } from './store/game-offline.store'; standalone: true, templateUrl: './game.page.html', styleUrl: './game.page.scss', - imports: [NgIf, NgFor, CardComponent, YouWonComponent, RouterLink], + imports: [CardComponent, YouWonComponent, RouterLink], }) export class GamePage { private readonly gameOfflineStore = inject(GameOfflineStore); diff --git a/apps/app/src/app/page/home/home.page.html b/apps/app/src/app/page/home/home.page.html index abe32cb9..0923e435 100644 --- a/apps/app/src/app/page/home/home.page.html +++ b/apps/app/src/app/page/home/home.page.html @@ -6,7 +6,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> - + @@ -431,4 +431,4 @@ Next steps - + diff --git a/apps/app/src/app/page/home/home.page.scss b/apps/app/src/app/page/home/home.page.scss index 58ff6748..1e6dd267 100644 --- a/apps/app/src/app/page/home/home.page.scss +++ b/apps/app/src/app/page/home/home.page.scss @@ -85,10 +85,6 @@ svg { border-radius: 1.5rem; } -.wrapper { - background-color: white; -} - .container { width: 100%; max-width: 768px; diff --git a/apps/app/src/app/page/login/login.page.html b/apps/app/src/app/page/login/login.page.html index 0b5104eb..b95eac8f 100644 --- a/apps/app/src/app/page/login/login.page.html +++ b/apps/app/src/app/page/login/login.page.html @@ -1,4 +1,4 @@ - + Login form @@ -35,4 +35,4 @@ Login form } - + diff --git a/apps/app/src/app/page/login/login.page.scss b/apps/app/src/app/page/login/login.page.scss deleted file mode 100644 index fb28e58a..00000000 --- a/apps/app/src/app/page/login/login.page.scss +++ /dev/null @@ -1,4 +0,0 @@ -section { - min-height: 100%; - background-color: white; -} diff --git a/apps/app/src/app/page/login/login.page.ts b/apps/app/src/app/page/login/login.page.ts index aa6620d3..a2f772b7 100644 --- a/apps/app/src/app/page/login/login.page.ts +++ b/apps/app/src/app/page/login/login.page.ts @@ -1,4 +1,4 @@ -import { JsonPipe, NgFor, NgIf } from '@angular/common'; +import { JsonPipe } from '@angular/common'; import { Component, OnInit, WritableSignal, inject, signal } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { Router } from '@angular/router'; @@ -12,8 +12,7 @@ import { UserStore } from '../../store/user.store'; @Component({ standalone: true, templateUrl: './login.page.html', - styleUrl: './login.page.scss', - imports: [NgIf, NgFor, ReactiveFormsModule, JsonPipe], + imports: [ReactiveFormsModule, JsonPipe], providers: [GetUsersGQL], }) export class LoginPage implements OnInit { diff --git a/apps/app/src/app/page/online/online.page.html b/apps/app/src/app/page/online/online.page.html index 02495913..383b3b59 100644 --- a/apps/app/src/app/page/online/online.page.html +++ b/apps/app/src/app/page/online/online.page.html @@ -1,5 +1,5 @@ - - List of games + + List of games diff --git a/apps/app/src/app/page/online/online.page.scss b/apps/app/src/app/page/online/online.page.scss index 3382fd90..5d0d1c31 100644 --- a/apps/app/src/app/page/online/online.page.scss +++ b/apps/app/src/app/page/online/online.page.scss @@ -1,7 +1,4 @@ main { - min-height: 100%; - background-color: rgb(255 255 255 / 90%); - .info { min-height: 40px; } diff --git a/apps/app/src/app/page/register/register.page.html b/apps/app/src/app/page/register/register.page.html index 123cd1d3..2473a816 100644 --- a/apps/app/src/app/page/register/register.page.html +++ b/apps/app/src/app/page/register/register.page.html @@ -1,4 +1,4 @@ - + Register form @if (user()) { @@ -34,4 +34,4 @@ Welcome Error: {{ error() | json }} } - + diff --git a/apps/app/src/app/page/register/register.page.scss b/apps/app/src/app/page/register/register.page.scss deleted file mode 100644 index fb28e58a..00000000 --- a/apps/app/src/app/page/register/register.page.scss +++ /dev/null @@ -1,4 +0,0 @@ -section { - min-height: 100%; - background-color: white; -} diff --git a/apps/app/src/app/page/register/register.page.ts b/apps/app/src/app/page/register/register.page.ts index ae5e67be..9cf60622 100644 --- a/apps/app/src/app/page/register/register.page.ts +++ b/apps/app/src/app/page/register/register.page.ts @@ -1,4 +1,4 @@ -import { JsonPipe, NgIf } from '@angular/common'; +import { JsonPipe } from '@angular/common'; import { HttpClient } from '@angular/common/http'; import { Component, WritableSignal, inject, signal } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; @@ -12,8 +12,7 @@ import { UserStore } from '../../store/user.store'; @Component({ standalone: true, templateUrl: './register.page.html', - styleUrl: './register.page.scss', - imports: [NgIf, ReactiveFormsModule, JsonPipe], + imports: [ReactiveFormsModule, JsonPipe], providers: [ApiClient, HttpClient, GetUserInfoGQL], }) export class RegisterPage { diff --git a/apps/app/src/styles.scss b/apps/app/src/styles.scss index e2d8c669..930b7564 100644 --- a/apps/app/src/styles.scss +++ b/apps/app/src/styles.scss @@ -11,6 +11,12 @@ html { font-family: Recursive, sans-serif; font-size: 16px; font-weight: var(--font-weight-md); + + main { + min-height: 100%; + padding-bottom: 42px !important; + background-color: rgb(255 255 255 / 90%); + } } h1, diff --git a/apps/app/tsconfig.json b/apps/app/tsconfig.json index 9d6cb146..bd1e4958 100644 --- a/apps/app/tsconfig.json +++ b/apps/app/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "target": "ES2022", "useDefineForClassFields": false, + "resolveJsonModule": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, diff --git a/package.json b/package.json index 0f0608ca..911b59cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@playsetonline/source", - "version": "1.0.0", + "version": "0.0.1", "license": "MIT", "private": true, "scripts": { diff --git a/release.config.js b/release.config.js index f1836d0e..a986a8ac 100644 --- a/release.config.js +++ b/release.config.js @@ -75,7 +75,7 @@ module.exports = { '@semantic-release/git', { assets: ['package.json', 'CHANGELOG.md'], - message: '🎒 chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}', + message: '🎒 chore(release): v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}', }, ], ], diff --git a/tsconfig.base.json b/tsconfig.base.json index e4f1be19..8cc5ce16 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -21,6 +21,7 @@ "skipLibCheck": true, "skipDefaultLibCheck": true, "paths": { + "@package": ["package.json"], "@playsetonline/api-definitions": ["libs/api-definitions/src/index.ts"], "@playsetonline/api-sdk": ["libs/api-sdk/src/index.ts"], "@playsetonline/apollo-definitions": ["libs/api-definitions/src/lib/apollo/operations.ts"]
Error: {{ error() | json }}