Skip to content

Practical patterns, starters & CLI tools for loop engineering with AI coding agents. Design systems that prompt and orchestrate agents (inspired by Addy Osmani and Boris Cherny). Includes loop-audit, loop-init, loop-cost.

fix(ci): install monorepo loop-audit for loop-init tests

Cobus Greyling6daea480baf0
diff --git a/.github/workflows/release-loop-init.yml b/.github/workflows/release-loop-init.yml
index d59f4d2..e614e7f 100644
--- a/.github/workflows/release-loop-init.yml
+++ b/.github/workflows/release-loop-init.yml
@@ -34,8 +34,22 @@ jobs:
- name: Test, build & publish
working-directory: tools/loop-init
run: |
- npm ci
+ # Build monorepo sibling first — declared ^range may not be on npm yet
+ # when cutting audit + init in the same release window.
+ (cd ../loop-audit && npm ci && npm run build)
+ cp package.json package.json.release-bak
+ cp package-lock.json package-lock.json.release-bak
+ node -e "
+ const fs = require('fs');
+ const p = JSON.parse(fs.readFileSync('package.json', 'utf8'));
+ p.dependencies['@cobusgreyling/loop-audit'] = 'file:../loop-audit';
+ fs.writeFileSync('package.json', JSON.stringify(p, null, 2) + '\n');
+ "
+ npm install
+ mv package.json.release-bak package.json
+ mv package-lock.json.release-bak package-lock.json
npm test
+ # package.json keeps registry range (^1.x) for the published tarball
npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
\ No newline at end of file
diff --git a/scripts/ci-validate-gates.sh b/scripts/ci-validate-gates.sh
index 5f49346..b3f5fd2 100755
--- a/scripts/ci-validate-gates.sh
+++ b/scripts/ci-validate-gates.sh
@@ -30,12 +30,38 @@ npm install --no-save yaml@2 ajv@8
node scripts/validate-registry.mjs
node scripts/check-loop-init-sync.mjs
-cd tools/loop-init
-npm ci
-npm test
+# loop-init depends on loop-audit; build sibling first and install from monorepo
+# so CI works before a new audit range is published to npm (chicken-and-egg).
+echo "Building and testing loop-audit…"
+(
+ cd tools/loop-audit
+ npm ci
+ npm test
+)
+
+echo "Building and testing loop-init…"
+(
+ cd tools/loop-init
+ # Always install monorepo sibling so CI/publish order does not require npm
+ # to already have the new loop-audit version (chicken-and-egg with ^1.7.0).
+ echo "Installing monorepo loop-audit sibling for loop-init"
+ cp package.json package.json.ci-bak
+ cp package-lock.json package-lock.json.ci-bak
+ node -e "
+ const fs = require('fs');
+ const p = JSON.parse(fs.readFileSync('package.json', 'utf8'));
+ p.dependencies['@cobusgreyling/loop-audit'] = 'file:../loop-audit';
+ fs.writeFileSync('package.json', JSON.stringify(p, null, 2) + '\n');
+ "
+ npm install
+ # Restore published package metadata (do not leave file: deps in package.json)
+ mv package.json.ci-bak package.json
+ mv package-lock.json.ci-bak package-lock.json
+ npm test
+)
echo "Building and testing loop-sync…"
-cd ../loop-sync
+cd tools/loop-sync
npm ci
npm test