-
Notifications
You must be signed in to change notification settings - Fork 298
Migrating Configuration to TypeScript
In Oni 0.3.1+, the user configuration is kept as a TypeScript file, in order to leverage language services like completion, hover, etc - this makes it easier for a user to discover the API surface, which is important for a programmatic configuration.
If you currently have a JavaScript configuration, you can keep using that as-is, and it will still work as today. You do not need to upgrade your configuration - it's opt-in. The config.js
file is still the entry point for configuration - the typescript configuration strategy compiles to config.js
on save.
Unfortunately, we don't have an automated upgrade process. If you'd like to convert your configuration over to the new format, you can do the following:
- In your configuration folder, rename
config.js
to_config.js
- Open Oni and
File -> Preferences -> Edit Oni config
- this will create a new.tsx
file - Port over the
activate
portion - Port over the configuration settings (in
module.exports = { ... }
) toexport configuration = { ... }
. - Save the file - you're all set!
Again, this is not required, but it's worth doing if you work in your config a lot - having the completion and API at hand makes it much easier!