From 8ec6bc91385416c012545c77756478c6c05b01b7 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Thu, 6 Apr 2023 11:29:59 +0200 Subject: [PATCH] Tools: Simplify dependencies of root package --- gulpfile.js | 2 -- package.json | 4 ++-- packages/tools/gulp/tasks/buildCommandIndexRun.js | 12 ++++++++++++ .../gulp/tasks/updateIgnoredTypeScriptBuildRun.js | 12 ++++++++++++ 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 packages/tools/gulp/tasks/buildCommandIndexRun.js create mode 100644 packages/tools/gulp/tasks/updateIgnoredTypeScriptBuildRun.js diff --git a/gulpfile.js b/gulpfile.js index 13985a513..8e14ebd74 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,8 +2,6 @@ const gulp = require('gulp'); const { execCommand } = require('@joplin/utils'); const tasks = { - updateIgnoredTypeScriptBuild: require('./packages/tools/gulp/tasks/updateIgnoredTypeScriptBuild'), - buildCommandIndex: require('./packages/tools/gulp/tasks/buildCommandIndex'), completePublishAll: { fn: async () => { await execCommand(['git', 'add', '-A']); diff --git a/package.json b/package.json index 1e7eee230..d56d3bad8 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "buildParallel": "yarn workspaces foreach --verbose --interlaced --parallel --jobs 2 --topological run build && yarn run tsc", "buildSequential": "yarn workspaces foreach --verbose --interlaced --topological run build && yarn run tsc", "buildApiDoc": "yarn workspace joplin start apidoc ../../readme/api/references/rest_api.md", - "buildCommandIndex": "gulp buildCommandIndex", + "buildCommandIndex": "node packages/tools/gulp/tasks/buildCommandIndexRun.js", "buildPluginDoc": "typedoc --name 'Joplin Plugin API Documentation' --mode file -theme './Assets/PluginDocTheme/' --readme './Assets/PluginDocTheme/index.md' --excludeNotExported --excludeExternals --excludePrivate --excludeProtected --out ../joplin-website/docs/api/references/plugin_api packages/lib/services/plugins/api/", "updateMarkdownDoc": "node ./packages/tools/updateMarkdownDoc", "updateNews": "node ./packages/tools/website/updateNews", @@ -53,7 +53,7 @@ "test-ci": "yarn workspaces foreach --parallel --verbose --interlaced --jobs 2 run test-ci", "test": "yarn workspaces foreach --parallel --verbose --interlaced --jobs 2 run test", "tsc": "yarn workspaces foreach --parallel --verbose --interlaced run tsc", - "updateIgnored": "gulp updateIgnoredTypeScriptBuild", + "updateIgnored": "node packages/tools/gulp/tasks/updateIgnoredTypeScriptBuildRun.js", "updatePluginTypes": "./packages/generator-joplin/updateTypes.sh", "watch": "yarn workspaces foreach --parallel --verbose --interlaced --jobs 999 run watch", "watchWebsite": "nodemon --verbose --watch Assets/WebsiteAssets --watch packages/tools/website --watch packages/tools/website/utils --ext md,ts,js,mustache,css,tsx,gif,png,svg --exec \"node packages/tools/website/build.js && http-server --port 8077 ../joplin-website/docs -a localhost\"" diff --git a/packages/tools/gulp/tasks/buildCommandIndexRun.js b/packages/tools/gulp/tasks/buildCommandIndexRun.js new file mode 100644 index 000000000..bbda5fd8d --- /dev/null +++ b/packages/tools/gulp/tasks/buildCommandIndexRun.js @@ -0,0 +1,12 @@ +// Allow running that task "buildCommandIndex" without gulp + +const task = require('./buildCommandIndex.js'); + +const main = async () => { + await task.fn(); +}; + +main().catch((error) => { + console.error(error); + process.exit(1); +}); diff --git a/packages/tools/gulp/tasks/updateIgnoredTypeScriptBuildRun.js b/packages/tools/gulp/tasks/updateIgnoredTypeScriptBuildRun.js new file mode 100644 index 000000000..7f91f333d --- /dev/null +++ b/packages/tools/gulp/tasks/updateIgnoredTypeScriptBuildRun.js @@ -0,0 +1,12 @@ +// Allow running that task "updateIgnoredTypeScriptBuild" without gulp + +const task = require('./updateIgnoredTypeScriptBuild.js'); + +const main = async () => { + await task.fn(); +}; + +main().catch((error) => { + console.error(error); + process.exit(1); +});