@svayam-opensource/prj 0.5.5 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/prj +12 -2
- package/package.json +1 -1
- package/prj +8 -3
package/bin/prj
CHANGED
|
@@ -3,8 +3,18 @@
|
|
|
3
3
|
# Resolves the workspace (the governance repo) and execs the bundled `prj`.
|
|
4
4
|
# The CLI code ships in this package; org data lives in the workspace.
|
|
5
5
|
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
# Resolve this script's real path — npm installs `bin/prj` as a SYMLINK in the
|
|
7
|
+
# global bin dir, so BASH_SOURCE[0] is the symlink, not the package file. Follow
|
|
8
|
+
# the chain (portable: macOS BSD readlink + Linux) so PKG is the actual package
|
|
9
|
+
# dir, not the npm prefix.
|
|
10
|
+
src="${BASH_SOURCE[0]}"
|
|
11
|
+
while [[ -h "$src" ]]; do
|
|
12
|
+
dir="$(cd -P "$(dirname "$src")" && pwd)"
|
|
13
|
+
src="$(readlink "$src")"
|
|
14
|
+
[[ "$src" != /* ]] && src="$dir/$src"
|
|
15
|
+
done
|
|
16
|
+
HERE="$(cd -P "$(dirname "$src")" && pwd)"
|
|
17
|
+
PKG="$(cd "$HERE/.." && pwd)" # package root: <...>/node_modules/@svayam-opensource/prj
|
|
8
18
|
# Discover the workspace: explicit env, else nearest ancestor with org-config.yaml.
|
|
9
19
|
if [[ -z "${ADF_WORKSPACE:-}" ]]; then
|
|
10
20
|
d="$PWD"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svayam-opensource/prj",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Governed Agentic Development Framework CLI (prj). A bash CLI wrapped for npm; operates on a governance workspace resolved via $ADF_WORKSPACE or the nearest org-config.yaml. Runtime prerequisites (not npm deps): bash, git, gh, yq, python3 (use Git Bash on Windows).",
|
|
5
5
|
"bin": {
|
|
6
6
|
"prj": "bin/prj"
|
package/prj
CHANGED
|
@@ -1409,6 +1409,11 @@ cmd_upgrade() {
|
|
|
1409
1409
|
label "for review + commit."
|
|
1410
1410
|
echo ""
|
|
1411
1411
|
|
|
1412
|
+
# Operate on the WORKSPACE (the governance data repo), not the CLI package.
|
|
1413
|
+
# Under npm install, SCRIPT_DIR is the package dir; the workspace is resolved
|
|
1414
|
+
# via $ADF_WORKSPACE / org-config discovery into $WORKSPACE_ROOT.
|
|
1415
|
+
cd "$WORKSPACE_ROOT" || { err "Cannot cd to workspace: $WORKSPACE_ROOT"; exit 1; }
|
|
1416
|
+
|
|
1412
1417
|
# Pre-conditions
|
|
1413
1418
|
if [[ -n "$(git status --porcelain)" ]]; then
|
|
1414
1419
|
err "Working tree has uncommitted changes. Commit or stash first."
|
|
@@ -1441,15 +1446,15 @@ cmd_upgrade() {
|
|
|
1441
1446
|
git checkout "$target" -- framework/ \
|
|
1442
1447
|
|| { err "git checkout $target failed. Is the tag/branch published?"; exit 1; }
|
|
1443
1448
|
|
|
1444
|
-
if [[ ! -
|
|
1445
|
-
err "framework/
|
|
1449
|
+
if [[ ! -f "$WORKSPACE_ROOT/framework/bin/setup.sh" ]]; then
|
|
1450
|
+
err "framework/bin/setup.sh not found after checkout. Aborting."
|
|
1446
1451
|
exit 1
|
|
1447
1452
|
fi
|
|
1448
1453
|
|
|
1449
1454
|
echo ""
|
|
1450
1455
|
label "Running framework/bin/setup.sh..."
|
|
1451
1456
|
echo ""
|
|
1452
|
-
bash "$
|
|
1457
|
+
bash "$WORKSPACE_ROOT/framework/bin/setup.sh"
|
|
1453
1458
|
echo ""
|
|
1454
1459
|
|
|
1455
1460
|
divider
|