Skip to content

Commit

Permalink
build(ts): update to latest ts release
Browse files Browse the repository at this point in the history
Issue microsoft/TypeScript#31676 got fixed and released in ts 3.5.3.
  • Loading branch information
nicojs committed Jul 9, 2019
1 parent 7cceddf commit 8c47e75
Show file tree
Hide file tree
Showing 18 changed files with 210 additions and 230 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -36,7 +36,7 @@
"sinon-chai": "^3.2.0",
"source-map-support": "^0.5.6",
"tslint": "~5.17.0",
"typescript": "~3.5.2"
"typescript": "~3.5.3"
},
"prettier": {
"singleQuote": true
Expand Down
82 changes: 41 additions & 41 deletions packages/api/package.json
@@ -1,43 +1,43 @@
{
"name": "@stryker-mutator/api",
"version": "2.0.0",
"description": "The api for the extendable JavaScript mutation testing framework Stryker",
"repository": {
"type": "git",
"url": "https://github.com/stryker-mutator/stryker"
},
"keywords": [
"mutation testing",
"mutation",
"testing",
"test",
"js",
"stryker"
],
"publishConfig": {
"access": "public"
},
"contributors": [
"nicojs <jansennico@gmail.com>",
"Alex van Assem <avassem@gmail.com>",
"Jeremy Nagel <jeremy.nagel@learnosity.com>",
"Philipp Weissenbacher <philipp.weissenbacher@gmail.com>",
"Simon de Lang <simondelang@gmail.com>"
],
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/stryker-mutator/stryker/issues"
},
"homepage": "https://github.com/stryker-mutator/stryker/tree/master/packages/api#readme",
"engines": {
"node": ">=8"
},
"dependencies": {
"mutation-testing-report-schema": "^1.0.0",
"tslib": "~1.10.0"
},
"devDependencies": {
"surrial": "~1.0.0",
"typed-inject": "~2.0.0"
}
"name": "@stryker-mutator/api",
"version": "2.0.0",
"description": "The api for the extendable JavaScript mutation testing framework Stryker",
"repository": {
"type": "git",
"url": "https://github.com/stryker-mutator/stryker"
},
"keywords": [
"mutation testing",
"mutation",
"testing",
"test",
"js",
"stryker"
],
"publishConfig": {
"access": "public"
},
"contributors": [
"nicojs <jansennico@gmail.com>",
"Alex van Assem <avassem@gmail.com>",
"Jeremy Nagel <jeremy.nagel@learnosity.com>",
"Philipp Weissenbacher <philipp.weissenbacher@gmail.com>",
"Simon de Lang <simondelang@gmail.com>"
],
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/stryker-mutator/stryker/issues"
},
"homepage": "https://github.com/stryker-mutator/stryker/tree/master/packages/api#readme",
"engines": {
"node": ">=8"
},
"dependencies": {
"mutation-testing-report-schema": "^1.0.0",
"tslib": "~1.10.0"
},
"devDependencies": {
"surrial": "~1.0.0",
"typed-inject": "~2.0.0"
}
}
10 changes: 7 additions & 3 deletions packages/api/src/plugin/Plugins.ts
Expand Up @@ -11,8 +11,8 @@ import { PluginKind } from './PluginKind';
/**
* Represents a StrykerPlugin
*/
export type Plugin<TPluginKind extends PluginKind, Tokens extends InjectionToken<PluginContexts[TPluginKind]>[]> =
FactoryPlugin<TPluginKind, Tokens> | ClassPlugin<TPluginKind, Tokens>;
export type Plugin<TPluginKind extends PluginKind> =
FactoryPlugin<TPluginKind, InjectionToken<PluginContexts[TPluginKind]>[]> | ClassPlugin<TPluginKind, InjectionToken<PluginContexts[TPluginKind]>[]>;

/**
* Represents a plugin that is created with a factory method
Expand All @@ -32,6 +32,10 @@ export interface FactoryPlugin<TPluginKind extends PluginKind, Tokens extends In
export interface ClassPlugin<TPluginKind extends PluginKind, Tokens extends InjectionToken<PluginContexts[TPluginKind]>[]> {
readonly kind: TPluginKind;
readonly name: string;
/**
* The prototype function (class) used to create the plugin.
* Not called `class` here, because that is a keyword
*/
readonly injectableClass: InjectableClass<PluginContexts[TPluginKind], PluginInterfaces[TPluginKind], Tokens>;
}

