@lithia-js/core 1.0.0-canary.26 → 1.0.0-canary.28

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/_index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { L as LithiaError, a as LithiaOptions, R as Route, E as Event } from './protocol-BGSauS_S.js';
2
- export { C as CFG_GLOBAL_KEY, b as RouteNotFoundError } from './protocol-BGSauS_S.js';
1
+ import { L as LithiaError, a as LithiaOptions, R as Route, E as Event } from './protocol-Bt_dmeQT.js';
2
+ export { C as CFG_GLOBAL_KEY, b as RouteNotFoundError } from './protocol-Bt_dmeQT.js';
3
3
  import { T as TaskCore } from './tasks-X-3clDS8.js';
4
4
  import '@lithia-js/utils';
5
5
  import 'c12';
package/dist/_index.mjs CHANGED
@@ -55,12 +55,13 @@ var ManifestVersionMismatchError = class extends LithiaError {
55
55
 
56
56
  // package.json
57
57
  var package_default = {
58
- version: "1.0.0-canary.26"};
58
+ version: "1.0.0-canary.28"};
59
59
 
60
60
  // src/meta.ts
61
61
  var version = package_default.version;
62
62
 
63
63
  // src/discovery/events.ts
64
+ var isDirectAppChildPath = (filePath, rootDir) => filePath.split(path.sep).join("/").startsWith(`app/${rootDir}/`);
64
65
  var withBase = (targetPath, base) => {
65
66
  if (!base || base === "/") return targetPath;
66
67
  return `${base.replace(/\/$/, "")}/${targetPath.replace(/^\//, "")}`;
@@ -170,10 +171,9 @@ var EventManifestGenerator = class {
170
171
  * the manifest file cannot be written.
171
172
  */
172
173
  async generateManifest(outRoot, scannedFiles) {
173
- const eventFiles = scannedFiles.filter((file) => {
174
- const normalized = file.path.split(path.sep).join("/");
175
- return normalized.includes("events/") || normalized.includes("app/events/");
176
- });
174
+ const eventFiles = scannedFiles.filter(
175
+ (file) => isDirectAppChildPath(file.path, "events")
176
+ );
177
177
  if (eventFiles.length === 0) return null;
178
178
  const events = this.processor.process(eventFiles);
179
179
  const manifest = { version, events };
@@ -191,6 +191,7 @@ var EventManifestGenerator = class {
191
191
  return manifest;
192
192
  }
193
193
  };
194
+ var isDirectAppChildPath2 = (filePath, rootDir) => filePath.split(path.sep).join("/").startsWith(`app/${rootDir}/`);
194
195
  var withBase2 = (routePath, base) => {
195
196
  if (!base || base === "/") return routePath;
196
197
  return `${base.replace(/\/$/, "")}/${routePath.replace(/^\//, "")}`;
@@ -336,10 +337,9 @@ var RouteManifestGenerator = class {
336
337
  * the manifest file cannot be written.
337
338
  */
338
339
  async generateManifest(outRoot, scannedFiles) {
339
- const routeFiles = scannedFiles.filter((file) => {
340
- const normalized = file.path.split(path.sep).join("/");
341
- return normalized.includes("routes/") || normalized.includes("app/routes/");
342
- });
340
+ const routeFiles = scannedFiles.filter(
341
+ (file) => isDirectAppChildPath2(file.path, "routes")
342
+ );
343
343
  const routes = routeFiles.map(
344
344
  (file) => this.processor.processRouteFile(file)
345
345
  );
@@ -403,6 +403,7 @@ function toOutputFilePath(root, relativePath) {
403
403
  }
404
404
 
405
405
  // src/discovery/tasks.ts
406
+ var isDirectAppChildPath3 = (filePath, rootDir) => filePath.split(path.sep).join("/").startsWith(`app/${rootDir}/`);
406
407
  var TaskConvention = class {
407
408
  taskRegex = /^(.*?)(?:\.(cron))?\.(mts|mjs|ts|js)$/i;
408
409
  /**
@@ -509,10 +510,9 @@ var TaskManifestGenerator = class {
509
510
  * file cannot be written.
510
511
  */
511
512
  async generateManifest(outRoot, scannedFiles) {
512
- const taskFiles = scannedFiles.filter((file) => {
513
- const normalized = file.path.split(path.sep).join("/");
514
- return normalized.includes("tasks/") || normalized.includes("app/tasks/");
515
- });
513
+ const taskFiles = scannedFiles.filter(
514
+ (file) => isDirectAppChildPath3(file.path, "tasks")
515
+ );
516
516
  if (taskFiles.length === 0) return null;
517
517
  const tasks = await this.attachCronSchedules(
518
518
  this.processor.process(taskFiles)