From 55131215c95c363e0d30fa5a568146d45c4604f2 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 7 Mar 2022 15:00:46 +0000 Subject: [PATCH] Add prerelease task --- Rakefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Rakefile b/Rakefile index 6f08b3c483..226c6381ed 100644 --- a/Rakefile +++ b/Rakefile @@ -239,6 +239,19 @@ namespace :npm do end end + desc "Configure for pre-release" + task :configure_prerelease, [:prerel] do |t, args| + require "json" + prerel = args[:prerel] + NPM_PACKAGES.each do |pkg| + pkg_dir = "#{Dir.pwd}/packages/npm-packages/#{pkg[:name]}" + pkg_json = "#{pkg_dir}/package.json" + package = JSON.parse(File.read(pkg_json)) + package["version"] += "-#{prerel}" + File.write(pkg_json, JSON.pretty_generate(package)) + end + end + desc "Build all npm packages" multitask :all => NPM_PACKAGES.map { |pkg| pkg[:name] } end