@cedarjs/api-server 6.0.0-canary.2789 → 6.0.0-canary.2793
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/package.json +29 -72
- package/dist/cjs/apiCLIConfig.d.ts +0 -6
- package/dist/cjs/apiCLIConfig.d.ts.map +0 -1
- package/dist/cjs/apiCLIConfig.js +0 -71
- package/dist/cjs/apiCLIConfigHandler.d.ts +0 -3
- package/dist/cjs/apiCLIConfigHandler.d.ts.map +0 -1
- package/dist/cjs/apiCLIConfigHandler.js +0 -67
- package/dist/cjs/bin.d.ts +0 -2
- package/dist/cjs/bin.d.ts.map +0 -1
- package/dist/cjs/bin.js +0 -1007
- package/dist/cjs/bothCLIConfig.d.ts +0 -6
- package/dist/cjs/bothCLIConfig.d.ts.map +0 -1
- package/dist/cjs/bothCLIConfig.js +0 -76
- package/dist/cjs/bothCLIConfigHandler.d.ts +0 -3
- package/dist/cjs/bothCLIConfigHandler.d.ts.map +0 -1
- package/dist/cjs/bothCLIConfigHandler.js +0 -107
- package/dist/cjs/buildManager.d.ts +0 -15
- package/dist/cjs/buildManager.d.ts.map +0 -1
- package/dist/cjs/buildManager.js +0 -79
- package/dist/cjs/cliHelpers.d.ts +0 -6
- package/dist/cjs/cliHelpers.d.ts.map +0 -1
- package/dist/cjs/cliHelpers.js +0 -57
- package/dist/cjs/createServer.d.ts +0 -30
- package/dist/cjs/createServer.d.ts.map +0 -1
- package/dist/cjs/createServer.js +0 -145
- package/dist/cjs/createServerHelpers.d.ts +0 -38
- package/dist/cjs/createServerHelpers.d.ts.map +0 -1
- package/dist/cjs/createServerHelpers.js +0 -112
- package/dist/cjs/fastify.d.ts +0 -13
- package/dist/cjs/fastify.d.ts.map +0 -1
- package/dist/cjs/fastify.js +0 -96
- package/dist/cjs/logFormatter/ambient.d.js +0 -1
- package/dist/cjs/logFormatter/bin.d.ts +0 -2
- package/dist/cjs/logFormatter/bin.d.ts.map +0 -1
- package/dist/cjs/logFormatter/bin.js +0 -369
- package/dist/cjs/logFormatter/formatters.d.ts +0 -30
- package/dist/cjs/logFormatter/formatters.d.ts.map +0 -1
- package/dist/cjs/logFormatter/formatters.js +0 -275
- package/dist/cjs/logFormatter/index.d.ts +0 -2
- package/dist/cjs/logFormatter/index.d.ts.map +0 -1
- package/dist/cjs/logFormatter/index.js +0 -184
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/plugins/api.d.ts +0 -14
- package/dist/cjs/plugins/api.d.ts.map +0 -1
- package/dist/cjs/plugins/api.js +0 -78
- package/dist/cjs/plugins/graphql.d.ts +0 -10
- package/dist/cjs/plugins/graphql.d.ts.map +0 -1
- package/dist/cjs/plugins/graphql.js +0 -135
- package/dist/cjs/plugins/lambdaLoader.d.ts +0 -34
- package/dist/cjs/plugins/lambdaLoader.d.ts.map +0 -1
- package/dist/cjs/plugins/lambdaLoader.js +0 -199
- package/dist/cjs/requestHandlers/awsLambdaFastify.d.ts +0 -5
- package/dist/cjs/requestHandlers/awsLambdaFastify.d.ts.map +0 -1
- package/dist/cjs/requestHandlers/awsLambdaFastify.js +0 -105
- package/dist/cjs/requestHandlers/utils.d.ts +0 -26
- package/dist/cjs/requestHandlers/utils.d.ts.map +0 -1
- package/dist/cjs/requestHandlers/utils.js +0 -55
- package/dist/cjs/serverManager.d.ts +0 -8
- package/dist/cjs/serverManager.d.ts.map +0 -1
- package/dist/cjs/serverManager.js +0 -137
- package/dist/cjs/types.d.ts +0 -19
- package/dist/cjs/types.d.ts.map +0 -1
- package/dist/cjs/utils.d.ts +0 -6
- package/dist/cjs/utils.d.ts.map +0 -1
- package/dist/cjs/utils.js +0 -58
- package/dist/cjs/watch.d.ts +0 -10
- package/dist/cjs/watch.d.ts.map +0 -1
- package/dist/cjs/watch.js +0 -399
- package/dist/cjs/watchPaths.d.ts +0 -3
- package/dist/cjs/watchPaths.d.ts.map +0 -1
- package/dist/cjs/watchPaths.js +0 -140
package/dist/cjs/watchPaths.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var watchPaths_exports = {};
|
|
30
|
-
__export(watchPaths_exports, {
|
|
31
|
-
getIgnoreFunction: () => getIgnoreFunction,
|
|
32
|
-
pathsToWatch: () => pathsToWatch
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(watchPaths_exports);
|
|
35
|
-
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
36
|
-
var import_node_path = __toESM(require("node:path"), 1);
|
|
37
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
38
|
-
async function workspacePackagesPaths() {
|
|
39
|
-
const cedarPaths = (0, import_project_config.getPaths)();
|
|
40
|
-
const packagesDir = import_node_path.default.join(cedarPaths.packages);
|
|
41
|
-
const packages = [];
|
|
42
|
-
try {
|
|
43
|
-
const rootPackageJsonPath = import_node_path.default.join(cedarPaths.base, "package.json");
|
|
44
|
-
const rootPackageJson = JSON.parse(
|
|
45
|
-
import_node_fs.default.readFileSync(rootPackageJsonPath, "utf8")
|
|
46
|
-
);
|
|
47
|
-
const hasPackageJsonWorkspaces = Array.isArray(rootPackageJson.workspaces) && rootPackageJson.workspaces.some((w) => w.startsWith("packages/"));
|
|
48
|
-
if (!hasPackageJsonWorkspaces || !import_node_fs.default.existsSync(packagesDir)) {
|
|
49
|
-
return [];
|
|
50
|
-
}
|
|
51
|
-
const globPattern = import_node_path.default.join(packagesDir, "*").replaceAll("\\", "/");
|
|
52
|
-
const packageDirs = await Array.fromAsync(import_node_fs.default.promises.glob(globPattern));
|
|
53
|
-
const apiPackageJsonPath = import_node_path.default.join(cedarPaths.api.base, "package.json");
|
|
54
|
-
const apiPackageJson = JSON.parse(
|
|
55
|
-
import_node_fs.default.readFileSync(apiPackageJsonPath, "utf8")
|
|
56
|
-
);
|
|
57
|
-
const deps = {
|
|
58
|
-
...apiPackageJson.dependencies ?? {},
|
|
59
|
-
...apiPackageJson.devDependencies ?? {},
|
|
60
|
-
...apiPackageJson.peerDependencies ?? {}
|
|
61
|
-
};
|
|
62
|
-
const workspaceDepNames = /* @__PURE__ */ new Set();
|
|
63
|
-
for (const [name, version] of Object.entries(deps)) {
|
|
64
|
-
if (String(version).startsWith("workspace:")) {
|
|
65
|
-
workspaceDepNames.add(name);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
for (const packageDir of packageDirs) {
|
|
69
|
-
const packageJsonPath = import_node_path.default.join(packageDir, "package.json");
|
|
70
|
-
if (!import_node_fs.default.existsSync(packageJsonPath)) {
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
const pkgJson = JSON.parse(import_node_fs.default.readFileSync(packageJsonPath, "utf8"));
|
|
74
|
-
if (workspaceDepNames.has(pkgJson.name)) {
|
|
75
|
-
packages.push(import_node_path.default.join(packageDir, "dist"));
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
} catch {
|
|
79
|
-
}
|
|
80
|
-
return packages;
|
|
81
|
-
}
|
|
82
|
-
async function apiIgnorePaths() {
|
|
83
|
-
const cedarPaths = (0, import_project_config.getPaths)();
|
|
84
|
-
const dbDir = await (0, import_project_config.getDbDir)(cedarPaths.api.prismaConfig);
|
|
85
|
-
if (dbDir === cedarPaths.api.base) {
|
|
86
|
-
throw new Error(
|
|
87
|
-
"Database directory cannot be the same as the API directory"
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
const ignoredApiPaths = [
|
|
91
|
-
// TODO: Is this still true?
|
|
92
|
-
// use this, because using cedarPaths.api.dist seems to not ignore on first
|
|
93
|
-
// build
|
|
94
|
-
"api/dist",
|
|
95
|
-
cedarPaths.api.types,
|
|
96
|
-
dbDir
|
|
97
|
-
];
|
|
98
|
-
return ignoredApiPaths;
|
|
99
|
-
}
|
|
100
|
-
async function getIgnoreFunction() {
|
|
101
|
-
const cedarPaths = (0, import_project_config.getPaths)();
|
|
102
|
-
const ignoredApiPaths = await apiIgnorePaths();
|
|
103
|
-
const ignoredExtensions = [
|
|
104
|
-
".DS_Store",
|
|
105
|
-
".db",
|
|
106
|
-
".sqlite",
|
|
107
|
-
"-journal",
|
|
108
|
-
".test.js",
|
|
109
|
-
".test.ts",
|
|
110
|
-
".scenarios.ts",
|
|
111
|
-
".scenarios.js",
|
|
112
|
-
".d.ts",
|
|
113
|
-
".log"
|
|
114
|
-
];
|
|
115
|
-
return (file) => {
|
|
116
|
-
if (file.includes("node_modules")) {
|
|
117
|
-
return true;
|
|
118
|
-
}
|
|
119
|
-
if (ignoredExtensions.some((ext) => file.endsWith(ext))) {
|
|
120
|
-
return true;
|
|
121
|
-
}
|
|
122
|
-
if (file.includes((0, import_project_config.importStatementPath)(cedarPaths.packages)) && file.includes("/src/")) {
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
if (ignoredApiPaths.some((ignoredPath) => file.includes(ignoredPath))) {
|
|
126
|
-
return true;
|
|
127
|
-
}
|
|
128
|
-
return false;
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
async function pathsToWatch() {
|
|
132
|
-
const cedarPaths = (0, import_project_config.getPaths)();
|
|
133
|
-
const watchPaths = [cedarPaths.api.src, ...await workspacePackagesPaths()];
|
|
134
|
-
return watchPaths.map((p) => (0, import_project_config.importStatementPath)(p));
|
|
135
|
-
}
|
|
136
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
137
|
-
0 && (module.exports = {
|
|
138
|
-
getIgnoreFunction,
|
|
139
|
-
pathsToWatch
|
|
140
|
-
});
|