Skip to content

Commit

Permalink
Merge pull request #2692 from ever-co/stage
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
evereq authored Jul 7, 2024
2 parents 04bc01c + 900eca5 commit 483e1af
Show file tree
Hide file tree
Showing 66 changed files with 1,740 additions and 503 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/desktop-server-api.apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.serverapi(true))
script.serverapi(true).then(console.log)
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-teams.git'
DESKTOP_API_SERVER_APP_NAME: 'ever-teams-api-server'
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.serverapi(true))
script.serverapi(true).then(console.log)
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-teams.git'
DESKTOP_API_SERVER_APP_NAME: 'ever-teams-api-server'
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.serverapi(true))
script.serverapi(true).then(console.log)
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-teams.git'
DESKTOP_API_SERVER_APP_NAME: 'ever-teams-api-server'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/desktop-server-web.apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.serverweb(true))
script.serverweb(true).then(console.log)
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-teams.git'
DESKTOP_WEB_SERVER_APP_NAME: 'ever-teams-web-server'
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.serverweb(true))
script.serverweb(true).then(console.log)
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-teams.git'
DESKTOP_WEB_SERVER_APP_NAME: 'ever-teams-web-server'
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.serverweb(true))
script.serverweb(true).then(console.log)
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-teams.git'
DESKTOP_WEB_SERVER_APP_NAME: 'ever-teams-web-server'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/desktop.apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.desktopTimer(true))
script.desktopTimer(true).then(console.log)
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-teams.git'
DESKTOP_TIMER_APP_NAME: 'ever-teams-desktop'
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.desktopTimer(true))
script.desktopTimer(true).then(console.log)
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-teams.git'
DESKTOP_TIMER_APP_NAME: 'ever-teams-desktop'
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.desktopTimer(true))
script.desktopTimer(true).then(console.log)
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-teams.git'
DESKTOP_TIMER_APP_NAME: 'ever-teams-desktop'
Expand Down
45 changes: 41 additions & 4 deletions .scripts/bump-version-electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,45 @@ async function getLatestTag(repoURL) {
}

