create-analog 2.0.0-alpha.9 → 2.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/files/styles.css +3 -81
  2. package/index.js +14 -63
  3. package/package.json +7 -3
  4. package/template-angular-v17/package.json +5 -5
  5. package/template-angular-v18/package.json +5 -5
  6. package/template-angular-v18/vite.config.ts +1 -1
  7. package/{template-angular-v16 → template-angular-v19}/README.md +1 -1
  8. package/{template-angular-v16 → template-angular-v19}/_gitignore +2 -0
  9. package/{template-angular-v16 → template-angular-v19}/angular.json +1 -1
  10. package/{template-angular-v16 → template-angular-v19}/index.html +1 -1
  11. package/template-angular-v19/package.json +53 -0
  12. package/{template-latest → template-angular-v19}/src/app/app.component.ts +0 -1
  13. package/{template-angular-v16 → template-angular-v19}/src/app/app.config.server.ts +3 -8
  14. package/template-angular-v19/src/app/app.config.ts +20 -0
  15. package/template-angular-v19/src/app/pages/index.page.ts +54 -0
  16. package/template-angular-v19/src/main.server.ts +8 -0
  17. package/{template-angular-v16 → template-angular-v19}/src/main.ts +2 -2
  18. package/{template-angular-v16 → template-angular-v19}/src/styles.css +5 -0
  19. package/{template-angular-v16 → template-angular-v19}/tsconfig.app.json +2 -3
  20. package/{template-angular-v16 → template-angular-v19}/tsconfig.json +3 -6
  21. package/{template-angular-v16 → template-angular-v19}/tsconfig.spec.json +3 -3
  22. package/{template-angular-v16 → template-angular-v19}/vite.config.ts +5 -4
  23. package/template-blog/.vscode/extensions.json +1 -1
  24. package/template-blog/package.json +26 -26
  25. package/template-blog/src/app/app.config.ts +8 -3
  26. package/template-blog/src/app/{app-root.spec.ts → app.spec.ts} +1 -1
  27. package/template-blog/src/app/{app.component.ts → app.ts} +1 -2
  28. package/template-blog/src/app/pages/blog/[slug].page.ts +1 -2
  29. package/template-blog/src/app/pages/blog/index.page.ts +1 -2
  30. package/template-blog/src/main.server.ts +2 -2
  31. package/template-blog/src/main.ts +2 -2
  32. package/template-blog/src/test-setup.ts +6 -5
  33. package/template-blog/tsconfig.json +4 -2
  34. package/template-blog/tsconfig.spec.json +1 -1
  35. package/template-blog/vite.config.ts +3 -3
  36. package/template-latest/.vscode/extensions.json +1 -1
  37. package/template-latest/package.json +26 -26
  38. package/template-latest/src/app/app.config.ts +8 -3
  39. package/template-latest/src/app/{app-root.spec.ts → app.spec.ts} +1 -1
  40. package/template-latest/src/app/app.ts +17 -0
  41. package/template-latest/src/app/pages/analog-welcome.ts +264 -0
  42. package/template-latest/src/app/pages/index.page.ts +6 -49
  43. package/template-latest/src/main.server.ts +2 -2
  44. package/template-latest/src/main.ts +2 -2
  45. package/template-latest/src/styles.css +3 -79
  46. package/template-latest/src/test-setup.ts +6 -5
  47. package/template-latest/tsconfig.json +4 -2
  48. package/template-latest/tsconfig.spec.json +1 -1
  49. package/template-latest/vite.config.ts +4 -2
  50. package/template-minimal/.vscode/extensions.json +1 -1
  51. package/template-minimal/package.json +26 -26
  52. package/template-minimal/src/app/app.config.ts +8 -3
  53. package/template-minimal/src/app/{app.component.ts → app.ts} +1 -2
  54. package/template-minimal/src/app/pages/index.page.ts +1 -2
  55. package/template-minimal/src/main.server.ts +2 -2
  56. package/template-minimal/src/main.ts +2 -2
  57. package/template-minimal/vite.config.ts +3 -3
  58. package/files/analog-env.d.ts +0 -13
  59. package/template-angular-v16/package.json +0 -54
  60. package/template-angular-v16/src/app/app.component.spec.ts +0 -17
  61. package/template-angular-v16/src/app/app.component.ts +0 -20
  62. package/template-angular-v16/src/app/app.config.ts +0 -12
  63. package/template-angular-v16/src/app/pages/index.page.ts +0 -49
  64. package/template-angular-v16/src/main.server.ts +0 -26
  65. package/template-angular-v18/src/app/app-root.ag +0 -16
  66. package/template-angular-v18/src/app/app-root.spec.ts +0 -20
  67. package/template-angular-v18/src/app/pages/index.page.ag +0 -53
  68. package/template-blog/src/app/app-root.ag +0 -25
  69. package/template-blog/src/app/pages/blog/[slug].page.ag +0 -24
  70. package/template-blog/src/app/pages/blog/index.page.ag +0 -32
  71. package/template-latest/src/app/app-root.ag +0 -16
  72. package/template-latest/src/app/app.component.spec.ts +0 -20
  73. package/template-latest/src/app/pages/index.page.ag +0 -53
  74. package/template-minimal/src/app/app-root.ag +0 -7
  75. package/template-minimal/src/app/pages/index.page.ag +0 -32
  76. /package/{template-angular-v16 → template-angular-v19}/.editorconfig +0 -0
  77. /package/{template-angular-v16 → template-angular-v19}/.vscode/extensions.json +0 -0
  78. /package/{template-angular-v16 → template-angular-v19}/.vscode/launch.json +0 -0
  79. /package/{template-angular-v16 → template-angular-v19}/.vscode/tasks.json +0 -0
  80. /package/{template-angular-v16/src/assets → template-angular-v19/public}/.gitkeep +0 -0
  81. /package/{template-angular-v16/src/assets → template-angular-v19/public}/analog.svg +0 -0
  82. /package/{template-angular-v16 → template-angular-v19/public}/favicon.ico +0 -0
  83. /package/{template-angular-v16/src/assets → template-angular-v19/public}/vite.svg +0 -0
  84. /package/{template-blog → template-angular-v19}/src/app/app.component.spec.ts +0 -0
  85. /package/{template-angular-v16/src/server/routes → template-angular-v19/src/server/routes/api}/v1/hello.ts +0 -0
  86. /package/{template-angular-v16/src/test.ts → template-angular-v19/src/test-setup.ts} +0 -0
  87. /package/{template-angular-v16 → template-angular-v19}/src/vite-env.d.ts +0 -0
