create-analog 2.0.0-alpha.10 → 2.0.0-alpha.12

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 (30) hide show
  1. package/index.js +16 -9
  2. package/package.json +1 -1
  3. package/template-angular-v16/package.json +5 -5
  4. package/template-angular-v17/package.json +5 -5
  5. package/template-angular-v18/package.json +5 -5
  6. package/template-blog/package.json +6 -6
  7. package/template-blog/src/app/app.config.ts +8 -3
  8. package/template-blog/src/app/{app.component.spec.ts → app.spec.ts} +1 -1
  9. package/template-blog/src/app/{app.component.ts → app.ts} +0 -1
  10. package/template-blog/src/app/pages/blog/[slug].page.ts +0 -1
  11. package/template-blog/src/app/pages/blog/index.page.ts +0 -1
  12. package/template-blog/src/test-setup.ts +6 -5
  13. package/template-blog/tsconfig.json +4 -2
  14. package/template-blog/vite.config.ts +2 -2
  15. package/template-latest/package.json +6 -6
  16. package/template-latest/src/app/app.config.ts +8 -3
  17. package/template-latest/src/app/{app.component.spec.ts → app.spec.ts} +1 -1
  18. package/template-latest/src/app/{app.component.ts → app.ts} +0 -1
  19. package/template-latest/src/app/pages/analog-welcome.ts +263 -0
  20. package/template-latest/src/app/pages/index.page.ag +2 -48
  21. package/template-latest/src/app/pages/index.page.ts +5 -47
  22. package/template-latest/src/styles.css +3 -79
  23. package/template-latest/src/test-setup.ts +6 -5
  24. package/template-latest/tsconfig.json +4 -2
  25. package/template-latest/vite.config.ts +4 -2
  26. package/template-minimal/package.json +6 -6
  27. package/template-minimal/src/app/app.config.ts +8 -3
  28. package/template-minimal/src/app/{app.component.ts → app.ts} +0 -1
  29. package/template-minimal/src/app/pages/index.page.ts +0 -1
  30. package/template-minimal/vite.config.ts +3 -3
package/index.js CHANGED
@@ -42,7 +42,7 @@ const HIGHLIGHTERS = {
42
42
  highlighter: 'withPrismHighlighter',
43
43
  entryPoint: 'prism-highlighter',
44
44
  dependencies: {
45
- 'marked-highlight': '^2.0.1',
45
+ 'marked-highlight': '^2.2.1',
46
46
  prismjs: '^1.29.0',
47
47
  },
48
48
  },
@@ -50,7 +50,7 @@ const HIGHLIGHTERS = {
50
50
  highlighter: 'withShikiHighlighter',
51
51
  entryPoint: 'shiki-highlighter',
52
52
  dependencies: {
53
- marked: '^7.0.0',
53
+ marked: '^15.0.7',
54
54
  'marked-shiki': '^1.1.0',
55
55
  shiki: '^1.6.1',
56
56
  },
@@ -214,6 +214,13 @@ async function init() {
214
214
  addTailwindDirectives(write, filesDir);
215
215
  }
216
216
 
217
+ replacePlaceholders(root, 'vite.config.ts', {
218
+ __TAILWIND_IMPORT__: !skipTailwind
219
+ ? `\nimport tailwindcss from '@tailwindcss/vite';`
220
+ : '',
221
+ __TAILWIND_PLUGIN__: !skipTailwind ? '\n tailwindcss()' : '',
222
+ });
223
+
217
224
  const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);
218
225
  const pkgManager = pkgInfo ? pkgInfo.name : 'npm';
