bump version to 1.11.3 and refactor code for improved readability
Some checks are pending
CI / general (push) Waiting to run

This commit is contained in:
mr. M 2025-03-31 00:29:34 +02:00
parent 47924ece7b
commit 1c14203808
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB
5 changed files with 30 additions and 20 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "@zen-browser/surfer", "name": "@zen-browser/surfer",
"version": "1.11.2", "version": "1.11.3",
"description": "Simplifying building firefox forks!", "description": "Simplifying building firefox forks!",
"main": "index.js", "main": "index.js",
"bin": { "bin": {

View file

@ -31,16 +31,15 @@ export const commands: Cmd[] = [
}, },
{ {
arg: '-j, --jobs <number>', arg: '-j, --jobs <number>',
description: description: 'Number of jobs to run in parallel',
'Number of jobs to run in parallel',
parse: (val: string) => { parse: (val: string) => {
const parsed = parseInt(val, 10) const parsed = parseInt(val, 10)
if (isNaN(parsed)) { if (isNaN(parsed)) {
throw new Error('Invalid number of jobs') throw new Error('Invalid number of jobs')
} }
return parsed return parsed
} },
} },
], ],
requestController: async () => (await import('./commands/build')).build, requestController: async () => (await import('./commands/build')).build,
}, },

View file

@ -110,7 +110,11 @@ const applyConfig = async (os: string) => {
writeFileSync(join(ENGINE_DIR, 'browser/config/version_display.txt'), version) writeFileSync(join(ENGINE_DIR, 'browser/config/version_display.txt'), version)
} }
const genericBuild = async (os: string, fast = false, jobs: number): Promise<boolean> => { const genericBuild = async (
os: string,
fast = false,
jobs: number
): Promise<boolean> => {
log.info(`Building for "${os}"...`) log.info(`Building for "${os}"...`)
log.warning( log.warning(
@ -133,11 +137,13 @@ const genericBuild = async (os: string, fast = false, jobs: number): Promise<boo
`Mach contents: \n ${readFileSync(join(ENGINE_DIR, 'mach'))}\n\n===END===` `Mach contents: \n ${readFileSync(join(ENGINE_DIR, 'mach'))}\n\n===END===`
) )
return (await configDispatch('./mach', { return (
args: buildOptions, await configDispatch('./mach', {
cwd: ENGINE_DIR, args: buildOptions,
killOnError: true, cwd: ENGINE_DIR,
})).success killOnError: true,
})
).success
} }
const parseDate = (d: number) => { const parseDate = (d: number) => {

View file

@ -36,7 +36,8 @@ ac_add_options --enable-rust-simd`
} }
} }
return ` return (
`
# ===================== # =====================
# Internal surfer config # Internal surfer config
# ===================== # =====================
@ -52,11 +53,15 @@ ac_add_options --enable-update-channel=${brand}
export ZEN_FIREFOX_VERSION=${getFFVersionOrCandidate()} export ZEN_FIREFOX_VERSION=${getFFVersionOrCandidate()}
export MOZ_APPUPDATE_HOST=${ export MOZ_APPUPDATE_HOST=${
config.updateHostname || 'localhost:7648 # This should not resolve' config.updateHostname || 'localhost:7648 # This should not resolve'
} }
` + (process as any).surferPlatform === 'darwin' ? ` ` +
((process as any).surferPlatform === 'darwin'
? `
# MacOS specific settings # MacOS specific settings
export MOZ_MACBUNDLE_NAME="${getCurrentBrandName()}.app" export MOZ_MACBUNDLE_NAME="${getCurrentBrandName()}.app"
` : ''; `
: '')
)
} }

View file

@ -2,14 +2,14 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
import execa from 'execa'; import execa from 'execa'
import { BASH_PATH } from '../constants'; import { BASH_PATH } from '../constants'
import { log } from '../log'; import { log } from '../log'
export const removeTimestamp = (input: string): string => export const removeTimestamp = (input: string): string =>
input.replace(/\s\d{1,5}:\d\d\.\d\d /g, '') input.replace(/\s\d{1,5}:\d\d\.\d\d /g, '')
type CommandResult = { success: boolean, output: string[] }; type CommandResult = { success: boolean; output: string[] }
export const configDispatch = ( export const configDispatch = (
cmd: string, cmd: string,