Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@betterer/betterer

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@betterer/betterer - npm Package Compare versions

Comparing version 0.5.2 to 1.0.0

dist/config/config.d.ts

2

dist/hasher.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc