Skip to content

Commit b2efe91

Browse files
committed
Include source maps
I also moved this to its own patch because it feels sufficiently standalone. Fixes coder#5026.
1 parent 6e40024 commit b2efe91

File tree

3 files changed

+44
-14
lines changed

3 files changed

+44
-14
lines changed

patches/integration.diff

-14
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Prepare Code for integration with code-server
77
3. Add the code-server version to the help dialog.
88
4. Add ready events for use in an iframe.
99
5. Add our icons.
10-
6. Remove sourcemap host since we cannot upload ours there.
1110

1211
Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
1312
===================================================================
@@ -254,16 +253,3 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
254253
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
255254
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="./static/out/vs/workbench/workbench.web.main.css">
256255

257-
Index: code-server/lib/vscode/build/gulpfile.reh.js
258-
===================================================================
259-
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
260-
+++ code-server/lib/vscode/build/gulpfile.reh.js
261-
@@ -365,7 +365,7 @@ function packageTask(type, platform, arc
262-
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
263-
optimizeTask,
264-
util.rimraf(`out-vscode-${type}-min`),
265-
- common.minifyTask(`out-vscode-${type}`, `https://ticino.blob.core.windows.net/sourcemaps/${commit}/core`)
266-
+ common.minifyTask(`out-vscode-${type}`, ``)
267-
));
268-
gulp.task(minifyTask);
269-

patches/series

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ local-storage.diff
1818
service-worker.diff
1919
last-opened.diff
2020
connection-type.diff
21+
sourcemaps.diff

patches/sourcemaps.diff

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Make sourcemaps self-hosted
2+
3+
Normally source maps get removed as part of the build process so prevent that
4+
from happening. Also avoid using the windows.net host since obviously we can
5+
not host our source maps there and want them to be self-hosted even if we could.
6+
7+
To test try debugging/browsing the source of a build in a browser.
8+
9+
Index: code-server/lib/vscode/build/gulpfile.reh.js
10+
===================================================================
11+
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
12+
+++ code-server/lib/vscode/build/gulpfile.reh.js
13+
@@ -195,8 +195,7 @@ function packageTask(type, platform, arc
14+
15+
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
16+
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
17+
- .pipe(util.setExecutableBit(['**/*.sh']))
18+
- .pipe(filter(['**', '!**/*.js.map']));
19+
+ .pipe(util.setExecutableBit(['**/*.sh']));
20+
21+
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
22+
const isUIExtension = (manifest) => {
23+
@@ -235,9 +234,9 @@ function packageTask(type, platform, arc
24+
.map(name => `.build/extensions/${name}/**`);
25+
26+
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
27+
- const extensionsCommonDependencies = gulp.src('.build/extensions/node_modules/**', { base: '.build', dot: true });
28+
- const sources = es.merge(src, extensions, extensionsCommonDependencies)
29+
+ const extensionsCommonDependencies = gulp.src('.build/extensions/node_modules/**', { base: '.build', dot: true })
30+
.pipe(filter(['**', '!**/*.js.map'], { dot: true }));
31+
+ const sources = es.merge(src, extensions, extensionsCommonDependencies);
32+
33+
let version = packageJson.version;
34+
const quality = product.quality;
35+
@@ -363,7 +362,7 @@ function packageTask(type, platform, arc
36+
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
37+
optimizeTask,
38+
util.rimraf(`out-vscode-${type}-min`),
39+
- common.minifyTask(`out-vscode-${type}`, `https://ticino.blob.core.windows.net/sourcemaps/${commit}/core`)
40+
+ common.minifyTask(`out-vscode-${type}`, '')
41+
));
42+
gulp.task(minifyTask);
43+

0 commit comments

Comments
 (0)