@cedarjs/api-server 2.5.0 → 2.5.1-next.27

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/cjs/watch.js CHANGED
@@ -217,7 +217,7 @@ var import_node_path = __toESM(require("node:path"), 1);
217
217
  var import_project_config2 = require("@cedarjs/project-config");
218
218
  async function workspacePackagesPaths() {
219
219
  const cedarPaths2 = (0, import_project_config2.getPaths)();
220
- const packagesDir = import_node_path.default.join(cedarPaths2.base, "packages");
220
+ const packagesDir = import_node_path.default.join(cedarPaths2.packages);
221
221
  const packages = [];
222
222
  try {
223
223
  const rootPackageJsonPath = import_node_path.default.join(cedarPaths2.base, "package.json");
@@ -259,18 +259,14 @@ async function workspacePackagesPaths() {
259
259
  }
260
260
  return packages;
261
261
  }
262
- function workspacePackagesIgnorePaths() {
263
- const cedarPaths2 = (0, import_project_config2.getPaths)();
264
- const packagesDir = import_node_path.default.join(cedarPaths2.base, "packages");
265
- const packageIgnoredPaths = [];
266
- if (import_node_fs2.default.existsSync(packagesDir)) {
267
- packageIgnoredPaths.push(import_node_path.default.join(packagesDir, "*/src"));
268
- }
269
- return packageIgnoredPaths;
270
- }
271
262
  async function apiIgnorePaths() {
272
263
  const cedarPaths2 = (0, import_project_config2.getPaths)();
273
264
  const dbDir = await (0, import_project_config2.getDbDir)(cedarPaths2.api.prismaConfig);
265
+ if (dbDir === cedarPaths2.api.base) {
266
+ throw new Error(
267
+ "Database directory cannot be the same as the API directory"
268
+ );
269
+ }
274
270
  const ignoredApiPaths = [
275
271
  // TODO: Is this still true?
276
272
  // use this, because using cedarPaths.api.dist seems to not ignore on first
@@ -281,13 +277,9 @@ async function apiIgnorePaths() {
281
277
  ];
282
278
  return ignoredApiPaths;
283
279
  }
284
- async function ignorePaths() {
285
- const apiIgnore = await apiIgnorePaths();
286
- const packagesIgnore = workspacePackagesIgnorePaths();
287
- return [...apiIgnore, ...packagesIgnore].map((p) => (0, import_project_config2.importStatementPath)(p));
288
- }
289
280
  async function getIgnoreFunction() {
290
- const ignoredWatchPaths = await ignorePaths();
281
+ const cedarPaths2 = (0, import_project_config2.getPaths)();
282
+ const ignoredApiPaths = await apiIgnorePaths();
291
283
  const ignoredExtensions = [
292
284
  ".DS_Store",
293
285
  ".db",
@@ -301,8 +293,19 @@ async function getIgnoreFunction() {
301
293
  ".log"
302
294
  ];
303
295
  return (file) => {
304
- const shouldIgnore = file.includes("node_modules") || ignoredWatchPaths.some((ignoredPath) => file.includes(ignoredPath)) || ignoredExtensions.some((ext) => file.endsWith(ext));
305
- return shouldIgnore;
296
+ if (file.includes("node_modules")) {
297
+ return true;
298
+ }
299
+ if (ignoredExtensions.some((ext) => file.endsWith(ext))) {
300
+ return true;
301
+ }
302
+ if (file.includes((0, import_project_config2.importStatementPath)(cedarPaths2.packages)) && file.includes("/src/")) {
303
+ return true;
304
+ }
305
+ if (ignoredApiPaths.some((ignoredPath) => file.includes(ignoredPath))) {
306
+ return true;
307
+ }
308
+ return false;
306
309
  };
307
310
  }
308
311
  async function pathsToWatch() {
@@ -1 +1 @@
1
- {"version":3,"file":"watchPaths.d.ts","sourceRoot":"","sources":["../../src/watchPaths.ts"],"names":[],"mappings":"AAoHA,wBAAsB,iBAAiB,mBAgBvB,MAAM,cAQrB;AAED,wBAAsB,YAAY,sBAQjC"}
1
+ {"version":3,"file":"watchPaths.d.ts","sourceRoot":"","sources":["../../src/watchPaths.ts"],"names":[],"mappings":"AAmGA,wBAAsB,iBAAiB,mBAqBvB,MAAM,cAwBrB;AAED,wBAAsB,YAAY,sBAQjC"}
@@ -37,7 +37,7 @@ var import_node_path = __toESM(require("node:path"), 1);
37
37
  var import_project_config = require("@cedarjs/project-config");
38
38
  async function workspacePackagesPaths() {
39
39
  const cedarPaths = (0, import_project_config.getPaths)();
40
- const packagesDir = import_node_path.default.join(cedarPaths.base, "packages");
40
+ const packagesDir = import_node_path.default.join(cedarPaths.packages);
41
41
  const packages = [];
42
42
  try {
43
43
  const rootPackageJsonPath = import_node_path.default.join(cedarPaths.base, "package.json");
@@ -79,18 +79,14 @@ async function workspacePackagesPaths() {
79
79
  }
80
80
  return packages;
81
81
  }
82
- function workspacePackagesIgnorePaths() {
83
- const cedarPaths = (0, import_project_config.getPaths)();
84
- const packagesDir = import_node_path.default.join(cedarPaths.base, "packages");
85
- const packageIgnoredPaths = [];
86
- if (import_node_fs.default.existsSync(packagesDir)) {
87
- packageIgnoredPaths.push(import_node_path.default.join(packagesDir, "*/src"));
88
- }
89
- return packageIgnoredPaths;
90
- }
91
82
  async function apiIgnorePaths() {
92
83
  const cedarPaths = (0, import_project_config.getPaths)();
93
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
+ }
94
90
  const ignoredApiPaths = [
95
91
  // TODO: Is this still true?
96
92
  // use this, because using cedarPaths.api.dist seems to not ignore on first
@@ -101,13 +97,9 @@ async function apiIgnorePaths() {
101
97
  ];
102
98
  return ignoredApiPaths;
103
99
  }
104
- async function ignorePaths() {
105
- const apiIgnore = await apiIgnorePaths();
106
- const packagesIgnore = workspacePackagesIgnorePaths();
107
- return [...apiIgnore, ...packagesIgnore].map((p) => (0, import_project_config.importStatementPath)(p));
108
- }
109
100
  async function getIgnoreFunction() {
110
- const ignoredWatchPaths = await ignorePaths();
101
+ const cedarPaths = (0, import_project_config.getPaths)();
102
+ const ignoredApiPaths = await apiIgnorePaths();
111
103
  const ignoredExtensions = [
112
104
  ".DS_Store",
113
105
  ".db",
@@ -121,8 +113,19 @@ async function getIgnoreFunction() {
121
113
  ".log"
122
114
  ];
123
115
  return (file) => {
124
- const shouldIgnore = file.includes("node_modules") || ignoredWatchPaths.some((ignoredPath) => file.includes(ignoredPath)) || ignoredExtensions.some((ext) => file.endsWith(ext));
125
- return shouldIgnore;
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;
126
129
  };
127
130
  }
128
131
  async function pathsToWatch() {
package/dist/watch.js CHANGED
@@ -192,7 +192,7 @@ import {
192
192
  } from "@cedarjs/project-config";
193
193
  async function workspacePackagesPaths() {
194
194
  const cedarPaths2 = getPaths2();
195
- const packagesDir = path2.join(cedarPaths2.base, "packages");
195
+ const packagesDir = path2.join(cedarPaths2.packages);
196
196
  const packages = [];
197
197
  try {
198
198
  const rootPackageJsonPath = path2.join(cedarPaths2.base, "package.json");
@@ -234,18 +234,14 @@ async function workspacePackagesPaths() {
234
234
  }
235
235
  return packages;
236
236
  }
237
- function workspacePackagesIgnorePaths() {
238
- const cedarPaths2 = getPaths2();
239
- const packagesDir = path2.join(cedarPaths2.base, "packages");
240
- const packageIgnoredPaths = [];
241
- if (fs2.existsSync(packagesDir)) {
242
- packageIgnoredPaths.push(path2.join(packagesDir, "*/src"));
243
- }
244
- return packageIgnoredPaths;
245
- }
246
237
  async function apiIgnorePaths() {
247
238
  const cedarPaths2 = getPaths2();
248
239
  const dbDir = await getDbDir(cedarPaths2.api.prismaConfig);
240
+ if (dbDir === cedarPaths2.api.base) {
241
+ throw new Error(
242
+ "Database directory cannot be the same as the API directory"
243
+ );
244
+ }
249
245
  const ignoredApiPaths = [
250
246
  // TODO: Is this still true?
251
247
  // use this, because using cedarPaths.api.dist seems to not ignore on first
@@ -256,13 +252,9 @@ async function apiIgnorePaths() {
256
252
  ];
257
253
  return ignoredApiPaths;
258
254
  }
259
- async function ignorePaths() {
260
- const apiIgnore = await apiIgnorePaths();
261
- const packagesIgnore = workspacePackagesIgnorePaths();
262
- return [...apiIgnore, ...packagesIgnore].map((p) => importStatementPath(p));
263
- }
264
255
  async function getIgnoreFunction() {
265
- const ignoredWatchPaths = await ignorePaths();
256
+ const cedarPaths2 = getPaths2();
257
+ const ignoredApiPaths = await apiIgnorePaths();
266
258
  const ignoredExtensions = [
267
259
  ".DS_Store",
268
260
  ".db",
@@ -276,8 +268,19 @@ async function getIgnoreFunction() {
276
268
  ".log"
277
269
  ];
278
270
  return (file) => {
279
- const shouldIgnore = file.includes("node_modules") || ignoredWatchPaths.some((ignoredPath) => file.includes(ignoredPath)) || ignoredExtensions.some((ext) => file.endsWith(ext));
280
- return shouldIgnore;
271
+ if (file.includes("node_modules")) {
272
+ return true;
273
+ }
274
+ if (ignoredExtensions.some((ext) => file.endsWith(ext))) {
275
+ return true;
276
+ }
277
+ if (file.includes(importStatementPath(cedarPaths2.packages)) && file.includes("/src/")) {
278
+ return true;
279
+ }
280
+ if (ignoredApiPaths.some((ignoredPath) => file.includes(ignoredPath))) {
281
+ return true;
282
+ }
283
+ return false;
281
284
  };
282
285
  }
283
286
  async function pathsToWatch() {
@@ -1 +1 @@
1
- {"version":3,"file":"watchPaths.d.ts","sourceRoot":"","sources":["../src/watchPaths.ts"],"names":[],"mappings":"AAoHA,wBAAsB,iBAAiB,mBAgBvB,MAAM,cAQrB;AAED,wBAAsB,YAAY,sBAQjC"}
1
+ {"version":3,"file":"watchPaths.d.ts","sourceRoot":"","sources":["../src/watchPaths.ts"],"names":[],"mappings":"AAmGA,wBAAsB,iBAAiB,mBAqBvB,MAAM,cAwBrB;AAED,wBAAsB,YAAY,sBAQjC"}
@@ -7,7 +7,7 @@ import {
7
7
  } from "@cedarjs/project-config";
8
8
  async function workspacePackagesPaths() {
9
9
  const cedarPaths = getPaths();
10
- const packagesDir = path.join(cedarPaths.base, "packages");
10
+ const packagesDir = path.join(cedarPaths.packages);
11
11
  const packages = [];
12
12
  try {
13
13
  const rootPackageJsonPath = path.join(cedarPaths.base, "package.json");
@@ -49,18 +49,14 @@ async function workspacePackagesPaths() {
49
49
  }
50
50
  return packages;
51
51
  }
52
- function workspacePackagesIgnorePaths() {
53
- const cedarPaths = getPaths();
54
- const packagesDir = path.join(cedarPaths.base, "packages");
55
- const packageIgnoredPaths = [];
56
- if (fs.existsSync(packagesDir)) {
57
- packageIgnoredPaths.push(path.join(packagesDir, "*/src"));
58
- }
59
- return packageIgnoredPaths;
60
- }
61
52
  async function apiIgnorePaths() {
62
53
  const cedarPaths = getPaths();
63
54
  const dbDir = await getDbDir(cedarPaths.api.prismaConfig);
55
+ if (dbDir === cedarPaths.api.base) {
56
+ throw new Error(
57
+ "Database directory cannot be the same as the API directory"
58
+ );
59
+ }
64
60
  const ignoredApiPaths = [
65
61
  // TODO: Is this still true?
66
62
  // use this, because using cedarPaths.api.dist seems to not ignore on first
@@ -71,13 +67,9 @@ async function apiIgnorePaths() {
71
67
  ];
72
68
  return ignoredApiPaths;
73
69
  }
74
- async function ignorePaths() {
75
- const apiIgnore = await apiIgnorePaths();
76
- const packagesIgnore = workspacePackagesIgnorePaths();
77
- return [...apiIgnore, ...packagesIgnore].map((p) => importStatementPath(p));
78
- }
79
70
  async function getIgnoreFunction() {
80
- const ignoredWatchPaths = await ignorePaths();
71
+ const cedarPaths = getPaths();
72
+ const ignoredApiPaths = await apiIgnorePaths();
81
73
  const ignoredExtensions = [
82
74
  ".DS_Store",
83
75
  ".db",
@@ -91,8 +83,19 @@ async function getIgnoreFunction() {
91
83
  ".log"
92
84
  ];
93
85
  return (file) => {
94
- const shouldIgnore = file.includes("node_modules") || ignoredWatchPaths.some((ignoredPath) => file.includes(ignoredPath)) || ignoredExtensions.some((ext) => file.endsWith(ext));
95
- return shouldIgnore;
86
+ if (file.includes("node_modules")) {
87
+ return true;
88
+ }
89
+ if (ignoredExtensions.some((ext) => file.endsWith(ext))) {
90
+ return true;
91
+ }
92
+ if (file.includes(importStatementPath(cedarPaths.packages)) && file.includes("/src/")) {
93
+ return true;
94
+ }
95
+ if (ignoredApiPaths.some((ignoredPath) => file.includes(ignoredPath))) {
96
+ return true;
97
+ }
98
+ return false;
96
99
  };
97
100
  }
98
101
  async function pathsToWatch() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/api-server",
3
- "version": "2.5.0",
3
+ "version": "2.5.1-next.27+4a00a5632",
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": "2.5.0",
115
- "@cedarjs/fastify-web": "2.5.0",
116
- "@cedarjs/internal": "2.5.0",
117
- "@cedarjs/project-config": "2.5.0",
118
- "@cedarjs/web-server": "2.5.0",
114
+ "@cedarjs/context": "2.5.1-next.27+4a00a5632",
115
+ "@cedarjs/fastify-web": "2.5.1-next.27+4a00a5632",
116
+ "@cedarjs/internal": "2.5.1-next.27+4a00a5632",
117
+ "@cedarjs/project-config": "2.5.1-next.27+4a00a5632",
118
+ "@cedarjs/web-server": "2.5.1-next.27+4a00a5632",
119
119
  "@fastify/multipart": "9.4.0",
120
120
  "@fastify/url-data": "6.0.3",
121
121
  "ansis": "4.2.0",
@@ -123,7 +123,7 @@
123
123
  "dotenv-defaults": "5.0.2",
124
124
  "fast-glob": "3.3.3",
125
125
  "fast-json-parse": "1.0.3",
126
- "fastify": "5.7.2",
126
+ "fastify": "5.7.4",
127
127
  "fastify-raw-body": "5.0.0",
128
128
  "pretty-bytes": "5.6.0",
129
129
  "pretty-ms": "7.0.1",
@@ -132,7 +132,7 @@
132
132
  "yargs": "17.7.2"
133
133
  },
134
134
  "devDependencies": {
135
- "@cedarjs/framework-tools": "0.0.0",
135
+ "@cedarjs/framework-tools": "2.5.1-next.27",
136
136
  "@types/aws-lambda": "8.10.160",
137
137
  "@types/dotenv-defaults": "^5.0.0",
138
138
  "@types/qs": "6.14.0",
@@ -155,5 +155,5 @@
155
155
  "publishConfig": {
156
156
  "access": "public"
157
157
  },
158
- "gitHead": "42e3c32b60325fcab386d1816401a8451f910121"
158
+ "gitHead": "4a00a56324db4db5db1559e21850f4d9b5856b52"
159
159
  }