@codyswann/lisa 4.107.4 → 4.107.5
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/all/copy-overwrite/scripts/lisa-hooks/block-managed-file-edits.sh +84 -0
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +4 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +7 -5
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/opencode/plugin-templates/block-managed-file-edits.sh +84 -0
- package/npm-package/create-only/.github/workflows/publish-to-npm.yml +2 -2
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/hooks/block-managed-file-edits.sh +84 -0
- package/plugins/lisa-agy/hooks/block-managed-file-edits.sh +84 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/hooks/block-managed-file-edits.sh +84 -0
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/hooks/block-managed-file-edits.sh +84 -0
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/hooks/block-managed-file-edits.sh +84 -0
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/hooks/block-managed-file-edits.sh +84 -0
- package/scripts/update-node-version.ts +16 -2
- package/typescript/copy-overwrite/.github/GITHUB_ACTIONS.md +2 -2
|
@@ -280,6 +280,86 @@ relative_path() {
|
|
|
280
280
|
printf '%s' "${rel#./}"
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
+
# The host's dependency and devDependency names, one per line, read at most
|
|
284
|
+
# once per classification. `managed_source` runs inside `$(...)`, so the cache
|
|
285
|
+
# lives only as long as that subshell — one classification, not one hook run.
|
|
286
|
+
# Unreadable or malformed `package.json` yields nothing, which makes every
|
|
287
|
+
# dependency-keyed stack below read as absent — an allow, the safe direction.
|
|
288
|
+
#
|
|
289
|
+
# Loaded into a global rather than echoed, so callers match with a here-string
|
|
290
|
+
# and no pipeline: under `pipefail` a `grep -q` that stops reading early can
|
|
291
|
+
# fail the writer with SIGPIPE and turn a match into a miss.
|
|
292
|
+
host_dependency_names=""
|
|
293
|
+
host_dependency_names_pending=1
|
|
294
|
+
load_host_dependency_names() {
|
|
295
|
+
[ "$host_dependency_names_pending" -eq 1 ] || return 0
|
|
296
|
+
host_dependency_names="$(jq -r \
|
|
297
|
+
'[(.dependencies // {}), (.devDependencies // {})] | add | keys[]' \
|
|
298
|
+
"$project_root/package.json" 2>/dev/null || true)"
|
|
299
|
+
host_dependency_names_pending=0
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
# Exact dependency name, or with `prefix` as the second argument, any name
|
|
303
|
+
# starting with it (the NestJS detector's `@nestjs` test).
|
|
304
|
+
host_has_dependency() {
|
|
305
|
+
load_host_dependency_names
|
|
306
|
+
local name
|
|
307
|
+
while IFS= read -r name; do
|
|
308
|
+
case "$name" in
|
|
309
|
+
"$1") return 0 ;;
|
|
310
|
+
"$1"*) [ "${2:-}" = prefix ] && return 0 ;;
|
|
311
|
+
esac
|
|
312
|
+
done <<<"$host_dependency_names"
|
|
313
|
+
return 1
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
# Whether the host is the given stack, so that stack's templates reach it.
|
|
317
|
+
#
|
|
318
|
+
# THE SAME PATH CAN BELONG TO DIFFERENT OWNERS IN DIFFERENT STACKS.
|
|
319
|
+
# `.github/workflows/ci.yml` is create-only in typescript, nestjs, cdk, expo and
|
|
320
|
+
# rails — the host owns it after the first apply — but copy-overwrite in
|
|
321
|
+
# harper-fabric and phaser. Probing every stack's tree without asking which
|
|
322
|
+
# stacks this host is made a NestJS host's own ci.yml read as managed via the
|
|
323
|
+
# harper-fabric copy, and a project-owned one-line Node bump needed a human to
|
|
324
|
+
# run the override (CodySwannGT/lisa#4511).
|
|
325
|
+
#
|
|
326
|
+
# `lisa apply` copies a stack's templates only into a host that stack's
|
|
327
|
+
# detector recognises, so each arm mirrors `src/detection/detectors/<stack>.ts`.
|
|
328
|
+
# `all`, `typescript`, and any stack without an arm here keep the pre-existing
|
|
329
|
+
# answer — always managed — so this narrows only where a detector proves the
|
|
330
|
+
# stack absent. Where a shell mirror cannot be exact it errs toward allowing,
|
|
331
|
+
# the same direction `.lisaignore` handling above takes.
|
|
332
|
+
stack_reaches_host() {
|
|
333
|
+
local stack="$1"
|
|
334
|
+
case "$stack" in
|
|
335
|
+
harper-fabric)
|
|
336
|
+
local config="$project_root/harper-app/config.yaml"
|
|
337
|
+
[ -f "$config" ] && [ -e "$project_root/harper-app/schema.graphql" ] ||
|
|
338
|
+
return 1
|
|
339
|
+
{
|
|
340
|
+
grep -qF 'graphqlSchema:' "$config" &&
|
|
341
|
+
grep -qF 'jsResource:' "$config" &&
|
|
342
|
+
grep -qF 'static:' "$config"
|
|
343
|
+
} || host_has_dependency harperdb
|
|
344
|
+
;;
|
|
345
|
+
phaser) host_has_dependency phaser ;;
|
|
346
|
+
nestjs)
|
|
347
|
+
[ -e "$project_root/nest-cli.json" ] ||
|
|
348
|
+
host_has_dependency @nestjs prefix
|
|
349
|
+
;;
|
|
350
|
+
expo)
|
|
351
|
+
[ -e "$project_root/app.json" ] || [ -e "$project_root/eas.json" ] ||
|
|
352
|
+
host_has_dependency expo
|
|
353
|
+
;;
|
|
354
|
+
cdk) [ -e "$project_root/cdk.json" ] ;;
|
|
355
|
+
rails)
|
|
356
|
+
[ -e "$project_root/bin/rails" ] ||
|
|
357
|
+
[ -e "$project_root/config/application.rb" ]
|
|
358
|
+
;;
|
|
359
|
+
*) return 0 ;;
|
|
360
|
+
esac
|
|
361
|
+
}
|
|
362
|
+
|
|
283
363
|
# Whether a host-relative path is shipped as a copy-overwrite template.
|
|
284
364
|
#
|
|
285
365
|
# A few stat calls rather than an enumeration: the same relative path is probed
|
|
@@ -299,6 +379,10 @@ managed_source() {
|
|
|
299
379
|
for stack in "$package_root"/*/copy-overwrite; do
|
|
300
380
|
[ -d "$stack" ] || continue
|
|
301
381
|
if [ -e "$stack/$rel" ]; then
|
|
382
|
+
# Another stack's copy-overwrite twin is not this host's file. Keep
|
|
383
|
+
# looking: a stack this host IS may still manage the same path.
|
|
384
|
+
local stack_name="${stack%/copy-overwrite}"
|
|
385
|
+
stack_reaches_host "${stack_name##*/}" || continue
|
|
302
386
|
printf '%s' "${stack#"$package_root"/}/$rel"
|
|
303
387
|
return 0
|
|
304
388
|
fi
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# with:
|
|
13
13
|
# tag: ${{ needs.release.outputs.tag }}
|
|
14
14
|
# version: ${{ needs.release.outputs.version }}
|
|
15
|
-
# node_version: '
|
|
15
|
+
# node_version: '24.21.0'
|
|
16
16
|
# package_manager: 'bun'
|
|
17
17
|
|
|
18
18
|
name: Publish to npm
|
|
@@ -31,7 +31,7 @@ on:
|
|
|
31
31
|
node_version:
|
|
32
32
|
description: 'Node.js version to use'
|
|
33
33
|
required: false
|
|
34
|
-
default: '
|
|
34
|
+
default: '24.21.0'
|
|
35
35
|
type: string
|
|
36
36
|
package_manager:
|
|
37
37
|
description: 'Package manager to use (npm, yarn, or bun)'
|
package/package.json
CHANGED
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
"qs": "^6.16.0"
|
|
189
189
|
},
|
|
190
190
|
"name": "@codyswann/lisa",
|
|
191
|
-
"version": "4.107.
|
|
191
|
+
"version": "4.107.5",
|
|
192
192
|
"description": "Governance-as-code for AI coding agents: turns a repository into agent-operated software factories with guardrails, guidance and automated enforcement for Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot and Devin",
|
|
193
193
|
"main": "dist/index.js",
|
|
194
194
|
"exports": {
|
|
@@ -351,7 +351,7 @@
|
|
|
351
351
|
"test": "tests"
|
|
352
352
|
},
|
|
353
353
|
"types": "./dist/index.d.ts",
|
|
354
|
-
"lisaReleaseCommit": "
|
|
355
|
-
"gitHead": "
|
|
356
|
-
"lisaReleaseTag": "v4.107.
|
|
354
|
+
"lisaReleaseCommit": "d14bf8be069e2b6216c49ad1b28df38c9ed18ea4",
|
|
355
|
+
"gitHead": "d14bf8be069e2b6216c49ad1b28df38c9ed18ea4",
|
|
356
|
+
"lisaReleaseTag": "v4.107.5"
|
|
357
357
|
}
|
|
@@ -280,6 +280,86 @@ relative_path() {
|
|
|
280
280
|
printf '%s' "${rel#./}"
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
+
# The host's dependency and devDependency names, one per line, read at most
|
|
284
|
+
# once per classification. `managed_source` runs inside `$(...)`, so the cache
|
|
285
|
+
# lives only as long as that subshell — one classification, not one hook run.
|
|
286
|
+
# Unreadable or malformed `package.json` yields nothing, which makes every
|
|
287
|
+
# dependency-keyed stack below read as absent — an allow, the safe direction.
|
|
288
|
+
#
|
|
289
|
+
# Loaded into a global rather than echoed, so callers match with a here-string
|
|
290
|
+
# and no pipeline: under `pipefail` a `grep -q` that stops reading early can
|
|
291
|
+
# fail the writer with SIGPIPE and turn a match into a miss.
|
|
292
|
+
host_dependency_names=""
|
|
293
|
+
host_dependency_names_pending=1
|
|
294
|
+
load_host_dependency_names() {
|
|
295
|
+
[ "$host_dependency_names_pending" -eq 1 ] || return 0
|
|
296
|
+
host_dependency_names="$(jq -r \
|
|
297
|
+
'[(.dependencies // {}), (.devDependencies // {})] | add | keys[]' \
|
|
298
|
+
"$project_root/package.json" 2>/dev/null || true)"
|
|
299
|
+
host_dependency_names_pending=0
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
# Exact dependency name, or with `prefix` as the second argument, any name
|
|
303
|
+
# starting with it (the NestJS detector's `@nestjs` test).
|
|
304
|
+
host_has_dependency() {
|
|
305
|
+
load_host_dependency_names
|
|
306
|
+
local name
|
|
307
|
+
while IFS= read -r name; do
|
|
308
|
+
case "$name" in
|
|
309
|
+
"$1") return 0 ;;
|
|
310
|
+
"$1"*) [ "${2:-}" = prefix ] && return 0 ;;
|
|
311
|
+
esac
|
|
312
|
+
done <<<"$host_dependency_names"
|
|
313
|
+
return 1
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
# Whether the host is the given stack, so that stack's templates reach it.
|
|
317
|
+
#
|
|
318
|
+
# THE SAME PATH CAN BELONG TO DIFFERENT OWNERS IN DIFFERENT STACKS.
|
|
319
|
+
# `.github/workflows/ci.yml` is create-only in typescript, nestjs, cdk, expo and
|
|
320
|
+
# rails — the host owns it after the first apply — but copy-overwrite in
|
|
321
|
+
# harper-fabric and phaser. Probing every stack's tree without asking which
|
|
322
|
+
# stacks this host is made a NestJS host's own ci.yml read as managed via the
|
|
323
|
+
# harper-fabric copy, and a project-owned one-line Node bump needed a human to
|
|
324
|
+
# run the override (CodySwannGT/lisa#4511).
|
|
325
|
+
#
|
|
326
|
+
# `lisa apply` copies a stack's templates only into a host that stack's
|
|
327
|
+
# detector recognises, so each arm mirrors `src/detection/detectors/<stack>.ts`.
|
|
328
|
+
# `all`, `typescript`, and any stack without an arm here keep the pre-existing
|
|
329
|
+
# answer — always managed — so this narrows only where a detector proves the
|
|
330
|
+
# stack absent. Where a shell mirror cannot be exact it errs toward allowing,
|
|
331
|
+
# the same direction `.lisaignore` handling above takes.
|
|
332
|
+
stack_reaches_host() {
|
|
333
|
+
local stack="$1"
|
|
334
|
+
case "$stack" in
|
|
335
|
+
harper-fabric)
|
|
336
|
+
local config="$project_root/harper-app/config.yaml"
|
|
337
|
+
[ -f "$config" ] && [ -e "$project_root/harper-app/schema.graphql" ] ||
|
|
338
|
+
return 1
|
|
339
|
+
{
|
|
340
|
+
grep -qF 'graphqlSchema:' "$config" &&
|
|
341
|
+
grep -qF 'jsResource:' "$config" &&
|
|
342
|
+
grep -qF 'static:' "$config"
|
|
343
|
+
} || host_has_dependency harperdb
|
|
344
|
+
;;
|
|
345
|
+
phaser) host_has_dependency phaser ;;
|
|
346
|
+
nestjs)
|
|
347
|
+
[ -e "$project_root/nest-cli.json" ] ||
|
|
348
|
+
host_has_dependency @nestjs prefix
|
|
349
|
+
;;
|
|
350
|
+
expo)
|
|
351
|
+
[ -e "$project_root/app.json" ] || [ -e "$project_root/eas.json" ] ||
|
|
352
|
+
host_has_dependency expo
|
|
353
|
+
;;
|
|
354
|
+
cdk) [ -e "$project_root/cdk.json" ] ;;
|
|
355
|
+
rails)
|
|
356
|
+
[ -e "$project_root/bin/rails" ] ||
|
|
357
|
+
[ -e "$project_root/config/application.rb" ]
|
|
358
|
+
;;
|
|
359
|
+
*) return 0 ;;
|
|
360
|
+
esac
|
|
361
|
+
}
|
|
362
|
+
|
|
283
363
|
# Whether a host-relative path is shipped as a copy-overwrite template.
|
|
284
364
|
#
|
|
285
365
|
# A few stat calls rather than an enumeration: the same relative path is probed
|
|
@@ -299,6 +379,10 @@ managed_source() {
|
|
|
299
379
|
for stack in "$package_root"/*/copy-overwrite; do
|
|
300
380
|
[ -d "$stack" ] || continue
|
|
301
381
|
if [ -e "$stack/$rel" ]; then
|
|
382
|
+
# Another stack's copy-overwrite twin is not this host's file. Keep
|
|
383
|
+
# looking: a stack this host IS may still manage the same path.
|
|
384
|
+
local stack_name="${stack%/copy-overwrite}"
|
|
385
|
+
stack_reaches_host "${stack_name##*/}" || continue
|
|
302
386
|
printf '%s' "${stack#"$package_root"/}/$rel"
|
|
303
387
|
return 0
|
|
304
388
|
fi
|
|
@@ -280,6 +280,86 @@ relative_path() {
|
|
|
280
280
|
printf '%s' "${rel#./}"
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
+
# The host's dependency and devDependency names, one per line, read at most
|
|
284
|
+
# once per classification. `managed_source` runs inside `$(...)`, so the cache
|
|
285
|
+
# lives only as long as that subshell — one classification, not one hook run.
|
|
286
|
+
# Unreadable or malformed `package.json` yields nothing, which makes every
|
|
287
|
+
# dependency-keyed stack below read as absent — an allow, the safe direction.
|
|
288
|
+
#
|
|
289
|
+
# Loaded into a global rather than echoed, so callers match with a here-string
|
|
290
|
+
# and no pipeline: under `pipefail` a `grep -q` that stops reading early can
|
|
291
|
+
# fail the writer with SIGPIPE and turn a match into a miss.
|
|
292
|
+
host_dependency_names=""
|
|
293
|
+
host_dependency_names_pending=1
|
|
294
|
+
load_host_dependency_names() {
|
|
295
|
+
[ "$host_dependency_names_pending" -eq 1 ] || return 0
|
|
296
|
+
host_dependency_names="$(jq -r \
|
|
297
|
+
'[(.dependencies // {}), (.devDependencies // {})] | add | keys[]' \
|
|
298
|
+
"$project_root/package.json" 2>/dev/null || true)"
|
|
299
|
+
host_dependency_names_pending=0
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
# Exact dependency name, or with `prefix` as the second argument, any name
|
|
303
|
+
# starting with it (the NestJS detector's `@nestjs` test).
|
|
304
|
+
host_has_dependency() {
|
|
305
|
+
load_host_dependency_names
|
|
306
|
+
local name
|
|
307
|
+
while IFS= read -r name; do
|
|
308
|
+
case "$name" in
|
|
309
|
+
"$1") return 0 ;;
|
|
310
|
+
"$1"*) [ "${2:-}" = prefix ] && return 0 ;;
|
|
311
|
+
esac
|
|
312
|
+
done <<<"$host_dependency_names"
|
|
313
|
+
return 1
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
# Whether the host is the given stack, so that stack's templates reach it.
|
|
317
|
+
#
|
|
318
|
+
# THE SAME PATH CAN BELONG TO DIFFERENT OWNERS IN DIFFERENT STACKS.
|
|
319
|
+
# `.github/workflows/ci.yml` is create-only in typescript, nestjs, cdk, expo and
|
|
320
|
+
# rails — the host owns it after the first apply — but copy-overwrite in
|
|
321
|
+
# harper-fabric and phaser. Probing every stack's tree without asking which
|
|
322
|
+
# stacks this host is made a NestJS host's own ci.yml read as managed via the
|
|
323
|
+
# harper-fabric copy, and a project-owned one-line Node bump needed a human to
|
|
324
|
+
# run the override (CodySwannGT/lisa#4511).
|
|
325
|
+
#
|
|
326
|
+
# `lisa apply` copies a stack's templates only into a host that stack's
|
|
327
|
+
# detector recognises, so each arm mirrors `src/detection/detectors/<stack>.ts`.
|
|
328
|
+
# `all`, `typescript`, and any stack without an arm here keep the pre-existing
|
|
329
|
+
# answer — always managed — so this narrows only where a detector proves the
|
|
330
|
+
# stack absent. Where a shell mirror cannot be exact it errs toward allowing,
|
|
331
|
+
# the same direction `.lisaignore` handling above takes.
|
|
332
|
+
stack_reaches_host() {
|
|
333
|
+
local stack="$1"
|
|
334
|
+
case "$stack" in
|
|
335
|
+
harper-fabric)
|
|
336
|
+
local config="$project_root/harper-app/config.yaml"
|
|
337
|
+
[ -f "$config" ] && [ -e "$project_root/harper-app/schema.graphql" ] ||
|
|
338
|
+
return 1
|
|
339
|
+
{
|
|
340
|
+
grep -qF 'graphqlSchema:' "$config" &&
|
|
341
|
+
grep -qF 'jsResource:' "$config" &&
|
|
342
|
+
grep -qF 'static:' "$config"
|
|
343
|
+
} || host_has_dependency harperdb
|
|
344
|
+
;;
|
|
345
|
+
phaser) host_has_dependency phaser ;;
|
|
346
|
+
nestjs)
|
|
347
|
+
[ -e "$project_root/nest-cli.json" ] ||
|
|
348
|
+
host_has_dependency @nestjs prefix
|
|
349
|
+
;;
|
|
350
|
+
expo)
|
|
351
|
+
[ -e "$project_root/app.json" ] || [ -e "$project_root/eas.json" ] ||
|
|
352
|
+
host_has_dependency expo
|
|
353
|
+
;;
|
|
354
|
+
cdk) [ -e "$project_root/cdk.json" ] ;;
|
|
355
|
+
rails)
|
|
356
|
+
[ -e "$project_root/bin/rails" ] ||
|
|
357
|
+
[ -e "$project_root/config/application.rb" ]
|
|
358
|
+
;;
|
|
359
|
+
*) return 0 ;;
|
|
360
|
+
esac
|
|
361
|
+
}
|
|
362
|
+
|
|
283
363
|
# Whether a host-relative path is shipped as a copy-overwrite template.
|
|
284
364
|
#
|
|
285
365
|
# A few stat calls rather than an enumeration: the same relative path is probed
|
|
@@ -299,6 +379,10 @@ managed_source() {
|
|
|
299
379
|
for stack in "$package_root"/*/copy-overwrite; do
|
|
300
380
|
[ -d "$stack" ] || continue
|
|
301
381
|
if [ -e "$stack/$rel" ]; then
|
|
382
|
+
# Another stack's copy-overwrite twin is not this host's file. Keep
|
|
383
|
+
# looking: a stack this host IS may still manage the same path.
|
|
384
|
+
local stack_name="${stack%/copy-overwrite}"
|
|
385
|
+
stack_reaches_host "${stack_name##*/}" || continue
|
|
302
386
|
printf '%s' "${stack#"$package_root"/}/$rel"
|
|
303
387
|
return 0
|
|
304
388
|
fi
|
|
@@ -280,6 +280,86 @@ relative_path() {
|
|
|
280
280
|
printf '%s' "${rel#./}"
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
+
# The host's dependency and devDependency names, one per line, read at most
|
|
284
|
+
# once per classification. `managed_source` runs inside `$(...)`, so the cache
|
|
285
|
+
# lives only as long as that subshell — one classification, not one hook run.
|
|
286
|
+
# Unreadable or malformed `package.json` yields nothing, which makes every
|
|
287
|
+
# dependency-keyed stack below read as absent — an allow, the safe direction.
|
|
288
|
+
#
|
|
289
|
+
# Loaded into a global rather than echoed, so callers match with a here-string
|
|
290
|
+
# and no pipeline: under `pipefail` a `grep -q` that stops reading early can
|
|
291
|
+
# fail the writer with SIGPIPE and turn a match into a miss.
|
|
292
|
+
host_dependency_names=""
|
|
293
|
+
host_dependency_names_pending=1
|
|
294
|
+
load_host_dependency_names() {
|
|
295
|
+
[ "$host_dependency_names_pending" -eq 1 ] || return 0
|
|
296
|
+
host_dependency_names="$(jq -r \
|
|
297
|
+
'[(.dependencies // {}), (.devDependencies // {})] | add | keys[]' \
|
|
298
|
+
"$project_root/package.json" 2>/dev/null || true)"
|
|
299
|
+
host_dependency_names_pending=0
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
# Exact dependency name, or with `prefix` as the second argument, any name
|
|
303
|
+
# starting with it (the NestJS detector's `@nestjs` test).
|
|
304
|
+
host_has_dependency() {
|
|
305
|
+
load_host_dependency_names
|
|
306
|
+
local name
|
|
307
|
+
while IFS= read -r name; do
|
|
308
|
+
case "$name" in
|
|
309
|
+
"$1") return 0 ;;
|
|
310
|
+
"$1"*) [ "${2:-}" = prefix ] && return 0 ;;
|
|
311
|
+
esac
|
|
312
|
+
done <<<"$host_dependency_names"
|
|
313
|
+
return 1
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
# Whether the host is the given stack, so that stack's templates reach it.
|
|
317
|
+
#
|
|
318
|
+
# THE SAME PATH CAN BELONG TO DIFFERENT OWNERS IN DIFFERENT STACKS.
|
|
319
|
+
# `.github/workflows/ci.yml` is create-only in typescript, nestjs, cdk, expo and
|
|
320
|
+
# rails — the host owns it after the first apply — but copy-overwrite in
|
|
321
|
+
# harper-fabric and phaser. Probing every stack's tree without asking which
|
|
322
|
+
# stacks this host is made a NestJS host's own ci.yml read as managed via the
|
|
323
|
+
# harper-fabric copy, and a project-owned one-line Node bump needed a human to
|
|
324
|
+
# run the override (CodySwannGT/lisa#4511).
|
|
325
|
+
#
|
|
326
|
+
# `lisa apply` copies a stack's templates only into a host that stack's
|
|
327
|
+
# detector recognises, so each arm mirrors `src/detection/detectors/<stack>.ts`.
|
|
328
|
+
# `all`, `typescript`, and any stack without an arm here keep the pre-existing
|
|
329
|
+
# answer — always managed — so this narrows only where a detector proves the
|
|
330
|
+
# stack absent. Where a shell mirror cannot be exact it errs toward allowing,
|
|
331
|
+
# the same direction `.lisaignore` handling above takes.
|
|
332
|
+
stack_reaches_host() {
|
|
333
|
+
local stack="$1"
|
|
334
|
+
case "$stack" in
|
|
335
|
+
harper-fabric)
|
|
336
|
+
local config="$project_root/harper-app/config.yaml"
|
|
337
|
+
[ -f "$config" ] && [ -e "$project_root/harper-app/schema.graphql" ] ||
|
|
338
|
+
return 1
|
|
339
|
+
{
|
|
340
|
+
grep -qF 'graphqlSchema:' "$config" &&
|
|
341
|
+
grep -qF 'jsResource:' "$config" &&
|
|
342
|
+
grep -qF 'static:' "$config"
|
|
343
|
+
} || host_has_dependency harperdb
|
|
344
|
+
;;
|
|
345
|
+
phaser) host_has_dependency phaser ;;
|
|
346
|
+
nestjs)
|
|
347
|
+
[ -e "$project_root/nest-cli.json" ] ||
|
|
348
|
+
host_has_dependency @nestjs prefix
|
|
349
|
+
;;
|
|
350
|
+
expo)
|
|
351
|
+
[ -e "$project_root/app.json" ] || [ -e "$project_root/eas.json" ] ||
|
|
352
|
+
host_has_dependency expo
|
|
353
|
+
;;
|
|
354
|
+
cdk) [ -e "$project_root/cdk.json" ] ;;
|
|
355
|
+
rails)
|
|
356
|
+
[ -e "$project_root/bin/rails" ] ||
|
|
357
|
+
[ -e "$project_root/config/application.rb" ]
|
|
358
|
+
;;
|
|
359
|
+
*) return 0 ;;
|
|
360
|
+
esac
|
|
361
|
+
}
|
|
362
|
+
|
|
283
363
|
# Whether a host-relative path is shipped as a copy-overwrite template.
|
|
284
364
|
#
|
|
285
365
|
# A few stat calls rather than an enumeration: the same relative path is probed
|
|
@@ -299,6 +379,10 @@ managed_source() {
|
|
|
299
379
|
for stack in "$package_root"/*/copy-overwrite; do
|
|
300
380
|
[ -d "$stack" ] || continue
|
|
301
381
|
if [ -e "$stack/$rel" ]; then
|
|
382
|
+
# Another stack's copy-overwrite twin is not this host's file. Keep
|
|
383
|
+
# looking: a stack this host IS may still manage the same path.
|
|
384
|
+
local stack_name="${stack%/copy-overwrite}"
|
|
385
|
+
stack_reaches_host "${stack_name##*/}" || continue
|
|
302
386
|
printf '%s' "${stack#"$package_root"/}/$rel"
|
|
303
387
|
return 0
|
|
304
388
|
fi
|
|
@@ -280,6 +280,86 @@ relative_path() {
|
|
|
280
280
|
printf '%s' "${rel#./}"
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
+
# The host's dependency and devDependency names, one per line, read at most
|
|
284
|
+
# once per classification. `managed_source` runs inside `$(...)`, so the cache
|
|
285
|
+
# lives only as long as that subshell — one classification, not one hook run.
|
|
286
|
+
# Unreadable or malformed `package.json` yields nothing, which makes every
|
|
287
|
+
# dependency-keyed stack below read as absent — an allow, the safe direction.
|
|
288
|
+
#
|
|
289
|
+
# Loaded into a global rather than echoed, so callers match with a here-string
|
|
290
|
+
# and no pipeline: under `pipefail` a `grep -q` that stops reading early can
|
|
291
|
+
# fail the writer with SIGPIPE and turn a match into a miss.
|
|
292
|
+
host_dependency_names=""
|
|
293
|
+
host_dependency_names_pending=1
|
|
294
|
+
load_host_dependency_names() {
|
|
295
|
+
[ "$host_dependency_names_pending" -eq 1 ] || return 0
|
|
296
|
+
host_dependency_names="$(jq -r \
|
|
297
|
+
'[(.dependencies // {}), (.devDependencies // {})] | add | keys[]' \
|
|
298
|
+
"$project_root/package.json" 2>/dev/null || true)"
|
|
299
|
+
host_dependency_names_pending=0
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
# Exact dependency name, or with `prefix` as the second argument, any name
|
|
303
|
+
# starting with it (the NestJS detector's `@nestjs` test).
|
|
304
|
+
host_has_dependency() {
|
|
305
|
+
load_host_dependency_names
|
|
306
|
+
local name
|
|
307
|
+
while IFS= read -r name; do
|
|
308
|
+
case "$name" in
|
|
309
|
+
"$1") return 0 ;;
|
|
310
|
+
"$1"*) [ "${2:-}" = prefix ] && return 0 ;;
|
|
311
|
+
esac
|
|
312
|
+
done <<<"$host_dependency_names"
|
|
313
|
+
return 1
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
# Whether the host is the given stack, so that stack's templates reach it.
|
|
317
|
+
#
|
|
318
|
+
# THE SAME PATH CAN BELONG TO DIFFERENT OWNERS IN DIFFERENT STACKS.
|
|
319
|
+
# `.github/workflows/ci.yml` is create-only in typescript, nestjs, cdk, expo and
|
|
320
|
+
# rails — the host owns it after the first apply — but copy-overwrite in
|
|
321
|
+
# harper-fabric and phaser. Probing every stack's tree without asking which
|
|
322
|
+
# stacks this host is made a NestJS host's own ci.yml read as managed via the
|
|
323
|
+
# harper-fabric copy, and a project-owned one-line Node bump needed a human to
|
|
324
|
+
# run the override (CodySwannGT/lisa#4511).
|
|
325
|
+
#
|
|
326
|
+
# `lisa apply` copies a stack's templates only into a host that stack's
|
|
327
|
+
# detector recognises, so each arm mirrors `src/detection/detectors/<stack>.ts`.
|
|
328
|
+
# `all`, `typescript`, and any stack without an arm here keep the pre-existing
|
|
329
|
+
# answer — always managed — so this narrows only where a detector proves the
|
|
330
|
+
# stack absent. Where a shell mirror cannot be exact it errs toward allowing,
|
|
331
|
+
# the same direction `.lisaignore` handling above takes.
|
|
332
|
+
stack_reaches_host() {
|
|
333
|
+
local stack="$1"
|
|
334
|
+
case "$stack" in
|
|
335
|
+
harper-fabric)
|
|
336
|
+
local config="$project_root/harper-app/config.yaml"
|
|
337
|
+
[ -f "$config" ] && [ -e "$project_root/harper-app/schema.graphql" ] ||
|
|
338
|
+
return 1
|
|
339
|
+
{
|
|
340
|
+
grep -qF 'graphqlSchema:' "$config" &&
|
|
341
|
+
grep -qF 'jsResource:' "$config" &&
|
|
342
|
+
grep -qF 'static:' "$config"
|
|
343
|
+
} || host_has_dependency harperdb
|
|
344
|
+
;;
|
|
345
|
+
phaser) host_has_dependency phaser ;;
|
|
346
|
+
nestjs)
|
|
347
|
+
[ -e "$project_root/nest-cli.json" ] ||
|
|
348
|
+
host_has_dependency @nestjs prefix
|
|
349
|
+
;;
|
|
350
|
+
expo)
|
|
351
|
+
[ -e "$project_root/app.json" ] || [ -e "$project_root/eas.json" ] ||
|
|
352
|
+
host_has_dependency expo
|
|
353
|
+
;;
|
|
354
|
+
cdk) [ -e "$project_root/cdk.json" ] ;;
|
|
355
|
+
rails)
|
|
356
|
+
[ -e "$project_root/bin/rails" ] ||
|
|
357
|
+
[ -e "$project_root/config/application.rb" ]
|
|
358
|
+
;;
|
|
359
|
+
*) return 0 ;;
|
|
360
|
+
esac
|
|
361
|
+
}
|
|
362
|
+
|
|
283
363
|
# Whether a host-relative path is shipped as a copy-overwrite template.
|
|
284
364
|
#
|
|
285
365
|
# A few stat calls rather than an enumeration: the same relative path is probed
|
|
@@ -299,6 +379,10 @@ managed_source() {
|
|
|
299
379
|
for stack in "$package_root"/*/copy-overwrite; do
|
|
300
380
|
[ -d "$stack" ] || continue
|
|
301
381
|
if [ -e "$stack/$rel" ]; then
|
|
382
|
+
# Another stack's copy-overwrite twin is not this host's file. Keep
|
|
383
|
+
# looking: a stack this host IS may still manage the same path.
|
|
384
|
+
local stack_name="${stack%/copy-overwrite}"
|
|
385
|
+
stack_reaches_host "${stack_name##*/}" || continue
|
|
302
386
|
printf '%s' "${stack#"$package_root"/}/$rel"
|
|
303
387
|
return 0
|
|
304
388
|
fi
|