@travetto/compiler 5.0.0-rc.2 → 5.0.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.
- package/README.md +18 -19
- package/package.json +4 -4
- package/src/compiler.ts +2 -2
- package/src/state.ts +1 -1
- package/src/watch.ts +3 -3
- package/support/setup.ts +1 -1
- package/support/ts-util.ts +1 -1
- package/support/util.ts +1 -1
package/README.md
CHANGED
|
@@ -50,25 +50,24 @@ $ 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/
|
|
54
|
-
2029-03-14T04:00:06.859Z debug [transformers ] Skipped @travetto/
|
|
55
|
-
2029-03-14T04:00:07.720Z debug [transformers ] Skipped @travetto/
|
|
56
|
-
2029-03-14T04:00:08.179Z debug [transformers ] Skipped @travetto/
|
|
57
|
-
2029-03-14T04:00:08.588Z debug [transformers ]
|
|
58
|
-
2029-03-14T04:00:09.493Z debug [
|
|
59
|
-
2029-03-14T04:00:10.395Z debug [delta ]
|
|
60
|
-
2029-03-14T04:00:10.407Z debug [
|
|
61
|
-
2029-03-14T04:00:10.799Z debug [manifest ]
|
|
62
|
-
2029-03-14T04:00:11.013Z debug [manifest ]
|
|
63
|
-
2029-03-14T04:00:11.827Z
|
|
64
|
-
2029-03-14T04:00:11.894Z
|
|
65
|
-
2029-03-14T04:00:12.133Z debug [
|
|
66
|
-
2029-03-14T04:00:13.123Z
|
|
67
|
-
2029-03-14T04:00:14.014Z
|
|
68
|
-
2029-03-14T04:00:14.924Z
|
|
69
|
-
2029-03-14T04:00:15.690Z
|
|
70
|
-
2029-03-14T04:00:15.865Z debug [
|
|
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/registry
|
|
55
|
+
2029-03-14T04:00:07.720Z debug [transformers ] Skipped @travetto/runtime
|
|
56
|
+
2029-03-14T04:00:08.179Z debug [transformers ] Skipped @travetto/schema
|
|
57
|
+
2029-03-14T04:00:08.588Z debug [transformers ] Completed
|
|
58
|
+
2029-03-14T04:00:09.493Z debug [delta ] Started
|
|
59
|
+
2029-03-14T04:00:10.395Z debug [delta ] Completed
|
|
60
|
+
2029-03-14T04:00:10.407Z debug [manifest ] Started
|
|
61
|
+
2029-03-14T04:00:10.799Z debug [manifest ] Wrote manifest @travetto-doc/compiler
|
|
62
|
+
2029-03-14T04:00:11.013Z debug [manifest ] Completed
|
|
63
|
+
2029-03-14T04:00:11.827Z info [server ] State changed: compile-end
|
|
64
|
+
2029-03-14T04:00:11.894Z debug [compiler-exec ] Skipped
|
|
65
|
+
2029-03-14T04:00:12.133Z debug [event-stream ] Finished event stream
|
|
66
|
+
2029-03-14T04:00:13.123Z info [server ] Closing down server
|
|
67
|
+
2029-03-14T04:00:14.014Z debug [server ] Server close event
|
|
68
|
+
2029-03-14T04:00:14.924Z info [server ] Closed down server
|
|
69
|
+
2029-03-14T04:00:15.690Z debug [server ] Finished processing events
|
|
70
|
+
2029-03-14T04:00:15.865Z debug [main ] End Server
|
|
72
71
|
```
|
|
73
72
|
|
|
74
73
|
**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.
|
|
3
|
+
"version": "5.0.0-rc.3",
|
|
4
4
|
"description": "The compiler infrastructure for the Travetto framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compiler",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@parcel/watcher": "^2.4.1",
|
|
34
|
-
"@travetto/manifest": "^5.0.0-rc.
|
|
35
|
-
"@travetto/transformer": "^5.0.0-rc.
|
|
34
|
+
"@travetto/manifest": "^5.0.0-rc.2",
|
|
35
|
+
"@travetto/transformer": "^5.0.0-rc.2",
|
|
36
36
|
"@types/node": "^20.14.10"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@travetto/cli": "^5.0.0-rc.
|
|
39
|
+
"@travetto/cli": "^5.0.0-rc.2"
|
|
40
40
|
},
|
|
41
41
|
"peerDependenciesMeta": {
|
|
42
42
|
"@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 {
|
|
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(
|
|
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,
|
|
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,
|
|
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,
|
|
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 => {
|
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 {
|
|
5
|
+
import type { DeltaEvent, ManifestContext, Package } from '@travetto/manifest';
|
|
6
6
|
|
|
7
7
|
import { Log } from './log';
|
|
8
8
|
import { CommonUtil } from './util';
|
package/support/ts-util.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
|
|
3
|
-
import {
|
|
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 {
|
|
7
|
+
import type { ManifestContext } from '@travetto/manifest';
|
|
8
8
|
|
|
9
9
|
import { Log } from './log';
|
|
10
10
|
|