From 82be2f875c296be1203c2363d082f539be579564 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Sat, 3 Aug 2024 14:29:22 -0700 Subject: [PATCH 1/3] Fix npm tagging and docs publishing for next releases --- .autorc | 2 +- scripts/release.sh | 27 +++++++++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.autorc b/.autorc index 926a020dd..067d94bcb 100644 --- a/.autorc +++ b/.autorc @@ -12,7 +12,7 @@ "versionFile": "./VERSION", "publishScript": "./scripts/release.sh", "publishScriptReleaseTypeArgs": { - "next": ["release"] + "next": ["next"] } } ], diff --git a/scripts/release.sh b/scripts/release.sh index fcae8b579..b7a64652a 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -3,23 +3,24 @@ set -u -o pipefail -readonly PKG_NPM_LABELS=`bazel query --output=label 'kind("npm_package rule", //...) - attr("tags", "\[.*do-not-publish.*\]", //...)'` -NPM_TAG=canary + # Called by auto -- `release` for normal releases or `snapshot` for canary/next. readonly RELEASE_TYPE=${1:-snapshot} readonly CURRENT_BRANCH=`git symbolic-ref --short HEAD` -if [ "$RELEASE_TYPE" == "snapshot" ] && [ "$CURRENT_BRANCH" == "main" ]; then +NPM_TAG=canary +if [ "$RELEASE_TYPE" == "next" ] && [ "$CURRENT_BRANCH" == "main" ]; then NPM_TAG=next elif [ "$RELEASE_TYPE" == "release" ] && [ "$CURRENT_BRANCH" == "main" ]; then # Releases off the main branch are for older majors. # Don't want to bump the latest tag for those - NPM_TAG=latest fi +# NPM Publishing echo "Publishing NPM Packages using tag: ${NPM_TAG} from release type: ${RELEASE_TYPE} on branch: ${CURRENT_BRANCH}" +readonly PKG_NPM_LABELS=`bazel query --output=label 'kind("npm_package rule", //...) - attr("tags", "\[.*do-not-publish.*\]", //...)'` for pkg in $PKG_NPM_LABELS ; do bazel run --config=release -- ${pkg}.publish --access public --tag ${NPM_TAG} @@ -27,24 +28,30 @@ done # Rebuild to stamp the release podspec bazel build --config=release //:PlayerUI_Podspec //:PlayerUI_Pod - bazel run --config=release //:ios_publish # Maven Central publishing -bazel run @rules_player//distribution:staged-maven-deploy -- "$RELEASE_TYPE" --package-group=com.intuit.playerui --legacy --client-timeout=600 --connect-timeout=600 +MVN_RELEASE_TYPE=snapshot +if [ "$RELEASE_TYPE" == "next" ] && [ "$CURRENT_BRANCH" == "main" ]; then + MVN_RELEASE_TYPE=release +elif [ "$RELEASE_TYPE" == "release" ] && [ "$CURRENT_BRANCH" == "main" ]; then + MVN_RELEASE_TYPE=release +fi + +echo "Publishing Maven Packages with release type: ${MVN_RELEASE_TYPE} on branch: ${CURRENT_BRANCH}" +bazel run @rules_player//distribution:staged-maven-deploy -- "$MVN_RELEASE_TYPE" --package-group=com.intuit.playerui --legacy --client-timeout=600 --connect-timeout=600 # Running this here because it will still have the pre-release version in the VERSION file before auto cleans it up # Make sure to re-stamp the outputs with the BASE_PATH so nextjs knows what to do with links -# Commented out as it needs to be re-written -if [ "$RELEASE_TYPE" == "snapshot" ] && [ "$CURRENT_BRANCH" == "main" ]; then +# Docs publishing +echo "Publishing Docs with release type: ${RELEASE_TYPE} on branch: ${CURRENT_BRANCH}" +if [ "$RELEASE_TYPE" == "next" ] && [ "$CURRENT_BRANCH" == "main" ]; then STABLE_DOCS_BASE_PATH=next bazel run --verbose_failures --config=release //docs:gh_deploy -- --dest_dir next elif [ "$RELEASE_TYPE" == "release" ] && [ "$CURRENT_BRANCH" == "main" ]; then STABLE_DOCS_BASE_PATH=latest bazel run --verbose_failures --config=release //docs:gh_deploy -- --dest_dir latest fi -# Commented out for now due to failures to deploy -# causes lots of "java.io.IOException: io.grpc.StatusRuntimeException: CANCELLED: Failed to read message." messages in the build # Also deploy to the versioned folder for main releases if [ "$RELEASE_TYPE" == "release" ]; then SEMVER_MAJOR=$(cat VERSION | cut -d. -f1) From 02e771e671bfe61494027ad3c5a6aa003b5931cc Mon Sep 17 00:00:00 2001 From: marky ercillo Date: Sat, 3 Aug 2024 18:06:31 -0700 Subject: [PATCH 2/3] added homepage to package.json, swapped createrBrowserRouter with createHashRouter --- docs/site/components/App.tsx | 4 ++-- docs/site/package.json | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/site/components/App.tsx b/docs/site/components/App.tsx index 6e1a1e18b..9835e8ec8 100644 --- a/docs/site/components/App.tsx +++ b/docs/site/components/App.tsx @@ -1,12 +1,12 @@ import React from "react"; import { createRoot } from "react-dom/client"; -import { createBrowserRouter, RouterProvider } from "react-router-dom"; +import { RouterProvider, createHashRouter } from "react-router-dom"; import { ChakraProvider } from "@chakra-ui/react"; import { PATH_TO_NAV } from "../config/navigation"; import { Context } from "./Context"; -const router = createBrowserRouter([ +const router = createHashRouter([ { path: "/", Component: React.lazy(() => import("../pages")), diff --git a/docs/site/package.json b/docs/site/package.json index 704e3087f..474e32592 100644 --- a/docs/site/package.json +++ b/docs/site/package.json @@ -1,6 +1,7 @@ { "name": "@player-ui/docs", "private": true, + "homepage": "https://player-ui.github.io", "type": "module", "dependencies": { "@player-ui/react": "workspace:*", From d3a13361e131fb09b526af5aa29e72df331d63d2 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Sat, 3 Aug 2024 18:11:08 -0700 Subject: [PATCH 3/3] Add dsl plugins page --- docs/site/config/navigation.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/site/config/navigation.ts b/docs/site/config/navigation.ts index 691f7d694..97837d1e5 100644 --- a/docs/site/config/navigation.ts +++ b/docs/site/config/navigation.ts @@ -102,6 +102,10 @@ const navigation: Navigation = { title: 'Schema', path: '/dsl/schema', }, + { + title: 'Plugins', + path: '/dsl/plugins', + }, ], }, {