Skip to content

Commit 2a634e3

Browse files
committed
feat: builder-io integration
1 parent dc4e5d7 commit 2a634e3

22 files changed

+296
-12
lines changed

angular.json

+46
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,52 @@
242242
},
243243
"tags": []
244244
},
245+
"route-pages-blog-page": {
246+
"projectType": "library",
247+
"root": "libs/route-pages/blog-page",
248+
"sourceRoot": "libs/route-pages/blog-page/src",
249+
"prefix": "valor-software-site-base",
250+
"architect": {
251+
"build": {
252+
"builder": "@nrwl/angular:ng-packagr-lite",
253+
"outputs": [
254+
"dist/libs/route-pages/blog-page"
255+
],
256+
"options": {
257+
"project": "libs/route-pages/blog-page/ng-package.json"
258+
},
259+
"configurations": {
260+
"production": {
261+
"tsConfig": "libs/route-pages/blog-page/tsconfig.lib.prod.json"
262+
},
263+
"development": {
264+
"tsConfig": "libs/route-pages/blog-page/tsconfig.lib.json"
265+
}
266+
},
267+
"defaultConfiguration": "production"
268+
},
269+
"test": {
270+
"builder": "@nrwl/jest:jest",
271+
"outputs": [
272+
"coverage/libs/route-pages/ashes-page"
273+
],
274+
"options": {
275+
"jestConfig": "libs/route-pages/blog-page/jest.config.ts",
276+
"passWithNoTests": true
277+
}
278+
},
279+
"lint": {
280+
"builder": "@nrwl/linter:eslint",
281+
"options": {
282+
"lintFilePatterns": [
283+
"libs/route-pages/blog-page/**/*.ts",
284+
"libs/route-pages/blog-page/**/*.html"
285+
]
286+
}
287+
}
288+
},
289+
"tags": []
290+
},
245291
"route-pages-blog-portfolio": {
246292
"projectType": "library",
247293
"root": "libs/route-pages/blog-portfolio",

apps/valor-software-site/src/app/app.module.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
33
import { RouterModule } from '@angular/router';
4+
45
import { routes } from './app.routing';
56
import { AppComponent } from './app.component';
67
import {
@@ -38,6 +39,9 @@ import { NotFoundComponent } from './404.component';
3839
{ provide: OLD_ROUTES_FROM_OLD_SITE, useValue: linksFromOldSite },
3940
],
4041
bootstrap: [AppComponent],
42+
exports: [
43+
NotFoundComponent
44+
]
4145
})
4246
export class AppModule {
4347
}

