Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transpiler plugin support #343

Closed
simondel opened this issue Aug 1, 2017 · 1 comment
Closed

Transpiler plugin support #343

simondel opened this issue Aug 1, 2017 · 1 comment
Labels
🚀 Feature request New feature request help wanted Extra attention is needed

Comments

@simondel
Copy link
Member

simondel commented Aug 1, 2017

In order to support different types of projects such as Babel and TypeScript projects, the way we generate mutants and decide which code should be placed in the Sandbox changes.

The MutatorOrchestrator in Stryker will be replaced using a Transpiler interface that can transpile code to the format required for the Sandbox and that can mutate code. A regular JavaScript transpiler won't actually change to code during the transpilation phase while a TypeScript transpiler would change the code (from TypeScript to JavaScript).

Suggested API change

Remove the Mutator interface because it specifically targets JavaScript code
Remove the MutatorFactory class
Remove the IdentifiedNode interface
Move the Mutant to the stryker-api because Transpilers will have to return it
Add the Transpiler interface:

interface Transpiler {
   new (sourceFiles: SourceFile[]): Transpiler;
   transpile(): SourceFile[];
   mutate(): Mutant[];
}

Make the SourceFile interface extend the InputFile interface so it has the mutated property that is already present in the InputFile interface. The new interface will look like this:

interface SourceFile extends InputFile {
  content: string;
}

Open issues

  • The Mutant class has no way to tell a difference between the code that was mutated and the code that should be placed in the sandbox. The code that was mutated may be TypeScript code, while the code for the sandbox could be JavaScript. The TypeScript code would be interesting to save in a Mutant for reporting purposes.

Note: This post will be updated to always show the latest info.

@simondel simondel added 🚀 Feature request New feature request help wanted Extra attention is needed labels Aug 1, 2017
@simondel simondel added this to the stryker-api 0.6 milestone Aug 1, 2017
@nicojs
Copy link
Member

nicojs commented Oct 10, 2017

This feature is released in stryker 0.10 as part of the TypeScript support. Seel #376 and #344

@nicojs nicojs closed this as completed Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Feature request New feature request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants