From bb892af3a4b8cd7ad0d091b8eadfddfa8e83c763 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 13 Nov 2023 22:09:35 -0800 Subject: [PATCH] Make trunk builds "0.0.0" (#1466) Summary: X-link: https://github.com/facebook/react-native/pull/41423 Pull Request resolved: https://github.com/facebook/yoga/pull/1466 Right now Yoga's main branch says it's 2.0.0, and RN's dirsync says its 1.14.0, but the code is really closer to what will be Yoga 3.0.0. This changes trunk builds to "0.0.0" for clarity, which will be assigned a real version number the first time publishing a new Yoga branch. This is separately a good practice to prevent the chance of accidental publishes causing damage. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D51236778 fbshipit-source-id: 06cac89bcca1c707ce5c00f9c346f627eef6b4bc --- Yoga.podspec | 2 +- gradle.properties | 2 +- javascript/package.json | 2 +- set-version.py | 8 ++++++++ website-next/package.json | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Yoga.podspec b/Yoga.podspec index 41431f67..4389cfe9 100644 --- a/Yoga.podspec +++ b/Yoga.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |spec| spec.name = 'Yoga' - spec.version = '2.0.0' + spec.version = '0.0.0' spec.license = { :type => 'MIT', :file => "LICENSE" } spec.homepage = 'https://yogalayout.dev/' spec.documentation_url = 'https://yogalayout.dev/docs' diff --git a/gradle.properties b/gradle.properties index e205cdeb..cb6b2b4a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,4 +11,4 @@ android.useAndroidX=true org.gradle.jvmargs=-Xmx1536M -VERSION_NAME=2.0.0 +VERSION_NAME=0.0.0 diff --git a/javascript/package.json b/javascript/package.json index 64fa2bd3..600eb60d 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,6 +1,6 @@ { "name": "yoga-layout", - "version": "2.0.0", + "version": "0.0.0", "description": "An embeddable and performant flexbox layout engine with bindings for multiple languages", "license": "MIT", "author": "Meta Open Source", diff --git a/set-version.py b/set-version.py index 2afff1a4..97354e26 100755 --- a/set-version.py +++ b/set-version.py @@ -28,6 +28,14 @@ with open("javascript/package.json", "r+") as f: f.truncate() f.write(new_contents) +with open("website-next/package.json", "r+") as f: + new_contents = re.sub( + r'"yoga-layout": ".*"', f'"yoga-layout": "{version}"', f.read() + ) + f.seek(0) + f.truncate() + f.write(new_contents) + with open("Yoga.podspec", "r+") as f: new_contents = re.sub( r"spec\.version = '.*'", f"spec.version = '{version}'", f.read() diff --git a/website-next/package.json b/website-next/package.json index e319c38e..1e64c865 100644 --- a/website-next/package.json +++ b/website-next/package.json @@ -25,7 +25,7 @@ "prism-react-renderer": "^2.1.0", "react": "^18.0.0", "react-dom": "^18.0.0", - "yoga-layout": "^2.0.0" + "yoga-layout": "0.0.0" }, "devDependencies": { "@docusaurus/module-type-aliases": "3.0.0",