feat: publish Alta Local Camera Discovery

This commit is contained in:
2026-09-01 18:02:14 +00:00
commit 33f28a3d73
30 changed files with 4939 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
'use strict';
const test = require('node:test');
const assert = require('node:assert/strict');
const path = require('node:path');
const { resolveAppAssetPath } = require('../src/app-protocol');
const staticDir = path.join(__dirname, '..', 'static');
test('app protocol resolves only explicitly packaged renderer assets', () => {
assert.equal(resolveAppAssetPath('app://bundle/index.html', staticDir), path.join(staticDir, 'index.html'));
assert.equal(resolveAppAssetPath('app://bundle/styles.css?v=12', staticDir), path.join(staticDir, 'styles.css'));
assert.equal(resolveAppAssetPath('app://bundle/alta-mark.png', staticDir), path.join(staticDir, 'alta-mark.png'));
assert.equal(resolveAppAssetPath('app://other/index.html', staticDir), null);
assert.equal(resolveAppAssetPath('app://bundle/../main.js', staticDir), null);
assert.equal(resolveAppAssetPath('app://bundle/%2e%2e/main.js', staticDir), null);
assert.equal(resolveAppAssetPath('file:///etc/passwd', staticDir), null);
assert.equal(resolveAppAssetPath('app://bundle/not-packaged.js', staticDir), null);
});