@travetto/manifest 4.0.0-rc.6 → 4.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/manifest",
3
- "version": "4.0.0-rc.6",
3
+ "version": "4.0.0",
4
4
  "description": "Support for project indexing, manifesting, along with file watching",
5
5
  "keywords": [
6
6
  "path",
package/src/delta.ts CHANGED
@@ -35,7 +35,7 @@ export class ManifestDeltaUtil {
35
35
 
36
36
  const root = path.resolve(ctx.workspace.path, ctx.build.outputFolder, left.outputFolder);
37
37
  const right = new Set(
38
- (await ManifestModuleUtil.scanFolder(root, left.main))
38
+ (await ManifestModuleUtil.scanFolder(ctx, root, left.main))
39
39
  .filter(x => {
40
40
  const type = ManifestModuleUtil.getFileType(x);
41
41
  return VALID_SOURCE_TYPE.has(type);
package/src/module.ts CHANGED
@@ -44,7 +44,7 @@ export class ManifestModuleUtil {
44
44
  /**
45
45
  * Simple file scanning
46
46
  */
47
- static async scanFolder(folder: string, full = false): Promise<string[]> {
47
+ static async scanFolder(ctx: ManifestContext, folder: string, full = false): Promise<string[]> {
48
48
  const key = `${folder}|${full}`;
49
49
  if (key in this.#scanCache) {
50
50
  return this.#scanCache[key];
@@ -56,6 +56,12 @@ export class ManifestModuleUtil {
56
56
 
57
57
  const out: string[] = [];
58
58
 
59
+ const exclude = new Set([
60
+ path.resolve(ctx.workspace.path, ctx.build.compilerFolder),
61
+ path.resolve(ctx.workspace.path, ctx.build.outputFolder),
62
+ path.resolve(ctx.workspace.path, ctx.build.toolFolder),
63
+ ]);
64
+
59
65
  const stack: [string, number][] = [[folder, 0]];
60
66
  while (stack.length) {
61
67
  const popped = stack.pop();
@@ -69,6 +75,9 @@ export class ManifestModuleUtil {
69
75
  if (top !== folder && await fs.stat(`${top}/package.json`).catch(() => false)) {
70
76
  continue;
71
77
  }
78
+ if (exclude.has(top)) {
79
+ continue;
80
+ }
72
81
 
73
82
  for (const sub of await fs.readdir(top)) {
74
83
  const valid = !sub.startsWith('.') && (depth > 0 || full);
@@ -177,7 +186,7 @@ export class ManifestModuleUtil {
177
186
 
178
187
  const files: ManifestModule['files'] = {};
179
188
 
180
- for (const file of await this.scanFolder(sourcePath, rest.main)) {
189
+ for (const file of await this.scanFolder(ctx, sourcePath, rest.main)) {
181
190
  // Group by top folder
182
191
  const moduleFile = file.replace(`${sourcePath}/`, '');
183
192
  const entry = await this.transformFile(moduleFile, file);