@travetto/manifest 5.0.11 → 5.1.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 ArcSine Technologies
3
+ Copyright (c) 2023 ArcSine Technologies
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/manifest",
3
- "version": "5.0.11",
3
+ "version": "5.1.0",
4
4
  "description": "Support for project indexing, manifesting, along with file watching",
5
5
  "keywords": [
6
6
  "path",
@@ -26,10 +26,10 @@
26
26
  "node": ">=22.0.0"
27
27
  },
28
28
  "dependencies": {
29
- "@types/node": "^22.10.2"
29
+ "@types/node": "^22.10.7"
30
30
  },
31
31
  "repository": {
32
- "url": "https://github.com/travetto/travetto.git",
32
+ "url": "git+https://github.com/travetto/travetto.git",
33
33
  "directory": "module/manifest"
34
34
  },
35
35
  "travetto": {
package/src/context.ts CHANGED
@@ -17,8 +17,10 @@ function findPackage(base: string, pred: (_p?: Pkg) => boolean): Pkg {
17
17
  let folder = `${base}/.`;
18
18
  let prev: string;
19
19
  let pkg: Pkg | undefined;
20
+ const packages: Pkg[] = [];
20
21
 
21
22
  do {
23
+ pkg && packages.push(pkg);
22
24
  prev = folder;
23
25
  folder = path.dirname(folder);
24
26
  const folderPkg = path.resolve(folder, 'package.json');
@@ -31,6 +33,9 @@ function findPackage(base: string, pred: (_p?: Pkg) => boolean): Pkg {
31
33
 
32
34
  if (!pkg) {
33
35
  throw new Error('Could not find a package.json');
36
+ } else if (!pred(pkg) && packages.length) {
37
+ // We never matched, lets fallback to the first package.json found
38
+ pkg = packages[0];
34
39
  }
35
40
 
36
41
  return pkg;