#!/usr/bin/env bash # Exit on error set -e # # Get app name from current directory app_name="${PWD##*/}" # Get latest version of Angular CLI npm install -g @angular/cli@latest # Generate angular project ng new $app_name --minimal --strict --routing --ssr=false --style=css --skip-git --skip-install --inline-template=false --standalone --zoneless --ai-config=gemini --directory . # Configure prettier echo '{ "tabWidth": 2, "useTabs": false, "singleQuote": true, "trailingComma": "none", "endOfLine": "lf", "arrowParens": "always", "printWidth": 120 }' > .prettierrc # Configure postcss for tailwind echo '{ "plugins": { "@tailwindcss/postcss": {} } }' > .postcssrc.json # Add Tailwind to CSS echo '@import "tailwindcss";' > src/styles.css # Configure VSCode echo '{ "files.insertFinalNewline": true, "files.trimTrailingWhitespace": true, "editor.formatOnSave": true, "css.validate": false, "files.associations": { "*.css": "tailwindcss" }, "editor.quickSuggestions": { "strings": true }, "tailwindCSS.emmetCompletions": true, "editor.inlineSuggest.enabled": true, "tailwindCSS.includeLanguages": { "plaintext": "html" } }' > .vscode/settings.json # Overwrite the default app.component.html curl -s https://start.workers.rocks/angular/app.html > src/app/app.html # Install tailwindcss (and Angular, that has been skipped in the ng new command) bun i -D tailwindcss @tailwindcss/postcss postcss # Disable Angular CLI analytics jq '.cli.analytics = false' angular.json > tmp.$$.json && mv -f tmp.$$.json angular.json # Add dev scripts to package.json jq '.scripts += { "dev": "ng serve" }' package.json > tmp.$$.json && mv -f tmp.$$.json package.json git init git add . git commit -m "Initial commit"