Skip to content

Commit

Permalink
chore(build): update dist/index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio authored and actions-user committed May 21, 2021
1 parent af88c97 commit ec4694f
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5853,22 +5853,31 @@ function requirePeerDependency(dependency) {
}

// src/run-tester.ts
var INTERNAL_CONFIG = "eslint-remote-tester-compare-internal.config.js";
var INTERNAL_CONFIG = "./eslint-remote-tester-runner-internal.config.js";
var RESULTS_TMP = "/tmp/results.json";
var DEFAULT_CONFIG = {
cache: false,
CI: true
};
var CONFIGURATION_TEMPLATE = (configuration, configurationPath) => `// Generated by eslint-remote-tester-run-action
var CONFIGURATION_TEMPLATE = (pathToUsersConfiguration) => `// Generated by eslint-remote-tester-run-action
const fs = require('fs');
// Load user's eslint-remote-tester.config.js
const usersConfig = require('${pathToUsersConfiguration}');
module.exports = {
...${JSON.stringify(configuration, null, 4)},
...usersConfig,
// Values from eslint-remote-tester-run-action's default configuration
...${JSON.stringify(DEFAULT_CONFIG, null, 4)},
onComplete: async function onComplete(results, comparisonResults) {
// Write results to cache
fs.writeFileSync('${RESULTS_TMP}', JSON.stringify(results || []));
// User provided onComplete is injected here if present
${configuration.onComplete ? `await require('${configurationPath}').onComplete(results, comparisonResults);` : "// No onComplete detected"}
if(usersConfig.onComplete) {
await usersConfig.onComplete(results, comparisonResults);
}
}
};
`;
Expand All @@ -5880,20 +5889,16 @@ async function runTester(configLocation) {
if (!import_fs.default.existsSync(usersConfigLocation)) {
throw new Error(`Unable to find eslint-remote-tester config with path ${usersConfigLocation}`);
}
let usersConfig;
import_fs.default.writeFileSync(INTERNAL_CONFIG, CONFIGURATION_TEMPLATE(usersConfigLocation));
let config;
try {
usersConfig = require(usersConfigLocation);
config = require(import_path2.default.resolve(INTERNAL_CONFIG));
} catch (e) {
throw e;
}
const config = {
...DEFAULT_CONFIG,
...usersConfig
};
import_fs.default.writeFileSync(INTERNAL_CONFIG, CONFIGURATION_TEMPLATE(config, usersConfigLocation));
const {validateConfig} = requirePeerDependency("eslint-remote-tester");
await validateConfig(config, false);
await import_exec.exec(`${ESLINT_REMOTE_TESTER_BIN} --config ./${INTERNAL_CONFIG}`, [], {
await import_exec.exec(`${ESLINT_REMOTE_TESTER_BIN} --config ${INTERNAL_CONFIG}`, [], {
ignoreReturnCode: true,
env: {...process.env, NODE_OPTIONS: "--max_old_space_size=5120"}
});
Expand Down

0 comments on commit ec4694f

Please sign in to comment.