Skip to content

Commit

Permalink
Manage PS Versions (Nightly or versions)
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 committed Jan 22, 2024
1 parent 1d2990f commit 8935fe7
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/pages/BO/dashboard/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {DashboardPageInterface} from '@interfaces/BO/dashboard';
import semver from 'semver';

const psVersion = process.env.PS_VERSION ?? '0.0.0';
const psVersion = getPSVersion();

/* eslint-disable global-require */
function requirePage(): DashboardPageInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/BO/login/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {LoginPageInterface} from '@interfaces/BO/login';
import semver from 'semver';

const psVersion = process.env.PS_VERSION ?? '0.0.0';
const psVersion = getPSVersion();

/* eslint-disable global-require */
function requirePage(): LoginPageInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/BO/modules/blockwishlist/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {ModuleBlockwishlistMainPageInterface} from '@interfaces/BO/modules/blockwishlist/index';
import semver from 'semver';

const psVersion = process.env.PS_VERSION ?? '0.0.0';
const psVersion = getPSVersion();

/* eslint-disable global-require */
function requirePage(): ModuleBlockwishlistMainPageInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/BO/modules/blockwishlist/statistics.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {ModuleBlockwishlistStatisticsPageInterface} from '@interfaces/BO/modules/blockwishlist/statistics';
import semver from 'semver';

const psVersion = process.env.PS_VERSION ?? '0.0.0';
const psVersion = getPSVersion();

/* eslint-disable global-require */
function requirePage(): ModuleBlockwishlistStatisticsPageInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/BO/modules/moduleManager/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {ModuleManagerPageInterface} from '@interfaces/BO/modules/moduleManager';
import semver from 'semver';

const psVersion = process.env.PS_VERSION ?? '0.0.0';
const psVersion = getPSVersion();

/* eslint-disable global-require, @typescript-eslint/no-var-requires */
function requirePage(): ModuleManagerPageInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/FO/category/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {FoCategoryPageInterface} from '@interfaces/FO/category';
import semver from 'semver';

const psVersion = process.env.PS_VERSION ?? '0.0.0';
const psVersion = getPSVersion();

/* eslint-disable global-require */
function requirePage(): FoCategoryPageInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/FO/home/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {FoHomePageInterface} from '@interfaces/FO/home';
import semver from 'semver';

const psVersion = process.env.PS_VERSION ?? '0.0.0';
const psVersion = getPSVersion();

/* eslint-disable global-require, @typescript-eslint/no-var-requires */
function requirePage(): FoHomePageInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/FO/login/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {FoLoginPageInterface} from '@interfaces/FO/login';
import semver from 'semver';

const psVersion = process.env.PS_VERSION ?? '0.0.0';
const psVersion = getPSVersion();

/* eslint-disable global-require, @typescript-eslint/no-var-requires */
function requirePage(): FoLoginPageInterface {
Expand Down
10 changes: 10 additions & 0 deletions src/types/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ declare global {
var maildevConfig: GlobalMaildevConfig;
var keycloakConfig: GlobalKeycloakConfig;
var browserErrors: GlobalBrowserErrors;

function getPSVersion(): string {

Check failure on line 16 in src/types/globals.d.ts

View workflow job for this annotation

GitHub Actions / ESLint

Move function declaration to program root

Check failure on line 16 in src/types/globals.d.ts

View workflow job for this annotation

GitHub Actions / ESLint

'getPSVersion' is defined but never used
if (!process.env.PS_VERSION) {
return '0.0.0';
}
if (process.env.PS_VERSION == 'nightly') {

Check failure on line 20 in src/types/globals.d.ts

View workflow job for this annotation

GitHub Actions / ESLint

Expected '===' and instead saw '=='
return '99.99.99';
}
return process.env.PS_VERSION;
}
}

export {};

0 comments on commit 8935fe7

Please sign in to comment.