@moneko/core 4.11.5-beta.1 → 4.11.5-beta.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.
- package/lib/bin/setup.d.mts +2 -0
- package/lib/bin/setup.mjs +1 -0
- package/package.json +1 -1
- package/lib/commom/ai-hooks.d.mts +0 -1
- package/lib/commom/ai-hooks.mjs +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{argv as o}from"node:process";import{ensureClaudeHooks as m,ensureCodexHooks as r}from"../commom/ai-hooks.mjs";import c from"../commom/check-npm.mjs";import{corepack as p}from"../commom/corepack.mjs";import{parseArgs as s}from"../commom/parse-args.mjs";import{CONFIG as i}from"../config.mjs";export default function(){p(i.corepack),c(),s(o)["ai-hooks"]&&(r(),m())};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/lib/commom/ai-hooks.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{existsSync as o,mkdirSync as e,readFileSync as s,writeFileSync as t}from"node:fs";import{dirname as m,resolve as r}from"node:path";import{paths as h}from"./paths.mjs";let n=h.programPath,i='bash "$(git rev-parse --show-toplevel)/node_modules/@moneko/core/hooks/eslint-fix.sh"',p='bash "$(git rev-parse --show-toplevel)/node_modules/@moneko/core/hooks/stylelint-fix.sh"',l=r(n,".codex/config.toml"),a=o(l)?s(l,"utf8"):"[features]\nhooks = true\n";for(let o of(a.includes("[[hooks.Stop]]")||(a=`${a.trimEnd()}
|
|
2
|
-
|
|
3
|
-
[[hooks.Stop]]
|
|
4
|
-
matcher = ".*"
|
|
5
|
-
`),[i,p])){let e=JSON.stringify(o);a.includes(`command = ${e}`)||(a=`${a.trimEnd()}
|
|
6
|
-
|
|
7
|
-
[[hooks.Stop.hooks]]
|
|
8
|
-
type = "command"
|
|
9
|
-
command = ${e}
|
|
10
|
-
`)}e(m(l),{recursive:!0}),t(l,a);let d=r(n,".claude/settings.json"),c=o(d)?JSON.parse(s(d,"utf8")):{};c.hooks??={},c.hooks.Stop??=[];let f=c.hooks.Stop.find(o=>o?.matcher===".*");for(let o of(f||(f={matcher:".*",hooks:[]},c.hooks.Stop.push(f)),f.hooks??=[],[i,p]))f.hooks.some(e=>e?.type==="command"&&e.command===o)||f.hooks.push({type:"command",command:o});e(m(d),{recursive:!0}),t(d,`${JSON.stringify(c,null,2)}
|
|
11
|
-
`);
|