Skip to content

Commit 2ac83b2

Browse files
committed
💄
1 parent 3de0f03 commit 2ac83b2

File tree

20 files changed

+57
-80
lines changed

20 files changed

+57
-80
lines changed

extensions/gitpod-remote/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@
301301
"@rollup/plugin-json": "^4.1.0",
302302
"@rollup/plugin-node-resolve": "^11.0.0",
303303
"@rollup/plugin-typescript": "^8.0.0",
304+
"@rollup/plugin-alias": "^3.1.9",
304305
"svelte-preprocess": "^4.0.0",
305306
"sirv-cli": "^2.0.0"
306307
},

extensions/gitpod-remote/package.nls.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
"makePrivate": "Make Private",
2222
"makePublic": "Make Public",
2323
"copyWebLink": "Copy web link",
24+
"tunnelNetwork": "Tunnel on all interfaces",
25+
"tunnelHost": "Tunnel on localhost",
26+
"retryAutoExpose": "Retry to expose",
2427
"openWebLinkInBrowser": "Open web link in Browser",
2528
"showReleaseNotes": "Gitpod: Show Release Notes"
2629
}

extensions/gitpod-remote/rollup.config.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ import livereload from 'rollup-plugin-livereload';
55
import { terser } from 'rollup-plugin-terser';
66
import sveltePreprocess from 'svelte-preprocess';
77
import typescript from '@rollup/plugin-typescript';
8+
import alias from '@rollup/plugin-alias';
89
import css from 'rollup-plugin-css-only';
910
import path from 'path';
1011
import copy from 'rollup-plugin-copy';
1112
import json from '@rollup/plugin-json';
1213

13-
// copy before packet
14-
import './rollup.copy';
15-
1614
const production = !process.env.ROLLUP_WATCH;
1715

