create-analog 3.0.0-alpha.94 → 3.0.0-alpha.96

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 (82) hide show
  1. package/index.js +16 -14
  2. package/package.json +5 -7
  3. package/template-angular-v20/package.json +5 -5
  4. package/{template-angular-v19 → template-angular-v21}/_gitignore +3 -0
  5. package/template-angular-v21/package.json +55 -0
  6. package/{template-angular-v19 → template-angular-v21}/src/app/app.config.ts +7 -4
  7. package/{template-angular-v18/src/app/app.component.spec.ts → template-angular-v21/src/app/app.spec.ts} +4 -4
  8. package/{template-angular-v19/src/app/app.component.ts → template-angular-v21/src/app/app.ts} +1 -1
  9. package/template-angular-v21/src/app/pages/analog-welcome.ts +264 -0
  10. package/template-angular-v21/src/app/pages/index.page.ts +12 -0
  11. package/{template-angular-v19 → template-angular-v21}/src/main.server.ts +2 -3
  12. package/{template-angular-v19 → template-angular-v21}/src/main.ts +2 -3
  13. package/template-angular-v21/src/server/routes/api/v1/hello.ts +3 -0
  14. package/template-angular-v21/src/styles.css +4 -0
  15. package/template-angular-v21/src/test-setup.ts +7 -0
  16. package/{template-angular-v18 → template-angular-v21}/tsconfig.app.json +1 -2
  17. package/{template-angular-v18 → template-angular-v21}/tsconfig.json +7 -1
  18. package/{template-angular-v18 → template-angular-v21}/tsconfig.spec.json +2 -4
  19. package/{template-angular-v18 → template-angular-v21}/vite.config.ts +2 -5
  20. package/template-blog/package.json +6 -6
  21. package/template-blog/src/app/app.config.ts +1 -2
  22. package/template-latest/package.json +6 -6
  23. package/template-minimal/package.json +6 -6
  24. package/template-angular-v17/README.md +0 -26
  25. package/template-angular-v17/_gitignore +0 -43
  26. package/template-angular-v17/index.html +0 -15
  27. package/template-angular-v17/package.json +0 -54
  28. package/template-angular-v17/src/app/app.component.spec.ts +0 -18
  29. package/template-angular-v17/src/app/app.component.ts +0 -20
  30. package/template-angular-v17/src/app/app.config.server.ts +0 -16
  31. package/template-angular-v17/src/app/app.config.ts +0 -12
  32. package/template-angular-v17/src/app/pages/index.page.ts +0 -46
  33. package/template-angular-v17/src/main.server.ts +0 -26
  34. package/template-angular-v17/src/main.ts +0 -7
  35. package/template-angular-v17/src/server/routes/v1/hello.ts +0 -3
  36. package/template-angular-v17/src/styles.css +0 -75
  37. package/template-angular-v17/src/test.ts +0 -12
  38. package/template-angular-v17/src/vite-env.d.ts +0 -41
  39. package/template-angular-v17/tsconfig.app.json +0 -15
  40. package/template-angular-v17/tsconfig.json +0 -28
  41. package/template-angular-v17/tsconfig.spec.json +0 -13
  42. package/template-angular-v17/vite.config.ts +0 -28
  43. package/template-angular-v18/_gitignore +0 -44
  44. package/template-angular-v18/angular.json +0 -54
  45. package/template-angular-v18/package.json +0 -52
  46. package/template-angular-v18/public/analog.svg +0 -1
  47. package/template-angular-v18/public/favicon.ico +0 -0
  48. package/template-angular-v18/public/vite.svg +0 -1
  49. package/template-angular-v18/src/app/app.component.ts +0 -18
  50. package/template-angular-v18/src/app/app.config.ts +0 -20
  51. package/template-angular-v18/src/app/pages/index.page.ts +0 -55
  52. package/template-angular-v18/src/main.server.ts +0 -32
  53. package/template-angular-v18/src/main.ts +0 -7
  54. package/template-angular-v18/src/server/routes/v1/hello.ts +0 -3
  55. package/template-angular-v18/src/styles.css +0 -80
  56. package/template-angular-v18/src/test-setup.ts +0 -12
  57. package/template-angular-v19/README.md +0 -26
  58. package/template-angular-v19/angular.json +0 -54
  59. package/template-angular-v19/index.html +0 -15
  60. package/template-angular-v19/package.json +0 -53
  61. package/template-angular-v19/public/analog.svg +0 -1
  62. package/template-angular-v19/public/favicon.ico +0 -0
  63. package/template-angular-v19/public/vite.svg +0 -1
  64. package/template-angular-v19/src/app/app.component.spec.ts +0 -20
  65. package/template-angular-v19/src/app/app.config.server.ts +0 -10
  66. package/template-angular-v19/src/app/pages/index.page.ts +0 -54
  67. package/template-angular-v19/src/server/routes/api/v1/hello.ts +0 -3
  68. package/template-angular-v19/src/styles.css +0 -80
  69. package/template-angular-v19/src/test-setup.ts +0 -12
  70. package/template-angular-v19/src/vite-env.d.ts +0 -1
  71. package/template-angular-v19/tsconfig.app.json +0 -15
  72. package/template-angular-v19/tsconfig.json +0 -26
  73. package/template-angular-v19/tsconfig.spec.json +0 -13
  74. package/template-angular-v19/vite.config.ts +0 -27
  75. /package/{template-angular-v18 → template-angular-v21}/README.md +0 -0
  76. /package/{template-angular-v17 → template-angular-v21}/angular.json +0 -0
  77. /package/{template-angular-v18 → template-angular-v21}/index.html +0 -0
  78. /package/{template-angular-v17/src/assets → template-angular-v21/public}/analog.svg +0 -0
  79. /package/{template-angular-v17 → template-angular-v21/public}/favicon.ico +0 -0
  80. /package/{template-angular-v17/src/assets → template-angular-v21/public}/vite.svg +0 -0
  81. /package/{template-angular-v18 → template-angular-v21}/src/app/app.config.server.ts +0 -0
  82. /package/{template-angular-v18 → template-angular-v21}/src/vite-env.d.ts +0 -0