@@ -1,55 +1,12 @@
1
- import { Component, signal } from '@angular/core';
1
+ import { Component } from '@angular/core';
2
+
3
+ import { AnalogWelcome } from './analog-welcome';
2
4
 
3
5
  @Component({
4
6
  selector: 'app-home',
5
- standalone: true,
7
+ imports: [AnalogWelcome],
6
8
  template: `
7
- <div>
8
- <a href="https://analogjs.org/" target="_blank">
9
- <img alt="Analog Logo" class="logo analog" src="/analog.svg" />
10
- </a>
11
- </div>
12
-
13
- <h2>Analog</h2>
14
-
15
- <h3>The fullstack meta-framework for Angular!</h3>
16
-
17
- <div class="card">
18
- <button type="button" (click)="increment()">Count {{ count() }}</button>
19
- </div>
20
-
21
- <p class="read-the-docs">
22
- <a href="https://analogjs.org" target="_blank">Docs</a> |
23
- <a href="https://github.com/analogjs/analog" target="_blank">GitHub</a> |
24
- <a href="https://github.com/sponsors/brandonroberts" target="_blank">
25
- Sponsor
26
- </a>
27
- </p>
28
- `,
29
- styles: `
30
- .logo {
31
- will-change: filter;
32
- }
33
-
34
- .logo:hover {
35
- filter: drop-shadow(0 0 2em #646cffaa);
36
- }
37
-
38
- .read-the-docs > * {
39
- color: #fff;
40
- }
41
-
42
- @media (prefers-color-scheme: light) {
43
- .read-the-docs > * {
44
- color: #213547;
45
- }
46
- }
9
+ <app-analog-welcome/>
47
10
  `,
48
11
  })
