You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 1, 2020. It is now read-only.
Roger Erens edited this page Apr 17, 2018
·
3 revisions
Migrating configuration from JavaScript 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 = { ... }) to export 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!