Get ready for V6
Pre-release
Pre-release
Package is now only ESM. Ready to be used with AdonisJS v6 after some polish
Breaking changes
- ESM only
- Repl constructor signature has changed. It now accepts an object of options instead of individual arguments :
Before :
new Repl(adonisRequireTs, '.history_file_name')
Now :
new Repl({ compiler, historyFilePath })
compiler
must follow the given interface :
interface Compiler {
compile (contents: string, filename: string): string
supportsTypescript: boolean
}
That means you are not forced to use @adonisjs/require-ts
anymore. In theory, any TypeScript compiler should work. Tried with tsc
and swc
and both worked fine.
- Since Node.js REPL isn't executed in a ESM context, you can't directly use the
import
statement. Instead, all modules should be imported with dynamic imports. For example :
// Before
import { foo } from './bar'
// Now
const { foo } = await import('./bar')
However, note that you can still use the import
statement in the file you are importing through dynamic imports. and ESM is fully supported in those files because they are handled by the Node.js loader
New features
- Added syntax highlighting in the REPL
- Also added bracket matching. That means when you are hovering a bracket, the matching one will be highlighted.