A single-commit snapshot of better-remote (7a8c4cb plus the uncommitted remote.js work), with every DRM-bearing piece replaced by a stub that keeps the same interface: - src/ui/drm.js: no DRM pipelines; needsDrm/isDrmUrl false, bestEncryptedTranscoding null, playDrmAudio rejects. The engine switcher and drmVjs* helpers stay as no-ops. - src/electron/drm.ts: initCdm/setupLicenseCors no-ops; the drm:license and api:stream:drm-info IPC handlers reject with "DRM is not available". - src/api/soundcloud.ts: resolveEncryptedStream keeps its signature, rejects. - src/electron/main.ts: license host dropped from the header rewrite. - src/ui/pb-lease.js: the expiry self-check uses a placeholder URL instead of a captured DRM manifest URL (same policy values, still passes). - scripts/vmp-sign.js, forge.config.js vmpSign: Widevine signing skipped, so no castLabs EVS account is needed to run or package. - README: says DRM is stubbed here. Go+ tracks SoundCloud only serves encrypted are unplayable and skipped; previews and everything else play as before. No history: the private branches' DRM code is not reachable from this commit. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
39 lines
1.7 KiB
JavaScript
Executable File
39 lines
1.7 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
'use strict'
|
|
// Squirrel/NuGet require a strict SemVer MAJOR.MINOR.PATCH version. A 4th segment
|
|
// (e.g. 0.16.16.16) makes electron-forge's squirrel maker crash deep inside
|
|
// releasify ("not SemVer-compatible"). This runs before packaging and COERCES a
|
|
// non-SemVer package.json version to a valid 3-part one (the first three numbers),
|
|
// writing it back so the build never fails on version FORMAT again.
|
|
//
|
|
// NOTE: this only fixes the FORMAT. For an update to actually register, the
|
|
// version must still be GREATER than what's already published — so keep bumping
|
|
// the patch each release (0.16.17 -> 0.16.18 -> ...).
|
|
const fs = require('fs')
|
|
const path = require('path')
|
|
|
|
const pkgPath = path.join(__dirname, '..', 'package.json')
|
|
const raw = fs.readFileSync(pkgPath, 'utf8')
|
|
const v = (JSON.parse(raw).version || '').toString()
|
|
|
|
// Valid: exactly 3 numeric segments (plus optional -prerelease / +build).
|
|
if (/^\d+\.\d+\.\d+(?:[-+].*)?$/.test(v)) {
|
|
console.log(`[version] ${v} — SemVer OK`)
|
|
process.exit(0)
|
|
}
|
|
|
|
const nums = v.match(/\d+/g) || []
|
|
if (nums.length === 0) {
|
|
console.error(`[version] "${v}" has no numbers — set a version like 0.16.17 in package.json`)
|
|
process.exit(1)
|
|
}
|
|
|
|
const coerced = `${nums[0] || 0}.${nums[1] || 0}.${nums[2] || 0}`
|
|
// Targeted replace so the rest of package.json's formatting is untouched.
|
|
const out = raw.replace(/("version"\s*:\s*")[^"]*(")/, `$1${coerced}$2`)
|
|
fs.writeFileSync(pkgPath, out)
|
|
|
|
console.warn(`[version] "${v}" is NOT SemVer — coerced to "${coerced}" and updated package.json.`)
|
|
console.warn('[version] Squirrel requires MAJOR.MINOR.PATCH. If that\'s not newer than your')
|
|
console.warn('[version] published version, bump the patch so clients see the update.')
|