clikit-plugin 0.2.2 → 0.2.3

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 (2) hide show
  1. package/dist/cli.js +9 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -47,10 +47,15 @@ function parseConfig(configPath) {
47
47
  return { config: {}, raw: "", parseError: null };
48
48
  }
49
49
  const content = fs.readFileSync(configPath, "utf-8");
50
- const cleaned = content.replace(/\/\/.*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, "");
51
- const cleanedTrailing = cleaned.replace(/,\s*([}\]])/g, "$1");
52
- const parsed = JSON.parse(cleanedTrailing);
53
- return { config: parsed, raw: content, parseError: null };
50
+ try {
51
+ const parsed = JSON.parse(content);
52
+ return { config: parsed, raw: content, parseError: null };
53
+ } catch {
54
+ const cleaned = content.replace(/\/\*[\s\S]*?\*\//g, "");
55
+ const cleanedTrailing = cleaned.replace(/,\s*([}\]])/g, "$1");
56
+ const parsed = JSON.parse(cleanedTrailing);
57
+ return { config: parsed, raw: content, parseError: null };
58
+ }
54
59
  } catch (err) {
55
60
  const raw = fs.existsSync(configPath) ? fs.readFileSync(configPath, "utf-8") : "";
56
61
  return { config: {}, raw, parseError: String(err) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clikit-plugin",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "OpenCode plugin with 10 agents, 19 commands, 48 skills, 14 hooks",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",