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-space

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

astro opinionated template

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

        

# Astro Template: Space

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

## Deployment Methods
### bun
```sh
bun create astro@latest -- --template smart-ace-designs/astro-space --typescript strict project-name
```
### npm
```sh
npm create astro@latest -- --template smart-ace-designs/astro-space --typescript strict project-name
```
### PowerShell
Add this function to your PowerShell profile or a PowerShell module:
```powershell
function New-AstroSpaceProject
{
[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-space `
--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)
[void](New-Item -Name "components" -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}
}
```
https://github.com/user-attachments/assets/547f884b-69f5-472f-9db7-1998aec54134

## 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/
| ├── layouts/
│ └── MainLayout.astro
│ ├── pages/
│ └── index.astro
| ├── styles/
│ └── styles.css
| └── env.d.ts
├── .gitignore
├── .prettierrc.mjs
├── astro.config.mjs
├── package.json
├── README.md
├── tailwind.config.mjs
└── tsconfig.json
```