From 7154ebbf5c227e5c004adc4488c2c7fb7600ecae Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Mon, 23 Nov 2020 17:06:52 +0000 Subject: [PATCH] Plugins: Updated types --- .../plugins/codemirror_content_script/api/Global.d.ts | 3 +-- .../plugins/codemirror_content_script/api/Joplin.d.ts | 3 +-- .../codemirror_content_script/api/JoplinPlugins.d.ts | 4 +--- .../plugins/codemirror_content_script/package.json | 4 ++-- .../plugins/codemirror_content_script/webpack.config.js | 9 +++++++++ .../tests/support/plugins/content_script/api/Global.d.ts | 3 +-- .../tests/support/plugins/content_script/api/Joplin.d.ts | 3 +-- .../plugins/content_script/api/JoplinPlugins.d.ts | 4 +--- .../tests/support/plugins/content_script/package.json | 4 ++-- .../support/plugins/content_script/webpack.config.js | 9 +++++++++ .../app-cli/tests/support/plugins/dialog/api/Global.d.ts | 3 +-- .../app-cli/tests/support/plugins/dialog/api/Joplin.d.ts | 3 +-- .../tests/support/plugins/dialog/api/JoplinPlugins.d.ts | 4 +--- .../app-cli/tests/support/plugins/dialog/package.json | 4 ++-- .../tests/support/plugins/dialog/webpack.config.js | 9 +++++++++ .../support/plugins/editor_context_menu/api/Global.d.ts | 3 +-- .../support/plugins/editor_context_menu/api/Joplin.d.ts | 3 +-- .../plugins/editor_context_menu/api/JoplinPlugins.d.ts | 4 +--- .../support/plugins/editor_context_menu/package.json | 4 ++-- .../plugins/editor_context_menu/webpack.config.js | 9 +++++++++ .../app-cli/tests/support/plugins/events/api/Global.d.ts | 3 +-- .../app-cli/tests/support/plugins/events/api/Joplin.d.ts | 3 +-- .../tests/support/plugins/events/api/JoplinPlugins.d.ts | 4 +--- .../app-cli/tests/support/plugins/events/package.json | 4 ++-- .../tests/support/plugins/events/webpack.config.js | 9 +++++++++ .../tests/support/plugins/jpl_test/api/Global.d.ts | 3 +-- .../tests/support/plugins/jpl_test/api/Joplin.d.ts | 3 +-- .../support/plugins/jpl_test/api/JoplinPlugins.d.ts | 4 +--- .../app-cli/tests/support/plugins/jpl_test/package.json | 4 ++-- .../tests/support/plugins/jpl_test/webpack.config.js | 9 +++++++++ .../tests/support/plugins/json_export/api/Global.d.ts | 3 +-- .../tests/support/plugins/json_export/api/Joplin.d.ts | 3 +-- .../support/plugins/json_export/api/JoplinPlugins.d.ts | 4 +--- .../tests/support/plugins/json_export/package.json | 4 ++-- .../tests/support/plugins/json_export/webpack.config.js | 9 +++++++++ .../app-cli/tests/support/plugins/menu/api/Global.d.ts | 3 +-- .../app-cli/tests/support/plugins/menu/api/Joplin.d.ts | 3 +-- .../tests/support/plugins/menu/api/JoplinPlugins.d.ts | 4 +--- packages/app-cli/tests/support/plugins/menu/package.json | 4 ++-- .../app-cli/tests/support/plugins/menu/webpack.config.js | 9 +++++++++ .../support/plugins/multi_selection/api/Global.d.ts | 3 +-- .../support/plugins/multi_selection/api/Joplin.d.ts | 3 +-- .../plugins/multi_selection/api/JoplinPlugins.d.ts | 4 +--- .../tests/support/plugins/multi_selection/package.json | 4 ++-- .../support/plugins/multi_selection/webpack.config.js | 9 +++++++++ .../support/plugins/register_command/api/Global.d.ts | 3 +-- .../support/plugins/register_command/api/Joplin.d.ts | 3 +-- .../plugins/register_command/api/JoplinPlugins.d.ts | 4 +--- .../tests/support/plugins/register_command/api/types.ts | 7 ------- .../tests/support/plugins/register_command/package.json | 4 ++-- .../support/plugins/register_command/webpack.config.js | 9 +++++++++ .../tests/support/plugins/selected_text/api/Global.d.ts | 3 +-- .../tests/support/plugins/selected_text/api/Joplin.d.ts | 3 +-- .../support/plugins/selected_text/api/JoplinPlugins.d.ts | 4 +--- .../tests/support/plugins/selected_text/package.json | 4 ++-- .../support/plugins/selected_text/webpack.config.js | 9 +++++++++ .../tests/support/plugins/settings/api/Global.d.ts | 3 +-- .../tests/support/plugins/settings/api/Joplin.d.ts | 3 +-- .../support/plugins/settings/api/JoplinPlugins.d.ts | 4 +--- .../app-cli/tests/support/plugins/settings/package.json | 4 ++-- .../tests/support/plugins/settings/webpack.config.js | 9 +++++++++ .../app-cli/tests/support/plugins/toc/api/Global.d.ts | 3 +-- .../app-cli/tests/support/plugins/toc/api/Joplin.d.ts | 3 +-- .../tests/support/plugins/toc/api/JoplinPlugins.d.ts | 4 +--- packages/app-cli/tests/support/plugins/toc/package.json | 4 ++-- .../app-cli/tests/support/plugins/toc/webpack.config.js | 9 +++++++++ .../support/plugins/withExternalModules/api/Global.d.ts | 3 +-- .../support/plugins/withExternalModules/api/Joplin.d.ts | 3 +-- .../plugins/withExternalModules/api/JoplinPlugins.d.ts | 4 +--- .../support/plugins/withExternalModules/package.json | 4 ++-- .../plugins/withExternalModules/webpack.config.js | 9 +++++++++ .../generators/app/templates/api/Global.d.ts | 3 +-- .../generators/app/templates/api/Joplin.d.ts | 3 +-- .../generators/app/templates/api/JoplinPlugins.d.ts | 4 +--- 74 files changed, 199 insertions(+), 140 deletions(-) diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Global.d.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/package.json b/packages/app-cli/tests/support/plugins/codemirror_content_script/package.json index ebc25dcb4..a7ad2623f 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/package.json +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -20,4 +20,4 @@ "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/webpack.config.js b/packages/app-cli/tests/support/plugins/codemirror_content_script/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/content_script/api/Global.d.ts b/packages/app-cli/tests/support/plugins/content_script/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/content_script/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/content_script/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/content_script/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/content_script/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/content_script/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/content_script/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/content_script/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/content_script/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/content_script/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/content_script/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/content_script/package.json b/packages/app-cli/tests/support/plugins/content_script/package.json index ebc25dcb4..a7ad2623f 100644 --- a/packages/app-cli/tests/support/plugins/content_script/package.json +++ b/packages/app-cli/tests/support/plugins/content_script/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -20,4 +20,4 @@ "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/content_script/webpack.config.js b/packages/app-cli/tests/support/plugins/content_script/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/content_script/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/content_script/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/dialog/api/Global.d.ts b/packages/app-cli/tests/support/plugins/dialog/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/dialog/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/dialog/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/dialog/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/dialog/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/dialog/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/dialog/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/dialog/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/dialog/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/dialog/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/dialog/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/dialog/package.json b/packages/app-cli/tests/support/plugins/dialog/package.json index ebc25dcb4..a7ad2623f 100644 --- a/packages/app-cli/tests/support/plugins/dialog/package.json +++ b/packages/app-cli/tests/support/plugins/dialog/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -20,4 +20,4 @@ "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/dialog/webpack.config.js b/packages/app-cli/tests/support/plugins/dialog/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/dialog/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/dialog/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/Global.d.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/package.json b/packages/app-cli/tests/support/plugins/editor_context_menu/package.json index ebc25dcb4..a7ad2623f 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/package.json +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -20,4 +20,4 @@ "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/webpack.config.js b/packages/app-cli/tests/support/plugins/editor_context_menu/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/events/api/Global.d.ts b/packages/app-cli/tests/support/plugins/events/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/events/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/events/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/events/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/events/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/events/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/events/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/events/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/events/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/events/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/events/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/events/package.json b/packages/app-cli/tests/support/plugins/events/package.json index ebc25dcb4..a7ad2623f 100644 --- a/packages/app-cli/tests/support/plugins/events/package.json +++ b/packages/app-cli/tests/support/plugins/events/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -20,4 +20,4 @@ "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/events/webpack.config.js b/packages/app-cli/tests/support/plugins/events/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/events/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/events/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/Global.d.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/jpl_test/package.json b/packages/app-cli/tests/support/plugins/jpl_test/package.json index ebc25dcb4..a7ad2623f 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/package.json +++ b/packages/app-cli/tests/support/plugins/jpl_test/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -20,4 +20,4 @@ "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/jpl_test/webpack.config.js b/packages/app-cli/tests/support/plugins/jpl_test/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/jpl_test/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/json_export/api/Global.d.ts b/packages/app-cli/tests/support/plugins/json_export/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/json_export/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/json_export/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/json_export/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/json_export/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/json_export/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/json_export/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/json_export/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/json_export/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/json_export/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/json_export/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/json_export/package.json b/packages/app-cli/tests/support/plugins/json_export/package.json index ebc25dcb4..a7ad2623f 100644 --- a/packages/app-cli/tests/support/plugins/json_export/package.json +++ b/packages/app-cli/tests/support/plugins/json_export/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -20,4 +20,4 @@ "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/json_export/webpack.config.js b/packages/app-cli/tests/support/plugins/json_export/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/json_export/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/json_export/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/menu/api/Global.d.ts b/packages/app-cli/tests/support/plugins/menu/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/menu/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/menu/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/menu/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/menu/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/menu/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/menu/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/menu/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/menu/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/menu/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/menu/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/menu/package.json b/packages/app-cli/tests/support/plugins/menu/package.json index ebc25dcb4..a7ad2623f 100644 --- a/packages/app-cli/tests/support/plugins/menu/package.json +++ b/packages/app-cli/tests/support/plugins/menu/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -20,4 +20,4 @@ "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/menu/webpack.config.js b/packages/app-cli/tests/support/plugins/menu/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/menu/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/menu/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/Global.d.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/multi_selection/package.json b/packages/app-cli/tests/support/plugins/multi_selection/package.json index ebc25dcb4..a7ad2623f 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/package.json +++ b/packages/app-cli/tests/support/plugins/multi_selection/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -20,4 +20,4 @@ "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/multi_selection/webpack.config.js b/packages/app-cli/tests/support/plugins/multi_selection/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/multi_selection/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/register_command/api/Global.d.ts b/packages/app-cli/tests/support/plugins/register_command/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/register_command/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/register_command/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/register_command/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/register_command/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/register_command/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/register_command/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/register_command/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/register_command/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/register_command/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/register_command/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/register_command/api/types.ts b/packages/app-cli/tests/support/plugins/register_command/api/types.ts index af2ccb25e..f81bc1038 100644 --- a/packages/app-cli/tests/support/plugins/register_command/api/types.ts +++ b/packages/app-cli/tests/support/plugins/register_command/api/types.ts @@ -208,13 +208,6 @@ export enum MenuItemLocation { * @deprecated Do not use - same as NoteListContextMenu */ Context = 'context', - - /** - * The context menu that appears when right-clicking on the note - * list, or when multiple notes are selected. Any command triggered from - * this location will receive a `noteIds` array with the list of notes that - * were right-clicked or selected. - */ NoteListContextMenu = 'noteListContextMenu', EditorContextMenu = 'editorContextMenu', } diff --git a/packages/app-cli/tests/support/plugins/register_command/package.json b/packages/app-cli/tests/support/plugins/register_command/package.json index ebc25dcb4..a7ad2623f 100644 --- a/packages/app-cli/tests/support/plugins/register_command/package.json +++ b/packages/app-cli/tests/support/plugins/register_command/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -20,4 +20,4 @@ "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/register_command/webpack.config.js b/packages/app-cli/tests/support/plugins/register_command/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/register_command/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/register_command/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/Global.d.ts b/packages/app-cli/tests/support/plugins/selected_text/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/selected_text/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/selected_text/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/selected_text/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/selected_text/package.json b/packages/app-cli/tests/support/plugins/selected_text/package.json index ebc25dcb4..a7ad2623f 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/package.json +++ b/packages/app-cli/tests/support/plugins/selected_text/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -20,4 +20,4 @@ "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/selected_text/webpack.config.js b/packages/app-cli/tests/support/plugins/selected_text/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/selected_text/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/settings/api/Global.d.ts b/packages/app-cli/tests/support/plugins/settings/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/settings/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/settings/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/settings/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/settings/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/settings/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/settings/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/settings/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/settings/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/settings/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/settings/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/settings/package.json b/packages/app-cli/tests/support/plugins/settings/package.json index ebc25dcb4..a7ad2623f 100644 --- a/packages/app-cli/tests/support/plugins/settings/package.json +++ b/packages/app-cli/tests/support/plugins/settings/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -20,4 +20,4 @@ "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/settings/webpack.config.js b/packages/app-cli/tests/support/plugins/settings/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/settings/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/settings/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/toc/api/Global.d.ts b/packages/app-cli/tests/support/plugins/toc/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/toc/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/toc/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/toc/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/toc/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/toc/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/toc/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/toc/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/toc/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/toc/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/toc/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/toc/package.json b/packages/app-cli/tests/support/plugins/toc/package.json index 2d1bfd13f..49adee358 100644 --- a/packages/app-cli/tests/support/plugins/toc/package.json +++ b/packages/app-cli/tests/support/plugins/toc/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -23,4 +23,4 @@ "dependencies": { "uslug": "^1.0.4" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/toc/webpack.config.js b/packages/app-cli/tests/support/plugins/toc/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/toc/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/toc/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/Global.d.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/api/Global.d.ts +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded. diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/package.json b/packages/app-cli/tests/support/plugins/withExternalModules/package.json index b62bc62a9..0003e5215 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/package.json +++ b/packages/app-cli/tests/support/plugins/withExternalModules/package.json @@ -6,7 +6,7 @@ "dist": "webpack", "postinstall": "npm run dist" }, - "keywords": [], + "keywords": {}, "license": "MIT", "devDependencies": { "@types/node": "^14.0.14", @@ -23,4 +23,4 @@ "dependencies": { "left-pad": "^1.3.0" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/webpack.config.js b/packages/app-cli/tests/support/plugins/withExternalModules/webpack.config.js index 5c86b05c6..1f3e9a860 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/webpack.config.js +++ b/packages/app-cli/tests/support/plugins/withExternalModules/webpack.config.js @@ -16,6 +16,13 @@ function createPluginArchive(sourceDir, destPath) { const distFiles = glob.sync(`${sourceDir}/**/*`) .map(f => f.substr(sourceDir.length + 1)); + if (!distFiles.length) { + // Usually means there's an error, which is going to be printed by + // webpack + console.info('Plugin archive was not created because the "dist" directory is empty'); + return; + } + fs.removeSync(destPath); tar.create( @@ -38,6 +45,8 @@ const manifestPath = `${srcDir}/manifest.json`; const manifest = readManifest(manifestPath); const archiveFilePath = path.resolve(__dirname, `${manifest.id}.jpl`); +fs.removeSync(distDir); + module.exports = { mode: 'production', entry: './src/index.ts', diff --git a/packages/generator-joplin/generators/app/templates/api/Global.d.ts b/packages/generator-joplin/generators/app/templates/api/Global.d.ts index f6a0078fa..1bc9783e7 100644 --- a/packages/generator-joplin/generators/app/templates/api/Global.d.ts +++ b/packages/generator-joplin/generators/app/templates/api/Global.d.ts @@ -1,13 +1,12 @@ import Plugin from '../Plugin'; import Joplin from './Joplin'; -import Logger from '../../../Logger'; /** * @ignore */ export default class Global { private joplin_; private requireWhiteList_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get joplin(): Joplin; private requireWhiteList; require(filePath: string): any; diff --git a/packages/generator-joplin/generators/app/templates/api/Joplin.d.ts b/packages/generator-joplin/generators/app/templates/api/Joplin.d.ts index 74494aea0..fc09aeeaa 100644 --- a/packages/generator-joplin/generators/app/templates/api/Joplin.d.ts +++ b/packages/generator-joplin/generators/app/templates/api/Joplin.d.ts @@ -7,7 +7,6 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; -import Logger from '../../../Logger'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -32,7 +31,7 @@ export default class Joplin { private views_; private interop_; private settings_; - constructor(logger: Logger, implementation: any, plugin: Plugin, store: any); + constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; diff --git a/packages/generator-joplin/generators/app/templates/api/JoplinPlugins.d.ts b/packages/generator-joplin/generators/app/templates/api/JoplinPlugins.d.ts index 2a2bfd93a..458445a66 100644 --- a/packages/generator-joplin/generators/app/templates/api/JoplinPlugins.d.ts +++ b/packages/generator-joplin/generators/app/templates/api/JoplinPlugins.d.ts @@ -1,13 +1,11 @@ import Plugin from '../Plugin'; -import Logger from '../../../Logger'; import { ContentScriptType, Script } from './types'; /** * This class provides access to plugin-related features. */ export default class JoplinPlugins { - private logger; private plugin; - constructor(logger: Logger, plugin: Plugin); + constructor(plugin: Plugin); /** * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. * That `onStart` method will be executed as soon as the plugin is loaded.