Skip to content

Commit

Permalink
patch (#1760)
Browse files Browse the repository at this point in the history
* test :: heroku build using build-2;

* test :: heroku build using build-2;

* add :: check for players with null links;

* add :: correct page data variable property name;

* .gitignore update;

* core :: Makefile update;

* ci :: disable sentry and hertzer deploy jobs;

* [STASH] :: #1718

* [STASH] :: #1738
  • Loading branch information
migbash authored Oct 17, 2023
1 parent 8a68e87 commit 2ef8d7d
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 68 deletions.
65 changes: 35 additions & 30 deletions .github/workflows/pr-main-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,16 @@ jobs:
prerelease: false

# ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# ▓▓ NOTE: ▓▓
# ▓▓ NOTE: ▓▓ SKIP ▓▓
# ▓▓ ➤ deploys target MAIN ▓▓
# ▓▓ ➤ after successfull "bump" & "release"; ▓▓
# ▓▓ ➤ dependent on "create-release" ▓▓
# ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓

sentry-sourcemap-deploy:
name: Sentry Sourcemap (Artifacts) Upload
name: 🟣 Sentry sourcemap (artifacts) upload
needs: create-release
if: false
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
Expand All @@ -312,40 +313,44 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16.17.0
- name: '🏗️ Set npm version'
- name: 'setup npm'
run: |
npm install -g [email protected]
- name: 'create .env'
run: |
echo ${{ secrets.ENV_FILE }} | base64 -d > .env
- name: '🟩 Build npm'
- name: 'build'
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
npm install
npm run build-2
# -----------------------
# NOTE: [STASHED]
# -> deploys target MAIN
# -> after successfull "bump" & "release";
# -> dependent on "create-release"
# -----------------------
# deploy:
# name: 🚀 Deployment
# needs: create-release
# runs-on: ubuntu-22.04
# steps:
# - name: executing remote ssh commands using password
# uses: appleboy/[email protected]
# # [ℹ] declaring ENV variables to be used in the project-CI/CD
# with:
# host: ${{secrets.WEB_SERVER_HOST}}
# username: ${{secrets.WEB_SERVER_USERNAME}}
# key: ${{secrets.WEB_SERVER_KEY}}
# port: ${{secrets.WEB_SERVER_PORT}}
# script: |
# # [ℹ] Navigate to target project directory
# cd web/scores
# # [ℹ] Update the directory with latests changes
# git pull origin main
# # [ℹ] Run target makefile command
# make update-scores-web
# ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# ▓▓ NOTE: ▓▓ SKIP ▓▓
# ▓▓ ➤ deploys target MAIN ▓▓
# ▓▓ ➤ after successfull "bump" & "release"; ▓▓
# ▓▓ ➤ dependent on "create-release" ▓▓
# ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓

deploy:
name: 🚀 Deployment
if: false
needs: create-release
runs-on: ubuntu-22.04
steps:
- name: executing remote ssh commands using password
uses: appleboy/[email protected]
# [ℹ] declaring ENV variables to be used in the project-CI/CD
with:
host: ${{secrets.WEB_SERVER_HOST}}
username: ${{secrets.WEB_SERVER_USERNAME}}
key: ${{secrets.WEB_SERVER_KEY}}
port: ${{secrets.WEB_SERVER_PORT}}
script: |
# [ℹ] Navigate to target project directory
cd web/scores
# [ℹ] Update the directory with latests changes
git pull origin main
# [ℹ] Run target makefile command
make update-scores-web
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ certs/*
# ▓▓ never uncomment
.env
.env.*
.sentryclirc

# ▓▓ 💠 MISC
WEBSITE-DEV-README.md
datalog/

# [PERSONAL]
# .vscode/
datalog/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ heroku-production-deploy-branch-current:
@echo \
"$(COLOUR_R)\
\n◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️\
\n◼️ 🚀 Pushing current branch to Heroku-Prod ◼️\
\n◼️ 🚀 Pushing current branch to Heroku-Prod ◼️\
\n◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️\
$(END_COLOUR)\n"
@git push heroku-prod $$(git branch --show-current):main -f
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"scripts": {
"start": "node build/index.js",
"build": "VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") vite build",
"build-2": "VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") VITE_SENTRY_UPLOAD_SOURCEMAPS=true vite build",
"build": "cross-env NODE_OPTIONS=--max_old_space_size=4096 VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") VITE_SENTRY_UPLOAD_SOURCEMAPS=true vite build",
"build-2": "cross-env NODE_OPTIONS=--max_old_space_size=4096 VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") VITE_SENTRY_UPLOAD_SOURCEMAPS=true vite build",
"test": "npm run test:integration && npm run test:unit",
"svelte-check": "svelte-check --tsconfig ./tsconfig.json",
"svelte-check::watch": "svelte-check --tsconfig ./tsconfig.json --watch",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
-->
<td>
<p>
${competitionObject?.data?.entry_fee ?? '-'}
{competitionObject?.data?.entry_fee ?? '-'} BTA
</p>
</td>

Expand All @@ -283,7 +283,7 @@
-->
<td>
<p>
${toDecimalFix((competitionObject?.data?.total_prize - competitionObject?.data?.betarena_commission), 2, true) ?? ''}
{toDecimalFix((competitionObject?.data?.total_prize - competitionObject?.data?.betarena_commission), 2, true) ?? ''} BTA
</p>
</td>

Expand All @@ -292,7 +292,7 @@
-->
<td>
<p>
${toDecimalFix(competitionPotentialUserWin, 2, true) ?? '-'}
{toDecimalFix(competitionPotentialUserWin, 2, true) ?? '-'} BTA
</p>
</td>

Expand Down Expand Up @@ -367,7 +367,7 @@
-->
<td>
<p>
${toDecimalFix(competitionPotentialUserWin, 2, true) ?? '-'}
{toDecimalFix(competitionPotentialUserWin, 2, true) ?? '-'} BTA
</p>
<p
class=
Expand Down Expand Up @@ -561,13 +561,13 @@
{translationObject2?.categories?.["1"] ?? '-'}

{:else if item == 'entry_fee'}
${competitionObject?.data?.entry_fee ?? '-'}
{competitionObject?.data?.entry_fee ?? '-'} BTA

{:else if item == 'total_prize'}
${toDecimalFix((competitionObject?.data?.total_prize - competitionObject?.data?.betarena_commission), 2, true) ?? ''}
{toDecimalFix((competitionObject?.data?.total_prize - competitionObject?.data?.betarena_commission), 2, true) ?? ''} BTA

{:else if item == 'potential_win'}
${toDecimalFix(competitionPotentialUserWin, 2, true) ?? '-'}
{toDecimalFix(competitionPotentialUserWin, 2, true) ?? '-'} BTA

{:else if item == 'forecast'}
{competitionUserForecast ?? '-'}
Expand Down
46 changes: 24 additions & 22 deletions src/lib/store/user-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,34 @@ function createLocalStore
(
): void =>
{
const existing: string = localStorage.getItem(key);
const exisitng_data: User_Setting = existing
?
JSON.parse(existing)
:
{
lang: 'en',
theme: 'Light',
country_bookmaker: undefined,
geoJs: undefined,
user: undefined,
voted_fixtures: [],
userguide_id_opt_out: [],
}
;
let localStore: User_Setting = methods.parseLocalStorage();

// ◼️◼️◼️ CHECK
// ◼️◼️◼️ absent localstorage object.
if (localStore == null)
{
localStore =
{
lang: 'en',
theme: 'Dark',
country_bookmaker: undefined,
geoJs: undefined,
user: undefined,
voted_fixtures: [],
userguide_id_opt_out: [],
}
}

if (exisitng_data.userguide_id_opt_out == null)
exisitng_data.userguide_id_opt_out = [];
// ◼️◼️◼️ NOTE:
// ◼️◼️◼️ force users to have '_this_' object data property.
if (localStore.userguide_id_opt_out == null)
localStore.userguide_id_opt_out = [];
;

localStorage.setItem
methods.setLocalStorage
(
key,
JSON.stringify(exisitng_data)
);
set(exisitng_data);
localStore
);
},

/**
Expand Down
2 changes: 2 additions & 0 deletions src/lib/utils/platform-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,8 @@ export function cleanUrl
url: string
): string
{
if (url == null) return '';

url = url.replace
(
'https://scores.betarena.com',
Expand Down
4 changes: 2 additions & 2 deletions src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export async function load
FIXTURE_LINEUPS_TRANSLATION,
FIXTURE_INCIDENTS,
FXITURE_INCIDENTS_TRANSLATION,
FEATURED_BETTING_SITES_WIDGET_DATA_SEO,
B_FEATB_T,
FIXTURE_STATISTICS,
FIXTURE_STATISTICS_TRANSLATION,
FIXTURE_CONTENT,
Expand Down Expand Up @@ -322,7 +322,7 @@ export async function load
FIXTURE_LINEUPS_TRANSLATION,
FIXTURE_INCIDENTS,
FXITURE_INCIDENTS_TRANSLATION,
FEATURED_BETTING_SITES_WIDGET_DATA_SEO,
B_FEATB_T,
FIXTURE_STATISTICS,
FIXTURE_STATISTICS_TRANSLATION,
FIXTURE_CONTENT,
Expand Down

0 comments on commit 2ef8d7d

Please sign in to comment.