apps/valor-software-site/src/app/app.routing.ts

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export const routes: Routes = [
3838
path: 'privacy-policy',
3939
loadChildren: () => import('@valor-software/privacy-policy-page').then(m => m.PrivacyPolicyPageModule)
4040
},
41+
{
42+
path: 'blog-page',
43+
loadChildren: () => import('@valor-software/blog-page').then(m => m.BlogPageModule)
44+
},
4145
{
4246
path: 'all-vacancies',
4347
redirectTo: 'careers'

apps/valor-software-site/src/index.html

+11-11
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@
3434
gtag('js', new Date());
3535
</script>
3636
<script type="text/javascript">
37-
window.onload = function () {
38-
if (window.self !== window.top) {
39-
document.body.innerHTML = `
40-
<div>
41-
<h1>If you see this page, the valor site link you have clicked on is under Clickjacking security attack.</h1>
42-
<h2>Please inform our team with the reference of the application from where you clicked this link.</h2>
43-
<h2>Click <a href="https://valor-software.com" title='Valor site' target='blank'>here</a> to access valor site safely.</h2>
44-
</div>
45-
`;
46-
}
47-
};
37+
// window.onload = function () {
38+
// if (window.self !== window.top) {
39+
// document.body.innerHTML = `
40+
// <div>
41+
// <h1>If you see this page, the valor site link you have clicked on is under Clickjacking security attack.</h1>
42+
// <h2>Please inform our team with the reference of the application from where you clicked this link.</h2>
43+
// <h2>Click <a href="https://valor-software.com" title='Valor site' target='blank'>here</a> to access valor site safely.</h2>
44+
// </div>
45+
// `;
46+
// }
47+
// };
4848
</script>
4949
</head>
5050
<body>
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"extends": [
3+
"../../../.eslintrc.json"
4+
],
5+
"ignorePatterns": [
6+
"!**/*"
7+
],
8+
"overrides": [
9+
{
10+
"files": [
11+
"*.ts"
12+
],
13+
"extends": [
14+
"plugin:@nrwl/nx/angular",
15+
"plugin:@angular-eslint/template/process-inline-templates"
16+
],
17+
"rules": {
18+
"@angular-eslint/directive-selector": [
19+
"error",
20+
{
21+
"type": "attribute",
22+
"prefix": "valorSoftwareSiteBase",
23+
"style": "camelCase"
24+
}
25+
],
26+
"@angular-eslint/component-selector": [
27+
"error",
28+
{
29+
"type": "element",
30+
"prefix": "valor-software-site-base",
31+
"style": "kebab-case"
32+
}
33+
]
34+
}
35+
},
36+
{
37+
"files": [
38+
"*.html"
39+
],
40+
"extends": [
41+
"plugin:@nrwl/nx/angular-template"
42+
],
43+
"rules": {}
44+
}
45+
]
46+
}

