fix(api): psysonic/undefined client id on Windows release builds (#1290)

This commit is contained in:
cucadmuh
2026-07-15 11:15:05 +03:00
committed by GitHub
parent 6d9018e6b6
commit 1b73e929f0
5 changed files with 32 additions and 2 deletions
+11
View File
@@ -27,6 +27,12 @@ const LUCIDE_SIGNALS = [
'("download"',
];
/** Subsonic client id must be a compile-time literal, not a cyclic package.json import. */
const CLIENT_ID_SIGNALS = [
'psysonic/undefined',
'psysonic/${',
];
let files;
try {
files = readdirSync(DIST).filter(f => f.endsWith('.js'));
@@ -45,6 +51,11 @@ for (const file of files) {
violations.push({ file, signal });
}
}
for (const signal of CLIENT_ID_SIGNALS) {
if (text.includes(signal)) {
violations.push({ file, signal: `client-id: ${signal}` });
}
}
}
if (violations.length > 0) {
+12
View File
@@ -43,3 +43,15 @@ export const CHANGELOG_RAW: string = ${JSON.stringify(changelogRaw)};
writeFileSync(join(outDir, 'releaseNotesBundle.ts'), ts, 'utf8');
console.log(`wrote src/generated/releaseNotesBundle.ts (sliced for ${version})`);
// Leaf module for boot-critical client id — must not import package.json at runtime
// in the authStore chunk (circular init → psysonic/undefined on Windows WebView2).
const appVersionTs = `/** @generated — run: node scripts/generate-release-notes-bundle.mjs */
export const APP_VERSION = ${JSON.stringify(version)};
/** Subsonic REST \`c\` param and OpenSubsonic client id (\`psysonic/<version>\`). */
export const SUBSONIC_CLIENT_ID = ${JSON.stringify(`psysonic/${version}`)};
`;
writeFileSync(join(outDir, 'appVersion.ts'), appVersionTs, 'utf8');
console.log(`wrote src/generated/appVersion.ts (${version})`);