Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/smart-ace-designs/astro-moonbase

An opinionated Astro template with built-in support for Vue, shadcn-vue, Tailwind CSS, prettier, and import aliases.
https://github.com/smart-ace-designs/astro-moonbase

astro opinionated template

Last synced: about 2 months ago
JSON representation

An opinionated Astro template with built-in support for Vue, shadcn-vue, Tailwind CSS, prettier, and import aliases.

Awesome Lists containing this project

README

        

# Astro Template: Moon Base

An opinionated Astro starter template with built-in support for Vue, shadcn-vue, Tailwind CSS, Prettier, view transitions, and import aliases.

## Deployment Methods
### bun
```sh
bun create astro@latest -- --template smart-ace-designs/astro-moonbase --typescript strict project-name
```
### npm
```sh
npm create astro@latest -- --template smart-ace-designs/astro-moonbase --typescript strict project-name
```
### PowerShell
Add this function to your PowerShell profile or a PowerShell module:
```powershell
function New-AstroMoonbaseProject
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory = $true)] [string]$ProjectName,
[Parameter(Mandatory = $true)] [string]$Location,
[Parameter(Mandatory = $false)] [switch]$StartCode,
[Parameter(Mandatory = $false)] [switch]$StartApp,
[Parameter(Mandatory = $false)] [ValidateSet("bun", "npm")] [string]$PackageManager = "bun"
)

switch ($PackageManager)
{
"bun" {$PackageManagerX = "bunx"}
"npm" {$PackageManagerX = "npx"}
}

Clear-Host
$Message = "Astro Deployment Tool"
$Width = $Host.UI.RawUI.WindowSize.Width
Write-Host
Write-Host ((" " * ($Width - $Message.Length)) + $Message) -ForegroundColor Green
Write-Host ("=" * $Width)

if (Test-Path -Path "$Location\$ProjectName")
{
Write-Host "`nProject folder ($ProjectName) already exists."
Write-Host "Operation cancelled...liftoff failed!"
return
}

Set-Location $Location
& $PackageManagerX create-astro@latest -- --template smart-ace-designs/astro-moonbase `
--typescript strict --git --no-install $ProjectName

if (!(Test-Path -Path $ProjectName))
{
Write-Host "`nProject folder ($ProjectName) was not created."
Write-Host "Operation cancelled...liftoff failed!"
Write-Host "`nIf using Bun please run `"bun pm cache rm`" to clear the cache and try again."
return
}

Write-Host
Set-Location $ProjectName
switch ($PackageManager)
{
"bun" {& $PackageManager install --no-summary}
"npm" {& $PackageManager install --silent}
}

& $PackageManagerX @astrojs/upgrade
& $PackageManager update --silent --save

[void](New-Item -Name "assets" -Path src -ItemType Directory)
Clear-Content -Path "README.md"

Write-Host
& $PackageManagerX prettier . --write --log-level silent
& $PackageManagerX prettier . --check
if ($StartCode -and (Get-Command code -ErrorAction SilentlyContinue)) {code .}
Write-Host
Write-Host ("=" * $Width)
if ($StartApp) {& $PackageManager run dev}
}
```

## Project Structure

Inside of your Astro project you will see the following folders and files:

```text
/
├── .vscode/
│ └── extensions.json
│ └── launch.json
│ └── settings.json
├── public/
│ └── favicon.svg
├── src/
| ├── components/
│ └── AstroWelcome.astro
| ├── layouts/
│ └── MainLayout.astro
| ├── lib/
│ └── utils.ts
│ ├── pages/
│ └── index.astro
| ├── styles/
│ └── global.css
| └── env.d.ts
├── .gitignore
├── .prettierrc.mjs
├── astro.config.mjs
├── components.json
├── package.json
├── README.md
├── tailwind.config.mjs
└── tsconfig.json
```