shibosoftwaredev/f1c100s-linux-nema17-stepper-controller
A four-layer NEMA 17 motor-controller PCB combining an Allwinner F1C100S Linux computer, USB‑PD/buck power system, W5500 Ethernet, STM32 real-time motion control, DRV8825 stepper driver, protection/temperature/current telemetry, USB interfaces, and local LED/buzzer diagnostics.
- Version
- 0.4.56
- License
- unset
- Stars
- 0
scripts/recover-review-upload.mjs
/** Complete the exact release created by tsci after its upload timed out. */
import fs from "node:fs"
import path from "node:path"
import os from "node:os"
import crypto from "node:crypto"
import {gzipSync} from "node:zlib"
import assert from "node:assert/strict"
const manifest=JSON.parse(fs.readFileSync("reports/review-fix-publish-manifest.json","utf8"))
assert.equal(manifest.version,"0.4.47-review-fixes-20261019")
const name=`${manifest.packageName}@${manifest.version}`
const files=manifest.files.map(file=>{
const bytes=fs.readFileSync(path.join(manifest.destination,file.file))
assert.equal(crypto.createHash("sha256").update(bytes).digest("hex"),file.sha256,file.file)
const text=bytes.toString("utf8")
const binary=bytes.subarray(0,8192).includes(0)||bytes.subarray(0,8192).toString("utf8").includes("�")
return binary?{file_path:file.file,content_base64:bytes.toString("base64")}:{file_path:file.file,content_text:text}
})
const archive=gzipSync(JSON.stringify({files}),{level:9})
const payload=JSON.stringify({package_name_with_version:name,archive_base64:archive.toString("base64")})
const token=process.env.TSCIRCUIT_TOKEN||JSON.parse(fs.readFileSync(path.join(os.homedir(),"Library/Preferences/tscircuit-nodejs/config.json"),"utf8")).sessionToken
assert.ok(token)
console.log(JSON.stringify({phase:"uploading-existing-release",name,files:files.length,gzipBytes:archive.length,requestBytes:Buffer.byteLength(payload)}))
const response=await fetch("https://registry-api.tscircuit.com/package_files/upload_archive",{
method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${token}`},
body:payload,signal:AbortSignal.timeout(180000),
})
const result=await response.json().catch(()=>({}))
if(!response.ok)throw new Error(`Archive upload HTTP ${response.status}: ${result.error?.error_code??"failed"}`)
fs.writeFileSync("reports/review-fix-upload-response.json",JSON.stringify({checkedAt:new Date().toISOString(),http:response.status,result},null,2)+"\n")
console.log(JSON.stringify({phase:"uploaded",http:response.status,files:files.length}))