package/index.js CHANGED
@@ -10,7 +10,8 @@ import { fileURLToPath } from 'node:url';
10
10
  import prompts from 'prompts';
11
11
 
12
12
  /**
13
- * @typedef {'latest' | 'blog' | 'minimal'} Template
13
+ * @typedef {'latest' | 'blog' | 'minimal'} StarterTemplate
14
+ * @typedef {StarterTemplate | `angular-v${number}`} Template
14
15
  * @typedef {'prismjs' | 'shiki'} HighlighterId
15
16
  * @typedef {(value: string) => string} Colorizer
16
17
  *
@@ -25,8 +26,7 @@ import prompts from 'prompts';
25
26
  * @property {readonly Variant[]} variants
26
27
  *
27
28
  * @typedef {object} HighlighterConfig
28
- * @property {string} highlighter
29
- * @property {string} entryPoint
29
+ * @property {'prism' | 'shiki'} contentHighlighter
30
30
  * @property {Record<string, string>} dependencies
31
31
  *
32
32
  * @typedef {object} PackageJson
@@ -62,6 +62,7 @@ const DEFAULT_BLOG_HIGHLIGHTER = 'prismjs';
62
62
 
63
63
  /** @type {readonly Template[]} */
64
64
  const H3_TEMPLATES = ['latest', 'blog', 'minimal'];
65
+ const VERSIONED_TEMPLATE = /^angular-v\d+$/;
65
66
 
66
67
  // Avoids autoconversion to number of the project name by defining that the args
67
68
  // non associated with an option ( _ ) needs to be parsed as a string. See #4606
