Skip to content

Commit 3fd47b6

Browse files
authored
Replace webpack with esbuild (#48)
1 parent b3abe2d commit 3fd47b6

11 files changed

Lines changed: 360 additions & 458 deletions

File tree

.github/workflows/nightly-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- run: yarn install
1919
- run: yarn run build
2020

21-
- run: yarn run vscode:package
21+
- run: yarn run package
2222
working-directory: packages/databricks-vscode
2323

2424
- name: Update nightly release

.github/workflows/push.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ jobs:
9191
- name: Building packages
9292
run: yarn run build
9393

94-
- run: yarn run test:compile
95-
working-directory: packages/databricks-vscode
96-
9794
- name: Unit Tests with Coverage (OSX)
9895
uses: GabrielBB/xvfb-action@v1
9996
if: matrix.os != 'windows-latest'
@@ -143,7 +140,7 @@ jobs:
143140
- run: mkdir -p packages/databricks-vscode/artifacts
144141

145142
- name: Build VSIX
146-
run: yarn workspace databricks vscode:package -o artifacts
143+
run: yarn workspace databricks package -o artifacts
147144

148145
- name: Upload artifacts
149146
uses: actions/upload-artifact@v3

.vscode/launch.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"--extensionDevelopmentPath=${workspaceFolder}/packages/databricks-vscode"
1515
],
1616
"outFiles": [
17-
"${workspaceFolder}/packages/databricks-vscode/dist/**/*.js"
17+
"${workspaceFolder}/packages/databricks-vscode/out/**/*.js"
1818
],
1919
"preLaunchTask": "${defaultBuildTask}"
2020
},
@@ -28,8 +28,7 @@
2828
"--extensionTestsPath=${workspaceFolder}/packages/databricks-vscode/out/test/suite"
2929
],
3030
"outFiles": [
31-
"${workspaceFolder}/packages/databricks-vscode/out/**/*.js",
32-
"${workspaceFolder}/packages/databricks-vscode/dist/**/*.js"
31+
"${workspaceFolder}/packages/databricks-vscode/out/**/*.js"
3332
],
3433
"preLaunchTask": "${defaultBuildTask}"
3534
}

.vscode/tasks.json

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"cwd": "${workspaceFolder}/packages/databricks-vscode"
1010
},
1111
"script": "watch",
12-
"problemMatcher": ["$ts-webpack-watch", "$tslint-webpack-watch"],
12+
"problemMatcher": "$tsc-watch",
1313
"isBackground": true,
1414
"presentation": {
1515
"reveal": "never",
@@ -19,25 +19,6 @@
1919
"kind": "build",
2020
"isDefault": true
2121
}
22-
},
23-
{
24-
"type": "npm",
25-
"options": {
26-
"cwd": "${workspaceFolder}/packages/databricks-vscode"
27-
},
28-
"script": "watch-tests",
29-
"problemMatcher": "$tsc-watch",
30-
"isBackground": true,
31-
"presentation": {
32-
"reveal": "never",
33-
"group": "watchers"
34-
},
35-
"group": "build"
36-
},
37-
{
38-
"label": "tasks: watch-tests",
39-
"dependsOn": ["npm: watch", "npm: watch-tests"],
40-
"problemMatcher": []
4122
}
4223
]
4324
}

