Skip to content

Add Astro stack detection and configuration #5

Closed

Description

@admarble

Problem

Astro is a popular meta-framework for static sites, but sequant doesn't detect it during init. Projects using Astro fall back to "generic" stack with no customized commands.

Detection

Astro projects can be identified by:

  • astro.config.mjs, astro.config.js, or astro.config.ts in root
  • "astro" in package.json dependencies

Proposed Configuration

```typescript
{
name: "astro",
displayName: "Astro",
detect: ["astro.config.mjs", "astro.config.js", "astro.config.ts"],
packageJsonKey: "astro",
commands: {
dev: "npm run dev",
build: "npm run build",
test: "npm run test",
lint: "npm run lint"
}
}
```

Acceptance Criteria

  • Auto-detect Astro projects during init
  • Configure appropriate dev/build commands
  • Note in constitution that Astro may not have test/lint by default

Priority

Medium - popular framework with growing adoption.

Activity

  1. admarble commented on Jan 7, 2026

    @admarble
    ContributorAuthor

    📋 Plan Review (Phase 1: /spec)

    AC Checklist with Verification Criteria

    AC-1: Auto-detect Astro projects during init

    Verification Method: Manual Test

    Scenario Given When Then
    Config file detection Directory with astro.config.mjs (or .js/.ts) Run sequant init Detects "Astro" stack
    Package.json fallback package.json with "astro" dep, no config file Run sequant init Detects "Astro" stack

    Assumptions:

    • Astro config files are always in project root
    • Package name is "astro" (not scoped)

    AC-2: Configure appropriate dev/build commands

    Verification Method: Manual Test

    Scenario Expected Result
    Dev command npm run dev
    Build command npm run build
    Variables substituted Templates use correct commands

    Assumptions:

    • Standard npm scripts work for most Astro projects

    AC-3: Note test/lint may not exist by default

    Verification Method: Code Review

    Item Proposed Default
    Test echo 'No test command configured - add vitest or similar'
    Lint npm run lint (common, but may fail if not configured)

    Implementation Plan

    Files to modify:

    1. src/lib/stacks.ts - Add Astro stack definition + detection logic
    2. docs/stacks/astro.md - New documentation file

    Phase 1: Stack Definition

    astro: {
      name: "astro",
      displayName: "Astro",
      detection: {
        files: ["astro.config.mjs", "astro.config.js", "astro.config.ts"],
        packageDeps: ["astro"],
      },
      commands: {
        dev: "npm run dev",
        build: "npm run build",
        test: "echo 'No test command configured'",
        lint: "npm run lint",
      },
      variables: {
        TEST_COMMAND: "npm test",
        BUILD_COMMAND: "npm run build",
        LINT_COMMAND: "npm run lint",
      },
    },

    Phase 2: Detection Logic

    • Add after Next.js detection (both JS frameworks, Next.js more common)
    • Check config files first, then package.json dependency

    Phase 3: Documentation

    • Create docs/stacks/astro.md following nextjs.md pattern

    Open Questions

    Question Recommendation Impact
    Detection priority vs Next.js? After Next.js Low
    Test command behavior? Echo message (like generic) Low

    Effort: ~30-50 lines across 2-3 files


    🤖 Generated with Claude Code

  2. added a commit that references this issue on Jan 7, 2026
    0d68c85
  3. added 2 commits that reference this issue on Jul 15, 2026
  4. added a commit that references this issue on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions