@travetto/compiler 5.0.19 → 6.0.0-rc.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.
@@ -73,7 +73,7 @@ async function load(/** @type {(ops: import('../support/entry.main').Operations)
73
73
  try { module.enableCompileCache(); } catch { }
74
74
  return cb(res);
75
75
  } catch (err) {
76
- await rm(ctx.srcPath('.'), { recursive: true, force: true });
76
+ await rm(ctx.destPath('.'), { recursive: true, force: true });
77
77
  throw err;
78
78
  }
79
79
  }
@@ -10,7 +10,9 @@ function findPackage(base, pred) {
10
10
  let folder = `${base}/.`;
11
11
  let prev;
12
12
  let pkg;
13
+ const packages = [];
13
14
  do {
15
+ pkg && packages.push(pkg);
14
16
  prev = folder;
15
17
  folder = path.dirname(folder);
16
18
  const folderPkg = path.resolve(folder, 'package.json');
@@ -22,6 +24,10 @@ function findPackage(base, pred) {
22
24
  if (!pkg) {
23
25
  throw new Error('Could not find a package.json');
24
26
  }
27
+ else if (!pred(pkg) && packages.length) {
28
+ // We never matched, lets fallback to the first package.json found
29
+ pkg = packages[0];
30
+ }
25
31
  return pkg;
26
32
  }
27
33
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/compiler",
3
- "version": "5.0.19",
3
+ "version": "6.0.0-rc.0",
4
4
  "description": "The compiler infrastructure for the Travetto framework",
5
5
  "keywords": [
6
6
  "compiler",
@@ -30,11 +30,11 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@parcel/watcher": "^2.5.0",
33
- "@travetto/manifest": "^5.0.12",
34
- "@travetto/transformer": "^5.0.13"
33
+ "@travetto/manifest": "^6.0.0-rc.0",
34
+ "@travetto/transformer": "^6.0.0-rc.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@travetto/cli": "^5.0.19"
37
+ "@travetto/cli": "^6.0.0-rc.0"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "@travetto/cli": {
package/src/state.ts CHANGED
@@ -18,7 +18,8 @@ export class CompilerState implements ts.CompilerHost {
18
18
  return new CompilerState().init(idx);
19
19
  }
20
20
 
21
- private constructor() { }
21
+ /** @private */
22
+ constructor() { }
22
23
 
23
24
  #outputPath: string;
24
25
  #typingsPath: string;
package/src/watch.ts CHANGED
@@ -167,6 +167,9 @@ export class CompilerWatcher {
167
167
  this.#q.add(item);
168
168
  }
169
169
  } catch (out) {
170
+ if (out instanceof Error && out.message.includes('Events were dropped by the FSEvents client.')) {
171
+ out = new CompilerReset('FSEvents failure, requires restart');
172
+ }
170
173
  return this.#q.throw(out instanceof Error ? out : new Error(`${out}`));
171
174
  }
172
175
  }, { ignore });
@@ -63,7 +63,9 @@ export const main = (ctx: ManifestContext) => {
63
63
  if (await client.clean()) {
64
64
  return console.log(`Clean triggered ${ctx.workspace.path}:`, buildFolders);
65
65
  } else {
66
- await Promise.all(buildFolders.map(f => fs.rm(CommonUtil.resolveWorkspace(ctx, f), { force: true, recursive: true })));
66
+ try {
67
+ await Promise.all(buildFolders.map(f => fs.rm(CommonUtil.resolveWorkspace(ctx, f), { force: true, recursive: true })));
68
+ } catch { }
67
69
  return console.log(`Cleaned ${ctx.workspace.path}:`, buildFolders);
68
70
  }
69
71
  },
@@ -72,7 +72,7 @@ export class CompilerClient {
72
72
 
73
73
  /** Clean the server */
74
74
  clean(): Promise<boolean> {
75
- return this.#fetch('/clean').then(v => v.ok, () => false);
75
+ return this.#fetch('/clean', { timeout: 300 }).then(v => v.ok, () => false);
76
76
  }
77
77
 
78
78
  /** Stop server and wait for shutdown */