From 860e5ace464e898dbc62db0a2281b26250c076d8 Mon Sep 17 00:00:00 2001 From: aksm-ms <58936966+aksm-ms@users.noreply.github.com> Date: Tue, 17 Mar 2020 17:26:39 +0530 Subject: [PATCH] Revert "added paths in tsconfig.json" This reverts commit cb2f4176bfc1e6603b6f7b2c4122f9327c913786. --- lib/PowerShell/ServicePrincipalLogin.js | 10 +++++----- lib/PowerShell/Utilities/Utils.js | 4 ++-- lib/main.js | 7 ++----- src/PowerShell/ServicePrincipalLogin.ts | 10 +++++----- src/PowerShell/Utilities/Utils.ts | 6 ++++-- src/main.ts | 2 +- tsconfig.json | 7 ++----- 7 files changed, 21 insertions(+), 25 deletions(-) diff --git a/lib/PowerShell/ServicePrincipalLogin.js b/lib/PowerShell/ServicePrincipalLogin.js index 3f473425..9dadd9e3 100644 --- a/lib/PowerShell/ServicePrincipalLogin.js +++ b/lib/PowerShell/ServicePrincipalLogin.js @@ -20,10 +20,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(require("@actions/core")); -const Utils_1 = __importDefault(require("PowerShell/Utilities/Utils")); -const PowerShellToolRunner_1 = __importDefault(require("PowerShell/Utilities/PowerShellToolRunner")); -const ScriptBuilder_1 = __importDefault(require("PowerShell/Utilities/ScriptBuilder")); -const Constants_1 = __importDefault(require("PowerShell/Constants")); +const Utils_1 = __importDefault(require("./Utilities/Utils")); +const PowerShellToolRunner_1 = __importDefault(require("./Utilities/PowerShellToolRunner")); +const ScriptBuilder_1 = __importDefault(require("./Utilities/ScriptBuilder")); +const Constants_1 = __importDefault(require("./Constants")); class ServicePrincipalLogin { constructor(servicePrincipalId, servicePrincipalKey, tenantId, subscriptionId) { this.servicePrincipalId = servicePrincipalId; @@ -48,7 +48,7 @@ class ServicePrincipalLogin { }); } } -exports.default = ServicePrincipalLogin; +exports.ServicePrincipalLogin = ServicePrincipalLogin; ServicePrincipalLogin.environment = Constants_1.default.environment; ServicePrincipalLogin.scopeLevel = Constants_1.default.scopeLevel; ServicePrincipalLogin.scheme = Constants_1.default.scheme; diff --git a/lib/PowerShell/Utilities/Utils.js b/lib/PowerShell/Utilities/Utils.js index f5b6b69a..e32d79ae 100644 --- a/lib/PowerShell/Utilities/Utils.js +++ b/lib/PowerShell/Utilities/Utils.js @@ -20,8 +20,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const os = __importStar(require("os")); -const Constants_1 = __importDefault(require("PowerShell/Constants")); -const PowerShellToolRunner_1 = __importDefault(require("PowerShell/Utilities/PowerShellToolRunner")); +const Constants_1 = __importDefault(require("../Constants")); +const PowerShellToolRunner_1 = __importDefault(require("./PowerShellToolRunner")); class Utils { static getLatestModule(moduleName) { return __awaiter(this, void 0, void 0, function* () { diff --git a/lib/main.js b/lib/main.js index 47da445d..ba89d83d 100644 --- a/lib/main.js +++ b/lib/main.js @@ -15,16 +15,13 @@ var __importStar = (this && this.__importStar) || function (mod) { result["default"] = mod; return result; }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(require("@actions/core")); const crypto = __importStar(require("crypto")); const exec = __importStar(require("@actions/exec")); const io = __importStar(require("@actions/io")); const actions_secret_parser_1 = require("actions-secret-parser"); -const ServicePrincipalLogin_1 = __importDefault(require("PowerShell/ServicePrincipalLogin")); +const ServicePrincipalLogin_1 = require("./PowerShell/ServicePrincipalLogin"); var azPath; var prefix = !!process.env.AZURE_HTTP_USER_AGENT ? `${process.env.AZURE_HTTP_USER_AGENT}` : ""; function main() { @@ -51,7 +48,7 @@ function main() { yield executeAzCliCommand(`account set --subscription "${subscriptionId}"`); if (enablePSSession) { console.log(`Running Azure PS Login`); - const spnlogin = new ServicePrincipalLogin_1.default(servicePrincipalId, servicePrincipalKey, tenantId, subscriptionId); + const spnlogin = new ServicePrincipalLogin_1.ServicePrincipalLogin(servicePrincipalId, servicePrincipalKey, tenantId, subscriptionId); spnlogin.initialize(); spnlogin.login(); } diff --git a/src/PowerShell/ServicePrincipalLogin.ts b/src/PowerShell/ServicePrincipalLogin.ts index 288e343e..7760e97c 100644 --- a/src/PowerShell/ServicePrincipalLogin.ts +++ b/src/PowerShell/ServicePrincipalLogin.ts @@ -1,11 +1,11 @@ import * as core from '@actions/core'; -import Utils from 'PowerShell/Utilities/Utils'; -import PowerShellToolRunner from 'PowerShell/Utilities/PowerShellToolRunner'; -import ScriptBuilder from 'PowerShell/Utilities/ScriptBuilder'; -import Constants from 'PowerShell/Constants'; +import Utils from './Utilities/Utils'; +import PowerShellToolRunner from './Utilities/PowerShellToolRunner'; +import ScriptBuilder from './Utilities/ScriptBuilder'; +import Constants from './Constants'; -export default class ServicePrincipalLogin implements IAzurePowerShellSession { +export class ServicePrincipalLogin implements IAzurePowerShellSession { static readonly environment: string = Constants.environment; static readonly scopeLevel: string = Constants.scopeLevel; static readonly scheme: string = Constants.scheme; diff --git a/src/PowerShell/Utilities/Utils.ts b/src/PowerShell/Utilities/Utils.ts index c990d6c4..9a25a72b 100644 --- a/src/PowerShell/Utilities/Utils.ts +++ b/src/PowerShell/Utilities/Utils.ts @@ -1,7 +1,9 @@ import * as os from 'os'; +import * as exec from '@actions/exec'; +import * as io from '@actions/io'; -import Constants from 'PowerShell/Constants'; -import PowerShellToolRunner from 'PowerShell/Utilities/PowerShellToolRunner'; +import Constants from '../Constants'; +import PowerShellToolRunner from './PowerShellToolRunner'; export default class Utils { static async getLatestModule(moduleName: string): Promise { diff --git a/src/main.ts b/src/main.ts index 68a41d1e..f81f26d7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,7 +4,7 @@ import * as exec from '@actions/exec'; import * as io from '@actions/io'; import { FormatType, SecretParser } from 'actions-secret-parser'; -import ServicePrincipalLogin from 'PowerShell/ServicePrincipalLogin'; +import { ServicePrincipalLogin } from './PowerShell/ServicePrincipalLogin'; var azPath: string; var prefix = !!process.env.AZURE_HTTP_USER_AGENT ? `${process.env.AZURE_HTTP_USER_AGENT}` : ""; diff --git a/tsconfig.json b/tsconfig.json index bbf65293..7a865ad1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -38,11 +38,8 @@ /* Module Resolution Options */ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - "baseUrl": "src", /* Base directory to resolve non-absolute module names. */ - "paths": { /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - "PowerShell/*": ["PowerShell/*"], - "PowerShell/Utilities/*": [ "PowerShell/Utilities/*"] - }, + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */