Skip to content

Commit

Permalink
Merge pull request #7842 from ever-co/stage
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
evereq authored Jun 1, 2024
2 parents 29d9e74 + 91feff7 commit 1899188
Show file tree
Hide file tree
Showing 671 changed files with 18,102 additions and 8,529 deletions.
2 changes: 2 additions & 0 deletions .deploy/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ COPY --chown=node:node packages/plugins/job-search/package.json ./packages/plugi
COPY --chown=node:node packages/plugins/job-proposal/package.json ./packages/plugins/job-proposal/
COPY --chown=node:node packages/plugins/job-search-ui/package.json ./packages/plugins/job-search-ui/
COPY --chown=node:node packages/ui-sdk/package.json ./packages/ui-sdk/
COPY --chown=node:node packages/ui-config/package.json ./packages/ui-config/

# We do not build here Wakatime plugin, because it used in Desktop Apps for now
# COPY --chown=node:node packages/plugins/integration-wakatime/package.json ./packages/plugins/integration-wakatime/
Expand Down Expand Up @@ -223,6 +224,7 @@ COPY --chown=node:node packages/plugins/job-search/package.json ./packages/plugi
COPY --chown=node:node packages/plugins/job-proposal/package.json ./packages/plugins/job-proposal/
COPY --chown=node:node packages/plugins/job-search-ui/package.json ./packages/plugins/job-search-ui/
COPY --chown=node:node packages/ui-sdk/package.json ./packages/ui-sdk/
COPY --chown=node:node packages/ui-config/package.json ./packages/ui-config/

# We do not build here Wakatime plugin, because it used in Desktop Apps for now
# COPY --chown=node:node packages/plugins/integration-wakatime/package.json ./packages/plugins/integration-wakatime/
Expand Down
1 change: 1 addition & 0 deletions .deploy/webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ COPY --chown=node:node packages/plugins/changelog/package.json ./packages/plugin
COPY --chown=node:node packages/plugins/job-proposal/package.json ./packages/plugins/job-proposal/
COPY --chown=node:node packages/plugins/job-search-ui/package.json ./packages/plugins/job-search-ui/
COPY --chown=node:node packages/ui-sdk/package.json ./packages/ui-sdk/
COPY --chown=node:node packages/ui-config/package.json ./packages/ui-config/

# We do not build here Wakatime plugin, because it used in Desktop Apps for now
# COPY --chown=node:node packages/plugins/integration-wakatime/package.json ./packages/plugins/integration-wakatime/
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ ormlogs.log
/apps/gauzy/src/environments/environment.prod.ts
/apps/gauzy/src/environments/environment.ts

/packages/ui-config/src/lib/environments/environment.prod.ts
/packages/ui-config/src/lib/environments/environment.ts

/apps/desktop-timer/src/environments/environment.prod.ts
/apps/desktop-timer/src/environments/environment.ts

Expand All @@ -89,35 +92,42 @@ megalinter-reports/
/apps/desktop-timer/src/assets/i18n
/apps/desktop/src/assets/i18n
/apps/server/src/assets/i18n
/apps/server-api/src/assets/i18n

# No need to duplicate desktop icons
/apps/desktop-timer/src/icons
/apps/desktop/src/icons
/apps/server/src/icons
/apps/server-api/src/icons

# Generated platform logo
apps/desktop-timer/src/assets/images/logos/platform_logo.*
apps/desktop/src/assets/images/logos/platform_logo.*
apps/server/src/assets/images/logos/platform_logo.*
apps/server-api/src/assets/images/logos/platform_logo.*

# Generated No internet logo
apps/desktop-timer/src/assets/images/logos/no_internet_logo.*
apps/desktop/src/assets/images/logos/no_internet_logo.*
apps/server/src/assets/images/logos/no_internet_logo.*
apps/server-api/src/assets/images/logos/no_internet_logo.*

# Generated desktop icon tray
apps/desktop-timer/src/assets/icons/tray
apps/desktop/src/assets/icons/tray
apps/server/src/assets/icons/tray
apps/server-api/src/assets/icons/tray

# Generated desktop 512x512 icon
apps/desktop-timer/src/assets/icons/desktop_logo_512x512.png
apps/desktop/src/assets/icons/desktop_logo_512x512.png
apps/server/src/assets/icons/desktop_logo_512x512.png
apps/server-api/src/assets/icons/desktop_logo_512x512.png

# Generated desktop icon menu
apps/desktop-timer/src/assets/icons/menu
apps/desktop/src/assets/icons/menu
apps/server/src/assets/icons/menu
apps/server-api/src/assets/icons/menu

.angular
64 changes: 27 additions & 37 deletions .scripts/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import { env } from './env';
import { writeFile, unlinkSync } from 'fs';
import * as path from 'path';
import { argv } from 'yargs';

