feat(companion): add generated macos ios android reference app surfaces
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { resolve } from 'node:path';
|
||||
import { generateReferenceCompanionApps } from '../src/companion/index.js';
|
||||
|
||||
function getArg(name: string): string | undefined {
|
||||
const idx = process.argv.indexOf(name);
|
||||
if (idx < 0) {
|
||||
return undefined;
|
||||
}
|
||||
const value = process.argv[idx + 1];
|
||||
if (!value || value.startsWith('--')) {
|
||||
return undefined;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
async function main(): Promise<void> {
|
||||
const outputDir = resolve(getArg('--output') ?? 'apps/companion');
|
||||
const gatewayUrl = getArg('--url') ?? 'ws://127.0.0.1:18800';
|
||||
|
||||
const result = await generateReferenceCompanionApps({
|
||||
outputDir,
|
||||
gatewayUrl,
|
||||
});
|
||||
|
||||
console.log(`Generated companion reference apps in ${result.rootDir}`);
|
||||
for (const entry of result.generated) {
|
||||
console.log(`- ${entry.platform}: ${entry.outputDir}`);
|
||||
}
|
||||
console.log(`- readme: ${result.readmePath}`);
|
||||
}
|
||||
|
||||
main().catch((error: unknown) => {
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
console.error(`companion:reference-apps failed: ${message}`);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
Reference in New Issue
Block a user