1816
function serve() {
@@ -41,12 +39,16 @@ export default {
4139
output: [
4240
{
4341
sourcemap: true,
44-
format: 'iife',
45-
name: 'app',
42+
format: 'es',
4643
file: path.join(__dirname, './public/portsview.js'),
4744
},
4845
],
4946
plugins: [
47+
alias({
48+
entries: [
49+
{ find: 'package.nls.json', replacement: path.join(__dirname, 'package.nls.json') },
50+
]
51+
}),
5052
svelte({
5153
preprocess: sveltePreprocess({
5254
typescript: {
@@ -61,11 +63,11 @@ export default {
6163
}),
6264
copy({
6365
targets: [
64-
{ src: 'node_modules/@vscode/codicons/dist/codicon.ttf', dest: 'public' },
65-
// { src: '../package.nls.json', dest: 'public' },
66+
{ src: 'node_modules/@vscode/codicons/dist/codicon.css', dest: 'public' },
67+
{ src: 'node_modules/@vscode/codicons/dist/codicon.ttf', dest: 'public' }
6668
],
6769
}),
68-
json(),
70+
json({ compact: true }),
6971
// we'll extract any component CSS out into
7072
// a separate file - better for performance
7173
css({ output: 'portsview.css' }),
@@ -88,7 +90,7 @@ export default {
8890

8991
// In dev mode, call `npm run start` once
9092
// the bundle has been generated
91-
!production && serve(),
93+
// !production && serve(),
9294

9395
// Watch the `public` directory and refresh the
9496
// browser on changes when not in production

extensions/gitpod-remote/rollup.copy.js

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

extensions/gitpod-remote/src/portViewProvider.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ export class GitpodPortViewProvider implements vscode.WebviewViewProvider {
4343
}
4444

4545
private _getHtmlForWebview(webview: vscode.Webview) {
46-
const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'public', 'portsview.js'));
46+
const codiconsUri = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'public', 'codicon.css'));
4747
const styleUri = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'public', 'portsview.css'));
48+
const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'public', 'portsview.js'));
4849
const nonce = getNonce();
4950
return `<!DOCTYPE html>
5051
<html lang="en">
@@ -53,7 +54,8 @@ export class GitpodPortViewProvider implements vscode.WebviewViewProvider {
5354
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
5455
5556
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
56-
<link nonce="${nonce}" href="${styleUri}" rel="stylesheet" />
57+
<link href="${codiconsUri}" rel="stylesheet" />
58+
<link href="${styleUri}" rel="stylesheet" />
5759
<title>Gitpod Port View</title>
5860
</head>
5961
<body></body>

extensions/gitpod-shared/package.json

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,19 @@
1010
"main": "./out/extension.js",
1111
"scripts": {
1212
"prepare": "node scripts/inflate.js",
13-
"check:webview": "svelte-check --tsconfig ./portsview/tsconfig.json",
14-
"build:webview": "rollup -c",
15-
"watch:webview": "rollup -c -w"
13+
"test": "mocha out/test/**/*.js"
1614
},
1715
"devDependencies": {
16+
"@types/mocha": "^9.1.1",
1817
"@types/js-yaml": "^4.0.5",
1918
"@types/node": "16.x",
2019
"@types/uuid": "^8.3.1",
2120
"@types/ws": "^7.2.6",
2221
"@tsconfig/svelte": "^2.0.0",
2322
"@types/vscode-webview": "^1.57.0",
23+
"mocha": "^10.0.0",
2424
"svelte": "^3.0.0",
2525
"svelte-check": "^2.0.0",
26-
"rollup": "^2.3.4",
27-
"rollup-plugin-copy": "^3.4.0",
28-
"rollup-plugin-css-only": "^3.1.0",
29-
"rollup-plugin-livereload": "^2.0.0",
30-
"rollup-plugin-svelte": "^7.0.0",
31-
"rollup-plugin-terser": "^7.0.0",
32-
"@rollup/plugin-commonjs": "^17.0.0",
33-
"@rollup/plugin-json": "^4.1.0",
34-
"@rollup/plugin-node-resolve": "^11.0.0",
35-
"@rollup/plugin-typescript": "^8.0.0",
3626
"svelte-preprocess": "^4.0.0"
3727
},
3828
"dependencies": {

extensions/gitpod-shared/portsview/src/App.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Copyright (c) Gitpod. All rights reserved.
33
------------------------------------------------------------------------------------------------>
44
<script lang="ts">
5-
import "@vscode/codicons/dist/codicons.css";
65
import { vscode } from "./utils/vscodeApi";
76
import PortTable from "./porttable/PortTable.svelte";
87
import type { GitpodPortObject } from "./protocol/gitpod";

extensions/gitpod-shared/portsview/src/main.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
import App from './App.svelte';
66

7-
const app = new App({
7+
new App({
88
target: document.body
99
});
10-
11-
export default app;

extensions/gitpod-shared/portsview/src/porttable/PortStatus.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Copyright (c) Gitpod. All rights reserved.
33
------------------------------------------------------------------------------------------------>
44
<script lang="ts">
5-
import "@vscode/codicons/dist/codicon.css";
65
import type { IconStatus } from "../protocol/gitpod";
76
87
export let status: IconStatus = "NotServed";
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
declare module 'package.nls.json' {
3+
export default ({} as { [key: string]: string; });
4+
}

extensions/gitpod-shared/portsview/src/utils/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) Gitpod. All rights reserved.
33
*--------------------------------------------------------------------------------------------*/
44

5-
// import nlsFile from '../../public/package.nls.json';
5+
import nlsFile from 'package.nls.json';
66
import type { GitpodPortObject, PortCommand } from '../protocol/gitpod';
77

88
// TODO: use vscode-nls
@@ -12,7 +12,7 @@ export function getNLSTitle(command: PortCommand) {
1212
case 'preview':
1313
name = 'openPreview';
1414
}
15-
return/* nlsFile[name] ?? */ command as string;
15+
return nlsFile[name] ?? command as string;
1616
}
1717

1818
export const commandIconMap: Record<PortCommand, string> = {

extensions/gitpod-web/src/test/port.test.ts renamed to extensions/gitpod-shared/src/test/port.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ExposedPortInfo, PortAutoExposure, PortsStatus, PortVisibility, TunneledPortInfo } from '@gitpod/supervisor-api-grpc/lib/status_pb';
2-
import { GitpodWorkspacePort, PortInfo, TunnelDescriptionI } from 'gitpod-shared';
2+
import { GitpodWorkspacePort, PortInfo, TunnelDescriptionI } from '../workspacePort';
33
import { TunnelVisiblity } from '@gitpod/supervisor-api-grpc/lib/port_pb';
44

55
import * as assert from 'assert';

extensions/gitpod-shared/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"composite": true,
77
"esModuleInterop": true,
88
"sourceMap": true,
9+
"declaration": true
910
},
1011
"include": [
1112
"./src/**/*"

extensions/gitpod-web/.vscodeignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
.gitignore
22
src/**
3-
!src/common/config.json
43
out/**
54
build/**
65
portsview/**
7-
!portsview/public/**
6+
!public/**
87
extension.webpack.config.js
98
extension-browser.webpack.config.js
109
tsconfig.json

extensions/gitpod-web/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,20 +533,16 @@
533533
},
534534
"scripts": {
535535
"vscode:prepublish": "yarn build; yarn run compile --cwd ..",
536-
"test": "mocha out/test/**/*.js",
537536
"build:webview": "rollup -c",
538537
"watch:webview": "rollup -c -w",
539538
"start:webview": "sirv public --no-clear"
540539
},
541540
"devDependencies": {
542-
"@types/mocha": "^9.1.1",
543541
"@types/node": "16.x",
544542
"@types/node-fetch": "^2.5.12",
545543
"@types/uuid": "8.0.0",
546544
"@types/yauzl": "^2.9.1",
547545
"@types/yazl": "^2.4.2",
548-
"mocha": "^10.0.0",
549-
"npm-run-all": "^4.1.5",
550546
"@tsconfig/svelte": "^2.0.0",
551547
"@types/vscode-webview": "^1.57.0",
552548
"svelte": "^3.0.0",
@@ -561,6 +557,7 @@
561557
"@rollup/plugin-json": "^4.1.0",
562558
"@rollup/plugin-node-resolve": "^11.0.0",
563559
"@rollup/plugin-typescript": "^8.0.0",
560+
"@rollup/plugin-alias": "^3.1.9",
564561
"svelte-preprocess": "^4.0.0",
565562
"sirv-cli": "^2.0.0"
566563
},

extensions/gitpod-web/rollup.config.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ import livereload from 'rollup-plugin-livereload';
55
import { terser } from 'rollup-plugin-terser';
66
import sveltePreprocess from 'svelte-preprocess';
77
import typescript from '@rollup/plugin-typescript';
8+
import alias from '@rollup/plugin-alias';
89
import css from 'rollup-plugin-css-only';
910
import path from 'path';
1011
import copy from 'rollup-plugin-copy';
1112
import json from '@rollup/plugin-json';
1213

13-
// copy before packet
14-
import './rollup.copy';
15-
1614
const production = !process.env.ROLLUP_WATCH;
1715

1816
function serve() {
@@ -41,12 +39,16 @@ export default {
4139
output: [
4240
{
4341
sourcemap: true,
44-
format: 'iife',
45-
name: 'app',
42+
format: 'es',
4643
file: path.join(__dirname, './public/portsview.js'),
4744
},
4845
],
4946
plugins: [
47+
alias({
48+
entries: [
49+
{ find: 'package.nls.json', replacement: path.join(__dirname, 'package.nls.json') },
50+
]
51+
}),
5052
svelte({
5153
preprocess: sveltePreprocess({
5254
typescript: {
@@ -61,11 +63,11 @@ export default {
6163
}),
6264
copy({
6365
targets: [
64-
{ src: 'node_modules/@vscode/codicons/dist/codicon.ttf', dest: 'public' },
65-
// { src: '../package.nls.json', dest: 'public' },
66+
{ src: 'node_modules/@vscode/codicons/dist/codicon.css', dest: 'public' },
67+
{ src: 'node_modules/@vscode/codicons/dist/codicon.ttf', dest: 'public' }
6668
],
6769
}),
68-
json(),
70+
json({ compact: true }),
6971
// we'll extract any component CSS out into
7072
// a separate file - better for performance
7173
css({ output: 'portsview.css' }),
@@ -88,7 +90,7 @@ export default {
8890

8991
// In dev mode, call `npm run start` once
9092
// the bundle has been generated
91-
!production && serve(),
93+
// !production && serve(),
9294

9395
// Watch the `public` directory and refresh the
9496
// browser on changes when not in production

extensions/gitpod-web/rollup.copy.js

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

extensions/gitpod-web/src/portViewProvider.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ export class GitpodPortViewProvider implements vscode.WebviewViewProvider {
4444
}
4545

4646
private _getHtmlForWebview(webview: vscode.Webview) {
47-
const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'public', 'portsview.js'));
47+
const codiconsUri = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'public', 'codicon.css'));
4848
const styleUri = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'public', 'portsview.css'));
49+
const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'public', 'portsview.js'));
4950
const nonce = getNonce();
5051
return `<!DOCTYPE html>
5152
<html lang="en">
@@ -54,7 +55,8 @@ export class GitpodPortViewProvider implements vscode.WebviewViewProvider {
5455
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
5556
5657
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
57-
<link nonce="${nonce}" href="${styleUri}" rel="stylesheet" />
58+
<link href="${codiconsUri}" rel="stylesheet" />
59+
<link href="${styleUri}" rel="stylesheet" />
5860
<title>Gitpod Port View</title>
5961
</head>
6062
<body></body>

extensions/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@
99
},
1010
"scripts": {
1111
"postinstall": "node ./postinstall.mjs",
12-
"compile": "yarn build:ts && yarn test:gitpod-web && yarn build:gitpod-web",
12+
"compile": "yarn build:ts && yarn build:gitpod-web",
1313
"watch": "npm-run-all -lp watch:ts watch:gitpod-web",
1414
"build:ts": "../node_modules/.bin/tsc -b",
1515
"watch:ts": "../node_modules/.bin/tsc -b -w",
1616
"build:gitpod-web": "yarn --cwd gitpod-web build:webview",
17-
"watch:gitpod-web": "yarn --cwd gitpod-web watch:webview",
18-
"test:gitpod-web": "yarn --cwd gitpod-web test"
17+
"watch:gitpod-web": "yarn --cwd gitpod-web watch:webview"
1918
},
2019
"devDependencies": {
2120
"@parcel/watcher": "2.0.5",

extensions/yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@
234234
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
235235
integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=
236236

237+
"@rollup/plugin-alias@^3.1.9":
238+
version "3.1.9"
239+
resolved "https://registry.yarnpkg.com/@rollup/plugin-alias/-/plugin-alias-3.1.9.tgz#a5d267548fe48441f34be8323fb64d1d4a1b3fdf"
240+
integrity sha512-QI5fsEvm9bDzt32k39wpOwZhVzRcL5ydcffUHMyLVaVaLeC70I8TJZ17F1z1eMoLu4E/UOcH9BWVkKpIKdrfiw==
241+
dependencies:
242+
slash "^3.0.0"
243+
237244
"@rollup/plugin-commonjs@^17.0.0":
238245
version "17.1.0"
239246
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-17.1.0.tgz#757ec88737dffa8aa913eb392fade2e45aef2a2d"

0 commit comments

Comments
 (0)