Skip to content

Commit

Permalink
add deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Feb 12, 2024
1 parent 64cfcd8 commit 499b942
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
17 changes: 8 additions & 9 deletions vike/node/cli/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// TODO/v1-release: remove this file

import { prerender as prerenderOriginal } from '../prerender/index.js'
export { runPrerenderFromAPI as prerender } from '../prerender/runPrerender.js'

import { assertWarning } from '../../utils/assert.js'
export const prerender: typeof prerenderOriginal = (options) => {
assertWarning(
false,
"`import { prerender } from 'vike/cli'` is deprecated in favor of `import { prerender } from 'vike/prerender'``",
{ onlyOnce: true, showStackTrace: true }
)
return prerenderOriginal(options)
}
import pc from '@brillout/picocolors'
assertWarning(
false,
`${pc.cyan("import { prerender } from 'vike/cli'")} is deprecated in favor of ${pc.cyan("import { prerender } from 'vike/api'")}`,
{ onlyOnce: true }
)
10 changes: 10 additions & 0 deletions vike/node/prerender/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
// TODO/v1-release: remove this file

export { runPrerenderFromAPI as prerender } from './runPrerender.js'

import { assertWarning } from './utils.js'
import pc from '@brillout/picocolors'
assertWarning(
false,
`${pc.cyan("import { prerender } from 'vike/prerender'")} is deprecated in favor of ${pc.cyan("import { prerender } from 'vike/api'")}`,
{ onlyOnce: true }
)

0 comments on commit 499b942

Please sign in to comment.