Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Working branch #91

Open
wants to merge 7 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 5 additions & 6 deletions .github/workflows/electron-build.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: "Build electron executables"
on:
name: 'Build electron executables'
on:
push:
branches:
branches:
- main
pull_request:

jobs:
deploy:
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Build frontend
run: npx nx build core --prod
env:
COMEN_ENVIRONMENT: "electron"
COMEN_ENVIRONMENT: 'electron'
- name: Build electron app
run: npx nx build electron-app --prod
- name: Package electron app
Expand All @@ -44,4 +44,3 @@ jobs:
with:
name: build-windows
path: dist/executables/Comen.exe

23 changes: 9 additions & 14 deletions .github/workflows/node-backend-docker.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
name: "Build docker image for node backend"
on:
name: 'Build docker image for node backend'
on:
push:
branches:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./apps/node-backend/Dockerfile
platforms: linux/amd64
push: true
tags: 3shain/comen:latest
tags: 3shain/comen:latest
7 changes: 3 additions & 4 deletions .github/workflows/node-backend-vercel-staging.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Vercel staging deployment for node backend"
on: [pull_request]
name: 'Vercel staging deployment for node backend'
on: [pull_request]
jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -20,7 +20,7 @@ jobs:
- name: Build frontend
run: npx nx build core --prod
env:
COMEN_ENVIRONMENT: "vercel"
COMEN_ENVIRONMENT: 'vercel'
- name: Build backend
run: npx nx build node-backend --prod
- name: Deploy production
Expand All @@ -32,4 +32,3 @@ jobs:
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
scope: ${{ secrets.VERCEL_SCOPE }}

9 changes: 4 additions & 5 deletions .github/workflows/node-backend-vercel.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Vercel deployment for node backend"
on:
name: 'Vercel deployment for node backend'
on:
push:
branches:
branches:
- main
jobs:
deploy:
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Build frontend
run: npx nx build core --prod
env:
COMEN_ENVIRONMENT: "vercel"
COMEN_ENVIRONMENT: 'vercel'
- name: Build backend
run: npx nx build node-backend --prod
- name: Deploy production
Expand All @@ -37,4 +37,3 @@ jobs:
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
scope: ${{ secrets.VERCEL_SCOPE }}
vercel-args: '--prod'

28 changes: 3 additions & 25 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
"polyfills": "apps/core/src/polyfills.ts",
"tsConfig": "apps/core/tsconfig.app.json",
"aot": true,
"assets": [
"apps/core/src/favicon.ico",
"apps/core/src/assets"
"assets": ["apps/core/src/favicon.ico", "apps/core/src/assets",{ "glob": "**/*", "input": "node_modules/monaco-editor", "output": "assets/monaco-editor" }
],
"styles": [
"apps/core/src/styles.less",
Expand All @@ -39,7 +37,8 @@
"date-fns",
"react",
"react-dom"
]
],
"webWorkerTsConfig": "apps/core/tsconfig.worker.json"
},
"configurations": {
"production": {
Expand Down Expand Up @@ -476,27 +475,6 @@
}
}
},
"dogfood": {
"root": "libs/dogfood",
"sourceRoot": "libs/dogfood/src",
"projectType": "library",
"architect": {
"lint": {
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["libs/dogfood/**/*.ts"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"outputs": ["coverage/libs/dogfood"],
"options": {
"jestConfig": "libs/dogfood/jest.config.js",
"passWithNoTests": true
}
}
}
},
"delta": {
"root": "libs/delta",
"sourceRoot": "libs/delta/src",
Expand Down
2 changes: 1 addition & 1 deletion apps/core/proxy.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"Connection": "keep-alive"
}
}
}
}
41 changes: 22 additions & 19 deletions apps/core/src/app/addon/addon-lazyload.resolve.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import { Injectable } from "@angular/core";
import { ActivatedRouteSnapshot, Resolve } from "@angular/router";
import { OverlayInfo, SourceInfo } from "./definations";
import { LookupService } from "./lookup.service";
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
import { OverlayInfo, SourceInfo } from './definations';
import { LookupService } from './lookup.service';

@Injectable()
export class AddonLazyloadResolver implements Resolve<{
overlay?: OverlayInfo,
source?: SourceInfo
}> {
export class AddonLazyloadResolver
implements
Resolve<{
overlay?: OverlayInfo;
source?: SourceInfo;
}> {
constructor(private lookup: LookupService) {}

constructor(
private lookup: LookupService
) { }

async resolve(snapshot: ActivatedRouteSnapshot) {
return {
overlay: snapshot.queryParams.o?await this.lookup.ensureOverlayLoaded(snapshot.queryParams.o):undefined,
source: snapshot.queryParams.p?await this.lookup.ensureSourceLoaded(snapshot.queryParams.p):undefined
};
}
}
async resolve(snapshot: ActivatedRouteSnapshot) {
return {
overlay: snapshot.queryParams.o
? await this.lookup.ensureOverlayLoaded(snapshot.queryParams.o)
: undefined,
source: snapshot.queryParams.p
? await this.lookup.ensureSourceLoaded(snapshot.queryParams.p)
: undefined,
};
}
}
30 changes: 15 additions & 15 deletions apps/core/src/app/addon/addon.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ import { AddonLazyloadResolver } from './addon-lazyload.resolve';
import { OverlayContainerComponent } from './overlay-container.component';

@NgModule({
declarations: [OverlayContainerComponent],
imports: [],
exports: [OverlayContainerComponent]
declarations: [OverlayContainerComponent],
imports: [],
exports: [OverlayContainerComponent],
})
export class AddonMoudle {
static forRoot(): ModuleWithProviders<AddonMoudle> {
return {
ngModule: AddonMoudle,
providers: [
AddonService,
AddonLazyloadResolver,
DebugGuard,
LookupService
]
}
}
}
static forRoot(): ModuleWithProviders<AddonMoudle> {
return {
ngModule: AddonMoudle,
providers: [
AddonService,
AddonLazyloadResolver,
DebugGuard,
LookupService,
],
};
}
}
Loading