@tscircuit/fake-snippets 0.0.24 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ // api/generated-index.js
1
2
  import ky from "ky"
2
3
  import { readFileSync } from "fs"
3
4
  import { join, dirname } from "path"
@@ -10,7 +11,7 @@ const __dirname = dirname(__filename)
10
11
  const normalIndexFile = join(__dirname, "../dist/index.html")
11
12
  const htmlContent = readFileSync(normalIndexFile, "utf-8")
12
13
 
13
- const cacheControlHeader = "public, max-age=120, s-maxage=120"
14
+ const cacheControlHeader = "public, max-age=0, must-revalidate"
14
15
 
15
16
  function getHtmlWithModifiedSeoTags({
16
17
  title,
@@ -77,6 +78,8 @@ async function handleCustomPackageHtml(req, res) {
77
78
 
78
79
  res.setHeader("Content-Type", "text/html; charset=utf-8")
79
80
  res.setHeader("Cache-Control", cacheControlHeader)
81
+ // Add ETag support for better caching
82
+ res.setHeader("Vary", "Accept-Encoding")
80
83
  res.status(200).send(html)
81
84
  }
82
85
 
@@ -97,6 +100,8 @@ async function handleCustomPage(req, res) {
97
100
 
98
101
  res.setHeader("Content-Type", "text/html; charset=utf-8")
99
102
  res.setHeader("Cache-Control", cacheControlHeader)
103
+ // Add ETag support for better caching
104
+ res.setHeader("Vary", "Accept-Encoding")
100
105
  res.status(200).send(html)
101
106
  }
102
107
 
@@ -117,5 +122,7 @@ export default async function handler(req, res) {
117
122
 
118
123
  res.setHeader("Content-Type", "text/html; charset=utf-8")
119
124
  res.setHeader("Cache-Control", cacheControlHeader)
125
+ // Add ETag support for better caching
126
+ res.setHeader("Vary", "Accept-Encoding")
120
127
  res.status(200).send(htmlContent)
121
128
  }
@@ -184,11 +184,8 @@ test("get order after polling /move_orders_forward", async () => {
184
184
 
185
185
  expect(getResponse.data.orderState.are_gerbers_uploaded).toBe(false)
186
186
 
187
- const moveOrdersForwardResponse = await axios.post(
187
+ const moveOrdersForwardResponse = await axios.get(
188
188
  "/api/_fake/move_orders_forward",
189
- {
190
- order_id: createResponse.data.order.order_id,
191
- },
192
189
  )
193
190
 
194
191
  expect(moveOrdersForwardResponse.status).toBe(200)