Skip to content
New issue

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

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

Already on GitHub? # to your account

Release #3033

Merged
merged 18 commits into from
Sep 17, 2024
Merged

Release #3033

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
5be351f
chore(deps): bump micromatch from 4.0.5 to 4.0.8
dependabot[bot] Sep 8, 2024
cee7a8e
[Fix] builds errors and warnings (#2982)
GedeonTS Sep 9, 2024
ca133bd
Merge pull request #2997 from ever-co/dependabot/npm_and_yarn/microma…
evereq Sep 9, 2024
063b14d
fix: trim leading zeros at the beginning of work time planned
CREDO23 Sep 10, 2024
e078486
fix arrow direction in settings sidebar
CREDO23 Sep 10, 2024
1855abc
Merge pull request #3012 from ever-co/3006-bug-settings--fix-directio…
evereq Sep 10, 2024
09600b7
Merge pull request #3011 from ever-co/2999-bug-planned--issue-with-wo…
evereq Sep 10, 2024
f3988ea
fix overlap on team member card| table view
CREDO23 Sep 12, 2024
a56d0e9
3001 bug planned years months have not values (#3015)
CREDO23 Sep 13, 2024
249945e
All plans modal | disbale the start working button when the timer is …
CREDO23 Sep 13, 2024
d1eaa48
Merge pull request #3024 from ever-co/3021-improvement-see-plan--logi…
evereq Sep 14, 2024
d2a5ccc
3008 improvements see plan user should be able to see all plans on t…
CREDO23 Sep 14, 2024
cb29513
Feat/init rebranding server web (#2993)
syns2191 Sep 15, 2024
8f3fd05
Improve branding (#3005)
samuelmbabhazi Sep 15, 2024
a27f0b9
Merge pull request #3026 from ever-co/develop
evereq Sep 15, 2024
521fe7a
Merge pull request #3019 from ever-co/2991-improvement-team-member-ca…
evereq Sep 17, 2024
793bd0c
feat: adapt sub-menus of 'Team' & 'Personal' menus UI (#3023)
land-bit Sep 17, 2024
68082e0
Merge pull request #3032 from ever-co/develop
evereq Sep 17, 2024
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
12 changes: 10 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,14 @@
"posthog",
"pageviews",
"pageleave",
"pageview"
"pageview",
"serverweb",
"intefaces",
"Environtment",
"asar",
"icns",
"nsis",
"WARNING️"
],
"useGitignore": true,
"ignorePaths": [
Expand Down Expand Up @@ -415,6 +422,7 @@
"apps/mobile/android/**",
"apps/mobile/ios/**",
"apps/desktop/i18n/**",
"apps/**/*.{svg,css,scss}"
"apps/**/*.{svg,css,scss}",
".scripts/icon-utils/icons/**",
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { IContentGenerator } from '../intefaces/i-content-generator';
import { Env } from '../../env';


export class CommonEnvironmentContent implements IContentGenerator {
public generate(variable: Partial<Env>): string {
return `
I18N_FILES_URL: '${variable.I18N_FILES_URL}',
COMPANY_SITE_LINK: '${variable.COMPANY_SITE_LINK}',
COMPANY_GITHUB_LINK: '${variable.COMPANY_GITHUB_LINK}',
`
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { IContentGenerator } from '../intefaces/i-content-generator';
import { IDesktopEnvironment } from '../intefaces/i-desktop-environment';

export class DesktopServerWebEnvironmentContent implements IContentGenerator {
public generate(variable: Partial<IDesktopEnvironment>): string {
return `
NAME: '${variable.DESKTOP_SERVER_WEB_APP_NAME || variable.NAME}',
DESCRIPTION: '${variable.DESKTOP_SERVER_WEB_APP_DESCRIPTION || variable.DESCRIPTION}',
APP_ID: '${variable.DESKTOP_SERVER_WEB_APP_ID || variable.APP_ID}',
REPO_NAME: '${variable.DESKTOP_SERVER_WEB_APP_REPO_NAME || variable.REPO_NAME}',
REPO_OWNER: '${variable.DESKTOP_SERVER_WEB_APP_REPO_OWNER || variable.REPO_OWNER}',
WELCOME_TITLE: '${variable.DESKTOP_SERVER_WEB_APP_WELCOME_TITLE || variable.WELCOME_TITLE}',
WELCOME_CONTENT: '${variable.DESKTOP_SERVER_WEB_APP_WELCOME_CONTENT || variable.WELCOME_CONTENT}',
PLATFORM_LOGO: '${variable.PLATFORM_LOGO}',
DESKTOP_SERVER_WEB_APP_DESKTOP_APP_LOGO_512X512: '${variable.DESKTOP_SERVER_WEB_APP_DESKTOP_APP_LOGO_512X512}',
`;
}
}
108 changes: 108 additions & 0 deletions .scripts/electron-desktop-environment/desktop-environment-manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import { DesktopEnvirontmentContentFactory } from './desktop-environtment-content-factory';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import * as path from 'path';
import * as fs from 'fs';
import { env } from '../env';
import { IDesktopEnvironment } from './intefaces/i-desktop-environment';

const argv: any = yargs(hideBin(process.argv)).argv;


export class DesktopEnvironmentManager {
private static _instance: DesktopEnvironmentManager;
private readonly desktop: string;
private readonly fileDir: string;
private readonly fileName: string;
private readonly isProd: boolean;

private constructor() {
console.log(argv);
this.desktop = String(argv.desktop);
this.isProd = argv.environment === 'prod';
this.fileName = 'config';
this.fileDir = path.join('apps', this.desktop, 'src', 'configs');
}


private static get instance(): DesktopEnvironmentManager {
if (!this._instance) {
this._instance = new DesktopEnvironmentManager();
}
return this._instance;
}

public static get environment(): any {
if (
fs.existsSync(
path.join(
this.instance.fileDir,
this.instance.fileName.concat(`.ts`)
)
)
) {
return require(path.join(
'..',
'..',
this.instance.fileDir,
this.instance.fileName
)).config;
}
return null;
}

public static update(): void {
const environment: IDesktopEnvironment = Object.assign(
{},
this.environment
);
const filePath = path.join(
this.instance.fileDir,
this.instance.fileName.concat('.ts')
);

if (fs.existsSync(filePath)) {
fs.unlinkSync(filePath);
fs.writeFileSync(
filePath,
this.instance.content(environment, this.instance.isProd)
);
return;
}
console.log(`WARNING: File ${filePath} does not exist`);
}

public static generate(): void {
const files = ['config.ts'];
const environment: Partial<IDesktopEnvironment> = Object.assign({}, env);

for (const file of files) {
const isProd = file === 'config.ts';
const filePath = path.join(this.instance.fileDir, file);
if (fs.existsSync(filePath)) {
fs.unlinkSync(filePath);
}
fs.writeFileSync(
filePath,
this.instance.content(environment, isProd)
);

console.log(`✔ Generated desktop ${isProd} environment file: ${filePath}`)
}
}


private content(variable: Partial<IDesktopEnvironment>, isProd: boolean): string {
return `
export const config = {
production: ${isProd},
${DesktopEnvirontmentContentFactory.generate(
this.desktop,
variable
)}
};
`;
}
}

DesktopEnvironmentManager.update();
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

import { IDesktopEnvironment } from './intefaces/i-desktop-environment';
import { CommonEnvironmentContent } from './concrete-environment-content/common-environment-content';
import { DesktopServerWebEnvironmentContent } from './concrete-environment-content/desktop-server-web-environment-content';

export class DesktopEnvirontmentContentFactory {
public static generate(
desktop: string,
environtment: Partial<IDesktopEnvironment>
) {
const common = new CommonEnvironmentContent();
switch (desktop) {
case 'server-web':
const desktopServerWeb = new DesktopServerWebEnvironmentContent();
return `
${common.generate(environtment)}
${desktopServerWeb.generate(environtment)}
`;
default:
return `
${common.generate(environtment)}
`;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { IDesktopEnvironment } from './i-desktop-environment'

export interface IContentGenerator {
generate(variable: Partial<IDesktopEnvironment>): string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Env } from '../../env';

export interface IDesktopEnvironment extends Env {
NAME: string;
DESCRIPTION: string;
APP_ID: string;
REPO_NAME: string;
REPO_OWNER: string;
WELCOME_TITLE: string;
WELCOME_CONTENT: string;
PLATFORM_LOGO: string;
DESKTOP_SERVER_WEB_APP_DESKTOP_APP_LOGO_512X512: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { IPackage } from '../interfaces/i-package';
import { IPackager } from '../interfaces/i-packager';
import { IPackageBuild } from '../interfaces/i-package-build';
import { env } from '../../env';

export class DesktopPackager implements IPackager {
public prepare(pkg: IPackage): IPackage {
pkg.name = env.DESKTOP_SERVER_WEB_APP_NAME || pkg.name;
pkg.productName = env.DESKTOP_SERVER_WEB_APP_DESCRIPTION || pkg.productName;
pkg.description = env.DESKTOP_SERVER_WEB_APP_DESCRIPTION || pkg.description;
pkg.homepage = env.COMPANY_SITE_LINK || pkg.homepage;
pkg.build.appId = env.DESKTOP_SERVER_WEB_APP_ID || pkg.build.appId;
pkg.build.productName =
env.DESKTOP_SERVER_WEB_APP_DESCRIPTION || pkg.build.productName;
pkg.build.linux.executableName =
env.DESKTOP_SERVER_WEB_APP_NAME || pkg.build.linux.executableName;
return pkg;
}

public prepareBuild(pkg: IPackageBuild): IPackageBuild {
pkg.description = env.DESKTOP_SERVER_WEB_APP_DESCRIPTION || pkg.description;
pkg.name = env.DESKTOP_SERVER_WEB_APP_NAME || pkg.name;
return pkg;
}
}
10 changes: 10 additions & 0 deletions .scripts/electron-package-utils/interfaces/i-package-build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export interface IPackageBuild {
name: string;
version: string;
description: string;
author: {
name: string;
email: string;
url: string;
}
}
68 changes: 68 additions & 0 deletions .scripts/electron-package-utils/interfaces/i-package.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
export interface IPackage {
name: string;
productName: string;
version: string;
description: string;
license: string;
homepage: string;
repository: { type: string; url: string };
bugs: { url: string };
private: boolean;
author: { name: string; email: string; url: string };
main: string;
workspaces: { packages: string[] };
build: {
appId: string;
artifactName: string;
productName: string;
copyright: string;
afterSign: string;
dmg: { sign: boolean };
asar: boolean;
npmRebuild: boolean;
asarUnpack: string[];
directories: { buildResources: string; output: string };
publish: {}[];
mac: {
category: string;
icon: string;
target: any[];
asarUnpack: string;
artifactName: string;
hardenedRuntime: boolean;
gatekeeperAssess: boolean;
entitlements: string;
entitlementsInherit: string;
extendInfo: {};
};
win: {
publisherName: string;
target: any[];
icon: string;
verifyUpdateCodeSignature: boolean;
};
linux: {
icon: string;
target: any[];
executableName: string;
artifactName: string;
synopsis: string;
category: string;
};
nsis: {
oneClick: boolean;
perMachine: boolean;
createDesktopShortcut: boolean;
createStartMenuShortcut: boolean;
allowToChangeInstallationDirectory: boolean;
allowElevation: boolean;
installerIcon: string;
artifactName: string;
deleteAppDataOnUninstall: boolean;
menuCategory: boolean;
};
extraResources: (string | object[])[];
extraFiles: string[];
};
dependencies: { [key: string]: string };
}
6 changes: 6 additions & 0 deletions .scripts/electron-package-utils/interfaces/i-packager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { IPackage } from './i-package';
import { IPackageBuild } from './i-package-build';
export interface IPackager {
prepare(pkg: IPackage): IPackage;
prepareBuild(pkg: IPackageBuild): IPackageBuild;
}
Loading
Loading