@cedarjs/api-server 8.0.0-canary.3427 → 8.0.0-canary.3429

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.
package/dist/bin.js CHANGED
@@ -709,7 +709,11 @@ import { config } from "dotenv-defaults";
709
709
  import fg3 from "fast-glob";
710
710
  import fastify from "fastify";
711
711
  import { getAsyncStoreInstance as getAsyncStoreInstance4 } from "@cedarjs/context/dist/store";
712
- import { getConfig as getConfig3, getPaths as getPaths4 } from "@cedarjs/project-config";
712
+ import {
713
+ getConfig as getConfig3,
714
+ getPaths as getPaths4,
715
+ writeApiProcessMeta
716
+ } from "@cedarjs/project-config";
713
717
  async function createServer(options = {}) {
714
718
  const {
715
719
  apiRootPath,
@@ -794,6 +798,19 @@ async function createServer(options = {}) {
794
798
  `${server.listeningOrigin}${apiRootPath}`
795
799
  )}`
796
800
  );
801
+ const address = server.addresses()[0];
802
+ if (address) {
803
+ try {
804
+ writeApiProcessMeta({
805
+ port: address.port,
806
+ host: address.address,
807
+ rootPath: apiRootPath
808
+ });
809
+ } catch (e) {
810
+ const message = e instanceof Error ? e.message : String(e);
811
+ server.log.warn(`Could not write the api process meta file: ${message}`);
812
+ }
813
+ }
797
814
  done();
798
815
  });
799
816
  server.start = (options2 = {}) => {
@@ -1 +1 @@
1
- {"version":3,"file":"createServer.d.ts","sourceRoot":"","sources":["../src/createServer.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,mBAAmB,EACnB,MAAM,EAEP,MAAM,0BAA0B,CAAA;AAsBjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAsB,YAAY,CAAC,OAAO,GAAE,mBAAwB,mBA4InE"}
1
+ {"version":3,"file":"createServer.d.ts","sourceRoot":"","sources":["../src/createServer.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,mBAAmB,EACnB,MAAM,EAEP,MAAM,0BAA0B,CAAA;AAsBjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAsB,YAAY,CAAC,OAAO,GAAE,mBAAwB,mBA+JnE"}
@@ -6,7 +6,11 @@ import { config } from "dotenv-defaults";
6
6
  import fg from "fast-glob";
7
7
  import fastify from "fastify";
8
8
  import { getAsyncStoreInstance } from "@cedarjs/context/dist/store";
9
- import { getConfig, getPaths } from "@cedarjs/project-config";
9
+ import {
10
+ getConfig,
11
+ getPaths,
12
+ writeApiProcessMeta
13
+ } from "@cedarjs/project-config";
10
14
  import { resolveOptions } from "./createServerHelpers.js";
11
15
  import { cedarFastifyAPI } from "./plugins/api.js";
12
16
  if (!process.env.CEDAR_ENV_FILES_LOADED) {
@@ -101,6 +105,19 @@ async function createServer(options = {}) {
101
105
  `${server.listeningOrigin}${apiRootPath}`
102
106
  )}`
103
107
  );
108
+ const address = server.addresses()[0];
109
+ if (address) {
110
+ try {
111
+ writeApiProcessMeta({
112
+ port: address.port,
113
+ host: address.address,
114
+ rootPath: apiRootPath
115
+ });
116
+ } catch (e) {
117
+ const message = e instanceof Error ? e.message : String(e);
118
+ server.log.warn(`Could not write the api process meta file: ${message}`);
119
+ }
120
+ }
104
121
  done();
105
122
  });
106
123
  server.start = (options2 = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/api-server",
3
- "version": "8.0.0-canary.3427",
3
+ "version": "8.0.0-canary.3429",
4
4
  "description": "CedarJS's HTTP server for Serverless Functions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -92,11 +92,11 @@
92
92
  "test:watch": "vitest watch"
93
93
  },
94
94
  "dependencies": {
95
- "@cedarjs/api": "8.0.0-canary.3427",
96
- "@cedarjs/context": "8.0.0-canary.3427",
97
- "@cedarjs/fastify-web": "8.0.0-canary.3427",
98
- "@cedarjs/project-config": "8.0.0-canary.3427",
99
- "@cedarjs/web-server": "8.0.0-canary.3427",
95
+ "@cedarjs/api": "8.0.0-canary.3429",
96
+ "@cedarjs/context": "8.0.0-canary.3429",
97
+ "@cedarjs/fastify-web": "8.0.0-canary.3429",
98
+ "@cedarjs/project-config": "8.0.0-canary.3429",
99
+ "@cedarjs/web-server": "8.0.0-canary.3429",
100
100
  "@fastify/multipart": "9.4.0",
101
101
  "@fastify/url-data": "6.0.4",
102
102
  "ansis": "4.4.0",
@@ -113,7 +113,7 @@
113
113
  "yargs": "17.7.3"
114
114
  },
115
115
  "devDependencies": {
116
- "@cedarjs/framework-tools": "8.0.0-canary.3427",
116
+ "@cedarjs/framework-tools": "8.0.0-canary.3429",
117
117
  "@fastify/compress": "9.2.1",
118
118
  "@types/aws-lambda": "8.10.164",
119
119
  "@types/dotenv-defaults": "^5.0.0",
@@ -129,7 +129,7 @@
129
129
  "vitest": "4.1.11"
130
130
  },
131
131
  "peerDependencies": {
132
- "@cedarjs/graphql-server": "8.0.0-canary.3427"
132
+ "@cedarjs/graphql-server": "8.0.0-canary.3429"
133
133
  },
134
134
  "peerDependenciesMeta": {
135
135
  "@cedarjs/graphql-server": {