Skip to content

Commit 6f3b728

Browse files
committed
feat(analog): add new Analog app scaffold with fonts, assets, and dev config
- Add complete apps/analog application scaffold (AnalogJS + Angular + Vite) - Project files: angular.json, package.json, vite.config.ts, tsconfig* and editor configs - Dev scripts and VS Code helpers: .vscode/launch.json, tasks.json, extensions.json - Root app and pages: src/main.ts, src/main.server.ts, src/app/* (AppComponent, app config, pages) - Server route example: src/server/routes/api/v1/hello.ts - Testing setup: vitest config, src/test-setup.ts, App unit spec - Styles, fonts integration and Tailwind glue: src/styles.css, fonts.ts - Assets and public files: index.html, favicon.ico, SVG logos, fonts, fonts.css, font-preloads.html, public placeholders - README and .gitignore - Add font assets and preloads - Include Inter and Roboto Mono woff2 files under public/assets/fonts - Provide fonts.css with @font-face rules and CSS variables - Add font preload partial (font-preloads.html) and reference in index.html - Add Angular + Analog app configuration - provideBrowserGlobalErrorListeners, Zone change detection, file router, http client, client hydration - server rendering config (app.config.server.ts) - bootstrapApplication entry points for browser and server - Add simple interactive demo page - Analog welcome component with interactive counter (AnalogWelcome) - Home page that renders the welcome component - Add build/dev/test config - Vite config includes analog platform plugin, Tailwind integration and angular-fonts plugin - Vitest setup for unit tests (jsdom environment, setup files) chore(fonts): add font package utilities for discovery & injection - New package helper modules (packages/font/src/lib/core) - file-discovery.ts: locate styles, tailwind config, fonts.ts, and index.html in common locations - injection-utils.ts: idempotent utilities to inject font CSS links, preload tags, and Tailwind theme/font configs into project files - Utilities include Tailwind v3/v4 injection strategies and index.html font section handling Why: - Provide a fully configured AnalogJS + Angular starter with fonts, Tailwind and Vite for local development and SSR. - Add tooling to programmatically inject font references and Tailwind helpers to user projects.
1 parent 8475303 commit 6f3b728

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4635
-82
lines changed

apps/analog/.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

apps/analog/.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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
45+
46+
# Environment files
47+
.env*
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3+
"recommendations": ["angular.ng-template", "analogjs.vscode-analog", "vitest.explorer"]
4+
}

apps/analog/.vscode/launch.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
"name": "ng test",
14+
"type": "chrome",
15+
"request": "launch",
16+
"preLaunchTask": "npm: test"
17+
}
18+
]
19+
}

apps/analog/.vscode/tasks.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
"type": "npm",
25+
"script": "test",
26+
"isBackground": true,
27+
"problemMatcher": {
28+
"owner": "typescript",
29+
"pattern": "$tsc",
30+
"background": {
31+
"activeOnStart": true,
32+
"beginsPattern": {
33+
"regexp": "(.*?)"
34+
},
35+
"endsPattern": {
36+
"regexp": "bundle generation complete"
37+
}
38+
}
39+
}
40+
}
41+
]
42+
}

apps/analog/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# analog
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+
## Test
18+
19+
Run `npm run test` to run unit tests with [Vitest](https://vitest.dev).
20+
21+
## Community
22+
23+
- Visit and Star the [GitHub Repo](https://github.com/analogjs/analog)
24+
- Join the [Discord](https://chat.analogjs.org)
25+
- Follow us on [Twitter](https://twitter.com/analogjs)
26+
- Become a [Sponsor](https://github.com/sponsors/brandonroberts)

apps/analog/angular.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"analog": {
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": "analog:build",
36+
"port": 5173
37+
},
38+
"configurations": {
39+
"development": {
40+
"buildTarget": "analog:build:development",
41+
"hmr": true
42+
},
43+
"production": {
44+
"buildTarget": "analog:build:production"
45+
}
46+
}
47+
},
48+
"test": {
49+
"builder": "@analogjs/vitest-angular:test"
50+
}
51+
}
52+
}
53+
}
54+
}

apps/analog/index.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>analog</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+
<!-- Font CSS -->
11+
<link rel="stylesheet" href="assets/fonts.css">
12+
<!-- End Font CSS -->
13+
<!-- Font Preloads -->
14+
<link rel="preload" href="/assets/fonts/inter/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2" as="font" type="font/woff2" crossorigin="anonymous">
15+
<link rel="preload" href="/assets/fonts/roboto-mono/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_ROW4AJi8SJQt.woff2" as="font" type="font/woff2" crossorigin="anonymous">
16+
<!-- End Font Preloads -->
17+
</head>
18+
<body>
19+
<app-root></app-root>
20+
<script type="module" src="/src/main.ts"></script>
21+
</body>
22+
</html>

apps/analog/package.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "analog",
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": "pnpm run dev",
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": "^1.22.1",
20+
"@analogjs/router": "^1.22.1",
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+
"@tailwindcss/vite": "^4.1.4",
30+
"postcss": "^8.5.3",
31+
"rxjs": "~7.8.0",
32+
"tailwindcss": "^4.1.4",
33+
"tslib": "^2.3.0",
34+
"zone.js": "~0.15.0"
35+
},
36+
"devDependencies": {
37+
"@analogjs/platform": "^1.22.1",
38+
"angular-fonts": "workspace:*",
39+
"@analogjs/vite-plugin-angular": "^1.22.1",
40+
"@analogjs/vitest-angular": "^1.22.1",
41+
"@angular/build": "^20.0.0",
42+
"@angular/cli": "^20.0.0",
43+
"@angular/compiler-cli": "^20.0.0",
44+
"jsdom": "^22.0.0",
45+
"typescript": "~5.8.0",
46+
"vite": "^7.0.0",
47+
"vite-tsconfig-paths": "^4.2.0",
48+
"vitest": "^4.0.0"
49+
},
50+
"overrides": {
51+
"vitest": "$vitest"
52+
}
53+
}

apps/analog/public/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)