@orbit-work/oem-dev-host 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/compiler.mjs +16 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orbit-work/oem-dev-host",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Live OEM bridge for full Desktop, isolated-profile sandbox, and Slot workbench modes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"src/server.mjs"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@orbit-work/oem-sdk": "0.1.
|
|
22
|
+
"@orbit-work/oem-sdk": "0.1.2",
|
|
23
23
|
"@orbit-work/ui": "0.1.2",
|
|
24
24
|
"@vitejs/plugin-react": "^4.3.4",
|
|
25
25
|
"react": "^19.0.0",
|
package/src/compiler.mjs
CHANGED
|
@@ -87,7 +87,14 @@ async function externalPlugin() {
|
|
|
87
87
|
|
|
88
88
|
function dataUrl(file, bytes) {
|
|
89
89
|
const extension = path.extname(file).toLowerCase()
|
|
90
|
-
const mime =
|
|
90
|
+
const mime =
|
|
91
|
+
extension === ".svg"
|
|
92
|
+
? "image/svg+xml"
|
|
93
|
+
: extension === ".webp"
|
|
94
|
+
? "image/webp"
|
|
95
|
+
: extension === ".jpg" || extension === ".jpeg"
|
|
96
|
+
? "image/jpeg"
|
|
97
|
+
: "image/png"
|
|
91
98
|
return `data:${mime};base64,${bytes.toString("base64")}`
|
|
92
99
|
}
|
|
93
100
|
|
|
@@ -142,6 +149,13 @@ export async function compileOemDevelopmentProject(projectRoot, { expectedIdenti
|
|
|
142
149
|
const trayFile = path.resolve(root, audit.manifest.assets.tray)
|
|
143
150
|
tray = dataUrl(trayFile, await readFile(trayFile))
|
|
144
151
|
}
|
|
152
|
+
// The login KV is mutable design data (not immutable identity), so it is
|
|
153
|
+
// refreshed with every reload like the logo rather than pinned at build time.
|
|
154
|
+
let loginBackground = null
|
|
155
|
+
if (audit.manifest.assets.loginBackground) {
|
|
156
|
+
const loginBackgroundFile = path.resolve(root, audit.manifest.assets.loginBackground)
|
|
157
|
+
loginBackground = dataUrl(loginBackgroundFile, await readFile(loginBackgroundFile))
|
|
158
|
+
}
|
|
145
159
|
let javascript = ""
|
|
146
160
|
let css = ""
|
|
147
161
|
if (audit.manifest.entry) {
|
|
@@ -174,7 +188,7 @@ export async function compileOemDevelopmentProject(projectRoot, { expectedIdenti
|
|
|
174
188
|
}
|
|
175
189
|
return {
|
|
176
190
|
identity,
|
|
177
|
-
snapshot: { manifest: audit.manifest, locales, logo, appIcon, tray, development },
|
|
191
|
+
snapshot: { manifest: audit.manifest, locales, logo, appIcon, tray, loginBackground, development },
|
|
178
192
|
javascript,
|
|
179
193
|
css,
|
|
180
194
|
}
|