Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage PS Versions (Nightly or versions) #11

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
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
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 = global.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 = global.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 = global.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 = global.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 = 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
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 = global.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 = 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
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 = 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
Original file line number Diff line number Diff line change
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 {};