libs/route-pages/blog-page/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# route-pages-blog-page
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
6+
## Running unit tests
7+
8+
Run `nx test route-pages-blog-page` to execute the unit tests.
9+
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'route-pages-blog-page',
4+
preset: '../../../jest.preset.js',
5+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6+
globals: {
7+
'ts-jest': {
8+
tsconfig: '<rootDir>/tsconfig.spec.json',
9+
stringifyContentPathRegex: '\\.(html|svg)$',
10+
}
11+
},
12+
coverageDirectory: '../../../coverage/libs/route-pages/blog-page',
13+
transform: {
14+
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular'
15+
},
16+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
17+
snapshotSerializers: [
18+
'jest-preset-angular/build/serializers/no-ng-attributes',
19+
'jest-preset-angular/build/serializers/ng-snapshot',
20+
'jest-preset-angular/build/serializers/html-comment',
21+
]
22+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "../../../dist/libs/route-pages/blog-page",
4+
"lib": {
5+
"entryFile": "src/index.ts"
6+
}
7+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@valor-software/blog-page",
3+
"version": "0.0.1",
4+
"peerDependencies": {
5+
"@angular/common": "^12.2.0",
6+
"@angular/core": "^12.2.0"
7+
},
8+
"dependencies": {
9+
"tslib": "^2.3.0"
10+
}
11+
}
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './lib/blog-page.module';
2+
export * from './lib/components';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { RouterModule, Routes } from '@angular/router';
4+
import { routes } from './routes';
5+
import { BuilderModule } from '@builder.io/angular';
6+
import { BlogPageComponent } from './components';
7+
8+
@NgModule({
9+
imports: [
10+
CommonModule,
11+
BuilderModule.forRoot('4285878c370b42da9d91ea69156f4584'),
12+
RouterModule.forChild(routes)
13+
],
14+
declarations: [BlogPageComponent]
15+
})
16+
export class BlogPageModule {
17+
static routes: Routes = routes;
18+
}
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<builder-component
2+
*ngIf="!noBuilderPageForUrl"
3+
model="page"
4+
(load)="noBuilderPageForUrl = $event ? false : true"
5+
(error)="noBuilderPageForUrl = true"
6+
>
7+
<!-- Default content inside the tag shows while the builder content is fetching -->
8+
<div class="spinner"></div>
9+
</builder-component>
10+
11+
<div *ngIf="noBuilderPageForUrl"> NO BUILDER PAGE</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
2+
3+
@Component({
4+
// eslint-disable-next-line @angular-eslint/component-selector
5+
selector: 'blog-page',
6+
templateUrl: './blog-page.component.html',
7+
changeDetection: ChangeDetectionStrategy.OnPush,
8+
})
9+
export class BlogPageComponent {
10+
noBuilderPageForUrl = false;
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './blog-page/blog-page.component';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Route } from '@angular/router';
2+
import { BlogPageComponent } from './components';
3+
4+
export const routes: Route[] = [
5+
{
6+
path: '',
7+
component: BlogPageComponent,
8+
},
9+
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import 'jest-preset-angular/setup-jest';
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"extends": "../../../tsconfig.base.json",
3+
"files": [],
4+
"include": [],
5+
"references": [
6+
{
7+
"path": "./tsconfig.lib.json"
8+
},
9+
{
10+
"path": "./tsconfig.spec.json"
11+
}
12+
],
13+
"compilerOptions": {
14+
"target": "es2020",
15+
"forceConsistentCasingInFileNames": true,
16+
"strict": true,
17+
"noImplicitOverride": true,
18+
"noPropertyAccessFromIndexSignature": true,
19+
"noImplicitReturns": true,
20+
"noFallthroughCasesInSwitch": true
21+
},
22+
"angularCompilerOptions": {
23+
"enableI18nLegacyMessageIdFormat": false,
24+
"strictInjectionParameters": true,
25+
"strictInputAccessModifiers": true,
26+
"strictTemplates": true
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../../dist/out-tsc",
5+
"target": "es2020",
6+
"declaration": true,
7+
"declarationMap": true,
8+
"inlineSources": true,
9+
"types": [],
10+
"lib": [
11+
"dom",
12+
"es2018"
13+
]
14+
},
15+
"exclude": [
16+
"src/test-setup.ts",
17+
"**/*.spec.ts",
18+
"jest.config.ts",
19+
"**/*.test.ts"
20+
],
21+
"include": [
22+
"**/*.ts"
23+
]
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.lib.json",
3+
"compilerOptions": {
4+
"declarationMap": false
5+
},
6+
"angularCompilerOptions": {
7+
"compilationMode": "partial"
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../../dist/out-tsc",
5+
"module": "commonjs",
6+
"types": ["jest", "node"]
7+
},
8+
"files": ["src/test-setup.ts"],
9+
"include": [
10+
"jest.config.ts",
11+
"**/*.test.ts",
12+
"**/*.spec.ts",
13+
"**/*.d.ts"
14+
]
15+
}

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
"@angular/common": "14.2.8",
2121
"@angular/compiler": "14.2.8",
2222
"@angular/core": "14.2.8",
23+
"@angular/elements": "^15.2.8",
2324
"@angular/forms": "14.2.8",
2425
"@angular/platform-browser": "14.2.8",
2526
"@angular/platform-browser-dynamic": "14.2.8",
2627
"@angular/router": "14.2.8",
28+
"@builder.io/angular": "^2.2.1",
2729
"@nrwl/angular": "15.0.3",
2830
"@scullyio/init": "^2.1.41",
2931
"@scullyio/ng-lib": "^2.1.41",
@@ -44,7 +46,7 @@
4446
"zone.js": "0.11.8"
4547
},
4648
"devDependencies": {
47-
"@angular-devkit/build-angular": "14.2.7",
49+
"@angular-devkit/build-angular": "~14.2.0",
4850
"@angular-eslint/eslint-plugin": "14.0.4",
4951
"@angular-eslint/eslint-plugin-template": "14.0.4",
5052
"@angular-eslint/template-parser": "14.0.4",

tsconfig.base.json

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
"skipDefaultLibCheck": true,
2222
"baseUrl": ".",
2323
"paths": {
24+
"@valor-software/blog-page": [
25+
"libs/route-pages/blog-page/src/index.ts"
26+
],
2427
"@valor-software/ashes-page": [
2528
"libs/route-pages/ashes-page/src/index.ts"
2629
],

0 commit comments

Comments
 (0)