Skip to content

Commit

Permalink
refactor(ts): add warning for nuxt-ts deprecation (#5301)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmarrec authored and pi0 committed Mar 21, 2019
1 parent 665f15a commit a11afd4
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions distributions/nuxt-ts/bin/nuxt-ts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
#!/usr/bin/env node

const boxen = require('boxen').default
const chalk = require('chalk').default

const warningBox = boxen([
chalk.yellow.bold('IMPORTANT : Package deprecation'),
'',
`Nuxt TypeScript Support has been refactored to be used with ${chalk.green.bold('nuxt')} package.`,
`Which means that ${chalk.yellow.bold(`nuxt-ts`)} package is now no longer needed and is now tagged as ${chalk.yellow.bold('deprecated')}.`,
`${chalk.bold.underline('We highly recommend')} to follow the guidelines below :`,
'',
chalk.yellow.bold('Migration guide (2.5.x)'),
'',
chalk.bold('Using yarn'),
'yarn remove nuxt-ts',
'yarn add nuxt',
'yarn add -D @nuxt/typescript',
'',
chalk.bold('Using npm'),
'npm uninstall nuxt-ts',
'npm install nuxt',
'npm install -D @nuxt/typescript',
'',
` ----- ${chalk.bold('nuxt.config.ts')} -----`,
'| build: { |',
`| ${chalk.red('-- useForkTsChecker: ...')} |`,
`| ${chalk.green('++ typescript : {')} |`,
`| ${chalk.green('++ typeCheck: ...')} |`,
`| ${chalk.green('++ }')} |`,
'| } |',
' --------------------------',
'',
'Find more information in updated docs : ' + chalk.blue.underline('https://nuxtjs.org/guide/typescript')
].join('\n'), Object.assign({
borderColor: 'yellow',
borderStyle: 'round',
padding: 1,
margin: 1
})) + '\n'

process.stdout.write(warningBox)

const suffix = require('../package.json').name.includes('-edge') ? '-edge' : ''
require('@nuxt/cli' + suffix).run()
.catch((error) => {
Expand Down

0 comments on commit a11afd4

Please sign in to comment.