Skip to content

Commit 0bfd53b

Browse files
updates
1 parent 9efd2c6 commit 0bfd53b

3 files changed

Lines changed: 53 additions & 5 deletions

File tree

branding.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"faviconSvg": "branding/favicon.svg",
77
"faviconIco": "branding/favicon.ico",
88
"pwaIcon192": "branding/pwa-icon-192.png",
9-
"pwaIcon512": "branding/pwa-icon-512.png"
9+
"pwaIcon512": "branding/pwa-icon-512.png",
10+
"tileImage": "branding/qbraid-tile.png"
1011
}

ci/dev/apply-branding.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ const replacements = [
5757
const assetReplacements = [
5858
{ from: branding.faviconIco, to: "src/browser/media/favicon.ico" },
5959
{ from: branding.faviconSvg, to: "src/browser/media/favicon.svg" },
60+
{ from: branding.faviconSvg, to: "src/browser/media/favicon-dark-support.svg" },
6061
{ from: branding.logoSvg, to: "src/browser/media/logo.svg" },
6162
{ from: branding.pwaIcon192, to: "src/browser/media/pwa-icon-192.png" },
6263
{ from: branding.pwaIcon512, to: "src/browser/media/pwa-icon-512.png" },
64+
{ from: branding.tileImage, to: "src/browser/media/qbraid-tile.png" },
6365
]
6466

6567
// Directories that might contain prebuilt release artifacts we need to patch in-place.
@@ -81,9 +83,11 @@ function applyBrandingToReleaseArtifacts() {
8183
const relAssetTargets = [
8284
{ from: branding.faviconIco, to: "src/browser/media/favicon.ico" },
8385
{ from: branding.faviconSvg, to: "src/browser/media/favicon.svg" },
86+
{ from: branding.faviconSvg, to: "src/browser/media/favicon-dark-support.svg" },
8487
{ from: branding.logoSvg, to: "src/browser/media/logo.svg" },
8588
{ from: branding.pwaIcon192, to: "src/browser/media/pwa-icon-192.png" },
8689
{ from: branding.pwaIcon512, to: "src/browser/media/pwa-icon-512.png" },
90+
{ from: branding.tileImage, to: "src/browser/media/qbraid-tile.png" },
8791
]
8892

8993
for (const asset of relAssetTargets) {
@@ -106,6 +110,49 @@ function applyBrandingToReleaseArtifacts() {
106110
json.documentationUrl = `https://${branding.companyDomain}`
107111
json.vendor = branding.companyName
108112
})
113+
114+
// Patch compiled login.js to change default app-name.
115+
const loginJsPath = path.join(dir, "out", "node", "routes", "login.js")
116+
if (fs.existsSync(loginJsPath)) {
117+
let js = fs.readFileSync(loginJsPath, "utf8")
118+
js = js.replace(/\|\|\s*["']code-server["']/, `|| "${branding.productName}"`)
119+
fs.writeFileSync(loginJsPath, js)
120+
}
121+
122+
// Remove or replace Coder promotional link.
123+
const vscodeWebPath = path.join(dir, "lib", "vscode")
124+
if (fs.existsSync(vscodeWebPath)) {
125+
const grepFiles = (dirPath) => {
126+
for (const entry of fs.readdirSync(dirPath, { withFileTypes: true })) {
127+
const full = path.join(dirPath, entry.name)
128+
if (entry.isDirectory()) grepFiles(full)
129+
else if (entry.isFile()) {
130+
let content = fs.readFileSync(full, "utf8")
131+
if (content.includes("code-server-to-coder")) {
132+
content = content.replace(
133+
/https?:\/\/[^"']*code-server-to-coder[^"']*/g,
134+
`https://${branding.companyDomain}`,
135+
)
136+
fs.writeFileSync(full, content)
137+
}
138+
}
139+
}
140+
}
141+
grepFiles(vscodeWebPath)
142+
}
143+
144+
// Patch Getting Started promotional tile.
145+
const gsJsPath = path.join(dir, "lib", "vscode", "out", "vs", "workbench", "contrib", "welcomeGettingStarted", "browser", "gettingStarted.js")
146+
if (fs.existsSync(gsJsPath)) {
147+
let gs = fs.readFileSync(gsJsPath, "utf8")
148+
gs = gs
149+
.replace(/https?:\\/\\/[^"']*code-server-to-coder[^"']*/g, "https://" + branding.companyDomain + "/home/introduction")
150+
.replace(/Deploy code-server for your team/g, "Learn more about qBraid")
151+
.replace(/Provision software development environments on your infrastructure with Coder\./g, "Discover the qBraid quantum development platform.")
152+
.replace(/Coder is a self-service portal[^"']*\./g, "qBraid provides managed quantum environments in the cloud.")
153+
.replace(/src: '\.\/_static\/src\/browser\/media\/templates.png'/g, "src: './_static/src/browser/media/qbraid-tile.png'")
154+
fs.writeFileSync(gsJsPath, gs)
155+
}
109156
}
110157
}
111158

patches/getting-started.diff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,21 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
5757
+ 'margin: 0px 0px 6px',
5858
+ 'font-weight: 500',
5959
+ ].join(';'),
60-
+ }, 'Deploy code-server for your team'),
60+
+ }, 'Learn more about qBraid'),
6161
+ $('p', {
6262
+ style: [
6363
+ 'margin: 0',
6464
+ 'font-size: 13px',
6565
+ 'color: #dcdee2',
6666
+ ].join(';'),
67-
+ }, 'Provision software development environments on your infrastructure with Coder.'),
67+
+ }, 'Explore cloud–hosted quantum IDEs and notebooks with qBraid.'),
6868
+ $('p', {
6969
+ style: [
7070
+ 'margin-top: 8px',
7171
+ 'font-size: 13px',
7272
+ 'color: #dcdee2',
7373
+ ].join(';'),
74-
+ }, 'Coder is a self-service portal which provisions via Terraform—Linux, macOS, Windows, x86, ARM, and, of course, Kubernetes based infrastructure.'),
74+
+ }, 'Spin up managed environments for popular quantum SDKs in seconds.'),
7575
+ $('p', {
7676
+ style: [
7777
+ 'margin: 0',
@@ -88,7 +88,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
8888
+ ].join(';'),
8989
+ })),
9090
+ $('img', {
91-
+ src: './_static/src/browser/media/templates.png',
91+
+ src: './_static/src/browser/media/qbraid-tile.png',
9292
+ style: [
9393
+ 'margin-bottom: -65px',
9494
+ ].join(';'),

0 commit comments

Comments
 (0)