Skip to content

Commit 3b01231

Browse files
committed
fix: bypass snippets option
1 parent 20f1ab9 commit 3b01231

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

packages/query/fixtures/basic/astro.config.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@ import { defineConfig } from "astro/config";
22
import simpleStackQuery from "simple-stack-query";
33

44
export default defineConfig({
5-
integrations: [simpleStackQuery()],
5+
integrations: [
6+
simpleStackQuery({
7+
bypassSnippetsPrompt: true,
8+
}),
9+
],
610
});

packages/query/src/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@ import { existsSync } from "node:fs";
88

99
type VitePlugin = Required<AstroConfig["vite"]>["plugins"][number];
1010

11-
export default function simpleStackQueryIntegration(): AstroIntegration {
11+
type Options = {
12+
bypassSnippetsPrompt?: boolean;
13+
};
14+
15+
export default function simpleStackQueryIntegration(
16+
opts?: Options,
17+
): AstroIntegration {
1218
let root: URL;
1319
let command: "dev" | "build" | "preview";
1420
return {
1521
name: "simple-stack-query",
1622
hooks: {
1723
"astro:server:start": async () => {
18-
if (command === "dev") {
24+
if (command === "dev" && !opts?.bypassSnippetsPrompt) {
1925
setTimeout(() => {
2026
addSnippets({ root });
2127
}, 100);

0 commit comments

Comments
 (0)