@codyswann/lisa 1.60.0 → 1.60.1
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/deletions.json +2 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +3 -12
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/prompts.d.ts +0 -8
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +0 -10
- package/dist/cli/prompts.js.map +1 -1
- package/dist/core/config.d.ts +1 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +0 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/lisa.d.ts +1 -36
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +6 -211
- package/dist/core/lisa.js.map +1 -1
- package/dist/strategies/copy-contents.d.ts +1 -1
- package/dist/strategies/copy-contents.d.ts.map +1 -1
- package/dist/strategies/copy-contents.js +3 -12
- package/dist/strategies/copy-contents.js.map +1 -1
- package/dist/strategies/copy-overwrite.d.ts +1 -1
- package/dist/strategies/copy-overwrite.d.ts.map +1 -1
- package/dist/strategies/copy-overwrite.js +2 -11
- package/dist/strategies/copy-overwrite.js.map +1 -1
- package/dist/strategies/create-only.d.ts +1 -2
- package/dist/strategies/create-only.d.ts.map +1 -1
- package/dist/strategies/create-only.js +2 -8
- package/dist/strategies/create-only.js.map +1 -1
- package/dist/strategies/merge.d.ts +1 -1
- package/dist/strategies/merge.d.ts.map +1 -1
- package/dist/strategies/merge.js +2 -9
- package/dist/strategies/merge.js.map +1 -1
- package/dist/strategies/package-lisa.d.ts.map +1 -1
- package/dist/strategies/package-lisa.js +0 -5
- package/dist/strategies/package-lisa.js.map +1 -1
- package/dist/strategies/strategy.interface.d.ts +1 -3
- package/dist/strategies/strategy.interface.d.ts.map +1 -1
- package/dist/strategies/tagged-merge.d.ts +2 -2
- package/dist/strategies/tagged-merge.d.ts.map +1 -1
- package/dist/strategies/tagged-merge.js +3 -8
- package/dist/strategies/tagged-merge.js.map +1 -1
- package/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/dist/core/manifest.d.ts +0 -71
- package/dist/core/manifest.d.ts.map +0 -1
- package/dist/core/manifest.js +0 -146
- package/dist/core/manifest.js.map +0 -1
package/all/deletions.json
CHANGED
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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwBpC;;;GAGG;AACH,wBAAgB,aAAa,IAAI,OAAO,CA4BvC;AA+GD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import * as path from "node:path";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { GitService } from "../core/git-service.js";
|
|
5
5
|
import { Lisa } from "../core/lisa.js";
|
|
6
|
-
import { DryRunManifestService, ManifestService } from "../core/manifest.js";
|
|
7
6
|
import { DetectorRegistry } from "../detection/index.js";
|
|
8
7
|
import { ConsoleLogger } from "../logging/index.js";
|
|
9
8
|
import { StrategyRegistry } from "../strategies/index.js";
|
|
@@ -33,7 +32,6 @@ export function createProgram() {
|
|
|
33
32
|
.option("-n, --dry-run", "Show what would be done without making changes")
|
|
34
33
|
.option("-y, --yes", "Non-interactive mode (auto-accept defaults, overwrite on conflict)")
|
|
35
34
|
.option("-v, --validate", "Validate project compatibility without applying changes")
|
|
36
|
-
.option("-u, --uninstall", "Remove Lisa-managed files from the project")
|
|
37
35
|
.option("--skip-git-check", "Skip dirty git working directory check (for postinstall use)")
|
|
38
36
|
.action(async (destination, options) => {
|
|
39
37
|
await runLisa(destination, options);
|
|
@@ -52,7 +50,6 @@ function printUsageAndExit() {
|
|
|
52
50
|
console.log(" -n, --dry-run Show what would be done without making changes");
|
|
53
51
|
console.log(" -y, --yes Non-interactive mode (auto-accept defaults, overwrite on conflict)");
|
|
54
52
|
console.log(" -v, --validate Validate project compatibility without applying changes");
|
|
55
|
-
console.log(" -u, --uninstall Remove Lisa-managed files from the project");
|
|
56
53
|
console.log(" --skip-git-check Skip dirty git working directory check (for postinstall use)");
|
|
57
54
|
console.log(" -h, --help Show this help message");
|
|
58
55
|
console.log("");
|
|
@@ -61,7 +58,6 @@ function printUsageAndExit() {
|
|
|
61
58
|
console.log(" lisa --dry-run .");
|
|
62
59
|
console.log(" lisa --yes /path/to/project # CI/CD pipeline usage");
|
|
63
60
|
console.log(" lisa --validate . # Check compatibility only");
|
|
64
|
-
console.log(" lisa --uninstall . # Remove Lisa configurations");
|
|
65
61
|
process.exit(1);
|
|
66
62
|
}
|
|
67
63
|
/**
|
|
@@ -75,9 +71,6 @@ function createDependencies(dryRun, yesMode, logger) {
|
|
|
75
71
|
return {
|
|
76
72
|
logger,
|
|
77
73
|
prompter: createPrompter(yesMode),
|
|
78
|
-
manifestService: dryRun
|
|
79
|
-
? new DryRunManifestService()
|
|
80
|
-
: new ManifestService(),
|
|
81
74
|
backupService: dryRun
|
|
82
75
|
? new DryRunBackupService()
|
|
83
76
|
: new BackupService(logger),
|
|
@@ -110,11 +103,9 @@ async function runLisa(destination, options) {
|
|
|
110
103
|
const deps = createDependencies(dryRun, yesMode, logger);
|
|
111
104
|
const lisa = new Lisa(config, deps);
|
|
112
105
|
try {
|
|
113
|
-
const result = options.
|
|
114
|
-
? await lisa.
|
|
115
|
-
:
|
|
116
|
-
? await lisa.validate()
|
|
117
|
-
: await lisa.apply();
|
|
106
|
+
const result = options.validate
|
|
107
|
+
? await lisa.validate()
|
|
108
|
+
: await lisa.apply();
|
|
118
109
|
if (!result.success) {
|
|
119
110
|
result.errors.forEach(error => logger.error(error));
|
|
120
111
|
process.exit(1);
|
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,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAyB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAyB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CA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
25
25
|
* @returns True if user wants to proceed despite dirty state
|
|
26
26
|
*/
|
|
27
27
|
confirmDirtyGit(status: string): Promise<boolean>;
|
|
28
|
-
/**
|
|
29
|
-
* Prompt when project is already on the latest Lisa version
|
|
30
|
-
* @param version The current Lisa version
|
|
31
|
-
* @returns True if user wants to proceed with update anyway
|
|
32
|
-
*/
|
|
33
|
-
confirmLatestVersion(version: string): Promise<boolean>;
|
|
34
28
|
}
|
|
35
29
|
/**
|
|
36
30
|
* Interactive prompter using {@link https://github.com/enquirer/enquirer inquirer}/prompts
|
|
@@ -39,7 +33,6 @@ export declare class InteractivePrompter implements IPrompter {
|
|
|
39
33
|
promptOverwrite(relativePath: string): Promise<OverwriteDecision>;
|
|
40
34
|
confirmProjectTypes(detected: readonly ProjectType[]): Promise<readonly ProjectType[]>;
|
|
41
35
|
confirmDirtyGit(status: string): Promise<boolean>;
|
|
42
|
-
confirmLatestVersion(version: string): Promise<boolean>;
|
|
43
36
|
}
|
|
44
37
|
/**
|
|
45
38
|
* Auto-accepting prompter for non-interactive mode
|
|
@@ -51,7 +44,6 @@ export declare class AutoAcceptPrompter implements IPrompter {
|
|
|
51
44
|
promptOverwrite(_relativePath: string): Promise<OverwriteDecision>;
|
|
52
45
|
confirmProjectTypes(detected: readonly ProjectType[]): Promise<readonly ProjectType[]>;
|
|
53
46
|
confirmDirtyGit(status: string): Promise<boolean>;
|
|
54
|
-
confirmLatestVersion(_version: string): Promise<boolean>;
|
|
55
47
|
}
|
|
56
48
|
/**
|
|
57
49
|
* Check if running in interactive mode (TTY available)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/cli/prompts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAarD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,CAAC;AAEtD;;GAEG;AACH,MAAM,W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G,OAAO,CAAC,iBAAiB,CAAC;IAIlE,mBAAmB,CACvB,QAAQ,EAAE,SAAS,WAAW,EAAE,GAC/B,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC;IAI5B,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAwBxD;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAK1D"}
|
package/dist/cli/prompts.js
CHANGED
|
@@ -38,12 +38,6 @@ export class InteractivePrompter {
|
|
|
38
38
|
default: false,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
async confirmLatestVersion(version) {
|
|
42
|
-
return confirm({
|
|
43
|
-
message: `You are already on the latest version of Lisa (${version}). Are you sure you want to update again?`,
|
|
44
|
-
default: false,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
41
|
}
|
|
48
42
|
/**
|
|
49
43
|
* Auto-accepting prompter for non-interactive mode
|
|
@@ -78,10 +72,6 @@ export class AutoAcceptPrompter {
|
|
|
78
72
|
default: false,
|
|
79
73
|
});
|
|
80
74
|
}
|
|
81
|
-
async confirmLatestVersion(_version) {
|
|
82
|
-
// In auto-accept mode, proceed with update even if on latest version
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
75
|
}
|
|
86
76
|
/**
|
|
87
77
|
* Check if running in interactive mode (TTY available)
|
package/dist/cli/prompts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/cli/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;GAEG;AACH,MAAM,0BAA0B,GAAG,iCAAiC,CAAC;AAErE;;GAEG;AACH,MAAM,yBAAyB,GAC7B,iFAAiF,CAAC;
|
|
1
|
+
{"version":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":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,OAAO,GACP,cAAc,GACd,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,KAAK,GACL,aAAa,GACb,OAAO,CAAC;AAEZ;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC,CAQ/B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,WAAW,EAO3C,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAOzC,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,4CAA4C;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAEzB,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,4DAA4D;IAC5D,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAE/B,gFAAgF;IAChF,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,OAAO,GACP,cAAc,GACd,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,YA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IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,oEAAoE;IACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/C,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,iBAAiB,CAUzD"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export * from "./config.js";
|
|
2
2
|
export { Lisa, type LisaDependencies } from "./lisa.js";
|
|
3
|
-
export { ManifestService, DryRunManifestService, ManifestNotFoundError, MANIFEST_FILENAME, type IManifestService, type ManifestEntry, } from "./manifest.js";
|
|
4
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/core/index.js
CHANGED
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAyB,MAAM,WAAW,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAyB,MAAM,WAAW,CAAC"}
|
package/dist/core/lisa.d.ts
CHANGED
|
@@ -5,14 +5,12 @@ import { StrategyRegistry } from "../strategies/index.js";
|
|
|
5
5
|
import type { IBackupService } from "../transaction/index.js";
|
|
6
6
|
import type { LisaConfig, LisaResult } from "./config.js";
|
|
7
7
|
import type { IGitService } from "./git-service.js";
|
|
8
|
-
import type { IManifestService } from "./manifest.js";
|
|
9
8
|
/**
|
|
10
9
|
* Dependencies for Lisa operations
|
|
11
10
|
*/
|
|
12
11
|
export interface LisaDependencies {
|
|
13
12
|
readonly logger: ILogger;
|
|
14
13
|
readonly prompter: IPrompter;
|
|
15
|
-
readonly manifestService: IManifestService;
|
|
16
14
|
readonly backupService: IBackupService;
|
|
17
15
|
readonly detectorRegistry: DetectorRegistry;
|
|
18
16
|
readonly strategyRegistry: StrategyRegistry;
|
|
@@ -31,7 +29,7 @@ export declare class Lisa {
|
|
|
31
29
|
private readonly lisaignoreSuffix;
|
|
32
30
|
/**
|
|
33
31
|
* Initialize Lisa orchestrator
|
|
34
|
-
* @param config - Configuration for the apply
|
|
32
|
+
* @param config - Configuration for the apply operation
|
|
35
33
|
* @param deps - Injected service dependencies
|
|
36
34
|
*/
|
|
37
35
|
constructor(config: LisaConfig, deps: LisaDependencies);
|
|
@@ -39,15 +37,6 @@ export declare class Lisa {
|
|
|
39
37
|
* Initialize services
|
|
40
38
|
*/
|
|
41
39
|
private initServices;
|
|
42
|
-
/**
|
|
43
|
-
* Check if project is already on the latest Lisa version
|
|
44
|
-
*/
|
|
45
|
-
private checkForLatestVersion;
|
|
46
|
-
/**
|
|
47
|
-
* Get the current Lisa version
|
|
48
|
-
* @returns The version string from package.json, or "unknown" if it cannot be read
|
|
49
|
-
*/
|
|
50
|
-
private getCurrentLisaVersion;
|
|
51
40
|
/**
|
|
52
41
|
* Detect and confirm project types
|
|
53
42
|
*/
|
|
@@ -96,26 +85,6 @@ export declare class Lisa {
|
|
|
96
85
|
* @returns Result of the validate operation
|
|
97
86
|
*/
|
|
98
87
|
validate(): Promise<LisaResult>;
|
|
99
|
-
/**
|
|
100
|
-
* Uninstall Lisa-managed files from the project
|
|
101
|
-
* @returns Result of the uninstall operation with removal statistics
|
|
102
|
-
*/
|
|
103
|
-
uninstall(): Promise<LisaResult>;
|
|
104
|
-
/**
|
|
105
|
-
* Process single uninstall entry and return updated counts
|
|
106
|
-
* @param entry - Manifest entry to process for removal
|
|
107
|
-
* @param stats - Current removal statistics
|
|
108
|
-
* @param stats.removed - Number of files removed so far
|
|
109
|
-
* @param stats.skipped - Number of files skipped so far
|
|
110
|
-
* @returns Updated removal statistics after processing this entry
|
|
111
|
-
*/
|
|
112
|
-
private processEntry;
|
|
113
|
-
/**
|
|
114
|
-
* Process manifest entries during uninstall
|
|
115
|
-
* @param entries Manifest entries to process
|
|
116
|
-
* @returns Stats with removed and skipped counts
|
|
117
|
-
*/
|
|
118
|
-
private processUninstallEntries;
|
|
119
88
|
/**
|
|
120
89
|
* Process all files for a given project type
|
|
121
90
|
* @param type Project type to process
|
|
@@ -213,9 +182,5 @@ export declare class Lisa {
|
|
|
213
182
|
* @param projectDir - The destination project directory to inspect
|
|
214
183
|
*/
|
|
215
184
|
private printMigrationNotices;
|
|
216
|
-
/**
|
|
217
|
-
* Remove empty directories after uninstall
|
|
218
|
-
*/
|
|
219
|
-
private removeEmptyDirectories;
|
|
220
185
|
}
|
|
221
186
|
//# sourceMappingURL=lisa.d.ts.map
|
package/dist/core/lisa.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lisa.d.ts","sourceRoot":"","sources":["../../src/core/lisa.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAwB,MAAM,wBAAwB,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAM9D,OAAO,KAAK,EAIV,UAAU,EACV,UAAU,EAGX,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"lisa.d.ts","sourceRoot":"","sources":["../../src/core/lisa.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAwB,MAAM,wBAAwB,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAM9D,OAAO,KAAK,EAIV,UAAU,EACV,UAAU,EAGX,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,cAAc,CAAC;IACvC,Q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B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAYrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA6EzB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAazB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAgB7B;;OAEG;IACH,OAAO,CAAC,YAAY;IAOpB;;;;;OAKG;YACW,WAAW;IAQzB;;;;;OAKG;YACW,qBAAqB;CAqDpC"}
|
package/dist/core/lisa.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/* eslint-disable max-lines -- Main orchestrator class with apply/
|
|
1
|
+
/* eslint-disable max-lines -- Main orchestrator class with apply/validate operations */
|
|
2
2
|
import * as fse from "fs-extra";
|
|
3
|
-
import {
|
|
3
|
+
import { readFile, stat } from "node:fs/promises";
|
|
4
4
|
import * as path from "node:path";
|
|
5
5
|
import pc from "picocolors";
|
|
6
6
|
import { DestinationNotDirectoryError, DestinationNotFoundError, UserAbortedError, } from "../errors/index.js";
|
|
@@ -23,7 +23,7 @@ export class Lisa {
|
|
|
23
23
|
lisaignoreSuffix = "(.lisaignore)";
|
|
24
24
|
/**
|
|
25
25
|
* Initialize Lisa orchestrator
|
|
26
|
-
* @param config - Configuration for the apply
|
|
26
|
+
* @param config - Configuration for the apply operation
|
|
27
27
|
* @param deps - Injected service dependencies
|
|
28
28
|
*/
|
|
29
29
|
constructor(config, deps) {
|
|
@@ -34,60 +34,9 @@ export class Lisa {
|
|
|
34
34
|
* Initialize services
|
|
35
35
|
*/
|
|
36
36
|
async initServices() {
|
|
37
|
-
const { backupService
|
|
37
|
+
const { backupService } = this.deps;
|
|
38
38
|
if (!this.config.dryRun) {
|
|
39
39
|
await backupService.init(this.config.destDir);
|
|
40
|
-
await manifestService.init(this.config.destDir, this.config.lisaDir);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Check if project is already on the latest Lisa version
|
|
45
|
-
*/
|
|
46
|
-
async checkForLatestVersion() {
|
|
47
|
-
const { prompter, manifestService, logger } = this.deps;
|
|
48
|
-
// Skip in dry run and validate modes
|
|
49
|
-
if (this.config.dryRun || this.config.validateOnly) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
try {
|
|
53
|
-
const manifestVersion = await manifestService.readVersion(this.config.destDir);
|
|
54
|
-
// Only check if manifest exists (project has been initialized before)
|
|
55
|
-
if (!manifestVersion) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
// Get current Lisa version
|
|
59
|
-
const currentVersion = await this.getCurrentLisaVersion();
|
|
60
|
-
if (manifestVersion === currentVersion) {
|
|
61
|
-
logger.info(`Project is on Lisa version ${manifestVersion}`);
|
|
62
|
-
const proceed = await prompter.confirmLatestVersion(manifestVersion);
|
|
63
|
-
if (!proceed) {
|
|
64
|
-
throw new UserAbortedError("Update cancelled: project is already on the latest version");
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
// If error is UserAbortedError, re-throw it
|
|
70
|
-
if (error instanceof UserAbortedError) {
|
|
71
|
-
throw error;
|
|
72
|
-
}
|
|
73
|
-
// For other errors, log and continue
|
|
74
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
75
|
-
logger.warn(`Could not check version: ${message}`);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Get the current Lisa version
|
|
80
|
-
* @returns The version string from package.json, or "unknown" if it cannot be read
|
|
81
|
-
*/
|
|
82
|
-
async getCurrentLisaVersion() {
|
|
83
|
-
try {
|
|
84
|
-
const packageJsonPath = path.join(this.config.lisaDir, "package.json");
|
|
85
|
-
const content = await readFile(packageJsonPath, "utf-8");
|
|
86
|
-
const packageJson = JSON.parse(content);
|
|
87
|
-
return packageJson.version || "unknown";
|
|
88
|
-
}
|
|
89
|
-
catch {
|
|
90
|
-
return "unknown";
|
|
91
40
|
}
|
|
92
41
|
}
|
|
93
42
|
/**
|
|
@@ -203,9 +152,8 @@ export class Lisa {
|
|
|
203
152
|
* @returns Promise that resolves when finalization is complete
|
|
204
153
|
*/
|
|
205
154
|
async finalize() {
|
|
206
|
-
const {
|
|
155
|
+
const { backupService } = this.deps;
|
|
207
156
|
if (!this.config.dryRun) {
|
|
208
|
-
await manifestService.finalize();
|
|
209
157
|
await backupService.cleanup();
|
|
210
158
|
}
|
|
211
159
|
}
|
|
@@ -258,7 +206,6 @@ export class Lisa {
|
|
|
258
206
|
await this.validateGitState();
|
|
259
207
|
this.printHeader();
|
|
260
208
|
await this.initServices();
|
|
261
|
-
await this.checkForLatestVersion();
|
|
262
209
|
await this.detectTypes();
|
|
263
210
|
await this.processConfigurations();
|
|
264
211
|
await this.processDeletions();
|
|
@@ -279,123 +226,6 @@ export class Lisa {
|
|
|
279
226
|
// Validate mode is essentially a dry run
|
|
280
227
|
return this.apply();
|
|
281
228
|
}
|
|
282
|
-
/**
|
|
283
|
-
* Uninstall Lisa-managed files from the project
|
|
284
|
-
* @returns Result of the uninstall operation with removal statistics
|
|
285
|
-
*/
|
|
286
|
-
async uninstall() {
|
|
287
|
-
const { logger, manifestService } = this.deps;
|
|
288
|
-
// Validate destination
|
|
289
|
-
await this.validateDestination();
|
|
290
|
-
// Print header
|
|
291
|
-
console.log("");
|
|
292
|
-
console.log(pc.blue(this.separator));
|
|
293
|
-
console.log(pc.blue(" Lisa Uninstaller"));
|
|
294
|
-
console.log(pc.blue(this.separator));
|
|
295
|
-
console.log("");
|
|
296
|
-
const errors = [];
|
|
297
|
-
try {
|
|
298
|
-
// Read manifest
|
|
299
|
-
const entries = await manifestService.read(this.config.destDir);
|
|
300
|
-
logger.info(`Reading manifest: ${path.join(this.config.destDir, ".lisa-manifest")}`);
|
|
301
|
-
console.log("");
|
|
302
|
-
// Process entries
|
|
303
|
-
const stats = await this.processUninstallEntries(entries);
|
|
304
|
-
// Remove empty directories and manifest
|
|
305
|
-
if (!this.config.dryRun) {
|
|
306
|
-
await this.removeEmptyDirectories();
|
|
307
|
-
await manifestService.remove(this.config.destDir);
|
|
308
|
-
logger.success("Removed manifest file");
|
|
309
|
-
}
|
|
310
|
-
// Print summary
|
|
311
|
-
console.log("");
|
|
312
|
-
console.log(pc.green(this.separator));
|
|
313
|
-
console.log(pc.green(this.config.dryRun
|
|
314
|
-
? " Lisa Uninstall Dry Run Complete"
|
|
315
|
-
: " Lisa Uninstall Complete!"));
|
|
316
|
-
console.log(pc.green(this.separator));
|
|
317
|
-
console.log("");
|
|
318
|
-
console.log(` ${pc.green("Removed:")} ${String(stats.removed).padStart(3)} files`);
|
|
319
|
-
console.log(` ${pc.yellow("Skipped:")} ${String(stats.skipped).padStart(3)} files (manual review needed)`);
|
|
320
|
-
console.log("");
|
|
321
|
-
return {
|
|
322
|
-
success: true,
|
|
323
|
-
counters: {
|
|
324
|
-
...this.counters,
|
|
325
|
-
copied: stats.removed,
|
|
326
|
-
skipped: stats.skipped,
|
|
327
|
-
},
|
|
328
|
-
detectedTypes: [],
|
|
329
|
-
mode: "uninstall",
|
|
330
|
-
errors,
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
catch (error) {
|
|
334
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
335
|
-
logger.error(message);
|
|
336
|
-
errors.push(message);
|
|
337
|
-
return {
|
|
338
|
-
success: false,
|
|
339
|
-
counters: this.counters,
|
|
340
|
-
detectedTypes: [],
|
|
341
|
-
mode: "uninstall",
|
|
342
|
-
errors,
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Process single uninstall entry and return updated counts
|
|
348
|
-
* @param entry - Manifest entry to process for removal
|
|
349
|
-
* @param stats - Current removal statistics
|
|
350
|
-
* @param stats.removed - Number of files removed so far
|
|
351
|
-
* @param stats.skipped - Number of files skipped so far
|
|
352
|
-
* @returns Updated removal statistics after processing this entry
|
|
353
|
-
*/
|
|
354
|
-
async processEntry(entry, stats) {
|
|
355
|
-
const { logger } = this.deps;
|
|
356
|
-
const destFile = path.join(this.config.destDir, entry.relativePath);
|
|
357
|
-
switch (entry.strategy) {
|
|
358
|
-
case "copy-overwrite":
|
|
359
|
-
case "create-only": {
|
|
360
|
-
if (await fse.pathExists(destFile)) {
|
|
361
|
-
if (this.config.dryRun) {
|
|
362
|
-
logger.dry(`Would remove: ${entry.relativePath}`);
|
|
363
|
-
}
|
|
364
|
-
else {
|
|
365
|
-
await fse.remove(destFile);
|
|
366
|
-
logger.success(`Removed: ${entry.relativePath}`);
|
|
367
|
-
}
|
|
368
|
-
return { ...stats, removed: stats.removed + 1 };
|
|
369
|
-
}
|
|
370
|
-
return { ...stats, skipped: stats.skipped + 1 };
|
|
371
|
-
}
|
|
372
|
-
case "copy-contents": {
|
|
373
|
-
logger.warn(`Cannot auto-remove (copy-contents): ${entry.relativePath}`);
|
|
374
|
-
logger.info(" Manually review and remove added lines if needed.");
|
|
375
|
-
return { ...stats, skipped: stats.skipped + 1 };
|
|
376
|
-
}
|
|
377
|
-
case "merge":
|
|
378
|
-
case "tagged-merge": {
|
|
379
|
-
logger.warn(`Cannot auto-remove (merged JSON): ${entry.relativePath}`);
|
|
380
|
-
logger.info(" Manually remove Lisa-added keys if needed.");
|
|
381
|
-
return { ...stats, skipped: stats.skipped + 1 };
|
|
382
|
-
}
|
|
383
|
-
default:
|
|
384
|
-
return { ...stats, skipped: stats.skipped + 1 };
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* Process manifest entries during uninstall
|
|
389
|
-
* @param entries Manifest entries to process
|
|
390
|
-
* @returns Stats with removed and skipped counts
|
|
391
|
-
*/
|
|
392
|
-
async processUninstallEntries(entries) {
|
|
393
|
-
const initial = { removed: 0, skipped: 0 };
|
|
394
|
-
return await entries.reduce(async (statsPromise, entry) => {
|
|
395
|
-
const stats = await statsPromise;
|
|
396
|
-
return this.processEntry(entry, stats);
|
|
397
|
-
}, Promise.resolve(initial));
|
|
398
|
-
}
|
|
399
229
|
/**
|
|
400
230
|
* Process all files for a given project type
|
|
401
231
|
* @param type Project type to process
|
|
@@ -437,9 +267,6 @@ export class Lisa {
|
|
|
437
267
|
});
|
|
438
268
|
const context = {
|
|
439
269
|
config: this.config,
|
|
440
|
-
recordFile: (relativePath, strat) => {
|
|
441
|
-
this.deps.manifestService.record(relativePath, strat);
|
|
442
|
-
},
|
|
443
270
|
backupFile: async (absolutePath) => {
|
|
444
271
|
await this.deps.backupService.backup(absolutePath);
|
|
445
272
|
await this.deps.backupService.persistentBackup(absolutePath);
|
|
@@ -782,38 +609,6 @@ export class Lisa {
|
|
|
782
609
|
console.log(" After this one-time change, quality/release workflow updates will be automatic.");
|
|
783
610
|
console.log("");
|
|
784
611
|
}
|
|
785
|
-
/**
|
|
786
|
-
* Remove empty directories after uninstall
|
|
787
|
-
*/
|
|
788
|
-
async removeEmptyDirectories() {
|
|
789
|
-
const destDir = this.config.destDir;
|
|
790
|
-
const removeEmpty = async (dir) => {
|
|
791
|
-
if (dir === destDir)
|
|
792
|
-
return;
|
|
793
|
-
if (dir.includes(".git") || dir.includes("node_modules"))
|
|
794
|
-
return;
|
|
795
|
-
try {
|
|
796
|
-
const entries = await readdir(dir);
|
|
797
|
-
if (entries.length === 0) {
|
|
798
|
-
await rmdir(dir);
|
|
799
|
-
// Recursively check parent
|
|
800
|
-
await removeEmpty(path.dirname(dir));
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
catch {
|
|
804
|
-
// Directory might not exist or not be empty
|
|
805
|
-
}
|
|
806
|
-
};
|
|
807
|
-
// Get all directories and check if empty
|
|
808
|
-
const entries = await readdir(destDir, { withFileTypes: true });
|
|
809
|
-
for (const entry of entries) {
|
|
810
|
-
if (entry.isDirectory() &&
|
|
811
|
-
!entry.name.startsWith(".git") &&
|
|
812
|
-
entry.name !== "node_modules") {
|
|
813
|
-
await removeEmpty(path.join(destDir, entry.name));
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
612
|
}
|
|
818
|
-
/* eslint-enable max-lines -- Main orchestrator class with apply/
|
|
613
|
+
/* eslint-enable max-lines -- Main orchestrator class with apply/validate operations */
|
|
819
614
|
//# sourceMappingURL=lisa.js.map
|