@travetto/manifest 3.4.0-rc.1 → 3.4.0-rc.3

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/package.ts +10 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/manifest",
3
- "version": "3.4.0-rc.1",
3
+ "version": "3.4.0-rc.3",
4
4
  "description": "Support for project indexing, manifesting, along with file watching",
5
5
  "keywords": [
6
6
  "path",
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "main": "__index__.ts",
26
26
  "engines": {
27
- "node": ">=18.0.0"
27
+ "node": ">=20.0.0"
28
28
  },
29
29
  "repository": {
30
30
  "url": "https://github.com/travetto/travetto.git",
package/src/package.ts CHANGED
@@ -66,10 +66,9 @@ export class PackageUtil {
66
66
  /**
67
67
  * Extract all dependencies from a package
68
68
  */
69
- static getAllDependencies<T = unknown>(modulePath: string, rootPath: string): PackageVisitReq<T>[] {
69
+ static getAllDependencies<T = unknown>(modulePath: string, local: boolean): PackageVisitReq<T>[] {
70
70
  const pkg = this.readPackage(modulePath);
71
71
  const children: Record<string, PackageVisitReq<T>> = {};
72
- const local = modulePath === rootPath && !modulePath.includes('node_modules');
73
72
  for (const [deps, prod] of [
74
73
  [pkg.dependencies, true],
75
74
  ...(local ? [[pkg.devDependencies, false] as const] : []),
@@ -136,7 +135,15 @@ export class PackageUtil {
136
135
  out.add(dep);
137
136
  await visitor.visit?.(req, dep);
138
137
  seen.set(key, dep);
139
- const children = this.getAllDependencies<T>(req.sourcePath, root.sourcePath);
138
+ const children = this.getAllDependencies<T>(
139
+ req.sourcePath,
140
+ // We consider a module local if its not in the node_modules
141
+ !req.sourcePath.includes('node_modules') && (
142
+ // And its the root or we are in a monorepo
143
+ root.sourcePath === req.sourcePath ||
144
+ !!root.pkg.workspaces
145
+ )
146
+ );
140
147
  queue.push(...children.map(x => ({ ...x, parent: dep })));
141
148
  }
142
149
  }