49
- export default class HomeComponent {
50
- count = signal(0);
51
-
52
- increment() {
53
- this.count.update((count) => count + 1);
54
- }
55
- }
12
+ export default class Home {}
@@ -2,7 +2,7 @@ import 'zone.js/node';
2
2
  import '@angular/platform-server/init';
3
3
  import { render } from '@analogjs/router/server';
4
4
 
5
- __APP_COMPONENT_IMPORT__
5
+ import { App } from './app/app';
6
6
  import { config } from './app/app.config.server';
7
7
 
8
- export default render(__APP_COMPONENT__, config);
8
+ export default render(App, config);
@@ -1,7 +1,7 @@
1
1
  import 'zone.js';
2
2
  import { bootstrapApplication } from '@angular/platform-browser';
3
3
 
4
- __APP_COMPONENT_IMPORT__
4
+ import { App } from './app/app';
5
5
  import { appConfig } from './app/app.config';
6
6
 
7
- bootstrapApplication(__APP_COMPONENT__, appConfig);
7
+ bootstrapApplication(App, appConfig);
@@ -1,80 +1,4 @@
1
- /* You can add global styles to this file, and also import other style files */
2
- :root {
3
- font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
4
- font-size: 16px;
5
- line-height: 24px;
6
- font-weight: 400;
7
-
8
- color-scheme: light dark;
9
- color: rgba(255, 255, 255, 0.87);
10
- background-color: #242424;
11
-
12
- font-synthesis: none;
13
- text-rendering: optimizeLegibility;
14
- -webkit-font-smoothing: antialiased;
15
- -moz-osx-font-smoothing: grayscale;
16
- -webkit-text-size-adjust: 100%;
17
- }
18
-
19
- a {
20
- font-weight: 500;
21
- color: #646cff;
22
- text-decoration: inherit;
23
- }
24
-
25
- a:hover {
26
- color: #535bf2;
27
- }
28
-
29
- body {
30
- margin: 0;
31
- display: flex;
32
- place-items: center;
33
- min-width: 320px;
34
- min-height: 100vh;
35
- }
36
-
37
- h1 {
38
- font-size: 3.2em;
39
- line-height: 1.1;
40
- }
41
-
42
- button {
43
- border-radius: 8px;
44
- border: 1px solid transparent;
45
- padding: 0.6em 1.2em;
46
- font-size: 1em;
47
- font-weight: 500;
48
- font-family: inherit;
49
- background-color: #1a1a1a;
50
- cursor: pointer;
51
- transition: border-color 0.25s;
52
- }
53
-
54
- button:hover {
55
- border-color: #646cff;
56
- }
57
-
58
- button:focus,
59
- button:focus-visible {
60
- outline: 4px auto -webkit-focus-ring-color;
61
- }
62
-
63
- .card {
64
- padding: 2em;
65
- }
66
-
67
- @media (prefers-color-scheme: light) {
68
- :root {
69
- color: #213547;
70
- background-color: #ffffff;
71
- }
72
-
73
- a:hover {
74
- color: #747bff;
75
- }
76
-
77
- button {
78
- background-color: #f9f9f9;
79
- }
1
+ html, body {
2
+ display: block;
3
+ height: 100%;
80
4
  }
@@ -1,12 +1,13 @@
1
+ import '@angular/compiler';
1
2
  import '@analogjs/vitest-angular/setup-zone';
2
3
 
3
4
  import {
4
- BrowserDynamicTestingModule,
5
- platformBrowserDynamicTesting,
6
- } from '@angular/platform-browser-dynamic/testing';
5
+ BrowserTestingModule,
6
+ platformBrowserTesting,
7
+ } from '@angular/platform-browser/testing';
7
8
  import { getTestBed } from '@angular/core/testing';
8
9
 
