From 366752f424d6e828fa72488d3e2e0308658b8646 Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Fri, 14 May 2021 10:22:05 -0700 Subject: [PATCH] Enforce version "0.0.0" in plugin sources Summary: I've noticed that two plugins had wrong versions set and because of that they always published with the same version and not auto-updated. This diff fixes that and also adds safeguard which shows error on "yarn install" if some plugin packages has version set to something different from "0.0.0". Reviewed By: passy Differential Revision: D28443509 fbshipit-source-id: d982dbe05fa876717799d9464f900f2173b32f70 --- desktop/plugins/postinstall.ts | 10 ++++++++++ desktop/plugins/public/cpu/package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/desktop/plugins/postinstall.ts b/desktop/plugins/postinstall.ts index c98578245..fcc31b07d 100644 --- a/desktop/plugins/postinstall.ts +++ b/desktop/plugins/postinstall.ts @@ -55,6 +55,16 @@ async function postinstall(): Promise { ); } } + if (packageJson.version !== '0.0.0') { + errors.push( + `[ERROR] Plugin package "${path.relative( + rootDir, + packageDir, + )}" has version "${ + packageJson.version + }" set in package.json. Plugin sources must have version set to "0.0.0". Version is automatically bumped when plugin released.`, + ); + } if ( packageJson.keywords && packageJson.keywords.includes('flipper-plugin') diff --git a/desktop/plugins/public/cpu/package.json b/desktop/plugins/public/cpu/package.json index abcfce263..ae2d48b6c 100644 --- a/desktop/plugins/public/cpu/package.json +++ b/desktop/plugins/public/cpu/package.json @@ -10,7 +10,7 @@ "archived": false } ], - "version": "0.0.1", + "version": "0.0.0", "main": "dist/bundle.js", "flipperBundlerEntry": "index.tsx", "license": "MIT",