@codyswann/lisa 1.85.6 → 1.85.8

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.
@@ -14,8 +14,17 @@ export declare class EnsureLisaPostinstallMigration implements Migration {
14
14
  readonly description = "Ensure Node-based projects run Lisa in their postinstall script";
15
15
  /**
16
16
  * Check whether this migration should run on the project
17
+ *
18
+ * Primary path: Node project types (typescript, expo, nestjs, cdk, npm-package)
19
+ * with a package.json whose postinstall lacks the CI-guarded Lisa invocation.
20
+ *
21
+ * Fallback path: non-Node projects (e.g. Rails-only) that nevertheless ship a
22
+ * package.json containing a legacy Lisa postinstall (unguarded). These were
23
+ * written by an older Lisa version before the CI guard existed and still need
24
+ * an upgrade. Projects without a package.json are untouched.
17
25
  * @param ctx - Migration context
18
- * @returns True when a Node project is missing the Lisa invocation in postinstall
26
+ * @returns True when a Node project is missing the Lisa invocation in postinstall,
27
+ * or when a non-Node project has an unguarded legacy Lisa postinstall
19
28
  */
20
29
  applies(ctx: MigrationContext): Promise<boolean>;
21
30
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ensure-lisa-postinstall.d.ts","sourceRoot":"","sources":["../../src/migrations/ensure-lisa-postinstall.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,0BAA0B,CAAC;AA6DlC;;;;;;;;;GASG;AACH,qBAAa,8BAA+B,YAAW,SAAS;IAC9D,QAAQ,CAAC,IAAI,6BAA6B;IAC1C,QAAQ,CAAC,WAAW,qEACgD;IAEpE;;;;OAIG;IACG,OAAO,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAetD;;;;OAIG;IACG,KAAK,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;CAqC7D"}
1
+ {"version":3,"file":"ensure-lisa-postinstall.d.ts","sourceRoot":"","sources":["../../src/migrations/ensure-lisa-postinstall.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAoFlC;;;;;;;;;GASG;AACH,qBAAa,8BAA+B,YAAW,SAAS;IAC9D,QAAQ,CAAC,IAAI,6BAA6B;IAC1C,QAAQ,CAAC,WAAW,qEACgD;IAEpE;;;;;;;;;;;;;OAaG;IACG,OAAO,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBtD;;;;OAIG;IACG,KAAK,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;CAqC7D"}
@@ -1,7 +1,8 @@
1
1
  import * as path from "node:path";
2
2
  import { readJsonOrNull, writeJson } from "../utils/json-utils.js";
3
3
  const PACKAGE_JSON = "package.json";
4
- const LISA_INVOCATION = "node node_modules/@codyswann/lisa/dist/index.js --yes --skip-git-check . 2>/dev/null || true";
4
+ const CI_GUARD_PREFIX = '[ -n "$CI" ] || ';
5
+ const LISA_INVOCATION = `${CI_GUARD_PREFIX}node node_modules/@codyswann/lisa/dist/index.js --yes --skip-git-check . 2>/dev/null || true`;
5
6
  const LISA_MARKER = "node_modules/@codyswann/lisa/dist/index.js";
6
7
  /**
7
8
  * Project types that do not use Node.js postinstall hooks (e.g. Rails).
@@ -17,7 +18,23 @@ async function readPackageJson(projectDir) {
17
18
  return readJsonOrNull(path.join(projectDir, PACKAGE_JSON));
18
19
  }
19
20
  /**
20
- * Compose the new postinstall, prepending the Lisa invocation to any existing command
21
+ * Legacy Lisa invocation pattern (without CI guard). Existing projects may
22
+ * have this form chained with other commands; we detect and replace it so
23
+ * the CI guard is introduced without duplicating the invocation.
24
+ */
25
+ const LEGACY_LISA_INVOCATION_RE = /node node_modules\/@codyswann\/lisa\/dist\/index\.js --yes --skip-git-check \. 2>\/dev\/null \|\| true/;
26
+ /**
27
+ * Guarded Lisa invocation pattern (CI guard directly gates the Lisa command).
28
+ * Used to detect when the migration has already been applied. Avoids false
29
+ * positives where the CI guard precedes an unrelated command (e.g.
30
+ * `[ -n "$CI" ] || patch-package && node ...lisa...`), which would leave Lisa
31
+ * effectively unguarded inside a `&&` chain.
32
+ */
33
+ const GUARDED_LISA_INVOCATION_RE = /\[ -n "\$CI" \] \|\| node node_modules\/@codyswann\/lisa\/dist\/index\.js --yes --skip-git-check \. 2>\/dev\/null \|\| true/;
34
+ /**
35
+ * Compose the new postinstall, prepending the Lisa invocation to any existing command.
36
+ * If the existing script already contains a legacy Lisa invocation (no CI guard),
37
+ * replace it in place with the guarded invocation rather than duplicating it.
21
38
  * @param existing - Existing postinstall script (may be undefined)
22
39
  * @returns The composed postinstall script
23
40
  */
@@ -26,6 +43,9 @@ function composePostinstall(existing) {
26
43
  if (!trimmed) {
27
44
  return LISA_INVOCATION;
28
45
  }
46
+ if (trimmed.includes(LISA_MARKER)) {
47
+ return trimmed.replace(LEGACY_LISA_INVOCATION_RE, LISA_INVOCATION);
48
+ }
29
49
  return `${LISA_INVOCATION} && ${trimmed}`;
30
50
  }
31
51
  /**
@@ -56,19 +76,30 @@ export class EnsureLisaPostinstallMigration {
56
76
  description = "Ensure Node-based projects run Lisa in their postinstall script";
57
77
  /**
58
78
  * Check whether this migration should run on the project
79
+ *
80
+ * Primary path: Node project types (typescript, expo, nestjs, cdk, npm-package)
81
+ * with a package.json whose postinstall lacks the CI-guarded Lisa invocation.
82
+ *
83
+ * Fallback path: non-Node projects (e.g. Rails-only) that nevertheless ship a
84
+ * package.json containing a legacy Lisa postinstall (unguarded). These were
85
+ * written by an older Lisa version before the CI guard existed and still need
86
+ * an upgrade. Projects without a package.json are untouched.
59
87
  * @param ctx - Migration context
60
- * @returns True when a Node project is missing the Lisa invocation in postinstall
88
+ * @returns True when a Node project is missing the Lisa invocation in postinstall,
89
+ * or when a non-Node project has an unguarded legacy Lisa postinstall
61
90
  */
62
91
  async applies(ctx) {
63
- if (!hasNodePostinstallType(ctx.detectedTypes)) {
64
- return false;
65
- }
66
92
  const pkg = await readPackageJson(ctx.projectDir);
67
93
  if (!pkg) {
68
94
  return false;
69
95
  }
70
96
  const postinstall = pkg.scripts?.postinstall;
71
- if (postinstall && postinstall.includes(LISA_MARKER)) {
97
+ if (!hasNodePostinstallType(ctx.detectedTypes)) {
98
+ return (!!postinstall &&
99
+ postinstall.includes(LISA_MARKER) &&
100
+ !GUARDED_LISA_INVOCATION_RE.test(postinstall));
101
+ }
102
+ if (postinstall && GUARDED_LISA_INVOCATION_RE.test(postinstall)) {
72
103
  return false;
73
104
  }
74
105
  return true;
@@ -1 +1 @@
1
- {"version":3,"file":"ensure-lisa-postinstall.js","sourceRoot":"","sources":["../../src/migrations/ensure-lisa-postinstall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAOnE,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,eAAe,GACnB,8FAA8F,CAAC;AACjG,MAAM,WAAW,GAAG,4CAA4C,CAAC;AAEjE;;;GAGG;AACH,MAAM,cAAc,GAA2B,CAAC,OAAO,CAAC,CAAC;AAUzD;;;;GAIG;AACH,KAAK,UAAU,eAAe,CAC5B,UAAkB;IAElB,OAAO,cAAc,CAAc,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,QAA4B;IACtD,MAAM,OAAO,GAAG,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,OAAO,GAAG,eAAe,OAAO,OAAO,EAAE,CAAC;AAC5C,CAAC;AAED;;;;;;GAMG;AACH,SAAS,sBAAsB,CAC7B,aAAqC;IAErC,IAAI,aAAa,CAAC,MAAM,KAAK,CA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AC,CAAC;YAChE,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,MAAM,EAAE,SAAS;gBACjB,YAAY,EAAE,CAAC,YAAY,CAAC;gBAC5B,OAAO;aACR,CAAC;QACJ,CAAC;QAED,MAAM,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC5B,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,SAAS;YACjB,YAAY,EAAE,CAAC,YAAY,CAAC;YAC5B,OAAO;SACR,CAAC;IACJ,CAAC;CACF"}
package/package.json CHANGED
@@ -78,7 +78,7 @@
78
78
  "lodash": ">=4.18.1"
79
79
  },
80
80
  "name": "@codyswann/lisa",
81
- "version": "1.85.6",
81
+ "version": "1.85.8",
82
82
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
83
83
  "main": "dist/index.js",
84
84
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "1.85.6",
3
+ "version": "1.85.8",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "1.85.6",
3
+ "version": "1.85.8",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "1.85.6",
3
+ "version": "1.85.8",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "1.85.6",
3
+ "version": "1.85.8",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "1.85.6",
3
+ "version": "1.85.8",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "1.85.6",
3
+ "version": "1.85.8",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"