9
10
  getTestBed().initTestEnvironment(
10
- BrowserDynamicTestingModule,
11
- platformBrowserDynamicTesting()
11
+ BrowserTestingModule,
12
+ platformBrowserTesting()
12
13
  );
@@ -1,4 +1,3 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
1
  {
3
2
  "compileOnSave": false,
4
3
  "compilerOptions": {
@@ -28,5 +27,8 @@
28
27
  "strictInjectionParameters": true,
29
28
  "strictInputAccessModifiers": true,
30
29
  "strictTemplates": true
31
- }
30
+ },
31
+ "references": [
32
+ { "path": "tsconfig.spec.json" }
33
+ ]
32
34
  }
@@ -3,7 +3,7 @@
3
3
  "extends": "./tsconfig.json",
4
4
  "compilerOptions": {
5
5
  "outDir": "./out-tsc/spec",
6
- "target": "es2016",
6
+ "target": "es2022",
7
7
  "types": ["node", "vitest/globals"]
8
8
  },
9
9
  "files": ["src/test-setup.ts"],
@@ -1,7 +1,7 @@
1
1
  /// <reference types="vitest" />
2
2
 
3
3
  import { defineConfig } from 'vite';
4
- import analog from '@analogjs/platform';
4
+ import analog from '@analogjs/platform';__TAILWIND_IMPORT__
5
5
 
6
6
  // https://vitejs.dev/config/
