From 70dd27012c9729179e6e602c0307a0bf7bc44d80 Mon Sep 17 00:00:00 2001 From: ido Date: Mon, 18 Dec 2023 18:26:55 +0200 Subject: [PATCH] fix: context import types --- packages/context/README.md | 2 +- packages/context/context.ts | 5 +++++ packages/context/package.json | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 packages/context/context.ts diff --git a/packages/context/README.md b/packages/context/README.md index 01021ce..4146da2 100644 --- a/packages/context/README.md +++ b/packages/context/README.md @@ -9,7 +9,7 @@ Allow you to add extra props without the need to manually add them every time `layouts/Layout.astro` ```astro --- -import Context from '@astro-utils/context/Context.astro'; +import Context from '@astro-utils/context/context.js'; function consoleIt(){ console.log('Hi'); diff --git a/packages/context/context.ts b/packages/context/context.ts new file mode 100644 index 0000000..14ddd21 --- /dev/null +++ b/packages/context/context.ts @@ -0,0 +1,5 @@ +import Context from './Context.astro'; +import getContext, {asyncContext} from './dist/index'; + +export {getContext, asyncContext}; +export default Context; diff --git a/packages/context/package.json b/packages/context/package.json index 993893f..f1c28f2 100644 --- a/packages/context/package.json +++ b/packages/context/package.json @@ -33,12 +33,14 @@ "dist/*", "README.md", "Context.astro", + "context.ts", "LICENSE" ], "main": "./dist/index.js", "exports": { ".": "./dist/index.js", - "./Context.astro": "./Context.astro" + "./Context.astro": "./Context.astro", + "./context.js": "./context.js" }, "devDependencies": { "astro": "^4.0.6",