@codyswann/lisa 2.132.6 → 2.133.0
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/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +10 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/setup-project.d.ts +26 -0
- package/dist/cli/setup-project.d.ts.map +1 -0
- package/dist/cli/setup-project.js +138 -0
- package/dist/cli/setup-project.js.map +1 -0
- package/dist/cli/starters.d.ts +27 -0
- package/dist/cli/starters.d.ts.map +1 -0
- package/dist/cli/starters.js +43 -0
- package/dist/cli/starters.js.map +1 -0
- package/dist/configs/jest/expo.d.ts +9 -33
- package/dist/configs/jest/expo.d.ts.map +1 -1
- package/dist/configs/jest/expo.js +77 -4
- package/dist/configs/jest/expo.js.map +1 -1
- package/expo/copy-overwrite/knip.json +1 -0
- package/expo/package-lisa/package.lisa.json +1 -2
- package/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- 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-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- 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-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-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-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-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-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-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/dist/cli/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { runApply } from "./apply.js";
|
|
3
3
|
import { printUpdateWarning } from "./print-update-warning.js";
|
|
4
|
+
import { runSetupProject } from "./setup-project.js";
|
|
4
5
|
import { runUpdateCheck } from "./update-check.js";
|
|
5
6
|
/**
|
|
6
7
|
* Injectable collaborators for {@link createProgram}. Defaults wire the real
|
|
@@ -10,6 +11,8 @@ import { runUpdateCheck } from "./update-check.js";
|
|
|
10
11
|
export interface ProgramDependencies {
|
|
11
12
|
/** Applies Lisa to a destination (defaults to the real {@link runApply}). */
|
|
12
13
|
runApply: typeof runApply;
|
|
14
|
+
/** Creates a starter-backed project and applies Lisa overlays. */
|
|
15
|
+
runSetupProject: typeof runSetupProject;
|
|
13
16
|
/** Runs the non-fatal npm update check (defaults to {@link runUpdateCheck}). */
|
|
14
17
|
runUpdateCheck: typeof runUpdateCheck;
|
|
15
18
|
/** Prints the update warning (defaults to {@link printUpdateWarning}). */
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,kEAAkE;IAClE,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,gFAAgF;IAChF,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,0EAA0E;IAC1E,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;CAC/C;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,YAAY,GAAE,OAAO,CAAC,mBAAmB,CAAM,GAC9C,OAAO,CA0DT;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { runApply } from "./apply.js";
|
|
3
3
|
import { printUpdateWarning } from "./print-update-warning.js";
|
|
4
|
+
import { runSetupProject } from "./setup-project.js";
|
|
4
5
|
import { addSharedOptions } from "./shared-options.js";
|
|
6
|
+
import { SETUP_TYPES } from "./starters.js";
|
|
5
7
|
import { runUpdateCheck } from "./update-check.js";
|
|
6
8
|
import { getPackageVersion } from "./version.js";
|
|
7
9
|
const DEFAULT_DEPENDENCIES = {
|
|
8
10
|
runApply,
|
|
11
|
+
runSetupProject,
|
|
9
12
|
runUpdateCheck,
|
|
10
13
|
printUpdateWarning,
|
|
11
14
|
};
|
|
@@ -51,6 +54,13 @@ export function createProgram(dependencies = {}) {
|
|
|
51
54
|
.argument("[destination]", "Path to the project directory")).action(async (destination, options) => {
|
|
52
55
|
await deps.runApply(destination, options);
|
|
53
56
|
});
|
|
57
|
+
addSharedOptions(program
|
|
58
|
+
.command("setup-project")
|
|
59
|
+
.description("Create a new Lisa-managed project from a starter repo")
|
|
60
|
+
.requiredOption("--type <type>", `Project type: ${SETUP_TYPES.join(" | ")}`)
|
|
61
|
+
.argument("[destination]", "Project name or path (default: ./<type>-app)")).action(async (destination, options) => {
|
|
62
|
+
await deps.runSetupProject(destination, options);
|
|
63
|
+
});
|
|
54
64
|
return program;
|
|
55
65
|
}
|
|
56
66
|
export { createPrompter } from "./prompts.js";
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAkBjD,MAAM,oBAAoB,GAAwB;IAChD,QAAQ;IACR,eAAe;IACf,cAAc;IACd,kBAAkB;CACnB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAC3B,eAA6C,EAAE;IAE/C,MAA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7E,CAAC,MAAM,CACN,KAAK,EACH,WAA+B,EAC/B,OAAuC,EACvC,EAAE;QACF,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC,CACF,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type CLIOptions } from "./shared-options.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parsed options for the setup-project command.
|
|
4
|
+
*/
|
|
5
|
+
export interface SetupProjectOptions extends CLIOptions {
|
|
6
|
+
type?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Injectable collaborators for setup-project.
|
|
10
|
+
*/
|
|
11
|
+
export interface SetupProjectDependencies {
|
|
12
|
+
runApply: (destination: string | undefined, options: CLIOptions) => Promise<void>;
|
|
13
|
+
runCommand: (command: string, args: readonly string[], options?: {
|
|
14
|
+
cwd?: string;
|
|
15
|
+
}) => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare const DEFAULT_SETUP_PROJECT_DEPENDENCIES: SetupProjectDependencies;
|
|
18
|
+
/**
|
|
19
|
+
* Create a Lisa-managed project from a starter and then apply overlays.
|
|
20
|
+
* @param destination - Optional project name or path
|
|
21
|
+
* @param options - Parsed setup-project options
|
|
22
|
+
* @param dependencies - Injectable collaborators
|
|
23
|
+
* @returns Promise that resolves after setup and apply complete
|
|
24
|
+
*/
|
|
25
|
+
export declare function runSetupProject(destination: string | undefined, options: SetupProjectOptions, dependencies?: SetupProjectDependencies): Promise<void>;
|
|
26
|
+
//# sourceMappingURL=setup-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-project.d.ts","sourceRoot":"","sources":["../../src/cli/setup-project.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,CACR,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,OAAO,EAAE,UAAU,KAChB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,UAAU,EAAE,CACV,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,KACvB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAmBD,eAAO,MAAM,kCAAkC,EAAE,wBAKhD,CAAC;AA6GF;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,OAAO,EAAE,mBAAmB,EAC5B,YAAY,GAAE,wBAA6D,GAC1E,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { readdir, rm } from "node:fs/promises";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
import { isSetupType, resolveStarter, SETUP_TYPES } from "./starters.js";
|
|
6
|
+
/**
|
|
7
|
+
* Remove setup-project-only fields from the options forwarded to apply.
|
|
8
|
+
* @param options - Parsed setup-project options
|
|
9
|
+
* @returns Shared apply options without undefined optional properties
|
|
10
|
+
*/
|
|
11
|
+
function toCliOptions(options) {
|
|
12
|
+
return {
|
|
13
|
+
...(options.dryRun !== undefined ? { dryRun: options.dryRun } : {}),
|
|
14
|
+
...(options.yes !== undefined ? { yes: options.yes } : {}),
|
|
15
|
+
...(options.validate !== undefined ? { validate: options.validate } : {}),
|
|
16
|
+
...(options.skipGitCheck !== undefined
|
|
17
|
+
? { skipGitCheck: options.skipGitCheck }
|
|
18
|
+
: {}),
|
|
19
|
+
...(options.harness !== undefined ? { harness: options.harness } : {}),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export const DEFAULT_SETUP_PROJECT_DEPENDENCIES = {
|
|
23
|
+
runApply: async () => {
|
|
24
|
+
throw new Error("runApply dependency was not configured");
|
|
25
|
+
},
|
|
26
|
+
runCommand,
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Run a command as a child process and reject on non-zero exit.
|
|
30
|
+
* @param command - Executable name
|
|
31
|
+
* @param args - Command arguments
|
|
32
|
+
* @param options - Spawn options
|
|
33
|
+
* @param options.cwd - Optional working directory for the command
|
|
34
|
+
* @returns Promise that resolves when the command exits successfully
|
|
35
|
+
*/
|
|
36
|
+
async function runCommand(command, args, options = {}) {
|
|
37
|
+
await new Promise((resolve, reject) => {
|
|
38
|
+
const child = spawn(command, args, {
|
|
39
|
+
cwd: options.cwd,
|
|
40
|
+
stdio: "inherit",
|
|
41
|
+
});
|
|
42
|
+
child.once("error", reject);
|
|
43
|
+
child.once("exit", code => {
|
|
44
|
+
if (code === 0) {
|
|
45
|
+
resolve();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
reject(new Error(`${command} ${args.join(" ")} exited ${code ?? 1}`));
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Check whether a destination exists and contains files.
|
|
54
|
+
* @param destination - Project destination path
|
|
55
|
+
* @returns True when the destination directory is non-empty
|
|
56
|
+
*/
|
|
57
|
+
async function directoryIsNonEmpty(destination) {
|
|
58
|
+
if (!existsSync(destination)) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return (await readdir(destination)).length > 0;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Detect whether the GitHub CLI is authenticated.
|
|
65
|
+
* @param deps - Injectable setup-project dependencies
|
|
66
|
+
* @returns True when `gh auth status` succeeds
|
|
67
|
+
*/
|
|
68
|
+
async function ghIsAuthenticated(deps) {
|
|
69
|
+
try {
|
|
70
|
+
await deps.runCommand("gh", ["auth", "status"]);
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Clone or create the starter project for a setup type.
|
|
79
|
+
* @param type - Lisa setup type
|
|
80
|
+
* @param destination - Project destination path
|
|
81
|
+
* @param deps - Injectable setup-project dependencies
|
|
82
|
+
* @returns Promise that resolves after the starter is available locally
|
|
83
|
+
*/
|
|
84
|
+
async function cloneStarter(type, destination, deps) {
|
|
85
|
+
if (!isSetupType(type)) {
|
|
86
|
+
throw new Error(`Unknown setup type ${JSON.stringify(type)}. Valid types: ${SETUP_TYPES.join(", ")}`);
|
|
87
|
+
}
|
|
88
|
+
const starter = resolveStarter(type);
|
|
89
|
+
const parentDir = path.dirname(destination);
|
|
90
|
+
const projectName = path.basename(destination);
|
|
91
|
+
const starterRef = `${starter.owner}/${starter.repo}`;
|
|
92
|
+
if (await ghIsAuthenticated(deps)) {
|
|
93
|
+
await deps.runCommand("gh", [
|
|
94
|
+
"repo",
|
|
95
|
+
"create",
|
|
96
|
+
projectName,
|
|
97
|
+
"--template",
|
|
98
|
+
starterRef,
|
|
99
|
+
"--public",
|
|
100
|
+
"--clone",
|
|
101
|
+
], { cwd: parentDir });
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
await deps.runCommand("git", [
|
|
105
|
+
"clone",
|
|
106
|
+
"--depth=1",
|
|
107
|
+
`https://github.com/${starterRef}.git`,
|
|
108
|
+
destination,
|
|
109
|
+
]);
|
|
110
|
+
await rm(path.join(destination, ".git"), { recursive: true, force: true });
|
|
111
|
+
await deps.runCommand("git", ["init", "-b", "main"], { cwd: destination });
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Create a Lisa-managed project from a starter and then apply overlays.
|
|
115
|
+
* @param destination - Optional project name or path
|
|
116
|
+
* @param options - Parsed setup-project options
|
|
117
|
+
* @param dependencies - Injectable collaborators
|
|
118
|
+
* @returns Promise that resolves after setup and apply complete
|
|
119
|
+
*/
|
|
120
|
+
export async function runSetupProject(destination, options, dependencies = DEFAULT_SETUP_PROJECT_DEPENDENCIES) {
|
|
121
|
+
if (!options.type) {
|
|
122
|
+
throw new Error(`Missing required --type. Valid types: ${SETUP_TYPES.join(", ")}`);
|
|
123
|
+
}
|
|
124
|
+
if (!isSetupType(options.type)) {
|
|
125
|
+
throw new Error(`Unknown setup type ${JSON.stringify(options.type)}. Valid types: ${SETUP_TYPES.join(", ")}`);
|
|
126
|
+
}
|
|
127
|
+
const resolvedDestination = path.resolve(destination ?? `./${options.type}-app`);
|
|
128
|
+
if (!(await directoryIsNonEmpty(resolvedDestination))) {
|
|
129
|
+
if (options.dryRun || options.validate) {
|
|
130
|
+
console.log(`Would create ${resolvedDestination} from ${resolveStarter(options.type).owner}/${resolveStarter(options.type).repo}`);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
await cloneStarter(options.type, resolvedDestination, dependencies);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
await dependencies.runApply(resolvedDestination, toCliOptions(options));
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=setup-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-project.js","sourceRoot":"","sources":["../../src/cli/setup-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAwBzE;;;;GAIG;A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,CACb,sBAAsB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,CACtC,WAAW,IAAI,KAAK,OAAO,CAAC,IAAI,MAAM,CACvC,CAAC;IAEF,IAAI,CAAC,CAAC,MAAM,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC;QACtD,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACvC,OAAO,CAAC,GAAG,CACT,gBAAgB,mBAAmB,SAAS,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CACtH,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,mBAAmB,EAAE,YAAY,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IAED,MAAM,YAAY,CAAC,QAAQ,CAAC,mBAAmB,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const SETUP_TYPES: readonly ["rails", "typescript", "expo", "nestjs", "cdk", "wiki", "harper-wiki"];
|
|
2
|
+
/**
|
|
3
|
+
* Supported starter-backed project setup types.
|
|
4
|
+
*/
|
|
5
|
+
export type SetupType = (typeof SETUP_TYPES)[number];
|
|
6
|
+
/**
|
|
7
|
+
* Metadata for a starter repository used by setup-project.
|
|
8
|
+
*/
|
|
9
|
+
export interface Starter {
|
|
10
|
+
readonly owner: string;
|
|
11
|
+
readonly repo: string;
|
|
12
|
+
readonly template: true;
|
|
13
|
+
}
|
|
14
|
+
export declare const STARTERS: Record<SetupType, Starter>;
|
|
15
|
+
/**
|
|
16
|
+
* Check whether a raw string is a supported setup type.
|
|
17
|
+
* @param value - Raw setup type value
|
|
18
|
+
* @returns True when value is a supported setup type
|
|
19
|
+
*/
|
|
20
|
+
export declare function isSetupType(value: string): value is SetupType;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve the configured starter template for a setup type.
|
|
23
|
+
* @param type - Valid Lisa setup type
|
|
24
|
+
* @returns Starter repository metadata
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveStarter(type: SetupType): Starter;
|
|
27
|
+
//# sourceMappingURL=starters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starters.d.ts","sourceRoot":"","sources":["../../src/cli/starters.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,kFAQd,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAgB/C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,SAAS,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAEvD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const SETUP_TYPES = [
|
|
2
|
+
"rails",
|
|
3
|
+
"typescript",
|
|
4
|
+
"expo",
|
|
5
|
+
"nestjs",
|
|
6
|
+
"cdk",
|
|
7
|
+
"wiki",
|
|
8
|
+
"harper-wiki",
|
|
9
|
+
];
|
|
10
|
+
export const STARTERS = {
|
|
11
|
+
rails: { owner: "CodySwannGT", repo: "railsstarter", template: true },
|
|
12
|
+
typescript: {
|
|
13
|
+
owner: "CodySwannGT",
|
|
14
|
+
repo: "typescriptstarter",
|
|
15
|
+
template: true,
|
|
16
|
+
},
|
|
17
|
+
expo: { owner: "CodySwannGT", repo: "expostarter", template: true },
|
|
18
|
+
nestjs: { owner: "CodySwannGT", repo: "nestjsstarter", template: true },
|
|
19
|
+
cdk: { owner: "CodySwannGT", repo: "cdkstarter", template: true },
|
|
20
|
+
wiki: { owner: "CodySwannGT", repo: "wikistarter", template: true },
|
|
21
|
+
"harper-wiki": {
|
|
22
|
+
owner: "CodySwannGT",
|
|
23
|
+
repo: "harperwikistarter",
|
|
24
|
+
template: true,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Check whether a raw string is a supported setup type.
|
|
29
|
+
* @param value - Raw setup type value
|
|
30
|
+
* @returns True when value is a supported setup type
|
|
31
|
+
*/
|
|
32
|
+
export function isSetupType(value) {
|
|
33
|
+
return SETUP_TYPES.includes(value);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve the configured starter template for a setup type.
|
|
37
|
+
* @param type - Valid Lisa setup type
|
|
38
|
+
* @returns Starter repository metadata
|
|
39
|
+
*/
|
|
40
|
+
export function resolveStarter(type) {
|
|
41
|
+
return STARTERS[type];
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=starters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starters.js","sourceRoot":"","sources":["../../src/cli/starters.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO;IACP,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,KAAK;IACL,MAAM;IACN,aAAa;CACL,CAAC;AAgBX,MAAM,CAAC,MAAM,QAAQ,GAA+B;IAClD,KAAK,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE;IACrE,UAAU,EAAE;QACV,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;IACnE,MAAM,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE;IACvE,GAAG,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE;IACjE,IAAI,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;IACnE,aAAa,EAAE;QACb,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,IAAI;KACf;CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,WAAW,CAAC,QAAQ,CAAC,KAAkB,CAAC,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAe;IAC5C,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -1,39 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Jest Configuration - Expo Stack
|
|
3
|
-
*
|
|
4
|
-
* Provides Expo/React Native-specific Jest configuration without using
|
|
5
|
-
* the `jest-expo` preset directly. The preset's `setupFiles` include
|
|
6
|
-
* `react-native/jest/setup.js` which redefines `window` via
|
|
7
|
-
* `Object.defineProperties` — incompatible with jsdom's non-configurable
|
|
8
|
-
* `window` property, causing "Cannot redefine property: window" errors.
|
|
9
|
-
*
|
|
10
|
-
* Instead, this config manually replicates the preset's resolution,
|
|
11
|
-
* transform, and haste settings without any preset setupFiles.
|
|
12
|
-
*
|
|
13
|
-
* `setupFiles` and `setupFilesAfterEnv` are configured here to wire up
|
|
14
|
-
* the base jest setup files (`jest.setup.pre.js` and `jest.setup.ts`).
|
|
15
|
-
* These base files import project-local overrides (`jest.setup.pre.local.js`
|
|
16
|
-
* and `jest.setup.local.ts`) which are create-only templates that projects
|
|
17
|
-
* can customize without Lisa overwriting them.
|
|
18
|
-
*
|
|
19
|
-
* Coverage collection is scoped to standard Expo source directories
|
|
20
|
-
* rather than a catch-all glob, preventing config files, scripts, and
|
|
21
|
-
* plugins from distorting coverage numbers. The `app/` directory is
|
|
22
|
-
* excluded because Expo Router file-based routing makes those files thin
|
|
23
|
-
* wrappers (8-15 lines) that just re-export feature components.
|
|
24
|
-
* `*View.{ts,tsx}` files are excluded because the Container/View pattern
|
|
25
|
-
* puts all logic in Container files — Views are purely presentational.
|
|
26
|
-
*
|
|
27
|
-
* Inheritance chain:
|
|
28
|
-
* expo.ts (this file)
|
|
29
|
-
* └── base.ts
|
|
30
|
-
* @see https://jestjs.io/docs/configuration
|
|
31
|
-
* @see https://github.com/expo/expo/issues/40184
|
|
32
|
-
* @module configs/jest/expo
|
|
33
|
-
*/
|
|
34
1
|
import type { Config } from "jest";
|
|
35
2
|
import { defaultCoverageExclusions, defaultThresholds, mergeConfigs, mergeThresholds, worktreeTestPathIgnorePatterns } from "./base.js";
|
|
36
3
|
export { defaultCoverageExclusions, defaultThresholds, mergeConfigs, mergeThresholds, worktreeTestPathIgnorePatterns, };
|
|
4
|
+
/**
|
|
5
|
+
* Selects the React Native Jest resolver path appropriate for the installed
|
|
6
|
+
* Expo SDK. Prefers the SDK 56 location when `@react-native/jest-preset` is
|
|
7
|
+
* present, otherwise falls back to the SDK 54 location.
|
|
8
|
+
* @param canResolve - Resolution predicate (defaults to a real project-scoped
|
|
9
|
+
* `require.resolve` check); injectable for testing both SDKs.
|
|
10
|
+
* @returns The resolver module path for the project's installed SDK.
|
|
11
|
+
*/
|
|
12
|
+
export declare const selectExpoJestResolver: (canResolve?: (specifier: string) => boolean) => string;
|
|
37
13
|
/**
|
|
38
14
|
* Options for configuring the Expo Jest config factory.
|
|
39
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expo.d.ts","sourceRoot":"","sources":["../../../src/configs/jest/expo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expo.d.ts","sourceRoot":"","sources":["../../../src/configs/jest/expo.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,8BAA8B,EAC/B,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,8BAA8B,GAC/B,CAAC;AAiCF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAY,CAAC,SAAS,EAAE,MAAM,KAAK,OAA+B,KACjE,MAAyE,CAAC;AAE7E;;GAEG;AACH,UAAU,eAAe;IACvB,gEAAgE;IAChE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAClD;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAAI,8BAG/B,eAAoB,KAAG,MAuDxB,CAAC"}
|
|
@@ -1,6 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jest Configuration - Expo Stack
|
|
3
|
+
*
|
|
4
|
+
* Provides Expo/React Native-specific Jest configuration without using
|
|
5
|
+
* the `jest-expo` preset directly. The preset's `setupFiles` include
|
|
6
|
+
* `react-native/jest/setup.js` which redefines `window` via
|
|
7
|
+
* `Object.defineProperties` — incompatible with jsdom's non-configurable
|
|
8
|
+
* `window` property, causing "Cannot redefine property: window" errors.
|
|
9
|
+
*
|
|
10
|
+
* Instead, this config manually replicates the preset's resolution,
|
|
11
|
+
* transform, and haste settings without any preset setupFiles.
|
|
12
|
+
*
|
|
13
|
+
* `setupFiles` and `setupFilesAfterEnv` are configured here to wire up
|
|
14
|
+
* the base jest setup files (`jest.setup.pre.js` and `jest.setup.ts`).
|
|
15
|
+
* These base files import project-local overrides (`jest.setup.pre.local.js`
|
|
16
|
+
* and `jest.setup.local.ts`) which are create-only templates that projects
|
|
17
|
+
* can customize without Lisa overwriting them.
|
|
18
|
+
*
|
|
19
|
+
* Coverage collection is scoped to standard Expo source directories
|
|
20
|
+
* rather than a catch-all glob, preventing config files, scripts, and
|
|
21
|
+
* plugins from distorting coverage numbers. The `app/` directory is
|
|
22
|
+
* excluded because Expo Router file-based routing makes those files thin
|
|
23
|
+
* wrappers (8-15 lines) that just re-export feature components.
|
|
24
|
+
* `*View.{ts,tsx}` files are excluded because the Container/View pattern
|
|
25
|
+
* puts all logic in Container files — Views are purely presentational.
|
|
26
|
+
*
|
|
27
|
+
* Inheritance chain:
|
|
28
|
+
* expo.ts (this file)
|
|
29
|
+
* └── base.ts
|
|
30
|
+
* @see https://jestjs.io/docs/configuration
|
|
31
|
+
* @see https://github.com/expo/expo/issues/40184
|
|
32
|
+
* @module configs/jest/expo
|
|
33
|
+
*/
|
|
34
|
+
import { createRequire } from "node:module";
|
|
1
35
|
import { defaultCoverageExclusions, defaultThresholds, mergeConfigs, mergeThresholds, worktreeTestPathIgnorePatterns, } from "./base.js";
|
|
2
36
|
// Re-export base utilities for entry-point configs
|
|
3
37
|
export { defaultCoverageExclusions, defaultThresholds, mergeConfigs, mergeThresholds, worktreeTestPathIgnorePatterns, };
|
|
38
|
+
/**
|
|
39
|
+
* SDK 56 / RN 0.85 relocated the React Native Jest resolver. On SDK 56 it
|
|
40
|
+
* lives at `@react-native/jest-preset/jest/resolver.js`; on SDK 54 / RN 0.81
|
|
41
|
+
* `@react-native/jest-preset` is not installed and the resolver still lives at
|
|
42
|
+
* `react-native/jest/resolver.js`. Picking the wrong one aborts Jest with a
|
|
43
|
+
* "module not found" error, so the choice must be made against what the
|
|
44
|
+
* consuming project actually has installed.
|
|
45
|
+
*/
|
|
46
|
+
const SDK56_RESOLVER = "@react-native/jest-preset/jest/resolver.js";
|
|
47
|
+
const LEGACY_RESOLVER = "react-native/jest/resolver.js";
|
|
48
|
+
/**
|
|
49
|
+
* Predicate that reports whether a module specifier can be resolved from the
|
|
50
|
+
* consuming project. Mirrors the runtime auto-detection style this factory
|
|
51
|
+
* already uses (e.g. `existsSync` for the `/src` convention) and is injectable
|
|
52
|
+
* so the choice can be exercised in tests without an installed RN toolchain.
|
|
53
|
+
* @param specifier - The module specifier to attempt to resolve.
|
|
54
|
+
* @returns `true` when the specifier resolves from the project's `node_modules`.
|
|
55
|
+
*/
|
|
56
|
+
const canResolveFromProject = (specifier) => {
|
|
57
|
+
// Resolve relative to the consuming project's CWD (where Jest runs) rather
|
|
58
|
+
// than Lisa's own `node_modules`, so hoisted/nested installs are honored.
|
|
59
|
+
const projectRequire = createRequire(`${process.cwd()}/noop.js`);
|
|
60
|
+
try {
|
|
61
|
+
projectRequire.resolve(specifier);
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Selects the React Native Jest resolver path appropriate for the installed
|
|
70
|
+
* Expo SDK. Prefers the SDK 56 location when `@react-native/jest-preset` is
|
|
71
|
+
* present, otherwise falls back to the SDK 54 location.
|
|
72
|
+
* @param canResolve - Resolution predicate (defaults to a real project-scoped
|
|
73
|
+
* `require.resolve` check); injectable for testing both SDKs.
|
|
74
|
+
* @returns The resolver module path for the project's installed SDK.
|
|
75
|
+
*/
|
|
76
|
+
export const selectExpoJestResolver = (canResolve = canResolveFromProject) => (canResolve(SDK56_RESOLVER) ? SDK56_RESOLVER : LEGACY_RESOLVER);
|
|
4
77
|
/**
|
|
5
78
|
* Creates a Jest configuration for Expo/React Native projects.
|
|
6
79
|
* @param options - Configuration options for threshold overrides
|
|
@@ -17,11 +90,11 @@ export const getExpoJestConfig = ({ thresholds = defaultThresholds, sourceRoot =
|
|
|
17
90
|
defaultPlatform: "ios",
|
|
18
91
|
platforms: ["android", "ios", "native"],
|
|
19
92
|
},
|
|
20
|
-
//
|
|
21
|
-
// `react-native/jest/resolver.js` and into `@react-native/jest-preset`.
|
|
22
|
-
// This resolver is what teaches Jest to resolve platform-extension files
|
|
93
|
+
// This resolver teaches Jest to resolve platform-extension files
|
|
23
94
|
// (`.ios`/`.native`/`.web`); without it those variants do not resolve.
|
|
24
|
-
|
|
95
|
+
// Its location moved between SDK 54 and SDK 56, so the path is chosen at
|
|
96
|
+
// config-build time against what the consuming project has installed.
|
|
97
|
+
resolver: selectExpoJestResolver(),
|
|
25
98
|
setupFiles: ["<rootDir>/jest.setup.pre.js"],
|
|
26
99
|
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
|
|
27
100
|
transform: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expo.js","sourceRoot":"","sources":["../../../src/configs/jest/expo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expo.js","sourceRoot":"","sources":["../../../src/configs/jest/expo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5C,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,8BAA8B,GAC/B,MAAM,WAAW,CAAC;AAEnB,mDAAmD;AACnD,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,8BAA8B,GAC/B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,cAAc,GAAG,4CAA4C,CAAC;AACpE,MAAM,eAAe,GAAG,+BAA+B,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EAAE,yBAAyB,CAAC;IAChE,sBAAsB,EAAE;QACtB,gBAAgB;QAChB,QAAQ;QACR,SAAS;QACT,GAAG,8BAA8B,EAAE;KACpC;IACD,uBAAuB,EAAE;QACvB,0WAA0W;KAC3W;IACD,oBAAoB,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IAChE,mBAAmB,EAAE;QACnB,GAAG,UAAU,0BAA0B;QACvC,GAAG,UAAU,sBAAsB;QACnC,GAAG,UAAU,yBAAyB;QACtC,GAAG,UAAU,wBAAwB;QACrC,GAAG,UAAU,qBAAqB;QAClC,GAAG,UAAU,mBAAmB;QAChC,GAAG,UAAU,yBAAyB;QACtC,GAAG,UAAU,sBAAsB;QACnC,GAAG,UAAU,sBAAsB;QACnC,GAAG,UAAU,qBAAqB;QAClC,GAAG,UAAU,qBAAqB;QAClC,oBAAoB;QACpB,GAAG,yBAAyB;KAC7B;IACD,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"lodash": ">=4.18.1"
|
|
84
84
|
},
|
|
85
85
|
"name": "@codyswann/lisa",
|
|
86
|
-
"version": "2.
|
|
86
|
+
"version": "2.133.0",
|
|
87
87
|
"description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
|
|
88
88
|
"main": "dist/index.js",
|
|
89
89
|
"exports": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.133.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.133.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, across Claude and Codex.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.133.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.133.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.133.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|