7
7
  export default defineConfig(({ mode }) => ({
@@ -11,7 +11,9 @@ export default defineConfig(({ mode }) => ({
11
11
  resolve: {
12
12
  mainFields: ['module'],
13
13
  },
14
- plugins: [analog(__ANALOG_SFC_CONFIG__)],
14
+ plugins: [
15
+ analog(),__TAILWIND_PLUGIN__
16
+ ],
15
17
  test: {
16
18
  globals: true,
17
19
  environment: 'jsdom',
@@ -1,4 +1,4 @@
1
1
  {
2
2
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3
- "recommendations": ["angular.ng-template", "analogjs.vscode-analog"]
3
+ "recommendations": ["angular.ng-template", "analogjs.vscode-analog", "vitest.explorer"]
4
4
  }
@@ -3,29 +3,29 @@
3
3
  "version": "0.0.0",
4
4
  "type": "module",
5
5
  "engines": {
6
- "node": ">=18.19.1"
6
+ "node": ">=20.19.1"
7
7
  },
8
8
  "scripts": {
9
9
  "ng": "ng",
10
- "dev": "ng serve",
11
- "start": "ng serve",
12
- "build": "ng build",
13
- "watch": "ng build --watch --configuration development",
14
- "test": "ng test"
10
+ "dev": "vite",
11
+ "start": "vite",
12
+ "build": "vite build",
13
+ "watch": "vite build --watch",
14
+ "test": "vitest",
15
+ "preview": "node dist/analog/server/index.mjs"
15
16
  },
16
17
  "private": true,
17
18
  "dependencies": {
18
- "@analogjs/content": "^2.0.0-alpha.9",
19
- "@analogjs/router": "^2.0.0-alpha.9",
20
- "@angular/animations": "^19.0.0",
21
- "@angular/common": "^19.0.0",
22
- "@angular/compiler": "^19.0.0",
23
- "@angular/core": "^19.0.0",
24
- "@angular/forms": "^19.0.0",
25
- "@angular/platform-browser": "^19.0.0",
26
- "@angular/platform-browser-dynamic": "^19.0.0",
27
- "@angular/platform-server": "^19.0.0",
28
- "@angular/router": "^19.0.0",
19
+ "@analogjs/content": "^2.0.0-beta.10",
20
+ "@analogjs/router": "^2.0.0-beta.10",
21
+ "@angular/animations": "^20.0.0",
22
+ "@angular/common": "^20.0.0",
23
+ "@angular/compiler": "^20.0.0",
24
+ "@angular/core": "^20.0.0",
25
+ "@angular/forms": "^20.0.0",
26
+ "@angular/platform-browser": "^20.0.0",
27
+ "@angular/platform-server": "^20.0.0",
28
+ "@angular/router": "^20.0.0",
29
29
  "front-matter": "^4.0.2",
30
30
  "marked": "^15.0.7",
31
31
  "marked-gfm-heading-id": "^4.1.1",
@@ -37,17 +37,17 @@
37
37
  "zone.js": "~0.15.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@analogjs/platform": "^2.0.0-alpha.9",
41
- "@analogjs/vite-plugin-angular": "^2.0.0-alpha.9",
42
- "@analogjs/vitest-angular": "^2.0.0-alpha.9",
43
- "@angular-devkit/build-angular": "^19.0.0",
44
- "@angular/build": "^19.0.0",
45
- "@angular/cli": "^19.0.0",
46
- "@angular/compiler-cli": "^19.0.0",
40
+ "@analogjs/platform": "^2.0.0-beta.10",
41
+ "@analogjs/vite-plugin-angular": "^2.0.0-beta.10",
42
+ "@analogjs/vitest-angular": "^2.0.0-beta.10",
43
+ "@angular-devkit/build-angular": "^20.0.0",
44
+ "@angular/build": "^20.0.0",
45
+ "@angular/cli": "^20.0.0",
46
+ "@angular/compiler-cli": "^20.0.0",
47
47
  "jsdom": "^22.0.0",
48
48
  "typescript": "~5.8.0",
49
- "vite": "^6.0.0",
49
+ "vite": "^7.0.0",
50
50
  "vite-tsconfig-paths": "^4.2.0",
51
- "vitest": "^3.0.0"
51
+ "vitest": "^4.0.0"
52
52
  }
53
53
  }
@@ -3,18 +3,23 @@ import {
3
3
  withFetch,
4
4
  withInterceptors,
5
5
  } from '@angular/common/http';
6
- import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
7
- import { provideClientHydration } from '@angular/platform-browser';
6
+ import {
7
+ ApplicationConfig,
8
+ provideBrowserGlobalErrorListeners,
9
+ provideZoneChangeDetection
10
+ } from '@angular/core';
11
+ import { provideClientHydration, withEventReplay } from '@angular/platform-browser';
8
12
  import { provideFileRouter, requestContextInterceptor } from '@analogjs/router';
9
13
 
10
14
  export const appConfig: ApplicationConfig = {
11
15
  providers: [
16
+ provideBrowserGlobalErrorListeners(),
12
17
  provideZoneChangeDetection({ eventCoalescing: true }),
13
18
  provideFileRouter(),
14
19
  provideHttpClient(
15
20
  withFetch(),
16
21
  withInterceptors([requestContextInterceptor])
17
22
  ),
18
- provideClientHydration(),
23
+ provideClientHydration(withEventReplay()),
19
24
  ],
20
25
  };
@@ -3,8 +3,7 @@ import { RouterOutlet } from '@angular/router';
3
3
 
4
4
  @Component({
5
5
  selector: 'app-root',
6
- standalone: true,
7
6
  imports: [RouterOutlet],
8
7
  template: `<router-outlet />`,
9
8
  })
10
- export class AppComponent {}
9
+ export class App {}
@@ -2,7 +2,6 @@ import { Component } from '@angular/core';
2
2
 
3
3
  @Component({
4
4
  selector: 'app-home',
5
- standalone: true,
6
5
  template: `
7
6
  <h2>Analog</h2>
8
7
 
@@ -35,4 +34,4 @@ import { Component } from '@angular/core';
35
34
  }
36
35
  `,
37
36
  })
38
- export default class HomeComponent {}
37
+ export default class Home {}
@@ -2,7 +2,7 @@ import 'zone.js/node';
2
2
  import '@angular/platform-server/init';
3
3
  import { render } from '@analogjs/router/server';
4
4
 
5
- __APP_COMPONENT_IMPORT__
5
+ import { App } from './app/app';
6
6
  import { config } from './app/app.config.server';
7
7
 
8
- export default render(__APP_COMPONENT__, config);
8
+ export default render(App, config);
@@ -1,7 +1,7 @@
1
1
  import 'zone.js';
2
2
  import { bootstrapApplication } from '@angular/platform-browser';
3
3
 
4
- __APP_COMPONENT_IMPORT__
4
+ import { App } from './app/app';
5
5
  import { appConfig } from './app/app.config';
6
6
 
7
- bootstrapApplication(__APP_COMPONENT__, appConfig);
7
+ bootstrapApplication(App, appConfig);
@@ -1,7 +1,7 @@
1
1
  /// <reference types="vitest" />
2
2
 
3
3
  import { defineConfig } from 'vite';
4
- import analog from '@analogjs/platform';
4
+ import analog from '@analogjs/platform';__TAILWIND_IMPORT__
5
5
 
6
6
  // https://vitejs.dev/config/
7
7
  export default defineConfig(({ mode }) => ({
@@ -17,7 +17,7 @@ export default defineConfig(({ mode }) => ({
17
17
  static: true,
18
18
  prerender: {
19
19
  routes: [],
20
- },__ANALOG_SFC_CONFIG__
21
- }),
20
+ },
21
+ }),__TAILWIND_PLUGIN__
22
22
  ],
23
23
  }));
@@ -1,13 +0,0 @@
1
- declare module '*.analog' {
2
- import { Type } from '@angular/core';
3
-
4
- const cmp: Type<unknown>;
5
- export default cmp;
6
- }
7
-
8
- declare module '*.ag' {
9
- import { Type } from '@angular/core';
10
-
11
- const cmp: Type<unknown>;
12
- export default cmp;
13
- }
@@ -1,54 +0,0 @@
1
- {
2
- "name": "my-app",
3
- "version": "0.0.0",
4
- "type": "module",
5
- "private": true,
6
- "engines": {
7
- "node": ">=18.13.0"
8
- },
9
- "scripts": {
10
- "dev": "ng serve",
11
- "ng": "ng",
12
- "start": "ng serve",
13
- "build": "ng build",
14
- "watch": "ng build --watch",
15
- "test": "ng test"
16
- },
17
- "dependencies": {
18
- "@analogjs/content": "^2.0.0-alpha.9",
19
- "@analogjs/router": "^2.0.0-alpha.9",
20
- "@angular/animations": "^16.2.0",
21
- "@angular/common": "^16.2.0",
22
- "@angular/compiler": "^16.2.0",
23
- "@angular/core": "^16.2.0",
24
- "@angular/forms": "^16.2.0",
25
- "@angular/platform-browser": "^16.2.0",
26
- "@angular/platform-browser-dynamic": "^16.2.0",
27
- "@angular/platform-server": "^16.2.0",
28
- "@angular/router": "^16.2.0",
29
- "@nx/angular": "~18.0.0",
30
- "front-matter": "^4.0.2",
31
- "marked": "^15.0.7",
32
- "marked-gfm-heading-id": "^4.1.1",
33
- "marked-highlight": "^2.2.1",
34
- "mermaid": "^10.2.4",
35
- "prismjs": "^1.29.0",
36
- "rxjs": "~7.5.6",
37
- "tslib": "^2.4.0",
38
- "zone.js": "~0.13.0"
39
- },
40
- "devDependencies": {
41
- "@analogjs/platform": "^2.0.0-alpha.9",
42
- "@analogjs/vite-plugin-angular": "^2.0.0-alpha.9",
43
- "@analogjs/vitest-angular": "^2.0.0-alpha.9",
44
- "@angular-devkit/build-angular": "^16.2.0",
45
- "@angular/cli": "^16.2.0",
46
- "@angular/compiler-cli": "^16.2.0",
47
- "@nx/vite": "~18.0.0",
48
- "nx": "~18.0.0",
49
- "jsdom": "^22.1.0",
50
- "typescript": "~5.0.2",
51
- "vite": "^5.0.0",
52
- "vitest": "^1.3.1"
53
- }
54
- }
@@ -1,17 +0,0 @@
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
- });
@@ -1,20 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import { RouterOutlet } from '@angular/router';
3
-
4
- @Component({
5
- selector: 'app-root',
6
- standalone: true,
7
- imports: [RouterOutlet],
8
- template: ` <router-outlet></router-outlet> `,
9
- styles: [
10
- `
11
- :host {
12
- max-width: 1280px;
13
- margin: 0 auto;
14
- padding: 2rem;
15
- text-align: center;
16
- }
17
- `,
18
- ],
19
- })
20
- export class AppComponent {}
@@ -1,12 +0,0 @@
1
- import { provideHttpClient } from '@angular/common/http';
2
- import { ApplicationConfig } from '@angular/core';
3
- import { provideClientHydration } from '@angular/platform-browser';
4
- import { provideFileRouter } from '@analogjs/router';
5
-
6
- export const appConfig: ApplicationConfig = {
7
- providers: [
8
- provideFileRouter(),
9
- provideHttpClient(),
10
- provideClientHydration(),
11
- ],
12
- };
@@ -1,49 +0,0 @@
1
- import { Component } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'app-home',
5
- standalone: true,
6
- template: `
7
- <div>
8
- <a href="https://analogjs.org/" target="_blank">
9
- <img alt="Analog Logo" class="logo analog" src="/analog.svg" />
10
- </a>
11
- </div>
12
-
13
- <h2>Analog</h2>
14
-
15
- <h3>The fullstack meta-framework for Angular!</h3>
16
-
17
- <div class="card">
18
- <button type="button" (click)="increment()">Count {{ count }}</button>
19
- </div>
20
-
21
- <p class="read-the-docs">
22
- For guides on how to customize this project, visit the
23
- <a href="https://analogjs.org" target="_blank">Analog documentation</a>
24
- </p>
25
- `,
26
- styles: [
27
- `
28
- .logo {
29
- will-change: filter;
30
- }
31
- .logo:hover {
32
- filter: drop-shadow(0 0 2em #646cffaa);
33
- }
34
- .logo.angular:hover {
35
- filter: drop-shadow(0 0 2em #42b883aa);
36
- }
37
- .read-the-docs {
38
- color: #888;
39
- }
40
- `,
41
- ],
42
- })
43
- export default class HomeComponent {
44
- count = 0;
45
-
46
- increment() {
47
- this.count++;
48
- }
49
- }
@@ -1,26 +0,0 @@
1
- import 'zone.js/node';
2
- import '@angular/platform-server/init';
3
-
4
- import { enableProdMode } from '@angular/core';
5
- import { bootstrapApplication } from '@angular/platform-browser';
6
- import { renderApplication } from '@angular/platform-server';
7
-
8
- import { config } from './app/app.config.server';
9
- import { AppComponent } from './app/app.component';
10
-
11
- if (import.meta.env.PROD) {
12
- enableProdMode();
13
- }
14
-
15
- export function bootstrap() {
16
- return bootstrapApplication(AppComponent, config);
17
- }
18
-
19
- export default async function render(url: string, document: string) {
20
- const html = await renderApplication(bootstrap, {
21
- document,
22
- url,
23
- });
24
-
25
- return html;
26
- }
@@ -1,16 +0,0 @@
1
- <script lang="ts">
2
- import { RouterOutlet } from '@angular/router' with { analog: 'imports' };
3
- </script>
4
-
5
- <template>
6
- <router-outlet />
7
- </template>
8
-
9
- <style>
10
- :host {
11
- max-width: 1280px;
12
- margin: 0 auto;
13
- padding: 2rem;
14
- text-align: center;
15
- }
16
- </style>
@@ -1,20 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
- import { provideRouter } from '@angular/router';
3
- import { provideLocationMocks } from '@angular/common/testing';
4
-
5
- import App from './app-root.ag';
6
-
7
- describe('App', () => {
8
- beforeEach(async () => {
9
- await TestBed.configureTestingModule({
10
- imports: [App],
11
- providers: [provideRouter([]), provideLocationMocks()],
12
- }).compileComponents();
13
- });
14
-
15
- it('should create the app', () => {
16
- const fixture = TestBed.createComponent(App);
17
- const app = fixture.componentInstance;
18
- expect(app).toBeTruthy();
19
- });
20
- });