From ea56d020e9556791c1175cc35ecef3204fcf3d16 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Mon, 27 Dec 2021 18:22:19 +0100 Subject: [PATCH] Tools: Improve plugin generator release script --- packages/generator-joplin/updateTypes.sh | 15 ------------- .../generator-joplin/updateTypesAndDemos.sh | 22 +++++++++++++++++++ packages/tools/release-plugin-generator.js | 2 ++ 3 files changed, 24 insertions(+), 15 deletions(-) create mode 100755 packages/generator-joplin/updateTypesAndDemos.sh diff --git a/packages/generator-joplin/updateTypes.sh b/packages/generator-joplin/updateTypes.sh index e3dfeae6f..7c7699830 100755 --- a/packages/generator-joplin/updateTypes.sh +++ b/packages/generator-joplin/updateTypes.sh @@ -1,12 +1,5 @@ #!/bin/bash -git pull - -if [[ -n $(git status --porcelain) ]]; then - echo "There are changes in the repo" - exit 1 -fi - SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" CLI_DIR="$SCRIPT_DIR/../app-cli" LIB_DIR="$SCRIPT_DIR/../lib" @@ -19,11 +12,3 @@ rsync -a --delete "$LIB_DIR/plugin_types/services/plugins/api/" "$SCRIPT_DIR/gen cp "$LIB_DIR/services/plugins/api/types.ts" "$SCRIPT_DIR/generators/app/templates/api/" cp "$SCRIPT_DIR/generators/app/templates/api_index.ts" "$SCRIPT_DIR/generators/app/templates/api/index.ts" rm -f "$SCRIPT_DIR/generators/app/templates/api/types.d.ts" - -yarn link - -"$CLI_DIR/tests/support/plugins/updatePlugins.sh" - -git add -A -git c -m "Plugins: Updated types" -git push diff --git a/packages/generator-joplin/updateTypesAndDemos.sh b/packages/generator-joplin/updateTypesAndDemos.sh new file mode 100755 index 000000000..99632bbd3 --- /dev/null +++ b/packages/generator-joplin/updateTypesAndDemos.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +git pull + +if [[ -n $(git status --porcelain) ]]; then + echo "There are changes in the repo" + exit 1 +fi + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +CLI_DIR="$SCRIPT_DIR/../app-cli" +LIB_DIR="$SCRIPT_DIR/../lib" + +./updateTypes.sh + +yarn link + +"$CLI_DIR/tests/support/plugins/updatePlugins.sh" + +git add -A +git c -m "Plugins: Updated types" +git push diff --git a/packages/tools/release-plugin-generator.js b/packages/tools/release-plugin-generator.js index 978917134..52ade594f 100644 --- a/packages/tools/release-plugin-generator.js +++ b/packages/tools/release-plugin-generator.js @@ -16,6 +16,8 @@ async function main() { console.info(`New version number: ${version}`); + await execCommandVerbose('updateTypes.sh'); + await setPackagePrivateField(packageFilePath, false); try { await execCommandVerbose('npm', ['publish']);