From c02e8ad58a9ca59c45560dc47a8841e1fc7ef7d6 Mon Sep 17 00:00:00 2001 From: Ruk6787 Date: Mon, 8 Jun 2026 10:12:09 +0500 Subject: [PATCH] Updated package.json and Added branch protection workflow --- .github/workflows/branch-flow.yml | 78 +++++++++++++++++++++++++++++++ README.md | 1 + package-lock.json | 64 +++---------------------- package.json | 31 +++++++++--- 4 files changed, 109 insertions(+), 65 deletions(-) create mode 100644 .github/workflows/branch-flow.yml create mode 100644 README.md diff --git a/.github/workflows/branch-flow.yml b/.github/workflows/branch-flow.yml new file mode 100644 index 0000000..b14a211 --- /dev/null +++ b/.github/workflows/branch-flow.yml @@ -0,0 +1,78 @@ +name: "Branch Flow Protection" + +on: + pull_request: + +jobs: + enforce-branch-flow: + runs-on: ubuntu-latest + + steps: + - name: Validate PR branch flow + env: + SOURCE: ${{ github.head_ref }} + TARGET: ${{ github.base_ref }} + + run: | + echo "PR: $SOURCE -> $TARGET" + + case "$SOURCE" in + + # Block main going into lower branches + main) + echo "🚀 $SOURCE -❌-> 🎯 $TARGET" + echo " " + echo "❌ main cannot merge downward." + echo "⚠️ Error: Merging from main into '$TARGET' is prohibited." + exit 1 + ;; + + # Hotfix/* branches can only go into main + hotfix/*) + if [[ "$TARGET" != "main" ]]; then + echo "🚀 $SOURCE -❌-> 🎯 $TARGET" + echo " " + echo "❌ hotfix/* branches must target main." + echo "⚠️ Error: Merging from $SOURCE into '$TARGET' is prohibited." + exit 1 + fi + ;; + + # Develop branches can only go into main + develop) + if [["$TARGET" != "main" ]]; then + echo "🚀 $SOURCE -❌-> 🎯 $TARGET" + echo " " + echo "❌ develop branch must target main." + echo "⚠️ Error: Merging from $SOURCE into '$TARGET' is prohibited." + exit 1 + fi + ;; + + # Features/* branches can only go into develop + feature/*) + if [[ "$TARGET" != "develop" ]]; then + echo "🚀 $SOURCE -❌-> 🎯 $TARGET" + echo " " + echo "❌ feature/* branches must target develop." + echo "⚠️ Error: Merging from $SOURCE into '$TARGET' is prohibited." + exit 1 + fi + ;; + + # Bugfixes/* branches can only go into develop + bugfix/*) + if [[ "$TARGET" != "develop" ]]; then + echo "🚀 $SOURCE -❌-> 🎯 $TARGET" + echo " " + echo "❌ bugfix/* branches must target develop." + echo "⚠️ Error: Merging from $SOURCE into '$TARGET' is prohibited." + exit 1 + fi + ;; + + esac + + echo "✅ Branch flow is valid." + echo " " + echo "🚀 $SOURCE -✅-> 🎯 $TARGET" diff --git a/README.md b/README.md new file mode 100644 index 0000000..2492982 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Node Shapes \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3ec13e9..55e7c89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,41 +1,18 @@ { - "name": "shapes", - "version": "1.0.0", + "name": "node-shapes", + "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "shapes", - "version": "1.0.0", - "license": "ISC", + "name": "node-shapes", + "version": "0.0.1", + "license": "MIT", "devDependencies": { "typescript": "^6.0.3", "vite": "^8.0.16" } }, - "node_modules/@emnapi/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", - "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/wasi-threads": "1.2.1", - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/runtime": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", - "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/@emnapi/wasi-threads": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", @@ -169,9 +146,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -189,9 +163,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -209,9 +180,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -229,9 +197,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -249,9 +214,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -269,9 +231,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -555,9 +514,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -579,9 +535,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -603,9 +556,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -627,9 +577,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -717,6 +664,7 @@ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, diff --git a/package.json b/package.json index 8f1e016..f99e3cb 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,34 @@ { - "name": "shapes", - "version": "1.0.0", - "description": "", + "name": "node-shapes", + "version": "0.0.1", + "description": "A JavaScript library for creating diagrams and flowcharts, with JSON export support.", "main": "index.js", + "license": "MIT", + "private": false, + "type": "commonjs", "scripts": { "dev": "vite", "build": "vite build", "test": "echo \"Error: no test specified\" && exit 1" }, - "keywords": [], - "author": "", - "license": "ISC", - "type": "commonjs", + "keywords": [ + "diagram", + "flowchart", + "shapes", + "nodes", + "javascript", + "visualization", + "json" + ], + "author": "Muhammad Rukban Ali Yousaf", + "repository": { + "type": "git", + "url": "git+https://github.com/QBitFoundry/node-shapes.git" + }, + "bugs": { + "url": "https://github.com/QBitFoundry/node-shapes/issues" + }, + "homepage": "https://github.com/QBitFoundry/node-shapes#readme", "devDependencies": { "typescript": "^6.0.3", "vite": "^8.0.16"