Skip to content

Commit

Permalink
feat: migrate to analogjs
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-ub committed Jul 24, 2024
1 parent 1118eb9 commit b1b9c0e
Show file tree
Hide file tree
Showing 63 changed files with 8,218 additions and 1,501 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
35 changes: 35 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
}
]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ Thumbs.db

.nx/cache
.nx/workspace-data

.angular
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Add files here to ignore them from prettier formatting
/dist
/coverage
/.nx/cache
/.nx/workspace-data
.angular
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
5 changes: 1 addition & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"recommendations": [

"nrwl.angular-console"
]
"recommendations": ["nrwl.angular-console", "esbenp.prettier-vscode"]
}
36 changes: 36 additions & 0 deletions apps/www/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": [
"plugin:@nx/nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "Www",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "www",
"style": "kebab-case"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@nx/nx/angular-template"],
"rules": {}
}
]
}
22 changes: 1 addition & 21 deletions apps/www/.gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
public/registry
4 changes: 0 additions & 4 deletions apps/www/.vscode/extensions.json

This file was deleted.

11 changes: 0 additions & 11 deletions apps/www/.vscode/launch.json

This file was deleted.

35 changes: 0 additions & 35 deletions apps/www/astro.config.mjs

This file was deleted.

41 changes: 41 additions & 0 deletions apps/www/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>shadcn-ng</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" />
<script>
if (localStorage.theme !== 'default') {
if (document && document.body) {
document.body.classList.add('theme-' + localStorage.theme);
}
}
if (localStorage.darkMode === 'dark') {
if (document && document.documentElement) {
document.documentElement.classList.add('dark');
}
} else if (localStorage.darkMode === 'light') {
if (document && document.documentElement) {
document.documentElement.classList.remove('dark');
localStorage.setItem('darkMode', 'light');
}
} else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
localStorage.setItem('darkMode', 'system');
if (document && document.documentElement) {
document.documentElement.classList.add('dark');
}
} else {
if (document && document.documentElement) {
document.documentElement.classList.remove('dark');
}
}
</script>
</head>
<body class="min-h-screen bg-background font-sans antialiased">
<www-root></www-root>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
61 changes: 28 additions & 33 deletions apps/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,40 @@
"type": "module",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@analogjs/astro-angular": "^1.6.3",
"@angular-devkit/build-angular": "^18.1.1",
"@angular/animations": "^18.1.1",
"@angular/cdk": "^18.1.1",
"@angular/common": "^18.1.1",
"@angular/compiler": "^18.1.1",
"@angular/compiler-cli": "^18.1.1",
"@angular/core": "^18.1.1",
"@angular/language-service": "^18.1.1",
"@angular/platform-browser": "^18.1.1",
"@angular/platform-browser-dynamic": "^18.1.1",
"@angular/platform-server": "^18.1.1",
"@astrojs/check": "^0.8.2",
"@astrojs/starlight": "^0.25.2",
"@astrojs/starlight-tailwind": "^2.0.3",
"@astrojs/tailwind": "^5.1.0",
"@radix-ng/primitives": "^0.8.2",
"astro": "^4.12.2",
"@analogjs/content": "^1.3.0",
"@analogjs/router": "^1.3.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"front-matter": "^4.0.2",
"fs": "0.0.1-security",
"lodash.template": "^4.5.0",
"lucide-angular": "^0.414.0",
"rxjs": "^7.8.1",
"sharp": "^0.32.5",
"marked": "^7.0.0",
"marked-gfm-heading-id": "^3.1.0",
"marked-highlight": "^2.0.1",
"marked-mangle": "^1.1.7",
"marked-shiki": "^1.1.0",
"os": "^0.1.2",
"path": "^0.12.7",
"process": "^0.11.10",
"rimraf": "^6.0.1",
"shiki": "^1.6.1",
"tailwind-merge": "^2.4.0",
"tailwindcss": "^3.4.4",
"tslib": "^2.6.3",
"typescript": "^5.5.3",
"zone.js": "^0.14.8"
"tailwindcss-animate": "^1.0.7",
"ts-morph": "^18.0.0",
"zod": "^3.20.2"
},
"devDependencies": {
"@types/lodash.template": "^4.5.1"
"@analogjs/platform": "^1.3.0",
"@analogjs/vite-plugin-angular": "^1.3.0",
"@types/node": "^20.14.12",
"autoprefixer": "^10.4.0",
"jsdom": "^22.1.0",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.2",
"typescript": "~5.4.2",
"vite": "^5.0.0",
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^1.3.1"
}
}
10 changes: 10 additions & 0 deletions apps/www/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { join } = require("node:path");

module.exports = {
plugins: {
tailwindcss: {
config: join(__dirname, "tailwind.config.cjs"),
},
autoprefixer: {},
},
};
63 changes: 63 additions & 0 deletions apps/www/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"name": "www",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"targets": {
"build-registry": {
"executor": "nx:run-commands",
"options": {
"cwd": "apps/www",
"command": "tsx --tsconfig tsconfig.scripts.json scripts/build-registry.mts"
}
},
"build": {
"executor": "@analogjs/platform:vite",
"defaultConfiguration": "production",
"configurations": {
"development": {
"mode": "development"
},
"production": {
"sourcemap": false,
"mode": "production"
}
},
"outputs": [
"{options.outputPath}",
"{workspaceRoot}/dist/apps/www/.nitro",
"{workspaceRoot}/dist/apps/www/ssr",
"{workspaceRoot}/dist/apps/www/analog"
],
"options": {
"main": "apps/www/src/main.ts",
"configFile": "apps/www/vite.config.ts",
"outputPath": "dist/apps/www/client",
"tsConfig": "apps/www/tsconfig.app.json"
},
"dependsOn": ["build-registry"]
},
"serve": {
"executor": "@analogjs/platform:vite-dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "www:build",
"port": 4321
},
"configurations": {
"development": {
"buildTarget": "www:build:development",
"hmr": true
},
"production": {
"buildTarget": "www:build:production"
}
}
},
"test": {
"executor": "@analogjs/vitest-angular:test",
"outputs": ["{projectRoot}/coverage"]
}
},
"tags": [],
"sourceRoot": "./apps/www/src"
}
Empty file added apps/www/public/.gitkeep
Empty file.
Binary file added apps/www/public/favicon.ico
Binary file not shown.
Binary file removed apps/www/public/og.jpg
Binary file not shown.
Loading

0 comments on commit b1b9c0e

Please sign in to comment.