Expand Down Expand Up @@ -81,7 +85,7 @@ export interface PluginInterfaces {
* Lookup type for plugins by kind.
*/
export type Plugins = {
[TPluginKind in keyof PluginInterfaces]: Plugin<TPluginKind, InjectionToken<PluginContexts[TPluginKind]>[]>;
[TPluginKind in keyof PluginInterfaces]: Plugin<TPluginKind>;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Expand Up @@ -79,7 +79,7 @@
"devDependencies": {
"@stryker-mutator/api": "^0.24.1",
"@stryker-mutator/test-helpers": "^2.0.0",
"@types/inquirer": "~6.0.0",
"@types/inquirer": "~6.0.2",
"@types/istanbul-lib-instrument": "~1.7.0",
"@types/node": "~10.11.4",
"@types/progress": "~2.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/Stryker.ts
Expand Up @@ -88,11 +88,11 @@ export default class Stryker {
await this.logDone();
return mutantResults;
} else {
this.logRemark();
this.logTraceLogLevelHint();
}
} finally {
// `injector.dispose` calls `dispose` on all created instances
// Namely the `SandboxPool` and the `ChildProcessProxy` instances
// Namely the `SandboxPool`, `MutantTranspileScheduler` and `ChildProcessProxy` instances
await mutationTestProcessInjector.dispose();
await LogConfigurator.shutdown();
}
Expand All @@ -104,7 +104,7 @@ export default class Stryker {
this.log.info('Done in %s.', this.timer.humanReadableElapsed());
}

private logRemark() {
private logTraceLogLevelHint() {
if (!this.log.isTraceEnabled()) {
this.log.info('Trouble figuring out what went wrong? Try `npx stryker run --fileLogLevel trace --logLevel debug` to get some more info.');
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/di/PluginCreator.ts
Expand Up @@ -20,11 +20,11 @@ export class PluginCreator<TPluginKind extends PluginKind> {
}
}

private isFactoryPlugin<TPluginKind extends PluginKind>(plugin: Plugin<TPluginKind, InjectionToken<PluginContexts[TPluginKind]>[]>):
private isFactoryPlugin(plugin: Plugin<PluginKind>):
plugin is FactoryPlugin<TPluginKind, InjectionToken<PluginContexts[TPluginKind]>[]> {
return !!(plugin as FactoryPlugin<TPluginKind, InjectionToken<PluginContexts[TPluginKind]>[]>).factory;
}
private isClassPlugin<TPluginKind extends PluginKind>(plugin: Plugin<TPluginKind, InjectionToken<PluginContexts[TPluginKind]>[]>):
private isClassPlugin(plugin: Plugin<PluginKind>):
plugin is ClassPlugin<TPluginKind, InjectionToken<PluginContexts[TPluginKind]>[]> {
return !!(plugin as ClassPlugin<TPluginKind, InjectionToken<PluginContexts[TPluginKind]>[]>).injectableClass;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/di/PluginLoader.ts
Expand Up @@ -10,11 +10,11 @@ import * as coreTokens from './coreTokens';
const IGNORED_PACKAGES = ['core', 'api', 'util'];

interface PluginModule {
strykerPlugins: Plugin<any, any>[];
strykerPlugins: Plugin<any>[];
}

export class PluginLoader implements PluginResolver {
private readonly pluginsByKind: Map<PluginKind, Plugin<any, any>[]> = new Map();
private readonly pluginsByKind: Map<PluginKind, Plugin<any>[]> = new Map();

public static inject = tokens(commonTokens.logger, coreTokens.pluginDescriptors);
constructor(private readonly log: Logger, private readonly pluginDescriptors: ReadonlyArray<string>) { }
Expand Down Expand Up @@ -97,7 +97,7 @@ export class PluginLoader implements PluginResolver {
}
}

private loadPlugin(plugin: Plugin<any, any>) {
private loadPlugin(plugin: Plugin<any>) {
let plugins = this.pluginsByKind.get(plugin.kind);
if (!plugins) {
plugins = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/di/factoryMethods.ts
Expand Up @@ -28,4 +28,4 @@ export function optionsFactory(config: Config, configEditorApplier: ConfigEditor
configEditorApplier.edit(config);
return freezeRecursively(config);
}
optionsFactory.inject = tokens(coreTokens.configReadFromConfigFile, coreTokens.configEditorApplier);
optionsFactory.inject = tokens<[typeof coreTokens.configReadFromConfigFile, typeof coreTokens.configEditorApplier]>(coreTokens.configReadFromConfigFile, coreTokens.configEditorApplier);
6 changes: 3 additions & 3 deletions packages/core/src/initializer/StrykerInquirer.ts
Expand Up @@ -11,7 +11,7 @@ export interface PromptResult {
export class StrykerInquirer {

public async promptPresets(options: Preset[]): Promise<Preset | undefined> {
const choices: inquirer.ChoiceType<string>[] = options.map(_ => _.name);
const choices: inquirer.ChoiceType[] = options.map(_ => _.name);
choices.push(new inquirer.Separator());
choices.push('None/other');
const answers = await inquirer.prompt<{ preset: string }>({
Expand All @@ -24,7 +24,7 @@ export class StrykerInquirer {
}

public async promptTestRunners(options: PromptOption[]): Promise<PromptOption> {
const choices: inquirer.ChoiceType<string>[] = options.map(_ => _.name);
const choices: inquirer.ChoiceType[] = options.map(_ => _.name);
choices.push(new inquirer.Separator());
choices.push(CommandTestRunner.runnerName);
const answers = await inquirer.prompt<{ testRunner: string }>({
Expand All @@ -34,7 +34,7 @@ export class StrykerInquirer {
name: 'testRunner',
type: 'list'
});
return options.filter(_ => _.name === answers.testRunner)[0] || { name: CommandTestRunner.runnerName };
return options.filter(_ => _.name === answers.testRunner)[0] || { name: CommandTestRunner.runnerName, pkg: null };
}

public async promptTestFrameworks(options: PromptOption[]): Promise<PromptOption> {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/initializer/presets/ReactPreset.ts
Expand Up @@ -39,7 +39,7 @@ export class ReactPreset implements Preset {
}`;

public async createConfig(): Promise<PresetConfiguration> {
const choices: inquirer.ChoiceType<string>[] = ['JSX', 'TSX'];
const choices: inquirer.ChoiceType[] = ['JSX', 'TSX'];
const answers = await inquirer.prompt<{ choice: string }>({
choices,
message: 'Is your project a JSX project or a TSX project?',
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/initializer/presets/VueJsPreset.ts
Expand Up @@ -44,14 +44,14 @@ export class VueJsPreset implements Preset {
}`;

public async createConfig(): Promise<PresetConfiguration> {
const testRunnerChoices: inquirer.ChoiceType<string>[] = ['karma', 'jest'];
const testRunnerChoices: inquirer.ChoiceType[] = ['karma', 'jest'];
const testRunnerAnswers = await inquirer.prompt<{ testRunner: string }>({
choices: testRunnerChoices,
message: 'Which test runner do you want to use?',
name: 'testRunner',
type: 'list'
});
const scriptChoices: inquirer.ChoiceType<string>[] = ['typescript', 'javascript'];
const scriptChoices: inquirer.ChoiceType[] = ['typescript', 'javascript'];
const scriptAnswers = await inquirer.prompt<{ script: string }>({
choices: scriptChoices,
message: 'Which language does your project use?',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/transpiler/MutantTranspileScheduler.ts
Expand Up @@ -25,7 +25,7 @@ export class MutantTranspileScheduler implements Disposable {
/**
* Creates a mutant transpiler
*/
constructor(private readonly transpiler: Transpiler & Disposable, private readonly unMutatedFiles: ReadonlyArray<File>) { }
constructor(private readonly transpiler: Transpiler, private readonly unMutatedFiles: ReadonlyArray<File>) { }

public scheduleTranspileMutants(allMutants: ReadonlyArray<TestableMutant>): Observable<TranspiledMutant> {
return from(allMutants).pipe(
Expand Down
Expand Up @@ -93,14 +93,14 @@ describe(StrykerInitializer.name, () => {
});
await sut.initialize();
expect(inquirerPrompt).callCount(7);
const [promptPreset, promptTestRunner, promptTestFramework, promptMutator, promptPackageManagers]: inquirer.ListQuestion<string>[] = [
const [promptPreset, promptTestRunner, promptTestFramework, promptMutator, promptPackageManagers]: inquirer.Question<string>[] = [
inquirerPrompt.getCall(0).args[0],
inquirerPrompt.getCall(1).args[0],
inquirerPrompt.getCall(2).args[0],
inquirerPrompt.getCall(3).args[0],
inquirerPrompt.getCall(6).args[0],
];
const [promptTranspilers, promptReporters]: inquirer.CheckboxQuestion<string>[] = [
const [promptTranspilers, promptReporters]: inquirer.Question<string>[] = [
inquirerPrompt.getCall(4).args[0],
inquirerPrompt.getCall(5).args[0],
];
Expand Down Expand Up @@ -198,7 +198,7 @@ describe(StrykerInitializer.name, () => {
});
await sut.initialize();
expect(inquirerPrompt).callCount(2);
const [promptPreset, promptPackageManager]: inquirer.ListQuestion<string>[] = [
const [promptPreset, promptPackageManager]: inquirer.Question<string>[] = [
inquirerPrompt.getCall(0).args[0],
inquirerPrompt.getCall(1).args[0]
];
Expand Down
101 changes: 46 additions & 55 deletions packages/javascript-mutator/package.json
@@ -1,57 +1,48 @@
{
"name": "@stryker-mutator/javascript-mutator",
"version": "2.0.0",
"description": "A plugin for javascript projects using Stryker",
"main": "src/index.js",
"scripts": {
"start": "tsc -w",
"clean": "rimraf \"+(test|src)/**/*+(.d.ts|.js|.map)\" reports",
"test": "nyc --exclude-after-remap=false --check-coverage --reporter=html --report-dir=reports/coverage --lines 85 --functions 90 --branches 60 npm run mocha",
"mocha": "mocha \"test/helpers/**/*.js\" \"test/unit/**/*.js\" \"test/integration/**/*.js\""
},
"repository": {
"type": "git",
"url": "https://github.com/stryker-mutator/stryker"
},
"engines": {
"node": ">=8"
},
"keywords": [
"stryker",
"javascript",
"@stryker-mutator/mutator-plugin"
],
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/stryker-mutator/stryker/issues"
},
"author": "Simon de Lang <simondelang@gmail.com>",
"contributors": [
"Nico Jansen <jansennico@gmail.com>",
"Niek te Grootenhuis <ntegro@hotmail.com>",
"Thomas Peters <thomaspeters4@outlook.com>",
"Sander Koenders <sanderkoenders@gmail.com>"
],
"homepage": "https://github.com/stryker-mutator/stryker/tree/master/packages/javascript-mutator#readme",
"license": "Apache-2.0",
"dependencies": {
"@babel/generator": "~7.4.0",
"@babel/parser": "~7.4.0",
"@babel/traverse": "~7.4.0",
"@stryker-mutator/api": "^2.0.0",
"lodash": "~4.17.4",
"tslib": "~1.10.0"
},
"peerDependencies": {
"@stryker-mutator/core": "^2.0.0"
},
"devDependencies": {
"@babel/types": "~7.4.0",
"@stryker-mutator/mutator-specification": "^2.0.0",
"@stryker-mutator/test-helpers": "^2.0.0",
"@types/babel__generator": "^7.0.0",
"@types/babel__traverse": "^7.0.0"
}
"name": "@stryker-mutator/javascript-mutator",
"version": "2.0.0",
"description": "A plugin for javascript projects using Stryker",
"main": "src/index.js",
"repository": {
"type": "git",
"url": "https://github.com/stryker-mutator/stryker"
},
"engines": {
"node": ">=8"
},
"keywords": [
"stryker",
"javascript",
"@stryker-mutator/mutator-plugin"
],
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/stryker-mutator/stryker/issues"
},
"author": "Simon de Lang <simondelang@gmail.com>",
"contributors": [
"Nico Jansen <jansennico@gmail.com>",
"Niek te Grootenhuis <ntegro@hotmail.com>",
"Thomas Peters <thomaspeters4@outlook.com>",
"Sander Koenders <sanderkoenders@gmail.com>"
],
"homepage": "https://github.com/stryker-mutator/stryker/tree/master/packages/javascript-mutator#readme",
"license": "Apache-2.0",
"dependencies": {
"@babel/generator": "~7.4.0",
"@babel/parser": "~7.4.0",
"@babel/traverse": "~7.4.0",
"lodash": "~4.17.4",
"tslib": "~1.10.0"
},
"peerDependencies": {
"@stryker-mutator/core": "^2.0.0"
},
"devDependencies": {
"@babel/types": "~7.4.0",
"@types/babel__generator": "^7.0.0",
"@types/babel__traverse": "^7.0.0"
}
}

0 comments on commit 8c47e75

Please sign in to comment.