Skip to content

Commit cb2f417

Browse files
committed
added paths in tsconfig.json
1 parent 09ec3fa commit cb2f417

7 files changed

Lines changed: 25 additions & 21 deletions

File tree

lib/PowerShell/ServicePrincipalLogin.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
2020
};
2121
Object.defineProperty(exports, "__esModule", { value: true });
2222
const core = __importStar(require("@actions/core"));
23-
const Utils_1 = __importDefault(require("./Utilities/Utils"));
24-
const PowerShellToolRunner_1 = __importDefault(require("./Utilities/PowerShellToolRunner"));
25-
const ScriptBuilder_1 = __importDefault(require("./Utilities/ScriptBuilder"));
26-
const Constants_1 = __importDefault(require("./Constants"));
23+
const Utils_1 = __importDefault(require("PowerShell/Utilities/Utils"));
24+
const PowerShellToolRunner_1 = __importDefault(require("PowerShell/Utilities/PowerShellToolRunner"));
25+
const ScriptBuilder_1 = __importDefault(require("PowerShell/Utilities/ScriptBuilder"));
26+
const Constants_1 = __importDefault(require("PowerShell/Constants"));
2727
class ServicePrincipalLogin {
2828
constructor(servicePrincipalId, servicePrincipalKey, tenantId, subscriptionId) {
2929
this.servicePrincipalId = servicePrincipalId;
@@ -48,7 +48,7 @@ class ServicePrincipalLogin {
4848
});
4949
}
5050
}
51-
exports.ServicePrincipalLogin = ServicePrincipalLogin;
51+
exports.default = ServicePrincipalLogin;
5252
ServicePrincipalLogin.environment = Constants_1.default.environment;
5353
ServicePrincipalLogin.scopeLevel = Constants_1.default.scopeLevel;
5454
ServicePrincipalLogin.scheme = Constants_1.default.scheme;

lib/PowerShell/Utilities/Utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
2020
};
2121
Object.defineProperty(exports, "__esModule", { value: true });
2222
const os = __importStar(require("os"));
23-
const Constants_1 = __importDefault(require("../Constants"));
24-
const PowerShellToolRunner_1 = __importDefault(require("./PowerShellToolRunner"));
23+
const Constants_1 = __importDefault(require("PowerShell/Constants"));
24+
const PowerShellToolRunner_1 = __importDefault(require("PowerShell/Utilities/PowerShellToolRunner"));
2525
class Utils {
2626
static getLatestModule(moduleName) {
2727
return __awaiter(this, void 0, void 0, function* () {

lib/main.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
1515
result["default"] = mod;
1616
return result;
1717
};
18+
var __importDefault = (this && this.__importDefault) || function (mod) {
19+
return (mod && mod.__esModule) ? mod : { "default": mod };
20+
};
1821
Object.defineProperty(exports, "__esModule", { value: true });
1922
const core = __importStar(require("@actions/core"));
2023
const crypto = __importStar(require("crypto"));
2124
const exec = __importStar(require("@actions/exec"));
2225
const io = __importStar(require("@actions/io"));
2326
const actions_secret_parser_1 = require("actions-secret-parser");
24-
const ServicePrincipalLogin_1 = require("./PowerShell/ServicePrincipalLogin");
27+
const ServicePrincipalLogin_1 = __importDefault(require("PowerShell/ServicePrincipalLogin"));
2528
var azPath;
2629
var prefix = !!process.env.AZURE_HTTP_USER_AGENT ? `${process.env.AZURE_HTTP_USER_AGENT}` : "";
2730
function main() {
@@ -48,7 +51,7 @@ function main() {
4851
yield executeAzCliCommand(`account set --subscription "${subscriptionId}"`);
4952
if (enablePSSession) {
5053
console.log(`Running Azure PS Login`);
51-
const spnlogin = new ServicePrincipalLogin_1.ServicePrincipalLogin(servicePrincipalId, servicePrincipalKey, tenantId, subscriptionId);
54+
const spnlogin = new ServicePrincipalLogin_1.default(servicePrincipalId, servicePrincipalKey, tenantId, subscriptionId);
5255
spnlogin.initialize();
5356
spnlogin.login();
5457
}

src/PowerShell/ServicePrincipalLogin.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as core from '@actions/core';
22

3-
import Utils from './Utilities/Utils';
4-
import PowerShellToolRunner from './Utilities/PowerShellToolRunner';
5-
import ScriptBuilder from './Utilities/ScriptBuilder';
6-
import Constants from './Constants';
3+
import Utils from 'PowerShell/Utilities/Utils';
4+
import PowerShellToolRunner from 'PowerShell/Utilities/PowerShellToolRunner';
5+
import ScriptBuilder from 'PowerShell/Utilities/ScriptBuilder';
6+
import Constants from 'PowerShell/Constants';
77

8-
export class ServicePrincipalLogin implements IAzurePowerShellSession {
8+
export default class ServicePrincipalLogin implements IAzurePowerShellSession {
99
static readonly environment: string = Constants.environment;
1010
static readonly scopeLevel: string = Constants.scopeLevel;
1111
static readonly scheme: string = Constants.scheme;

src/PowerShell/Utilities/Utils.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import * as os from 'os';
2-
import * as exec from '@actions/exec';
3-
import * as io from '@actions/io';
42

5-
import Constants from '../Constants';
6-
import PowerShellToolRunner from './PowerShellToolRunner';
3+
import Constants from 'PowerShell/Constants';
4+
import PowerShellToolRunner from 'PowerShell/Utilities/PowerShellToolRunner';
75

86
export default class Utils {
97
static async getLatestModule(moduleName: string): Promise<string> {

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as exec from '@actions/exec';
44
import * as io from '@actions/io';
55

66
import { FormatType, SecretParser } from 'actions-secret-parser';
7-
import { ServicePrincipalLogin } from './PowerShell/ServicePrincipalLogin';
7+
import ServicePrincipalLogin from 'PowerShell/ServicePrincipalLogin';
88

99
var azPath: string;
1010
var prefix = !!process.env.AZURE_HTTP_USER_AGENT ? `${process.env.AZURE_HTTP_USER_AGENT}` : "";

tsconfig.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@
3838

3939
/* Module Resolution Options */
4040
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
41-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
42-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
41+
"baseUrl": "src", /* Base directory to resolve non-absolute module names. */
42+
"paths": { /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
43+
"PowerShell/*": ["PowerShell/*"],
44+
"PowerShell/Utilities/*": [ "PowerShell/Utilities/*"]
45+
},
4346
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
4447
// "typeRoots": [], /* List of folders to include type definitions from. */
4548
// "types": [], /* Type declaration files to be included in compilation. */

0 commit comments

Comments
 (0)