@travetto/compiler 8.0.0-alpha.24 → 8.0.0-alpha.25

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": "8.0.0-alpha.24",
3
+ "version": "8.0.0-alpha.25",
4
4
  "type": "module",
5
5
  "description": "The compiler infrastructure for the Travetto framework",
6
6
  "keywords": [
@@ -31,11 +31,11 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@parcel/watcher": "^2.6.0",
34
- "@travetto/manifest": "^8.0.0-alpha.11",
35
- "@travetto/transformer": "^8.0.0-alpha.17"
34
+ "@travetto/manifest": "^8.0.0-alpha.12",
35
+ "@travetto/transformer": "^8.0.0-alpha.18"
36
36
  },
37
37
  "peerDependencies": {
38
- "@travetto/cli": "^8.0.0-alpha.29"
38
+ "@travetto/cli": "^8.0.0-alpha.32"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "@travetto/cli": {
package/src/event.ts CHANGED
@@ -3,14 +3,14 @@ import type { CompilerEvent, CompilerEventPayload, CompilerEventType } from './t
3
3
  const VALID_EVENT_TYPES = new Set<CompilerEventType>(['change', 'log', 'progress', 'state', 'all', 'file']);
4
4
 
5
5
  export class EventUtil {
6
- static isComplilerEventType = (value: string): value is CompilerEventType => VALID_EVENT_TYPES.has(value as CompilerEventType);
6
+ static isCompilerEventType = (value: string): value is CompilerEventType => VALID_EVENT_TYPES.has(value as CompilerEventType);
7
7
 
8
8
  static isCompilerEvent = (value: unknown): value is CompilerEvent =>
9
9
  typeof value === 'object' &&
10
10
  value !== null &&
11
11
  'type' in value &&
12
12
  typeof value.type === 'string' &&
13
- EventUtil.isComplilerEventType(value.type);
13
+ EventUtil.isCompilerEventType(value.type);
14
14
 
15
15
  static sendEvent<K extends CompilerEventType, T extends CompilerEventPayload<K>>(type: K, payload: T): void {
16
16
  process.connected && process.send!({ type, payload }, undefined, undefined, () => {});
@@ -178,7 +178,7 @@ export class CompilerServer {
178
178
  let close = false;
179
179
  switch (action) {
180
180
  case 'event': {
181
- if (EventUtil.isComplilerEventType(subAction)) {
181
+ if (EventUtil.isCompilerEventType(subAction)) {
182
182
  this.#addListener(subAction, response);
183
183
  }
184
184
  return;
package/src/state.ts CHANGED
@@ -30,7 +30,7 @@ export class CompilerState implements CompilerHost {
30
30
  #sourceDirectory = new Map<string, string>();
31
31
  #sourceToEntry = new Map<string, CompileStateEntry>();
32
32
  #outputToEntry = new Map<string, CompileStateEntry>();
33
- #tscOutputFileToOuptut = new Map<string, string>();
33
+ #tscOutputFileToOutput = new Map<string, string>();
34
34
 
35
35
  #sourceContents = new Map<string, string | undefined>();
36
36
  #sourceFileObjects = new Map<string, SourceFile>();
@@ -198,7 +198,7 @@ export class CompilerState implements CompilerHost {
198
198
  case 'package-json': {
199
199
  const text = this.readFile(sourceFile)!;
200
200
  const finalText = CompilerUtil.rewritePackageJSON(this.#manifest, text);
201
- const location = this.#tscOutputFileToOuptut.get(output) ?? output;
201
+ const location = this.#tscOutputFileToOutput.get(output) ?? output;
202
202
  this.#writeFile(location, finalText);
203
203
  this.#writeExternalTypings(location, finalText);
204
204
  break;
@@ -277,14 +277,14 @@ export class CompilerState implements CompilerHost {
277
277
  this.#sourceToEntry.set(sourceFile, entry);
278
278
  this.#sourceDirectory.set(sourceFolder, sourceFolder);
279
279
 
280
- this.#tscOutputFileToOuptut.set(tscOutputFile, outputFile);
281
- this.#tscOutputFileToOuptut.set(`${tscOutputFile}.map`, `${outputFile}.map`);
280
+ this.#tscOutputFileToOutput.set(tscOutputFile, outputFile);
281
+ this.#tscOutputFileToOutput.set(`${tscOutputFile}.map`, `${outputFile}.map`);
282
282
 
283
283
  if (!isTypings) {
284
284
  const srcBase = `${ManifestModuleUtil.withoutSourceExtension(tscOutputFile)}${ManifestModuleUtil.TYPINGS_EXT}`;
285
285
  const outBase = `${ManifestModuleUtil.withoutSourceExtension(outputFile)}${ManifestModuleUtil.TYPINGS_EXT}`;
286
- this.#tscOutputFileToOuptut.set(`${srcBase}.map`, `${outBase}.map`);
287
- this.#tscOutputFileToOuptut.set(srcBase, outBase);
286
+ this.#tscOutputFileToOutput.set(`${srcBase}.map`, `${outBase}.map`);
287
+ this.#tscOutputFileToOutput.set(srcBase, outBase);
288
288
  }
289
289
 
290
290
  return entry;
@@ -319,10 +319,10 @@ export class CompilerState implements CompilerHost {
319
319
  this.#sourceFiles.delete(sourceFile);
320
320
 
321
321
  const tscOutputDts = `${ManifestModuleUtil.withoutSourceExtension(entry.tscOutputFile)}${ManifestModuleUtil.TYPINGS_EXT}`;
322
- this.#tscOutputFileToOuptut.delete(entry.tscOutputFile);
323
- this.#tscOutputFileToOuptut.delete(`${entry.tscOutputFile}.map`);
324
- this.#tscOutputFileToOuptut.delete(tscOutputDts);
325
- this.#tscOutputFileToOuptut.delete(`${tscOutputDts}.map`);
322
+ this.#tscOutputFileToOutput.delete(entry.tscOutputFile);
323
+ this.#tscOutputFileToOutput.delete(`${entry.tscOutputFile}.map`);
324
+ this.#tscOutputFileToOutput.delete(tscOutputDts);
325
+ this.#tscOutputFileToOutput.delete(`${tscOutputDts}.map`);
326
326
  }
327
327
 
328
328
  getAllFiles(): string[] {
@@ -361,7 +361,7 @@ export class CompilerState implements CompilerHost {
361
361
  // JSX runtime shenanigans
362
362
  text = text.replace(/support\/jsx-runtime"/g, 'support/jsx-runtime.js"');
363
363
 
364
- const location = this.#tscOutputFileToOuptut.get(outputFile) ?? outputFile;
364
+ const location = this.#tscOutputFileToOutput.get(outputFile) ?? outputFile;
365
365
 
366
366
  if (ManifestModuleUtil.TYPINGS_WITH_MAP_EXT_REGEX.test(outputFile)) {
367
367
  this.#writeExternalTypings(location, text, bom);
package/support/invoke.ts CHANGED
@@ -85,7 +85,7 @@ export async function invoke(...input: string[]): Promise<unknown> {
85
85
  return CommonUtil.writeStdout(2, info);
86
86
  }
87
87
  case 'event': {
88
- if (!EventUtil.isComplilerEventType(args[0])) {
88
+ if (!EventUtil.isCompilerEventType(args[0])) {
89
89
  throw new Error(`Unknown event type: ${args[0]}`);
90
90
  }
91
91
  for await (const event of client.fetchEvents(args[0])) {