@cedarjs/api-server 1.1.1-next.21 → 1.1.1

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
@@ -38,17 +38,15 @@ var init_cliHelpers = __esm({
38
38
  // src/createServerHelpers.ts
39
39
  import { parseArgs } from "util";
40
40
  import { coerceRootPath } from "@cedarjs/fastify-web/dist/helpers.js";
41
- function isCustomLoggerInstance(logger) {
42
- return !!logger && typeof logger === "object" && "info" in logger;
43
- }
44
41
  function resolveOptions(options = {}, args) {
45
42
  options.parseArgs ??= true;
46
43
  const defaults = getDefaultCreateServerOptions();
47
- const logger = options.logger ?? defaults.logger;
44
+ options.logger ??= defaults.logger;
48
45
  const resolvedOptions = {
49
46
  apiRootPath: options.apiRootPath ?? defaults.apiRootPath,
50
47
  fastifyServerOptions: options.fastifyServerOptions ?? {
51
48
  requestTimeout: defaults.fastifyServerOptions.requestTimeout,
49
+ logger: options.logger ?? defaults.logger,
52
50
  bodyLimit: defaults.fastifyServerOptions.bodyLimit
53
51
  },
54
52
  discoverFunctionsGlob: options.discoverFunctionsGlob ?? defaults.discoverFunctionsGlob,
@@ -57,11 +55,7 @@ function resolveOptions(options = {}, args) {
57
55
  apiPort: options.apiPort ?? defaults.apiPort
58
56
  };
59
57
  resolvedOptions.fastifyServerOptions.requestTimeout ??= defaults.fastifyServerOptions.requestTimeout;
60
- if (isCustomLoggerInstance(logger)) {
61
- resolvedOptions.fastifyServerOptions.loggerInstance = logger;
62
- } else {
63
- resolvedOptions.fastifyServerOptions.logger = logger;
64
- }
58
+ resolvedOptions.fastifyServerOptions.logger = options.logger;
65
59
  if (options.parseArgs) {
66
60
  const { values } = parseArgs({
67
61
  options: {
@@ -153,7 +147,7 @@ async function loadFastifyConfig() {
153
147
  }
154
148
  return serverConfigFile;
155
149
  }
156
- var DEFAULT_OPTIONS, isServerConfigLoaded, serverConfigFile, createFastifyInstance, fastify_default;
150
+ var DEFAULT_OPTIONS, isServerConfigLoaded, serverConfigFile, createFastifyInstance;
157
151
  var init_fastify = __esm({
158
152
  "src/fastify.ts"() {
159
153
  "use strict";
@@ -181,7 +175,6 @@ var init_fastify = __esm({
181
175
  });
182
176
  return fastify2;
183
177
  };
184
- fastify_default = createFastifyInstance;
185
178
  }
186
179
  });
187
180
 
@@ -717,7 +710,7 @@ async function handler2(options) {
717
710
  options.apiPort,
718
711
  options.apiRootPath
719
712
  ].join("");
720
- const webFastify = await fastify_default();
713
+ const webFastify = await createFastifyInstance();
721
714
  webFastify.register(redwoodFastifyWeb, {
722
715
  redwood: {
723
716
  apiProxyTarget
@@ -2,7 +2,7 @@ import ansis from "ansis";
2
2
  import { redwoodFastifyWeb, coerceRootPath } from "@cedarjs/fastify-web";
3
3
  import { getWebHost, getWebPort, getAPIHost, getAPIPort } from "./cliHelpers.js";
4
4
  import { createServer as createApiServer } from "./createServer.js";
5
- import createFastifyInstance from "./fastify.js";
5
+ import { createFastifyInstance } from "./fastify.js";
6
6
  async function handler(options) {
7
7
  const timeStart = Date.now();
8
8
  console.log(ansis.dim.italic("Starting API and Web Servers..."));
package/dist/cjs/bin.js CHANGED
@@ -58,17 +58,15 @@ var init_cliHelpers = __esm({
58
58
  });
59
59
 
60
60
  // src/createServerHelpers.ts
61
- function isCustomLoggerInstance(logger) {
62
- return !!logger && typeof logger === "object" && "info" in logger;
63
- }
64
61
  function resolveOptions(options = {}, args) {
65
62
  options.parseArgs ??= true;
66
63
  const defaults = getDefaultCreateServerOptions();
67
- const logger = options.logger ?? defaults.logger;
64
+ options.logger ??= defaults.logger;
68
65
  const resolvedOptions = {
69
66
  apiRootPath: options.apiRootPath ?? defaults.apiRootPath,
70
67
  fastifyServerOptions: options.fastifyServerOptions ?? {
71
68
  requestTimeout: defaults.fastifyServerOptions.requestTimeout,
69
+ logger: options.logger ?? defaults.logger,
72
70
  bodyLimit: defaults.fastifyServerOptions.bodyLimit
73
71
  },
74
72
  discoverFunctionsGlob: options.discoverFunctionsGlob ?? defaults.discoverFunctionsGlob,
@@ -77,11 +75,7 @@ function resolveOptions(options = {}, args) {
77
75
  apiPort: options.apiPort ?? defaults.apiPort
78
76
  };
79
77
  resolvedOptions.fastifyServerOptions.requestTimeout ??= defaults.fastifyServerOptions.requestTimeout;
80
- if (isCustomLoggerInstance(logger)) {
81
- resolvedOptions.fastifyServerOptions.loggerInstance = logger;
82
- } else {
83
- resolvedOptions.fastifyServerOptions.logger = logger;
84
- }
78
+ resolvedOptions.fastifyServerOptions.logger = options.logger;
85
79
  if (options.parseArgs) {
86
80
  const { values } = (0, import_util.parseArgs)({
87
81
  options: {
@@ -169,7 +163,7 @@ async function loadFastifyConfig() {
169
163
  }
170
164
  return serverConfigFile;
171
165
  }
172
- var import_fs, import_path, import_url, import_fastify, import_store, import_project_config2, DEFAULT_OPTIONS, isServerConfigLoaded, serverConfigFile, createFastifyInstance, fastify_default;
166
+ var import_fs, import_path, import_url, import_fastify, import_store, import_project_config2, DEFAULT_OPTIONS, isServerConfigLoaded, serverConfigFile, createFastifyInstance;
173
167
  var init_fastify = __esm({
174
168
  "src/fastify.ts"() {
175
169
  "use strict";
@@ -203,7 +197,6 @@ var init_fastify = __esm({
203
197
  });
204
198
  return fastify2;
205
199
  };
206
- fastify_default = createFastifyInstance;
207
200
  }
208
201
  });
209
202
 
@@ -741,7 +734,7 @@ async function handler2(options) {
741
734
  options.apiPort,
742
735
  options.apiRootPath
743
736
  ].join("");
744
- const webFastify = await fastify_default();
737
+ const webFastify = await createFastifyInstance();
745
738
  webFastify.register(import_fastify_web2.redwoodFastifyWeb, {
746
739
  redwood: {
747
740
  apiProxyTarget
@@ -35,7 +35,7 @@ var import_ansis = __toESM(require("ansis"), 1);
35
35
  var import_fastify_web = require("@cedarjs/fastify-web");
36
36
  var import_cliHelpers = require("./cliHelpers.js");
37
37
  var import_createServer = require("./createServer.js");
38
- var import_fastify = __toESM(require("./fastify.js"), 1);
38
+ var import_fastify = require("./fastify.js");
39
39
  async function handler(options) {
40
40
  const timeStart = Date.now();
41
41
  console.log(import_ansis.default.dim.italic("Starting API and Web Servers..."));
@@ -51,7 +51,7 @@ async function handler(options) {
51
51
  options.apiPort,
52
52
  options.apiRootPath
53
53
  ].join("");
54
- const webFastify = await (0, import_fastify.default)();
54
+ const webFastify = await (0, import_fastify.createFastifyInstance)();
55
55
  webFastify.register(import_fastify_web.redwoodFastifyWeb, {
56
56
  redwood: {
57
57
  apiProxyTarget
@@ -7,7 +7,7 @@ export interface CreateServerOptions {
7
7
  /** The prefix for all routes. Defaults to `/` */
8
8
  apiRootPath?: string;
9
9
  /** Logger instance or options */
10
- logger?: FastifyServerOptions['logger'] | FastifyServerOptions['loggerInstance'];
10
+ logger?: FastifyServerOptions['logger'];
11
11
  /**
12
12
  * Options for the fastify server instance.
13
13
  * Omitting logger here because we move it up.
@@ -1 +1 @@
1
- {"version":3,"file":"createServerHelpers.d.ts","sourceRoot":"","sources":["../../src/createServerHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EAChB,MAAM,SAAS,CAAA;AAMhB,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;AAEtE,MAAM,WAAW,MAAO,SAAQ,eAAe;IAC7C,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACnD;AAED,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IAGpB,iCAAiC;IACjC,MAAM,CAAC,EACH,oBAAoB,CAAC,QAAQ,CAAC,GAC9B,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;IAE1C;;;OAGG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAA;IAE3D;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,G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GG;IACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAEzC,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7D,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,KAAK,0BAA0B,GAAG,QAAQ,CACxC,IAAI,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG;IAClD,oBAAoB,EAAE,oBAAoB,CAAA;CAC3C,CACF,CAAA;AAID,eAAO,MAAM,6BAA6B,EAAE,MAAM,0BAiB9C,CAAA;AAQJ,wBAAgB,cAAc,CAC5B,OAAO,GAAE,mBAAwB,EACjC,IAAI,CAAC,EAAE,MAAM,EAAE;0BANS,oBAAoB;GAgF7C"}
@@ -42,17 +42,15 @@ const getDefaultCreateServerOptions = () => ({
42
42
  apiHost: (0, import_cliHelpers.getAPIHost)(),
43
43
  apiPort: (0, import_cliHelpers.getAPIPort)()
44
44
  });
45
- function isCustomLoggerInstance(logger) {
46
- return !!logger && typeof logger === "object" && "info" in logger;
47
- }
48
45
  function resolveOptions(options = {}, args) {
49
46
  options.parseArgs ??= true;
50
47
  const defaults = getDefaultCreateServerOptions();
51
- const logger = options.logger ?? defaults.logger;
48
+ options.logger ??= defaults.logger;
52
49
  const resolvedOptions = {
53
50
  apiRootPath: options.apiRootPath ?? defaults.apiRootPath,
54
51
  fastifyServerOptions: options.fastifyServerOptions ?? {
55
52
  requestTimeout: defaults.fastifyServerOptions.requestTimeout,
53
+ logger: options.logger ?? defaults.logger,
56
54
  bodyLimit: defaults.fastifyServerOptions.bodyLimit
57
55
  },
58
56
  discoverFunctionsGlob: options.discoverFunctionsGlob ?? defaults.discoverFunctionsGlob,
@@ -61,11 +59,7 @@ function resolveOptions(options = {}, args) {
61
59
  apiPort: options.apiPort ?? defaults.apiPort
62
60
  };
63
61
  resolvedOptions.fastifyServerOptions.requestTimeout ??= defaults.fastifyServerOptions.requestTimeout;
64
- if (isCustomLoggerInstance(logger)) {
65
- resolvedOptions.fastifyServerOptions.loggerInstance = logger;
66
- } else {
67
- resolvedOptions.fastifyServerOptions.logger = logger;
68
- }
62
+ resolvedOptions.fastifyServerOptions.logger = options.logger;
69
63
  if (options.parseArgs) {
70
64
  const { values } = (0, import_util.parseArgs)({
71
65
  options: {
@@ -10,5 +10,4 @@ export declare function loadFastifyConfig(): Promise<{
10
10
  configureFastify: FastifySideConfigFn;
11
11
  }>;
12
12
  export declare const createFastifyInstance: (options?: FastifyServerOptions) => Promise<FastifyInstance>;
13
- export default createFastifyInstance;
14
13
  //# sourceMappingURL=fastify.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../../src/fastify.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAOpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAGrD,eAAO,MAAM,eAAe;;;;CAI3B,CAAA;AAiBD,wBAAsB,iBAAiB;YAb7B,oBAAoB;sBACV,mBAAmB;GAsCtC;AAED,eAAO,MAAM,qBAAqB,GAChC,UAAU,oBAAoB,KAC7B,OAAO,CAAC,eAAe,CAWzB,CAAA;AAED,eAAe,qBAAqB,CAAA"}
1
+ {"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../../src/fastify.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAOpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAGrD,eAAO,MAAM,eAAe;;;;CAI3B,CAAA;AAiBD,wBAAsB,iBAAiB;YAb7B,oBAAoB;sBACV,mBAAmB;GAsCtC;AAED,eAAO,MAAM,qBAAqB,GAChC,UAAU,oBAAoB,KAC7B,OAAO,CAAC,eAAe,CAWzB,CAAA"}
@@ -30,7 +30,6 @@ var fastify_exports = {};
30
30
  __export(fastify_exports, {
31
31
  DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
32
32
  createFastifyInstance: () => createFastifyInstance,
33
- default: () => fastify_default,
34
33
  loadFastifyConfig: () => loadFastifyConfig
35
34
  });
36
35
  module.exports = __toCommonJS(fastify_exports);
@@ -84,7 +83,6 @@ const createFastifyInstance = async (options) => {
84
83
  });
85
84
  return fastify;
86
85
  };
87
- var fastify_default = createFastifyInstance;
88
86
  // Annotate the CommonJS export names for ESM import in node:
89
87
  0 && (module.exports = {
90
88
  DEFAULT_OPTIONS,
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/watch.ts"],"names":[],"mappings":"AAuEA;;;;GAIG;AACH,wBAAsB,UAAU,kBA+E/B"}
1
+ {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/watch.ts"],"names":[],"mappings":"AAuEA;;;;GAIG;AACH,wBAAsB,UAAU,kBA6E/B"}
package/dist/cjs/watch.js CHANGED
@@ -252,13 +252,12 @@ async function validateSdls() {
252
252
  }
253
253
  }
254
254
  async function startWatch() {
255
- const dbDir = await (0, import_project_config2.getDbDir)(cedarPaths.api.prismaConfig);
256
255
  const ignoredApiPaths = [
257
256
  // use this, because using cedarPaths.api.dist seems to not ignore on first
258
257
  // build
259
258
  "api/dist",
260
259
  cedarPaths.api.types,
261
- dbDir
260
+ cedarPaths.api.db
262
261
  ].map((path3) => (0, import_project_config2.ensurePosixPath)(path3));
263
262
  const ignoredExtensions = [
264
263
  ".DS_Store",
@@ -7,7 +7,7 @@ export interface CreateServerOptions {
7
7
  /** The prefix for all routes. Defaults to `/` */
8
8
  apiRootPath?: string;
9
9
  /** Logger instance or options */
10
- logger?: FastifyServerOptions['logger'] | FastifyServerOptions['loggerInstance'];
10
+ logger?: FastifyServerOptions['logger'];
11
11
  /**
12
12
  * Options for the fastify server instance.
13
13
  * Omitting logger here because we move it up.
@@ -1 +1 @@
1
- {"version":3,"file":"createServerHelpers.d.ts","sourceRoot":"","sources":["../src/createServerHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EAChB,MAAM,SAAS,CAAA;AAMhB,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;AAEtE,MAAM,WAAW,MAAO,SAAQ,eAAe;IAC7C,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACnD;AAED,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IAGpB,iCAAiC;IACjC,MAAM,CAAC,EACH,oBAAoB,CAAC,QAAQ,CAAC,GAC9B,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;IAE1C;;;OAGG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAA;IAE3D;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAEzC,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7D,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,KAAK,0BAA0B,GAAG,QAAQ,CACxC,IAAI,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG;IAClD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mB,EAAE,sBAAsB,CAAC,GAAG;IAClD,oBAAoB,EAAE,oBAAoB,CAAA;CAC3C,CACF,CAAA;AAID,eAAO,MAAM,6BAA6B,EAAE,MAAM,0BAiB9C,CAAA;AAQJ,wBAAgB,cAAc,CAC5B,OAAO,GAAE,mBAAwB,EACjC,IAAI,CAAC,EAAE,MAAM,EAAE;0BANS,oBAAoB;GAgF7C"}
@@ -18,17 +18,15 @@ const getDefaultCreateServerOptions = () => ({
18
18
  apiHost: getAPIHost(),
19
19
  apiPort: getAPIPort()
20
20
  });
21
- function isCustomLoggerInstance(logger) {
22
- return !!logger && typeof logger === "object" && "info" in logger;
23
- }
24
21
  function resolveOptions(options = {}, args) {
25
22
  options.parseArgs ??= true;
26
23
  const defaults = getDefaultCreateServerOptions();
27
- const logger = options.logger ?? defaults.logger;
24
+ options.logger ??= defaults.logger;
28
25
  const resolvedOptions = {
29
26
  apiRootPath: options.apiRootPath ?? defaults.apiRootPath,
30
27
  fastifyServerOptions: options.fastifyServerOptions ?? {
31
28
  requestTimeout: defaults.fastifyServerOptions.requestTimeout,
29
+ logger: options.logger ?? defaults.logger,
32
30
  bodyLimit: defaults.fastifyServerOptions.bodyLimit
33
31
  },
34
32
  discoverFunctionsGlob: options.discoverFunctionsGlob ?? defaults.discoverFunctionsGlob,
@@ -37,11 +35,7 @@ function resolveOptions(options = {}, args) {
37
35
  apiPort: options.apiPort ?? defaults.apiPort
38
36
  };
39
37
  resolvedOptions.fastifyServerOptions.requestTimeout ??= defaults.fastifyServerOptions.requestTimeout;
40
- if (isCustomLoggerInstance(logger)) {
41
- resolvedOptions.fastifyServerOptions.loggerInstance = logger;
42
- } else {
43
- resolvedOptions.fastifyServerOptions.logger = logger;
44
- }
38
+ resolvedOptions.fastifyServerOptions.logger = options.logger;
45
39
  if (options.parseArgs) {
46
40
  const { values } = parseArgs({
47
41
  options: {
package/dist/fastify.d.ts CHANGED
@@ -10,5 +10,4 @@ export declare function loadFastifyConfig(): Promise<{
10
10
  configureFastify: FastifySideConfigFn;
11
11
  }>;
12
12
  export declare const createFastifyInstance: (options?: FastifyServerOptions) => Promise<FastifyInstance>;
13
- export default createFastifyInstance;
14
13
  //# sourceMappingURL=fastify.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAOpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAGrD,eAAO,MAAM,eAAe;;;;CAI3B,CAAA;AAiBD,wBAAsB,iBAAiB;YAb7B,oBAAoB;sBACV,mBAAmB;GAsCtC;AAED,eAAO,MAAM,qBAAqB,GAChC,UAAU,oBAAoB,KAC7B,OAAO,CAAC,eAAe,CAWzB,CAAA;AAED,eAAe,qBAAqB,CAAA"}
1
+ {"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAOpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAGrD,eAAO,MAAM,eAAe;;;;CAI3B,CAAA;AAiBD,wBAAsB,iBAAiB;YAb7B,oBAAoB;sBACV,mBAAmB;GAsCtC;AAED,eAAO,MAAM,qBAAqB,GAChC,UAAU,oBAAoB,KAC7B,OAAO,CAAC,eAAe,CAWzB,CAAA"}
package/dist/fastify.js CHANGED
@@ -48,10 +48,8 @@ const createFastifyInstance = async (options) => {
48
48
  });
49
49
  return fastify;
50
50
  };
51
- var fastify_default = createFastifyInstance;
52
51
  export {
53
52
  DEFAULT_OPTIONS,
54
53
  createFastifyInstance,
55
- fastify_default as default,
56
54
  loadFastifyConfig
57
55
  };
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":"AAuEA;;;;GAIG;AACH,wBAAsB,UAAU,kBA+E/B"}
1
+ {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":"AAuEA;;;;GAIG;AACH,wBAAsB,UAAU,kBA6E/B"}
package/dist/watch.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  rebuildApi
12
12
  } from "@cedarjs/internal/dist/build/api";
13
13
  import { loadAndValidateSdls } from "@cedarjs/internal/dist/validateSchema";
14
- import { ensurePosixPath, getPaths as getPaths2, getDbDir } from "@cedarjs/project-config";
14
+ import { ensurePosixPath, getPaths as getPaths2 } from "@cedarjs/project-config";
15
15
 
16
16
  // src/utils.ts
17
17
  function debounce(func, wait) {
@@ -223,13 +223,12 @@ async function validateSdls() {
223
223
  }
224
224
  }
225
225
  async function startWatch() {
226
- const dbDir = await getDbDir(cedarPaths.api.prismaConfig);
227
226
  const ignoredApiPaths = [
228
227
  // use this, because using cedarPaths.api.dist seems to not ignore on first
229
228
  // build
230
229
  "api/dist",
231
230
  cedarPaths.api.types,
232
- dbDir
231
+ cedarPaths.api.db
233
232
  ].map((path3) => ensurePosixPath(path3));
234
233
  const ignoredExtensions = [
235
234
  ".DS_Store",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/api-server",
3
- "version": "1.1.1-next.21+77cfbaa90",
3
+ "version": "1.1.1",
4
4
  "description": "CedarJS's HTTP server for Serverless Functions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -69,6 +69,10 @@
69
69
  "types": "./dist/cjs/cliHelpers.d.ts",
70
70
  "default": "./dist/cjs/cliHelpers.js"
71
71
  },
72
+ "./cjs/bothCliConfigHandler": {
73
+ "types": "./dist/cjs/bothCLIConfigHandler.d.ts",
74
+ "default": "./dist/cjs/bothCLIConfigHandler.js"
75
+ },
72
76
  "./watch": {
73
77
  "import": {
74
78
  "types": "./dist/watch.d.ts",
@@ -107,20 +111,20 @@
107
111
  "test:watch": "vitest watch"
108
112
  },
109
113
  "dependencies": {
110
- "@cedarjs/context": "1.1.1-next.21",
111
- "@cedarjs/fastify-web": "1.1.1-next.21",
112
- "@cedarjs/internal": "1.1.1-next.21",
113
- "@cedarjs/project-config": "1.1.1-next.21",
114
- "@cedarjs/web-server": "1.1.1-next.21",
115
- "@fastify/multipart": "9.0.3",
116
- "@fastify/url-data": "6.0.3",
117
- "chalk": "4.1.2",
114
+ "@cedarjs/context": "1.1.1",
115
+ "@cedarjs/fastify-web": "1.1.1",
116
+ "@cedarjs/internal": "1.1.1",
117
+ "@cedarjs/project-config": "1.1.1",
118
+ "@cedarjs/web-server": "1.1.1",
119
+ "@fastify/multipart": "8.3.1",
120
+ "@fastify/url-data": "5.4.0",
121
+ "ansis": "4.1.0",
118
122
  "chokidar": "3.6.0",
119
123
  "dotenv-defaults": "5.0.2",
120
124
  "fast-glob": "3.3.3",
121
125
  "fast-json-parse": "1.0.3",
122
- "fastify": "5.4.0",
123
- "fastify-raw-body": "5.0.0",
126
+ "fastify": "4.28.1",
127
+ "fastify-raw-body": "4.3.0",
124
128
  "pretty-bytes": "5.6.0",
125
129
  "pretty-ms": "7.0.1",
126
130
  "qs": "6.13.0",
@@ -128,20 +132,19 @@
128
132
  "yargs": "17.7.2"
129
133
  },
130
134
  "devDependencies": {
131
- "@cedarjs/framework-tools": "1.1.0",
135
+ "@cedarjs/framework-tools": "1.1.1",
132
136
  "@types/aws-lambda": "8.10.152",
133
137
  "@types/dotenv-defaults": "^2.0.4",
134
138
  "@types/qs": "6.9.16",
135
139
  "@types/split2": "4.2.3",
136
140
  "@types/yargs": "17.0.33",
137
- "memfs": "4.17.2",
138
141
  "pino-abstract-transport": "1.2.0",
139
142
  "tsx": "4.20.5",
140
143
  "typescript": "5.9.2",
141
144
  "vitest": "3.2.4"
142
145
  },
143
146
  "peerDependencies": {
144
- "@cedarjs/graphql-server": "1.1.0"
147
+ "@cedarjs/graphql-server": "1.1.1"
145
148
  },
146
149
  "peerDependenciesMeta": {
147
150
  "@cedarjs/graphql-server": {
@@ -151,5 +154,5 @@
151
154
  "publishConfig": {
152
155
  "access": "public"
153
156
  },
154
- "gitHead": "77cfbaa90a726923a763fb33b836638d94b2d431"
157
+ "gitHead": "0c21e9ed1de0c7302295f3ca284924e48dd81afe"
155
158
  }