Skip to content

Commit

Permalink
Added supported features
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshay committed Sep 26, 2023
1 parent 374f1b9 commit a871a6b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-ravens-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astro-aws/adapter": patch
---

Set supported features
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"cSpell.words": ["astro"],
"eslint.nodePath": ".yarn/sdks",
"files.associations": {
"*.mdx": "markdown"
},
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": ".yarn/sdks/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib"
}
22 changes: 21 additions & 1 deletion packages/adapter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,27 @@ import type { Args } from "./args.js"
import { bundleEntry } from "./shared.js"
import { ADAPTER_NAME } from "./constants.js"
import { warn } from "./log.js"
import { writeFile } from "node:fs/promises"

const getAdapter = (args: Args = {}): AstroAdapter => ({
adapterFeatures: {
edgeMiddleware: false,
functionPerRoute: false,
},
args,
exports: ["handler"],
name: ADAPTER_NAME,
serverEntrypoint: `${ADAPTER_NAME}/lambda/index.js`,
supportedAstroFeatures: {
assets: {
isSharpCompatible: false,
isSquooshCompatible: false,
supportKind: "stable",
},
hybridOutput: "stable",
serverOutput: "stable",
staticOutput: "unsupported",
},
})

const astroAWSFunctions = (args: Args = {}): AstroIntegration => {
Expand Down Expand Up @@ -42,7 +57,12 @@ const astroAWSFunctions = (args: Args = {}): AstroIntegration => {
)
}
},
"astro:build:done": async () => {
"astro:build:done": async (options) => {
await writeFile(
fileURLToPath(new URL("metadata.json", astroConfig.outDir)),
JSON.stringify(options),
)

await bundleEntry(
fileURLToPath(
new URL(astroConfig.build.serverEntry, astroConfig.build.server),
Expand Down

0 comments on commit a871a6b

Please sign in to comment.