@getcoherent/cli 0.6.47 → 0.6.49

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.js +7 -14
  3. package/package.json +10 -10
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Sergei Kovtun
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.js CHANGED
@@ -5028,11 +5028,12 @@ async function applyModification(request, dsm, cm, pm, projectRoot, aiProvider,
5028
5028
  const relPath = filePath.replace(projectRoot + "/", "").replace(projectRoot + "\\", "");
5029
5029
  const tscErrors = runTscCheck(projectRoot).filter((e) => e.file === relPath);
5030
5030
  if (tscErrors.length > 0) {
5031
- const bestSnapshot = codeToWrite;
5031
+ let bestSnapshot = codeToWrite;
5032
5032
  const detResult = await applyDeterministicFixes(tscErrors, projectRoot, tscBackups);
5033
- let bestErrorCount = Math.min(tscErrors.length, tscErrors.length - detResult.fixed.length);
5033
+ const bestErrorCount = detResult.remaining.length;
5034
5034
  if (detResult.fixed.length > 0) {
5035
5035
  codeToWrite = await readFile(filePath);
5036
+ bestSnapshot = codeToWrite;
5036
5037
  console.log(
5037
5038
  chalk8.green(` \u2714 Fixed ${tscErrors.length - detResult.remaining.length} TypeScript error(s)`)
5038
5039
  );
@@ -5057,9 +5058,7 @@ Keep all existing functionality intact.`,
5057
5058
  if (afterErrors.length > bestErrorCount) {
5058
5059
  await writeFile(filePath, bestSnapshot);
5059
5060
  codeToWrite = bestSnapshot;
5060
- console.log(
5061
- chalk8.yellow(` \u26A0 AI fix regressed TypeScript errors. Reverted to best version.`)
5062
- );
5061
+ console.log(chalk8.yellow(` \u26A0 AI fix regressed TypeScript errors. Reverted to best version.`));
5063
5062
  } else {
5064
5063
  codeToWrite = reFixed;
5065
5064
  console.log(
@@ -5072,18 +5071,14 @@ Keep all existing functionality intact.`,
5072
5071
  }
5073
5072
  } catch (tscAiErr) {
5074
5073
  console.log(
5075
- chalk8.dim(
5076
- ` \u26A0 AI tsc fix skipped: ${tscAiErr instanceof Error ? tscAiErr.message : "unknown"}`
5077
- )
5074
+ chalk8.dim(` \u26A0 AI tsc fix skipped: ${tscAiErr instanceof Error ? tscAiErr.message : "unknown"}`)
5078
5075
  );
5079
5076
  }
5080
5077
  }
5081
5078
  }
5082
5079
  } catch (tscErr) {
5083
5080
  console.log(
5084
- chalk8.dim(
5085
- ` \u26A0 TypeScript check skipped: ${tscErr instanceof Error ? tscErr.message : "unknown"}`
5086
- )
5081
+ chalk8.dim(` \u26A0 TypeScript check skipped: ${tscErr instanceof Error ? tscErr.message : "unknown"}`)
5087
5082
  );
5088
5083
  }
5089
5084
  const pageIdx = dsm.getConfig().pages.findIndex((p) => p.id === page.id);
@@ -8825,9 +8820,7 @@ async function fixCommand(opts = {}) {
8825
8820
  }
8826
8821
  }
8827
8822
  } catch (err) {
8828
- console.log(
8829
- chalk15.yellow(` \u26A0 TypeScript check skipped: ${err instanceof Error ? err.message : "unknown error"}`)
8830
- );
8823
+ console.log(chalk15.yellow(` \u26A0 TypeScript check skipped: ${err instanceof Error ? err.message : "unknown error"}`));
8831
8824
  }
8832
8825
  if (fixes.length === 0 && totalErrors === 0 && totalWarnings === 0 && remaining.length === 0) {
8833
8826
  console.log(chalk15.green("\n \u2705 Everything looks good \u2014 no issues found\n"));
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.6.47",
6
+ "version": "0.6.49",
7
7
  "description": "CLI interface for Coherent Design Method",
8
8
  "type": "module",
9
9
  "main": "./dist/index.js",
@@ -33,15 +33,8 @@
33
33
  ],
34
34
  "author": "Coherent Design Method",
35
35
  "license": "MIT",
36
- "scripts": {
37
- "dev": "tsup --watch",
38
- "build": "tsup",
39
- "typecheck": "tsc --noEmit",
40
- "test": "vitest"
41
- },
42
36
  "dependencies": {
43
37
  "@anthropic-ai/sdk": "^0.32.0",
44
- "@getcoherent/core": "workspace:*",
45
38
  "chalk": "^5.3.0",
46
39
  "chokidar": "^4.0.1",
47
40
  "commander": "^11.1.0",
@@ -49,7 +42,8 @@
49
42
  "open": "^10.1.0",
50
43
  "ora": "^7.0.1",
51
44
  "prompts": "^2.4.2",
52
- "zod": "^3.22.4"
45
+ "zod": "^3.22.4",
46
+ "@getcoherent/core": "0.6.49"
53
47
  },
54
48
  "devDependencies": {
55
49
  "@types/node": "^20.11.0",
@@ -58,5 +52,11 @@
58
52
  "react": "^19.2.4",
59
53
  "tsup": "^8.0.1",
60
54
  "typescript": "^5.3.3"
55
+ },
56
+ "scripts": {
57
+ "dev": "tsup --watch",
58
+ "build": "tsup",
59
+ "typecheck": "tsc --noEmit",
60
+ "test": "vitest"
61
61
  }
62
- }
62
+ }