From 6dc01b538c20310a7b768de64777c7a255d08402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Wed, 8 Nov 2023 14:20:58 +0100 Subject: [PATCH] feat: improve monorepo dev experience --- frontend/app/angular.json | 7 ++- frontend/app/package.json | 4 +- .../modules/dashboard/dashboard.component.ts | 2 +- .../src/app/modules/news/page/news-page.scss | 2 +- frontend/app/src/global.scss | 20 ++++----- frontend/app/tsconfig.json | 2 + packages/collection-utils/README.md | 0 packages/core/test/compat.spec.ts | 43 ------------------- 8 files changed, 21 insertions(+), 59 deletions(-) create mode 100644 packages/collection-utils/README.md delete mode 100644 packages/core/test/compat.spec.ts diff --git a/frontend/app/angular.json b/frontend/app/angular.json index 04073824..a38bf812 100644 --- a/frontend/app/angular.json +++ b/frontend/app/angular.json @@ -11,7 +11,7 @@ "schematics": {}, "architect": { "build": { - "builder": "@angular-devkit/build-angular:browser", + "builder": "@angular-devkit/build-angular:browser-esbuild", "options": { "outputPath": "www", "index": "src/index.html", @@ -50,7 +50,10 @@ }, "./node_modules/leaflet/dist/leaflet.css", "./node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css" - ] + ], + "stylePreprocessorOptions": { + "includePaths": ["src", "src/theme/util", "node_modules"] + } }, "configurations": { "production": { diff --git a/frontend/app/package.json b/frontend/app/package.json index 0cdd7628..b3bfff2e 100644 --- a/frontend/app/package.json +++ b/frontend/app/package.json @@ -26,7 +26,7 @@ "chromium:virtual-host": "chromium --host-resolver-rules=\"MAP mobile.app.uni-frankfurt.de:* localhost:8100\" --ignore-certificate-errors", "cypress:open": "cypress open", "cypress:run": "cypress run", - "dev": "ng serve app -c local", + "dev": "ng serve app", "dev:external": "ionic serve --external", "dev:prod": "ionic serve --prod", "dev:virtual-host": "ionic serve --public-host=mobile.app.uni-frankfurt.de --ssl=true --open=false", @@ -124,7 +124,7 @@ "@angular-eslint/eslint-plugin-template": "16.1.0", "@angular-eslint/schematics": "16.1.0", "@angular-eslint/template-parser": "16.1.0", - "@angular/cli": "16.1.4", + "@angular/cli": "17.0.0", "@angular/compiler": "16.1.4", "@angular/compiler-cli": "16.1.4", "@angular/language-service": "16.1.4", diff --git a/frontend/app/src/app/modules/dashboard/dashboard.component.ts b/frontend/app/src/app/modules/dashboard/dashboard.component.ts index 08b01c68..8cc03aab 100644 --- a/frontend/app/src/app/modules/dashboard/dashboard.component.ts +++ b/frontend/app/src/app/modules/dashboard/dashboard.component.ts @@ -28,7 +28,7 @@ import {takeUntilDestroyed} from '@angular/core/rxjs-interop'; @Component({ selector: 'app-dashboard', templateUrl: './dashboard.component.html', - styleUrls: ['./dashboard.component.scss', '/dashboard.collapse.component.scss'], + styleUrls: ['./dashboard.component.scss', './dashboard.collapse.component.scss'], }) export class DashboardComponent implements OnInit, OnDestroy { @ViewChild('toolbar', {read: ElementRef}) toolbarRef: ElementRef; diff --git a/frontend/app/src/app/modules/news/page/news-page.scss b/frontend/app/src/app/modules/news/page/news-page.scss index cfe9a606..61429f98 100644 --- a/frontend/app/src/app/modules/news/page/news-page.scss +++ b/frontend/app/src/app/modules/news/page/news-page.scss @@ -12,7 +12,7 @@ * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ -@import 'src/theme/util/mixins'; +@import 'mixins'; .news-grid { @include auto-grid(300px); diff --git a/frontend/app/src/global.scss b/frontend/app/src/global.scss index 5848a75f..c458a5b0 100644 --- a/frontend/app/src/global.scss +++ b/frontend/app/src/global.scss @@ -14,17 +14,17 @@ */ // http://ionicframework.com/docs/theming/ -@import '~@ionic/angular/css/normalize.css'; -@import '~@ionic/angular/css/structure.css'; -@import '~@ionic/angular/css/typography.css'; -@import '~@ionic/angular/css/core.css'; +@import '@ionic/angular/css/normalize'; +@import '@ionic/angular/css/structure'; +@import '@ionic/angular/css/typography'; +@import '@ionic/angular/css/core'; -@import '~@ionic/angular/css/padding.css'; -@import '~@ionic/angular/css/float-elements.css'; -@import '~@ionic/angular/css/text-alignment.css'; -@import '~@ionic/angular/css/text-transformation.css'; -@import '~@ionic/angular/css/flex-utils.css'; -@import '~@ionic/angular/css/display.css'; +@import '@ionic/angular/css/padding'; +@import '@ionic/angular/css/float-elements'; +@import '@ionic/angular/css/text-alignment'; +@import '@ionic/angular/css/text-transformation'; +@import '@ionic/angular/css/flex-utils'; +@import '@ionic/angular/css/display'; @import 'swiper/scss'; @import 'swiper/scss/controller'; diff --git a/frontend/app/tsconfig.json b/frontend/app/tsconfig.json index 39b1d1d8..2956c57c 100644 --- a/frontend/app/tsconfig.json +++ b/frontend/app/tsconfig.json @@ -4,7 +4,9 @@ "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", + "allowJs": true, "declaration": false, + "declarationMap": false, "emitDecoratorMetadata": true, "skipLibCheck": false, "isolatedModules": false, diff --git a/packages/collection-utils/README.md b/packages/collection-utils/README.md new file mode 100644 index 00000000..e69de29b diff --git a/packages/core/test/compat.spec.ts b/packages/core/test/compat.spec.ts deleted file mode 100644 index 1b8230f3..00000000 --- a/packages/core/test/compat.spec.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2021 StApps - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - */ - -import {lightweightProjectFromPath, LightweightProject} from '@openstapps/easy-ast'; -import {expect} from 'chai'; - -process.on('unhandledRejection', error => { - throw error; -}); - -describe('Mapping Compatibility', () => { - let project: LightweightProject; - - before(function () { - this.timeout(15_000); - this.slow(10_000); - - project = lightweightProjectFromPath('src'); - }); - - it('non-exported definitions should not have duplicate names across files', () => { - const names = new Set(); - - for (const file in project) { - for (const definition in project[file]) { - expect(names).not.to.include(definition); - names.add(definition); - } - } - }); -});