Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
uiautomator2: ['?'],
uiautomator: ['4.2'],
windows: ['10'],
mac: ['?'], // TODO
};
// When was the driver supported in Appium?
const appiumRanges = {
xcuitest: ['1.6.0'],
uiautomator2: ['1.6.0'],
espresso: ['1.9.0'],
windows: ['1.6.0'],
mac: ['1.6.4'],
};
const rootFolder = findRoot(__dirname);
// Create Handlebars helper that shows a version range
Handlebars.registerHelper('versions', function versionHelper (object, name, driverName) {
if (!object) {
return 'None';
}
if (!_.isObject(object)) {
object = {};
}
let min = object[name ? `${name}_min` : 'min'];
let max = object[name ? `${name}_max` : 'max'];
if (!min) {
if (name === 'appium' && _.isArray(appiumRanges[driverName])) {
async start(application) {
// Load boilerplate-server core configuration
const core = load(
resolve(findRoot(__dirname), this.configuration.path),
this.configuration.filter,
application.runtime.env
);
// Load package.jsons
const corePkgPath = resolve(application.runtime.base, "package.json");
const pkgPath = resolve(application.runtime.cwd, "package.json");
const corePkg = require(corePkgPath);
const userPkg = require(pkgPath);
const pkg = merge({}, corePkg, userPkg);
// Allow user to override core behaviour via cli and *rc files
merge(core, { pkg }, application.runtime.api);
// Find all node modules on the way from here to the top
const getPackageRootPath = memoize(filename => findRoot(filename))
import { Logger } from '@nestjs/common';
import { classToPlain, Exclude } from 'class-transformer';
import { validateSync } from 'class-validator';
import findRoot from 'find-root';
import { readJSONSync, writeJson } from 'fs-extra';
import { camelCase, get } from 'lodash';
import nconf from 'nconf';
import { join } from 'path';
import SmeeClient from 'smee-client';
import { ConfigValidationError } from '@kb-errors';
import { PackageDetailsDto } from '@kb-models';
import { AchievibitConfig } from './achievibit-config.model';
const appRoot = findRoot(__dirname);
const environment = get(process, 'env.NODE_ENV', 'development');
const eventLogger: Logger = new Logger('SmeeEvents');
(eventLogger as any).info = eventLogger.log;
const configFilePath = join(appRoot, `${ environment }.env.json`);
const packageDetails = new PackageDetailsDto(readJSONSync(join(appRoot, 'package.json')));
nconf
.argv({
parseValues: true
})
.env({
lowerCase: true,
parseValues: true,
transform: transformToLowerCase
})
const packageResolve = (id, directory) =>
path.resolve(findRoot(resolve(id)), directory);
#!/usr/bin/env node
import findRoot from 'find-root'
const root = findRoot(__dirname)
import { main } from './src/element'
main(root)
export default async options => {
const instance = await boilerplate({
name: "patternplate-server",
cwd: findRoot(__dirname),
...options
});
instance.transforms = await transforms(instance);
instance.pattern = await pattern(instance);
const cache = await getCache(instance);
instance.cache = cache;
if (options.mode !== "console") {
const readFile = getReadFile({ cache });
readTree(path.resolve("./patterns"), cache).then(tree =>
Promise.all(tree.map(file => readFile(file)))
);