219
226
  const pkg = JSON.parse(
@@ -376,11 +383,11 @@ function addTailwindDependencies(pkg) {
376
383
 
377
384
  function addYarnDevDependencies(pkg, template) {
378
385
  // v18
379
- if (template === 'latest' || template === 'blog') {
380
- pkg.devDependencies['@nx/angular'] = '^19.1.0';
381
- pkg.devDependencies['@nx/devkit'] = '^19.1.0';
382
- pkg.devDependencies['@nx/vite'] = '^19.1.0';
383
- pkg.devDependencies['nx'] = '^19.1.0';
386
+ if (template === 'latest' || template === 'blog' || template === 'minimal') {
387
+ pkg.devDependencies['@nx/angular'] = '^21.0.0';
388
+ pkg.devDependencies['@nx/devkit'] = '^21.0.0';
389
+ pkg.devDependencies['@nx/vite'] = '^21.0.0';
390
+ pkg.devDependencies['nx'] = '^21.0.0';
384
391
  } else if (template === 'angular-v17') {
385
392
  pkg.devDependencies['@angular-devkit/build-angular'] = '^17.2.0';
386
393
  }
@@ -434,10 +441,10 @@ function setComponentFormat(root, filesDir, write, template, useAnalogSFC) {
434
441
  __APP_COMPONENT__: useAnalogSFC ? 'App' : 'AppComponent',
435
442
  __APP_COMPONENT_IMPORT__: useAnalogSFC
436
443
  ? "import App from './app/app-root.ag';"
437
- : "import { AppComponent } from './app/app.component';",
444
+ : "import { AppComponent } from './app/app';",
438
445
  });
439
446
 
440
- const cmpForDelete = useAnalogSFC ? 'app.component' : 'app-root';
447
+ const cmpForDelete = useAnalogSFC ? 'app' : 'app-root';
441
448
  const deleteExt = useAnalogSFC ? 'ts' : 'ag';
442
449
  deleteFiles(root, [
443
450
  useAnalogSFC ? `src/app/${cmpForDelete}.ts` : `src/app/${cmpForDelete}.ag`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-analog",
3
- "version": "2.0.0-alpha.10",
3
+ "version": "2.0.0-alpha.12",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Brandon Roberts",
@@ -15,8 +15,8 @@
15
15
  "test": "ng test"
16
16
  },
17
17
  "dependencies": {
18
- "@analogjs/content": "^2.0.0-alpha.10",
19
- "@analogjs/router": "^2.0.0-alpha.10",
18
+ "@analogjs/content": "^2.0.0-alpha.12",
19
+ "@analogjs/router": "^2.0.0-alpha.12",
20
20
  "@angular/animations": "^16.2.0",
21
21
  "@angular/common": "^16.2.0",
22
22
  "@angular/compiler": "^16.2.0",
@@ -38,9 +38,9 @@
38
38
  "zone.js": "~0.13.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@analogjs/platform": "^2.0.0-alpha.10",
42
- "@analogjs/vite-plugin-angular": "^2.0.0-alpha.10",
43
- "@analogjs/vitest-angular": "^2.0.0-alpha.10",
41
+ "@analogjs/platform": "^2.0.0-alpha.12",
42
+ "@analogjs/vite-plugin-angular": "^2.0.0-alpha.12",
43
+ "@analogjs/vitest-angular": "^2.0.0-alpha.12",
44
44
  "@angular-devkit/build-angular": "^16.2.0",
45
45
  "@angular/cli": "^16.2.0",
46
46
  "@angular/compiler-cli": "^16.2.0",
@@ -15,8 +15,8 @@
15
15
  "test": "ng test"
16
16
  },
17
17
  "dependencies": {
18
- "@analogjs/content": "^2.0.0-alpha.10",
19
- "@analogjs/router": "^2.0.0-alpha.10",
18
+ "@analogjs/content": "^2.0.0-alpha.12",
19
+ "@analogjs/router": "^2.0.0-alpha.12",
20
20
  "@angular/animations": "^17.2.0",
21
21
  "@angular/common": "^17.2.0",
22
22
  "@angular/compiler": "^17.2.0",
@@ -38,9 +38,9 @@
38
38
  "zone.js": "~0.14.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@analogjs/platform": "^2.0.0-alpha.10",
42
- "@analogjs/vite-plugin-angular": "^2.0.0-alpha.10",
43
- "@analogjs/vitest-angular": "^2.0.0-alpha.10",
41
+ "@analogjs/platform": "^2.0.0-alpha.12",
42
+ "@analogjs/vite-plugin-angular": "^2.0.0-alpha.12",
43
+ "@analogjs/vitest-angular": "^2.0.0-alpha.12",
44
44
  "@angular-devkit/build-angular": "^17.2.0",
45
45
  "@angular/cli": "^17.2.0",
46
46
  "@angular/compiler-cli": "^17.2.0",
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "private": true,
17
17
  "dependencies": {
18
- "@analogjs/content": "^2.0.0-alpha.10",
19
- "@analogjs/router": "^2.0.0-alpha.10",
18
+ "@analogjs/content": "^2.0.0-alpha.12",
19
+ "@analogjs/router": "^2.0.0-alpha.12",
20
20
  "@angular/animations": "^18.0.0",
21
21
  "@angular/build": "^18.0.0",
22
22
  "@angular/common": "^18.0.0",
@@ -38,9 +38,9 @@
38
38
  "zone.js": "~0.14.3"
39
39
  },
40
40
  "devDependencies": {
41
- "@analogjs/platform": "^2.0.0-alpha.10",
42
- "@analogjs/vite-plugin-angular": "^2.0.0-alpha.10",
43
- "@analogjs/vitest-angular": "^2.0.0-alpha.10",
41
+ "@analogjs/platform": "^2.0.0-alpha.12",
42
+ "@analogjs/vite-plugin-angular": "^2.0.0-alpha.12",
43
+ "@analogjs/vitest-angular": "^2.0.0-alpha.12",
44
44
  "@angular/cli": "^18.0.0",
45
45
  "@angular/compiler-cli": "^18.0.0",
46
46
  "jsdom": "^22.0.0",
@@ -3,7 +3,7 @@
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",
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "private": true,
17
17
  "dependencies": {
18
- "@analogjs/content": "^2.0.0-alpha.10",
19
- "@analogjs/router": "^2.0.0-alpha.10",
18
+ "@analogjs/content": "^2.0.0-alpha.12",
19
+ "@analogjs/router": "^2.0.0-alpha.12",
20
20
  "@angular/animations": "^19.0.0",
21
21
  "@angular/common": "^19.0.0",
22
22
  "@angular/compiler": "^19.0.0",
@@ -36,9 +36,9 @@
36
36
  "zone.js": "~0.15.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@analogjs/platform": "^2.0.0-alpha.10",
40
- "@analogjs/vite-plugin-angular": "^2.0.0-alpha.10",
41
- "@analogjs/vitest-angular": "^2.0.0-alpha.10",
39
+ "@analogjs/platform": "^2.0.0-alpha.12",
40
+ "@analogjs/vite-plugin-angular": "^2.0.0-alpha.12",
41
+ "@analogjs/vitest-angular": "^2.0.0-alpha.12",
42
42
  "@angular-devkit/build-angular": "^19.0.0",
43
43
  "@angular/build": "^19.0.0",
44
44
  "@angular/cli": "^19.0.0",
@@ -3,21 +3,26 @@ 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
  import { provideContent, withMarkdownRenderer } from '@analogjs/content';
10
14
  import { __HIGHLIGHTER__ } from '@analogjs/content/__HIGHLIGHTER_ENTRY_POINT__';
11
15
 
12
16
  export const appConfig: ApplicationConfig = {
13
17
  providers: [
18
+ provideBrowserGlobalErrorListeners(),
14
19
  provideZoneChangeDetection({ eventCoalescing: true }),
15
20
  provideFileRouter(),
16
21
  provideHttpClient(
17
22
  withFetch(),
18
23
  withInterceptors([requestContextInterceptor])
19
24
  ),
20
- provideClientHydration(),
25
+ provideClientHydration(withEventReplay()),
21
26
  provideContent(withMarkdownRenderer(), __HIGHLIGHTER__()),
22
27
  ],
23
28
  };
@@ -2,7 +2,7 @@ import { TestBed } from '@angular/core/testing';
2
2
  import { provideRouter } from '@angular/router';
3
3
  import { provideLocationMocks } from '@angular/common/testing';
4
4
 
5
- import { AppComponent } from './app.component';
5
+ import { AppComponent } from './app';
6
6
 
7
7
  describe('AppComponent', () => {
8
8
  beforeEach(async () => {
@@ -3,7 +3,6 @@ import { RouterLink, RouterOutlet } from '@angular/router';
3
3
 
4
4
  @Component({
5
5
  selector: 'app-root',
6
- standalone: true,
7
6
  imports: [RouterLink, RouterOutlet],
8
7
  template: `
9
8
  <nav>
@@ -6,7 +6,6 @@ import PostAttributes from '../../post-attributes';
6
6
 
7
7
  @Component({
8
8
  selector: 'app-blog-post',
9
- standalone: true,
10
9
  imports: [AsyncPipe, MarkdownComponent],
11
10
  template: `
12
11
  @if (post$ | async; as post) {
@@ -6,7 +6,6 @@ import PostAttributes from '../../post-attributes';
6
6
 
7
7
  @Component({
8
8
  selector: 'app-blog',
9
- standalone: true,
10
9
  imports: [RouterLink],
11
10
  template: `
12
11
  <h1>Blog Archive</h1>
@@ -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
  }
@@ -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 }) => ({
@@ -19,7 +19,7 @@ export default defineConfig(({ mode }) => ({
19
19
  prerender: {
20
20
  routes: ['/blog', '/blog/2022-12-27-my-first-post'],
21
21
  },__ANALOG_SFC_CONFIG__
22
- }),
22
+ }),__TAILWIND_PLUGIN__
23
23
  ],
24
24
  test: {
25
25
  globals: true,
@@ -3,7 +3,7 @@
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",
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "private": true,
17
17
  "dependencies": {
18
- "@analogjs/content": "^2.0.0-alpha.10",
19
- "@analogjs/router": "^2.0.0-alpha.10",
18
+ "@analogjs/content": "^2.0.0-alpha.12",
19
+ "@analogjs/router": "^2.0.0-alpha.12",
20
20
  "@angular/animations": "^19.0.0",
21
21
  "@angular/common": "^19.0.0",
22
22
  "@angular/compiler": "^19.0.0",
@@ -37,9 +37,9 @@
37
37
  "zone.js": "~0.15.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@analogjs/platform": "^2.0.0-alpha.10",
41
- "@analogjs/vite-plugin-angular": "^2.0.0-alpha.10",
42
- "@analogjs/vitest-angular": "^2.0.0-alpha.10",
40
+ "@analogjs/platform": "^2.0.0-alpha.12",
41
+ "@analogjs/vite-plugin-angular": "^2.0.0-alpha.12",
42
+ "@analogjs/vitest-angular": "^2.0.0-alpha.12",
43
43
  "@angular-devkit/build-angular": "^19.0.0",
44
44
  "@angular/build": "^19.0.0",
45
45
  "@angular/cli": "^19.0.0",
@@ -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
  };
@@ -2,7 +2,7 @@ import { TestBed } from '@angular/core/testing';
2
2
  import { provideRouter } from '@angular/router';
3
3
  import { provideLocationMocks } from '@angular/common/testing';
4
4
 
5
- import { AppComponent } from './app.component';
5
+ import { AppComponent } from './app';
6
6
 
7
7
  describe('AppComponent', () => {
8
8
  beforeEach(async () => {
@@ -3,7 +3,6 @@ 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
  styles: `
@@ -0,0 +1,263 @@
1
+ import { Component } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'app-analog-welcome',
5
+ styles: [
6
+ `
7
+ :host {
8
+ font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
9
+ 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
10
+ 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
11
+ 'Noto Color Emoji';
12
+ display: flex;
13
+ padding: 2rem 1rem 8rem;
14
+ flex-direction: column;
15
+ background: rgb(250 250 250);
16
+ height: 100%;
17
+ }
18
+ a {
19
+ color: inherit;
20
+ text-decoration: inherit;
21
+ }
22
+ .main {
23
+ margin: 0 auto;
24
+ flex: 1 1 0;
25
+ }
26
+ .intro-section {
27
+ padding-top: 1.5rem;
28
+ padding-bottom: 2rem;
29
+ }
30
+ .intro-section > * + * {
31
+ margin-top: 1.5rem;
32
+ }
33
+ @media (min-width: 768px) {
34
+ .intro-section {
35
+ padding-top: 2.5rem;
36
+ padding-bottom: 3rem;
37
+ }
38
+ }
39
+ @media (min-width: 1024px) {
40
+ .intro-section {
41
+ padding-top: 8rem;
42
+ padding-bottom: 8rem;
43
+ }
44
+ }
45
+ .intro-container {
46
+ display: flex;
47
+ flex-direction: column;
48
+ text-align: center;
49
+ gap: 1rem;
50
+ align-items: center;
51
+ max-width: 64rem;
52
+ }
53
+ .intro-logo {
54
+ height: 3rem;
55
+ width: 3rem;
56
+ }
57
+ .intro-badge {
58
+ transition-property: color, background-color, border-color,
59
+ text-decoration-color, fill, stroke;
60
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
61
+ transition-duration: 150ms;
62
+ font-weight: 500;
63
+ font-size: 0.875rem;
64
+ line-height: 1.25rem;
65
+ padding: 0.375rem 1rem;
66
+ background-color: rgb(228 228 231);
67
+ border-radius: 1rem;
68
+ }
69
+ .intro-heading {
70
+ margin: 0;
71
+ font-weight: 500;
72
+ }
73
+
74
+ @media (min-width: 640px) {
75
+ .intro-heading {
76
+ font-size: 3rem;
77
+ line-height: 1;
78
+ }
79
+ }
80
+ @media (min-width: 768px) {
81
+ .intro-heading {
82
+ font-size: 3.75rem;
83
+ line-height: 1;
84
+ }
85
+ }
86
+ @media (min-width: 1024px) {
87
+ .intro-heading {
88
+ font-size: 4.5rem;
89
+ line-height: 1;
90
+ }
91
+ }
92
+ .intro-analog {
93
+ color: #dd0031;
94
+ }
95
+ .intro-description {
96
+ line-height: 1.5;
97
+ max-width: 42rem;
98
+ margin: 0;
99
+ }
100
+
101
+ @media (min-width: 640px) {
102
+ .intro-description {
103
+ line-height: 2rem;
104
+ font-size: 1.25rem;
105
+ }
106
+ }
107
+ .btn-container > * + * {
108
+ margin-left: 1rem;
109
+ }
110
+ .darkBtn {
111
+ transition-property: color, background-color, border-color,
112
+ text-decoration-color, fill, stroke;
113
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
114
+ transition-duration: 150ms;
115
+ color: rgb(250 250 250);
116
+ font-weight: 500;
117
+ font-size: 0.875rem;
118
+ line-height: 1.25rem;
119
+ padding-left: 2rem;
120
+ padding-right: 2rem;
121
+ background-color: rgb(9 9 11);
122
+ border-radius: 0.375rem;
123
+ justify-content: center;
124
+ align-items: center;
125
+ height: 2.75rem;
126
+ cursor: pointer;
127
+ display: inline-flex;
128
+ }
129
+ .darkBtn:hover {
130
+ background-color: rgb(9 9 11 / 0.9);
131
+ }
132
+ .lightBtn {
133
+ transition-property: color, background-color, border-color,
134
+ text-decoration-color, fill, stroke;
135
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
136
+ transition-duration: 150ms;
137
+ color: rgb(24, 24, 27);
138
+ background: rgb(250 250 250);
139
+ font-weight: 500;
140
+ font-size: 0.875rem;
141
+ line-height: 1.25rem;
142
+ padding-left: 2rem;
143
+ padding-right: 2rem;
144
+ border-radius: 0.375rem;
145
+ border: 1px solid rgb(229, 231, 235);
146
+ justify-content: center;
147
+ align-items: center;
148
+ height: 2.75rem;
149
+ display: inline-flex;
150
+ cursor: pointer;
151
+ }
152
+ .lightBtn:hover {
153
+ background-color: rgb(244 244 245);
154
+ }
155
+ .counter-section {
156
+ padding-top: 2rem;
157
+ padding-bottom: 2rem;
158
+ }
159
+
160
+ @media (min-width: 768px) {
161
+ .counter-section {
162
+ padding-top: 3rem;
163
+ padding-bottom: 3rem;
164
+ }
165
+ }
166
+
167
+ @media (min-width: 1024px) {
168
+ .counter-section {
169
+ padding-top: 6rem;
170
+ padding-bottom: 6rem;
171
+ }
172
+ }
173
+ .counter-container {
174
+ text-align: center;
175
+ gap: 1rem;
176
+ justify-content: center;
177
+ align-items: center;
178
+ flex-direction: column;
179
+ max-width: 58rem;
180
+ display: flex;
181
+ margin-left: auto;
182
+ margin-right: auto;
183
+ }
184
+ .counter-heading {
185
+ color: #dd0031;
186
+ line-height: 1.1;
187
+ font-weight: 500;
188
+ font-size: 1.875rem;
189
+ margin: 0;
190
+ }
191
+ .counter-description {
192
+ line-height: 1.5;
193
+ max-width: 85%;
194
+ margin: 0;
195
+ }
196
+
197
+ @media (min-width: 640px) {
198
+ .counter-description {
199
+ line-height: 1.75rem;
200
+ font-size: 1.125rem;
201
+ }
202
+ }
203
+ .count {
204
+ margin-left: 0.25rem;
205
+ font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
206
+ }
207
+ `,
208
+ ],
209
+ template: `
210
+ <main class="main">
211
+ <section class="intro-section">
212
+ <div class="intro-container">
213
+ <img
214
+ class="intro-logo"
215
+ src="https://analogjs.org/img/logos/analog-logo.svg"
216
+ alt="AnalogJs logo. Two red triangles and a white analog wave in front"
217
+ />
218
+ <a
219
+ class="intro-badge"
220
+ target="_blank"
221
+ href="https://twitter.com/analogjs"
222
+ >Follow along on Twitter</a
223
+ >
224
+ <h1 class="intro-heading">
225
+ <span class="intro-analog">Analog.</span> The fullstack Angular
226
+ meta-framework
227
+ </h1>
228
+ <p class="intro-description">
229
+ Analog is for building applications and websites with Angular.
230
+ <br />Powered by Vite.
231
+ </p>
232
+ <div class="btn-container">
233
+ <a class="darkBtn" href="https://analogjs.org">Read the docs</a>
234
+ <a
235
+ target="_blank"
236
+ rel="noreferrer"
237
+ class="lightBtn"
238
+ href="https://github.com/analogjs/analog"
239
+ >Star on GitHub</a
240
+ >
241
+ </div>
242
+ </div>
243
+ </section>
244
+ <section id="counter-demo" class="section">
245
+ <div class="counter-container">
246
+ <h2 class="counter-heading">Counter</h2>
247
+ <p class="counter-description">
248
+ This is a simple interactive counter. Powered by Angular.
249
+ </p>
250
+ <button (click)="increment()" class="lightBtn">
251
+ Count: <span class="count">{{ count }}</span>
252
+ </button>
253
+ </div>
254
+ </section>
255
+ </main>
256
+ `,
257
+ })
258
+ export class AnalogWelcome {
259
+ count = 0;
260
+ increment() {
261
+ this.count++;
262
+ }
263
+ }
@@ -1,53 +1,7 @@
1
1
  <script lang="ts">
2
- import { signal } from '@angular/core';
3
-
4
- const count = signal(0);
5
-
6
- function increment() {
7
- this.count.update((count) => count + 1);
8
- }
2
+ import AnalogWelcome from './analog-welcome' with { analog: 'imports '};
9
3
  </script>
10
4
 
11
5
  <template>
12
- <div>
13
- <a href="https://analogjs.org/" target="_blank">
14
- <img alt="Analog Logo" class="logo analog" src="/analog.svg" />
15
- </a>
16
- </div>
17
-
18
- <h2>Analog</h2>
19
-
20
- <h3>The fullstack meta-framework for Angular!</h3>
21
-
22
- <div class="card">
23
- <button type="button" (click)="increment()">Count {{ count() }}</button>
24
- </div>
25
-
26
- <p class="read-the-docs">
27
- <a href="https://analogjs.org" target="_blank">Docs</a> |
28
- <a href="https://github.com/analogjs/analog" target="_blank">GitHub</a> |
29
- <a href="https://github.com/sponsors/brandonroberts" target="_blank">
30
- Sponsor
31
- </a>
32
- </p>
6
+ <AnalogWelcome />
33
7
  </template>
34
-
35
- <style>
36
- .logo {
37
- will-change: filter;
38
- }
39
-
40
- .logo:hover {
41
- filter: drop-shadow(0 0 2em #646cffaa);
42
- }
43
-
44
- .read-the-docs > * {
45
- color: #fff;
46
- }
47
-
48
- @media (prefers-color-scheme: light) {
49
- .read-the-docs > * {
50
- color: #213547;
51
- }
52
- }
53
- </style>
@@ -1,55 +1,13 @@
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
12
  export default class HomeComponent {
50
- count = signal(0);
51
-
52
- increment() {
53
- this.count.update((count) => count + 1);
54
- }
55
13
  }
@@ -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
  }
@@ -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(__ANALOG_SFC_CONFIG__),__TAILWIND_PLUGIN__
16
+ ],
15
17
  test: {
16
18
  globals: true,
17
19
  environment: 'jsdom',
@@ -3,7 +3,7 @@
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",
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "private": true,
17
17
  "dependencies": {
18
- "@analogjs/content": "^2.0.0-alpha.10",
19
- "@analogjs/router": "^2.0.0-alpha.10",
18
+ "@analogjs/content": "^2.0.0-alpha.12",
19
+ "@analogjs/router": "^2.0.0-alpha.12",
20
20
  "@angular/animations": "^19.0.0",
21
21
  "@angular/common": "^19.0.0",
22
22
  "@angular/compiler": "^19.0.0",
@@ -37,9 +37,9 @@
37
37
  "zone.js": "~0.15.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@analogjs/platform": "^2.0.0-alpha.10",
41
- "@analogjs/vite-plugin-angular": "^2.0.0-alpha.10",
42
- "@analogjs/vitest-angular": "^2.0.0-alpha.10",
40
+ "@analogjs/platform": "^2.0.0-alpha.12",
41
+ "@analogjs/vite-plugin-angular": "^2.0.0-alpha.12",
42
+ "@analogjs/vitest-angular": "^2.0.0-alpha.12",
43
43
  "@angular-devkit/build-angular": "^19.0.0",
44
44
  "@angular/build": "^19.0.0",
45
45
  "@angular/cli": "^19.0.0",
@@ -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,7 +3,6 @@ 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
  })
@@ -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
 
@@ -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
+ },__ANALOG_SFC_CONFIG__,
21
+ }),__TAILWIND_PLUGIN__
22
22
  ],
23
23
  }));