packages/databricks-vscode/.vscodeignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
.vscode/**
22
.vscode-test/**
3-
out/**
3+
dist/**
44
node_modules/**
55
src/**
66
.gitignore
77
.yarnrc
8-
webpack.config.js
9-
vsc-extension-quickstart.md
108
**/tsconfig.json
119
**/.eslintrc.json
1210
**/*.map

packages/databricks-vscode/package.json

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"onView:clusterManager",
5252
"onView:clusterList"
5353
],
54-
"main": "./dist/extension.js",
54+
"main": "out/extension.js",
5555
"contributes": {
5656
"commands": [
5757
{
@@ -206,23 +206,22 @@
206206
"useYarn": false
207207
},
208208
"scripts": {
209-
"vscode:prepublish": "yarn run package",
210-
"vscode:package": "vsce package",
211-
"compile": "webpack",
212-
"watch": "webpack --watch",
213-
"package": "webpack --mode production --devtool hidden-source-map",
209+
"vscode:prepublish": "rm -rf out && yarn run package:compile && yarn run package:copy-webview-toolkit",
210+
"package": "vsce package",
211+
"package:compile": "yarn run esbuild:base --minify",
212+
"package:copy-webview-toolkit": "cp ./node_modules/@vscode/webview-ui-toolkit/dist/toolkit.js ./out/toolkit.js",
213+
"esbuild:base": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node",
214+
"compile": "tsc",
215+
"watch": "yarn run package:copy-webview-toolkit && tsc -w",
214216
"fix": "prettier . --write",
215217
"test:lint": "eslint src --ext ts && prettier . -c",
216-
"test:compile": "tsc -p . --outDir out",
217-
"test:watch": "tsc -p . -w --outDir out",
218-
"test:unit": "yarn run test:compile && node ./out/test/runTest.js",
219-
"test:integ:prepare": "yarn run vscode:package && extest get-vscode --type ${VSCODE_TEST_VERSION:-stable} --storage /tmp/vscode-test-databricks && extest get-chromedriver --storage /tmp/vscode-test-databricks && extest install-vsix -f databricks-0.0.1.vsix --storage /tmp/vscode-test-databricks",
220-
"test:integ:run": "yarn run test:compile && ts-node src/test/e2e/scripts/e2e.ts --storage /tmp/vscode-test-databricks --code_settings src/test/e2e/settings.json 'out/**/*.e2e.js'",
218+
"test:unit": "yarn run compile && node ./out/test/runTest.js",
219+
"test:integ:prepare": "yarn run package && extest get-vscode --type ${VSCODE_TEST_VERSION:-stable} --storage /tmp/vscode-test-databricks && extest get-chromedriver --storage /tmp/vscode-test-databricks && extest install-vsix -f databricks-0.0.1.vsix --storage /tmp/vscode-test-databricks",
220+
"test:integ:run": "yarn run compile && node out/test/e2e/scripts/e2e.js --storage /tmp/vscode-test-databricks --code_settings src/test/e2e/settings.json 'out/**/*.e2e.js'",
221221
"test:integ": "yarn run test:integ:prepare && yarn run test:integ:run",
222222
"test:cov": "nyc yarn run test:unit",
223-
"test": "yarn run compile && yarn run test:lint && yarn run test:unit",
224-
"build": "yarn run vscode:prepublish",
225-
"clean": "rm -rf node_modules out dist .vscode-test"
223+
"test": "yarn run test:lint && yarn run test:unit",
224+
"clean": "rm -rf node_modules out .vscode-test"
226225
},
227226
"dependencies": {
228227
"@databricks/databricks-sdk": "*",
@@ -237,20 +236,17 @@
237236
"@types/vscode": "^1.69.0",
238237
"@typescript-eslint/eslint-plugin": "^5.30.7",
239238
"@vscode/test-electron": "^2.1.5",
239+
"esbuild": "^0.14.51",
240240
"eslint": "^8.20.0",
241241
"glob": "^8.0.3",
242242
"mocha": "^10.0.0",
243243
"nyc": "^15.1.0",
244244
"prettier": "^2.7.1",
245245
"tmp-promise": "^3.0.3",
246-
"ts-loader": "^9.3.1",
247246
"ts-mockito": "^2.6.1",
248-
"ts-node": "^10.9.1",
249247
"typescript": "^4.7.4",
250248
"vsce": "^2.10.0",
251-
"vscode-extension-tester": "^4.3.0",
252-
"webpack": "^5.73.0",
253-
"webpack-cli": "^4.10.0"
249+
"vscode-extension-tester": "^4.3.0"
254250
},
255251
"nyc": {
256252
"extends": "@istanbuljs/nyc-config-typescript",
@@ -270,4 +266,4 @@
270266
],
271267
"report-dir": "coverage"
272268
}
273-
}
269+
}

packages/databricks-vscode/src/workflow/WorkflowOutputPanel.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ export class WorkflowOutputPanel {
9999

100100
private getWebviewContent(message: string): string {
101101
const toolkitUri = this.getUri([
102-
"node_modules",
103-
"@vscode",
104-
"webview-ui-toolkit",
105-
"dist",
102+
"out",
106103
"toolkit.js", // A toolkit.min.js file is also available
107104
]);
108105

packages/databricks-vscode/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"compilerOptions": {
33
"module": "CommonJS",
4-
"target": "ES6",
5-
"moduleResolution": "Node",
4+
"target": "ES2020",
5+
"outDir": "out",
66
"esModuleInterop": true,
77
"isolatedModules": true,
88
"lib": ["ES2020"],

packages/databricks-vscode/vsc-extension-quickstart.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

packages/databricks-vscode/webpack.config.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)