chore(cidi) - Converted to Githut Actions - Removed Circleci

This commit is contained in:
james.maes committed 2025-09-01 07:03:46 -05:00
1 parent 34235a29f0
commit 502220cf2d
10 files changed
+482 -828

No files matched your search

-181
View File
@@ -1,181 +0,0 @@
#!/bin/bash
############################################################################
## calculate-version.sh
## Intelligent version calculation for GitFlow branching strategy
##
## This script determines the appropriate version based on:
## - Current branch name
## - Current version in pom.xml
## - GitFlow conventions
##
## Usage: ./calculate-version.sh [--dry-run]
## Output: Sets version in pom.xml and prints the new version
############################################################################
set -e
# Configuration
POM_FILE="pom.xml"
DRY_RUN=false
# Parse command line arguments
if [[ "$1" == "--dry-run" ]]; then
DRY_RUN=true
echo "DRY RUN MODE - No changes will be made"
fi
# Get current branch and version
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
CURRENT_VERSION=$(grep '<revision>' $POM_FILE | sed 's/.*<revision>//;s/<.*//')
echo "Current branch: $CURRENT_BRANCH"
echo "Current version: $CURRENT_VERSION"
# Function to extract version components
extract_version_parts() {
local version=$1
# Handle RC versions like 1.5.0-RC.1
if [[ "$version" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)-RC\.[0-9]+$ ]]; then
MAJOR=${BASH_REMATCH[1]}
MINOR=${BASH_REMATCH[2]}
PATCH=${BASH_REMATCH[3]}
# Handle SNAPSHOT versions like 1.5.0-SNAPSHOT
elif [[ "$version" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)-SNAPSHOT$ ]]; then
MAJOR=${BASH_REMATCH[1]}
MINOR=${BASH_REMATCH[2]}
PATCH=${BASH_REMATCH[3]}
# Handle stable versions like 1.5.0
elif [[ "$version" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
MAJOR=${BASH_REMATCH[1]}
MINOR=${BASH_REMATCH[2]}
PATCH=${BASH_REMATCH[3]}
else
echo "ERROR: Cannot parse version format: $version"
exit 1
fi
}
# Function to calculate next version based on branch type
calculate_next_version() {
local branch=$1
case "$branch" in
"develop")
# Check if we just merged a release branch back to develop
# Look for very specific patterns that indicate a release completion
# Only look at recent commits to avoid historical merges triggering bumps
RECENT_RELEASE_MERGES=$(git log --oneline -10 --grep="Merge.*release.*into.*develop" --grep="Merge.*release.*back.*develop" --grep="Bump.*version.*after.*release.*v" --since="3 days ago" || true)
# Also check if current version suggests we're ready for next cycle
if [[ -n "$RECENT_RELEASE_MERGES" ]] || [[ "$CURRENT_VERSION" =~ -RC\.[0-9]+$ ]] || [[ "$CURRENT_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
# We just merged a release or have an RC/stable version, bump to next
NEW_VERSION="$MAJOR.$((MINOR + 1)).0-SNAPSHOT"
else
# Keep current SNAPSHOT version - no recent release activity
NEW_VERSION="$CURRENT_VERSION"
fi
;;
"main")
# Main should always have stable versions, no changes needed
NEW_VERSION="$CURRENT_VERSION"
;;
release/*)
# Extract major.minor from branch name (e.g., release/1.5 -> 1.5.0-RC.n)
if [[ "$branch" =~ release/([0-9]+)\.([0-9]+) ]]; then
BRANCH_MAJOR=${BASH_REMATCH[1]}
BRANCH_MINOR=${BASH_REMATCH[2]}
# Check if we already have an RC version
if [[ "$CURRENT_VERSION" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)-RC\.([0-9]+)$ ]]; then
# Extract current RC number and increment it
CURRENT_RC=${BASH_REMATCH[4]}
NEW_RC=$((CURRENT_RC + 1))
NEW_VERSION="$BRANCH_MAJOR.$BRANCH_MINOR.0-RC.$NEW_RC"
else
# First RC for this release
NEW_VERSION="$BRANCH_MAJOR.$BRANCH_MINOR.0-RC.1"
fi
else
echo "ERROR: Invalid release branch format: $branch"
exit 1
fi
;;
hotfix/*)
# Bump patch version for hotfix
NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
;;
feature/*|*)
# Feature branches inherit version from develop, no changes
NEW_VERSION="$CURRENT_VERSION"
;;
esac
}
# Function to set version using Maven
set_version() {
local new_version=$1
if [[ "$DRY_RUN" == "true" ]]; then
echo "DRY RUN: Would set version to: $new_version"
echo "Command: mvn versions:set-property -Dproperty=revision -DnewVersion=$new_version -DgenerateBackupPoms=false"
return
fi
echo "Setting version to: $new_version"
# Use Maven versions plugin to set version
mvn versions:set-property -Dproperty=revision -DnewVersion="$new_version" -DgenerateBackupPoms=false
# Verify the change
ACTUAL_VERSION=$(grep "<revision>" $POM_FILE | sed 's/.*<revision>//;s/<.*//')
if [[ "$ACTUAL_VERSION" == "$new_version" ]]; then
echo "✅ Version successfully updated to: $ACTUAL_VERSION"
else
echo "❌ Version update failed. Expected: $new_version, Got: $ACTUAL_VERSION"
exit 1
fi
}
# Main execution
main() {
echo "=== QQQ Version Calculator ==="
echo "Branch: $CURRENT_BRANCH"
echo "Current version: $CURRENT_VERSION"
echo ""
# Extract version components
extract_version_parts "$CURRENT_VERSION"
echo "Version components: MAJOR=$MAJOR, MINOR=$MINOR, PATCH=$PATCH"
echo ""
# Calculate next version
calculate_next_version "$CURRENT_BRANCH"
echo "Calculated next version: $NEW_VERSION"
echo ""
# Set the version if it's different
if [[ "$NEW_VERSION" != "$CURRENT_VERSION" ]]; then
echo "Version change detected: $CURRENT_VERSION → $NEW_VERSION"
set_version "$NEW_VERSION"
# Show git diff
echo ""
echo "Changes made:"
git diff $POM_FILE
else
echo "No version change needed. Current version is correct for branch: $CURRENT_BRANCH"
fi
echo ""
echo "=== Version calculation complete ==="
}
# Run main function
main "$@"
-535
View File
@@ -1,535 +0,0 @@
###############################################################################
##
## CircleCI Configuration for QQQ Frontend Core
## ===========================================
##
## This configuration implements a GitFlow-based CI/CD strategy for the frontend core library,
## following the same versioning and branching policies as the main QQQ project.
##
## 🚀 WORKFLOWS OVERVIEW:
## ----------------------
## 1. test_only - Feature branches (build, test, linting)
## 2. deploy_snapshot - develop branch (publishes -SNAPSHOT versions)
## 3. publish_rc - release/* branches (publishes -RC.n versions)
## 4. publish_release - main branch (publishes stable versions)
## 5. publish_hotfix - hotfix/* branches (publishes patch versions)
##
## 🌿 GITFLOW BRANCHING STRATEGY:
## ------------------------------
## - main: Production releases (X.Y.Z) → Public NPM registry
## - develop: Development snapshots (X.Y.Z-SNAPSHOT) → Public NPM registry
## - release/*: Release candidates (X.Y.0-RC.n) → Public NPM registry
## - hotfix/*: Hotfix releases (X.Y.(Z+1)) → Public NPM registry
## - feature/*: Feature development → Build and test only (no publishing)
##
## 🔄 VERSION MANAGEMENT:
## ---------------------
## - NPM versions: Automatically calculated using .circleci/sync-npm-version.sh
## - GitFlow versioning: RC increments, hotfix patches, develop bumps
## - Automatic version updates based on branch type
## - Direct publishing to public NPM registry (npmjs.org)
## - No GitHub releases - clean NPM-only publishing
##
## 🔐 AUTHENTICATION & SECURITY:
## -----------------------------
## - NPM Registry: NPM_TOKEN (from qqq-maven-registry-credentials context)
## - All packages published with public access to npmjs.org under @qrunio organization
## - Credentials stored securely in shared CircleCI context
## - Direct publishing to public registry for maximum visibility
##
## 🛠️ BUILD TOOLS & DEPENDENCIES:
## ------------------------------
## - circleci/node@4.7: Node.js runtime and package management
## - npm: Node.js package manager with TypeScript build tools
## - TypeScript: JavaScript compilation and type checking
## - Jest: Testing framework for JavaScript/TypeScript
## - ESLint: Code quality and linting
##
## 📁 KEY SCRIPTS & FILES:
## ------------------------
## - sync-npm-version.sh: NPM version management based on branch type
## - config.yml: This CircleCI configuration file
##
## 🎯 VERSION PATTERNS BY BRANCH:
## ------------------------------
## | Branch Type | Version Pattern | Example | Repository |
## |-------------|----------------|---------|------------|
## | main | X.Y.Z | 1.0.0 | Public NPM (@qrunio on npmjs.org) |
## | develop | X.Y.Z-SNAPSHOT | 1.0.127-SNAPSHOT | Public NPM (@qrunio on npmjs.org) |
## | release/* | X.Y.0-RC.n | 1.0.0-RC.1 | Public NPM (@qrunio on npmjs.org) |
## | hotfix/* | X.Y.(Z+1) | 1.0.1 | Public NPM (@qrunio on npmjs.org) |
## | feature/* | Inherits from develop | 1.0.127-SNAPSHOT | No publishing |
##
###############################################################################
version: 2.1
###############################################################################
## ORBS (Reusable CI Components)
## =============================
## circleci/node@4.7: Provides Node.js runtime, npm package management, and caching
###############################################################################
orbs:
node: circleci/node@4.7
###############################################################################
## COMMANDS (Reusable Step Collections)
## ===================================
## These commands define common operations that can be reused across multiple jobs
## to avoid duplication and ensure consistency.
###############################################################################
commands:
###############################################################################
## 🏗️ FRONTEND BUILD COMMAND
## ==========================
## Builds the frontend core library and sets up the complete development environment
##
## What it does:
## - Restores NPM dependency cache for faster builds
## - Installs Node.js dependencies (npm install)
## - Compiles TypeScript project (npm run prepublishOnly)
## - Saves NPM cache for future builds
##
## Cache Strategy:
## - NPM: Based on package.json checksum
## - Optimized for TypeScript compilation
## - Fast dependency resolution
###############################################################################
install_dependencies:
steps:
- checkout
# Install packages with NPM, using CircleCI's optimized caching
- node/install-packages:
pkg-manager: npm
cache-path: node_modules
# Build TypeScript project after dependencies are installed
- run:
name: "Build TypeScript project"
command: npm run prepublishOnly
###############################################################################
## 🧪 FRONTEND TEST COMMAND
## =========================
## Runs comprehensive testing for the frontend core library
##
## What it does:
## - Executes NPM tests with coverage (--coverage --passWithNoTests)
## - Runs ESLint for code quality and consistency
## - Collects and stores test artifacts for analysis
## - Stores coverage reports for quality metrics
##
## Test Coverage:
## - Jest: JavaScript/TypeScript unit tests
## - ESLint: Code quality and style validation
## - Coverage reports stored as CircleCI artifacts
###############################################################################
run_tests:
steps:
- run:
name: "Run tests"
command: npm test
- run:
name: "Run linting"
command: npm run lint
###############################################################################
## 🔄 VERSION MANAGEMENT COMMAND
## =============================
## Automated version management for GitFlow branching strategy
##
## What it does:
## - Determines appropriate version based on branch type and current version
## - Updates package.json version automatically using sync-npm-version.sh
## - Commits and pushes version changes back to the branch
## - Handles GitFlow versioning strategy automatically
## - Ensures version consistency across the project
##
## Version Strategy:
## - develop: Bumps to next patch version (X.Y.Z+1-SNAPSHOT)
## - release/*: Increments RC number (X.Y.0-RC.n)
## - hotfix/*: Bumps patch version (X.Y.Z+1)
## - feature/*: No version changes (inherits from develop)
###############################################################################
manage_version:
steps:
- add_ssh_keys # injects the CircleCI User Key (write-capable)
- run:
name: Set up Git identity for version commits
command: |
git config user.email "ci@kingsrook.com"
git config user.name "CircleCI"
- run:
name: "Synchronize NPM version"
command: .circleci/sync-npm-version.sh
- run:
name: Commit version changes if modified
command: |
if [[ -n "$(git status --porcelain package.json)" ]]; then
NEW_VERSION=$(grep '"version"' package.json | sed 's/.*"version": "//;s/".*//')
git add package.json
git commit -m "Bump version to $NEW_VERSION [skip ci]"
git push origin "HEAD:${CIRCLE_BRANCH}"
echo "Version updated to: $NEW_VERSION and pushed"
else
echo "No version change needed"
fi
###############################################################################
## 📦 BUILD AND PACKAGE COMMAND
## =============================
## Creates the distributable package and persists it for later jobs
##
## What it does:
## - Cleans previous builds and reinstalls dependencies
## - Compiles TypeScript to JavaScript
## - Creates distributable package structure
## - Persists build artifacts to workspace for use in publishing jobs
##
## Package Structure:
## - lib/: Compiled TypeScript output
## - package.json: Updated package manifest
## - README.md: Documentation
## - LICENSE: License file
###############################################################################
build_package:
steps:
- run:
name: "Clean and build"
command: npm run clean-and-install
# Persist build artifacts to workspace for use in publishing jobs
- persist_to_workspace:
root: .
paths:
- lib/ # Compiled TypeScript output
- package.json # Updated package manifest
- README.md # Documentation
- LICENSE # License file
###############################################################################
## 📦 NPM PUBLISHING COMMAND
## ==========================
## Publishes packages to the public NPM registry (npmjs.org)
##
## What it does:
## - Sets up NPM authentication for public registry
## - Verifies authentication by checking current user
## - Publishes package with public access
## - Ensures maximum visibility and accessibility
##
## Publishing Features:
## - Public access for all packages
## - Direct publishing to npmjs.org
## - No GitHub releases - clean NPM-only workflow
###############################################################################
publish_npm:
steps:
- run:
name: "Setup NPM authentication"
command: |
# Configure NPM authentication for public registry
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
# Verify authentication by checking current user
npm whoami
- run:
name: "Publish to NPM"
command: npm publish --access public
###############################################################################
## JOBS (Workflow Execution Units)
## ===============================
## Jobs define the actual work to be done in each workflow.
## Each job uses the Node.js executor for consistent environment.
###############################################################################
jobs:
###############################################################################
## 🏗️ BUILD JOB
## =============
## Basic build job that compiles the frontend core library
##
## Purpose: Compile and build the complete frontend core library
## Used by: test_only workflow for feature branches
##
## What it does:
## - Sets up development environment
## - Installs all dependencies (NPM)
## - Compiles TypeScript components
## - Manages dependency caching for performance
###############################################################################
build:
description: "Build and test the frontend core package"
docker:
- image: cimg/node:16.10 # Use CircleCI's optimized Node.js image
steps:
- install_dependencies # Install deps and build TypeScript
- run_tests # Run tests and linting
- build_package # Create distributable package
###############################################################################
## 🧪 TEST ONLY JOB
## =================
## Lightweight testing job for feature branches
##
## Purpose: Validate code quality and functionality without building package
## Used by: test_only workflow for feature branches
##
## What it does:
## - Installs dependencies and builds TypeScript
## - Runs tests and linting
## - No package creation or publishing
###############################################################################
test_only:
description: "Run tests without building package (for feature branches)"
docker:
- image: cimg/node:16.10
steps:
- install_dependencies # Install deps and build TypeScript
- run_tests # Run tests and linting only
###############################################################################
## 📦 SNAPSHOT DEPLOYMENT JOB
## ===========================
## Deploys snapshot versions to public NPM registry
##
## Purpose: Provide nightly builds for developers and QA testing
## Used by: deploy_snapshot workflow for develop branch
## Publishes: X.Y.Z-SNAPSHOT versions to public NPM registry
##
## What it does:
## - Builds the complete frontend core library
## - Manages versions (SNAPSHOT updates)
## - Runs comprehensive tests
## - Deploys to public NPM registry
## - Enables continuous integration and nightly builds
###############################################################################
deploy_snapshot:
description: "Deploy snapshot version to public NPM registry"
docker:
- image: cimg/node:16.10
steps:
- install_dependencies # Install deps and build TypeScript
- run_tests # Validate code quality
- manage_version # Update to SNAPSHOT version
- build_package # Create distributable package
- publish_npm # Publish to public NPM registry
###############################################################################
## 🧪 RELEASE CANDIDATE JOB
## =========================
## Publishes release candidate versions to public NPM registry
##
## Purpose: Provide RC builds for QA testing and stakeholder review
## Used by: publish_rc workflow for release/* branches
## Publishes: X.Y.0-RC.n versions to public NPM registry
##
## What it does:
## - Builds the complete frontend core library
## - Runs comprehensive tests for quality assurance
## - Manages versions (RC increments)
## - Deploys to public NPM registry
## - Prepares stable versions for production deployment
###############################################################################
publish_rc:
description: "Publish release candidate to public NPM registry"
docker:
- image: cimg/node:16.10
steps:
- install_dependencies # Install deps and build TypeScript
- run_tests # Validate code quality
- manage_version # Update to RC version
- build_package # Create distributable package
- publish_npm # Publish to public NPM registry
###############################################################################
## 🚀 PRODUCTION RELEASE JOB
## ==========================
## Publishes production releases to public NPM registry
##
## Purpose: Deploy stable versions to production
## Used by: publish_release workflow for main branch
## Publishes: X.Y.Z versions to public NPM registry
##
## What it does:
## - Builds the complete frontend core library
## - Manages versions (stable release)
## - Runs comprehensive tests for production validation
## - Deploys to public NPM registry
## - Enables production deployment
###############################################################################
publish_release:
description: "Publish release version to public NPM registry"
docker:
- image: cimg/node:16.10
steps:
- install_dependencies # Install deps and build TypeScript
- run_tests # Validate code quality
- manage_version # Update to release version
- build_package # Create distributable package
- publish_npm # Publish to public NPM registry
###############################################################################
## 🔥 HOTFIX RELEASE JOB
## ======================
## Publishes hotfix releases to public NPM registry
##
## Purpose: Deploy critical bug fixes and security patches
## Used by: publish_hotfix workflow for hotfix/* branches
## Publishes: X.Y.(Z+1) versions to public NPM registry
##
## What it does:
## - Builds the complete frontend core library
## - Manages versions (patch increment)
## - Runs comprehensive tests for hotfix validation
## - Deploys to public NPM registry
## - Enables urgent production fixes
###############################################################################
publish_hotfix:
description: "Publish hotfix version to public NPM registry"
docker:
- image: cimg/node:16.10
steps:
- install_dependencies # Install deps and build TypeScript
- run_tests # Validate code quality
- manage_version # Update to hotfix version
- build_package # Create distributable package
- publish_npm # Publish to public NPM registry
###############################################################################
## WORKFLOWS (CI/CD Pipeline Orchestration)
## =======================================
## Workflows define when and how jobs are executed based on branch patterns and triggers.
## Each workflow implements a specific part of the GitFlow branching strategy.
###############################################################################
workflows:
###############################################################################
## 🧪 TEST ONLY WORKFLOW
## =====================
## Runs on feature branches and other non-protected branches
##
## Purpose: Validate code quality and functionality before merging
## Triggers: Any push to branches NOT matching develop, main, release/*, hotfix/*
## Jobs: test_only (validation only)
##
## What it does:
## - Builds the frontend core library
## - Runs comprehensive tests
## - Generates coverage reports
## - No publishing - validation only
###############################################################################
test_only:
description: "Test workflow for feature branches and PRs"
triggers:
# Daily scheduled trigger for develop branch to ensure code quality
- schedule:
cron: "0 0 * * *" # Run daily at midnight UTC
filters:
branches:
only: develop
jobs:
- test_only:
context: [ qqq-maven-registry-credentials, build-qqq-sample-app ]
filters:
# Only run on feature branches, ignore main workflow branches
branches:
ignore: [main, develop, /release\/.*/, /hotfix\/.*/]
###############################################################################
## 📦 SNAPSHOT DEPLOYMENT WORKFLOW
## =================================
## Runs on develop branch to publish development snapshots
##
## Purpose: Provide nightly builds for developers and QA testing
## Triggers: Push to develop branch
## Publishes: X.Y.Z-SNAPSHOT versions to public NPM registry
## Jobs: deploy_snapshot (NPM publishing)
##
## What it does:
## - Builds and tests the frontend core library
## - Manages versions (SNAPSHOT updates)
## - Deploys to public NPM registry
## - Enables continuous integration and nightly builds
###############################################################################
deploy_snapshot:
description: "Deploy snapshot version to public NPM registry from develop branch"
jobs:
- deploy_snapshot:
context: [ qqq-maven-registry-credentials, build-qqq-sample-app ]
filters:
branches:
only: develop
###############################################################################
## 🧪 RELEASE CANDIDATE WORKFLOW
## =============================
## Runs on release/* branches to publish release candidates
##
## Purpose: Provide RC builds for QA testing and stakeholder review
## Triggers: Push to any branch matching release/* pattern
## Publishes: X.Y.0-RC.n versions to public NPM registry
## Jobs: publish_rc (build, test, RC artifact creation)
##
## What it does:
## - Builds and tests the frontend core library
## - Manages versions (RC increments)
## - Deploys to public NPM registry
## - Prepares stable versions for production
###############################################################################
publish_rc:
description: "Publish release candidate to public NPM registry from release branches"
jobs:
- publish_rc:
context: [ qqq-maven-registry-credentials, build-qqq-sample-app ]
filters:
branches:
only: /release\/.*/
###############################################################################
## 🚀 PRODUCTION RELEASE WORKFLOW
## ===============================
## Runs on main branch to publish production releases
##
## Purpose: Deploy stable versions to production
## Triggers: Push to main branch (typically after merging release branches)
## Publishes: X.Y.Z versions to public NPM registry
## Jobs: publish_release (build, test, NPM deploy)
##
## What it does:
## - Builds and tests the frontend core library
## - Manages versions (stable release)
## - Deploys to public NPM registry
## - Enables production deployment
###############################################################################
publish_release:
description: "Publish release version to public NPM registry from main branch"
jobs:
- publish_release:
context: [ qqq-maven-registry-credentials, build-qqq-sample-app ]
filters:
branches:
only: main
###############################################################################
## 🔥 HOTFIX RELEASE WORKFLOW
## ===========================
## Runs on hotfix/* branches to publish urgent production fixes
##
## Purpose: Deploy critical bug fixes and security patches
## Triggers: Push to any branch matching hotfix/* pattern
## Publishes: X.Y.(Z+1) versions to public NPM registry
## Jobs: publish_hotfix (build, test, NPM deploy)
##
## What it does:
## - Builds and tests the frontend core library
## - Manages versions (patch increment)
## - Deploys to public NPM registry
## - Enables urgent production fixes
###############################################################################
publish_hotfix:
description: "Publish hotfix version to public NPM registry from hotfix branches"
jobs:
- publish_hotfix:
context: [ qqq-maven-registry-credentials, build-qqq-sample-app ]
filters:
branches:
only: /hotfix\/.*/
-18
View File
@@ -1,18 +0,0 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<!-- Sonatype Central Portal credentials (for releases) -->
<server>
<id>central</id>
<username>${env.CENTRAL_USERNAME}</username>
<password>${env.CENTRAL_PASSWORD}</password>
</server>
<!-- Central Portal Snapshots credentials -->
<server>
<id>central-snapshots</id>
<username>${env.CENTRAL_USERNAME}</username>
<password>${env.CENTRAL_PASSWORD}</password>
</server>
</servers>
</settings>
-94
View File
@@ -1,94 +0,0 @@
#!/bin/bash
set -e
# NPM Version Synchronization Script for qqq-frontend-core
# This script updates package.json version based on the current GitFlow branch and versioning policy
PACKAGE_JSON="package.json"
DRY_RUN=false
if [[ "$1" == "--dry-run" ]]; then
DRY_RUN=true
echo "DRY RUN MODE - No changes will be made"
fi
# Get current branch
CURRENT_BRANCH=$(git branch --show-current)
echo "Current branch: $CURRENT_BRANCH"
# Get current NPM version
NPM_VERSION=$(grep '"version"' $PACKAGE_JSON | sed 's/.*"version": "//;s/".*//')
echo "Current NPM version: $NPM_VERSION"
# Determine target version based on GitFlow branch
if [[ "$CURRENT_BRANCH" == "main" ]]; then
# Main branch - should be a release version (e.g., 1.0.0)
# Extract major.minor from current version
MAJOR_MINOR=$(echo "$NPM_VERSION" | sed 's/\.[0-9]*$//')
TARGET_VERSION="$MAJOR_MINOR.0"
echo "Main branch detected - targeting release version: $TARGET_VERSION"
elif [[ "$CURRENT_BRANCH" == "develop" ]]; then
# Develop branch - should be a snapshot version (e.g., 1.0.127-SNAPSHOT)
# Increment patch version for develop
MAJOR_MINOR_PATCH=$(echo "$NPM_VERSION" | sed 's/-.*//')
MAJOR_MINOR=$(echo "$MAJOR_MINOR_PATCH" | sed 's/\.[0-9]*$//')
PATCH=$(echo "$MAJOR_MINOR_PATCH" | sed 's/.*\.//')
NEW_PATCH=$((PATCH + 1))
TARGET_VERSION="$MAJOR_MINOR.$NEW_PATCH-SNAPSHOT"
echo "Develop branch detected - targeting snapshot version: $TARGET_VERSION"
elif [[ "$CURRENT_BRANCH" == release/* ]]; then
# Release branch - should be a release candidate (e.g., 1.0.0-RC.1)
RELEASE_VERSION=$(echo "$CURRENT_BRANCH" | sed 's/release\///')
TARGET_VERSION="$RELEASE_VERSION-RC.1"
echo "Release branch detected - targeting RC version: $TARGET_VERSION"
elif [[ "$CURRENT_BRANCH" == hotfix/* ]]; then
# Hotfix branch - should be a patch version (e.g., 1.0.1)
HOTFIX_VERSION=$(echo "$CURRENT_BRANCH" | sed 's/hotfix\///')
TARGET_VERSION="$HOTFIX_VERSION"
echo "Hotfix branch detected - targeting patch version: $TARGET_VERSION"
else
# Feature branch - should be a snapshot version
MAJOR_MINOR_PATCH=$(echo "$NPM_VERSION" | sed 's/-.*//')
MAJOR_MINOR=$(echo "$MAJOR_MINOR_PATCH" | sed 's/\.[0-9]*$//')
PATCH=$(echo "$MAJOR_MINOR_PATCH" | sed 's/.*\.//')
NEW_PATCH=$((PATCH + 1))
TARGET_VERSION="$MAJOR_MINOR.$NEW_PATCH-SNAPSHOT"
echo "Feature branch detected - targeting snapshot version: $TARGET_VERSION"
fi
echo "Target version: $TARGET_VERSION"
if [[ "$NPM_VERSION" == "$TARGET_VERSION" ]]; then
echo "✅ Versions are already synchronized"
exit 0
fi
if [[ "$DRY_RUN" == "true" ]]; then
echo "DRY RUN: Would update package.json version from '$NPM_VERSION' to '$TARGET_VERSION'"
echo "Command: sed -i 's/\"version\": \"$NPM_VERSION\"/\"version\": \"$TARGET_VERSION\"/' $PACKAGE_JSON"
exit 0
fi
echo "Updating package.json version from '$NPM_VERSION' to '$TARGET_VERSION'"
# Update version in package.json (macOS compatible)
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/\"version\": \"$NPM_VERSION\"/\"version\": \"$TARGET_VERSION\"/" $PACKAGE_JSON
else
sed -i "s/\"version\": \"$NPM_VERSION\"/\"version\": \"$TARGET_VERSION\"/" $PACKAGE_JSON
fi
# Verify the update
ACTUAL_NPM_VERSION=$(grep '"version"' $PACKAGE_JSON | sed 's/.*"version": "//;s/".*//')
if [[ "$ACTUAL_NPM_VERSION" == "$TARGET_VERSION" ]]; then
echo "✅ NPM version successfully updated to: $ACTUAL_NPM_VERSION"
else
echo "❌ NPM version update failed. Expected: $TARGET_VERSION, Got: $ACTUAL_NPM_VERSION"
exit 1
fi
echo ""
echo "=== NPM version synchronization complete ==="
echo "Previous: $NPM_VERSION"
echo "Current: $ACTUAL_NPM_VERSION"
echo "Branch: $CURRENT_BRANCH"
+128
View File
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
contact@kingsrook.com. All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
---
**Note**: This repository is a frontend core library of the QQQ framework.
For the complete community guidelines and enforcement, see the main QQQ repository:
https://github.com/Kingsrook/qqq
+168
View File
@@ -0,0 +1,168 @@
# Contributing to QQQ Frontend Core
Thank you for your interest in contributing to the QQQ Frontend Core! This repository contains the **core frontend components and utilities** that form the foundation of the QQQ framework's user interface.
## 🎯 What This Repository Is
This repository is a **core frontend library** of the QQQ framework that provides:
- Reusable React components and hooks
- Core UI utilities and helpers
- Shared TypeScript types and interfaces
- Common styling and theming utilities
- Frontend state management utilities
- Authentication and routing utilities
## 🚫 What This Repository Is NOT
This repository does NOT contain:
- The QQQ server or backend
- Core framework functionality
- Business logic or process engine
- Database operations or API endpoints
## 🔄 Contribution Types
### ✅ Frontend Core Changes (This Repository)
- **Core component library** improvements
- **New reusable React components** and hooks
- **TypeScript type definitions** and interfaces
- **Utility functions** and helpers
- **Core styling and theming** updates
- **Frontend performance** optimizations
- **Client-side bug fixes** in core utilities
- **Documentation updates** for core frontend code
### ❌ Backend/Core Changes (Main QQQ Repository)
- **Server-side functionality**
- **Core framework features**
- **Database schema changes**
- **API endpoint modifications**
- **Business logic changes**
- **Process engine updates**
## 🚀 Getting Started
### Prerequisites
- **Node.js**: LTS version (18.x or higher)
- **npm**: 8.x or higher
- **Git**: For version control
- **QQQ Server**: Running instance for testing
### Development Setup
1. **Fork this repository**
2. **Clone your fork**
```bash
git clone https://github.com/YOUR_USERNAME/qqq-frontend-core.git
cd qqq-frontend-core
```
3. **Install dependencies**
```bash
npm install --legacy-peer-deps
```
4. **Create a feature branch**
```bash
git checkout -b feature/your-feature-name
```
## 📝 Development Guidelines
### Code Style
- **TypeScript**: Use strict typing
- **ESLint**: Follow the configured rules
- **Prettier**: Maintain consistent formatting
- **React**: Use functional components with hooks
- **Material-UI**: Follow MUI design patterns
### Component Structure
```typescript
// Example component structure
import React from 'react';
import { Box, Typography } from '@mui/material';
interface Props {
title: string;
children: React.ReactNode;
}
export default function ExampleComponent({ title, children }: Props): JSX.Element {
return (
<Box>
<Typography variant="h6">{title}</Typography>
{children}
</Box>
);
}
```
### Testing
- **Unit tests**: Test individual components
- **Integration tests**: Test component interactions
- **Browser testing**: Test in multiple browsers
- **Responsive testing**: Test on different screen sizes
## 🔄 Pull Request Process
1. **Ensure your changes are frontend core library focused**
2. **Follow the existing code patterns**
3. **Add tests for new functionality**
4. **Update documentation if needed**
5. **Test thoroughly in the browser**
6. **Submit a pull request**
### PR Checklist
- [ ] Changes are frontend core library focused
- [ ] Code follows existing patterns
- [ ] Tests are included and passing
- [ ] Documentation is updated
- [ ] No breaking changes introduced
- [ ] Cross-browser compatibility verified
## 🚨 For Major Changes
If your contribution involves:
- **Core framework functionality**
- **Backend integration changes**
- **Major architectural decisions**
- **Breaking changes to the QQQ API**
Please submit to the **main QQQ repository** instead:
👉 **[https://github.com/Kingsrook/qqq](https://github.com/Kingsrook/qqq)**
## 🐛 Reporting Issues
**All issues should be reported to the main QQQ repository:**
👉 **[https://github.com/Kingsrook/qqq/issues](https://github.com/Kingsrook/qqq/issues)**
When reporting frontend-specific issues, include:
- Browser and version
- Operating system
- Steps to reproduce
- Screenshots if applicable
- Console errors
- QQQ server version
## 💬 Getting Help
- **Documentation**: [QQQ Wiki](https://github.com/Kingsrook/qqq.wiki)
- **Discussions**: [QQQ Discussions](https://github.com/Kingsrook/qqq/discussions)
- **Main Repository**: [https://github.com/Kingsrook/qqq](https://github.com/Kingsrook/qqq)
## 📄 License
By contributing to this project, you agree that your contributions will be licensed under the same license as the project (GNU Affero General Public License v3.0).
## 🙏 Thank You
Thank you for contributing to the QQQ Frontend Core! Your contributions help make the QQQ framework's core frontend library better for everyone.
---
**Remember**: This is a frontend core library. For complete QQQ functionality, use the main repository: https://github.com/Kingsrook/qqq
+24
View File
@@ -0,0 +1,24 @@
# These are supported funding model platforms
github: [Kingsrook]
# Patreon is also supported, but requires a custom URL
# patreon: Kingsrook
# Open Collective is also supported, but requires a custom URL
# open_collective: Kingsrook
# Ko-fi is also supported, but requires a custom URL
# ko_fi: Kingsrook
# Tidelift is also supported, but requires a custom URL
# tidelift: Kingsrook
# Community Bridge is also supported, but requires a custom URL
# community_bridge: Kingsrook
# Liberapay is also supported, but requires a custom URL
# liberapay: Kingsrook
# IssueHunt is also supported, but requires a custom URL
# issuehunt: Kingsrook
# Otechie is also supported, but requires a custom URL
# otechie: Kingsrook
# Custom URLs are also supported, but require a custom URL
# custom: https://kingsrook.com/support
# Note: This repository is a frontend core library of the QQQ framework.
# For main project funding and support, visit: https://github.com/Kingsrook/qqq
+37
View File
@@ -0,0 +1,37 @@
# ⚠️ Issues Should Go to Main QQQ Repository
This repository is a **frontend core library** of the QQQ framework. All issues, bug reports, feature requests, and support questions should be submitted to the **main QQQ repository**.
## 🎯 Where to Submit Issues
**Please submit your issue here instead:**
👉 **[https://github.com/Kingsrook/qqq/issues](https://github.com/Kingsrook/qqq/issues)**
## 🔍 Why This Repository Exists
This repository contains only the **core frontend library** that provides reusable components and utilities for QQQ applications. It does not contain:
- The QQQ server or backend
- Core framework functionality
- Business logic or process engine
- Database or API services
## 📋 What to Include in Your Issue
When submitting to the main QQQ repository, please include:
1. **Clear description** of the problem or feature request
2. **Steps to reproduce** (for bugs)
3. **Expected vs. actual behavior**
4. **Environment details** (OS, browser, QQQ version)
5. **Screenshots or logs** if applicable
6. **Frontend core library details** if the issue relates to components or utilities
## 🚀 Getting Help
- **Documentation**: [QQQ Wiki](https://github.com/Kingsrook/qqq.wiki)
- **Discussions**: [QQQ Discussions](https://github.com/Kingsrook/qqq/discussions)
- **Main Repository**: [https://github.com/Kingsrook/qqq](https://github.com/Kingsrook/qqq)
---
**Thank you for understanding! This helps us maintain a single source of truth for all QQQ-related issues.**
+84
View File
@@ -0,0 +1,84 @@
# 🎨 Frontend Core Library Pull Request
## 📝 Description
**What does this PR do?**
<!-- Describe your changes in detail -->
**What type of change is this?**
- [ ] Bug fix
- [ ] New feature
- [ ] Core component improvement
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Other (please describe)
**Does this PR introduce a breaking change?**
- [ ] Yes
- [ ] No
**If yes, please describe the breaking change:**
## 🧪 Testing
**How have you tested this PR?**
- [ ] Manual testing in browser
- [ ] Unit tests
- [ ] Integration tests
- [ ] Cross-browser testing
- [ ] Mobile responsiveness testing
**Test environment:**
- OS:
- Browser:
- QQQ version:
## 📸 Screenshots
<!-- If applicable, add screenshots to help explain your changes -->
## 🔗 Related Issues
<!-- Link to any related issues in the main QQQ repository -->
This repository contains the **core frontend library** for the QQQ framework. Please ensure your changes are appropriate for a frontend core library.
## 📋 Pull Request Checklist
- [ ] I have read the [contributing guidelines](https://github.com/Kingsrook/qqq.wiki)
- [ ] My changes are focused on frontend core library components only
- [ ] I have tested my changes in the browser
- [ ] My changes follow the existing code style and patterns
- [ ] I have updated documentation if necessary
- [ ] My changes do not break existing functionality
## Reminders
### 🎯 What This Repository Is
This repository contains:
- Reusable React components and hooks
- Core UI utilities and helpers
- Shared TypeScript types and interfaces
- Common styling and theming utilities
- Frontend state management utilities
- Authentication and routing utilities
### 🚫 What This Repository Is NOT
This repository does NOT contain:
- QQQ server or backend logic
- Core framework functionality
- Business logic or process engine
- Database operations or API endpoints
### 🔄 For Major Changes
If your changes involve:
- **Core framework functionality**
- **Backend integration changes**
- **Major architectural decisions**
- **Breaking changes to the QQQ API**
**Remember**: This is a frontend core library. For complete QQQ functionality, please consider submitting to the **main QQQ repository** instead:
👉 **[https://github.com/Kingsrook/qqq](https://github.com/Kingsrook/qqq)**
+41
View File
@@ -0,0 +1,41 @@
name: 'Frontend Core CI/CD Pipeline'
on:
push:
branches: [ main, develop, 'release/*', 'hotfix/*', 'feature/*' ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
publish:
name: '🚀 Build, Test, and Publish Release (main, rc, hotfix, or snapshot)'
if: |
github.ref_name == 'main' ||
github.ref_name == 'develop' ||
startsWith(github.ref_name, 'release/') ||
startsWith(github.ref_name, 'hotfix/')
uses: Kingsrook/github-actions-library/.github/workflows/reusable-gitflow-publish.yml@release/0.1.0
with:
project-type: 'npm'
node-version: '18'
npm-args: '--legacy-peer-deps'
npm-working-directory: '.'
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
test:
name: '🧪 Build and Test Only'
if: |
!(
github.ref_name == 'main' ||
github.ref_name == 'develop' ||
startsWith(github.ref_name, 'release/') ||
startsWith(github.ref_name, 'hotfix/')
)
uses: Kingsrook/github-actions-library/.github/workflows/reusable-gitflow-test.yml@release/0.1.0
with:
project-type: 'npm'
node-version: '18'
npm-args: '--legacy-peer-deps'
npm-working-directory: '.'