Skip to content

Commit c84f9bd

Browse files
akosyakovmustard-mh
authored andcommitted
gitpod server initial commit
Tool: gitpod/catfood.gitpod.cloud
1 parent ddc367e commit c84f9bd

File tree

76 files changed

+11296
-4279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+11296
-4279
lines changed

.gitpod.Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM gitpod/workspace-full:latest
2+
3+
USER gitpod
4+
5+
# We use latest major version of Node.js distributed VS Code. (see about dialog in your local VS Code)
6+
RUN bash -c ". .nvm/nvm.sh \
7+
&& nvm install 20 \
8+
&& nvm use 20 \
9+
&& nvm alias default 20"
10+
11+
RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix
12+
13+
# Install dependencies
14+
RUN sudo apt-get update \
15+
&& sudo apt-get install -y --no-install-recommends \
16+
xvfb x11vnc fluxbox dbus-x11 x11-utils x11-xserver-utils xdg-utils \
17+
fbautostart xterm eterm gnome-terminal gnome-keyring seahorse nautilus \
18+
libx11-dev libxkbfile-dev libsecret-1-dev libnotify4 libnss3 libxss1 \
19+
libasound2 libgbm1 xfonts-base xfonts-terminus fonts-noto fonts-wqy-microhei \
20+
fonts-droid-fallback vim-tiny nano libgconf2-dev libgtk-3-dev twm \
21+
&& sudo apt-get clean && sudo rm -rf /var/cache/apt/* && sudo rm -rf /var/lib/apt/lists/* && sudo rm -rf /tmp/*
22+
23+
# Disable v8 cache used by yarn v1.x, refs https://github.com/nodejs/node/issues/51555
24+
ENV DISABLE_V8_COMPILE_CACHE=1

.gitpod.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
image:
2+
file: .gitpod.Dockerfile
3+
ports:
4+
- port: 8080
5+
onOpen: open-browser
6+
tasks:
7+
- init: |
8+
npm ci
9+
gp sync-done dependencies
10+
npm run server:init
11+
command: |
12+
gp sync-done init
13+
export NODE_ENV=development
14+
export VSCODE_DEV=1
15+
npm run watch
16+
name: watch app
17+
- command: |
18+
export NODE_ENV=development
19+
export VSCODE_DEV=1
20+
gp sync-await init
21+
./scripts/code-server.sh --without-connection-token
22+
name: run app
23+
openMode: split-right
24+
- name: Local Proxy
25+
command: |
26+
cd gitpod
27+
gp ports await 9888
28+
go run proxy.go
29+
- name: Build Prepare
30+
init: |
31+
gp sync-await dependencies
32+
npm run gulp compile-build
33+
npm run gulp extensions-ci \
34+
&& npm run gulp minify-vscode-reh \
35+
&& npm run gulp vscode-web-min-ci \
36+
&& npm run gulp vscode-reh-linux-x64-min-ci
37+
38+
vscode:
39+
extensions:
40+
- dbaeumer.vscode-eslint
41+
- svelte.svelte-vscode

.vscode/launch.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,15 @@
290290
"presentation": {
291291
"group": "0_vscode",
292292
"order": 2
293-
}
293+
},
294+
"env": {
295+
"VSCODE_DEV": "1",
296+
"NODE_ENV": "development"
297+
},
298+
"args": [
299+
"--host=127.0.0.1",
300+
"--without-connection-token"
301+
]
294302
},
295303
{
296304
"type": "node",

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"git.branchProtectionPrompt": "alwaysCommitToNewBranch",
101101
"git.branchRandomName.enable": true,
102102
"git.pullBeforeCheckout": true,
103-
"git.mergeEditor": true,
103+
"git.mergeEditor": false,
104104
"remote.extensionKind": {
105105
"msjsdiag.debugger-for-chrome": "workspace"
106106
},

BUILD.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
packages:
2+
- name: install
3+
type: generic
4+
srcs:
5+
- "**"
6+
config:
7+
commands:
8+
- ["yarn"]
9+
- name: init
10+
type: generic
11+
deps:
12+
- ":install"
13+
config:
14+
commands:
15+
- ["yarn", "--cwd", "./install/build", "compile"]
16+
- ["yarn", "--cwd", "./install", "compile"]
17+
- ["yarn", "--cwd", "./install", "download-builtin-extensions"]

build/.moduleignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,10 @@ zone.js/dist/**
185185
@xterm/xterm-addon-*/fixtures/**
186186
@xterm/xterm-addon-*/out/**
187187
@xterm/xterm-addon-*/out-test/**
188+
189+
# TODO: Remove this once gitpod-protocol package doesn't ship source code
190+
@gitpod/gitpod-protocol/src/**
191+
@gitpod/gitpod-protocol/data/**
192+
@gitpod/gitpod-protocol/node_modules/**
193+
@gitpod/gitpod-protocol/lib/*.d.ts
194+
@gitpod/gitpod-protocol/lib/*.d.ts.map

build/.webignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,19 @@ vscode-textmate/webpack.config.js
5757

5858
vsda/**
5959
!vsda/rust/web/**
60+
61+
@improbable-eng/**
62+
!@improbable-eng/grpc-web/dist/grpc-web-client.umd.js
63+
64+
@gitpod/**
65+
!@gitpod/local-app-api-grpcweb/lib/localapp.js
66+
!@gitpod/ide-metrics-api-grpcweb/lib/index.js
67+
68+
browser-headers/**
69+
google-protobuf/**
70+
71+
@zip.js/**
72+
[email protected]/zip.js/dist/zip-no-worker-deflate.min.js
73+
74+
@jeanp413/analytics-node-umd/**
75+
!@jeanp413/analytics-node-umd/dist/umd/index.js

build/buildfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ exports.code = [
5757
createModuleDescription('vs/code/electron-sandbox/processExplorer/processExplorer')
5858
];
5959

60-
exports.codeWeb = createModuleDescription('vs/code/browser/workbench/workbench');
60+
// exports.codeWeb = createModuleDescription('vs/code/browser/workbench/workbench');
61+
exports.codeWeb = createModuleDescription('vs/gitpod/browser/workbench/workbench');
6162

6263
exports.codeServer = [
6364
// 'vs/server/node/server.main' is not included here because it gets inlined via ./src/server-main.js

build/checksums/vscode-sysroot.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
68a17006021975ff271a1dd615f9db9eda7c25f2cc65e750c87980dc57a06c94 aarch64-linux-gnu-glibc-2.17.tar.gz
2-
0de422a81683cf9e8cf875dbd1e0c27545ac3c775b2d53015daf3ca2b31d3f15 aarch64-linux-gnu-glibc-2.28.tar.gz
3-
3ced48cb479f2cdba95aa649710fcb7778685551c745bbd76ac706c3c0ead9fb arm-rpi-linux-gnueabihf-glibc-2.17.tar.gz
4-
7aea163f7fad8cc50000c86b5108be880121d35e2f55d016ef8c96bbe54129eb arm-rpi-linux-gnueabihf-glibc-2.28.tar.gz
5-
5aae21115f1d284c3cdf32c83db15771b59bc80793f1423032abf5a823c0d658 x86_64-linux-gnu-glibc-2.17.tar.gz
6-
dbb927408393041664a020661f2641c9785741be3d29b050b9dac58980967784 x86_64-linux-gnu-glibc-2.28.tar.gz
1+
4aa30f61adde7839ca5616e23cb44625a16b4dd77e5ce38df214d8dfbf4d3596 aarch64-linux-gnu-glibc-2.17.tar.gz
2+
4a00f87f0d109f66698244cf2bca4c237ff5bb84be4953bd2e624df7d46a4ccb aarch64-linux-gnu-glibc-2.28.tar.gz
3+
76226b2a2be87c1d6cbd60371df30b2794d7c9595794786e1be34318be201948 arm-rpi-linux-gnueabihf-glibc-2.17.tar.gz
4+
3625f8b5e36a42615f904fa3c222dcf35e37d4a46c2ea52f81cad36af5d1c07a arm-rpi-linux-gnueabihf-glibc-2.28.tar.gz
5+
2ab8ad5a09270df7562ff79662f07c23d857ca19fa34dbe63999feabf4375bbb x86_64-linux-gnu-glibc-2.17.tar.gz
6+
e655175b6143145f5d5f7d84a894f405e0df597b811a507dced6ead03f773bcb x86_64-linux-gnu-glibc-2.28.tar.gz

build/gulpfile.reh.js

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,14 @@ const serverResources = [
9393

9494
const serverWithWebResourceIncludes = [
9595
...serverResourceIncludes,
96-
'out-build/vs/code/browser/workbench/*.html',
96+
// 'out-build/vs/code/browser/workbench/*.html',
97+
'out-build/vs/gitpod/browser/workbench/*.html',
9798
...vscodeWebResourceIncludes
9899
];
99100

100101
const serverWithWebResourceExcludes = [
101102
...serverResourceExcludes,
103+
'!out-build/vs/gitpod/**/*-dev.html',
102104
'!out-build/vs/code/**/*-dev.html'
103105
];
104106