const environment = argv.environment;
Expand All @@ -22,15 +23,11 @@ import { Environment } from './model';

if (!env.IS_DOCKER) {
if (!env.GOOGLE_MAPS_API_KEY) {
console.warn(
'WARNING: No Google Maps API Key defined in the .env file. Google Maps may not be working!'
);
console.warn('WARNING: No Google Maps API Key defined in the .env file. Google Maps may not be working!');
}

if (!env.SENTRY_DSN) {
console.warn(
'WARNING: No Sentry DSN defined in the .env file. Sentry logging may not be working!'
);
console.warn('WARNING: No Sentry DSN defined in the .env file. Sentry logging may not be working!');
}

if (!env.JITSU_BROWSER_URL || !env.JITSU_BROWSER_WRITE_KEY) {
Expand Down Expand Up @@ -326,39 +323,32 @@ if (!isProd) {

// we always want first to remove old generated files (one of them is not needed for current build)
try {
unlinkSync(`./apps/gauzy/src/environments/environment.ts`);
} catch { }
unlinkSync(`./packages/ui-config/src/lib/environments/environment.ts`);
} catch {}
try {
unlinkSync(`./apps/gauzy/src/environments/environment.prod.ts`);
} catch { }
unlinkSync(`./packages/ui-config/src/lib/environments/environment.prod.ts`);
} catch {}

const envFileDest: string = isProd ? 'environment.prod.ts' : 'environment.ts';
const envFileDestOther: string = !isProd
? 'environment.prod.ts'
: 'environment.ts';

writeFile(
`./apps/gauzy/src/environments/${envFileDest}`,
envFileContent,
function (err) {
if (err) {
console.log(err);
} else {
console.log(`Generated Angular environment file: ${envFileDest}`);
}
const envFileDestOther: string = !isProd ? 'environment.prod.ts' : 'environment.ts';

writeFile(`./packages/ui-config/src/lib/environments/${envFileDest}`, envFileContent, (error) => {
if (error) {
console.log(error);
} else {
// Paths to environment files
const envFilePath = path.resolve(`./packages/ui-config/src/lib/environments/${envFileDest}`);
console.log(`Generated Angular environment file: ${envFilePath}`);
}
);

writeFile(
`./apps/gauzy/src/environments/${envFileDestOther}`,
`export const environment = { production: ${!isProd} }`,
function (err) {
if (err) {
console.log(err);
} else {
console.log(
`Generated Second Empty Angular environment file: ${envFileDestOther}`
);
}
});

let envFileDestOtherContent = `export const environment = { production: ${!isProd} }`;

writeFile(`./packages/ui-config/src/lib/environments/${envFileDestOther}`, envFileDestOtherContent, (error) => {
if (error) {
console.log(error);
} else {
const envFileOtherPath = path.resolve(`./packages/ui-config/src/lib/environments/${envFileDestOther}`);
console.log(`Generated Second Empty Angular environment file: ${envFileOtherPath}`);
}
);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { IContentGenerator } from '../interfaces/i-content-generator';
import { IDesktopEnvironment } from '../interfaces/i-desktop-environment';

export class DesktopApiServerEnvironmentContent implements IContentGenerator {
public generate(variable: Partial<IDesktopEnvironment>): string {
return `
NAME: '${variable.DESKTOP_API_SERVER_APP_NAME || variable.NAME}',
DESCRIPTION: '${variable.DESKTOP_API_SERVER_APP_DESCRIPTION || variable.DESCRIPTION}',
APP_ID: '${variable.DESKTOP_API_SERVER_APP_ID || variable.APP_ID}',
REPO_NAME: '${variable.DESKTOP_API_SERVER_APP_REPO_NAME || variable.REPO_NAME}',
REPO_OWNER: '${variable.DESKTOP_API_SERVER_APP_REPO_OWNER || variable.REPO_OWNER}',
WELCOME_TITLE: '${variable.DESKTOP_API_SERVER_APP_WELCOME_TITLE || variable.WELCOME_TITLE || ''}',
WELCOME_CONTENT: '${variable.DESKTOP_API_SERVER_APP_WELCOME_CONTENT || variable.WELCOME_CONTENT || ''}',
IS_DESKTOP_TIMER: ${false},
IS_DESKTOP: ${false},
IS_SERVER: ${true},
IS_SERVER_API: ${true}
`;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CommonEnvironmentContent } from './concrete-environment-content/common-
import { DesktopTimerEnvironmentContent } from './concrete-environment-content/desktop-timer-environment-content';
import { DesktopEnvironmentContent } from './concrete-environment-content/desktop-environment-content';
import { DesktopServerEnvironmentContent } from './concrete-environment-content/desktop-server-environment-content';
import { DesktopApiServerEnvironmentContent } from './concrete-environment-content/desktop-api-server-environment-content';
import { IDesktopEnvironment } from './interfaces/i-desktop-environment';

export class DesktopEnvironmentContentFactory {
Expand All @@ -26,6 +27,11 @@ export class DesktopEnvironmentContentFactory {
return common
.generate(environment)
.concat(server.generate(environment));
case 'server-api':
const apiServer = new DesktopApiServerEnvironmentContent();
return common
.generate(environment)
.concat(apiServer.generate(environment));
default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export interface IDesktopEnvironment extends Env {
IS_DESKTOP_TIMER: boolean;
IS_DESKTOP: boolean;
IS_SERVER: boolean;
IS_SERVER_API: boolean;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { IPackage } from '../interfaces/i-package';
import { IPackager } from '../interfaces/i-packager';
import { env } from '../../env';

export class ServerApiPackager implements IPackager {
public prepare(pkg: IPackage): IPackage {
pkg.name = env.DESKTOP_API_SERVER_APP_NAME || pkg.name;
pkg.productName = env.DESKTOP_API_SERVER_APP_DESCRIPTION || pkg.productName;
pkg.description = env.DESKTOP_API_SERVER_APP_DESCRIPTION || pkg.description;
pkg.homepage = env.COMPANY_SITE_LINK || pkg.homepage;
pkg.build.appId = env.DESKTOP_API_SERVER_APP_ID || pkg.build.appId;
pkg.build.productName =
env.DESKTOP_API_SERVER_APP_DESCRIPTION || pkg.build.productName;
pkg.build.linux.executableName =
env.DESKTOP_API_SERVER_APP_NAME || pkg.build.linux.executableName;
return pkg;
}
}
4 changes: 4 additions & 0 deletions .scripts/electron-package-utils/packager-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { IPackager } from './interfaces/i-packager';
import { DesktopTimerPackager } from './concrete-packager/desktop-timer-packager';
import { DesktopPackager } from './concrete-packager/desktop-packager';
import { ServerPackager } from './concrete-packager/server-packager';
import { ServerApiPackager } from './concrete-packager/server-api-packager';


export class PackagerFactory {
public static packager(desktop: string): IPackager {
Expand All @@ -12,6 +14,8 @@ export class PackagerFactory {
return new DesktopPackager();
case 'server':
return new ServerPackager();
case 'server-api':
return new ServerApiPackager();
default:
console.warn('WARNING: Unknown application.');
break;
Expand Down
22 changes: 22 additions & 0 deletions .scripts/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ export type Env = Readonly<{
DESKTOP_SERVER_APP_REPO_OWNER: string;
DESKTOP_SERVER_APP_WELCOME_TITLE: string;
DESKTOP_SERVER_APP_WELCOME_CONTENT: string;
DESKTOP_API_SERVER_APP_NAME: string;
DESKTOP_API_SERVER_APP_DESCRIPTION: string;
DESKTOP_API_SERVER_APP_ID: string;
DESKTOP_API_SERVER_APP_REPO_NAME: string;
DESKTOP_API_SERVER_APP_REPO_OWNER: string;
DESKTOP_API_SERVER_APP_WELCOME_TITLE: string;
DESKTOP_API_SERVER_APP_WELCOME_CONTENT: string;
AWHost: string;
API_DEFAULT_PORT: number;
GAUZY_UI_DEFAULT_PORT: number;
Expand Down Expand Up @@ -290,6 +297,21 @@ export const env: Env = cleanEnv(
API_DEFAULT_PORT: num({ default: 3000 }),
GAUZY_UI_DEFAULT_PORT: num({ default: 5621 }),
SCREENSHOTS_ENGINE_METHOD: str({ default: 'ScreenshotDesktopLib' }),
DESKTOP_API_SERVER_APP_NAME: str({
default: 'gauzy-api-server',
}),
DESKTOP_API_SERVER_APP_DESCRIPTION: str({
default: 'Gauzy Api Server',
}),
DESKTOP_API_SERVER_APP_ID: str({
default: 'com.ever.gauzyapiserver',
}),
DESKTOP_API_SERVER_APP_REPO_NAME: str({
default: 'ever-gauzy-api-server',
}),
DESKTOP_API_SERVER_APP_REPO_OWNER: str({ default: 'ever-co' }),
DESKTOP_API_SERVER_APP_WELCOME_TITLE: str({ default: '' }),
DESKTOP_API_SERVER_APP_WELCOME_CONTENT: str({ default: '' }),
},
{ strict: true, dotEnvPath: __dirname + '/../.env' }
);
Loading

0 comments on commit 1899188

Please sign in to comment.