@betterer/betterer
Advanced tools
Comparing version 0.5.2 to 1.0.0
@@ -1,1 +0,1 @@ | ||
export declare function hash(value: string): string; | ||
export declare function createHash(value: string): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var djb2a = require("djb2a"); | ||
var NEW_LINE = '\n'; | ||
var NEW_LINES = /\r\n|\r|\n/g; | ||
var NORMALISED_NEW_LINE = '\n'; | ||
function hash(value) { | ||
return djb2a(value.replace(NEW_LINES, NORMALISED_NEW_LINE)).toString(); | ||
function createHash(value) { | ||
return djb2a(value.replace(NEW_LINES, NEW_LINE)).toString(); | ||
} | ||
exports.hash = hash; | ||
exports.createHash = createHash; | ||
//# sourceMappingURL=hasher.js.map |
@@ -1,8 +0,28 @@ | ||
import { BettererConfig } from './config'; | ||
import { BettererStats } from './statistics'; | ||
export * from './config'; | ||
export * from './constants'; | ||
export * from './files'; | ||
export * from './statistics'; | ||
export * from './types'; | ||
export declare function betterer(config: BettererConfig): Promise<BettererStats>; | ||
import { BettererConfigPartial } from './config'; | ||
import { BettererStats, BettererRuns } from './context'; | ||
import { BettererWatcher } from './watcher'; | ||
export * from './config/public'; | ||
export * from './context/public'; | ||
export * from './reporters/public'; | ||
export * from './results/public'; | ||
export * from './test/public'; | ||
export * from './watcher/public'; | ||
export declare function betterer(config: BettererConfigPartial): Promise<BettererStats>; | ||
export declare namespace betterer { | ||
var single: (config: Partial<{ | ||
configPaths: string | import("./config").BettererConfigPaths; | ||
resultsPath: string; | ||
filters: string | import("./config").BettererConfigFilters | readonly string[]; | ||
ignores: string | import("./config").BettererConfigIgnore; | ||
cwd: string; | ||
update: boolean; | ||
}>, filePath: string) => Promise<BettererRuns>; | ||
var watch: (config: Partial<{ | ||
configPaths: string | import("./config").BettererConfigPaths; | ||
resultsPath: string; | ||
filters: string | import("./config").BettererConfigFilters | readonly string[]; | ||
ignores: string | import("./config").BettererConfigIgnore; | ||
cwd: string; | ||
update: boolean; | ||
}>) => Promise<BettererWatcher>; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var logger_1 = require("@betterer/logger"); | ||
var errors_1 = require("@betterer/errors"); | ||
var context_1 = require("./context"); | ||
var register_1 = require("./register"); | ||
var reporters_1 = require("./reporters"); | ||
var runner_1 = require("./runner"); | ||
tslib_1.__exportStar(require("./constants"), exports); | ||
tslib_1.__exportStar(require("./files"), exports); | ||
tslib_1.__exportStar(require("./statistics"), exports); | ||
var watcher_1 = require("./watcher"); | ||
tslib_1.__exportStar(require("./context/public"), exports); | ||
tslib_1.__exportStar(require("./results/public"), exports); | ||
tslib_1.__exportStar(require("./test/public"), exports); | ||
tslib_1.__exportStar(require("./watcher/public"), exports); | ||
register_1.registerExtensions(); | ||
function betterer(config) { | ||
logger_1.header("\n \\ | / _ _ _ \n '-.ooo.-' | |__ ___| |_| |_ ___ _ __ ___ _ __ \n---ooooo--- | '_ \\ / _ \\ __| __/ _ \\ '__/ _ \\ '__|\n .-'ooo'-. | |_) | __/ |_| || __/ | | __/ | \n / | \\ |_.__/ \\___|\\__|\\__\\___|_| \\___|_| \n "); | ||
return runner_1.run(config); | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var context, runs, stats, e_1; | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 4, , 5]); | ||
context = new context_1.BettererContext(config, reporters_1.serialReporters); | ||
return [4 /*yield*/, context.setup()]; | ||
case 1: | ||
_a.sent(); | ||
return [4 /*yield*/, runner_1.serial(context)]; | ||
case 2: | ||
runs = _a.sent(); | ||
return [4 /*yield*/, context.process(runs)]; | ||
case 3: | ||
stats = _a.sent(); | ||
context.tearDown(); | ||
return [2 /*return*/, stats]; | ||
case 4: | ||
e_1 = _a.sent(); | ||
errors_1.logError(e_1); | ||
throw e_1; | ||
case 5: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
} | ||
exports.betterer = betterer; | ||
betterer.single = function bettererSingle(config, filePath) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var context, runs, e_2; | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 3, , 4]); | ||
context = new context_1.BettererContext(config); | ||
return [4 /*yield*/, context.setup()]; | ||
case 1: | ||
_a.sent(); | ||
return [4 /*yield*/, runner_1.parallel(context, [filePath])]; | ||
case 2: | ||
runs = _a.sent(); | ||
context.tearDown(); | ||
return [2 /*return*/, runs]; | ||
case 3: | ||
e_2 = _a.sent(); | ||
errors_1.logError(e_2); | ||
throw e_2; | ||
case 4: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}; | ||
betterer.watch = function bettererWatch(config) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var context_2, watcher, e_3; | ||
var _this = this; | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 2, , 3]); | ||
context_2 = new context_1.BettererContext(config, reporters_1.parallelReporters); | ||
watcher = new watcher_1.BettererWatcher(context_2, function (filePaths) { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, context_2.setup()]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/, runner_1.parallel(context_2, filePaths)]; | ||
} | ||
}); | ||
}); }); | ||
return [4 /*yield*/, watcher.setup()]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/, watcher]; | ||
case 2: | ||
e_3 = _a.sent(); | ||
errors_1.logError(e_3); | ||
throw e_3; | ||
case 3: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,3 @@ | ||
export declare const JS_EXTENSION = ".js"; | ||
export declare const RESULTS_EXTENTION = ".results"; | ||
export declare function registerExtensions(): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts_node_1 = require("ts-node"); | ||
var constants_1 = require("./constants"); | ||
exports.JS_EXTENSION = '.js'; | ||
exports.RESULTS_EXTENTION = '.results'; | ||
function registerExtensions() { | ||
// Need to do this so that webpack doesn't remove it | ||
// during the extension bundle... | ||
var EXTENSIONS = eval("require.extensions"); | ||
// Get the original JS module require: | ||
var JS = require.extensions[constants_1.JS_EXTENSION]; | ||
var JS = EXTENSIONS[exports.JS_EXTENSION]; | ||
// Use TS-Node register to allow `.betterer.ts` config files: | ||
ts_node_1.register(); | ||
ts_node_1.register({ | ||
transpileOnly: true, | ||
compilerOptions: { | ||
module: 'commonjs' | ||
} | ||
}); | ||
// Force `.betterer.results` files to be loaded as JS: | ||
require.extensions[constants_1.RESULTS_EXTENTION] = function (m, filePath) { | ||
EXTENSIONS[exports.RESULTS_EXTENTION] = function (m, filePath) { | ||
JS(m, filePath); | ||
@@ -13,0 +22,0 @@ }; |
export declare type MaybeAsync<T> = T | Promise<T>; | ||
export declare type BettererResult = { | ||
timestamp: number; | ||
value: unknown; | ||
}; | ||
export declare type BettererResults = Record<string, BettererResult>; |
{ | ||
"name": "@betterer/betterer", | ||
"description": "Main engine for runing betterer tests", | ||
"version": "0.5.2", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
@@ -27,6 +27,10 @@ "publishConfig": { | ||
"dependencies": { | ||
"@betterer/constraints": "^0.5.0", | ||
"@betterer/logger": "^0.5.0", | ||
"@betterer/constraints": "^1.0.0", | ||
"@betterer/errors": "^1.0.0", | ||
"@betterer/logger": "^1.0.0", | ||
"chokidar": "^3.3.1", | ||
"djb2a": "^1.2.0", | ||
"jest-diff": "^24.9.0", | ||
"find-up": "^4.1.0", | ||
"gitignore-globs": "^0.1.1", | ||
"jest-diff": "^26.0.1", | ||
"lines-and-columns": "^1.1.6", | ||
@@ -37,3 +41,3 @@ "safe-string-literal": "^1.0.1", | ||
}, | ||
"gitHead": "97ee5008070d4b8d4d52343b76addaed775802da" | ||
"gitHead": "1ce8729fb53a9a138624c2d30282092bbe931ddf" | ||
} |
@@ -1,2 +0,2 @@ | ||
[![betterer](https://github.com/phenomnomnominal/betterer/blob/master/docs/logo.png)](https://phenomnomnominal.github.io/betterer/) | ||
[![Betterer](https://raw.githubusercontent.com/phenomnomnominal/betterer/master/docs/logo.png)](https://phenomnomnominal.github.io/betterer/) | ||
@@ -18,5 +18,5 @@ # `@betterer/betterer` | ||
const resultsPath = path.resolve(cwd, './.betterer.results'); | ||
const { worse } = await betterer({ configPath, resultsPath }); | ||
process.exit(worse.length !== 0 ? 1 : 0); | ||
const { worse } = await betterer({ configPath, resultsPath, cwd }); | ||
process.exitcode = worse.length !== 0 ? 1 : 0; | ||
} | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
150144
168
2287
0
12
5
2
+ Added@betterer/errors@^1.0.0
+ Addedchokidar@^3.3.1
+ Addedfind-up@^4.1.0
+ Addedgitignore-globs@^0.1.1
+ Added@betterer/constraints@1.0.2(transitive)
+ Added@betterer/errors@1.2.0(transitive)
+ Added@betterer/logger@1.0.2(transitive)
+ Added@jest/types@26.6.2(transitive)
+ Added@types/istanbul-reports@3.0.4(transitive)
+ Added@types/node@22.10.2(transitive)
+ Added@types/yargs@15.0.19(transitive)
+ Addedansi-escapes@4.3.2(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedanymatch@3.1.3(transitive)
+ Addedastral-regex@2.0.0(transitive)
+ Addedbinary-extensions@2.3.0(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedchokidar@3.6.0(transitive)
+ Addedcli-cursor@3.1.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addeddiff-sequences@26.6.2(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfind-up@4.1.0(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedgitignore-globs@0.1.1(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedis-binary-path@2.1.0(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedjest-diff@26.6.2(transitive)
+ Addedjest-get-type@26.3.0(transitive)
+ Addedlocate-path@5.0.0(transitive)
+ Addedlog-update@4.0.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@4.1.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedpretty-format@26.6.2(transitive)
+ Addedreact-is@17.0.2(transitive)
+ Addedreaddirp@3.6.0(transitive)
+ Addedrestore-cursor@3.1.0(transitive)
+ Addedslice-ansi@4.0.0(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedtype-fest@0.21.3(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedwrap-ansi@6.2.0(transitive)
- Removed@betterer/constraints@0.5.0(transitive)
- Removed@betterer/logger@0.5.0(transitive)
- Removed@jest/types@24.9.0(transitive)
- Removed@types/istanbul-reports@1.1.2(transitive)
- Removed@types/yargs@13.0.12(transitive)
- Removedansi-regex@4.1.1(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removeddiff-sequences@24.9.0(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedjest-diff@24.9.0(transitive)
- Removedjest-get-type@24.9.0(transitive)
- Removedpretty-format@24.9.0(transitive)
- Removedreact-is@16.13.1(transitive)
- Removedsupports-color@5.5.0(transitive)
Updated@betterer/constraints@^1.0.0
Updated@betterer/logger@^1.0.0
Updatedjest-diff@^26.0.1