@@ -448,7 +450,12 @@ function tweakProductForServerWeb(product) {
448450
...bootstrapEntryPoints
449451
],
450452
resources: type === 'reh' ? serverResources : serverWithWebResources,
451-
fileContentMapper: createVSCodeWebFileContentMapper('.build/extensions', type === 'reh-web' ? tweakProductForServerWeb(product) : product)
453+
fileContentMapper: createVSCodeWebFileContentMapper('.build/extensions', type === 'reh-web' ? tweakProductForServerWeb(product) : product),
454+
header: [
455+
'/*!-----------------------------------------',
456+
' * Copyright (c) Gitpod. All rights reserved.',
457+
' *-----------------------------------------*/'
458+
].join('\n')
452459
}
453460
}
454461
)
@@ -470,11 +477,58 @@ function tweakProductForServerWeb(product) {
470477
const sourceFolderName = `out-vscode-${type}${dashed(minified)}`;
471478
const destinationFolderName = `vscode-${type}${dashed(platform)}${dashed(arch)}`;
472479

480+
/**
481+
* This dummy extension is a mock the for built-in extension called `github-authentication`.
482+
* In Gitpod we don't use the built-in extension (it's implemented inside gitpod-web extension)
483+
* but if this one is missing, it breaks the GitHub Authentication for extensions that depend
484+
* explicitly on `github-authentication` like `github.vscode-pull-request-github`
485+
*/
486+
const createDummyGitHubAuthExtensionTask = task.define('createDummyGitHubAuthExtensionTask', (done) => {
487+
const dir = path.join(BUILD_ROOT, destinationFolderName, 'extensions', 'github-authentication');
488+
489+
if (!fs.existsSync(dir)) {
490+
fs.mkdirSync(dir, { recursive: true });
491+
}
492+
493+
const packageJsonContent = {
494+
name: 'github-authentication',
495+
displayName: 'GitHub Authentication',
496+
description: 'Gitpod Override', // TODO: change
497+
publisher: 'vscode',
498+
license: 'MIT',
499+
version: '0.0.2',
500+
engines: {
501+
vscode: '^1.41.0',
502+
},
503+
categories: ['Other'],
504+
api: 'none',
505+
extensionKind: ['ui', 'workspace'],
506+
activationEvents: [
507+
'onAuthenticationRequest:github',
508+
],
509+
capabilities: {
510+
virtualWorkspaces: true,
511+
untrustedWorkspaces: {
512+
supported: true,
513+
},
514+
},
515+
main: './extension.js',
516+
};
517+
518+
const extensionJsContent = `module.exports = function activate() {}`;
519+
520+
fs.writeFileSync(path.join(dir, 'package.json'), JSON.stringify(packageJsonContent, null, 2));
521+
fs.writeFileSync(path.join(dir, 'extension.js'), extensionJsContent);
522+
523+
done();
524+
});
525+
473526
const serverTaskCI = task.define(`vscode-${type}${dashed(platform)}${dashed(arch)}${dashed(minified)}-ci`, task.series(
474527
compileNativeExtensionsBuildTask,
475528
gulp.task(`node-${platform}-${arch}`),
476529
util.rimraf(path.join(BUILD_ROOT, destinationFolderName)),
477-
packageTask(type, platform, arch, sourceFolderName, destinationFolderName)
530+
packageTask(type, platform, arch, sourceFolderName, destinationFolderName),
531+
createDummyGitHubAuthExtensionTask
478532
));
479533
gulp.task(serverTaskCI);
480534

build/gulpfile.vscode.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ const vscodeResources = [
110110

111111
// Excludes
112112
'!out-build/vs/code/browser/**',
113+
'!out-build/vs/gitpod/browser/**',
113114
'!out-build/vs/editor/standalone/**',
114115
'!out-build/vs/code/**/*-dev.html',
116+
'!out-build/vs/gitpod/**/*-dev.html',
115117
'!out-build/vs/workbench/contrib/issue/**/*-dev.html',
116118
'!**/test/**'
117119
];

0 commit comments

Comments
 (0)