mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
286169a9e7
## Summary `@vercel/devlow-bench` hasn't published since December 2024. The job that published it was removed in #93064; it was gated on the head commit message starting with `chore: release turbopack npm packages`, which squash-merge rewrites, so it couldn't fire through normal review — #93951 bumped the version correctly and still published nothing. Rather than rebuild that machinery for `turbopack/packages/*`, this moves the one remaining package to `packages/`, where lerna and the existing recursive publish already handle everything. **`publish-release.js` is unchanged.** The tradeoff is that the package joins the Next.js lockstep version, going from `0.4.0` to the current canary, and ships nightly instead of on manual bumps. At ~10k downloads/month, essentially all CI, nobody is reading its version for compatibility — not worth ~300 lines of bespoke release code in the script that gates Next.js releases. `packages/` already holds unscoped, non-`@next/` packages (`create-next-app`, `eslint-config-next`, `next-rspack`), all lockstep. The root eslint config covers `packages/` but never applied to `turbopack/`, so this exempts the three rules the source doesn't satisfy and prefixes six unused parameters, rather than reformatting the package as part of a move. ## Deletions Three nft packages, last published in 2022, none with a build script or any consumer: - `@vercel/experimental-nft` — a stub containing only a `package.json` - `@vercel/webpack-nft` — resolved binaries built from a `node-file-trace` crate that no longer exists, so its core codepath couldn't work - `@vercel/experimental-nft-next-plugin` — depends on the above `turbopack/xtask/src/publish.rs` goes with them: its only caller was the workflow removed in #93064, its `npm` subcommand targeted that same missing crate, and nothing invokes `cargo xtask`. `turbopack/packages/` no longer exists. ## Verification - `publish-release.js --dry-run` — publishes `@vercel/devlow-bench` via the untouched recursive publish - `lerna list` and `turbo run build` both resolve it at the new path - `pnpm run --filter=devlow-bench test` — 3/3, and the CI jobs reference it by name, not path - Root eslint and the package's own `lint` script both clean - `cargo check`/`clippy`/`fmt -p xtask` - Not run: a real publish, which only CI can exercise `pnpm-lock.yaml` is hand-edited to repoint the workspace entry and drop the three removed ones. A full `pnpm install` rewrites ~1800 unrelated lines, and `--frozen-lockfile` fails identically on unmodified `canary` from pre-existing `apps/docs` drift. <!-- NEXT_JS_LLM -->
73 lines
1.8 KiB
TypeScript
73 lines
1.8 KiB
TypeScript
import assert from 'assert'
|
|
import { mkdtemp, rm, writeFile } from 'node:fs/promises'
|
|
import { tmpdir } from 'node:os'
|
|
import { join } from 'node:path'
|
|
import { test } from 'node:test'
|
|
import { command } from '../shell.js'
|
|
|
|
async function withTempScript(
|
|
scriptContents: string,
|
|
fn: (scriptPath: string) => Promise<void>
|
|
) {
|
|
const dir = await mkdtemp(join(tmpdir(), 'devlow-shell-test-'))
|
|
const scriptPath = join(dir, 'script.js')
|
|
|
|
try {
|
|
await writeFile(scriptPath, scriptContents, 'utf8')
|
|
await fn(scriptPath)
|
|
} finally {
|
|
await rm(dir, { recursive: true, force: true })
|
|
}
|
|
}
|
|
|
|
test('waitForOutput handles sequential waits after buffered output', async () => {
|
|
await withTempScript(
|
|
`
|
|
console.log('FIRST_MARKER')
|
|
console.log('SECOND_MARKER')
|
|
setTimeout(() => {}, 1000)
|
|
`,
|
|
async (scriptPath) => {
|
|
const shell = command('node', [scriptPath])
|
|
|
|
try {
|
|
const first = await shell.waitForOutput(/FIRST_MARKER\n/, {
|
|
timeoutMs: 2_000,
|
|
})
|
|
assert.equal(first[0], 'FIRST_MARKER\n')
|
|
const second = await shell.waitForOutput(/SECOND_MARKER\n/, {
|
|
timeoutMs: 2_000,
|
|
})
|
|
assert.equal(second[0], 'SECOND_MARKER\n')
|
|
} finally {
|
|
await shell.kill()
|
|
}
|
|
}
|
|
)
|
|
})
|
|
|
|
test('waitForOutput times out when output never appears', async () => {
|
|
await withTempScript(
|
|
`
|
|
console.log('FIRST_MARKER')
|
|
setTimeout(() => {}, 1000)
|
|
`,
|
|
async (scriptPath) => {
|
|
const shell = command('node', [scriptPath])
|
|
|
|
try {
|
|
await shell.waitForOutput(/FIRST_MARKER\n/, {
|
|
timeoutMs: 2_000,
|
|
})
|
|
|
|
await assert.rejects(
|
|
shell.waitForOutput(/NEVER_SEEN\n/, { timeoutMs: 100 }),
|
|
/Timed out waiting for output matching/
|
|
)
|
|
} finally {
|
|
await shell.kill()
|
|
}
|
|
}
|
|
)
|
|
})
|