module.exports.serverweb = async (isProd) => {
if (fs.existsSync('./apps/server-web/src/package.json')) {
let package = require('../apps/server-web/src/package.json');
if (fs.existsSync('./apps/server-web/release/app/package.json')) {
let package = require('../apps/server-web/release/app/package.json');
let currentVersion = package.version;

const repoURL = process.env.PROJECT_REPO;
console.log('repoURL', repoURL);

const appName = process.env.DESKTOP_WEB_SERVER_APP_NAME;
console.log('appName', appName);

const stdout = await getLatestTag(repoURL);

let newVersion = stdout.trim();
console.log('latest tag', newVersion);

if (newVersion) {
// let's remove "v" from version, i.e. first character
newVersion = newVersion.substring(1);
package.version = newVersion;

console.log('Version updated to version', newVersion);
} else {
console.log('Latest tag is not found. Build Desktop Web Server App with default version', currentVersion);
}

package.name = appName;
package.productName = process.env.DESKTOP_WEB_SERVER_APP_DESCRIPTION;
package.description = process.env.DESKTOP_WEB_SERVER_APP_DESCRIPTION;
package.homepage = process.env.COMPANY_SITE_LINK;

fs.writeFileSync('./apps/server-web/release/app/package.json', JSON.stringify(package, null, 2));

let updated = require('../apps/server-web/release/app/package.json');

console.log('Version releasing', updated.version);
}

if (fs.existsSync('./apps/server-web/package.json')) {
let package = require('../apps/server-web/package.json');
let currentVersion = package.version;

const repoURL = process.env.PROJECT_REPO;
Expand Down Expand Up @@ -104,9 +141,9 @@ module.exports.serverweb = async (isProd) => {
];
}

fs.writeFileSync('./apps/server-web/src/package.json', JSON.stringify(package, null, 2));
fs.writeFileSync('./apps/server-web/package.json', JSON.stringify(package, null, 2));

let updated = require('../apps/server-web/src/package.json');
let updated = require('../apps/server-web/package.json');

console.log('Version releasing', updated.version);
}
Expand Down
6 changes: 5 additions & 1 deletion apps/server-web/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Ever Teams Web Server

Electron-based Desktop App that serve Ever Teams NextJs frontend.
Electron-based Desktop App that serves Ever Teams NextJs frontend, build with [ERB](https://github.com/electron-react-boilerplate/electron-react-boilerplate).

## Docs

Docs for ERB are available at <https://electron-react-boilerplate.js.org>.
8 changes: 5 additions & 3 deletions apps/server-web/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ever-teams-server-web",
"name": "ever-teams-web-server",
"version": "0.1.0",
"description": "Ever Teams Web Server",
"license": "AGPL-3.0",
Expand Down Expand Up @@ -49,7 +49,9 @@
"i18next-electron-fs-backend": "^3.0.1",
"i18next-fs-backend": "^2.3.1",
"i18next-resources-to-backend": "^1.2.1",
"react-i18next": "^14.1.0"
"react-i18next": "^14.1.0",
"@radix-ui/react-switch": "^1.1.0",
"classnames": "^2.5.1"
},
"devDependencies": {
"electron": "28.1.0",
Expand Down Expand Up @@ -164,7 +166,7 @@
"yarn": ">=1.13.0"
},
"build": {
"appId": "co.ever.teamswebserver",
"appId": "com.ever.everteamswebserver",
"artifactName": "${name}-${version}.${ext}",
"productName": "Ever Teams Web Server",
"copyright": "Copyright © 2024-Present. Ever Co. LTD",
Expand Down
4 changes: 2 additions & 2 deletions apps/server-web/release/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/server-web/release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ever-teams-server-web",
"name": "ever-teams-web-server",
"version": "0.1.0",
"description": "Ever Teams Web Server",
"license": "AGPL-3.0",
Expand Down
4 changes: 2 additions & 2 deletions apps/server-web/src/configs/i18n.mainconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const prependPath = app.isPackaged

i18n.use(backend).init({
backend: {
loadPath: prependPath + '/src/locales/{{lng}}/{{ns}}.json',
addPath: prependPath + '/src/locales/{{lng}}/{{ns}}.missing.json'
loadPath: prependPath + '/src/locales/i18n/{{lng}}/{{ns}}.json',
addPath: prependPath + '/src/locales/i18n/{{lng}}/{{ns}}.missing.json'
},
debug: false,
ns: 'translation',
Expand Down
7 changes: 5 additions & 2 deletions apps/server-web/src/configs/i18nResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import resourcesToBackend from 'i18next-resources-to-backend';

i18n
.use(
resourcesToBackend((language: string, namespace: string) => import(`../locales/${language}/${namespace}.json`))
resourcesToBackend((language: string, namespace: string) => import(`../locales/i18n/${language}/${namespace}.json`))
)
.init({
debug: true,
Expand All @@ -13,6 +13,9 @@ i18n
}
});
i18n.on('failedLoading', (lng, ns, msg) => console.error(msg))
i18n.languages = ['en', 'bg'];
i18n.languages = [
'en',
'bg',
];

export default i18n;
1 change: 0 additions & 1 deletion apps/server-web/src/locales/bg/translation.missing.json

This file was deleted.

38 changes: 0 additions & 38 deletions apps/server-web/src/locales/en/translation.json

This file was deleted.

6 changes: 0 additions & 6 deletions apps/server-web/src/locales/en/translation.missing.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"MENU": {
"SERVER": "сървър",
"UPDATER": "Актуализатор",
"UPDATER": "Актуализация",
"ABOUT": "относно",
"SERVER_START": "Започнете",
"SERVER_STOP": "Спри се",
Expand All @@ -16,7 +16,9 @@
"FIELDS": {
"PORT": "ПРИСТАНИЩЕ",
"GAUZY_API_SERVER_URL": "Gauzy API сървър Url",
"NEXT_PUBLIC_GAUZY_API_SERVER_URL": "Публичен Gauzy API сървър Url"
"NEXT_PUBLIC_GAUZY_API_SERVER_URL": "Публичен Gauzy API сървър Url",
"LANGUAGES": "Езици",
"OPTIONS": "Настроики"
},
"BUTTON": {
"SAVE_SETTING": "Запазване на настройката",
Expand All @@ -28,7 +30,19 @@
"QUIT_N_INSTALL": "Излезте и инсталирайте",
"UP_TO_DATE": "Актуална",
"UPDATE_AVAILABLE": "Налична актуализация",
"CHECK_FOR_UPDATE": "Проверка за актуализация"
"CHECK_FOR_UPDATE": "Проверка за актуализация",
"SERVER_CONFIG": "Конфигурация на сървъра",
"UPDATE_OPTIONS": {
"A_DAY": "Ден",
"A_HOURS": "A часа",
"3_HOURS": "3 часа",
"30_MINUTES": "30 минути"
},
"AUTO_UPDATE_TITLE": "Автоматична проверка на актуализацията",
"AUTO_UPDATE_SUBTITLE": "Активирайте автоматичната проверка на актуализацията, за да стартирате заявка за проверка дали е налична нова версия и да уведомите",
"AUTO_UPDATE_TOGLE": "Автоматична актуализация",
"CHECK_UPDATE_TITLE": "Проверете и актуализирайте версията на приложението си",
"CHECK_UPDATE_SUBTITLE": "Налична е нова актуализация! Моля, щракнете върху бутона Изтегляне сега по-долу."
}
},
"MESSAGE": {
Expand Down
15 changes: 15 additions & 0 deletions apps/server-web/src/locales/i18n/bg/translation.missing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"Status: Started": "Status: Started",
"Start": "Start",
"Stop": "Stop",
"Setting": "Setting",
"About": "About",
"Quit": "Quit",
"Статус: Спряна": "Статус: Спряна",
"Започнете": "Започнете",
"Спри се": "Спри се",
"Настройка": "Настройка",
"относно": "относно",
"Откажете се": "Откажете се",
"Status: Stopped": "Status: Stopped"
}
61 changes: 61 additions & 0 deletions apps/server-web/src/locales/i18n/en/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"MENU": {
"SERVER": "Server",
"UPDATER": "Update",
"ABOUT": "About",
"SERVER_START": "Start",
"SERVER_STOP": "Stop",
"APP_SETTING": "Setting",
"APP_ABOUT": "About",
"APP_QUIT": "Quit",
"GENERAL": "General",
"SERVER_STATUS_STOPPED": "Status: Stopped",
"SERVER_STATUS_STARTED": "Status: Started"
},
"FORM": {
"FIELDS": {
"PORT": "PORT",
"GAUZY_API_SERVER_URL": "Gauzy API Server Url",
"NEXT_PUBLIC_GAUZY_API_SERVER_URL": "Public Gauzy API Server Url",
"LANGUAGES": "Languages",
"OPTIONS": "Options"
},
"BUTTON": {
"SAVE_SETTING": "Save Setting",
"OK": "OK",
"YES": "Yes",
"NO": "No",
"DOWNLOAD_NOW": "Download Now",
"LATER": "Later",
"CANCEL": "Cancel"
},
"LABELS": {
"CHECKING": "Checking",
"DOWNLOADING": "Downloading",
"QUIT_N_INSTALL": "Quit and Install",
"UP_TO_DATE": "Up to date",
"UPDATE_AVAILABLE": "Update Available",
"CHECK_FOR_UPDATE": "Check For Update",
"SERVER_CONFIG": "Server Configuration",
"UPDATE_OPTIONS": {
"A_DAY": "A Day",
"A_HOURS": "A Hours",
"3_HOURS": "30 Hours",
"30_MINUTES": "30 Minutes"
},
"AUTO_UPDATE_TITLE": "Automatic Update Check",
"AUTO_UPDATE_SUBTITLE": "Enable automatice update check, in order to run a request to check if new version is available and notify",
"AUTO_UPDATE_TOGLE": "Automatic Update",
"CHECK_UPDATE_TITLE": "Check & Update your app version",
"CHECK_UPDATE_SUBTITLE": "New Update is available! Please click button Download Now below."
}
},
"MESSAGE": {
"SUCCESS": "Success",
"ERROR": "Error",
"WARNING": "Warning",
"INFO": "Info",
"UPDATE_AVAILABLE": "New Update is available! Please click button Download Now below.",
"EXIT_MESSAGE": "Server web still running, Are you sure to exit the app ?"
}
}
Loading

0 comments on commit 483e1af

Please sign in to comment.