From 55e254e1299e3a96f46d8f3a229d7820cf08fdc7 Mon Sep 17 00:00:00 2001 From: rumblefrog Date: Fri, 15 Nov 2019 23:04:06 -0500 Subject: [PATCH] refactor: file structuring --- lib/installer.js | 2 +- lib/structures/versioning.js | 2 +- lib/{ => utils}/constants.js | 0 lib/{ => utils}/scraper.js | 2 +- src/installer.ts | 2 +- src/structures/versioning.ts | 2 +- src/{ => utils}/constants.ts | 0 src/{ => utils}/scraper.ts | 2 +- 8 files changed, 6 insertions(+), 6 deletions(-) rename lib/{ => utils}/constants.js (100%) rename lib/{ => utils}/scraper.js (98%) rename src/{ => utils}/constants.ts (100%) rename src/{ => utils}/scraper.ts (95%) diff --git a/lib/installer.js b/lib/installer.js index f951e82..33b185c 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -13,7 +13,7 @@ const tool_cache_1 = require("@actions/tool-cache"); const core_1 = require("@actions/core"); const semver_1 = require("semver"); const path_1 = require("path"); -const scraper_1 = require("./scraper"); +const scraper_1 = require("./utils/scraper"); let versions; function installCompiler(range) { return __awaiter(this, void 0, void 0, function* () { diff --git a/lib/structures/versioning.js b/lib/structures/versioning.js index 6b39b3a..cd949ed 100644 --- a/lib/structures/versioning.js +++ b/lib/structures/versioning.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const constants_1 = require("../constants"); +const constants_1 = require("../utils/constants"); var Platform; (function (Platform) { Platform["Linux"] = "linux"; diff --git a/lib/constants.js b/lib/utils/constants.js similarity index 100% rename from lib/constants.js rename to lib/utils/constants.js diff --git a/lib/scraper.js b/lib/utils/scraper.js similarity index 98% rename from lib/scraper.js rename to lib/utils/scraper.js index f0e1638..c026b22 100644 --- a/lib/scraper.js +++ b/lib/utils/scraper.js @@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const constants_1 = require("./constants"); -const versioning_1 = require("./structures/versioning"); +const versioning_1 = require("../structures/versioning"); const HttpClient_1 = require("typed-rest-client/HttpClient"); const await_to_js_1 = __importDefault(require("await-to-js")); const client = new HttpClient_1.HttpClient('setup-sp'); diff --git a/src/installer.ts b/src/installer.ts index 7239e13..767ae6f 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -2,7 +2,7 @@ import { find as findCache, downloadTool, extractTar, extractZip, cacheDir } fro import { addPath } from '@actions/core'; import { maxSatisfying } from 'semver'; import { join as pathJoin } from 'path'; -import { getVersions } from './scraper'; +import { getVersions } from './utils/scraper'; let versions; diff --git a/src/structures/versioning.ts b/src/structures/versioning.ts index e3db9b5..26665cf 100644 --- a/src/structures/versioning.ts +++ b/src/structures/versioning.ts @@ -1,4 +1,4 @@ -import { ENDPOINT } from '../constants'; +import { ENDPOINT } from '../utils/constants'; export enum Platform { Linux = "linux", diff --git a/src/constants.ts b/src/utils/constants.ts similarity index 100% rename from src/constants.ts rename to src/utils/constants.ts diff --git a/src/scraper.ts b/src/utils/scraper.ts similarity index 95% rename from src/scraper.ts rename to src/utils/scraper.ts index 2d00c18..ebe4829 100644 --- a/src/scraper.ts +++ b/src/utils/scraper.ts @@ -1,5 +1,5 @@ import { ENDPOINT, MM_REGEX, BUILD_REGEX } from './constants'; -import { Platform, Version, Versions, parsePlatform } from './structures/versioning'; +import { Platform, Version, Versions, parsePlatform } from '../structures/versioning'; import { HttpClient } from 'typed-rest-client/HttpClient'; import to from 'await-to-js';