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",
"version": "1.11.2",
"version": "1.11.3",
"description": "Simplifying building firefox forks!",
"main": "index.js",
"bin": {

View file

@ -31,16 +31,15 @@ export const commands: Cmd[] = [
},
{
arg: '-j, --jobs <number>',
description:
'Number of jobs to run in parallel',
description: 'Number of jobs to run in parallel',
parse: (val: string) => {
const parsed = parseInt(val, 10)
if (isNaN(parsed)) {
throw new Error('Invalid number of jobs')
}
return parsed
}
}
},
},
],
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)
}
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.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===`
)
return (await configDispatch('./mach', {
return (
await configDispatch('./mach', {
args: buildOptions,
cwd: ENGINE_DIR,
killOnError: true,
})).success
})
).success
}
const parseDate = (d: number) => {

View file

@ -36,7 +36,8 @@ ac_add_options --enable-rust-simd`
}
}
return `
return (
`
# =====================
# Internal surfer config
# =====================
@ -54,9 +55,13 @@ export ZEN_FIREFOX_VERSION=${getFFVersionOrCandidate()}
export MOZ_APPUPDATE_HOST=${
config.updateHostname || 'localhost:7648 # This should not resolve'
}
` + (process as any).surferPlatform === 'darwin' ? `
` +
((process as any).surferPlatform === 'darwin'
? `
# MacOS specific settings
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
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
import execa from 'execa';
import { BASH_PATH } from '../constants';
import { log } from '../log';
import execa from 'execa'
import { BASH_PATH } from '../constants'
import { log } from '../log'
export const removeTimestamp = (input: string): string =>
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 = (
cmd: string,