@travetto/compiler 5.0.0-rc.2 → 5.0.0-rc.4

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/README.md CHANGED
@@ -50,25 +50,23 @@ $ TRV_BUILD=debug trvc build
50
50
  2029-03-14T04:00:04.495Z debug [manifest ] Started
51
51
  2029-03-14T04:00:05.066Z debug [manifest ] Completed
52
52
  2029-03-14T04:00:05.307Z debug [transformers ] Started
53
- 2029-03-14T04:00:05.952Z debug [transformers ] Skipped @travetto/base
54
- 2029-03-14T04:00:06.859Z debug [transformers ] Skipped @travetto/cli
55
- 2029-03-14T04:00:07.720Z debug [transformers ] Skipped @travetto/manifest
56
- 2029-03-14T04:00:08.179Z debug [transformers ] Skipped @travetto/registry
57
- 2029-03-14T04:00:08.588Z debug [transformers ] Skipped @travetto/schema
58
- 2029-03-14T04:00:09.493Z debug [transformers ] Completed
59
- 2029-03-14T04:00:10.395Z debug [delta ] Started
60
- 2029-03-14T04:00:10.407Z debug [delta ] Completed
61
- 2029-03-14T04:00:10.799Z debug [manifest ] Started
62
- 2029-03-14T04:00:11.013Z debug [manifest ] Wrote manifest @travetto-doc/compiler
63
- 2029-03-14T04:00:11.827Z debug [manifest ] Completed
64
- 2029-03-14T04:00:11.894Z info [server ] State changed: compile-end
65
- 2029-03-14T04:00:12.133Z debug [compiler-exec ] Skipped
66
- 2029-03-14T04:00:13.123Z debug [event-stream ] Finished event stream
67
- 2029-03-14T04:00:14.014Z info [server ] Closing down server
68
- 2029-03-14T04:00:14.924Z debug [server ] Server close event
69
- 2029-03-14T04:00:15.690Z info [server ] Closed down server
70
- 2029-03-14T04:00:15.865Z debug [server ] Finished processing events
71
- 2029-03-14T04:00:16.757Z debug [main ] End Server
53
+ 2029-03-14T04:00:05.952Z debug [transformers ] Skipped @travetto/cli
54
+ 2029-03-14T04:00:06.859Z debug [transformers ] Skipped @travetto/runtime
55
+ 2029-03-14T04:00:07.720Z debug [transformers ] Skipped @travetto/schema
56
+ 2029-03-14T04:00:08.179Z debug [transformers ] Completed
57
+ 2029-03-14T04:00:08.588Z debug [delta ] Started
58
+ 2029-03-14T04:00:09.493Z debug [delta ] Completed
59
+ 2029-03-14T04:00:10.395Z debug [manifest ] Started
60
+ 2029-03-14T04:00:10.407Z debug [manifest ] Wrote manifest @travetto-doc/compiler
61
+ 2029-03-14T04:00:10.799Z debug [manifest ] Completed
62
+ 2029-03-14T04:00:11.013Z info [server ] State changed: compile-end
63
+ 2029-03-14T04:00:11.827Z debug [compiler-exec ] Skipped
64
+ 2029-03-14T04:00:11.894Z debug [event-stream ] Finished event stream
65
+ 2029-03-14T04:00:12.133Z info [server ] Closing down server
66
+ 2029-03-14T04:00:13.123Z debug [server ] Server close event
67
+ 2029-03-14T04:00:14.014Z info [server ] Closed down server
68
+ 2029-03-14T04:00:14.924Z debug [server ] Finished processing events
69
+ 2029-03-14T04:00:15.690Z debug [main ] End Server
72
70
  ```
73
71
 
74
72
  **Terminal: Sample trv output with default log level**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/compiler",
3
- "version": "5.0.0-rc.2",
3
+ "version": "5.0.0-rc.4",
4
4
  "description": "The compiler infrastructure for the Travetto framework",
5
5
  "keywords": [
6
6
  "compiler",
@@ -29,14 +29,17 @@
29
29
  "url": "https://github.com/travetto/travetto.git",
30
30
  "directory": "module/compiler"
31
31
  },
32
+ "engines": {
33
+ "node": ">=22.0.0"
34
+ },
32
35
  "dependencies": {
33
36
  "@parcel/watcher": "^2.4.1",
34
- "@travetto/manifest": "^5.0.0-rc.1",
35
- "@travetto/transformer": "^5.0.0-rc.1",
36
- "@types/node": "^20.14.10"
37
+ "@travetto/manifest": "^5.0.0-rc.2",
38
+ "@travetto/transformer": "^5.0.0-rc.3",
39
+ "@types/node": "^22.1.0"
37
40
  },
38
41
  "peerDependencies": {
39
- "@travetto/cli": "^5.0.0-rc.1"
42
+ "@travetto/cli": "^5.0.0-rc.4"
40
43
  },
41
44
  "peerDependenciesMeta": {
42
45
  "@travetto/cli": {
package/src/compiler.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import fs from 'node:fs/promises';
2
2
  import { setMaxListeners } from 'node:events';
3
3
 
4
- import { ManifestModuleUtil, RuntimeIndex } from '@travetto/manifest';
4
+ import { ManifestIndex, ManifestModuleUtil } from '@travetto/manifest';
5
5
 
6
6
  import { CompilerUtil } from './util';
7
7
  import { CompilerState } from './state';
@@ -24,7 +24,7 @@ export class Compiler {
24
24
  */
25
25
  static async main(): Promise<void> {
26
26
  const [dirty, watch] = process.argv.slice(2);
27
- const state = await CompilerState.get(RuntimeIndex);
27
+ const state = await CompilerState.get(new ManifestIndex());
28
28
  log.debug('Running compiler with dirty file', dirty);
29
29
  const dirtyFiles = ManifestModuleUtil.getFileType(dirty) === 'ts' ? [dirty] : (await fs.readFile(dirty, 'utf8')).split(/\n/).filter(x => !!x);
30
30
  await new Compiler(state, dirtyFiles, watch === 'true').run();
package/src/state.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import ts from 'typescript';
2
2
 
3
- import { path, ManifestModuleUtil, ManifestModule, ManifestRoot, ManifestIndex } from '@travetto/manifest';
3
+ import { path, ManifestModuleUtil, type ManifestModule, type ManifestRoot, ManifestIndex } from '@travetto/manifest';
4
4
  import { TransformerManager } from '@travetto/transformer';
5
5
 
6
6
  import { TypescriptUtil } from '../support/ts-util';
package/src/watch.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import os from 'node:os';
2
2
 
3
- import { ManifestModuleFileType, ManifestModuleFolderType, ManifestModuleUtil, ManifestUtil, PackageUtil, RuntimeIndex, path } from '@travetto/manifest';
3
+ import { type ManifestModuleFileType, type ManifestModuleFolderType, ManifestModuleUtil, ManifestUtil, PackageUtil, path } from '@travetto/manifest';
4
4
 
5
5
  import type { CompileStateEntry } from './types';
6
6
  import { CompilerState } from './state';
@@ -88,13 +88,13 @@ export class CompilerWatcher {
88
88
  const mods = [...new Set(events.map(v => v.entry.module.name))];
89
89
 
90
90
  const moduleToFiles = new Map(mods.map(m => [m, {
91
- context: ManifestUtil.getModuleContext(this.#state.manifest, RuntimeIndex.getManifestModule(m)!.sourceFolder),
91
+ context: ManifestUtil.getModuleContext(this.#state.manifest, this.#state.manifestIndex.getManifestModule(m)!.sourceFolder),
92
92
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
93
93
  files: [] as FileShape[]
94
94
  }] as const));
95
95
 
96
96
  const parents = new Map<string, string[]>(
97
- mods.map(m => [m, RuntimeIndex.getDependentModules(m, 'parents').map(x => x.name)])
97
+ mods.map(m => [m, this.#state.manifestIndex.getDependentModules(m, 'parents').map(x => x.name)])
98
98
  );
99
99
 
100
100
  const allFiles = events.map(ev => {
@@ -92,7 +92,6 @@ export class CompilerClient {
92
92
  return true;
93
93
  }
94
94
 
95
- /** Fetch compiler events */
96
95
  /** Fetch compiler events */
97
96
  fetchEvents<
98
97
  V extends CompilerEventType,
package/support/setup.ts CHANGED
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module';
2
2
  import fs from 'node:fs/promises';
3
3
  import path from 'node:path';
4
4
 
5
- import { type DeltaEvent, type ManifestContext, type Package } from '@travetto/manifest';
5
+ import type { DeltaEvent, ManifestContext, Package } from '@travetto/manifest';
6
6
 
7
7
  import { Log } from './log';
8
8
  import { CommonUtil } from './util';
@@ -1,6 +1,6 @@
1
1
  import fs from 'node:fs/promises';
2
2
 
3
- import { type ManifestContext } from '@travetto/manifest';
3
+ import type { ManifestContext } from '@travetto/manifest';
4
4
  import { CommonUtil } from './util';
5
5
 
6
6
  const OPT_CACHE: Record<string, import('typescript').CompilerOptions> = {};
package/support/util.ts CHANGED
@@ -4,7 +4,7 @@ import timers from 'node:timers/promises';
4
4
  import posix from 'node:path/posix';
5
5
  import native from 'node:path';
6
6
 
7
- import { type ManifestContext } from '@travetto/manifest';
7
+ import type { ManifestContext } from '@travetto/manifest';
8
8
 
9
9
  import { Log } from './log';
10
10