diff --git a/packages/astro/package.json b/packages/astro/package.json index 0641405f86..7dad97ca3e 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -53,7 +53,7 @@ "./client/*": "./dist/runtime/client/*", "./components": "./components/index.ts", "./components/*": "./components/*", - "./integration": "./integrations/index.js", + "./integration": "./dist/integrations/index.js", "./toolbar": "./dist/toolbar/index.js", "./assets": "./dist/assets/index.js", "./assets/utils": "./dist/assets/utils/index.js", diff --git a/packages/db/test/fixtures/integration-only/integration/index.ts b/packages/db/test/fixtures/integration-only/integration/index.ts index 10e7246f68..431a1e935a 100644 --- a/packages/db/test/fixtures/integration-only/integration/index.ts +++ b/packages/db/test/fixtures/integration-only/integration/index.ts @@ -1,14 +1,16 @@ -import type { AstroIntegration } from "astro" +import {} from "astro" +import { defineIntegration } from "astro/integration" import type { AstroDbHooks } from "@astrojs/db/types" declare module "astro" { interface AstroIntegrationHooks extends AstroDbHooks {} } -export default function testIntegration(): AstroIntegration { - return { - name: 'db-test-integration', - hooks: { +export default defineIntegration({ + name: "db-test-integration", + setup() { + return { + hooks: { 'astro:db:setup': ({ extendDb }) => { extendDb({ configEntrypoint: './integration/config.ts', @@ -16,5 +18,6 @@ export default function testIntegration(): AstroIntegration { }); }, }, - }; -} + } + } +}) diff --git a/packages/db/test/fixtures/integrations/integration/index.ts b/packages/db/test/fixtures/integrations/integration/index.ts index 10e7246f68..431a1e935a 100644 --- a/packages/db/test/fixtures/integrations/integration/index.ts +++ b/packages/db/test/fixtures/integrations/integration/index.ts @@ -1,14 +1,16 @@ -import type { AstroIntegration } from "astro" +import {} from "astro" +import { defineIntegration } from "astro/integration" import type { AstroDbHooks } from "@astrojs/db/types" declare module "astro" { interface AstroIntegrationHooks extends AstroDbHooks {} } -export default function testIntegration(): AstroIntegration { - return { - name: 'db-test-integration', - hooks: { +export default defineIntegration({ + name: "db-test-integration", + setup() { + return { + hooks: { 'astro:db:setup': ({ extendDb }) => { extendDb({ configEntrypoint: './integration/config.ts', @@ -16,5 +18,6 @@ export default function testIntegration(): AstroIntegration { }); }, }, - }; -} + } + } +})