create-analog 1.7.3-beta.2 → 1.7.3-beta.3
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.
- package/index.js +6 -1
- package/package.json +2 -1
- package/template-angular-v16/.vscode/extensions.json +1 -1
- package/template-angular-v16/package.json +5 -5
- package/template-angular-v17/.vscode/extensions.json +1 -1
- package/template-angular-v17/package.json +5 -5
- package/template-blog/.vscode/extensions.json +1 -1
- package/template-blog/package.json +5 -5
- package/template-latest/.vscode/extensions.json +1 -1
- package/template-latest/package.json +5 -5
- package/template-latest/src/app/pages/index.page.ts +7 -4
- package/template-minimal/.editorconfig +16 -0
- package/template-minimal/.vscode/extensions.json +4 -0
- package/template-minimal/.vscode/launch.json +13 -0
- package/template-minimal/.vscode/tasks.json +24 -0
- package/template-minimal/README.md +22 -0
- package/template-minimal/_gitignore +44 -0
- package/template-minimal/angular.json +51 -0
- package/template-minimal/index.html +15 -0
- package/template-minimal/package.json +49 -0
- package/template-minimal/public/.gitkeep +0 -0
- package/template-minimal/public/favicon.ico +0 -0
- package/template-minimal/src/app/app.component.ts +10 -0
- package/template-minimal/src/app/app.config.server.ts +10 -0
- package/template-minimal/src/app/app.config.ts +20 -0
- package/template-minimal/src/app/pages/index.page.ts +28 -0
- package/template-minimal/src/main.server.ts +32 -0
- package/template-minimal/src/main.ts +7 -0
- package/template-minimal/src/styles.css +1 -0
- package/template-minimal/src/vite-env.d.ts +1 -0
- package/template-minimal/tsconfig.app.json +14 -0
- package/template-minimal/tsconfig.json +31 -0
- package/template-minimal/vite.config.ts +23 -0
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// @ts-check
|
|
4
|
-
import { green, red, reset, yellow } from 'kolorist';
|
|
4
|
+
import { blue, green, red, reset, yellow } from 'kolorist';
|
|
5
5
|
import minimist from 'minimist';
|
|
6
6
|
import { execSync } from 'node:child_process';
|
|
7
7
|
import fs, { readdirSync } from 'node:fs';
|
|
@@ -29,6 +29,11 @@ const APPS = [
|
|
|
29
29
|
template: 'blog',
|
|
30
30
|
color: yellow,
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Minimal',
|
|
34
|
+
template: 'minimal',
|
|
35
|
+
color: blue,
|
|
36
|
+
},
|
|
32
37
|
],
|
|
33
38
|
},
|
|
34
39
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-analog",
|
|
3
|
-
"version": "1.7.3-beta.
|
|
3
|
+
"version": "1.7.3-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Brandon Roberts",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"template-angular-v17",
|
|
15
15
|
"template-blog",
|
|
16
16
|
"template-latest",
|
|
17
|
+
"template-minimal",
|
|
17
18
|
"files"
|
|
18
19
|
],
|
|
19
20
|
"main": "index.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"test": "ng test"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@analogjs/content": "^1.7.3-beta.
|
|
19
|
-
"@analogjs/router": "^1.7.3-beta.
|
|
18
|
+
"@analogjs/content": "^1.7.3-beta.3",
|
|
19
|
+
"@analogjs/router": "^1.7.3-beta.3",
|
|
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": "^1.7.3-beta.
|
|
42
|
-
"@analogjs/vite-plugin-angular": "^1.7.3-beta.
|
|
43
|
-
"@analogjs/vitest-angular": "^1.7.3-beta.
|
|
41
|
+
"@analogjs/platform": "^1.7.3-beta.3",
|
|
42
|
+
"@analogjs/vite-plugin-angular": "^1.7.3-beta.3",
|
|
43
|
+
"@analogjs/vitest-angular": "^1.7.3-beta.3",
|
|
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": "^1.7.3-beta.
|
|
19
|
-
"@analogjs/router": "^1.7.3-beta.
|
|
18
|
+
"@analogjs/content": "^1.7.3-beta.3",
|
|
19
|
+
"@analogjs/router": "^1.7.3-beta.3",
|
|
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": "^1.7.3-beta.
|
|
42
|
-
"@analogjs/vite-plugin-angular": "^1.7.3-beta.
|
|
43
|
-
"@analogjs/vitest-angular": "^1.7.3-beta.
|
|
41
|
+
"@analogjs/platform": "^1.7.3-beta.3",
|
|
42
|
+
"@analogjs/vite-plugin-angular": "^1.7.3-beta.3",
|
|
43
|
+
"@analogjs/vitest-angular": "^1.7.3-beta.3",
|
|
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
|
"test": "ng test"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@analogjs/content": "^1.7.3-beta.
|
|
19
|
-
"@analogjs/router": "^1.7.3-beta.
|
|
18
|
+
"@analogjs/content": "^1.7.3-beta.3",
|
|
19
|
+
"@analogjs/router": "^1.7.3-beta.3",
|
|
20
20
|
"@angular/animations": "^18.0.0",
|
|
21
21
|
"@angular/common": "^18.0.0",
|
|
22
22
|
"@angular/compiler": "^18.0.0",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"zone.js": "~0.14.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@analogjs/platform": "^1.7.3-beta.
|
|
39
|
-
"@analogjs/vite-plugin-angular": "^1.7.3-beta.
|
|
40
|
-
"@analogjs/vitest-angular": "^1.7.3-beta.
|
|
38
|
+
"@analogjs/platform": "^1.7.3-beta.3",
|
|
39
|
+
"@analogjs/vite-plugin-angular": "^1.7.3-beta.3",
|
|
40
|
+
"@analogjs/vitest-angular": "^1.7.3-beta.3",
|
|
41
41
|
"@angular-devkit/build-angular": "^18.0.0",
|
|
42
42
|
"@angular/cli": "^18.0.0",
|
|
43
43
|
"@angular/compiler-cli": "^18.0.0",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"private": true,
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@analogjs/content": "^1.7.3-beta.
|
|
19
|
-
"@analogjs/router": "^1.7.3-beta.
|
|
18
|
+
"@analogjs/content": "^1.7.3-beta.3",
|
|
19
|
+
"@analogjs/router": "^1.7.3-beta.3",
|
|
20
20
|
"@angular/animations": "^18.0.0",
|
|
21
21
|
"@angular/common": "^18.0.0",
|
|
22
22
|
"@angular/compiler": "^18.0.0",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"zone.js": "~0.14.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@analogjs/platform": "^1.7.3-beta.
|
|
41
|
-
"@analogjs/vite-plugin-angular": "^1.7.3-beta.
|
|
42
|
-
"@analogjs/vitest-angular": "^1.7.3-beta.
|
|
40
|
+
"@analogjs/platform": "^1.7.3-beta.3",
|
|
41
|
+
"@analogjs/vite-plugin-angular": "^1.7.3-beta.3",
|
|
42
|
+
"@analogjs/vitest-angular": "^1.7.3-beta.3",
|
|
43
43
|
"@angular-devkit/build-angular": "^18.0.0",
|
|
44
44
|
"@angular/cli": "^18.0.0",
|
|
45
45
|
"@angular/compiler-cli": "^18.0.0",
|
|
@@ -19,8 +19,11 @@ import { Component, signal } from '@angular/core';
|
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
21
|
<p class="read-the-docs">
|
|
22
|
-
|
|
23
|
-
<a href="https://analogjs
|
|
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</a
|
|
26
|
+
>
|
|
24
27
|
</p>
|
|
25
28
|
`,
|
|
26
29
|
styles: [
|
|
@@ -31,8 +34,8 @@ import { Component, signal } from '@angular/core';
|
|
|
31
34
|
.logo:hover {
|
|
32
35
|
filter: drop-shadow(0 0 2em #646cffaa);
|
|
33
36
|
}
|
|
34
|
-
.read-the-docs {
|
|
35
|
-
color: #
|
|
37
|
+
.read-the-docs > * {
|
|
38
|
+
color: #fff;
|
|
36
39
|
}
|
|
37
40
|
`,
|
|
38
41
|
],
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Editor configuration, see https://editorconfig.org
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 2
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
|
|
11
|
+
[*.ts]
|
|
12
|
+
quote_type = single
|
|
13
|
+
|
|
14
|
+
[*.md]
|
|
15
|
+
max_line_length = off
|
|
16
|
+
trim_trailing_whitespace = false
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"configurations": [
|
|
5
|
+
{
|
|
6
|
+
"name": "ng serve",
|
|
7
|
+
"type": "chrome",
|
|
8
|
+
"request": "launch",
|
|
9
|
+
"preLaunchTask": "npm: start",
|
|
10
|
+
"url": "http://localhost:5173/"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"tasks": [
|
|
5
|
+
{
|
|
6
|
+
"type": "npm",
|
|
7
|
+
"script": "start",
|
|
8
|
+
"isBackground": true,
|
|
9
|
+
"problemMatcher": {
|
|
10
|
+
"owner": "typescript",
|
|
11
|
+
"pattern": "$tsc",
|
|
12
|
+
"background": {
|
|
13
|
+
"activeOnStart": true,
|
|
14
|
+
"beginsPattern": {
|
|
15
|
+
"regexp": "(.*?)"
|
|
16
|
+
},
|
|
17
|
+
"endsPattern": {
|
|
18
|
+
"regexp": "bundle generation complete"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Analog App
|
|
2
|
+
|
|
3
|
+
This project was generated with [Analog](https://analogjs.org), the fullstack meta-framework for Angular.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
Run `npm install` to install the application dependencies.
|
|
8
|
+
|
|
9
|
+
## Development
|
|
10
|
+
|
|
11
|
+
Run `npm start` for a dev server. Navigate to `http://localhost:5173/`. The application automatically reloads if you change any of the source files.
|
|
12
|
+
|
|
13
|
+
## Build
|
|
14
|
+
|
|
15
|
+
Run `npm run build` to build the client/server project. The client build artifacts are located in the `dist/analog/public` directory. The server for the API build artifacts are located in the `dist/analog/server` directory.
|
|
16
|
+
|
|
17
|
+
## Community
|
|
18
|
+
|
|
19
|
+
- Visit and Star the [GitHub Repo](https://github.com/analogjs/analog)
|
|
20
|
+
- Join the [Discord](https://chat.analogjs.org)
|
|
21
|
+
- Follow us on [Twitter](https://twitter.com/analogjs)
|
|
22
|
+
- Become a [Sponsor](https://github.com/sponsors/brandonroberts)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Compiled output
|
|
4
|
+
/dist
|
|
5
|
+
/tmp
|
|
6
|
+
/out-tsc
|
|
7
|
+
/bazel-out
|
|
8
|
+
|
|
9
|
+
# Node
|
|
10
|
+
/node_modules
|
|
11
|
+
npm-debug.log
|
|
12
|
+
yarn-error.log
|
|
13
|
+
|
|
14
|
+
# IDEs and editors
|
|
15
|
+
.idea/
|
|
16
|
+
.project
|
|
17
|
+
.classpath
|
|
18
|
+
.c9/
|
|
19
|
+
*.launch
|
|
20
|
+
.settings/
|
|
21
|
+
*.sublime-workspace
|
|
22
|
+
|
|
23
|
+
# Visual Studio Code
|
|
24
|
+
.vscode/*
|
|
25
|
+
!.vscode/settings.json
|
|
26
|
+
!.vscode/tasks.json
|
|
27
|
+
!.vscode/launch.json
|
|
28
|
+
!.vscode/extensions.json
|
|
29
|
+
.history/*
|
|
30
|
+
|
|
31
|
+
# Miscellaneous
|
|
32
|
+
/.angular/cache
|
|
33
|
+
/.nx/cache
|
|
34
|
+
/.nx/workspace-data
|
|
35
|
+
.sass-cache/
|
|
36
|
+
/connect.lock
|
|
37
|
+
/coverage
|
|
38
|
+
/libpeerconnection.log
|
|
39
|
+
testem.log
|
|
40
|
+
/typings
|
|
41
|
+
|
|
42
|
+
# System files
|
|
43
|
+
.DS_Store
|
|
44
|
+
Thumbs.db
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"newProjectRoot": "projects",
|
|
5
|
+
"projects": {
|
|
6
|
+
"my-app": {
|
|
7
|
+
"projectType": "application",
|
|
8
|
+
"root": ".",
|
|
9
|
+
"sourceRoot": "src",
|
|
10
|
+
"prefix": "app",
|
|
11
|
+
"architect": {
|
|
12
|
+
"build": {
|
|
13
|
+
"builder": "@analogjs/platform:vite",
|
|
14
|
+
"options": {
|
|
15
|
+
"configFile": "vite.config.ts",
|
|
16
|
+
"main": "src/main.ts",
|
|
17
|
+
"outputPath": "dist/client",
|
|
18
|
+
"tsConfig": "tsconfig.app.json"
|
|
19
|
+
},
|
|
20
|
+
"defaultConfiguration": "production",
|
|
21
|
+
"configurations": {
|
|
22
|
+
"development": {
|
|
23
|
+
"mode": "development"
|
|
24
|
+
},
|
|
25
|
+
"production": {
|
|
26
|
+
"sourcemap": false,
|
|
27
|
+
"mode": "production"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"serve": {
|
|
32
|
+
"builder": "@analogjs/platform:vite-dev-server",
|
|
33
|
+
"defaultConfiguration": "development",
|
|
34
|
+
"options": {
|
|
35
|
+
"buildTarget": "my-app:build",
|
|
36
|
+
"port": 5173
|
|
37
|
+
},
|
|
38
|
+
"configurations": {
|
|
39
|
+
"development": {
|
|
40
|
+
"buildTarget": "my-app:build:development",
|
|
41
|
+
"hmr": true
|
|
42
|
+
},
|
|
43
|
+
"production": {
|
|
44
|
+
"buildTarget": "my-app:build:production"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>My App</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
|
+
<app-root></app-root>
|
|
13
|
+
<script type="module" src="/src/main.ts"></script>
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-app",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=18.19.1"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
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"
|
|
15
|
+
},
|
|
16
|
+
"private": true,
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@analogjs/content": "^1.7.3-beta.1",
|
|
19
|
+
"@analogjs/router": "^1.7.3-beta.1",
|
|
20
|
+
"@angular/animations": "^18.0.0",
|
|
21
|
+
"@angular/common": "^18.0.0",
|
|
22
|
+
"@angular/compiler": "^18.0.0",
|
|
23
|
+
"@angular/core": "^18.0.0",
|
|
24
|
+
"@angular/forms": "^18.0.0",
|
|
25
|
+
"@angular/platform-browser": "^18.0.0",
|
|
26
|
+
"@angular/platform-browser-dynamic": "^18.0.0",
|
|
27
|
+
"@angular/platform-server": "^18.0.0",
|
|
28
|
+
"@angular/router": "^18.0.0",
|
|
29
|
+
"front-matter": "^4.0.2",
|
|
30
|
+
"marked": "^5.0.2",
|
|
31
|
+
"marked-gfm-heading-id": "^3.1.0",
|
|
32
|
+
"marked-highlight": "^2.0.1",
|
|
33
|
+
"marked-mangle": "^1.1.7",
|
|
34
|
+
"prismjs": "^1.29.0",
|
|
35
|
+
"rxjs": "~7.8.0",
|
|
36
|
+
"tslib": "^2.3.0",
|
|
37
|
+
"zone.js": "~0.14.3"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@analogjs/platform": "^1.7.3-beta.1",
|
|
41
|
+
"@analogjs/vite-plugin-angular": "^1.7.3-beta.1",
|
|
42
|
+
"@analogjs/vitest-angular": "^1.7.3-beta.1",
|
|
43
|
+
"@angular-devkit/build-angular": "^18.0.0",
|
|
44
|
+
"@angular/cli": "^18.0.0",
|
|
45
|
+
"@angular/compiler-cli": "^18.0.0",
|
|
46
|
+
"typescript": "~5.4.2",
|
|
47
|
+
"vite": "^5.0.0"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
})
|
|
10
|
+
export class AppComponent {}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
|
|
2
|
+
import { provideServerRendering } from '@angular/platform-server';
|
|
3
|
+
|
|
4
|
+
import { appConfig } from './app.config';
|
|
5
|
+
|
|
6
|
+
const serverConfig: ApplicationConfig = {
|
|
7
|
+
providers: [provideServerRendering()],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const config = mergeApplicationConfig(appConfig, serverConfig);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
provideHttpClient,
|
|
3
|
+
withFetch,
|
|
4
|
+
withInterceptors,
|
|
5
|
+
} from '@angular/common/http';
|
|
6
|
+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
|
|
7
|
+
import { provideClientHydration } from '@angular/platform-browser';
|
|
8
|
+
import { provideFileRouter, requestContextInterceptor } from '@analogjs/router';
|
|
9
|
+
|
|
10
|
+
export const appConfig: ApplicationConfig = {
|
|
11
|
+
providers: [
|
|
12
|
+
provideZoneChangeDetection({ eventCoalescing: true }),
|
|
13
|
+
provideFileRouter(),
|
|
14
|
+
provideHttpClient(
|
|
15
|
+
withFetch(),
|
|
16
|
+
withInterceptors([requestContextInterceptor])
|
|
17
|
+
),
|
|
18
|
+
provideClientHydration(),
|
|
19
|
+
],
|
|
20
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-home',
|
|
5
|
+
standalone: true,
|
|
6
|
+
template: `
|
|
7
|
+
<h2>Analog</h2>
|
|
8
|
+
|
|
9
|
+
<h3>The fullstack meta-framework for Angular!</h3>
|
|
10
|
+
|
|
11
|
+
<p>
|
|
12
|
+
<a href="https://analogjs.org" target="_blank">Docs</a> |
|
|
13
|
+
<a href="https://github.com/analogjs/analog" target="_blank">GitHub</a> |
|
|
14
|
+
<a href="https://github.com/sponsors/brandonroberts" target="_blank"
|
|
15
|
+
>Sponsor</a
|
|
16
|
+
>
|
|
17
|
+
</p>
|
|
18
|
+
`,
|
|
19
|
+
styles: `
|
|
20
|
+
:host {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
align-items: center;
|
|
25
|
+
}
|
|
26
|
+
`,
|
|
27
|
+
})
|
|
28
|
+
export default class HomeComponent {}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import 'zone.js/node';
|
|
2
|
+
import '@angular/platform-server/init';
|
|
3
|
+
import { enableProdMode } from '@angular/core';
|
|
4
|
+
import { bootstrapApplication } from '@angular/platform-browser';
|
|
5
|
+
import { renderApplication } from '@angular/platform-server';
|
|
6
|
+
import { provideServerContext } from '@analogjs/router/server';
|
|
7
|
+
import { ServerContext } from '@analogjs/router/tokens';
|
|
8
|
+
|
|
9
|
+
import { config } from './app/app.config.server';
|
|
10
|
+
import { AppComponent } from './app/app.component';
|
|
11
|
+
|
|
12
|
+
if (import.meta.env.PROD) {
|
|
13
|
+
enableProdMode();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function bootstrap() {
|
|
17
|
+
return bootstrapApplication(AppComponent, config);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default async function render(
|
|
21
|
+
url: string,
|
|
22
|
+
document: string,
|
|
23
|
+
serverContext: ServerContext
|
|
24
|
+
) {
|
|
25
|
+
const html = await renderApplication(bootstrap, {
|
|
26
|
+
document,
|
|
27
|
+
url,
|
|
28
|
+
platformProviders: [provideServerContext(serverContext)],
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return html;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* You can add global styles to this file, and also import other style files */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "./tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "./out-tsc/app",
|
|
6
|
+
"types": []
|
|
7
|
+
},
|
|
8
|
+
"files": ["src/main.ts", "src/main.server.ts"],
|
|
9
|
+
"include": [
|
|
10
|
+
"src/**/*.d.ts",
|
|
11
|
+
"src/app/pages/**/*.page.ts",
|
|
12
|
+
"src/server/middleware/**/*.ts"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"compileOnSave": false,
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"baseUrl": "./",
|
|
6
|
+
"outDir": "./dist/out-tsc",
|
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noImplicitOverride": true,
|
|
10
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
11
|
+
"noImplicitReturns": true,
|
|
12
|
+
"noFallthroughCasesInSwitch": true,
|
|
13
|
+
"sourceMap": true,
|
|
14
|
+
"declaration": false,
|
|
15
|
+
"downlevelIteration": true,
|
|
16
|
+
"experimentalDecorators": true,
|
|
17
|
+
"moduleResolution": "node",
|
|
18
|
+
"importHelpers": true,
|
|
19
|
+
"target": "ES2022",
|
|
20
|
+
"module": "ES2022",
|
|
21
|
+
"lib": ["ES2022", "dom"],
|
|
22
|
+
"useDefineForClassFields": false,
|
|
23
|
+
"skipLibCheck": true
|
|
24
|
+
},
|
|
25
|
+
"angularCompilerOptions": {
|
|
26
|
+
"enableI18nLegacyMessageIdFormat": false,
|
|
27
|
+
"strictInjectionParameters": true,
|
|
28
|
+
"strictInputAccessModifiers": true,
|
|
29
|
+
"strictTemplates": true
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="vitest" />
|
|
2
|
+
|
|
3
|
+
import { defineConfig } from 'vite';
|
|
4
|
+
import analog from '@analogjs/platform';
|
|
5
|
+
|
|
6
|
+
// https://vitejs.dev/config/
|
|
7
|
+
export default defineConfig(({ mode }) => ({
|
|
8
|
+
build: {
|
|
9
|
+
target: ['es2020'],
|
|
10
|
+
},
|
|
11
|
+
resolve: {
|
|
12
|
+
mainFields: ['module'],
|
|
13
|
+
},
|
|
14
|
+
plugins: [
|
|
15
|
+
analog({
|
|
16
|
+
ssr: false,
|
|
17
|
+
static: true,
|
|
18
|
+
prerender: {
|
|
19
|
+
routes: [],
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
}));
|