From d670c5c860f8135e0c65eb4b59c4f1f27466f5a6 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Wed, 25 Oct 2023 21:41:43 -0700 Subject: [PATCH] Update publish-native script for wasm change (#57472) x-ref: https://github.com/vercel/next.js/actions/runs/6649134570/job/18067246584 x-ref: https://github.com/vercel/next.js/pull/57437 --- scripts/publish-native.js | 98 +++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/scripts/publish-native.js b/scripts/publish-native.js index c3c77bc157a1f..6bd9e7b2dc4ce 100755 --- a/scripts/publish-native.js +++ b/scripts/publish-native.js @@ -74,60 +74,60 @@ const cwd = process.cwd() ) // Update name/version of wasm packages and publish - const pkgDirectory = 'packages/next-swc/crates/wasm' - let wasmDir = path.join(cwd, pkgDirectory) + // const pkgDirectory = 'packages/next-swc/crates/wasm' + // let wasmDir = path.join(cwd, pkgDirectory) - await Promise.all( - ['web', 'nodejs'].map(async (wasmTarget) => { - await publishSema.acquire() + // await Promise.all( + // ['web', 'nodejs'].map(async (wasmTarget) => { + // await publishSema.acquire() - let wasmPkg = JSON.parse( - await readFile(path.join(wasmDir, `pkg-${wasmTarget}/package.json`)) - ) - wasmPkg.name = `@next/swc-wasm-${wasmTarget}` - wasmPkg.version = version - wasmPkg.repository = { - type: 'git', - url: 'https://github.com/vercel/next.js', - directory: pkgDirectory, - } + // let wasmPkg = JSON.parse( + // await readFile(path.join(wasmDir, `pkg-${wasmTarget}/package.json`)) + // ) + // wasmPkg.name = `@next/swc-wasm-${wasmTarget}` + // wasmPkg.version = version + // wasmPkg.repository = { + // type: 'git', + // url: 'https://github.com/vercel/next.js', + // directory: pkgDirectory, + // } - await writeFile( - path.join(wasmDir, `pkg-${wasmTarget}/package.json`), - JSON.stringify(wasmPkg, null, 2) - ) + // await writeFile( + // path.join(wasmDir, `pkg-${wasmTarget}/package.json`), + // JSON.stringify(wasmPkg, null, 2) + // ) - try { - await execa( - `npm`, - [ - 'publish', - `${path.join(wasmDir, `pkg-${wasmTarget}`)}`, - '--access', - 'public', - ...(version.includes('canary') ? ['--tag', 'canary'] : []), - ], - { stdio: 'inherit' } - ) - } catch (err) { - // don't block publishing other versions on single platform error - console.error(`Failed to publish`, wasmTarget, err) + // try { + // await execa( + // `npm`, + // [ + // 'publish', + // `${path.join(wasmDir, `pkg-${wasmTarget}`)}`, + // '--access', + // 'public', + // ...(version.includes('canary') ? ['--tag', 'canary'] : []), + // ], + // { stdio: 'inherit' } + // ) + // } catch (err) { + // // don't block publishing other versions on single platform error + // console.error(`Failed to publish`, wasmTarget, err) - if ( - err.message && - err.message.includes( - 'You cannot publish over the previously published versions' - ) - ) { - console.error('Ignoring already published error', wasmTarget) - } else { - // throw err - } - } finally { - publishSema.release() - } - }) - ) + // if ( + // err.message && + // err.message.includes( + // 'You cannot publish over the previously published versions' + // ) + // ) { + // console.error('Ignoring already published error', wasmTarget) + // } else { + // // throw err + // } + // } finally { + // publishSema.release() + // } + // }) + // ) // Update optional dependencies versions let nextPkg = JSON.parse(