From c94ec4e06430c6cae11af0d75fc89e51bd684ca0 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 26 Jan 2024 20:19:28 +0000 Subject: [PATCH] Chore: Rename instances of `yarn run` to just `yarn` --- .github/scripts/run_ci.sh | 20 +++++++++---------- .github/workflows/build-macos-m1.yml | 4 ++-- .github/workflows/github-actions-main.yml | 6 +++--- docker-compose.db-dev.yml | 2 +- lint-staged.config.js | 8 ++++---- package.json | 10 +++++----- packages/app-cli/build-doc.sh | 2 +- packages/app-cli/cli-integration.sh | 2 +- packages/app-cli/createUsers.sh | 2 +- packages/app-cli/fuzzing.sh | 2 +- .../register_command/test_plugin_update.sh | 2 +- packages/app-cli/tools/populateDatabase.ts | 2 +- .../app-desktop/integration-tests/run-ci.sh | 4 ++-- packages/app-desktop/package.json | 2 +- packages/app-mobile/clean_build.bat | 2 +- .../NoteEditor/CodeMirror/CodeMirror.ts | 2 +- packages/generator-joplin/updateTypes.sh | 2 +- packages/lib/package.json | 2 +- packages/renderer/package.json | 2 +- packages/renderer/publish.sh | 2 +- packages/server/package.json | 6 +++--- packages/server/readme/stripe.md | 6 +++--- .../server/src/services/database/types.ts | 2 +- packages/server/src/tools/generateTypes.ts | 2 +- packages/tools/checkIgnoredFiles.ts | 4 ++-- packages/tools/packageJsonLint.ts | 2 +- packages/tools/release-android.ts | 2 +- packages/tools/release-cli.ts | 2 +- packages/tools/release-plugin-repo-cli.ts | 4 ++-- packages/turndown/build_for_test.sh | 4 ++-- packages/utils/package.json | 2 +- readme/dev/BUILD.md | 4 ++-- readme/dev/DEPLOY.md | 18 ++++++++--------- readme/dev/coding_style.md | 6 +++--- readme/dev/spec/default_plugins.md | 2 +- 35 files changed, 73 insertions(+), 73 deletions(-) diff --git a/.github/scripts/run_ci.sh b/.github/scripts/run_ci.sh index 02b32ff95a..cdeca04211 100755 --- a/.github/scripts/run_ci.sh +++ b/.github/scripts/run_ci.sh @@ -107,7 +107,7 @@ if [ "$RUN_TESTS" == "1" ]; then # # https://stackoverflow.com/questions/38558989 export NODE_OPTIONS="--max-old-space-size=32768" - yarn run test-ci + yarn test-ci testResult=$? if [ $testResult -ne 0 ]; then exit $testResult @@ -122,13 +122,13 @@ fi if [ "$RUN_TESTS" == "1" ]; then echo "Step: Running linter..." - yarn run linter-ci ./ + yarn linter-ci ./ testResult=$? if [ $testResult -ne 0 ]; then exit $testResult fi - yarn run packageJsonLint + yarn packageJsonLint testResult=$? if [ $testResult -ne 0 ]; then exit $testResult @@ -175,7 +175,7 @@ fi # ============================================================================= # Check .gitignore and .eslintignore files - they should be updated when -# new TypeScript files are added by running `yarn run updateIgnored`. +# new TypeScript files are added by running `yarn updateIgnored`. # See coding_style.md # ============================================================================= @@ -200,7 +200,7 @@ if [ "$RUN_TESTS" == "1" ]; then mkdir -p ../joplin-website/docs ll ../joplin-website/docs/api/references/plugin_api - SKIP_SPONSOR_PROCESSING=1 yarn run buildWebsite + SKIP_SPONSOR_PROCESSING=1 yarn buildWebsite testResult=$? if [ $testResult -ne 0 ]; then exit $testResult @@ -253,14 +253,14 @@ if [ "$IS_DESKTOP_RELEASE" == "1" ]; then # "python" and seems to no longer respect the PYTHON_PATH environment variable. # We work around this by aliasing python. alias python=$(which python3) - USE_HARD_LINKS=false yarn run dist + USE_HARD_LINKS=false yarn dist else - USE_HARD_LINKS=false yarn run dist + USE_HARD_LINKS=false yarn dist fi elif [[ $IS_LINUX = 1 ]] && [ "$IS_SERVER_RELEASE" == "1" ]; then echo "Step: Building Docker Image..." cd "$ROOT_DIR" - yarn run buildServerDocker --tag-name $GIT_TAG_NAME --push-images --repository $SERVER_REPOSITORY + yarn buildServerDocker --tag-name $GIT_TAG_NAME --push-images --repository $SERVER_REPOSITORY else echo "Step: Building but *not* publishing desktop application..." @@ -274,8 +274,8 @@ else export CSC_IDENTITY_AUTO_DISCOVERY=false npm pkg set 'build.mac.identity'=null --json - USE_HARD_LINKS=false yarn run dist --publish=never + USE_HARD_LINKS=false yarn dist --publish=never else - USE_HARD_LINKS=false yarn run dist --publish=never + USE_HARD_LINKS=false yarn dist --publish=never fi fi diff --git a/.github/workflows/build-macos-m1.yml b/.github/workflows/build-macos-m1.yml index ffb5ab06dd..0b545c6c07 100644 --- a/.github/workflows/build-macos-m1.yml +++ b/.github/workflows/build-macos-m1.yml @@ -67,7 +67,7 @@ jobs: if [[ $GIT_TAG_NAME = v* ]]; then echo "Building and publishing desktop application..." - PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn run dist --mac --arm64 + PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn dist --mac --arm64 yarn renameReleaseAssets --repo="$GH_REPO" --tag="$GIT_TAG_NAME" --token="$GITHUB_TOKEN" else @@ -80,5 +80,5 @@ jobs: export CSC_IDENTITY_AUTO_DISCOVERY=false npm pkg set 'build.mac.identity'=null --json - PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn run dist --mac --arm64 --publish=never + PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn dist --mac --arm64 --publish=never fi diff --git a/.github/workflows/github-actions-main.yml b/.github/workflows/github-actions-main.yml index d1a81bdae1..a35d765115 100644 --- a/.github/workflows/github-actions-main.yml +++ b/.github/workflows/github-actions-main.yml @@ -141,7 +141,7 @@ jobs: # To ensure that the operations stop on failure, all commands # should be on one line with "&&" in between. run: | - yarn install && cd packages/app-desktop && yarn run dist + yarn install && cd packages/app-desktop && yarn dist # Build and package the Windows app, without publishing it, just to # verify that the build process hasn't been broken. @@ -153,7 +153,7 @@ jobs: SERVER_REPOSITORY: joplin/server SERVER_TAG_PREFIX: server run: | - yarn install && cd packages/app-desktop && yarn run dist --publish=never + yarn install && cd packages/app-desktop && yarn dist --publish=never ServerDockerImage: needs: pre_job @@ -197,7 +197,7 @@ jobs: BUILD_SEQUENCIAL: 1 run: | yarn install - yarn run buildServerDocker --tag-name server-v0.0.0 --repository joplin/server + yarn buildServerDocker --tag-name server-v0.0.0 --repository joplin/server # Basic test to ensure that the created build is valid. It should exit with # code 0 if it works. diff --git a/docker-compose.db-dev.yml b/docker-compose.db-dev.yml index cff015a8ea..861058778d 100644 --- a/docker-compose.db-dev.yml +++ b/docker-compose.db-dev.yml @@ -1,5 +1,5 @@ # For development this compose file starts the database only. The app can then -# be started using `yarn run start-dev`, which is useful for development, because +# be started using `yarn start-dev`, which is useful for development, because # it means the app Docker file doesn't have to be rebuilt on each change. version: '3' diff --git a/lint-staged.config.js b/lint-staged.config.js index 9af7c1e42a..ec26372681 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -11,9 +11,9 @@ module.exports = { // // '**/*.ts?(x)': () => 'npm run tsc', '*.{js,jsx,ts,tsx}': [ - 'yarn run checkIgnoredFiles', - // 'yarn run checkLibPaths', - 'yarn run packageJsonLint', - 'yarn run linter-precommit', + 'yarn checkIgnoredFiles', + // 'yarn checkLibPaths', + 'yarn packageJsonLint', + 'yarn linter-precommit', ], }; diff --git a/package.json b/package.json index 17b9f9fce7..8b60420835 100644 --- a/package.json +++ b/package.json @@ -14,13 +14,13 @@ "scripts": { "buildApiDoc": "yarn workspace joplin start apidoc ../../readme/api/references/rest_api.md", "buildScriptIndexes": "node packages/tools/gulp/tasks/buildScriptIndexesRun.js", - "buildParallel": "yarn workspaces foreach --verbose --interlaced --parallel --jobs 2 --topological run build && yarn run tsc", - "buildPluginDoc": "cd packages/generate-plugin-doc && yarn run buildPluginDoc_", - "buildSequential": "yarn workspaces foreach --verbose --interlaced --topological run build && yarn run tsc", + "buildParallel": "yarn workspaces foreach --verbose --interlaced --parallel --jobs 2 --topological run build && yarn tsc", + "buildPluginDoc": "cd packages/generate-plugin-doc && yarn buildPluginDoc_", + "buildSequential": "yarn workspaces foreach --verbose --interlaced --topological run build && yarn tsc", "buildServerDocker": "node packages/tools/buildServerDocker.js", "buildSettingJsonSchema": "yarn workspace joplin start settingschema ../../../joplin-website/docs/schema/settings.json", "buildTranslations": "node packages/tools/build-translation.js", - "buildWebsite": "node ./packages/tools/website/processDocs.js --env prod && node ./packages/tools/website/build.js && yarn run buildPluginDoc && yarn run buildSettingJsonSchema", + "buildWebsite": "node ./packages/tools/website/processDocs.js --env prod && node ./packages/tools/website/build.js && yarn buildPluginDoc && yarn buildSettingJsonSchema", "buildWebsiteTranslations": "node packages/tools/website/buildTranslations.js", "checkIgnoredFiles": "node ./packages/tools/checkIgnoredFiles.js", "checkLibPaths": "node ./packages/tools/checkLibPaths.js", @@ -40,7 +40,7 @@ "packageJsonLint": "node ./packages/tools/packageJsonLint.js", "postinstall": "gulp build", "postPreReleasesToForum": "node ./packages/tools/postPreReleasesToForum", - "publishAll": "git pull && yarn run buildParallel && lerna version --yes --no-private --no-git-tag-version && gulp completePublishAll", + "publishAll": "git pull && yarn buildParallel && lerna version --yes --no-private --no-git-tag-version && gulp completePublishAll", "releaseAndroid": "PATH=\"/usr/local/opt/openjdk@11/bin:$PATH\" node packages/tools/release-android.js", "releaseAndroidClean": "node packages/tools/release-android.js", "releaseCli": "node packages/tools/release-cli.js", diff --git a/packages/app-cli/build-doc.sh b/packages/app-cli/build-doc.sh index b1bba774eb..13893ce61b 100755 --- a/packages/app-cli/build-doc.sh +++ b/packages/app-cli/build-doc.sh @@ -1,3 +1,3 @@ #!/bin/bash set -e -yarn run build && NODE_PATH=build node build/build-doc.js \ No newline at end of file +yarn build && NODE_PATH=build node build/build-doc.js \ No newline at end of file diff --git a/packages/app-cli/cli-integration.sh b/packages/app-cli/cli-integration.sh index 37f9a9bc28..d0207f48a3 100755 --- a/packages/app-cli/cli-integration.sh +++ b/packages/app-cli/cli-integration.sh @@ -1,3 +1,3 @@ #!/bin/bash set -e -yarn run build && NODE_PATH="build/" node build/cli-integration-tests.js \ No newline at end of file +yarn build && NODE_PATH="build/" node build/cli-integration-tests.js \ No newline at end of file diff --git a/packages/app-cli/createUsers.sh b/packages/app-cli/createUsers.sh index dd3eeb10e3..6d80f4df85 100755 --- a/packages/app-cli/createUsers.sh +++ b/packages/app-cli/createUsers.sh @@ -2,7 +2,7 @@ # Start the server with: # -# JOPLIN_IS_TESTING=1 yarn run start-dev +# JOPLIN_IS_TESTING=1 yarn start-dev SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" diff --git a/packages/app-cli/fuzzing.sh b/packages/app-cli/fuzzing.sh index f87369fece..980d5822b3 100755 --- a/packages/app-cli/fuzzing.sh +++ b/packages/app-cli/fuzzing.sh @@ -1,4 +1,4 @@ #!/bin/bash # set -e -yarn run build && NODE_PATH="build/" node build/fuzzing.js \ No newline at end of file +yarn build && NODE_PATH="build/" node build/fuzzing.js \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/register_command/test_plugin_update.sh b/packages/app-cli/tests/support/plugins/register_command/test_plugin_update.sh index d165367b94..d79bb8f6c7 100755 --- a/packages/app-cli/tests/support/plugins/register_command/test_plugin_update.sh +++ b/packages/app-cli/tests/support/plugins/register_command/test_plugin_update.sh @@ -4,4 +4,4 @@ # - Run the below command # - Then the file /manifests.json also needs to be updated with the new manifest file -yarn run dist && cp publish/org.joplinapp.plugins.RegisterCommandDemo.jpl ~/src/joplin-plugins-test/plugins/org.joplinapp.plugins.RegisterCommandDemo/plugin.jpl && cp publish/org.joplinapp.plugins.RegisterCommandDemo.json ~/src/joplin-plugins-test/plugins/org.joplinapp.plugins.RegisterCommandDemo/plugin.json \ No newline at end of file +yarn dist && cp publish/org.joplinapp.plugins.RegisterCommandDemo.jpl ~/src/joplin-plugins-test/plugins/org.joplinapp.plugins.RegisterCommandDemo/plugin.jpl && cp publish/org.joplinapp.plugins.RegisterCommandDemo.json ~/src/joplin-plugins-test/plugins/org.joplinapp.plugins.RegisterCommandDemo/plugin.json \ No newline at end of file diff --git a/packages/app-cli/tools/populateDatabase.ts b/packages/app-cli/tools/populateDatabase.ts index 5b2a81268e..b9ec089ba5 100644 --- a/packages/app-cli/tools/populateDatabase.ts +++ b/packages/app-cli/tools/populateDatabase.ts @@ -8,7 +8,7 @@ // - Run the Postgres database -- `sudo docker-compose --file docker-compose.db-dev.yml up` // - Update the DB parameters in ~/joplin-credentials/server.env to use the dev // database -// - Run the server - `JOPLIN_IS_TESTING=1 yarn run start-dev` +// - Run the server - `JOPLIN_IS_TESTING=1 yarn start-dev` // - Then run this script - `node populateDatabase.js` // // Currently it doesn't actually create the users, so that should be done using: diff --git a/packages/app-desktop/integration-tests/run-ci.sh b/packages/app-desktop/integration-tests/run-ci.sh index 071d4a3f2b..df63672ac7 100755 --- a/packages/app-desktop/integration-tests/run-ci.sh +++ b/packages/app-desktop/integration-tests/run-ci.sh @@ -7,7 +7,7 @@ export CI=true if test "$RUNNER_OS" = "Linux" ; then # The Ubuntu Github CI doesn't have a display server. # Start a virtual one with xvfb-run. - xvfb-run -- yarn run playwright test + xvfb-run -- yarn playwright test else - yarn run playwright test + yarn playwright test fi diff --git a/packages/app-desktop/package.json b/packages/app-desktop/package.json index 3b106cc641..200b131c27 100644 --- a/packages/app-desktop/package.json +++ b/packages/app-desktop/package.json @@ -5,7 +5,7 @@ "main": "main.js", "private": true, "scripts": { - "dist": "yarn run electronRebuild && npx electron-builder", + "dist": "yarn electronRebuild && npx electron-builder", "build": "gulp build", "electronBuilder": "gulp electronBuilder", "electronRebuild": "gulp electronRebuild", diff --git a/packages/app-mobile/clean_build.bat b/packages/app-mobile/clean_build.bat index 21ff0f0cc2..83b80fd58f 100644 --- a/packages/app-mobile/clean_build.bat +++ b/packages/app-mobile/clean_build.bat @@ -4,4 +4,4 @@ rmdir /s/q android\build rmdir /s/q android\.gradle rmdir /s/q node_modules yarn install -yarn run start \ No newline at end of file +yarn start \ No newline at end of file diff --git a/packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.ts b/packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.ts index 95ea80a5bb..4a90a67e7f 100644 --- a/packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.ts +++ b/packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.ts @@ -1,7 +1,7 @@ /* eslint-disable import/prefer-default-export */ // This contains the CodeMirror instance, which needs to be built into a bundle -// using `yarn run buildInjectedJs`. This bundle is then loaded from +// using `yarn buildInjectedJs`. This bundle is then loaded from // NoteEditor.tsx into the webview. // // In general, since this file is harder to debug due to the intermediate built diff --git a/packages/generator-joplin/updateTypes.sh b/packages/generator-joplin/updateTypes.sh index 8e77537cad..5362c384d3 100755 --- a/packages/generator-joplin/updateTypes.sh +++ b/packages/generator-joplin/updateTypes.sh @@ -5,7 +5,7 @@ CLI_DIR="$SCRIPT_DIR/../app-cli" LIB_DIR="$SCRIPT_DIR/../lib" cd "$LIB_DIR" -yarn run generatePluginTypes +yarn generatePluginTypes cd "$SCRIPT_DIR" rsync -a --delete "$LIB_DIR/plugin_types/lib/services/plugins/api/" "$SCRIPT_DIR/generators/app/templates/api/" diff --git a/packages/lib/package.json b/packages/lib/package.json index 5b0743cbc6..6e43ae9a23 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -11,7 +11,7 @@ "scripts": { "tsc": "tsc --project tsconfig.json", "watch": "tsc --watch --preserveWatchOutput --project tsconfig.json", - "generatePluginTypes": "rm -rf ./plugin_types && yarn run tsc --declaration --declarationDir ./plugin_types --project tsconfig.json", + "generatePluginTypes": "rm -rf ./plugin_types && yarn tsc --declaration --declarationDir ./plugin_types --project tsconfig.json", "test": "jest --verbose=false", "test-ci": "yarn test" }, diff --git a/packages/renderer/package.json b/packages/renderer/package.json index ff13d727c9..69ec52fad7 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -10,7 +10,7 @@ }, "scripts": { "buildAssets": "node Tools/buildAssets.js", - "build": "yarn run buildAssets", + "build": "yarn buildAssets", "tsc": "tsc --project tsconfig.json", "watch": "tsc --watch --preserveWatchOutput --project tsconfig.json", "test": "jest", diff --git a/packages/renderer/publish.sh b/packages/renderer/publish.sh index 3971be65a9..f7cf549c0b 100644 --- a/packages/renderer/publish.sh +++ b/packages/renderer/publish.sh @@ -3,7 +3,7 @@ set -e SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$SCRIPT_DIR" -yarn run buildAssets +yarn buildAssets npm version patch npm publish diff --git a/packages/server/package.json b/packages/server/package.json index 5f71bc30d8..e41e0c6bd8 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -3,15 +3,15 @@ "version": "2.14.2", "private": true, "scripts": { - "start-dev": "yarn run build && JOPLIN_IS_TESTING=1 nodemon --config nodemon.json --ext ts,js,mustache,css,tsx dist/app.js --env dev", + "start-dev": "yarn build && JOPLIN_IS_TESTING=1 nodemon --config nodemon.json --ext ts,js,mustache,css,tsx dist/app.js --env dev", "start-prod": "pm2 kill && pm2 start --no-daemon --exp-backoff-restart-delay=1000 dist/app.js", - "rebuild": "yarn run clean && yarn run build && yarn run tsc", + "rebuild": "yarn clean && yarn build && yarn tsc", "build": "gulp build", "devCreateDb": "node dist/app.js --env dev --create-db", "devDropTables": "node dist/app.js --env dev --drop-tables", "devDropDb": "node dist/app.js --env dev --drop-db", "start": "node dist/app.js", - "generateTypes": "rm -f db-buildTypes.sqlite && yarn run start --env buildTypes migrate latest && node dist/tools/generateTypes.js && mv db-buildTypes.sqlite schema.sqlite", + "generateTypes": "rm -f db-buildTypes.sqlite && yarn start --env buildTypes migrate latest && node dist/tools/generateTypes.js && mv db-buildTypes.sqlite schema.sqlite", "tsc": "tsc --project tsconfig.json", "test": "jest --verbose=false", "test-ci": "yarn test", diff --git a/packages/server/readme/stripe.md b/packages/server/readme/stripe.md index 421471eb56..1702e81c31 100644 --- a/packages/server/readme/stripe.md +++ b/packages/server/readme/stripe.md @@ -1,9 +1,9 @@ # How to test the complete workflow locally -- In website/build.ts, set the env to "dev", then build the website - `yarn run watchWebsite` -- Start the Stripe CLI tool: `yarn run stripeListen` +- In website/build.ts, set the env to "dev", then build the website - `yarn watchWebsite` +- Start the Stripe CLI tool: `yarn stripeListen` - Copy the webhook secret, and paste it in joplin-credentials/server.env (under STRIPE_WEBHOOK_SECRET) -- Start the local Joplin Server, `yarn run start-dev`, running under http://joplincloud.local:22300 +- Start the local Joplin Server, `yarn start-dev`, running under http://joplincloud.local:22300 - Start the workflow from http://localhost:8077/plans/ - The local website often is not configured to send email, but you can see them in the database, in the "emails" table. diff --git a/packages/server/src/services/database/types.ts b/packages/server/src/services/database/types.ts index d4d3bc438a..1e6712b2f7 100644 --- a/packages/server/src/services/database/types.ts +++ b/packages/server/src/services/database/types.ts @@ -138,7 +138,7 @@ export enum TaskId { } // AUTO-GENERATED-TYPES -// Auto-generated using `yarn run generate-types` +// Auto-generated using `yarn generate-types` export interface Session extends WithDates, WithUuid { user_id?: Uuid; auth_code?: string; diff --git a/packages/server/src/tools/generateTypes.ts b/packages/server/src/tools/generateTypes.ts index 86d55ed0a8..b786f7c1cd 100644 --- a/packages/server/src/tools/generateTypes.ts +++ b/packages/server/src/tools/generateTypes.ts @@ -212,7 +212,7 @@ async function main() { tableStrings.push(createRuntimeObject(table)); } - let content = `// Auto-generated using \`yarn run generate-types\`\n${typeStrings.join('\n\n')}`; + let content = `// Auto-generated using \`yarn generate-types\`\n${typeStrings.join('\n\n')}`; content += '\n\n'; content += `export const databaseSchema: DatabaseTables = {\n${tableStrings.join('\n')}\n};`; diff --git a/packages/tools/checkIgnoredFiles.ts b/packages/tools/checkIgnoredFiles.ts index cda55e8be6..b68e70a886 100644 --- a/packages/tools/checkIgnoredFiles.ts +++ b/packages/tools/checkIgnoredFiles.ts @@ -10,7 +10,7 @@ const main = async () => { '.eslintignore': await readFile('.eslintignore', 'utf8'), }; - await execCommand('yarn run updateIgnored', { quiet: true }); + await execCommand('yarn updateIgnored', { quiet: true }); const newContent = { '.gitignore': await readFile('.gitignore', 'utf8'), @@ -20,7 +20,7 @@ const main = async () => { if (newContent['.gitignore'] !== previousContent['.gitignore'] || newContent['.eslintignore'] !== previousContent['.eslintignore']) { await writeFile('.gitignore', previousContent['.gitignore'], 'utf8'); await writeFile('.eslintignore', previousContent['.eslintignore'], 'utf8'); - throw new Error('.gitignore or .eslintignore would be modified - run `yarn run updateIgnored`'); + throw new Error('.gitignore or .eslintignore would be modified - run `yarn updateIgnored`'); } }; diff --git a/packages/tools/packageJsonLint.ts b/packages/tools/packageJsonLint.ts index 4ff9b0edbc..259e8ffe27 100644 --- a/packages/tools/packageJsonLint.ts +++ b/packages/tools/packageJsonLint.ts @@ -8,7 +8,7 @@ const main = async () => { const rootDir = await getRootDir(); chdir(rootDir); - await execCommand('yarn run npmPkgJsonLint --configFile .npmpackagejsonlintrc.json --quiet .'); + await execCommand('yarn npmPkgJsonLint --configFile .npmpackagejsonlintrc.json --quiet .'); }; main().catch((error) => { diff --git a/packages/tools/release-android.ts b/packages/tools/release-android.ts index 3eb8f5950b..83f282e50b 100644 --- a/packages/tools/release-android.ts +++ b/packages/tools/release-android.ts @@ -137,7 +137,7 @@ async function createRelease(projectName: string, name: string, tagName: string, console.info(`Running from: ${process.cwd()}`); await execCommand('yarn install', { showStdout: false }); - await execCommand('yarn run tsc', { showStdout: false }); + await execCommand('yarn tsc', { showStdout: false }); console.info(`Building APK file v${suffix}...`); diff --git a/packages/tools/release-cli.ts b/packages/tools/release-cli.ts index 6a15178a28..93c29060fa 100644 --- a/packages/tools/release-cli.ts +++ b/packages/tools/release-cli.ts @@ -16,7 +16,7 @@ async function main() { const newTag = `cli-${newVersion}`; await execCommand('touch app/main.js'); - await execCommand('yarn run build'); + await execCommand('yarn build'); await execCommand('cp ../../README.md build/'); process.chdir(`${appDir}/build`); diff --git a/packages/tools/release-plugin-repo-cli.ts b/packages/tools/release-plugin-repo-cli.ts index 6aa6160b58..db79ca8575 100644 --- a/packages/tools/release-plugin-repo-cli.ts +++ b/packages/tools/release-plugin-repo-cli.ts @@ -8,10 +8,10 @@ async function main() { await gitPullTry(); chdir(rootDir); - await execCommand('yarn run tsc'); + await execCommand('yarn tsc'); chdir(workDir); - await execCommand('yarn run dist'); + await execCommand('yarn dist'); const newVersion = (await execCommand('npm version patch')).trim(); diff --git a/packages/turndown/build_for_test.sh b/packages/turndown/build_for_test.sh index 3349c35798..17ec912519 100755 --- a/packages/turndown/build_for_test.sh +++ b/packages/turndown/build_for_test.sh @@ -4,5 +4,5 @@ set -e SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" ROOT_DIR="$SCRIPT_DIR/../.." -yarn run build -cd $ROOT_DIR/packages/app-cli && yarn run test -- HtmlToMd \ No newline at end of file +yarn build +cd $ROOT_DIR/packages/app-cli && yarn test -- HtmlToMd \ No newline at end of file diff --git a/packages/utils/package.json b/packages/utils/package.json index 90120ffaf0..3294b7c1c7 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -21,7 +21,7 @@ }, "scripts": { "tsc": "tsc --project tsconfig.json", - "build": "yarn run tsc", + "build": "yarn tsc", "watch": "tsc --watch --preserveWatchOutput --project tsconfig.json", "test": "jest --verbose=false", "test-ci": "yarn test" diff --git a/readme/dev/BUILD.md b/readme/dev/BUILD.md index a9b4161afa..87e07fefea 100644 --- a/readme/dev/BUILD.md +++ b/readme/dev/BUILD.md @@ -78,9 +78,9 @@ To test the extension please refer to the relevant pages for each browser: [Fire To make changes to the application, you'll need to rebuild any TypeScript file you've changed. The simplest way to do this is to watch for changes from the root of the project. Simply run this command, and it should take care of the rest: - yarn run watch + yarn watch -Running `yarn run tsc` would have the same effect, but without watching. +Running `yarn tsc` would have the same effect, but without watching. ## Running an application with additional parameters diff --git a/readme/dev/DEPLOY.md b/readme/dev/DEPLOY.md index 701545ed98..73a96873e2 100644 --- a/readme/dev/DEPLOY.md +++ b/readme/dev/DEPLOY.md @@ -6,7 +6,7 @@ Various scripts are provided to deploy the Joplin applications, scripts and tool Before new releases are created, all version numbers must be updated. This is done using the `setupNewRelease` script and passing it the new major.minor version number. For example: - yarn run setupNewRelease 1.8 + yarn setupNewRelease 1.8 Patch numbers are going to be incremented automatically when releasing each individual package. @@ -14,13 +14,13 @@ Patch numbers are going to be incremented automatically when releasing each indi The desktop application is built for Windows, macOS and Linux via continuous integration, by pushing a version tag to GitHub. The process is automated using: - yarn run releaseDesktop + yarn releaseDesktop ## Android application The app is built and upload to GitHub using: - yarn run releaseAndroid --type=prerelease + yarn releaseAndroid --type=prerelease The "type" parameter can be either "release" or "prerelease" @@ -32,7 +32,7 @@ It must be built and released manually using XCode. Unlike the mobile or desktop application, the CLI app doesn't bundle its dependencies and is always installed from source. For that reason, all its `@joplin` dependencies must be deployed publicly first. This is done using: - yarn run publishAll + yarn publishAll This is going to publish all the Joplin libraries, such as `@joplin/lib`, `@joplin/tools`, etc. @@ -52,28 +52,28 @@ Then in `app-cli/package.json`, all `@joplin` dependencies and devdependencies m Finally, to release the actual app, run: - yarn run releaseCli + yarn releaseCli ## Joplin Server Run: - yarn run releaseServer + yarn releaseServer ## Web clipper Run: - yarn run releaseClipper + yarn releaseClipper ## Plugin generator First the types should generally be updated, using `./updateTypes.sh`. Then run: - yarn run releasePluginGenerator + yarn releasePluginGenerator ## Plugin Repo Cli This tool is packaged using Webpack so it can be released with a single command: - yarn run releasePluginRepoCli + yarn releasePluginRepoCli diff --git a/readme/dev/coding_style.md b/readme/dev/coding_style.md index cdefdd3d0e..5e1fdbde20 100644 --- a/readme/dev/coding_style.md +++ b/readme/dev/coding_style.md @@ -4,13 +4,13 @@ Coding style is mostly enforced by a pre-commit hook that runs `eslint`. This ho ## Enforcing rules using eslint -Whenever possible, coding style should be enforced using an eslint rule. To do so, add the relevant rule or plugin to `eslintrc.js`. To manually run the linter, run `yarn run linter ./` from the root of the project. +Whenever possible, coding style should be enforced using an eslint rule. To do so, add the relevant rule or plugin to `eslintrc.js`. To manually run the linter, run `yarn linter ./` from the root of the project. When adding a rule, you will often find that many files will no longer pass the linter. In that case, you have two options: - Fix the files one by one. If there aren't too many files, and the changes are simple (they are unlikely to introduce regressions), this is the preferred solution. -- Or use `yarn run linter-interactive ./` to disable existing errors. The interactive tool will process all the files and you can then choose to disable any existing error that it finds (by adding a `eslint-disable-next-line` comment above it). This allows keeping the existing, working codebase as it is, and enforcing that new code follows the rule. When using this method, add the comment "Old code before rule was applied" so that we can easily find back all the lines that have been automatically disabled. +- Or use `yarn linter-interactive ./` to disable existing errors. The interactive tool will process all the files and you can then choose to disable any existing error that it finds (by adding a `eslint-disable-next-line` comment above it). This allows keeping the existing, working codebase as it is, and enforcing that new code follows the rule. When using this method, add the comment "Old code before rule was applied" so that we can easily find back all the lines that have been automatically disabled. ## TypeScript rules @@ -20,7 +20,7 @@ Because the TypeScript compiler generates `.js` files, be sure to add these new To do this, 1. If the TypeScript compiler has already generated a `.js` file for the new `.ts` file, delete it. -2. Run `yarn run updateIgnored` in the root directory of the project (or `yarn run postinstall`) +2. Run `yarn updateIgnored` in the root directory of the project (or `yarn postinstall`) ### Convert existing `.js` files to TypeScript before modifying diff --git a/readme/dev/spec/default_plugins.md b/readme/dev/spec/default_plugins.md index 2fce2987cb..7f718ebb7d 100644 --- a/readme/dev/spec/default_plugins.md +++ b/readme/dev/spec/default_plugins.md @@ -37,7 +37,7 @@ Some plugins need patching. To create or update a plugin's patch, run the `patch For example, ```shell $ cd packages/default-plugins -$ yarn run patch plugin.id.here +$ yarn patch plugin.id.here ``` The script will create a temporary directory in which changes can be made. Do not stage the changes that should appear in the patch.