From ee8a942e5cd54594c2f33474e97704cb01998c52 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Fri, 17 Nov 2023 00:32:36 +0100 Subject: [PATCH] excluding cypress tests from mocha and refactoring node_module paths #753 --- package-lock.json | 18 +++++++++--------- package.json | 6 +++--- src/backend/middlewares/admin/SettingsMWs.ts | 2 +- .../model/extension/ExtensionConfigWrapper.ts | 4 ++-- src/common/config/private/MessagingConfig.ts | 4 ++-- src/common/config/private/PrivateConfig.ts | 3 +-- src/frontend/app/ui/admin/admin.component.ts | 2 +- .../ui/gallery/blog/blog.gallery.component.ts | 3 +-- .../search-field.gallery.component.ts | 2 +- .../app/ui/settings/settings.service.ts | 2 +- .../settings-entry/settings-entry.component.ts | 2 +- .../sorting-method.settings-entry.component.ts | 6 +++--- .../ui/settings/template/template.component.ts | 4 ++-- .../unit/middlewares/admin/SettingsMWs.ts | 2 +- 14 files changed, 29 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 912d4dac2..fa93418a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pigallery2", - "version": "2.0.0-rc", + "version": "2.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "pigallery2", - "version": "2.0.0-rc", + "version": "2.0.0", "license": "MIT", "dependencies": { "archiver": "5.3.1", @@ -89,7 +89,7 @@ "codelyzer": "6.0.2", "core-js": "3.29.0", "coveralls": "3.1.1", - "cypress": "latest", + "cypress": "13.1.0", "deep-equal-in-any-order": "2.0.5", "ejs-loader": "0.5.0", "eslint": "8.36.0", @@ -8645,9 +8645,9 @@ } }, "node_modules/cypress/node_modules/@types/node": { - "version": "16.18.48", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.48.tgz", - "integrity": "sha512-mlaecDKQ7rIZrYD7iiKNdzFb6e/qD5I9U1rAhq+Fd+DWvYVs+G2kv74UFHmSOlg5+i/vF3XxuR522V4u8BqO+Q==", + "version": "16.18.61", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.61.tgz", + "integrity": "sha512-k0N7BqGhJoJzdh6MuQg1V1ragJiXTh8VUBAZTWjJ9cUq23SG0F0xavOwZbhiP4J3y20xd6jxKx+xNUhkMAi76Q==", "dev": true }, "node_modules/cypress/node_modules/ansi-styles": { @@ -30548,9 +30548,9 @@ }, "dependencies": { "@types/node": { - "version": "16.18.48", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.48.tgz", - "integrity": "sha512-mlaecDKQ7rIZrYD7iiKNdzFb6e/qD5I9U1rAhq+Fd+DWvYVs+G2kv74UFHmSOlg5+i/vF3XxuR522V4u8BqO+Q==", + "version": "16.18.61", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.61.tgz", + "integrity": "sha512-k0N7BqGhJoJzdh6MuQg1V1ragJiXTh8VUBAZTWjJ9cUq23SG0F0xavOwZbhiP4J3y20xd6jxKx+xNUhkMAi76Q==", "dev": true }, "ansi-styles": { diff --git a/package.json b/package.json index 54158f12c..8d75c3308 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "create-release": "gulp create-release", "build-backend": "tsc", "pretest": "tsc", - "test": "ng test && nyc mocha --recursive test", - "test-backend": "tsc && mocha --recursive test", + "test": "ng test && nyc mocha --recursive test --exclude test/cypress/**/*.js", + "test-backend": "tsc && mocha --recursive test --exclude test/cypress/**/*.js", "coverage": "nyc report --reporter=lcov", "start": "node ./src/backend/index", "run-dev": "ng build --configuration=dev", @@ -112,7 +112,7 @@ "codelyzer": "6.0.2", "core-js": "3.29.0", "coveralls": "3.1.1", - "cypress": "latest", + "cypress": "13.1.0", "deep-equal-in-any-order": "2.0.5", "ejs-loader": "0.5.0", "eslint": "8.36.0", diff --git a/src/backend/middlewares/admin/SettingsMWs.ts b/src/backend/middlewares/admin/SettingsMWs.ts index 6f745e030..0e7af1ca0 100644 --- a/src/backend/middlewares/admin/SettingsMWs.ts +++ b/src/backend/middlewares/admin/SettingsMWs.ts @@ -3,7 +3,7 @@ import {ErrorCodes, ErrorDTO} from '../../../common/entities/Error'; import {Logger} from '../../Logger'; import {Config} from '../../../common/config/private/Config'; import {ConfigDiagnostics} from '../../model/diagnostics/ConfigDiagnostics'; -import {ConfigClassBuilder} from '../../../../node_modules/typeconfig/node'; +import {ConfigClassBuilder} from 'typeconfig/node'; import {TAGS} from '../../../common/config/public/ClientConfig'; import {ObjectManagers} from '../../model/ObjectManagers'; import {ExtensionConfigWrapper} from '../../model/extension/ExtensionConfigWrapper'; diff --git a/src/backend/model/extension/ExtensionConfigWrapper.ts b/src/backend/model/extension/ExtensionConfigWrapper.ts index 534b72ce0..b11e5eaaf 100644 --- a/src/backend/model/extension/ExtensionConfigWrapper.ts +++ b/src/backend/model/extension/ExtensionConfigWrapper.ts @@ -1,6 +1,6 @@ -import {IConfigClass} from '../../../../node_modules/typeconfig/common'; +import {IConfigClass} from 'typeconfig/common'; import {Config, PrivateConfigClass} from '../../../common/config/private/Config'; -import {ConfigClassBuilder} from '../../../../node_modules/typeconfig/node'; +import {ConfigClassBuilder} from 'typeconfig/node'; import {IExtensionConfig} from './IExtension'; import {Utils} from '../../../common/Utils'; import {ObjectManagers} from '../ObjectManagers'; diff --git a/src/common/config/private/MessagingConfig.ts b/src/common/config/private/MessagingConfig.ts index 9b9cb8435..067a19f78 100644 --- a/src/common/config/private/MessagingConfig.ts +++ b/src/common/config/private/MessagingConfig.ts @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/no-inferrable-types */ -import {SubConfigClass} from '../../../../node_modules/typeconfig/src/decorators/class/SubConfigClass'; +import {ConfigProperty, SubConfigClass} from 'typeconfig/common'; import {ConfigPriority, TAGS} from '../public/ClientConfig'; -import {ConfigProperty} from '../../../../node_modules/typeconfig/src/decorators/property/ConfigPropoerty'; declare let $localize: (s: TemplateStringsArray) => string; @@ -96,6 +95,7 @@ export class EmailMessagingConfig { smtp?: EmailSMTPMessagingConfig = new EmailSMTPMessagingConfig(); } + @SubConfigClass({softReadonly: true}) export class MessagingConfig { @ConfigProperty({ diff --git a/src/common/config/private/PrivateConfig.ts b/src/common/config/private/PrivateConfig.ts index 76fcbff57..24adc83b0 100644 --- a/src/common/config/private/PrivateConfig.ts +++ b/src/common/config/private/PrivateConfig.ts @@ -26,8 +26,7 @@ import { ConfigPriority, TAGS } from '../public/ClientConfig'; -import {SubConfigClass} from 'typeconfig/src/decorators/class/SubConfigClass'; -import {ConfigProperty} from 'typeconfig/src/decorators/property/ConfigPropoerty'; +import {ConfigProperty, SubConfigClass} from 'typeconfig/common'; import {DefaultsJobs} from '../../entities/job/JobDTO'; import {SearchQueryDTO, SearchQueryTypes, TextSearch,} from '../../entities/SearchQueryDTO'; import {SortByTypes} from '../../entities/SortingMethods'; diff --git a/src/frontend/app/ui/admin/admin.component.ts b/src/frontend/app/ui/admin/admin.component.ts index 64f929c79..04feb789f 100644 --- a/src/frontend/app/ui/admin/admin.component.ts +++ b/src/frontend/app/ui/admin/admin.component.ts @@ -9,7 +9,7 @@ import {ConfigStyle, SettingsService} from '../settings/settings.service'; import {ConfigPriority} from '../../../../common/config/public/ClientConfig'; import {WebConfig} from '../../../../common/config/private/WebConfig'; import {ISettingsComponent} from '../settings/template/ISettingsComponent'; -import {WebConfigClassBuilder} from '../../../../../node_modules/typeconfig/src/decorators/builders/WebConfigClassBuilder'; +import {WebConfigClassBuilder} from 'typeconfig/src/decorators/builders/WebConfigClassBuilder'; import {enumToTranslatedArray} from '../EnumTranslations'; import {PiTitleService} from '../../model/pi-title.service'; diff --git a/src/frontend/app/ui/gallery/blog/blog.gallery.component.ts b/src/frontend/app/ui/gallery/blog/blog.gallery.component.ts index ea8adbea0..137f709de 100644 --- a/src/frontend/app/ui/gallery/blog/blog.gallery.component.ts +++ b/src/frontend/app/ui/gallery/blog/blog.gallery.component.ts @@ -1,6 +1,5 @@ -import {Component, EventEmitter, Input, Output} from '@angular/core'; +import {Component, EventEmitter, Input, Output,OnChanges} from '@angular/core'; import {BlogService, GroupedMarkdown} from './blog.service'; -import {OnChanges} from '../../../../../../node_modules/@angular/core'; import {map, Observable} from 'rxjs'; @Component({ diff --git a/src/frontend/app/ui/gallery/search/search-field/search-field.gallery.component.ts b/src/frontend/app/ui/gallery/search/search-field/search-field.gallery.component.ts index 14afd5973..a1f3345ad 100644 --- a/src/frontend/app/ui/gallery/search/search-field/search-field.gallery.component.ts +++ b/src/frontend/app/ui/gallery/search/search-field/search-field.gallery.component.ts @@ -4,7 +4,7 @@ import {AutoCompleteService} from '../autocomplete.service'; import {SearchQueryDTO} from '../../../../../../common/entities/SearchQueryDTO'; import {ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator,} from '@angular/forms'; import {SearchQueryParserService} from '../search-query-parser.service'; -import {BsModalRef, BsModalService,} from '../../../../../../../node_modules/ngx-bootstrap/modal'; +import {BsModalRef, BsModalService,} from 'ngx-bootstrap/modal'; import {Utils} from '../../../../../../common/Utils'; @Component({ diff --git a/src/frontend/app/ui/settings/settings.service.ts b/src/frontend/app/ui/settings/settings.service.ts index aa27919c1..4e8885f54 100644 --- a/src/frontend/app/ui/settings/settings.service.ts +++ b/src/frontend/app/ui/settings/settings.service.ts @@ -10,7 +10,7 @@ import {CookieService} from 'ngx-cookie-service'; import {DefaultsJobs} from '../../../../common/entities/job/JobDTO'; import {StatisticDTO} from '../../../../common/entities/settings/StatisticDTO'; import {ScheduledJobsService} from './scheduled-jobs.service'; -import {IWebConfigClassPrivate} from '../../../../../node_modules/typeconfig/src/decorators/class/IWebConfigClass'; +import {IWebConfigClassPrivate} from 'typeconfig/src/decorators/class/IWebConfigClass'; export enum ConfigStyle { diff --git a/src/frontend/app/ui/settings/template/settings-entry/settings-entry.component.ts b/src/frontend/app/ui/settings/template/settings-entry/settings-entry.component.ts index 5f2d2b4f0..333add009 100644 --- a/src/frontend/app/ui/settings/template/settings-entry/settings-entry.component.ts +++ b/src/frontend/app/ui/settings/template/settings-entry/settings-entry.component.ts @@ -16,7 +16,7 @@ import {ConfigStyle, SettingsService} from '../../settings.service'; import {WebConfig} from '../../../../../../common/config/private/WebConfig'; import {JobScheduleConfig, UserConfig} from '../../../../../../common/config/private/PrivateConfig'; import {enumToTranslatedArray} from '../../../EnumTranslations'; -import {BsModalService} from '../../../../../../../node_modules/ngx-bootstrap/modal'; +import {BsModalService} from 'ngx-bootstrap/modal'; import {CustomSettingsEntries} from '../CustomSettingsEntries'; import {GroupByTypes, SortByTypes} from '../../../../../../common/entities/SortingMethods'; diff --git a/src/frontend/app/ui/settings/template/settings-entry/sorting-method/sorting-method.settings-entry.component.ts b/src/frontend/app/ui/settings/template/settings-entry/sorting-method/sorting-method.settings-entry.component.ts index 41b563a3c..f879898e4 100644 --- a/src/frontend/app/ui/settings/template/settings-entry/sorting-method/sorting-method.settings-entry.component.ts +++ b/src/frontend/app/ui/settings/template/settings-entry/sorting-method/sorting-method.settings-entry.component.ts @@ -5,12 +5,12 @@ import { NG_VALUE_ACCESSOR, ValidationErrors, Validator -} from '../../../../../../../../node_modules/@angular/forms'; +} from '@angular/forms'; import {SortByDirectionalTypes, SortingMethod} from '../../../../../../../common/entities/SortingMethods'; import {enumToTranslatedArray} from '../../../../EnumTranslations'; import {AutoCompleteService} from '../../../../gallery/search/autocomplete.service'; -import {RouterLink} from '../../../../../../../../node_modules/@angular/router'; -import {forwardRef} from '../../../../../../../../node_modules/@angular/core'; +import {RouterLink} from '@angular/router'; +import {forwardRef} from '@angular/core'; import {Utils} from '../../../../../../../common/Utils'; @Component({ diff --git a/src/frontend/app/ui/settings/template/template.component.ts b/src/frontend/app/ui/settings/template/template.component.ts index 40f7f9859..6c115e316 100644 --- a/src/frontend/app/ui/settings/template/template.component.ts +++ b/src/frontend/app/ui/settings/template/template.component.ts @@ -9,11 +9,11 @@ import {JobDTOUtils} from '../../../../../common/entities/job/JobDTO'; import {ScheduledJobsService} from '../scheduled-jobs.service'; import {UntypedFormControl} from '@angular/forms'; import {Subscription} from 'rxjs'; -import {IWebConfigClassPrivate} from '../../../../../../node_modules/typeconfig/src/decorators/class/IWebConfigClass'; +import {IWebConfigClassPrivate} from 'typeconfig/src/decorators/class/IWebConfigClass'; import {ConfigPriority, TAGS} from '../../../../../common/config/public/ClientConfig'; import {Utils} from '../../../../../common/Utils'; import {UserRoles} from '../../../../../common/entities/UserDTO'; -import {WebConfigClassBuilder} from '../../../../../../node_modules/typeconfig/src/decorators/builders/WebConfigClassBuilder'; +import {WebConfigClassBuilder} from 'typeconfig/web'; import {ErrorDTO} from '../../../../../common/entities/Error'; import {ISettingsComponent} from './ISettingsComponent'; import {CustomSettingsEntries} from './CustomSettingsEntries'; diff --git a/test/backend/unit/middlewares/admin/SettingsMWs.ts b/test/backend/unit/middlewares/admin/SettingsMWs.ts index 12093f64c..72129189c 100644 --- a/test/backend/unit/middlewares/admin/SettingsMWs.ts +++ b/test/backend/unit/middlewares/admin/SettingsMWs.ts @@ -6,10 +6,10 @@ import {SettingsMWs} from '../../../../../src/backend/middlewares/admin/Settings import {ServerUserConfig} from '../../../../../src/common/config/private/PrivateConfig'; import {Config} from '../../../../../src/common/config/private/Config'; import {UserRoles} from '../../../../../src/common/entities/UserDTO'; -import {ConfigClassBuilder} from '../../../../../node_modules/typeconfig/node'; import * as fs from 'fs'; import * as path from 'path'; import {ExtensionConfigWrapper} from '../../../../../src/backend/model/extension/ExtensionConfigWrapper'; +import {ConfigClassBuilder} from 'typeconfig/node'; declare const describe: any;