Skip to content

Commit d1369c5

Browse files
build: update to Nx 19.1 (#1107)
1 parent 9ef4f3b commit d1369c5

33 files changed

+577
-277
lines changed

.eslintrc.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@
2424
{
2525
"files": ["*.ts", "*.tsx"],
2626
"extends": ["plugin:@nx/typescript"],
27-
"rules": {}
27+
"rules": {
28+
"@typescript-eslint/no-extra-semi": "error",
29+
"no-extra-semi": "off"
30+
}
2831
},
2932
{
3033
"files": ["*.js", "*.jsx"],
3134
"extends": ["plugin:@nx/javascript"],
32-
"rules": {}
35+
"rules": {
36+
"@typescript-eslint/no-extra-semi": "error",
37+
"no-extra-semi": "off"
38+
}
3339
},
3440
{
3541
"files": "*.json",

package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
"@astrojs/react": "^3.0.0",
6060
"@babel/core": "^7.21.8",
6161
"@mdx-js/react": "3.0.1",
62-
"@nx/angular": "19.0.3",
63-
"@nx/devkit": "19.0.3",
62+
"@nx/angular": "19.1.0",
63+
"@nx/devkit": "19.1.0",
6464
"@trpc/client": "^10.25.0",
6565
"@trpc/server": "^10.25.0",
6666
"ajv-formats": "^2.1.1",
@@ -90,22 +90,22 @@
9090
"@angular-eslint/eslint-plugin": "17.3.0",
9191
"@angular-eslint/eslint-plugin-template": "17.3.0",
9292
"@angular-eslint/template-parser": "17.3.0",
93-
"@angular/cli": "^18.0.0",
93+
"@angular/cli": "~18.0.0",
9494
"@angular/compiler-cli": "^18.0.0",
9595
"@angular/language-service": "^18.0.0",
9696
"@astrojs/markdown-component": "^1.0.5",
9797
"@commitlint/cli": "^17.4.2",
9898
"@commitlint/config-conventional": "^17.4.2",
9999
"@netlify/functions": "^2.3.0",
100100
"@ngtools/webpack": "^18.0.0",
101-
"@nx/cypress": "19.0.3",
102-
"@nx/eslint": "19.0.3",
103-
"@nx/eslint-plugin": "19.0.3",
104-
"@nx/jest": "19.0.3",
105-
"@nx/js": "19.0.3",
106-
"@nx/plugin": "19.0.3",
107-
"@nx/vite": "19.0.3",
108-
"@nx/web": "19.0.3",
101+
"@nx/cypress": "19.1.0",
102+
"@nx/eslint": "19.1.0",
103+
"@nx/eslint-plugin": "19.1.0",
104+
"@nx/jest": "19.1.0",
105+
"@nx/js": "19.1.0",
106+
"@nx/plugin": "19.1.0",
107+
"@nx/vite": "19.1.0",
108+
"@nx/web": "19.1.0",
109109
"@schematics/angular": "^18.0.0",
110110
"@semantic-release/changelog": "^6.0.3",
111111
"@semantic-release/exec": "^6.0.3",
@@ -129,7 +129,7 @@
129129
"conventional-changelog": "^3.1.25",
130130
"conventional-changelog-cli": "^2.2.2",
131131
"cpy-cli": "^4.2.0",
132-
"cypress": "^13.6.6",
132+
"cypress": "13.9.0",
133133
"esbuild": "0.19.5",
134134
"eslint": "8.57.0",
135135
"eslint-config-prettier": "9.0.0",
@@ -148,7 +148,7 @@
148148
"minimist": "^1.2.7",
149149
"ng-packagr": "^18.0.0",
150150
"nitropack": "^2.9.0",
151-
"nx": "19.0.3",
151+
"nx": "19.1.0",
152152
"playwright": "^1.30.0",
153153
"postcss": "^8.4.21",
154154
"postcss-import": "~15.1.0",

packages/create-analog/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const APPS = [
2121
variants: [
2222
{
2323
name: 'Full-stack Application',
24-
template: 'angular-v17',
24+
template: 'latest',
2525
color: green,
2626
},
2727
{

packages/create-analog/template-blog/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@angular/platform-browser-dynamic": "^18.0.0",
2727
"@angular/platform-server": "^18.0.0",
2828
"@angular/router": "^18.0.0",
29-
"@nx/angular": "~19.0.0",
29+
"@nx/angular": "~19.1.0",
3030
"front-matter": "^4.0.2",
3131
"marked": "^5.0.2",
3232
"marked-gfm-heading-id": "^3.1.0",
@@ -43,8 +43,8 @@
4343
"@angular-devkit/build-angular": "^18.0.0",
4444
"@angular/cli": "^18.0.0",
4545
"@angular/compiler-cli": "^18.0.0",
46-
"@nx/vite": "~19.0.0",
47-
"nx": "~19.0.0",
46+
"@nx/vite": "~19.1.0",
47+
"nx": "~19.1.0",
4848
"jsdom": "^22.1.0",
4949
"typescript": "~5.4.2",
5050
"vite": "^5.0.0",

packages/create-analog/template-latest/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@angular/platform-browser-dynamic": "^18.0.0",
2727
"@angular/platform-server": "^18.0.0",
2828
"@angular/router": "^18.0.0",
29-
"@nx/angular": "~19.0.0",
29+
"@nx/angular": "~19.1.0",
3030
"front-matter": "^4.0.2",
3131
"marked": "^5.0.2",
3232
"marked-gfm-heading-id": "^3.1.0",
@@ -43,9 +43,9 @@
4343
"@angular-devkit/build-angular": "^18.0.0",
4444
"@angular/cli": "^18.0.0",
4545
"@angular/compiler-cli": "^18.0.0",
46-
"@nx/vite": "~19.0.0",
46+
"@nx/vite": "~19.1.0",
4747
"jsdom": "^22.0.0",
48-
"nx": "~19.0.0",
48+
"nx": "~19.1.0",
4949
"typescript": "~5.4.2",
5050
"vite": "^5.0.0",
5151
"vite-tsconfig-paths": "^4.2.0",
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
import { ApplicationConfig, mergeApplicationConfig } from '@angular/core';
2-
import { provideServerRendering } from '@angular/platform-server';
1+
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
2+
import {
3+
provideServerRendering,
4+
ɵSERVER_CONTEXT as SERVER_CONTEXT,
5+
} from '@angular/platform-server';
6+
37
import { appConfig } from './app.config';
48

59
const serverConfig: ApplicationConfig = {
6-
providers: [provideServerRendering()],
10+
providers: [
11+
provideServerRendering(),
12+
{ provide: SERVER_CONTEXT, useValue: 'ssr-analog' },
13+
],
714
};
815

916
export const config = mergeApplicationConfig(appConfig, serverConfig);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"extends": ["<%= offsetFromRoot %>.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts"],
7+
"extends": [
8+
"plugin:<%= nxPackageNamespace %>/nx/angular",
9+
"plugin:@angular-eslint/template/process-inline-templates"
10+
],
11+
"rules": {
12+
"@angular-eslint/directive-selector": [
13+
"error",
14+
{
15+
"type": "attribute",
16+
"prefix": "<%= className %>",
17+
"style": "camelCase"
18+
}
19+
],
20+
"@angular-eslint/component-selector": [
21+
"error",
22+
{
23+
"type": "element",
24+
"prefix": "<%= fileName %>",
25+
"style": "kebab-case"
26+
}
27+
]
28+
}
29+
},
30+
{
31+
"files": ["*.html"],
32+
"extends": ["plugin:<%= nxPackageNamespace %>/nx/angular-template"],
33+
"rules": {}
34+
}
35+
]
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>MyApp</title>
6+
<base href="/">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<link rel="icon" type="image/x-icon" href="/favicon.ico">
9+
<link rel="stylesheet" href="/src/styles.css" />
10+
</head>
11+
<body>
12+
<<%= fileName %>-root></<%= fileName %>-root>
13+
<script type="module" src="/src/main.ts"></script>
14+
</body>
15+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

packages/nx-plugin/src/generators/app/files/template-angular-v18/public/.gitkeep__template__

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="564" zoomAndPan="magnify" viewBox="0 0 422.88 343.499995" height="458" preserveAspectRatio="xMidYMid meet" version="1.0"><defs><clipPath id="id1"><path d="M 127.296875 75.375 L 347.570312 75.375 L 347.570312 267.527344 L 127.296875 267.527344 Z M 127.296875 75.375 " clip-rule="nonzero"/></clipPath><clipPath id="id2"><path d="M 75.871094 104 L 263.335938 104 L 263.335938 268.03125 L 75.871094 268.03125 Z M 75.871094 104 " clip-rule="nonzero"/></clipPath><clipPath id="id3"><path d="M 105 169.023438 L 315 169.023438 L 315 256.898438 L 105 256.898438 Z M 105 169.023438 " clip-rule="nonzero"/></clipPath></defs><g clip-path="url(#id1)"><path fill="#c30f2e" d="M 237.433594 75.378906 L 347.570312 267.527344 L 127.296875 267.527344 L 237.433594 75.378906 " fill-opacity="1" fill-rule="nonzero"/></g><g clip-path="url(#id2)"><path fill="#dd0330" d="M 169.601562 104 L 263.332031 268.03125 L 75.871094 268.03125 L 169.601562 104 " fill-opacity="1" fill-rule="nonzero"/></g><path fill="#ffffff" d="M 328.894531 218.96875 L 95.152344 218.96875 L 95.152344 216.402344 L 328.894531 216.402344 L 328.894531 218.96875 " fill-opacity="1" fill-rule="nonzero"/><g clip-path="url(#id3)"><path fill="#ffffff" d="M 292.785156 256.511719 C 291.871094 256.511719 291.011719 256.132812 290.292969 255.414062 C 286 251.101562 285.8125 233.566406 286.019531 207.304688 C 286.136719 192.953125 286.292969 173.296875 284.003906 171.746094 C 281.769531 172.671875 281.546875 188.910156 281.402344 199.660156 C 281.230469 212.167969 281.054688 225.109375 279.023438 231.699219 C 278.417969 233.652344 277.636719 235.441406 276.066406 235.296875 C 273.851562 235.101562 273.136719 231.605469 271.484375 217.808594 C 270.796875 212.078125 270.085938 206.15625 269.253906 203.863281 C 269.144531 203.574219 269.050781 203.34375 268.96875 203.164062 C 268.082031 205.167969 267.058594 210.675781 266.347656 214.5 C 265.363281 219.78125 264.433594 224.769531 263.269531 226.945312 C 262.371094 228.617188 260.945312 230.796875 258.953125 230.375 C 256.238281 229.804688 255.425781 224.332031 255.183594 221.121094 C 255.183594 194.105469 251.648438 190.960938 250.941406 190.605469 L 250.828125 190.691406 L 250.65625 190.652344 C 248.132812 191.753906 247.996094 200.515625 247.867188 208.988281 C 247.765625 215.203125 247.65625 222.246094 246.75 228.835938 C 245.574219 237.378906 244.152344 239.027344 242.382812 238.925781 C 238.308594 238.648438 238.191406 224.617188 238.191406 223.019531 C 238.191406 222.519531 238.203125 221.929688 238.21875 221.277344 C 238.296875 218.011719 238.4375 211.9375 236.429688 210.023438 C 236.164062 209.769531 235.789062 209.476562 235.496094 209.558594 C 234.066406 209.917969 232.582031 214.5625 232.089844 216.089844 C 231.933594 216.574219 231.808594 216.972656 231.703125 217.246094 C 231.621094 217.472656 231.515625 217.792969 231.390625 218.179688 C 230.308594 221.464844 229.078125 224.742188 226.976562 225.550781 C 226.199219 225.851562 225.386719 225.785156 224.625 225.355469 C 223.613281 224.78125 222.789062 223.609375 222.019531 221.660156 C 221.597656 220.582031 221.238281 219.488281 220.871094 218.390625 C 220.425781 217.050781 219.96875 215.664062 219.402344 214.347656 C 218.957031 213.324219 217.847656 212.863281 216.433594 213.113281 C 213.496094 213.636719 213.003906 216.605469 212.589844 221.074219 C 212.515625 221.851562 212.445312 222.613281 212.347656 223.332031 C 212.335938 223.542969 211.816406 230.101562 211.484375 232.1875 C 210.566406 237.90625 209.359375 240.160156 207.355469 239.996094 C 202.410156 239.574219 200.140625 217.882812 200.261719 208.71875 C 200.355469 201.722656 199.089844 199.167969 198.332031 198.761719 C 198.253906 198.726562 198.132812 198.660156 197.84375 198.863281 C 196.949219 199.46875 196.152344 201.355469 196.398438 203.335938 C 199.121094 224.902344 197.113281 249.601562 192.195312 255.164062 C 190.644531 256.914062 188.535156 256.890625 187.066406 255.414062 C 182.769531 251.101562 182.589844 233.566406 182.792969 207.304688 C 182.910156 192.953125 183.0625 173.296875 180.777344 171.746094 C 178.542969 172.671875 178.324219 188.910156 178.175781 199.660156 C 178.003906 212.167969 177.828125 225.109375 175.792969 231.699219 C 175.1875 233.652344 174.40625 235.441406 172.839844 235.296875 C 170.621094 235.101562 169.910156 231.605469 168.253906 217.808594 C 167.566406 212.078125 166.855469 206.15625 166.023438 203.863281 C 165.917969 203.574219 165.824219 203.34375 165.738281 203.164062 C 164.855469 205.167969 163.832031 210.675781 163.121094 214.5 C 162.136719 219.78125 161.207031 224.769531 160.039062 226.945312 C 159.140625 228.617188 157.714844 230.796875 155.726562 230.375 C 153.011719 229.804688 152.199219 224.332031 151.957031 221.121094 C 151.953125 194.105469 148.421875 190.960938 147.714844 190.605469 L 147.601562 190.691406 L 147.425781 190.652344 C 144.90625 191.753906 144.769531 200.515625 144.636719 208.988281 C 144.539062 215.203125 144.429688 222.246094 143.523438 228.835938 C 142.347656 237.378906 140.9375 239.042969 139.160156 238.925781 C 135.078125 238.648438 134.960938 224.617188 134.960938 223.019531 C 134.960938 222.519531 134.976562 221.929688 134.992188 221.277344 C 135.070312 218.011719 135.210938 211.9375 133.203125 210.023438 C 132.9375 209.769531 132.5625 209.476562 132.269531 209.558594 C 130.839844 209.917969 129.351562 214.5625 128.867188 216.089844 C 128.710938 216.570312 128.578125 216.972656 128.480469 217.246094 C 128.394531 217.46875 128.289062 217.789062 128.164062 218.175781 C 127.082031 221.460938 125.851562 224.742188 123.753906 225.550781 C 122.972656 225.851562 122.15625 225.785156 121.398438 225.355469 C 120.386719 224.78125 119.558594 223.609375 118.792969 221.660156 C 118.371094 220.582031 118.007812 219.488281 117.644531 218.390625 C 117.199219 217.050781 116.738281 215.664062 116.171875 214.347656 C 115.730469 213.324219 114.617188 212.863281 113.203125 213.113281 C 109.820312 213.714844 109.019531 217.910156 108.375 222.917969 L 108.261719 223.808594 L 105.703125 223.46875 L 105.824219 222.59375 C 106.382812 218.203125 107.234375 211.566406 112.753906 210.589844 C 115.351562 210.128906 117.621094 211.207031 118.535156 213.332031 C 119.148438 214.753906 119.628906 216.191406 120.089844 217.585938 C 120.433594 218.636719 120.785156 219.6875 121.191406 220.726562 C 121.90625 222.539062 122.460938 223.007812 122.667969 223.121094 C 123.960938 222.71875 125.28125 218.699219 125.71875 217.375 C 125.855469 216.949219 125.972656 216.597656 126.066406 216.347656 C 126.15625 216.101562 126.273438 215.742188 126.414062 215.308594 C 127.578125 211.667969 129.039062 207.726562 131.632812 207.070312 C 132.425781 206.867188 133.652344 206.894531 134.984375 208.167969 C 137.8125 210.867188 137.664062 217.167969 137.566406 221.339844 C 137.550781 221.964844 137.535156 222.535156 137.535156 223.019531 C 137.535156 229.675781 138.523438 234.328125 139.277344 235.925781 C 139.667969 235.109375 140.335938 233.132812 140.972656 228.488281 C 141.855469 222.050781 141.96875 215.089844 142.0625 208.949219 C 142.234375 198.082031 142.355469 190.203125 146.289062 188.351562 C 146.875 187.992188 147.847656 187.796875 148.875 188.316406 C 152.679688 190.230469 154.527344 200.929688 154.527344 221.023438 C 154.765625 224.128906 155.601562 227.398438 156.289062 227.867188 C 156.292969 227.796875 156.851562 227.453125 157.769531 225.734375 C 158.75 223.910156 159.726562 218.660156 160.585938 214.03125 C 162.488281 203.828125 163.351562 200.246094 165.601562 200.058594 C 167.316406 199.890625 168.109375 202.070312 168.441406 202.988281 C 169.378906 205.558594 170.074219 211.359375 170.808594 217.503906 C 171.382812 222.269531 172.199219 229.074219 173.03125 231.828125 C 173.121094 231.585938 173.222656 231.296875 173.332031 230.941406 C 175.257812 224.703125 175.433594 211.957031 175.601562 199.625 C 175.835938 182.496094 176.136719 171.882812 179.261719 169.667969 C 179.957031 169.175781 180.804688 169.054688 181.632812 169.332031 C 185.292969 170.546875 185.574219 181.277344 185.367188 207.328125 C 185.21875 226.21875 185.035156 249.730469 188.894531 253.605469 C 189.230469 253.945312 189.46875 253.945312 189.554688 253.945312 C 189.734375 253.945312 189.992188 253.773438 190.265625 253.464844 C 194.171875 249.046875 196.644531 225.847656 193.84375 203.660156 C 193.496094 200.898438 194.5625 197.996094 196.382812 196.746094 C 197.386719 196.054688 198.542969 195.964844 199.542969 196.5 C 201.820312 197.710938 202.925781 201.832031 202.835938 208.753906 C 202.675781 220.839844 205.578125 234.984375 207.472656 237.242188 C 207.773438 236.742188 208.367188 235.371094 208.9375 231.78125 C 209.257812 229.796875 209.785156 223.128906 209.792969 223.0625 C 209.886719 222.308594 209.957031 221.578125 210.023438 220.835938 C 210.414062 216.671875 210.894531 211.492188 215.980469 210.589844 C 218.574219 210.128906 220.84375 211.203125 221.761719 213.332031 C 222.375 214.753906 222.851562 216.191406 223.3125 217.585938 C 223.664062 218.636719 224.015625 219.6875 224.421875 220.726562 C 225.132812 222.539062 225.691406 223.007812 225.894531 223.121094 C 227.1875 222.71875 228.511719 218.699219 228.945312 217.378906 C 229.085938 216.953125 229.203125 216.597656 229.292969 216.347656 C 229.386719 216.105469 229.5 215.742188 229.636719 215.308594 C 230.804688 211.667969 232.265625 207.726562 234.863281 207.070312 C 235.648438 206.867188 236.878906 206.894531 238.210938 208.167969 C 241.039062 210.867188 240.890625 217.167969 240.796875 221.339844 C 240.777344 221.964844 240.761719 222.535156 240.761719 223.019531 C 240.761719 229.675781 241.75 234.328125 242.503906 235.925781 C 242.890625 235.109375 243.558594 233.132812 244.203125 228.488281 C 245.085938 222.050781 245.191406 215.089844 245.292969 208.949219 C 245.460938 198.082031 245.582031 190.203125 249.515625 188.351562 C 250.101562 187.992188 251.074219 187.796875 252.105469 188.316406 C 255.90625 190.230469 257.757812 200.929688 257.757812 221.023438 C 257.996094 224.128906 258.832031 227.398438 259.515625 227.867188 C 259.523438 227.796875 260.074219 227.453125 261 225.734375 C 261.980469 223.910156 262.953125 218.660156 263.816406 214.03125 C 265.710938 203.828125 266.578125 200.246094 268.828125 200.058594 C 270.546875 199.890625 271.339844 202.070312 271.671875 202.988281 C 272.605469 205.558594 273.300781 211.359375 274.042969 217.503906 C 274.609375 222.269531 275.425781 229.074219 276.261719 231.828125 C 276.347656 231.585938 276.449219 231.296875 276.558594 230.941406 C 278.484375 224.703125 278.65625 211.957031 278.828125 199.625 C 279.058594 182.496094 279.363281 171.882812 282.488281 169.667969 C 283.1875 169.175781 284.03125 169.054688 284.859375 169.332031 C 288.523438 170.546875 288.804688 181.277344 288.59375 207.328125 C 288.445312 226.21875 288.261719 249.730469 292.117188 253.605469 C 292.460938 253.945312 292.695312 253.945312 292.785156 253.945312 C 292.960938 253.945312 293.21875 253.773438 293.488281 253.464844 C 297.402344 249.046875 299.871094 225.847656 297.070312 203.660156 C 296.707031 200.769531 297.527344 197.855469 299.023438 196.734375 C 299.777344 196.164062 300.695312 196.046875 301.539062 196.402344 C 303.71875 197.332031 305.195312 201.316406 306.054688 208.589844 C 306.414062 211.636719 306.734375 214.929688 307.042969 218.179688 C 307.722656 225.273438 308.644531 234.832031 309.890625 236.933594 C 310.273438 236.445312 311.054688 235.125 312.214844 231.585938 L 314.664062 232.386719 C 312.863281 237.859375 311.453125 239.921875 309.617188 239.710938 C 306.761719 239.394531 305.9375 233.625 304.480469 218.425781 C 304.171875 215.191406 303.855469 211.917969 303.496094 208.886719 C 302.402344 199.609375 300.542969 198.769531 300.523438 198.761719 C 300.160156 198.945312 299.316406 200.875 299.628906 203.335938 C 302.34375 224.902344 300.34375 249.605469 295.421875 255.164062 C 294.628906 256.058594 293.738281 256.511719 292.785156 256.511719 " fill-opacity="1" fill-rule="nonzero"/></g></svg>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { TestBed } from '@angular/core/testing';
2+
import { RouterTestingModule } from '@angular/router/testing';
3+
import { AppComponent } from './app.component';
4+
5+
describe('AppComponent', () => {
6+
beforeEach(async () => {
7+
await TestBed.configureTestingModule({
8+
imports: [RouterTestingModule, AppComponent],
9+
}).compileComponents();
10+
});
11+
12+
it('should create the app', () => {
13+
const fixture = TestBed.createComponent(AppComponent);
14+
const app = fixture.componentInstance;
15+
expect(app).toBeTruthy();
16+
});
17+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component } from '@angular/core';
2+
import { RouterOutlet } from '@angular/router';
3+
4+
@Component({
5+
selector: '<%= fileName %>-root',
6+
standalone: true,
7+
imports: [RouterOutlet],
8+
template: ` <router-outlet></router-outlet> `,
9+
})
10+
export class AppComponent {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
2+
import {
3+
provideServerRendering,
4+
ɵSERVER_CONTEXT as SERVER_CONTEXT,
5+
} from '@angular/platform-server';
6+
7+
import { appConfig } from './app.config';
8+
9+
const serverConfig: ApplicationConfig = {
10+
providers: [
11+
provideServerRendering(),
12+
{ provide: SERVER_CONTEXT, useValue: 'ssr-analog' },
13+
],
14+
};
15+
16+
export const config = mergeApplicationConfig(appConfig, serverConfig);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
2+
import { provideHttpClient, withFetch } from '@angular/common/http';
3+
import { provideClientHydration } from '@angular/platform-browser';
4+
import { provideFileRouter } from '@analogjs/router';
5+
<% if (addTRPC) { %>
6+
import { provideTrpcClient } from '../trpc-client';
7+
<% } %>
8+
9+
export const appConfig: ApplicationConfig = {
10+
providers: [
11+
provideZoneChangeDetection({ eventCoalescing: true }),
12+
provideFileRouter(),
13+
provideClientHydration(),
14+
provideHttpClient(withFetch()),
15+
<% if (addTRPC) { %>
16+
provideTrpcClient(),
17+
<% } %>
18+
],
19+
};

0 commit comments

Comments
 (0)