@cedarjs/api-server 4.0.0-canary.13811 → 4.0.0-canary.13813
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 +8 -5
- package/dist/cjs/bin.js +19 -16
- package/dist/cjs/createServer.d.ts.map +1 -1
- package/dist/cjs/createServer.js +6 -5
- package/dist/cjs/plugins/graphql.d.ts.map +1 -1
- package/dist/cjs/plugins/graphql.js +2 -1
- package/dist/cjs/plugins/lambdaLoader.d.ts.map +1 -1
- package/dist/cjs/plugins/lambdaLoader.js +5 -4
- package/dist/createServer.d.ts.map +1 -1
- package/dist/createServer.js +3 -2
- package/dist/plugins/graphql.d.ts.map +1 -1
- package/dist/plugins/graphql.js +2 -1
- package/dist/plugins/lambdaLoader.d.ts.map +1 -1
- package/dist/plugins/lambdaLoader.js +3 -2
- package/package.json +9 -9
package/dist/bin.js
CHANGED
|
@@ -316,7 +316,8 @@ var init_utils2 = __esm({
|
|
|
316
316
|
});
|
|
317
317
|
|
|
318
318
|
// src/plugins/lambdaLoader.ts
|
|
319
|
-
import path2 from "path";
|
|
319
|
+
import path2 from "node:path";
|
|
320
|
+
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
320
321
|
import ansis from "ansis";
|
|
321
322
|
import fg from "fast-glob";
|
|
322
323
|
import { getPaths as getPaths2 } from "@cedarjs/project-config";
|
|
@@ -333,7 +334,7 @@ var init_lambdaLoader = __esm({
|
|
|
333
334
|
const imports = foundFunctions.map(async (fnPath) => {
|
|
334
335
|
const ts = Date.now();
|
|
335
336
|
const routeName = path2.basename(fnPath).replace(".js", "");
|
|
336
|
-
const fnImport = await import(
|
|
337
|
+
const fnImport = await import(pathToFileURL2(fnPath).href);
|
|
337
338
|
const handler3 = (() => {
|
|
338
339
|
if ("handler" in fnImport) {
|
|
339
340
|
return fnImport.handler;
|
|
@@ -467,6 +468,7 @@ var graphql_exports = {};
|
|
|
467
468
|
__export(graphql_exports, {
|
|
468
469
|
redwoodFastifyGraphQLServer: () => redwoodFastifyGraphQLServer
|
|
469
470
|
});
|
|
471
|
+
import { pathToFileURL as pathToFileURL3 } from "node:url";
|
|
470
472
|
import fastifyMultiPart from "@fastify/multipart";
|
|
471
473
|
import fastifyUrlData2 from "@fastify/url-data";
|
|
472
474
|
import fg2 from "fast-glob";
|
|
@@ -490,7 +492,7 @@ async function redwoodFastifyGraphQLServer(fastify2, options) {
|
|
|
490
492
|
cwd: getPaths3().api.base,
|
|
491
493
|
absolute: true
|
|
492
494
|
});
|
|
493
|
-
const filePath =
|
|
495
|
+
const filePath = pathToFileURL3(graphqlFunctionPath).href;
|
|
494
496
|
const { __rw_graphqlOptions } = await import(filePath);
|
|
495
497
|
if (!__rw_graphqlOptions) {
|
|
496
498
|
return;
|
|
@@ -553,7 +555,8 @@ var init_graphql = __esm({
|
|
|
553
555
|
|
|
554
556
|
// src/createServer.ts
|
|
555
557
|
import fs2 from "node:fs";
|
|
556
|
-
import path3 from "path";
|
|
558
|
+
import path3 from "node:path";
|
|
559
|
+
import { pathToFileURL as pathToFileURL4 } from "node:url";
|
|
557
560
|
import ansis2 from "ansis";
|
|
558
561
|
import { config } from "dotenv-defaults";
|
|
559
562
|
import fg3 from "fast-glob";
|
|
@@ -620,7 +623,7 @@ async function createServer(options = {}) {
|
|
|
620
623
|
});
|
|
621
624
|
if (graphqlFunctionPath) {
|
|
622
625
|
const { redwoodFastifyGraphQLServer: redwoodFastifyGraphQLServer2 } = await Promise.resolve().then(() => (init_graphql(), graphql_exports));
|
|
623
|
-
const { __rw_graphqlOptions } = await import(
|
|
626
|
+
const { __rw_graphqlOptions } = await import(pathToFileURL4(graphqlFunctionPath).href);
|
|
624
627
|
await server.register(redwoodFastifyGraphQLServer2, {
|
|
625
628
|
redwood: {
|
|
626
629
|
apiRootPath,
|
package/dist/cjs/bin.js
CHANGED
|
@@ -338,11 +338,12 @@ var init_utils2 = __esm({
|
|
|
338
338
|
});
|
|
339
339
|
|
|
340
340
|
// src/plugins/lambdaLoader.ts
|
|
341
|
-
var
|
|
341
|
+
var import_node_path, import_node_url, import_ansis, import_fast_glob, import_project_config3, LAMBDA_FUNCTIONS, setLambdaFunctions, loadFunctionsFromDist, findApiDistFunctions, lambdaRequestHandler;
|
|
342
342
|
var init_lambdaLoader = __esm({
|
|
343
343
|
"src/plugins/lambdaLoader.ts"() {
|
|
344
344
|
"use strict";
|
|
345
|
-
|
|
345
|
+
import_node_path = __toESM(require("node:path"), 1);
|
|
346
|
+
import_node_url = require("node:url");
|
|
346
347
|
import_ansis = __toESM(require("ansis"), 1);
|
|
347
348
|
import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
348
349
|
import_project_config3 = require("@cedarjs/project-config");
|
|
@@ -354,8 +355,8 @@ var init_lambdaLoader = __esm({
|
|
|
354
355
|
console.log(import_ansis.default.dim.italic("Importing Server Functions... "));
|
|
355
356
|
const imports = foundFunctions.map(async (fnPath) => {
|
|
356
357
|
const ts = Date.now();
|
|
357
|
-
const routeName =
|
|
358
|
-
const fnImport = await import(
|
|
358
|
+
const routeName = import_node_path.default.basename(fnPath).replace(".js", "");
|
|
359
|
+
const fnImport = await import((0, import_node_url.pathToFileURL)(fnPath).href);
|
|
359
360
|
const handler3 = (() => {
|
|
360
361
|
if ("handler" in fnImport) {
|
|
361
362
|
return fnImport.handler;
|
|
@@ -392,7 +393,7 @@ var init_lambdaLoader = __esm({
|
|
|
392
393
|
options: options?.fastGlobOptions,
|
|
393
394
|
discoverFunctionsGlob: options?.discoverFunctionsGlob
|
|
394
395
|
});
|
|
395
|
-
const i = serverFunctions.findIndex((x) =>
|
|
396
|
+
const i = serverFunctions.findIndex((x) => import_node_path.default.basename(x) === "graphql.js");
|
|
396
397
|
if (i >= 0) {
|
|
397
398
|
const graphQLFn = serverFunctions.splice(i, 1)[0];
|
|
398
399
|
serverFunctions.unshift(graphQLFn);
|
|
@@ -506,7 +507,7 @@ async function redwoodFastifyGraphQLServer(fastify2, options) {
|
|
|
506
507
|
cwd: (0, import_project_config4.getPaths)().api.base,
|
|
507
508
|
absolute: true
|
|
508
509
|
});
|
|
509
|
-
const filePath =
|
|
510
|
+
const filePath = (0, import_node_url2.pathToFileURL)(graphqlFunctionPath).href;
|
|
510
511
|
const { __rw_graphqlOptions } = await import(filePath);
|
|
511
512
|
if (!__rw_graphqlOptions) {
|
|
512
513
|
return;
|
|
@@ -560,10 +561,11 @@ async function redwoodFastifyGraphQLServer(fastify2, options) {
|
|
|
560
561
|
function trimSlashes(path5) {
|
|
561
562
|
return path5.replace(/^\/|\/$/g, "");
|
|
562
563
|
}
|
|
563
|
-
var import_multipart, import_url_data2, import_fast_glob2, import_store3, import_helpers3, import_graphql_server, import_project_config4;
|
|
564
|
+
var import_node_url2, import_multipart, import_url_data2, import_fast_glob2, import_store3, import_helpers3, import_graphql_server, import_project_config4;
|
|
564
565
|
var init_graphql = __esm({
|
|
565
566
|
"src/plugins/graphql.ts"() {
|
|
566
567
|
"use strict";
|
|
568
|
+
import_node_url2 = require("node:url");
|
|
567
569
|
import_multipart = __toESM(require("@fastify/multipart"), 1);
|
|
568
570
|
import_url_data2 = __toESM(require("@fastify/url-data"), 1);
|
|
569
571
|
import_fast_glob2 = __toESM(require("fast-glob"), 1);
|
|
@@ -585,7 +587,7 @@ async function createServer(options = {}) {
|
|
|
585
587
|
apiPort,
|
|
586
588
|
apiHost
|
|
587
589
|
} = resolveOptions(options);
|
|
588
|
-
const serverConfigPath =
|
|
590
|
+
const serverConfigPath = import_node_path2.default.join(
|
|
589
591
|
(0, import_project_config5.getPaths)().base,
|
|
590
592
|
(0, import_project_config5.getConfig)().api.serverConfig
|
|
591
593
|
);
|
|
@@ -636,7 +638,7 @@ async function createServer(options = {}) {
|
|
|
636
638
|
});
|
|
637
639
|
if (graphqlFunctionPath) {
|
|
638
640
|
const { redwoodFastifyGraphQLServer: redwoodFastifyGraphQLServer2 } = await Promise.resolve().then(() => (init_graphql(), graphql_exports));
|
|
639
|
-
const { __rw_graphqlOptions } = await import(
|
|
641
|
+
const { __rw_graphqlOptions } = await import((0, import_node_url3.pathToFileURL)(graphqlFunctionPath).href);
|
|
640
642
|
await server.register(redwoodFastifyGraphQLServer2, {
|
|
641
643
|
redwood: {
|
|
642
644
|
apiRootPath,
|
|
@@ -665,12 +667,13 @@ async function createServer(options = {}) {
|
|
|
665
667
|
};
|
|
666
668
|
return server;
|
|
667
669
|
}
|
|
668
|
-
var import_node_fs2,
|
|
670
|
+
var import_node_fs2, import_node_path2, import_node_url3, import_ansis2, import_dotenv_defaults, import_fast_glob3, import_fastify3, import_store4, import_project_config5;
|
|
669
671
|
var init_createServer = __esm({
|
|
670
672
|
"src/createServer.ts"() {
|
|
671
673
|
"use strict";
|
|
672
674
|
import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
673
|
-
|
|
675
|
+
import_node_path2 = __toESM(require("node:path"), 1);
|
|
676
|
+
import_node_url3 = require("node:url");
|
|
674
677
|
import_ansis2 = __toESM(require("ansis"), 1);
|
|
675
678
|
import_dotenv_defaults = require("dotenv-defaults");
|
|
676
679
|
import_fast_glob3 = __toESM(require("fast-glob"), 1);
|
|
@@ -681,8 +684,8 @@ var init_createServer = __esm({
|
|
|
681
684
|
init_api();
|
|
682
685
|
if (!process.env.CEDAR_ENV_FILES_LOADED) {
|
|
683
686
|
(0, import_dotenv_defaults.config)({
|
|
684
|
-
path:
|
|
685
|
-
defaults:
|
|
687
|
+
path: import_node_path2.default.join((0, import_project_config5.getPaths)().base, ".env"),
|
|
688
|
+
defaults: import_node_path2.default.join((0, import_project_config5.getPaths)().base, ".env.defaults"),
|
|
686
689
|
multiline: true
|
|
687
690
|
});
|
|
688
691
|
process.env.CEDAR_ENV_FILES_LOADED = "true";
|
|
@@ -807,7 +810,7 @@ var init_bothCLIConfigHandler = __esm({
|
|
|
807
810
|
});
|
|
808
811
|
|
|
809
812
|
// src/bin.ts
|
|
810
|
-
var
|
|
813
|
+
var import_path2 = __toESM(require("path"), 1);
|
|
811
814
|
var import_dotenv_defaults2 = require("dotenv-defaults");
|
|
812
815
|
var import_helpers4 = require("yargs/helpers");
|
|
813
816
|
var import_yargs = __toESM(require("yargs/yargs"), 1);
|
|
@@ -882,8 +885,8 @@ function builder2(yargs2) {
|
|
|
882
885
|
init_bothCLIConfigHandler();
|
|
883
886
|
if (!process.env.CEDAR_ENV_FILES_LOADED) {
|
|
884
887
|
(0, import_dotenv_defaults2.config)({
|
|
885
|
-
path:
|
|
886
|
-
defaults:
|
|
888
|
+
path: import_path2.default.join((0, import_project_config6.getPaths)().base, ".env"),
|
|
889
|
+
defaults: import_path2.default.join((0, import_project_config6.getPaths)().base, ".env.defaults"),
|
|
887
890
|
multiline: true
|
|
888
891
|
});
|
|
889
892
|
process.env.CEDAR_ENV_FILES_LOADED = "true";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createServer.d.ts","sourceRoot":"","sources":["../../src/createServer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createServer.d.ts","sourceRoot":"","sources":["../../src/createServer.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,mBAAmB,EACnB,MAAM,EAEP,MAAM,0BAA0B,CAAA;AAsBjC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,YAAY,CAAC,OAAO,GAAE,mBAAwB,mBAoHnE"}
|
package/dist/cjs/createServer.js
CHANGED
|
@@ -32,7 +32,8 @@ __export(createServer_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(createServer_exports);
|
|
34
34
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
35
|
-
var
|
|
35
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
36
|
+
var import_node_url = require("node:url");
|
|
36
37
|
var import_ansis = __toESM(require("ansis"), 1);
|
|
37
38
|
var import_dotenv_defaults = require("dotenv-defaults");
|
|
38
39
|
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
@@ -43,8 +44,8 @@ var import_createServerHelpers = require("./createServerHelpers.js");
|
|
|
43
44
|
var import_api = require("./plugins/api.js");
|
|
44
45
|
if (!process.env.CEDAR_ENV_FILES_LOADED) {
|
|
45
46
|
(0, import_dotenv_defaults.config)({
|
|
46
|
-
path:
|
|
47
|
-
defaults:
|
|
47
|
+
path: import_node_path.default.join((0, import_project_config.getPaths)().base, ".env"),
|
|
48
|
+
defaults: import_node_path.default.join((0, import_project_config.getPaths)().base, ".env.defaults"),
|
|
48
49
|
multiline: true
|
|
49
50
|
});
|
|
50
51
|
process.env.CEDAR_ENV_FILES_LOADED = "true";
|
|
@@ -58,7 +59,7 @@ async function createServer(options = {}) {
|
|
|
58
59
|
apiPort,
|
|
59
60
|
apiHost
|
|
60
61
|
} = (0, import_createServerHelpers.resolveOptions)(options);
|
|
61
|
-
const serverConfigPath =
|
|
62
|
+
const serverConfigPath = import_node_path.default.join(
|
|
62
63
|
(0, import_project_config.getPaths)().base,
|
|
63
64
|
(0, import_project_config.getConfig)().api.serverConfig
|
|
64
65
|
);
|
|
@@ -109,7 +110,7 @@ async function createServer(options = {}) {
|
|
|
109
110
|
});
|
|
110
111
|
if (graphqlFunctionPath) {
|
|
111
112
|
const { redwoodFastifyGraphQLServer } = await import("./plugins/graphql.js");
|
|
112
|
-
const { __rw_graphqlOptions } = await import(
|
|
113
|
+
const { __rw_graphqlOptions } = await import((0, import_node_url.pathToFileURL)(graphqlFunctionPath).href);
|
|
113
114
|
await server.register(redwoodFastifyGraphQLServer, {
|
|
114
115
|
redwood: {
|
|
115
116
|
apiRootPath,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/plugins/graphql.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/plugins/graphql.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,SAAS,CAAA;AAO3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAA;KAC7B,CAAA;CACF;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,4BAA4B,iBAmGtC"}
|
|
@@ -31,6 +31,7 @@ __export(graphql_exports, {
|
|
|
31
31
|
redwoodFastifyGraphQLServer: () => redwoodFastifyGraphQLServer
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(graphql_exports);
|
|
34
|
+
var import_node_url = require("node:url");
|
|
34
35
|
var import_multipart = __toESM(require("@fastify/multipart"), 1);
|
|
35
36
|
var import_url_data = __toESM(require("@fastify/url-data"), 1);
|
|
36
37
|
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
@@ -55,7 +56,7 @@ async function redwoodFastifyGraphQLServer(fastify, options) {
|
|
|
55
56
|
cwd: (0, import_project_config.getPaths)().api.base,
|
|
56
57
|
absolute: true
|
|
57
58
|
});
|
|
58
|
-
const filePath =
|
|
59
|
+
const filePath = (0, import_node_url.pathToFileURL)(graphqlFunctionPath).href;
|
|
59
60
|
const { __rw_graphqlOptions } = await import(filePath);
|
|
60
61
|
if (!__rw_graphqlOptions) {
|
|
61
62
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lambdaLoader.d.ts","sourceRoot":"","sources":["../../../src/plugins/lambdaLoader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lambdaLoader.d.ts","sourceRoot":"","sources":["../../../src/plugins/lambdaLoader.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,OAAO,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAOhB,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAC7C,eAAO,MAAM,gBAAgB,EAAE,OAAY,CAAA;AAI3C,eAAO,MAAM,kBAAkB,GAAU,gBAAgB,MAAM,EAAE,kBAsDhE,CAAA;AAED,KAAK,4BAA4B,GAAG;IAClC,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC1C,CAAA;AAGD,eAAO,MAAM,qBAAqB,GAChC,UAAS,4BAAiC,kBAe3C,CAAA;AA0BD,UAAU,oBAAqB,SAAQ,uBAAuB;IAC5D,MAAM,EAAE;QACN,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;CACF;AAED;;;;IAII;AACJ,eAAO,MAAM,oBAAoB,GAC/B,KAAK,cAAc,CAAC,oBAAoB,CAAC,EACzC,OAAO,YAAY,kBAsBpB,CAAA"}
|
|
@@ -34,7 +34,8 @@ __export(lambdaLoader_exports, {
|
|
|
34
34
|
setLambdaFunctions: () => setLambdaFunctions
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(lambdaLoader_exports);
|
|
37
|
-
var
|
|
37
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
38
|
+
var import_node_url = require("node:url");
|
|
38
39
|
var import_ansis = __toESM(require("ansis"), 1);
|
|
39
40
|
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
40
41
|
var import_project_config = require("@cedarjs/project-config");
|
|
@@ -46,8 +47,8 @@ const setLambdaFunctions = async (foundFunctions) => {
|
|
|
46
47
|
console.log(import_ansis.default.dim.italic("Importing Server Functions... "));
|
|
47
48
|
const imports = foundFunctions.map(async (fnPath) => {
|
|
48
49
|
const ts = Date.now();
|
|
49
|
-
const routeName =
|
|
50
|
-
const fnImport = await import(
|
|
50
|
+
const routeName = import_node_path.default.basename(fnPath).replace(".js", "");
|
|
51
|
+
const fnImport = await import((0, import_node_url.pathToFileURL)(fnPath).href);
|
|
51
52
|
const handler = (() => {
|
|
52
53
|
if ("handler" in fnImport) {
|
|
53
54
|
return fnImport.handler;
|
|
@@ -84,7 +85,7 @@ const loadFunctionsFromDist = async (options = {}) => {
|
|
|
84
85
|
options: options?.fastGlobOptions,
|
|
85
86
|
discoverFunctionsGlob: options?.discoverFunctionsGlob
|
|
86
87
|
});
|
|
87
|
-
const i = serverFunctions.findIndex((x) =>
|
|
88
|
+
const i = serverFunctions.findIndex((x) => import_node_path.default.basename(x) === "graphql.js");
|
|
88
89
|
if (i >= 0) {
|
|
89
90
|
const graphQLFn = serverFunctions.splice(i, 1)[0];
|
|
90
91
|
serverFunctions.unshift(graphQLFn);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createServer.d.ts","sourceRoot":"","sources":["../src/createServer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createServer.d.ts","sourceRoot":"","sources":["../src/createServer.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,mBAAmB,EACnB,MAAM,EAEP,MAAM,0BAA0B,CAAA;AAsBjC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,YAAY,CAAC,OAAO,GAAE,mBAAwB,mBAoHnE"}
|
package/dist/createServer.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
-
import path from "path";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
3
4
|
import ansis from "ansis";
|
|
4
5
|
import { config } from "dotenv-defaults";
|
|
5
6
|
import fg from "fast-glob";
|
|
@@ -76,7 +77,7 @@ async function createServer(options = {}) {
|
|
|
76
77
|
});
|
|
77
78
|
if (graphqlFunctionPath) {
|
|
78
79
|
const { redwoodFastifyGraphQLServer } = await import("./plugins/graphql.js");
|
|
79
|
-
const { __rw_graphqlOptions } = await import(
|
|
80
|
+
const { __rw_graphqlOptions } = await import(pathToFileURL(graphqlFunctionPath).href);
|
|
80
81
|
await server.register(redwoodFastifyGraphQLServer, {
|
|
81
82
|
redwood: {
|
|
82
83
|
apiRootPath,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../src/plugins/graphql.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../src/plugins/graphql.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,SAAS,CAAA;AAO3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAA;KAC7B,CAAA;CACF;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,4BAA4B,iBAmGtC"}
|
package/dist/plugins/graphql.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { pathToFileURL } from "node:url";
|
|
1
2
|
import fastifyMultiPart from "@fastify/multipart";
|
|
2
3
|
import fastifyUrlData from "@fastify/url-data";
|
|
3
4
|
import fg from "fast-glob";
|
|
@@ -22,7 +23,7 @@ async function redwoodFastifyGraphQLServer(fastify, options) {
|
|
|
22
23
|
cwd: getPaths().api.base,
|
|
23
24
|
absolute: true
|
|
24
25
|
});
|
|
25
|
-
const filePath =
|
|
26
|
+
const filePath = pathToFileURL(graphqlFunctionPath).href;
|
|
26
27
|
const { __rw_graphqlOptions } = await import(filePath);
|
|
27
28
|
if (!__rw_graphqlOptions) {
|
|
28
29
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lambdaLoader.d.ts","sourceRoot":"","sources":["../../src/plugins/lambdaLoader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lambdaLoader.d.ts","sourceRoot":"","sources":["../../src/plugins/lambdaLoader.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,OAAO,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAOhB,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAC7C,eAAO,MAAM,gBAAgB,EAAE,OAAY,CAAA;AAI3C,eAAO,MAAM,kBAAkB,GAAU,gBAAgB,MAAM,EAAE,kBAsDhE,CAAA;AAED,KAAK,4BAA4B,GAAG;IAClC,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC1C,CAAA;AAGD,eAAO,MAAM,qBAAqB,GAChC,UAAS,4BAAiC,kBAe3C,CAAA;AA0BD,UAAU,oBAAqB,SAAQ,uBAAuB;IAC5D,MAAM,EAAE;QACN,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;CACF;AAED;;;;IAII;AACJ,eAAO,MAAM,oBAAoB,GAC/B,KAAK,cAAc,CAAC,oBAAoB,CAAC,EACzC,OAAO,YAAY,kBAsBpB,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import path from "path";
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
2
3
|
import ansis from "ansis";
|
|
3
4
|
import fg from "fast-glob";
|
|
4
5
|
import { getPaths } from "@cedarjs/project-config";
|
|
@@ -11,7 +12,7 @@ const setLambdaFunctions = async (foundFunctions) => {
|
|
|
11
12
|
const imports = foundFunctions.map(async (fnPath) => {
|
|
12
13
|
const ts = Date.now();
|
|
13
14
|
const routeName = path.basename(fnPath).replace(".js", "");
|
|
14
|
-
const fnImport = await import(
|
|
15
|
+
const fnImport = await import(pathToFileURL(fnPath).href);
|
|
15
16
|
const handler = (() => {
|
|
16
17
|
if ("handler" in fnImport) {
|
|
17
18
|
return fnImport.handler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/api-server",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.13813+9c6f670ae9",
|
|
4
4
|
"description": "CedarJS's HTTP server for Serverless Functions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -111,11 +111,11 @@
|
|
|
111
111
|
"test:watch": "vitest watch"
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
|
-
"@cedarjs/context": "4.0.0-canary.
|
|
115
|
-
"@cedarjs/fastify-web": "4.0.0-canary.
|
|
116
|
-
"@cedarjs/internal": "4.0.0-canary.
|
|
117
|
-
"@cedarjs/project-config": "4.0.0-canary.
|
|
118
|
-
"@cedarjs/web-server": "4.0.0-canary.
|
|
114
|
+
"@cedarjs/context": "4.0.0-canary.13813",
|
|
115
|
+
"@cedarjs/fastify-web": "4.0.0-canary.13813",
|
|
116
|
+
"@cedarjs/internal": "4.0.0-canary.13813",
|
|
117
|
+
"@cedarjs/project-config": "4.0.0-canary.13813",
|
|
118
|
+
"@cedarjs/web-server": "4.0.0-canary.13813",
|
|
119
119
|
"@fastify/multipart": "9.4.0",
|
|
120
120
|
"@fastify/url-data": "6.0.3",
|
|
121
121
|
"ansis": "4.2.0",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"yargs": "17.7.2"
|
|
133
133
|
},
|
|
134
134
|
"devDependencies": {
|
|
135
|
-
"@cedarjs/framework-tools": "4.0.0-canary.
|
|
135
|
+
"@cedarjs/framework-tools": "4.0.0-canary.13813",
|
|
136
136
|
"@types/aws-lambda": "8.10.161",
|
|
137
137
|
"@types/dotenv-defaults": "^5.0.0",
|
|
138
138
|
"@types/split2": "4.2.3",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"vitest": "3.2.4"
|
|
146
146
|
},
|
|
147
147
|
"peerDependencies": {
|
|
148
|
-
"@cedarjs/graphql-server": "4.0.0-canary.
|
|
148
|
+
"@cedarjs/graphql-server": "4.0.0-canary.13813"
|
|
149
149
|
},
|
|
150
150
|
"peerDependenciesMeta": {
|
|
151
151
|
"@cedarjs/graphql-server": {
|
|
@@ -155,5 +155,5 @@
|
|
|
155
155
|
"publishConfig": {
|
|
156
156
|
"access": "public"
|
|
157
157
|
},
|
|
158
|
-
"gitHead": "
|
|
158
|
+
"gitHead": "9c6f670ae9b1c903854fc4ba8a27592f27b634d2"
|
|
159
159
|
}
|