@travetto/compiler 7.0.0-rc.2 → 7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/compiler",
3
- "version": "7.0.0-rc.2",
3
+ "version": "7.0.0-rc.3",
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": "^7.0.0-rc.1",
34
- "@travetto/transformer": "^7.0.0-rc.2"
33
+ "@travetto/manifest": "^7.0.0-rc.2",
34
+ "@travetto/transformer": "^7.0.0-rc.3"
35
35
  },
36
36
  "peerDependencies": {
37
- "@travetto/cli": "^7.0.0-rc.2"
37
+ "@travetto/cli": "^7.0.0-rc.3"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "@travetto/cli": {
package/src/compiler.ts CHANGED
@@ -225,6 +225,7 @@ export class Compiler {
225
225
  action: event.action,
226
226
  time: Date.now(),
227
227
  file: event.file,
228
+ import: event.entry.import,
228
229
  output: event.entry.outputFile!,
229
230
  module: event.entry.module.name
230
231
  });
package/src/state.ts CHANGED
@@ -172,7 +172,7 @@ export class CompilerState implements ts.CompilerHost {
172
172
  const tscOutputFile = path.resolve(this.#outputPath, ManifestModuleUtil.withOutputExtension(relativeSource));
173
173
  const outputFile = path.resolve(this.#outputPath, ManifestModuleUtil.withOutputExtension(relativeOutput));
174
174
 
175
- const entry: CompileStateEntry = { sourceFile, outputFile, module, tscOutputFile };
175
+ const entry: CompileStateEntry = { sourceFile, outputFile, module, tscOutputFile, import: `${module.name}/${moduleFile}` };
176
176
 
177
177
  this.#outputToEntry.set(outputFile, entry);
178
178
  this.#sourceFiles.add(sourceFile);
package/src/types.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type ts from 'typescript';
2
2
 
3
- import type { ManifestModule } from '@travetto/manifest';
3
+ import type { ChangeEventType, ManifestModule } from '@travetto/manifest';
4
4
 
5
5
  export type CompileEmitError = Error | readonly ts.Diagnostic[];
6
6
  export type CompileEmitter = (file: string, newProgram?: boolean) => Promise<CompileEmitError | undefined>;
7
7
  export type CompileEmitEvent = { file: string, i: number, total: number, error?: CompileEmitError, duration: number };
8
- export type CompileStateEntry = { sourceFile: string, tscOutputFile: string, outputFile?: string, module: ManifestModule };
9
- export type CompilerWatchEvent = { action: 'create' | 'update' | 'delete', file: string, entry: CompileStateEntry };
8
+ export type CompileStateEntry = { sourceFile: string, tscOutputFile: string, outputFile?: string, module: ManifestModule, import: string };
9
+ export type CompilerWatchEvent = { action: ChangeEventType, file: string, entry: CompileStateEntry };
10
10
  export class CompilerReset extends Error { }
package/support/setup.ts CHANGED
@@ -208,7 +208,7 @@ export class CompilerSetup {
208
208
  const delta = await Log.wrap('delta', async log => {
209
209
  if (changes) {
210
210
  log.debug('Skipping, everything changed');
211
- return [{ type: 'changed', file: '*', module: ctx.workspace.name, sourceFile: '' } as const];
211
+ return [{ type: 'update', file: '*', module: ctx.workspace.name, sourceFile: '' } as const];
212
212
  } else {
213
213
  return ManifestDeltaUtil.produceDelta(manifest);
214
214
  }
@@ -241,6 +241,6 @@ export class CompilerSetup {
241
241
  }
242
242
  });
243
243
 
244
- return delta.filter(event => event.type === 'added' || event.type === 'changed');
244
+ return delta.filter(event => event.type === 'create' || event.type === 'update');
245
245
  }
246
246
  }
package/support/types.ts CHANGED
@@ -1,7 +1,9 @@
1
+ import type { ChangeEventType } from '@travetto/manifest';
2
+
1
3
  export type CompilerMode = 'build' | 'watch';
2
4
 
3
5
  export type CompilerStateType = 'startup' | 'init' | 'compile-start' | 'compile-end' | 'watch-start' | 'watch-end' | 'reset' | 'closed';
4
- export type CompilerChangeEvent = { file: string, action: 'create' | 'update' | 'delete', output: string, module: string, time: number };
6
+ export type CompilerChangeEvent = { file: string, action: ChangeEventType, output: string, module: string, import: string, time: number };
5
7
  export type CompilerLogLevel = 'info' | 'debug' | 'warn' | 'error';
6
8
  export type CompilerLogEvent = { level: CompilerLogLevel, message: string, time?: number, args?: unknown[], scope?: string };
7
9
  export type CompilerProgressEvent = { idx: number, total: number, message: string, operation: 'compile', complete?: boolean };
package/tsconfig.trv.json CHANGED
@@ -5,7 +5,8 @@
5
5
  "moduleResolution": "Bundler",
6
6
  "allowImportingTsExtensions": true,
7
7
  "lib": [
8
- "ES2024"
8
+ "ES2024",
9
+ "ESNext.Collection"
9
10
  ],
10
11
  "jsx": "react-jsx",
11
12
  "strict": true,