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 Dec 31, 2021
1 parent d6f2ec3 commit e72eaaa
Showing 1 changed file with 34 additions and 15 deletions.
49 changes: 34 additions & 15 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5840,7 +5840,7 @@ var import_compare = __toModule(require_compare());
var core2 = __toModule(require_core());
var DEPENDENCY_TO_INFO = {
"eslint-remote-tester": {
minVersion: "1.0.1",
minVersion: "2.1.1",
exportPath: "eslint-remote-tester/dist/exports-for-compare-action",
packageJsonPath: "eslint-remote-tester/package.json",
bin: "eslint-remote-tester"
Expand Down Expand Up @@ -5868,21 +5868,13 @@ function requirePeerDependency(dependency) {
}

// src/run-tester.ts
var INTERNAL_CONFIG = "./eslint-remote-tester-runner-internal.config.js";
var INTERNAL_CONFIG = "./eslint-remote-tester-runner-internal.config";
var RESULTS_TMP = "/tmp/results.json";
var DEFAULT_CONFIG = {
cache: false,
CI: true
};
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 = {
...usersConfig,
var CONFIGURATION_TEMPLATE_BASE = `
// Values from eslint-remote-tester-run-action's default configuration
...${JSON.stringify(DEFAULT_CONFIG, null, 4)},
Expand All @@ -5894,8 +5886,32 @@ module.exports = {
await usersConfig.onComplete(results, comparisonResults, repositoryCount);
}
}
`;
var CONFIGURATION_TEMPLATE_JS = (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 = {
...usersConfig,
${CONFIGURATION_TEMPLATE_BASE}
};
`;
var CONFIGURATION_TEMPLATE_TS = (pathToUsersConfiguration) => `// Generated by eslint-remote-tester-run-action
import fs from 'fs';
import type { Config } from 'eslint-remote-tester';
// Load user's eslint-remote-tester.config.ts
import usersConfig from '${pathToUsersConfiguration.replace(/\.ts$/, "")}';
const config: Config = {
...usersConfig,
${CONFIGURATION_TEMPLATE_BASE}
};
export default config;
`;
async function runTester(configLocation) {
const usersConfigLocation = import_path2.default.resolve(configLocation);
if (!import_fs.default.existsSync(ESLINT_REMOTE_TESTER_BIN)) {
Expand All @@ -5904,16 +5920,19 @@ async function runTester(configLocation) {
if (!import_fs.default.existsSync(usersConfigLocation)) {
throw new Error(`Unable to find eslint-remote-tester config with path ${usersConfigLocation}`);
}
import_fs.default.writeFileSync(INTERNAL_CONFIG, CONFIGURATION_TEMPLATE(usersConfigLocation));
const extension = usersConfigLocation.split(".").pop();
const configTemplate = extension === "ts" ? CONFIGURATION_TEMPLATE_TS : CONFIGURATION_TEMPLATE_JS;
const createdConfig = `${INTERNAL_CONFIG}.${extension}`;
import_fs.default.writeFileSync(createdConfig, configTemplate(usersConfigLocation));
const {loadConfig, validateConfig} = requirePeerDependency("eslint-remote-tester");
let config;
try {
config = require(import_path2.default.resolve(INTERNAL_CONFIG));
config = loadConfig(import_path2.default.resolve(createdConfig));
} catch (e) {
throw e;
}
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 ${createdConfig}`, [], {
ignoreReturnCode: true,
env: {...process.env, NODE_OPTIONS: "--max_old_space_size=5120"}
});
Expand Down

0 comments on commit e72eaaa

Please sign in to comment.