mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Finish axios migration via shared native HTTP helper
Replace all in-scope axios callsites with a new helpers/http.js wrapper over native fetch, including JSON/text GET, JSON POST, HEAD checks, and transient 5xx retry behavior; update all browser, build, script, and proxy API clients to use it; add focused unit tests; and remove axios from package dependencies. Constraint: Preserve API/build and deployment behavior while lowering transport surface area. Rejected: inline fetch replacements at each callsite | rejected to avoid inconsistent error/retry semantics. Confidence: high Scope-risk: moderate Directive: Keep helper in place as the transport boundary and update tests when changing request semantics. Tested: pnpm run -s typecheck, pnpm -s run test-prebuild, pnpm -s run test, pnpm -s run test:browser, pnpm -s run netlify-build, smoke GETs on /apple-silicon-app-test and /apple-silicon-app-test/?version=2 Not-tested: branch/netlify deployment health in CI pipeline after merge
This commit is contained in:
parent
d39a2a1d6c
commit
d45b587434
25 changed files with 824 additions and 267 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import plist from 'plist'
|
||||
import axios from 'axios'
|
||||
import prettyBytes from 'pretty-bytes'
|
||||
import * as zip from '@zip.js/zip.js'
|
||||
|
||||
import { isString } from './check-types.js'
|
||||
import { postJson } from './http.js'
|
||||
import parseMacho from './macho/index.js'
|
||||
|
||||
// Vite Web Workers - https://vitejs.dev/guide/features.html#web-workers
|
||||
|
|
@ -331,14 +331,13 @@ export default class AppFilesScanner {
|
|||
|
||||
// console.log( 'this.testResultStore', this.testResultStore )
|
||||
|
||||
const { supportedVersionNumber } = await axios.post( this.testResultStore , {
|
||||
const responseData = await postJson( this.testResultStore, {
|
||||
filename,
|
||||
appVersion,
|
||||
result,
|
||||
machoMeta: JSON.stringify( machoMeta ),
|
||||
infoPlist: JSON.stringify( infoPlist )
|
||||
})
|
||||
.then( response => response.data )
|
||||
} )
|
||||
.catch(function (error) {
|
||||
console.error(error)
|
||||
|
||||
|
|
@ -348,7 +347,7 @@ export default class AppFilesScanner {
|
|||
})
|
||||
|
||||
return {
|
||||
supportedVersionNumber
|
||||
supportedVersionNumber: responseData?.supportedVersionNumber ?? null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue