deuk-agent-rule 1.0.13 → 2.2.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.
@@ -2,7 +2,7 @@
2
2
  * Populates ../DeukAgentRulesOSS for the public GitHub repo.
3
3
  * Run: cd deuk-agent-rule && npm run sync:oss
4
4
  */
5
- import { cpSync, existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "fs";
5
+ import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, unlinkSync, writeFileSync } from "fs";
6
6
  import { dirname, join } from "path";
7
7
  import { fileURLToPath } from "url";
8
8
 
@@ -25,7 +25,7 @@ function gitBase() {
25
25
  const base = gitBase();
26
26
  const gitUrl = base.startsWith("http") ? "git+" + base + ".git" : base;
27
27
 
28
- /** Public mirror: no prebump/postchangelog (internal sync / polish hooks). */
28
+ /** Strip OSS package.json hooks not used in the public mirror. */
29
29
  function stripOssVersionrcScripts(ossVersionrcPath) {
30
30
  let t = readFileSync(ossVersionrcPath, "utf8").replace(/\r\n/g, "\n");
31
31
  t = t.replace(/\n scripts:\s*\{\n[\s\S]*?\n \},\s*\n/, "\n");
@@ -39,13 +39,14 @@ cpSync(join(pkgRoot, "publish"), join(ossRoot, "publish"), { recursive: true, fo
39
39
  if (existsSync(join(pkgRoot, ".github"))) {
40
40
  cpSync(join(pkgRoot, ".github"), join(ossRoot, ".github"), { recursive: true, force: true });
41
41
  }
42
- cpSync(join(pkgRoot, "scripts", "cli.mjs"), join(ossRoot, "scripts", "cli.mjs"), { force: true });
43
- cpSync(join(pkgRoot, "scripts", "merge-logic.mjs"), join(ossRoot, "scripts", "merge-logic.mjs"), {
44
- force: true,
45
- });
46
- cpSync(join(pkgRoot, "scripts", "sync-bundle.mjs"), join(ossRoot, "scripts", "sync-bundle.mjs"), {
47
- force: true,
48
- });
42
+
43
+ // Modular CLI: Copy all runtime scripts, exclude internal sync tools
44
+ const scriptsDir = join(pkgRoot, "scripts");
45
+ for (const name of readdirSync(scriptsDir)) {
46
+ if (!name.endsWith(".mjs")) continue;
47
+ if (name === "sync-oss.mjs" || name === "sync-bundle.mjs") continue;
48
+ cpSync(join(scriptsDir, name), join(ossRoot, "scripts", name), { force: true });
49
+ }
49
50
 
50
51
  if (!existsSync(ossPublic)) {
51
52
  throw new Error("Missing oss-public/: " + ossPublic);