sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.09k stars 126 forks source link

Ion overwrites `astro.config.mjs` #440

Open garysassano opened 1 month ago

garysassano commented 1 month ago
  1. You have an existing Astro project
  2. You execute sst init
  3. astro.config.mjs gets transformed into a broken state

astro.config.mjs (before sst init)

import { defineConfig } from "astro/config";

import preact from "@astrojs/preact";

// https://astro.build/config
export default defineConfig({
  site: "https://example.com",
  integrations: [preact()]
});

astro.config.mjs (after sst init)

import { defineConfig } from "astro/config";
import aws from "astro-sst";

export default defineConfig({
  output: "server",
  adapter: aws(),
});

image

jayair commented 1 month ago

Yeah the sst init command is mostly designed for new projects. But it would be good if we could handle this.

thdxr commented 3 weeks ago

we have a few issues open like this - should we instead print what the user needs to add to the config instead of adding it ourselves?

jayair commented 3 weeks ago

Yeah probably. Maybe just do it automatically for Next.js for now?