Skip to content

Commit cbb4dea

Browse files
committed
add simple dev.to clone
1 parent 8e27e2f commit cbb4dea

File tree

105 files changed

+5053
-110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+5053
-110
lines changed

apps/ng-demo-e2e/playwright.config.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
import { defineConfig, devices } from '@playwright/test';
22
import { nxE2EPreset } from '@nx/playwright/preset';
3-
43
import { workspaceRoot } from '@nx/devkit';
4+
import 'dotenv/config';
55

66
// For CI, you may want to set BASE_URL to the deployed application.
77
const baseURL = process.env['BASE_URL'] || 'http://localhost:4200';
88

9-
/**
10-
* Read environment variables from file.
11-
* https://github.com/motdotla/dotenv
12-
*/
13-
// require('dotenv').config();
14-
159
/**
1610
* See https://playwright.dev/docs/test-configuration.
1711
*/

apps/ng-demo/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
22
displayName: 'ng-demo',
3-
preset: '../../jest.preset.js',
3+
preset: '../../jest.preset.cjs',
44
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
55
coverageDirectory: '../../coverage/apps/ng-demo',
66
transform: {

apps/ng-demo/project.json

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,28 @@
1717
"tsConfig": "apps/ng-demo/tsconfig.app.json",
1818
"assets": [
1919
{
20-
"glob": "**/*",
21-
"input": "apps/ng-demo/public"
22-
}
20+
"glob": "favicon.ico",
21+
"input": "apps/ng-demo/src/assets/favicon.ico"
22+
},
23+
"apps/ng-demo/src/assets"
2324
],
24-
"styles": ["apps/ng-demo/src/styles.css"],
25-
"scripts": [],
26-
"server": "apps/ng-demo/src/main.server.ts",
27-
"prerender": true,
28-
"ssr": {
29-
"entry": "apps/ng-demo/server.ts"
30-
}
25+
"styles": [
26+
"apps/ng-demo/src/styles.css",
27+
"apps/ng-demo/src/styles/article.css",
28+
"apps/ng-demo/src/styles/comments.css"
29+
],
30+
"scripts": []
3131
},
3232
"configurations": {
3333
"production": {
34-
"budgets": [
35-
{
36-
"type": "initial",
37-
"maximumWarning": "500kb",
38-
"maximumError": "1mb"
39-
},
40-
{
41-
"type": "anyComponentStyle",
42-
"maximumWarning": "2kb",
43-
"maximumError": "4kb"
44-
}
45-
],
34+
"namedChunks": true,
35+
"sourceMap": true,
4636
"outputHashing": "all"
4737
},
4838
"development": {
4939
"optimization": false,
5040
"extractLicenses": false,
41+
"namedChunks": true,
5142
"sourceMap": true
5243
}
5344
},

apps/ng-demo/server.ts

Lines changed: 0 additions & 60 deletions
This file was deleted.

apps/ng-demo/src/app/app.component.css

Whitespace-only changes.

apps/ng-demo/src/app/app.component.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,20 @@ import { Component } from '@angular/core';
22

33
@Component({
44
selector: 'app-root',
5-
template: '<router-outlet></router-outlet>',
6-
styleUrl: './app.component.css',
5+
template: `
6+
<app-header></app-header>
7+
<router-outlet></router-outlet>
8+
`,
9+
styles: [
10+
`
11+
:host {
12+
display: block;
13+
max-width: var(--screen-width);
14+
padding: 1rem;
15+
margin: auto;
16+
box-sizing: border-box;
17+
}
18+
`,
19+
],
720
})
821
export class AppComponent {}

apps/ng-demo/src/app/app.module.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ import { AppComponent } from './app.component';
44
import { HttpClientModule } from '@angular/common/http';
55
import { RouterModule } from '@angular/router';
66
import { appRoutes } from './app.routes';
7+
import { HeaderModule } from '../components/header/header.component';
78

89
@NgModule({
910
declarations: [AppComponent],
10-
imports: [BrowserModule, HttpClientModule, RouterModule.forRoot(appRoutes)],
11+
imports: [
12+
BrowserModule,
13+
HttpClientModule,
14+
RouterModule.forRoot(appRoutes),
15+
HeaderModule,
16+
],
1117
providers: [],
1218
bootstrap: [AppComponent],
1319
})

apps/ng-demo/src/app/app.routes.ts

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
11
import { Route } from '@angular/router';
22

3-
export const appRoutes: Route[] = [];
3+
export const appRoutes: Route[] = [
4+
{ path: '', redirectTo: 'home', pathMatch: 'full' },
5+
{
6+
path: 'home',
7+
loadChildren: () =>
8+
import('../pages/home/home.module').then((m) => m.HomeModule),
9+
},
10+
{
11+
path: 'tag/:tag',
12+
pathMatch: 'full',
13+
loadChildren: () =>
14+
import('../pages/home/home.module').then((m) => m.HomeModule),
15+
},
16+
{
17+
path: 'videos',
18+
loadChildren: () =>
19+
import('../pages/videos/videos.module').then((m) => m.VideosModule),
20+
},
21+
{
22+
path: 'users/:username',
23+
loadChildren: () =>
24+
import('../pages/user-profile/user-profile.module').then(
25+
(m) => m.UserProfileModule
26+
),
27+
},
28+
{
29+
path: ':user/:slug',
30+
loadChildren: () =>
31+
import('../pages/article-detail/article-detail.module').then(
32+
(m) => m.ArticleDetailModule
33+
),
34+
},
35+
{
36+
path: 'not-found',
37+
pathMatch: 'full',
38+
loadComponent: () => import('../pages/not-found/not-found.component'),
39+
},
40+
{
41+
path: '**',
42+
pathMatch: 'full',
43+
redirectTo: 'not-found',
44+
},
45+
];
8.51 MB
Loading
4.04 MB
Loading

0 commit comments

Comments
 (0)