Plugin Migration Guide from v5 to v6
View in MarkdownSourceNew ipm CLI tool
In v6, there is a new CLI tool named ipm (Inkdrop Plugin Manager) for publishing plugins.
npm install -g @inkdropapp/ipm-cli
ipm configure
Check out the repository for more details.
New TypeScript definitions
TypeScript definitions for Inkdrop v6 are now available at @inkdropapp/types. You can install them to get type-checking and autocompletion for the Inkdrop API in your plugin:
npm install --save-dev @inkdropapp/types
@electron/remote is deprecated
remote.dialog → inkdrop.dialog
Before:
const remote = require('@electron/remote')
const { dialog } = remote
return dialog.showOpenDialog(
inkdrop.window,
{
...
})
After:
return inkdrop.dialog.showOpenDialog({
...
})
The inkdrop.window argument is no longer required.
inkdrop.window.on()
Before:
inkdrop.window.on('focus', this.handleAppFocus)
After:
const sub = inkdrop.window.onFocus(this.handleAppFocus)
// Unsubscribe
sub.dispose()
inkdrop.main.dataStore.getLocalDB() → inkdrop.localDB
CSS selectors for keymaps and commands
.mde-preview→.mde-preview-container
LESS is deprecated
The necessity of LESS has been less and less over the years, since CSS supports nested selectors and variables. In v6, the app has dropped support for LESS.
- Rename
.lessto.css
Before:
@primary-color: #ff0000;
.my-plugin {
.component {
color: @primary-color;
}
}
After:
:root {
--primary-color: #ff0000;
}
.my-plugin {
.component {
color: var(--primary-color);
}
}