Skip to content

Commit

Permalink
fix: use flatted to stringify circular JSON (#122)
Browse files Browse the repository at this point in the history
closes #121
  • Loading branch information
mseele authored Jan 30, 2024
1 parent 3ead88c commit 66111f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"@astrojs/webapi": "^2.2.0",
"@middy/core": "^5.0.1",
"esbuild": "^0.19.5",
"flatted": "^3.2.9",
"http-status-codes": "^2.3.0",
"merge-anything": "^5.1.7",
"pino": "^8.16.2"
Expand Down
4 changes: 3 additions & 1 deletion packages/adapter/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { fileURLToPath } from "node:url"
import { writeFile } from "node:fs/promises"

import { stringify } from "flatted"

import type { AstroAdapter, AstroConfig, AstroIntegration } from "astro"

import type { Args } from "./args.js"
Expand Down Expand Up @@ -77,7 +79,7 @@ const astroAWSFunctions = (args: Partial<Args> = {}): AstroIntegration => {
"astro:build:done": async (options) => {
await writeFile(
fileURLToPath(new URL("metadata.json", astroConfig.outDir)),
JSON.stringify({
stringify({
args: argsWithDefault,
options,
config: astroConfig,
Expand Down

0 comments on commit 66111f8

Please sign in to comment.