automutate
Advanced tools
Comparing version 0.3.3 to 0.5.0
@@ -5,2 +5,19 @@ import { ILogger } from "./logger"; | ||
/** | ||
* Settings to initialize a new IAutoMutator. | ||
*/ | ||
export interface IAutoMutatorSettings { | ||
/** | ||
* Applies individual waves of file mutations. | ||
*/ | ||
mutationsApplier?: IMutationsApplier; | ||
/** | ||
* Provides waves of file mutations. | ||
*/ | ||
mutationsProvider: IMutationsProvider; | ||
/** | ||
* Generates output messages for significant operations. | ||
*/ | ||
logger?: ILogger; | ||
} | ||
/** | ||
* Runs waves of file mutations. | ||
@@ -35,6 +52,5 @@ */ | ||
* | ||
* @param mutationsApplier Applies individual waves of file mutations. | ||
* @param mutationsProvider Provides waves of file mutations. | ||
* @param settings Settings to be used for initialization. | ||
*/ | ||
constructor(mutationsApplier: IMutationsApplier, mutationsProvider: IMutationsProvider, logger: ILogger); | ||
constructor(settings: IAutoMutatorSettings); | ||
/** | ||
@@ -41,0 +57,0 @@ * Runs waves of file mutations. |
@@ -10,2 +10,4 @@ "use strict"; | ||
}; | ||
const consoleLogger_1 = require("./loggers/consoleLogger"); | ||
const fileMutationsApplier_1 = require("./mutationsAppliers/fileMutationsApplier"); | ||
/** | ||
@@ -18,9 +20,10 @@ * Runs waves of file mutations. | ||
* | ||
* @param mutationsApplier Applies individual waves of file mutations. | ||
* @param mutationsProvider Provides waves of file mutations. | ||
* @param settings Settings to be used for initialization. | ||
*/ | ||
constructor(mutationsApplier, mutationsProvider, logger) { | ||
this.mutationsApplier = mutationsApplier; | ||
this.mutationsProvider = mutationsProvider; | ||
this.logger = logger; | ||
constructor(settings) { | ||
this.logger = settings.logger || new consoleLogger_1.ConsoleLogger(); | ||
this.mutationsApplier = settings.mutationsApplier || new fileMutationsApplier_1.FileMutationsApplier({ | ||
logger: this.logger | ||
}); | ||
this.mutationsProvider = settings.mutationsProvider; | ||
} | ||
@@ -48,2 +51,2 @@ /** | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIj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vZ2dlcjogdGhpcy5sb2dnZXJcclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLm11dGF0aW9uc1Byb3ZpZGVyID0gc2V0dGluZ3MubXV0YXRpb25zUHJvdmlkZXI7XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBSdW5zIHdhdmVzIG9mIGZpbGUgbXV0YXRpb25zLlxyXG4gICAgICogXHJcbiAgICAgKiBAcmV0dXJucyBBIFByb21pc2UgZm9yIHRoZSB3YXZlcyBjb21wbGV0aW5nLlxyXG4gICAgICovXHJcbiAgICBwdWJsaWMgYXN5bmMgcnVuKCk6IFByb21pc2U8dm9pZD4ge1xyXG4gICAgICAgIHdoaWxlICh0cnVlKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IG11dGF0aW9uc1dhdmU6IElNdXRhdGlvbnNXYXZlID0gYXdhaXQgdGhpcy5tdXRhdGlvbnNQcm92aWRlci5wcm92aWRlKCk7XHJcbiAgICAgICAgICAgIGlmICghbXV0YXRpb25zV2F2ZS5maWxlTXV0YXRpb25zKSB7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgdGhpcy5sb2dnZXIub25XYXZlQmVnaW4obXV0YXRpb25zV2F2ZSk7XHJcbiAgICAgICAgICAgIGF3YWl0IHRoaXMubXV0YXRpb25zQXBwbGllci5hcHBseShtdXRhdGlvbnNXYXZlLmZpbGVNdXRhdGlvbnMpO1xyXG4gICAgICAgICAgICB0aGlzLmxvZ2dlci5vbldhdmVFbmQobXV0YXRpb25zV2F2ZSk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59XHJcbiJdfQ== |
@@ -7,2 +7,19 @@ import { IFileProviderFactory } from "./fileProviderFactory"; | ||
/** | ||
* Settings to initialize a new IMutationsApplier. | ||
*/ | ||
export interface IMutationsApplierSettings { | ||
/** | ||
* Generates output messages for significant operations. | ||
*/ | ||
logger: ILogger; | ||
/** | ||
* Creates file providers for files. | ||
*/ | ||
fileProviderFactory: IFileProviderFactory; | ||
/** | ||
* Creates mutators for mutations. | ||
*/ | ||
mutatorFactory: IMutatorFactory; | ||
} | ||
/** | ||
* Applies individual waves of file mutations. | ||
@@ -46,7 +63,5 @@ */ | ||
* | ||
* @param logger Generates output messages for significant operations. | ||
* @param fileProviderFactory Creates file providers for files. | ||
* @param mutatorFactory Creates mutators for mutations. | ||
* @param settings Settings to be used for initialization. | ||
*/ | ||
constructor(logger: ILogger, fileProviderFactory: IFileProviderFactory, mutatorFactory: IMutatorFactory); | ||
constructor(settings: IMutationsApplierSettings); | ||
/** | ||
@@ -53,0 +68,0 @@ * Applies an iteration of file mutations. |
@@ -17,10 +17,8 @@ "use strict"; | ||
* | ||
* @param logger Generates output messages for significant operations. | ||
* @param fileProviderFactory Creates file providers for files. | ||
* @param mutatorFactory Creates mutators for mutations. | ||
* @param settings Settings to be used for initialization. | ||
*/ | ||
constructor(logger, fileProviderFactory, mutatorFactory) { | ||
this.logger = logger; | ||
this.fileProviderFactory = fileProviderFactory; | ||
this.mutatorFactory = mutatorFactory; | ||
constructor(settings) { | ||
this.logger = settings.logger; | ||
this.fileProviderFactory = settings.fileProviderFactory; | ||
this.mutatorFactory = settings.mutatorFactory; | ||
} | ||
@@ -36,5 +34,5 @@ /** | ||
yield Promise.all(Object.keys(mutations) | ||
.map((fileName) => { | ||
return this.applyFileMutations(fileName, mutations[fileName]); | ||
})); | ||
.map((fileName) => __awaiter(this, void 0, void 0, function* () { | ||
yield this.applyFileMutations(fileName, mutations[fileName]); | ||
}))); | ||
this.logger.onComplete(); | ||
@@ -87,2 +85,2 @@ }); | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9tdXRhdGlvbnNBcHBsaWVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQTZCQTs7R0FFRztBQUNIO0lBZ0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gb3ZlcmxhcHMuXHJcbiAgICAgKi9cclxuICAgIHByaXZhdGUgb3JkZXJNdXRhdGlvbnMobXV0YXRpb25zOiBJTXV0YXRpb25bXSk6IElNdXRhdGlvbltdIHtcclxuICAgICAgICBjb25zdCBvcmRlcmVkOiBJTXV0YXRpb25bXSA9IFtdO1xyXG4gICAgICAgIGxldCBsYXN0U3RhcnQ6IG51bWJlciA9IEluZmluaXR5O1xyXG5cclxuICAgICAgICBmb3IgKGxldCBpOiBudW1iZXIgPSBtdXRhdGlvbnMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpIC09IDEpIHtcclxuICAgICAgICAgICAgY29uc3QgbXV0YXRpb246IElNdXRhdGlvbiA9IG11dGF0aW9uc1tpXTtcclxuICAgICAgICAgICAgaWYgKChtdXRhdGlvbi5yYW5nZS5lbmQgfHwgbXV0YXRpb24ucmFuZ2UuYmVnaW4pID4gbGFzdFN0YXJ0KSB7XHJcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgbGFzdFN0YXJ0ID0gbXV0YXRpb24ucmFuZ2UuYmVnaW47XHJcbiAgICAgICAgICAgIG9yZGVyZWQucHVzaChtdXRhdGlvbik7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICByZXR1cm4gb3JkZXJlZC5zb3J0KChhOiBJTXV0YXRpb24sIGI6IElNdXRhdGlvbik6IG51bWJlciA9PiB7XHJcbiAgICAgICAgICAgIHJldHVybiAoYi5yYW5nZS5lbmQgfHwgYi5yYW5nZS5iZWdpbikgLSAoYS5yYW5nZS5lbmQgfHwgYS5yYW5nZS5iZWdpbik7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbn1cclxuIl19 | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9tdXRhdGlvbnNBcHBsaWVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcG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9yZGVyZWQucHVzaChtdXRhdGlvbik7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICByZXR1cm4gb3JkZXJlZC5zb3J0KChhOiBJTXV0YXRpb24sIGI6IElNdXRhdGlvbik6IG51bWJlciA9PiB7XHJcbiAgICAgICAgICAgIHJldHVybiAoYi5yYW5nZS5lbmQgfHwgYi5yYW5nZS5iZWdpbikgLSAoYS5yYW5nZS5lbmQgfHwgYS5yYW5nZS5iZWdpbik7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbn1cclxuIl19 |
@@ -6,4 +6,8 @@ import { ILogger } from "../logger"; | ||
*/ | ||
export interface IFileMutationSettings { | ||
export interface IFileMutationsApplierSettings { | ||
/** | ||
* Generates output messages for significant operations. | ||
*/ | ||
logger: ILogger; | ||
/** | ||
* Additional directories to search for mutators within. | ||
@@ -20,6 +24,5 @@ */ | ||
* | ||
* @param logger Generates output messages for significant operations. | ||
* @param fileSettings Settings for manipulating local files. | ||
* @param settings Settings to be used for initialization. | ||
*/ | ||
constructor(logger: ILogger, settings?: IFileMutationSettings); | ||
constructor(settings: IFileMutationsApplierSettings); | ||
} |
@@ -15,10 +15,13 @@ "use strict"; | ||
* | ||
* @param logger Generates output messages for significant operations. | ||
* @param fileSettings Settings for manipulating local files. | ||
* @param settings Settings to be used for initialization. | ||
*/ | ||
constructor(logger, settings = {}) { | ||
super(logger, new fileProviderFactory_1.FileProviderFactory((fileName) => new localFileProvider_1.LocalFileProvider(fileName)), new mutatorFactory_1.MutatorFactory(new mutatorSearcher_1.MutatorSearcher([ | ||
path.join(__dirname, "../../lib/mutators"), | ||
...(settings.mutatorDirectories || []) | ||
]), logger)); | ||
constructor(settings) { | ||
super({ | ||
logger: settings.logger, | ||
fileProviderFactory: new fileProviderFactory_1.FileProviderFactory((fileName) => new localFileProvider_1.LocalFileProvider(fileName)), | ||
mutatorFactory: new mutatorFactory_1.MutatorFactory(new mutatorSearcher_1.MutatorSearcher([ | ||
path.join(__dirname, "../../lib/mutators"), | ||
...(settings.mutatorDirectories || []) | ||
]), settings.logger) | ||
}); | ||
} | ||
@@ -28,2 +31,2 @@ } | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9tdXRhdGlvbnNBcHBsaWVycy9maWxlTXV0YXRpb25zQXBwbGllci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsTUFBWSxJQUFJLFdBQU0sTUFBTSxDQUFDLENBQUE7QUFHN0Isc0NBQW9DLHdCQUF3QixDQUFDLENBQUE7QUFFN0Qsb0NBQWtDLG9DQUFvQyxDQUFDLENBQUE7QUFDdkUsbUNBQWlDLHFCQUFxQixDQUFDLENBQUE7QUFDdkQsaUNBQStCLG1CQUFtQixDQUFDLENBQUE7QUFDbkQsa0NBQWdDLG9CQUFvQixDQUFDLENBQUE7QUFZckQ7O0dBRUc7QUFDSCxtQ0FBMEMsbUNBQWdCO0lBQ3REOzs7OztPQUtHO0lBQ0gsWUFBbUIsTUFBZSxFQUFFLFFBQVEsR0FBMEIsRUFBRTtRQUNwRSxNQUNJLE1BQU0sRUFDTixJQUFJLHlDQUFtQixDQUNuQixDQUFDLFFBQWdCLEtBQW9CLElBQUkscUNBQWlCLENBQUMsUUFBUSxDQUFDLENBQUMsRUFDekUsSUFBSSwrQkFBYyxDQUNkLElBQUksaUNBQWUsQ0FBQztZQUNoQixJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxvQkFBb0IsQ0FBQztZQUMxQyxHQUFHLENBQUMsUUFBUSxDQUFDLGtCQUFrQixJQUFJLEVBQUUsQ0FBQztTQUN6QyxDQUFDLEVBQ0YsTUFBTSxDQUFDLENBQUMsQ0FBQztJQUNyQixDQUFDO0FBQ0wsQ0FBQztBQW5CWSw0QkFBb0IsdUJBbUJoQyxDQUFBIiwiZmlsZSI6Im11dGF0aW9uc0FwcGxpZXJzL2ZpbGVNdXRhdGlvbn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19kaXJuYW1lLCBcIi4uLy4uL2xpYi9tdXRhdG9yc1wiKSxcclxuICAgICAgICAgICAgICAgICAgICAuLi4oc2V0dGluZ3MubXV0YXRvckRpcmVjdG9yaWVzIHx8IFtdKVxyXG4gICAgICAgICAgICAgICAgXSksXHJcbiAgICAgICAgICAgICAgICBzZXR0aW5ncy5sb2dnZXIpXHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbn1cclxuIl19 |
{ | ||
"name": "automutate", | ||
"version": "0.3.3", | ||
"version": "0.5.0", | ||
"description": "Applies waves of mutations provided by other tools, such as linters.", | ||
@@ -49,2 +49,3 @@ "index": "lib/index.js", | ||
"tslint", | ||
"lesshint", | ||
"eslint" | ||
@@ -51,0 +52,0 @@ ], |
# automutate | ||
[![npm](https://img.shields.io/npm/v/automutate.svg)](https://www.npmjs.com/package/automutate) | ||
@@ -68,3 +69,4 @@ Applies waves of mutations provided by other tools, such as linters. | ||
Mutators are also given the *original* file contents at construction time, which allows for custom mutators to perform setup logic (for example, a language's linter creating an abstract syntax tree for the file). | ||
Mutators are also given the *original* file contents at construction time, which allows for custom mutators to perform setup logic. | ||
For example, a language's linter might create an abstract syntax tree for the file. | ||
@@ -74,3 +76,2 @@ | ||
In order to be compatible with `automutate`, a linter must allow for some rules to report proposed fixes using the standard format. | ||
Once that is possible, it's a matter of creating a [mutations provider](https://github.com/autolint/automutate/blob/master/src/mutationsProvider.ts) that continuously retrieves these proposed fixes using the linter. | ||
See [Onboarding](docs/onboarding.md). |
import { ILogger } from "./logger"; | ||
import { ConsoleLogger } from "./loggers/consoleLogger"; | ||
import { IMutationsApplier } from "./mutationsApplier"; | ||
import { FileMutationsApplier } from "./mutationsAppliers/fileMutationsApplier"; | ||
import { IMutationsProvider, IMutationsWave } from "./mutationsProvider"; | ||
/** | ||
* Settings to initialize a new IAutoMutator. | ||
*/ | ||
export interface IAutoMutatorSettings { | ||
/** | ||
* Applies individual waves of file mutations. | ||
*/ | ||
mutationsApplier?: IMutationsApplier; | ||
/** | ||
* Provides waves of file mutations. | ||
*/ | ||
mutationsProvider: IMutationsProvider; | ||
/** | ||
* Generates output messages for significant operations. | ||
*/ | ||
logger?: ILogger; | ||
} | ||
/** | ||
* Runs waves of file mutations. | ||
@@ -39,9 +61,10 @@ */ | ||
* | ||
* @param mutationsApplier Applies individual waves of file mutations. | ||
* @param mutationsProvider Provides waves of file mutations. | ||
* @param settings Settings to be used for initialization. | ||
*/ | ||
constructor(mutationsApplier: IMutationsApplier, mutationsProvider: IMutationsProvider, logger: ILogger) { | ||
this.mutationsApplier = mutationsApplier; | ||
this.mutationsProvider = mutationsProvider; | ||
this.logger = logger; | ||
constructor(settings: IAutoMutatorSettings) { | ||
this.logger = settings.logger || new ConsoleLogger(); | ||
this.mutationsApplier = settings.mutationsApplier || new FileMutationsApplier({ | ||
logger: this.logger | ||
}); | ||
this.mutationsProvider = settings.mutationsProvider; | ||
} | ||
@@ -48,0 +71,0 @@ |
@@ -9,2 +9,22 @@ import { IFileProvider } from "./fileProvider"; | ||
/** | ||
* Settings to initialize a new IMutationsApplier. | ||
*/ | ||
export interface IMutationsApplierSettings { | ||
/** | ||
* Generates output messages for significant operations. | ||
*/ | ||
logger: ILogger; | ||
/** | ||
* Creates file providers for files. | ||
*/ | ||
fileProviderFactory: IFileProviderFactory; | ||
/** | ||
* Creates mutators for mutations. | ||
*/ | ||
mutatorFactory: IMutatorFactory; | ||
} | ||
/** | ||
* Applies individual waves of file mutations. | ||
@@ -53,10 +73,8 @@ */ | ||
* | ||
* @param logger Generates output messages for significant operations. | ||
* @param fileProviderFactory Creates file providers for files. | ||
* @param mutatorFactory Creates mutators for mutations. | ||
* @param settings Settings to be used for initialization. | ||
*/ | ||
public constructor(logger: ILogger, fileProviderFactory: IFileProviderFactory, mutatorFactory: IMutatorFactory) { | ||
this.logger = logger; | ||
this.fileProviderFactory = fileProviderFactory; | ||
this.mutatorFactory = mutatorFactory; | ||
public constructor(settings: IMutationsApplierSettings) { | ||
this.logger = settings.logger; | ||
this.fileProviderFactory = settings.fileProviderFactory; | ||
this.mutatorFactory = settings.mutatorFactory; | ||
} | ||
@@ -73,4 +91,4 @@ | ||
Object.keys(mutations) | ||
.map((fileName: string): Promise<void> => { | ||
return this.applyFileMutations(fileName, mutations[fileName]); | ||
.map(async (fileName: string): Promise<void> => { | ||
await this.applyFileMutations(fileName, mutations[fileName]); | ||
})); | ||
@@ -77,0 +95,0 @@ |
@@ -14,4 +14,9 @@ import * as path from "path"; | ||
*/ | ||
export interface IFileMutationSettings { | ||
export interface IFileMutationsApplierSettings { | ||
/** | ||
* Generates output messages for significant operations. | ||
*/ | ||
logger: ILogger; | ||
/** | ||
* Additional directories to search for mutators within. | ||
@@ -29,11 +34,10 @@ */ | ||
* | ||
* @param logger Generates output messages for significant operations. | ||
* @param fileSettings Settings for manipulating local files. | ||
* @param settings Settings to be used for initialization. | ||
*/ | ||
public constructor(logger: ILogger, settings: IFileMutationSettings = {}) { | ||
super( | ||
logger, | ||
new FileProviderFactory( | ||
public constructor(settings: IFileMutationsApplierSettings) { | ||
super({ | ||
logger: settings.logger, | ||
fileProviderFactory: new FileProviderFactory( | ||
(fileName: string): IFileProvider => new LocalFileProvider(fileName)), | ||
new MutatorFactory( | ||
mutatorFactory: new MutatorFactory( | ||
new MutatorSearcher([ | ||
@@ -43,4 +47,5 @@ path.join(__dirname, "../../lib/mutators"), | ||
]), | ||
logger)); | ||
settings.logger) | ||
}); | ||
} | ||
} |
@@ -43,3 +43,7 @@ "use strict"; | ||
const stubFileProvider = new stubFileProvider_1.StubFileProvider(testCase.before); | ||
const mutationsApplier = new mutationsApplier_1.MutationsApplier(stubLogger, new fileProviderFactory_1.FileProviderFactory(() => stubFileProvider), new mutatorFactory_1.MutatorFactory(mutatorSearcher, stubLogger)); | ||
const mutationsApplier = new mutationsApplier_1.MutationsApplier({ | ||
logger: stubLogger, | ||
fileProviderFactory: new fileProviderFactory_1.FileProviderFactory(() => stubFileProvider), | ||
mutatorFactory: new mutatorFactory_1.MutatorFactory(mutatorSearcher, stubLogger) | ||
}); | ||
// Act | ||
@@ -46,0 +50,0 @@ const actual = yield mutationsApplier.applyFileMutations([testCase.directoryPath.join("/"), testCase.name].join("/"), testCase.mutations); |
@@ -53,6 +53,7 @@ import * as path from "path"; | ||
const stubFileProvider: IFileProvider = new StubFileProvider(testCase.before); | ||
const mutationsApplier: IMutationsApplier = new MutationsApplier( | ||
stubLogger, | ||
new FileProviderFactory((): IFileProvider => stubFileProvider), | ||
new MutatorFactory(mutatorSearcher, stubLogger)); | ||
const mutationsApplier: IMutationsApplier = new MutationsApplier({ | ||
logger: stubLogger, | ||
fileProviderFactory: new FileProviderFactory((): IFileProvider => stubFileProvider), | ||
mutatorFactory: new MutatorFactory(mutatorSearcher, stubLogger) | ||
}); | ||
@@ -59,0 +60,0 @@ // Act |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76
4
188841
106
3854