@travetto/compiler 6.0.0-rc.3 → 6.0.1
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 +2 -0
- package/package.json +4 -4
- package/src/watch.ts +2 -1
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ This module expands upon the [Typescript](https://typescriptlang.org) compiler,
|
|
|
18
18
|
* Automatic conversion to either [Ecmascript Module](https://nodejs.org/api/esm.html) or [CommonJS](https://nodejs.org/api/modules.html) based on the [Package JSON](https://docs.npmjs.com/cli/v9/configuring-npm/package-json) `type` value
|
|
19
19
|
* Removal of type only imports which can break [Ecmascript Module](https://nodejs.org/api/esm.html)-style output
|
|
20
20
|
* Automatic addition of `.js` extension to imports to also support [Ecmascript Module](https://nodejs.org/api/esm.html)-style output
|
|
21
|
+
|
|
21
22
|
Beyond the [Typescript](https://typescriptlang.org) compiler functionality, the module provides the primary entry point into the development process.
|
|
22
23
|
|
|
23
24
|
## CLI
|
|
@@ -33,6 +34,7 @@ The compiler cli supports the following operations:
|
|
|
33
34
|
* `event <log|progress|state>` - Watch events in realtime as newline delimited JSON
|
|
34
35
|
* `exec <file> [...args]` - Allow for compiling and executing an entrypoint file
|
|
35
36
|
* `manifest --prod [output]` - Generate the project manifest
|
|
37
|
+
|
|
36
38
|
In addition to the normal output, the compiler supports an environment variable `TRV_BUILD` that supports the following values: `debug`, `info`, `warn` or `none`. This provides different level of logging during the build process which is helpful to diagnose any odd behaviors. When invoking an unknown command (e.g. `<other>` from above), the default level is `warn`. Otherwise the default logging level is `info`.
|
|
37
39
|
|
|
38
40
|
**Terminal: Sample trv output with debug logging**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/compiler",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.1",
|
|
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.1",
|
|
33
|
-
"@travetto/manifest": "^6.0.0
|
|
34
|
-
"@travetto/transformer": "^6.0.0
|
|
33
|
+
"@travetto/manifest": "^6.0.0",
|
|
34
|
+
"@travetto/transformer": "^6.0.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@travetto/cli": "^6.0.0
|
|
37
|
+
"@travetto/cli": "^6.0.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
40
40
|
"@travetto/cli": {
|
package/src/watch.ts
CHANGED
|
@@ -117,13 +117,14 @@ export class CompilerWatcher {
|
|
|
117
117
|
const relativeFile = file.includes(moduleRoot) ? file.split(`${moduleRoot}/`)[1] : file;
|
|
118
118
|
const folderKey = ManifestModuleUtil.getFolderKey(relativeFile);
|
|
119
119
|
const fileType = ManifestModuleUtil.getFileType(relativeFile);
|
|
120
|
+
const roleType = ManifestModuleUtil.getFileRole(relativeFile)!;
|
|
120
121
|
|
|
121
122
|
const manifestModuleFiles = manifest.modules[moduleName].files[folderKey] ??= [];
|
|
122
123
|
const idx = manifestModuleFiles.findIndex(x => x[0] === relativeFile);
|
|
123
124
|
const wrappedIdx = idx < 0 ? manifestModuleFiles.length : idx;
|
|
124
125
|
|
|
125
126
|
switch (action) {
|
|
126
|
-
case 'create': manifestModuleFiles[wrappedIdx] = [relativeFile, fileType, Date.now()]; break;
|
|
127
|
+
case 'create': manifestModuleFiles[wrappedIdx] = [relativeFile, fileType, Date.now(), roleType]; break;
|
|
127
128
|
case 'delete': idx >= 0 && manifestModuleFiles.splice(idx, 1); break;
|
|
128
129
|
}
|
|
129
130
|
}
|