Skip to content

Commit 5be18bf

Browse files
Merge pull request #151 from Power-Maverick/main
Update file paths and imports. Upgraded to webpack
2 parents 7e4ec42 + d916240 commit 5be18bf

14 files changed

+2269
-1362
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Install Node.js
1818
uses: actions/setup-node@v1
1919
with:
20-
node-version: 14.x
20+
node-version: 18.x
2121
- name: Run Build
2222
run: |
2323
npm install

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- uses: actions/setup-node@v1
1414
with:
15-
node-version: 14.x
15+
node-version: 18.x
1616
- name: Run Build
1717
run: |
1818
npm install

package-lock.json

Lines changed: 2118 additions & 1269 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "dataverse-devtools",
33
"displayName": "Dataverse DevTools",
4-
"version": "2.1.13",
4+
"version": "2.2.0",
55
"description": "The all-in-one tool to develop code for Dataverse/Dynamics 365. Helps you connect to a Dataverse environment, generate TypeScript definitions for entities, create different type of Dataverse-specific projects and much more.",
66
"publisher": "danish-naglekar",
77
"author": {
@@ -20,17 +20,20 @@
2020
"*"
2121
],
2222
"engines": {
23-
"vscode": "^1.58.0"
23+
"vscode": "^1.80.0"
2424
},
25-
"main": "./out/extension.js",
25+
"main": "./dist/extension.js",
2626
"scripts": {
27-
"vscode:prepublish": "npm run compile",
28-
"compile": "tsc -p ./",
29-
"watch": "tsc -watch -p ./",
30-
"pretest": "npm run compile && npm run lint",
27+
"vscode:prepublish": "npm run package",
28+
"compile": "webpack",
29+
"watch": "webpack --watch",
30+
"package": "webpack --mode production --devtool hidden-source-map",
31+
"compile-tests": "tsc -p . --outDir out",
32+
"watch-tests": "tsc -p . -w --outDir out",
33+
"pretest": "npm run compile-tests && npm run compile && npm run lint",
3134
"lint": "eslint src --ext ts",
35+
"test": "vscode-test",
3236
"format": "prettier --write src",
33-
"test": "node ./out/test/runTest.js",
3437
"version": "auto-changelog -p && git add CHANGELOG.md",
3538
"contributors:add": "all-contributors add",
3639
"contributors:generate": "all-contributors generate"
@@ -551,27 +554,32 @@
551554
"devDependencies": {
552555
"@types/glob": "^7.1.3",
553556
"@types/mocha": "^8.2.2",
554-
"@types/node": "14.x",
557+
"@types/node": "18.x",
555558
"@types/node-fetch": "^2.5.11",
556559
"@types/uuid": "^8.3.1",
557-
"@types/vscode": "^1.58.0",
558-
"@typescript-eslint/eslint-plugin": "^4.26.0",
559-
"@typescript-eslint/parser": "^4.26.0",
560+
"@types/vscode": "^1.80.0",
561+
"@typescript-eslint/eslint-plugin": "^6.15.0",
562+
"@typescript-eslint/parser": "^6.15.0",
563+
"@vscode/test-cli": "^0.0.4",
564+
"@vscode/test-electron": "^2.3.8",
560565
"all-contributors-cli": "^6.20.0",
561566
"auto-changelog": "^2.3.0",
562-
"eslint": "^7.27.0",
567+
"copy-webpack-plugin": "^11.0.0",
568+
"eslint": "^8.56.0",
563569
"glob": "^7.1.7",
564570
"mocha": "^10.0.0",
565-
"typescript": "^4.3.2",
566-
"vscode-test": "^1.5.2"
571+
"ts-loader": "^9.5.1",
572+
"typescript": "^5.3.3",
573+
"webpack": "^5.89.0",
574+
"webpack-cli": "^5.1.4"
567575
},
568576
"dependencies": {
569577
"@azure/identity": "^3.0.0",
570578
"@azure/identity-vscode": "^1.0.0",
571579
"@azure/msal-node": "^1.3.0",
572580
"@types/fs-extra": "^9.0.12",
573581
"@types/lodash": "^4.14.171",
574-
"@vscode/extension-telemetry": "^0.8.5",
582+
"@vscode/extension-telemetry": "^0.9.2",
575583
"axios": "^0.27.2",
576584
"conditional-reduce": "^1.2.0",
577585
"dayjs": "^1.10.7",

src/cliCommands/cliCommandsDataProvider.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import * as vscode from "vscode";
21
import * as path from "path";
3-
import * as config from "../utils/Config";
4-
import { ICliCommandVerb, ICliCommandList } from "../utils/Interfaces";
5-
import { CliCommandItemBase } from "./cliCommandsItemBase";
2+
import * as vscode from "vscode";
3+
import { ICliCommandList, ICliCommandVerb } from "../utils/Interfaces";
64
import cliInJson from "./cliCommands.json";
5+
import { CliCommandItemBase } from "./cliCommandsItemBase";
76

87
export class CliCommandDataProvider implements vscode.TreeDataProvider<CliCommandTreeItem> {
98
private cliCommands: ICliCommandList | undefined;
@@ -56,8 +55,8 @@ export class CliCommandTreeItem extends CliCommandItemBase {
5655
}
5756

5857
iconPath = {
59-
light: path.join(__filename, "..", "..", "..", "resources", "light", this.level === 1 ? "folder.svg" : this.level === 2 ? "cli.svg" : "generic.svg"),
60-
dark: path.join(__filename, "..", "..", "..", "resources", "dark", this.level === 1 ? "folder.svg" : this.level === 2 ? "cli.svg" : "generic.svg"),
58+
light: path.join(__filename, "..", "resources", "light", this.level === 1 ? "folder.svg" : this.level === 2 ? "cli.svg" : "generic.svg"),
59+
dark: path.join(__filename, "..", "resources", "dark", this.level === 1 ? "folder.svg" : this.level === 2 ? "cli.svg" : "generic.svg"),
6160
};
6261

6362
contextValue = this.level === 2 ? "cli-command" : "cli-group";

src/cliCommands/cliCommandsItemBase.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as vscode from "vscode";
21
import * as path from "path";
2+
import * as vscode from "vscode";
33

44
export class CliCommandItemBase extends vscode.TreeItem {
55
constructor(public readonly label: string, public readonly desc: string | undefined, public readonly collapsibleState: vscode.TreeItemCollapsibleState) {
@@ -10,8 +10,8 @@ export class CliCommandItemBase extends vscode.TreeItem {
1010
}
1111

1212
iconPath = {
13-
light: path.join(__filename, "..", "..", "..", "resources", "light", "generic.svg"),
14-
dark: path.join(__filename, "..", "..", "..", "resources", "dark", "generic.svg"),
13+
light: path.join(__filename, "..", "resources", "light", "generic.svg"),
14+
dark: path.join(__filename, "..", "resources", "dark", "generic.svg"),
1515
};
1616

1717
//contextValue = this.level === 2 ? "connection" : "connection-child";

src/login/server.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import * as fs from "fs";
33
import * as http from "http";
44
import * as net from "net";
55
import * as path from "path";
6-
import * as url from "url";
76
import { parse, ParsedUrlQuery } from "querystring";
7+
import * as url from "url";
88

99
interface Deferred<T> {
1010
resolve: (result: T | Promise<T>) => void;
@@ -88,10 +88,10 @@ export function createServer(nonce: string): {
8888
}
8989
break;
9090
case "/":
91-
sendFile(res, path.join(__filename, "..", "..", "..", "CodeFlowResult", "index.html"), "text/html; charset=utf-8");
91+
sendFile(res, path.join(__filename, "..", "CodeFlowResult", "index.html"), "text/html; charset=utf-8");
9292
break;
9393
case "/main.css":
94-
sendFile(res, path.join(__filename, "..", "..", "..", "CodeFlowResult", "main.css"), "text/css; charset=utf-8");
94+
sendFile(res, path.join(__filename, "..", "CodeFlowResult", "main.css"), "text/css; charset=utf-8");
9595
break;
9696
case "/callback/":
9797
deferredCode.resolve(
@@ -137,10 +137,11 @@ export function createTerminateServer(server: http.Server): () => Promise<void>
137137
}
138138

139139
export async function startServer(server: http.Server, adfs: boolean): Promise<number> {
140-
let portTimer: NodeJS.Timer;
140+
let portTimer: NodeJS.Timeout;
141141
function cancelPortTimer() {
142142
clearTimeout(portTimer);
143143
}
144+
144145
const portPromise = new Promise<number>((resolve, reject) => {
145146
portTimer = setTimeout(() => {
146147
reject(new Error("Timeout waiting for port"));

src/tools/toolsDataProvider.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as vscode from "vscode";
21
import * as path from "path";
2+
import * as vscode from "vscode";
33
import { ITools } from "../utils/Interfaces";
4-
import { ToolsItemBase } from "./toolsItemBase";
54
import toolsInJson from "./tools.json";
5+
import { ToolsItemBase } from "./toolsItemBase";
66

77
export class ToolsDataProvider implements vscode.TreeDataProvider<ToolsTreeItem> {
88
constructor(private vscontext: vscode.ExtensionContext) {}
@@ -32,17 +32,13 @@ export class ToolsTreeItem extends ToolsItemBase {
3232
light: path.join(
3333
__filename,
3434
"..",
35-
"..",
36-
"..",
3735
"resources",
3836
"toolIcons",
3937
this.toolShortName === "drb" ? "drb.png" : this.toolShortName === "prt" ? "prt.png" : this.toolShortName === "cmt" ? "cmt.png" : this.toolShortName === "pd" ? "pd.png" : "generic.svg",
4038
),
4139
dark: path.join(
4240
__filename,
4341
"..",
44-
"..",
45-
"..",
4642
"resources",
4743
"toolIcons",
4844
this.toolShortName === "drb" ? "drb.png" : this.toolShortName === "prt" ? "prt.png" : this.toolShortName === "cmt" ? "cmt.png" : this.toolShortName === "pd" ? "pd.png" : "generic.svg",

src/tools/toolsItemBase.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as vscode from "vscode";
21
import * as path from "path";
2+
import * as vscode from "vscode";
33

44
export class ToolsItemBase extends vscode.TreeItem {
55
constructor(public readonly toolName: string, public readonly authorName: string | undefined, public readonly collapsibleState: vscode.TreeItemCollapsibleState) {
@@ -10,8 +10,8 @@ export class ToolsItemBase extends vscode.TreeItem {
1010
}
1111

1212
iconPath = {
13-
light: path.join(__filename, "..", "..", "..", "resources", "light", "generic.svg"),
14-
dark: path.join(__filename, "..", "..", "..", "resources", "dark", "generic.svg"),
13+
light: path.join(__filename, "..", "resources", "light", "generic.svg"),
14+
dark: path.join(__filename, "..", "resources", "dark", "generic.svg"),
1515
};
1616

1717
//contextValue = this.level === 2 ? "connection" : "connection-child";

src/trees/dataverseConnectionDataProvider.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import * as vscode from "vscode";
1+
import { observable } from "mobx";
22
import * as path from "path";
3-
import { State } from "../utils/State";
3+
import * as vscode from "vscode";
44
import { connectionCurrentStoreKey, connectionStoreKey, environmentTypes, extensionPrefix } from "../utils/Constants";
5-
import { IConnection, IStore } from "../utils/Interfaces";
6-
import { observable } from "mobx";
75
import { groupBy } from "../utils/ExtensionMethods";
6+
import { IConnection, IStore } from "../utils/Interfaces";
7+
import { State } from "../utils/State";
88
import { TreeItemBase } from "./treeItemBase";
99

1010
export class DataverseConnectionDataProvider implements vscode.TreeDataProvider<DataverseConnectionTreeItem> {
@@ -119,8 +119,6 @@ export class DataverseConnectionTreeItem extends TreeItemBase {
119119
light: path.join(
120120
__filename,
121121
"..",
122-
"..",
123-
"..",
124122
"resources",
125123
"light",
126124
this.level === 1
@@ -136,8 +134,6 @@ export class DataverseConnectionTreeItem extends TreeItemBase {
136134
dark: path.join(
137135
__filename,
138136
"..",
139-
"..",
140-
"..",
141137
"resources",
142138
"dark",
143139
this.level === 1

0 commit comments

Comments
 (0)