Skip to content

Commit 6723cc8

Browse files
committed
WIP prettier and optimizing code
1 parent f1fc422 commit 6723cc8

File tree

71 files changed

+1088
-1111
lines changed

Some content is hidden

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

71 files changed

+1088
-1111
lines changed

examples/angular/template-hierarchy-data-fetching/example-app/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
"build": "ng build",
88
"watch": "ng build --watch --configuration development",
99
"test": "ng test",
10-
"serve:ssr:my-app": "node dist/my-app/server/server.mjs"
10+
"serve:ssr:my-app": "node dist/my-app/server/server.mjs",
11+
"prettier": "prettier --write \"src/**/*.{ts,html,css,scss}\""
1112
},
1213
"prettier": {
1314
"overrides": [
1415
{
15-
"files": "*.html",
16+
"files": "src/**/*.{ts,html,css,scss}",
1617
"options": {
1718
"parser": "angular"
1819
}
@@ -30,6 +31,7 @@
3031
"@angular/router": "^20.0.0",
3132
"@angular/ssr": "^20.0.5",
3233
"express": "^5.1.0",
34+
"prettier": "^3.6.2",
3335
"rxjs": "~7.8.0",
3436
"tslib": "^2.3.0"
3537
},
@@ -48,4 +50,4 @@
4850
"karma-jasmine-html-reporter": "~2.1.0",
4951
"typescript": "~5.8.2"
5052
}
51-
}
53+
}

examples/angular/template-hierarchy-data-fetching/example-app/src/app/app.config.server.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import { appConfig } from './app.config';
44
import { serverRoutes } from './app.routes.server';
55

66
const serverConfig: ApplicationConfig = {
7-
providers: [
8-
provideServerRendering(withRoutes(serverRoutes))
9-
]
7+
providers: [provideServerRendering(withRoutes(serverRoutes))],
108
};
119

1210
export const config = mergeApplicationConfig(appConfig, serverConfig);
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZonelessChangeDetection } from '@angular/core';
1+
import {
2+
ApplicationConfig,
3+
provideBrowserGlobalErrorListeners,
4+
provideZonelessChangeDetection,
5+
} from '@angular/core';
26
import { provideRouter } from '@angular/router';
37
import { provideHttpClient, withFetch } from '@angular/common/http';
48

59
import { routes } from './app.routes';
6-
import { provideClientHydration, withEventReplay } from '@angular/platform-browser';
10+
import {
11+
provideClientHydration,
12+
withEventReplay,
13+
} from '@angular/platform-browser';
714

815
export const appConfig: ApplicationConfig = {
916
providers: [
1017
provideBrowserGlobalErrorListeners(),
1118
provideZonelessChangeDetection(),
12-
provideRouter(routes),
19+
provideRouter(routes),
1320
provideClientHydration(withEventReplay()),
14-
provideHttpClient(withFetch())
15-
]
21+
provideHttpClient(withFetch()),
22+
],
1623
};

examples/angular/template-hierarchy-data-fetching/example-app/src/app/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
<app-dynamic-content></app-dynamic-content>
55
</main>
66
<app-footer></app-footer>
7-
</div>
7+
</div>

examples/angular/template-hierarchy-data-fetching/example-app/src/app/app.routes.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import { RenderMode, ServerRoute } from '@angular/ssr';
33
export const serverRoutes: ServerRoute[] = [
44
{
55
path: '**',
6-
renderMode: RenderMode.Prerender
7-
}
6+
renderMode: RenderMode.Prerender,
7+
},
88
];

examples/angular/template-hierarchy-data-fetching/example-app/src/app/app.routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { Routes } from '@angular/router';
22
import { DynamicContentComponent } from './components/dynamic-content/dynamic-content.component';
33

44
export const routes: Routes = [
5-
{ path: '**', component: DynamicContentComponent }
6-
];
5+
{ path: '**', component: DynamicContentComponent },
6+
];

examples/angular/template-hierarchy-data-fetching/example-app/src/app/app.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ import { DynamicContentComponent } from './components/dynamic-content/dynamic-co
55

66
@Component({
77
selector: 'app-root',
8-
imports: [
9-
HeaderComponent,
10-
DynamicContentComponent,
11-
FooterComponent,
12-
],
13-
templateUrl: './app.html'
8+
imports: [HeaderComponent, DynamicContentComponent, FooterComponent],
9+
templateUrl: './app.html',
1410
})
15-
export class App {
16-
}
11+
export class App {}

examples/angular/template-hierarchy-data-fetching/example-app/src/app/assets/scss/components/button.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
@use "sass:color";
33

44
.button {
5-
padding: .5rem $gutter * 1.5;
5+
padding: 0.5rem $gutter * 1.5;
66
color: white;
77
transition: 0.3s ease;
88
cursor: pointer;
9-
9+
1010
&.button-primary {
1111
background-color: $primary-color;
1212
border-color: $primary-color;
1313
&:hover {
1414
background-color: color.scale($primary-color, $lightness: -15%);
1515
}
1616
}
17-
17+
1818
&.button-secondary {
1919
background-color: $secondary-color;
2020
color: #111;
@@ -23,20 +23,20 @@
2323
color: #fff;
2424
}
2525
}
26-
26+
2727
&.button-link {
2828
background-color: transparent;
2929
color: $primary-color;
3030
border: 1px solid $primary-color;
3131
}
32-
32+
3333
&.button-large {
3434
font-size: 1.2rem;
3535
padding: 1rem $gutter * 2;
3636
}
37-
37+
3838
&.button-small {
3939
font-size: 0.75rem;
40-
padding: .25rem $gutter;
40+
padding: 0.25rem $gutter;
4141
}
42-
}
42+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* You can add global styles to this file, and also import other style files */
2-
@use 'reset';
3-
@use 'layout';
4-
@use 'helpers';
5-
@use './components/button';
1+
@use "reset";
2+
@use "layout";
3+
@use "helpers";
4+
@use "./components/button";
5+

examples/angular/template-hierarchy-data-fetching/example-app/src/app/assets/scss/helpers.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ $spacers: (
6161
.mr-#{$key} {
6262
@include margin(right, $value);
6363
}
64-
}
64+
}

0 commit comments

Comments
 (0)