Skip to content

Commit

Permalink
Analog component
Browse files Browse the repository at this point in the history
* feat: add component, template, docs, example for AnalogJS

* sync

* sync

* fix: adjust path for nitro.json in dist

* sync

---------

Co-authored-by: Frank <[email protected]>
  • Loading branch information
brandonroberts and fwang committed Sep 21, 2024
1 parent dcf9efd commit 377fb1b
Show file tree
Hide file tree
Showing 37 changed files with 1,283 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/sst/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ func CmdInit(cli *cli.Cli) error {
template = "remix"
break

case slices.ContainsFunc(hints, func(s string) bool { return (strings.HasPrefix(s, "vite.config") && fileContains(s, "@analogjs/platform")) }):
fmt.Println(" Analog detected. This will...")
fmt.Println(" - create an sst.config.ts")
fmt.Println(" - add sst to package.json")
template = "analog"
break

case slices.ContainsFunc(hints, func(s string) bool { return strings.HasPrefix(s, "angular.json") }):
fmt.Println(" Angular detected. This will...")
fmt.Println(" - create an sst.config.ts")
Expand Down
16 changes: 16 additions & 0 deletions examples/aws-analog/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
48 changes: 48 additions & 0 deletions examples/aws-analog/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
/.nx/cache
/.nx/workspace-data
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db

# sst
.sst
.output
4 changes: 4 additions & 0 deletions examples/aws-analog/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
"recommendations": ["angular.ng-template", "analogjs.vscode-analog"]
}
19 changes: 19 additions & 0 deletions examples/aws-analog/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "ng serve",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: start",
"url": "http://localhost:5173/"
},
{
"name": "ng test",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: test"
}
]
}
42 changes: 42 additions & 0 deletions examples/aws-analog/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "start",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "bundle generation complete"
}
}
}
},
{
"type": "npm",
"script": "test",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "bundle generation complete"
}
}
}
}
]
}
26 changes: 26 additions & 0 deletions examples/aws-analog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Analog App

This project was generated with [Analog](https://analogjs.org), the fullstack meta-framework for Angular.

## Setup

Run `npm install` to install the application dependencies.

## Development

Run `npm start` for a dev server. Navigate to `http://localhost:5173/`. The application automatically reloads if you change any of the source files.

## Build

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.

## Test

Run `npm run test` to run unit tests with [Vitest](https://vitest.dev).

## Community

- Visit and Star the [GitHub Repo](https://github.com/analogjs/analog)
- Join the [Discord](https://chat.analogjs.org)
- Follow us on [Twitter](https://twitter.com/analogjs)
- Become a [Sponsor](https://github.com/sponsors/brandonroberts)
54 changes: 54 additions & 0 deletions examples/aws-analog/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"my-app": {
"projectType": "application",
"root": ".",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@analogjs/platform:vite",
"options": {
"configFile": "vite.config.ts",
"main": "src/main.ts",
"outputPath": "dist/client",
"tsConfig": "tsconfig.app.json"
},
"defaultConfiguration": "production",
"configurations": {
"development": {
"mode": "development"
},
"production": {
"sourcemap": false,
"mode": "production"
}
}
},
"serve": {
"builder": "@analogjs/platform:vite-dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "my-app:build",
"port": 5173
},
"configurations": {
"development": {
"buildTarget": "my-app:build:development",
"hmr": true
},
"production": {
"buildTarget": "my-app:build:production"
}
}
},
"test": {
"builder": "@analogjs/vitest-angular:test"
}
}
}
}
}
15 changes: 15 additions & 0 deletions examples/aws-analog/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>My App</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="stylesheet" href="/src/styles.css" />
</head>
<body>
<app-root></app-root>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
53 changes: 53 additions & 0 deletions examples/aws-analog/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "analog-sst",
"version": "0.0.0",
"type": "module",
"engines": {
"node": ">=18.19.1"
},
"scripts": {
"build": "ng build",
"dev": "ng serve",
"ng": "ng",
"start": "npm run dev",
"test": "ng test",
"watch": "ng build --watch --configuration development"
},
"private": true,
"dependencies": {
"@analogjs/content": "^1.7.3",
"@analogjs/router": "^1.7.3",
"@angular/animations": "^18.0.0",
"@angular/build": "^18.0.0",
"@angular/common": "^18.0.0",
"@angular/compiler": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/forms": "^18.0.0",
"@angular/platform-browser": "^18.0.0",
"@angular/platform-browser-dynamic": "^18.0.0",
"@angular/platform-server": "^18.0.0",
"@angular/router": "^18.0.0",
"front-matter": "^4.0.2",
"marked": "^5.0.2",
"marked-gfm-heading-id": "^3.1.0",
"marked-highlight": "^2.0.1",
"marked-mangle": "^1.1.7",
"prismjs": "^1.29.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.3"
},
"devDependencies": {
"@analogjs/platform": "^1.7.3",
"@analogjs/vite-plugin-angular": "^1.7.3",
"@analogjs/vitest-angular": "^1.7.3",
"@angular/cli": "^18.0.0",
"@angular/compiler-cli": "^18.0.0",
"jsdom": "^22.0.0",
"sst": "latest",
"typescript": "~5.4.2",
"vite": "^5.0.0",
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^1.3.1"
}
}
Empty file.
1 change: 1 addition & 0 deletions examples/aws-analog/public/analog.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/aws-analog/public/favicon.ico
Binary file not shown.
Loading

0 comments on commit 377fb1b

Please sign in to comment.