@@ -97,16 +98,14 @@ const APPS = [
97
98
  /** @type {Readonly<Record<HighlighterId, HighlighterConfig>>} */
98
99
  const HIGHLIGHTERS = {
99
100
  prismjs: {
100
- highlighter: 'withPrismHighlighter',
101
- entryPoint: 'prism-highlighter',
101
+ contentHighlighter: 'prism',
102
102
  dependencies: {
103
103
  'marked-highlight': '^2.2.1',
104
104
  prismjs: '^1.29.0',
105
105
  },
106
106
  },
107
107
  shiki: {
108
- highlighter: 'withShikiHighlighter',
109
- entryPoint: 'shiki-highlighter',
108
+ contentHighlighter: 'shiki',
110
109
  dependencies: {
111
110
  marked: '^18.0.0',
112
111
  'marked-shiki': '^1.1.0',
@@ -532,18 +531,13 @@ function addPnpmDependencies(pkg, template) {
532
531
  function ensureSyntaxHighlighter(root, pkg, highlighter) {
533
532
  const config = HIGHLIGHTERS[highlighter];
534
533
 
535
- replacePlaceholders(root, 'src/app/app.config.ts', {
536
- __HIGHLIGHTER__: config.highlighter,
537
- __HIGHLIGHTER_ENTRY_POINT__: config.entryPoint,
538
- });
539
-
540
534
  pkg.dependencies ??= {};
541
535
  for (const [name, version] of Object.entries(config.dependencies)) {
542
536
  pkg.dependencies[name] = version;
543
537
  }
544
538
 
545
539
  replacePlaceholders(root, 'vite.config.ts', {
546
- __CONTENT_HIGHLIGHTER__: highlighter,
540
+ __CONTENT_HIGHLIGHTER__: config.contentHighlighter,
547
541
  });
548
542
  }
549
543
 
@@ -631,7 +625,15 @@ function resolveTemplate(value) {
631
625
  * @returns {value is Template}
632
626
  */
633
627
  function isTemplate(value) {
634
- return value === 'latest' || value === 'blog' || value === 'minimal';
628
+ if (value === 'latest' || value === 'blog' || value === 'minimal') {
629
+ return true;
630
+ }
631
+
632
+ return (
633
+ value !== undefined &&
634
+ VERSIONED_TEMPLATE.test(value) &&
635
+ fs.existsSync(path.join(CLI_DIR, `template-${value}`))
636
+ );
635
637
  }
636
638
 
637
639
  init().catch((error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-analog",
3
- "version": "3.0.0-alpha.94",
3
+ "version": "3.0.0-alpha.96",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Brandon Roberts",
@@ -10,10 +10,8 @@
10
10
  },
11
11
  "files": [
12
12
  "index.js",
13
- "template-angular-v17",
14
- "template-angular-v18",
15
- "template-angular-v19",
16
13
  "template-angular-v20",
14
+ "template-angular-v21",
17
15
  "template-blog",
18
16
  "template-latest",
19
17
  "template-minimal",
@@ -41,9 +39,9 @@
41
39
  "prompts": "^2.4.2"
42
40
  },
43
41
  "devDependencies": {
44
- "@analogjs/platform": "3.0.0-alpha.94",
45
- "@analogjs/vite-plugin-angular": "3.0.0-alpha.94",
46
- "@analogjs/vite-plugin-nitro": "3.0.0-alpha.94",
42
+ "@analogjs/platform": "3.0.0-alpha.96",
43
+ "@analogjs/vite-plugin-angular": "3.0.0-alpha.96",
44
+ "@analogjs/vite-plugin-nitro": "3.0.0-alpha.96",
47
45
  "h3": "^1.15.11"
48
46
  },
49
47
  "publishConfig": {
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "private": true,
18
18
  "dependencies": {
19
- "@analogjs/content": "^3.0.0-alpha.94",
20
- "@analogjs/router": "^3.0.0-alpha.94",
19
+ "@analogjs/content": "^3.0.0-alpha.96",
20
+ "@analogjs/router": "^3.0.0-alpha.96",
21
21
  "@angular/animations": "^20.0.0",
22
22
  "@angular/common": "^20.0.0",
23
23
  "@angular/compiler": "^20.0.0",
@@ -37,9 +37,9 @@
37
37
  "zone.js": "~0.15.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@analogjs/platform": "^3.0.0-alpha.94",
41
- "@analogjs/vite-plugin-angular": "^3.0.0-alpha.94",
42
- "@analogjs/vitest-angular": "^3.0.0-alpha.94",
40
+ "@analogjs/platform": "^3.0.0-alpha.96",
41
+ "@analogjs/vite-plugin-angular": "^3.0.0-alpha.96",
42
+ "@analogjs/vitest-angular": "^3.0.0-alpha.96",
43
43
  "@angular-devkit/build-angular": "^20.0.0",
44
44
  "@angular/build": "^20.0.0",
45
45
  "@angular/cli": "^20.0.0",
@@ -42,3 +42,6 @@ testem.log
42
42
  # System files
43
43
  .DS_Store
44
44
  Thumbs.db
45
+
46
+ # Environment files
47
+ .env*
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "my-app",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "engines": {
6
+ "node": ">=20.19.1"
7
+ },
8
+ "scripts": {
9
+ "ng": "ng",
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"
16
+ },
17
+ "private": true,
18
+ "dependencies": {
19
+ "@analogjs/content": "^3.0.0-alpha.96",
20
+ "@analogjs/router": "^3.0.0-alpha.96",
21
+ "@angular/animations": "^21.0.0",
22
+ "@angular/common": "^21.0.0",
23
+ "@angular/compiler": "^21.0.0",
24
+ "@angular/core": "^21.0.0",
25
+ "@angular/forms": "^21.0.0",
26
+ "@angular/platform-browser": "^21.0.0",
27
+ "@angular/platform-server": "^21.0.0",
28
+ "@angular/router": "^21.0.0",
29
+ "front-matter": "^4.0.2",
30
+ "marked": "^15.0.7",
31
+ "marked-gfm-heading-id": "^4.1.1",
32
+ "marked-highlight": "^2.2.1",
33
+ "marked-mangle": "^1.1.10",
34
+ "prismjs": "^1.29.0",
35
+ "rxjs": "~7.8.0",
36
+ "tslib": "^2.3.0"
37
+ },
38
+ "devDependencies": {
39
+ "@analogjs/platform": "^3.0.0-alpha.96",
40
+ "@analogjs/vite-plugin-angular": "^3.0.0-alpha.96",
41
+ "@analogjs/vitest-angular": "^3.0.0-alpha.96",
42
+ "@angular/build": "^21.0.0",
43
+ "@angular/cli": "^21.0.0",
44
+ "@angular/compiler-cli": "^21.0.0",
45
+ "jsdom": "^22.0.0",
46
+ "typescript": "~5.9.0",
47
+ "vite": "^8.0.0",
48
+ "vite-tsconfig-paths": "^6.1.1",
49
+ "vitest": "^4.1.0"
50
+ },
51
+ "overrides": {
52
+ "vite": "$vite",
53
+ "vitest": "$vitest"
54
+ }
55
+ }
@@ -3,18 +3,21 @@ 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
+ } from '@angular/core';
10
+ import { provideClientHydration, withEventReplay } from '@angular/platform-browser';
8
11
  import { provideFileRouter, requestContextInterceptor } from '@analogjs/router';
9
12
 
10
13
  export const appConfig: ApplicationConfig = {
11
14
  providers: [
12
- provideZoneChangeDetection({ eventCoalescing: true }),
15
+ provideBrowserGlobalErrorListeners(),
13
16
  provideFileRouter(),
14
17
  provideHttpClient(
15
18
  withFetch(),
16
19
  withInterceptors([requestContextInterceptor])
17
20
  ),
18
- provideClientHydration(),
21
+ provideClientHydration(withEventReplay()),
19
22
  ],
20
23
  };
@@ -2,18 +2,18 @@ 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 { App } from './app';
6
6
 
7
- describe('AppComponent', () => {
7
+ describe('App', () => {
8
8
  beforeEach(async () => {
9
9
  await TestBed.configureTestingModule({
10
- imports: [AppComponent],
10
+ imports: [App],
11
11
  providers: [provideRouter([]), provideLocationMocks()],
12
12
  }).compileComponents();
13
13
  });
14
14
 
15
15
  it('should create the app', () => {
16
- const fixture = TestBed.createComponent(AppComponent);
16
+ const fixture = TestBed.createComponent(App);
17
17
  const app = fixture.componentInstance;
18
18
  expect(app).toBeTruthy();
19
19
  });
@@ -14,4 +14,4 @@ import { RouterOutlet } from '@angular/router';
14
14
  }
15
15
  `,
16
16
  })
17
- export class AppComponent {}
17
+ export class App {}
@@ -0,0 +1,264 @@
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
+
261
+ increment() {
262
+ this.count++;
263
+ }
264
+ }
@@ -0,0 +1,12 @@
1
+ import { Component } from '@angular/core';
2
+
3
+ import { AnalogWelcome } from './analog-welcome';
4
+
5
+ @Component({
6
+ selector: 'app-home',
7
+ imports: [AnalogWelcome],
8
+ template: `
9
+ <app-analog-welcome/>
10
+ `,
11
+ })
12
+ export default class Home {}
@@ -1,8 +1,7 @@
1
- import 'zone.js/node';
2
1
  import '@angular/platform-server/init';
3
2
  import { render } from '@analogjs/router/server';
4
3
 
5
- __APP_COMPONENT_IMPORT__
4
+ import { App } from './app/app';
6
5
  import { config } from './app/app.config.server';
7
6
 
8
- export default render(__APP_COMPONENT__, config);
7
+ export default render(App, config);
@@ -1,7 +1,6 @@
1
- import 'zone.js';
2
1
  import { bootstrapApplication } from '@angular/platform-browser';
3
2
 
4
- __APP_COMPONENT_IMPORT__
3
+ import { App } from './app/app';
5
4
  import { appConfig } from './app/app.config';
6
5
 
7
- bootstrapApplication(__APP_COMPONENT__, appConfig);
6
+ bootstrapApplication(App, appConfig);
@@ -0,0 +1,3 @@
1
+ import { defineEventHandler } from 'h3';
2
+
3
+ export default defineEventHandler(() => ({ message: 'Hello World' }));
@@ -0,0 +1,4 @@
1
+ html, body {
2
+ display: block;
3
+ height: 100%;
4
+ }
@@ -0,0 +1,7 @@
1
+ import '@angular/compiler';
2
+ import '@analogjs/vitest-angular/setup-zone';
3
+ import { setupTestBed } from '@analogjs/vitest-angular/setup-testbed';
4
+
5
+ setupTestBed({
6
+ zoneless: false
7
+ });
@@ -3,8 +3,7 @@
3
3
  "extends": "./tsconfig.json",
4
4
  "compilerOptions": {
5
5
  "outDir": "./out-tsc/app",
6
- "types": [],
7
- "rootDir": "./src"
6
+ "types": []
8
7
  },
9
8
  "files": ["src/main.ts", "src/main.server.ts"],
10
9
  "include": [
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "compileOnSave": false,
3
3
  "compilerOptions": {
4
+ "baseUrl": "./",
4
5
  "outDir": "./dist/out-tsc",
5
6
  "forceConsistentCasingInFileNames": true,
6
7
  "strict": true,
@@ -10,8 +11,10 @@
10
11
  "noFallthroughCasesInSwitch": true,
11
12
  "sourceMap": true,
12
13
  "declaration": false,
14
+ "downlevelIteration": true,
13
15
  "experimentalDecorators": true,
14
16
  "moduleResolution": "bundler",
17
+ "isolatedModules": true,
15
18
  "importHelpers": true,
16
19
  "target": "ES2022",
17
20
  "module": "ES2022",
@@ -24,5 +27,8 @@
24
27
  "strictInjectionParameters": true,
25
28
  "strictInputAccessModifiers": true,
26
29
  "strictTemplates": true
27
- }
30
+ },
31
+ "references": [
32
+ { "path": "tsconfig.spec.json" }
33
+ ]
28
34
  }
@@ -3,10 +3,8 @@
3
3
  "extends": "./tsconfig.json",
4
4
  "compilerOptions": {
5
5
  "outDir": "./out-tsc/spec",
6
- "target": "es2016",
7
- "types": ["node", "vitest/globals"],
8
- "rootDir": "./src",
9
- "composite": false
6
+ "target": "es2022",
7
+ "types": ["node", "vitest/globals"]
10
8
  },
11
9
  "files": ["src/test-setup.ts"],
12
10
  "include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
@@ -1,7 +1,7 @@
1
1
  /// <reference types="vitest" />
2
2
 
3
3
  import { defineConfig } from 'vite';
4
- __TAILWIND_IMPORT__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 }) => ({
@@ -12,7 +12,7 @@ export default defineConfig(({ mode }) => ({
12
12
  mainFields: ['module'],
13
13
  },
14
14
  plugins: [
15
- __TAILWIND_PLUGIN__ analog(),
15
+ analog(),__TAILWIND_PLUGIN__
16
16
  ],
17
17
  test: {
18
18
  globals: true,
@@ -21,7 +21,4 @@ __TAILWIND_PLUGIN__ analog(),
21
21
  include: ['**/*.spec.ts'],
22
22
  reporters: ['default'],
23
23
  },
24
- define: {
25
- 'import.meta.vitest': mode !== 'production',
26
- },
27
24
  }));