Skip to content

Commit

Permalink
Merge pull request #11 from Progi1984/managePSVersions
Browse files Browse the repository at this point in the history
Manage PS Versions (Nightly or versions)
  • Loading branch information
Progi1984 committed Jan 23, 2024
2 parents 1d2990f + 8f98f7d commit 3d454b8
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Expand Up @@ -50,6 +50,12 @@ module.exports = {
'import/no-unresolved': 0,
'import/extensions': ['off', 'never'],
'no-use-before-define': 0,
'@typescript-eslint/no-unused-vars': [
'error',
{
varsIgnorePattern: '^getPSVersion$',
},
],
// Remove after Typescript Migration
'import/no-import-module-exports': 0,
},
Expand Down
2 changes: 1 addition & 1 deletion src/pages/BO/dashboard/index.ts
@@ -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 = global.getPSVersion();

/* eslint-disable global-require */
function requirePage(): DashboardPageInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/BO/login/index.ts
@@ -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 = global.getPSVersion();

/* eslint-disable global-require */
function requirePage(): LoginPageInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/BO/modules/blockwishlist/index.ts
@@ -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 = global.getPSVersion();

/* eslint-disable global-require */
function requirePage(): ModuleBlockwishlistMainPageInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/BO/modules/blockwishlist/statistics.ts
@@ -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 = global.getPSVersion();

/* eslint-disable global-require */
function requirePage(): ModuleBlockwishlistStatisticsPageInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/BO/modules/moduleManager/index.ts
@@ -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 = global.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
@@ -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 = global.getPSVersion();

/* eslint-disable global-require */
function requirePage(): FoCategoryPageInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/FO/home/index.ts
@@ -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 = global.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
@@ -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 = global.getPSVersion();

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

// eslint-disable-next-line no-inner-declarations
function getPSVersion(): string {
if (!process.env.PS_VERSION) {
return '0.0.0';
}
if (process.env.PS_VERSION === 'nightly') {
return '99.99.99';
}
return process.env.PS_VERSION;
}
}

export {};

0 comments on commit 3d454b8

Please sign in to comment.