mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Allows using `unstable_after` in `generateStaticParams`. definitely niche, but since we're now allowing `after` to be used during build, i see no reason not to. Also fixes an issue where we didn't pass `experimental.after` into the context used for `generateStaticParams`, so if `after` was called, it'd always say that you have to enable `experimental.after` even if you already did.
17 lines
453 B
JavaScript
17 lines
453 B
JavaScript
export function cliLog(/** @type {string | Record<string, any>} */ data) {
|
|
console.log('<test-log>' + JSON.stringify(data) + '</test-log>')
|
|
}
|
|
|
|
export function readCliLogs(/** @type {string} */ output) {
|
|
return output
|
|
.split('\n')
|
|
.map((line) => {
|
|
const match = line.match(/^<test-log>(?<value>.+?)<\/test-log>$/)
|
|
if (!match) {
|
|
return null
|
|
}
|
|
return JSON.parse(match.groups.value)
|
|
})
|
|
.filter(Boolean)
|
|
}
|