Skip to content

Commit

Permalink
Merge pull request #2787 from ever-co/stage
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
evereq authored Jul 23, 2024
2 parents b43e27e + 4af6326 commit 287b1cc
Show file tree
Hide file tree
Showing 53 changed files with 1,114 additions and 420 deletions.
57 changes: 29 additions & 28 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"Accordian",
"adipiscing",
"aliqua",
"tblr",
"conver",
"amet",
"Andross",
"animatable",
Expand All @@ -23,6 +21,7 @@
"arrowleft",
"asel",
"Authentificate",
"authjs",
"barcodes",
"billrate",
"binutils",
Expand All @@ -48,6 +47,7 @@
"choos",
"ciphertext",
"classpath",
"Clik",
"cloc",
"clockcircleo",
"cloudinary",
Expand All @@ -62,13 +62,21 @@
"combx",
"commitlint",
"comparision",
"comparization",
"compodoc",
"consectetur",
"containerd",
"contaniner",
"conver",
"creatoe",
"dailyplan",
"Darkmode",
"datas",
"dataToDisplay",
"dearmor",
"deepscan",
"Defaul",
"Desabled",
"Descrption",
"deserunt",
"dimesions",
Expand All @@ -79,6 +87,7 @@
"domutils",
"DONT",
"dotenv",
"dpkg",
"Dropown",
"dropwdown",
"dummyimage",
Expand All @@ -90,6 +99,7 @@
"embla",
"Enderbury",
"endregion",
"Entra",
"Entypo",
"envalid",
"errr",
Expand All @@ -115,6 +125,7 @@
"gauzystage",
"gcloud",
"Gitter",
"GlobalSkeleton",
"gradlew",
"graphicsmagick",
"greenkeeper",
Expand Down Expand Up @@ -170,9 +181,11 @@
"kanban",
"Kanbanboard",
"kanbandata",
"keyrings",
"Kiritimati",
"Kolkata",
"Kosrae",
"Koyeb",
"labore",
"Lask",
"lastest",
Expand All @@ -191,6 +204,7 @@
"mathieudutour",
"Mazen",
"Metral",
"MICROSOFTENTRAID",
"miliseconds",
"millisencods",
"mobx",
Expand All @@ -200,7 +214,11 @@
"nextjs",
"nimg",
"nocheck",
"nodesource",
"nodistro",
"noreferrer",
"Northflank",
"Notif",
"Opena",
"opentelemetry",
"Ordereds",
Expand All @@ -220,10 +238,12 @@
"phraseapp",
"pkill",
"Plaholder",
"plan",
"plasmo",
"plasmohq",
"popperjs",
"Pourtcent",
"prebuild",
"precommit",
"Pressable",
"Pressible",
Expand All @@ -236,6 +256,7 @@
"RECAPTCHA",
"recieve",
"Reconds",
"Relationnal",
"Repobeats",
"RESERVERD",
"Rickert",
Expand All @@ -249,6 +270,7 @@
"Settingfilter",
"setuptools",
"setwin",
"setwork",
"shadcn",
"shandow",
"signin",
Expand All @@ -259,9 +281,8 @@
"skey",
"smalltext",
"snyk",
"Sonner",
"sonner",
"Notif",
"Sonner",
"stackoverflow",
"statsus",
"statut",
Expand All @@ -270,8 +291,8 @@
"stylelint",
"stylesheet",
"subsquently",
"svgs",
"svgr",
"svgs",
"Swith",
"Syle",
"Synk",
Expand All @@ -281,6 +302,7 @@
"tanstack",
"taskid",
"taskstatus",
"tblr",
"teamtask",
"tempor",
"testid",
Expand All @@ -290,6 +312,7 @@
"tinvitations",
"tnode",
"Togger",
"tomorow",
"Tongatapu",
"tota",
"TRANSFERT",
Expand Down Expand Up @@ -326,29 +349,7 @@
"Xlarge",
"xlcard",
"xlight",
"yellowbox",
"Desabled",
"keyrings",
"dearmor",
"dpkg",
"containerd",
"nodistro",
"nodesource",
"Koyeb",
"Northflank",
"prebuild",
"dataToDisplay",
"GlobalSkeleton",
"dailyplan",
"tomorow",
"comparization",
"plan",
"setwork",
"Clik",
"Relationnal",
"authjs",
"MICROSOFTENTRAID",
"Entra"
"yellowbox"
],
"useGitignore": true,
"ignorePaths": [
Expand Down
82 changes: 41 additions & 41 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
{
"importSorter.generalConfiguration.sortOnBeforeSave": false,
"importSorter.sortConfiguration.joinImportPaths": false,
"cSpell.userWords": [],
"cSpell.enabled": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"npm.packageManager": "yarn",
"prettier.trailingComma": "none",
"prettier.singleQuote": true,
"editor.formatOnSave": true,
"eslint.format.enable": true,
"editor.tabSize": 4,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "never",
"source.sortMembers": "never",
"organizeImports": "never"
},
"vsicons.presets.angular": true,
"deepscan.enable": true,
"cSpell.words": [],
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/node_modules": false,
"**/public/**/*.png": false,
"**/public/**/*.jpg": false,
"**/public/**/*.pdf": true
},
"search.exclude": {
"**/node_modules": true,
"**/.idea": true,
"**/.idea/**/*.{xml,iml}": true,
"**/.iml": true,
"**/.yarn": true,
"**/yarn.lock": true
},
"docwriter.style": "Auto-detect"
"importSorter.generalConfiguration.sortOnBeforeSave": false,
"importSorter.sortConfiguration.joinImportPaths": false,
"cSpell.userWords": [],
"cSpell.enabled": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"npm.packageManager": "yarn",
"prettier.trailingComma": "none",
"prettier.singleQuote": true,
"editor.formatOnSave": true,
"eslint.format.enable": true,
"editor.tabSize": 4,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "never",
"source.sortMembers": "never",
"organizeImports": "never"
},
"vsicons.presets.angular": true,
"deepscan.enable": true,
"cSpell.words": ["Timepicker"],
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/node_modules": false,
"**/public/**/*.png": false,
"**/public/**/*.jpg": false,
"**/public/**/*.pdf": true
},
"search.exclude": {
"**/node_modules": true,
"**/.idea": true,
"**/.idea/**/*.{xml,iml}": true,
"**/.iml": true,
"**/.yarn": true,
"**/yarn.lock": true
},
"docwriter.style": "Auto-detect"
}
3 changes: 2 additions & 1 deletion apps/server-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"i18next-resources-to-backend": "^1.2.1",
"react-i18next": "^14.1.0",
"@radix-ui/react-switch": "^1.1.0",
"classnames": "^2.5.1"
"classnames": "^2.5.1",
"fast-glob": "^3.3.2"
},
"devDependencies": {
"electron": "28.1.0",
Expand Down
3 changes: 2 additions & 1 deletion apps/server-web/src/locales/i18n/bg/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"INFO": "Информация",
"UPDATE_AVAILABLE": "Налична е нова актуализация! Моля, щракнете върху бутона Изтегляне сега по-долу.",
"EXIT_MESSAGE": "Мрежата на сървъра все още работи, сигурни ли сте, че ще излезете от приложението?",
"UPDATE_SUCCESS": "Актуализирайте успешно"
"UPDATE_SUCCESS": "Актуализирайте успешно",
"SERVER_RUN_DIALOG": "Сървърната мрежа работи в момента, искате ли да рестартирате сървъра?"
},
"LANGUAGES": {
"en": "Английски",
Expand Down
3 changes: 2 additions & 1 deletion apps/server-web/src/locales/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"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 ?",
"UPDATE_SUCCESS": "Update Successfully"
"UPDATE_SUCCESS": "Update Successfully",
"SERVER_RUN_DIALOG": "Server web currently running, You want to restart the server ?"
},
"LANGUAGES": {
"en": "English",
Expand Down
6 changes: 4 additions & 2 deletions apps/server-web/src/main/helpers/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export const EventLists = {
UPDATE_CANCELLED: 'UPDATE_CANCELLED',
CHANGE_LANGUAGE: 'CHANGE_LANGUAGE',
OPEN_WEB: 'OPEN_WEB',
SERVER_WINDOW: 'SERVER_WINDOW'
SERVER_WINDOW: 'SERVER_WINDOW',
RESTART_SERVER: 'RESTART_SERVER'
}

export const SettingPageTypeMessage = {
Expand All @@ -33,7 +34,8 @@ export const SettingPageTypeMessage = {
langChange: 'lang',
updateSetting: 'update-setting',
updateSettingResponse: 'update-setting-response',
updateCancel: 'update-cancel'
updateCancel: 'update-cancel',
restartServer: 'restart-server'
}

export const ServerPageTypeMessage = {
Expand Down
3 changes: 2 additions & 1 deletion apps/server-web/src/main/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './create-window'
export * from './create-window';
export * from './replace-config';
44 changes: 44 additions & 0 deletions apps/server-web/src/main/helpers/replace-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import fs from 'fs';
import path from 'path';
import fg from 'fast-glob';
import os from 'os';

type EnvOptions = {
before: {
NEXT_PUBLIC_GAUZY_API_SERVER_URL?: string
},
after: {
NEXT_PUBLIC_GAUZY_API_SERVER_URL?: string
}
}

const scanAllFiles = async (files: string[], oldConfig: string, newConfig: string) => {
files.forEach((file) => {
if (path.extname(file) === '.js') {
try {
const data = fs.readFileSync(file, 'utf-8');
const result = data.replace(new RegExp(oldConfig, 'g'), newConfig);
fs.writeFileSync(file, result, 'utf8');
} catch (error) {
console.log('error replace', error);
}
}
});
}
export const replaceConfig = async (folderPath: string, envOptions: EnvOptions) => {
try {
console.log('all files path', folderPath);
if (os.platform() === 'win32') {
folderPath = folderPath.replace(/\\/g, '/');
}
console.log('final path', folderPath);
const NEXT_PUBLIC_GAUZY_API_SERVER_URL_BEFORE = `"NEXT_PUBLIC_GAUZY_API_SERVER_URL","${envOptions.before.NEXT_PUBLIC_GAUZY_API_SERVER_URL}"`;
const NEXT_PUBLIC_GAUZY_API_SERVER_URL_AFTER = `"NEXT_PUBLIC_GAUZY_API_SERVER_URL","${envOptions.after.NEXT_PUBLIC_GAUZY_API_SERVER_URL}"`;
const NEXT_PUBLIC_GAUZY_API_SERVER_URL_DEFAULT = `"NEXT_PUBLIC_GAUZY_API_SERVER_URL","https://api.ever.team"`;
const files = await fg(`${folderPath}/**/*`, { onlyFiles: true });
await scanAllFiles(files, NEXT_PUBLIC_GAUZY_API_SERVER_URL_BEFORE, NEXT_PUBLIC_GAUZY_API_SERVER_URL_AFTER);
await scanAllFiles(files, NEXT_PUBLIC_GAUZY_API_SERVER_URL_DEFAULT, NEXT_PUBLIC_GAUZY_API_SERVER_URL_AFTER);
} catch (error) {
console.log('error on replacing file', error);
}
}
Loading

0 comments on commit 287b1cc

Please sign in to comment.