File tree Expand file tree Collapse file tree 5 files changed +27
-16
lines changed
Expand file tree Collapse file tree 5 files changed +27
-16
lines changed Original file line number Diff line number Diff line change @@ -145,9 +145,9 @@ const config = {
145145
146146 // Handle special cases with plugins.
147147 plugins : [
148+ unicodeTransformPlugin ( ) ,
148149 // Environment variable replacement must run AFTER unicode transform.
149150 envVarReplacementPlugin ( inlinedEnvVars ) ,
150- unicodeTransformPlugin ( ) ,
151151 {
152152 name : 'resolve-socket-packages' ,
153153 setup ( build ) {
Original file line number Diff line number Diff line change 2323 "build:watch" : " node --max-old-space-size=8192 --import=./scripts/load.mjs scripts/build.mjs --watch" ,
2424 "restore-cache" : " node --import=./scripts/load.mjs scripts/restore-cache.mjs" ,
2525 "build:sea" : " node --max-old-space-size=8192 --import=./scripts/load.mjs scripts/build-sea.mjs" ,
26- "build:sea:internal:bootstrap" : " node --max-old-space-size=8192 .config/esbuild.sea-bootstrap.build.mjs" ,
2726 "build:js" : " node scripts/build-js.mjs" ,
2827 "dev:watch" : " pnpm run build:watch" ,
29- "publish:sea" : " node --import=./scripts/load.mjs scripts/publish-sea.mjs" ,
3028 "check" : " node ../../scripts/check.mjs" ,
3129 "check-ci" : " pnpm run check" ,
3230 "lint" : " oxlint -c ../../.oxlintrc.json" ,
5250 "dev:npx" : " cross-env SOCKET_CLI_MODE=npx node --experimental-strip-types src/cli-dispatch.mts" ,
5351 "e2e-tests" : " dotenvx -q run -f .env.test -- vitest run --config vitest.e2e.config.mts" ,
5452 "e2e:js" : " node scripts/e2e.mjs --js" ,
55- "e2e:smol" : " node scripts/e2e.mjs --smol" ,
5653 "e2e:sea" : " node scripts/e2e.mjs --sea" ,
5754 "e2e:all" : " node scripts/e2e.mjs --all" ,
5855 "test" : " run-s check test:*" ,
Original file line number Diff line number Diff line change @@ -141,9 +141,9 @@ async function main() {
141141 } ,
142142 )
143143
144- if ( watchResult . code !== 0 ) {
145- process . exitCode = watchResult . code
146- throw new Error ( `Watch mode failed with exit code ${ watchResult . code } ` )
144+ if ( ! watchResult || watchResult . code !== 0 ) {
145+ process . exitCode = watchResult ? .code ?? 1
146+ throw new Error ( `Watch mode failed with exit code ${ watchResult ? .code ?? 1 } ` )
147147 }
148148 return
149149 }
@@ -265,7 +265,7 @@ async function main() {
265265 logger . step ( 'Phase 4: Post-processing (parallel)...' )
266266 }
267267
268- await Promise . all ( [
268+ const postResults = await Promise . allSettled ( [
269269 // Copy CLI bundle to dist (required for dist/index.js to work).
270270 ( async ( ) => {
271271 copyFileSync ( 'build/cli.js' , 'dist/cli.js' )
@@ -297,6 +297,14 @@ async function main() {
297297 } ) ( ) ,
298298 ] )
299299
300+ const postFailed = postResults . filter ( r => r . status === 'rejected' )
301+ if ( postFailed . length > 0 ) {
302+ for ( const r of postFailed ) {
303+ logger . error ( `Post-processing failed: ${ r . reason ?. message ?? r . reason } ` )
304+ }
305+ throw new Error ( 'Post-processing step(s) failed' )
306+ }
307+
300308 if ( ! quiet ) {
301309 printSuccess ( 'Build completed' )
302310 printFooter ( )
Original file line number Diff line number Diff line change @@ -331,15 +331,19 @@ ${content}
331331 */
332332async function downloadAssets ( assetNames , parallel = true ) {
333333 if ( parallel ) {
334- const results = await Promise . all (
334+ const settled = await Promise . allSettled (
335335 assetNames . map ( name => downloadAsset ( ASSETS [ name ] ) ) ,
336336 )
337337
338- const failed = results . filter ( r => ! r . ok )
338+ const failed = settled . filter (
339+ r => r . status === 'rejected' || ( r . status === 'fulfilled' && ! r . value . ok ) ,
340+ )
339341 if ( failed . length > 0 ) {
340342 logger . error ( `\n${ failed . length } asset(s) failed:` )
341- for ( const { name } of failed ) {
342- logger . error ( ` - ${ name } ` )
343+ for ( const r of failed ) {
344+ logger . error (
345+ ` - ${ r . status === 'rejected' ? r . reason ?. message ?? r . reason : r . value . name } ` ,
346+ )
343347 }
344348 process . exitCode = 1
345349 }
Original file line number Diff line number Diff line change @@ -154,15 +154,17 @@ async function downloadBinaries(platformFilter = null) {
154154 `Downloading iocraft binaries for ${ configs . length } platform(s)...` ,
155155 )
156156
157- const results = await Promise . all (
157+ const settled = await Promise . allSettled (
158158 configs . map ( config => downloadIocraftBinary ( config ) ) ,
159159 )
160160
161- const failed = results . filter ( r => ! r . ok )
161+ const failed = settled . filter (
162+ r => r . status === 'rejected' || ( r . status === 'fulfilled' && ! r . value . ok ) ,
163+ )
162164 if ( failed . length > 0 ) {
163165 logger . error ( `\n${ failed . length } platform(s) failed:` )
164- for ( const { target } of failed ) {
165- logger . error ( ` - ${ target } ` )
166+ for ( const r of failed ) {
167+ logger . error ( ` - ${ r . status === 'rejected' ? r . reason ?. message ?? r . reason : r . value . target } ` )
166168 }
167169 return false
168170 }
You can’t perform that action at this time.
0 commit comments