Our application uses a scoped name in its package.json along with a productName without special characters. We build for several targets, including deb.
I expected the deb file to have a control file that looks like:
Package: Opentrons # <-productName
...
electron-builder always uses name from package.json as the deb:
Package: @opentrons/app-shell # <- name
Debian package names must start with an alphanumeric character. As it stands, electron-builder by default builds invalid deb packages for projects with scoped names, because Package: @scope/name is illegal.
I'm not very familiar with this codebase, but this looks to me like it could be the offending line: https://github.com/electron-userland/electron-builder/blob/master/packages/electron-builder-lib/src/targets/fpm.ts#L125
I'm currently working around this by specifying --name=Opentrons in the deb.fpm config option, but that's sub-optimal because I have to manually keep that name and the packageName in sync (the file macros do not appear to work in the fpm option).
I think using packageName for fpm --name if it exists would be a very sane default. Otherwise, macro expansion in fpm options would also be an acceptable solution to me.
Updated link for the problematic line: https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/src/targets/fpm.ts#L125
Fixed, release will be in 2 days.
Most helpful comment
Fixed, release will be in 2 days.