@platformatic/astro 2.55.0 → 2.57.0

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.
Files changed (3) hide show
  1. package/index.js +14 -0
  2. package/package.json +6 -6
  3. package/schema.json +1 -1
package/index.js CHANGED
@@ -141,11 +141,25 @@ export class AstroStackable extends BaseStackable {
141
141
 
142
142
  // This is only used in non SSR production mode as in other modes a TCP server is started
143
143
  async inject (injectParams, onInject) {
144
+ if (this.startHttpTimer && this.endHttpTimer) {
145
+ this.startHttpTimer({ request: injectParams })
146
+
147
+ if (onInject) {
148
+ const originalOnInject = onInject
149
+ onInject = (err, response) => {
150
+ this.endHttpTimer({ request: injectParams, response })
151
+ originalOnInject(err, response)
152
+ }
153
+ }
154
+ }
155
+
144
156
  const res = await this.#app.inject(injectParams, onInject)
145
157
 
146
158
  /* c8 ignore next 3 */
147
159
  if (onInject) {
148
160
  return
161
+ } else if (this.endHttpTimer) {
162
+ this.endHttpTimer({ request: injectParams, response: res })
149
163
  }
150
164
 
151
165
  // Since inject might be called from the main thread directly via ITC, let's clean it up
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/astro",
3
- "version": "2.55.0",
3
+ "version": "2.57.0",
4
4
  "description": "Platformatic Astro Stackable",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -19,9 +19,9 @@
19
19
  "@fastify/static": "^8.0.0",
20
20
  "fastify": "^5.0.0",
21
21
  "semver": "^7.6.3",
22
- "@platformatic/basic": "2.55.0",
23
- "@platformatic/config": "2.55.0",
24
- "@platformatic/utils": "2.55.0"
22
+ "@platformatic/basic": "2.57.0",
23
+ "@platformatic/config": "2.57.0",
24
+ "@platformatic/utils": "2.57.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@astrojs/node": "^8.3.3",
@@ -33,8 +33,8 @@
33
33
  "typescript": "^5.5.4",
34
34
  "vite": "^5.4.4",
35
35
  "ws": "^8.18.0",
36
- "@platformatic/composer": "2.55.0",
37
- "@platformatic/service": "2.55.0"
36
+ "@platformatic/composer": "2.57.0",
37
+ "@platformatic/service": "2.57.0"
38
38
  },
39
39
  "scripts": {
40
40
  "test": "npm run lint && borp --concurrency=1 --no-timeout",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/astro/2.55.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/astro/2.57.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Astro Stackable",
5
5
  "type": "object",