@travetto/compiler 8.0.0-alpha.6 → 8.0.0-alpha.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/state.ts +6 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/compiler",
3
- "version": "8.0.0-alpha.6",
3
+ "version": "8.0.0-alpha.7",
4
4
  "type": "module",
5
5
  "description": "The compiler infrastructure for the Travetto framework",
6
6
  "keywords": [
package/src/state.ts CHANGED
@@ -182,15 +182,16 @@ export class CompilerState implements CompilerHost {
182
182
  }
183
183
 
184
184
  switch (ManifestModuleUtil.getFileType(sourceFile)) {
185
- case 'js':
186
- case 'typings':
187
185
  case 'package-json': {
188
186
  const text = this.readFile(sourceFile)!;
189
- const finalText = sourceFile.endsWith('package.json') ? CompilerUtil.rewritePackageJSON(this.#manifest, text) : text;
187
+ const finalText = CompilerUtil.rewritePackageJSON(this.#manifest, text);
190
188
  const location = this.#tscOutputFileToOuptut.get(output) ?? output;
191
- this.#writeFile(location, finalText, false);
189
+ this.#writeFile(location, finalText);
190
+ this.#writeExternalTypings(location, finalText);
192
191
  break;
193
192
  }
193
+ case 'js':
194
+ case 'typings': this.writeFile(output, this.readFile(sourceFile)!); break;
194
195
  case 'ts': {
195
196
  const program = await this.getProgram(needsNewProgram);
196
197
  const tsSourceFile = program.getSourceFile(sourceFile)!;
@@ -329,7 +330,7 @@ export class CompilerState implements CompilerHost {
329
330
 
330
331
  const location = this.#tscOutputFileToOuptut.get(outputFile) ?? outputFile;
331
332
 
332
- if (ManifestModuleUtil.TYPINGS_WITH_MAP_EXT_REGEX.test(outputFile) || outputFile.endsWith('package.json')) {
333
+ if (ManifestModuleUtil.TYPINGS_WITH_MAP_EXT_REGEX.test(outputFile)) {
333
334
  this.#writeExternalTypings(location, text, bom);
334
335
  }
335
336