Skip to content

Commit bab7657

Browse files
authored
Merge pull request #1293 from dacgray/add-commands-to-junie
feat: add support for JetBrains Junie commands
2 parents 8c3dc77 + 88be270 commit bab7657

9 files changed

Lines changed: 675 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ See [Quick Start guide](https://dyoshikawa.github.io/rulesync/getting-started/qu
8080
| Qwen Code | qwencode ||| | | | | |
8181
| Kiro | kiro ||||||| |
8282
| Google Antigravity | antigravity || | || | ✅ 🌏 | |
83-
| JetBrains Junie | junie |||| ||| |
83+
| JetBrains Junie | junie |||| ✅ 🌏 ||| |
8484
| AugmentCode | augmentcode ||| | | | | |
8585
| Windsurf | windsurf ||| | | | | |
8686
| Warp | warp || | | | | | |

docs/reference/supported-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Rulesync supports both **generation** and **import** for All of the major AI cod
2020
| Qwen Code | qwencode ||| | | | | |
2121
| Kiro | kiro ||||||| |
2222
| Google Antigravity | antigravity || | || | ✅ 🌏 | |
23-
| JetBrains Junie | junie |||| ||| |
23+
| JetBrains Junie | junie |||| ✅ 🌏 ||| |
2424
| AugmentCode | augmentcode ||| | | | | |
2525
| Windsurf | windsurf ||| | | | | |
2626
| Warp | warp || | | | | | |

skills/rulesync/supported-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Rulesync supports both **generation** and **import** for All of the major AI cod
2020
| Qwen Code | qwencode ||| | | | | |
2121
| Kiro | kiro ||||||| |
2222
| Google Antigravity | antigravity || | || | ✅ 🌏 | |
23-
| JetBrains Junie | junie |||| ||| |
23+
| JetBrains Junie | junie |||| ✅ 🌏 ||| |
2424
| AugmentCode | augmentcode ||| | | | | |
2525
| Windsurf | windsurf ||| | | | | |
2626
| Warp | warp || | | | | | |

src/features/commands/cline-command.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,32 @@ Step 1`;
8282

8383
expect(command.getFileContent()).toBe("");
8484
});
85+
86+
it("should skip validation when validate is false", () => {
87+
const command = new ClineCommand({
88+
baseDir: testDir,
89+
relativeDirPath: ".clinerules/workflows",
90+
relativeFilePath: "test.md",
91+
fileContent: validContent,
92+
validate: false,
93+
});
94+
95+
expect(command).toBeInstanceOf(ClineCommand);
96+
expect(command.getFileContent()).toBe(validContent);
97+
});
98+
});
99+
100+
describe("getBody", () => {
101+
it("should return the command body", () => {
102+
const command = new ClineCommand({
103+
baseDir: testDir,
104+
relativeDirPath: ".clinerules/workflows",
105+
relativeFilePath: "test.md",
106+
fileContent: validContent,
107+
});
108+
109+
expect(command.getBody()).toBe(validContent);
110+
});
85111
});
86112

87113
describe("toRulesyncCommand", () => {

src/features/commands/commands-processor.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { ClineCommand } from "./cline-command.js";
1111
import { CommandsProcessor, CommandsProcessorToolTarget } from "./commands-processor.js";
1212
import { CursorCommand } from "./cursor-command.js";
1313
import { GeminiCliCommand } from "./geminicli-command.js";
14+
import { JunieCommand } from "./junie-command.js";
1415
import { KiloCommand } from "./kilo-command.js";
1516
import { OpenCodeCommand } from "./opencode-command.js";
1617
import { RooCommand } from "./roo-command.js";
@@ -52,6 +53,11 @@ vi.mock("./geminicli-command.js", () => ({
5253
return { ...config, isDeletable: () => true };
5354
}),
5455
}));
56+
vi.mock("./junie-command.js", () => ({
57+
JunieCommand: vi.fn().mockImplementation(function (config) {
58+
return { ...config, isDeletable: () => true };
59+
}),
60+
}));
5561
vi.mock("./kilo-command.js", () => ({
5662
KiloCommand: vi.fn().mockImplementation(function (config) {
5763
return { ...config, isDeletable: () => true };
@@ -114,6 +120,19 @@ vi.mocked(ClaudecodeCommand).forDeletion = vi.fn().mockImplementation((params) =
114120
getRelativeFilePath: () => params.relativeFilePath,
115121
}));
116122

123+
// Set up static methods after mocking
124+
vi.mocked(JunieCommand).fromFile = vi.fn();
125+
vi.mocked(JunieCommand).fromRulesyncCommand = vi.fn();
126+
vi.mocked(JunieCommand).isTargetedByRulesyncCommand = vi.fn().mockReturnValue(true);
127+
vi.mocked(JunieCommand).getSettablePaths = vi.fn().mockImplementation((_options = {}) => ({
128+
relativeDirPath: join(".junie", "commands"),
129+
}));
130+
vi.mocked(JunieCommand).forDeletion = vi.fn().mockImplementation((params) => ({
131+
...params,
132+
isDeletable: () => true,
133+
getRelativeFilePath: () => params.relativeFilePath,
134+
}));
135+
117136
// Set up static methods after mocking
118137
vi.mocked(GeminiCliCommand).fromFile = vi.fn();
119138
vi.mocked(GeminiCliCommand).fromRulesyncCommand = vi.fn();
@@ -1168,6 +1187,7 @@ describe("CommandsProcessor", () => {
11681187
"copilot",
11691188
"cursor",
11701189
"geminicli",
1190+
"junie",
11711191
"kilo",
11721192
"kiro",
11731193
"opencode",
@@ -1189,6 +1209,7 @@ describe("CommandsProcessor", () => {
11891209
"cursor",
11901210
"factorydroid",
11911211
"geminicli",
1212+
"junie",
11921213
"kilo",
11931214
"kiro",
11941215
"opencode",
@@ -1209,6 +1230,7 @@ describe("CommandsProcessor", () => {
12091230
"cursor",
12101231
"factorydroid",
12111232
"geminicli",
1233+
"junie",
12121234
"codexcli",
12131235
"kilo",
12141236
"opencode",
@@ -1244,6 +1266,7 @@ describe("CommandsProcessor", () => {
12441266
"claudecode-legacy",
12451267
"cline",
12461268
"geminicli",
1269+
"junie",
12471270
"kilo",
12481271
"roo",
12491272
];

src/features/commands/commands-processor.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { CopilotCommand } from "./copilot-command.js";
1818
import { CursorCommand } from "./cursor-command.js";
1919
import { FactorydroidCommand } from "./factorydroid-command.js";
2020
import { GeminiCliCommand } from "./geminicli-command.js";
21+
import { JunieCommand } from "./junie-command.js";
2122
import { KiloCommand } from "./kilo-command.js";
2223
import { KiroCommand } from "./kiro-command.js";
2324
import { OpenCodeCommand } from "./opencode-command.js";
@@ -72,6 +73,7 @@ const commandsProcessorToolTargetTuple = [
7273
"cursor",
7374
"factorydroid",
7475
"geminicli",
76+
"junie",
7577
"kilo",
7678
"kiro",
7779
"opencode",
@@ -218,6 +220,19 @@ const toolCommandFactories = new Map<CommandsProcessorToolTarget, ToolCommandFac
218220
},
219221
},
220222
],
223+
[
224+
"junie",
225+
{
226+
class: JunieCommand,
227+
meta: {
228+
extension: "md",
229+
supportsProject: true,
230+
supportsGlobal: true,
231+
isSimulated: false,
232+
supportsSubdirectory: false,
233+
},
234+
},
235+
],
221236
[
222237
"kilo",
223238
{

0 commit comments

Comments
 (0)