Skip to content

Commit 7f84a14

Browse files
committed
feat: add comprehensive Clojure language support
Add complete Clojure programming language implementation with: - Tool detector for Java, Clojure CLI, Leiningen, Boot, clj-kondo, zprint - Config wizard for interactive project setup - Command runner with multi-build system support (CLI, Leiningen, Boot) - 9 command files: setup, test, build, repl, lint, format, run, deps, clean - Comprehensive test suite with 24 tests - User documentation with examples and best practices Features: - Java runtime detection and validation - Framework detection (Luminus, Pedestal, Compojure, Ring, Reitit, Fulcro) - REPL support (nREPL, Socket REPL, prepl) - ClojureScript detection (shadow-cljs, figwheel) - Intelligent error handling with Clojure-specific suggestions - Platform-specific installation instructions - All existing tests pass, no regressions
1 parent 42babac commit 7f84a14

15 files changed

Lines changed: 4076 additions & 0 deletions

commands/clojure-commands.md

Lines changed: 515 additions & 0 deletions
Large diffs are not rendered by default.

commands/clojure-setup.md

Lines changed: 453 additions & 0 deletions
Large diffs are not rendered by default.

languages/clojure/config-wizard.js

Lines changed: 446 additions & 0 deletions
Large diffs are not rendered by default.

languages/clojure/tool-detector.js

Lines changed: 1014 additions & 0 deletions
Large diffs are not rendered by default.

scripts/clojure/command-runner.js

Lines changed: 1021 additions & 0 deletions
Large diffs are not rendered by default.

scripts/commands/clojure-build.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Clojure Build Command
4+
*
5+
* Build Clojure projects with intelligent defaults
6+
*/
7+
8+
const ClojureCommandRunner = require('../clojure/command-runner');
9+
10+
async function main() {
11+
try {
12+
const runner = new ClojureCommandRunner();
13+
14+
// Parse arguments for build options
15+
const args = process.argv.slice(2);
16+
const options = {};
17+
18+
// Check for uberjar flag
19+
if (args.includes('--uberjar') || args.includes('-u')) {
20+
options.uberjar = true;
21+
// Remove the flag from args
22+
args = args.filter((arg) => !['--uberjar', '-u'].includes(arg));
23+
}
24+
25+
await runner.build(args, options);
26+
} catch (error) {
27+
console.error('❌ Clojure build failed:', error.message);
28+
process.exit(1);
29+
}
30+
}
31+
32+
if (require.main === module) {
33+
main();
34+
}
35+
36+
module.exports = { main };

scripts/commands/clojure-clean.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Clojure Clean Command
4+
*
5+
* Clean Clojure build artifacts
6+
*/
7+
8+
const ClojureCommandRunner = require('../clojure/command-runner');
9+
10+
async function main() {
11+
try {
12+
const runner = new ClojureCommandRunner();
13+
14+
// Parse arguments for clean options
15+
const args = process.argv.slice(2);
16+
const options = {};
17+
18+
// Check for all flag
19+
if (args.includes('--all') || args.includes('-a')) {
20+
options.all = true;
21+
// Remove the flag from args
22+
args = args.filter((arg) => !['--all', '-a'].includes(arg));
23+
}
24+
25+
await runner.clean(options);
26+
} catch (error) {
27+
console.error('❌ Clojure clean failed:', error.message);
28+
process.exit(1);
29+
}
30+
}
31+
32+
if (require.main === module) {
33+
main();
34+
}
35+
36+
module.exports = { main };

scripts/commands/clojure-deps.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Clojure Dependencies Command
4+
*
5+
* Update Clojure dependencies
6+
*/
7+
8+
const ClojureCommandRunner = require('../clojure/command-runner');
9+
10+
async function main() {
11+
try {
12+
const runner = new ClojureCommandRunner();
13+
await runner.deps(process.argv.slice(2));
14+
} catch (error) {
15+
console.error('❌ Clojure dependency update failed:', error.message);
16+
process.exit(1);
17+
}
18+
}
19+
20+
if (require.main === module) {
21+
main();
22+
}
23+
24+
module.exports = { main };

scripts/commands/clojure-format.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Clojure Format Command
4+
*
5+
* Format Clojure code with zprint
6+
*/
7+
8+
const ClojureCommandRunner = require('../clojure/command-runner');
9+
10+
async function main() {
11+
try {
12+
const runner = new ClojureCommandRunner();
13+
await runner.format(process.argv.slice(2));
14+
} catch (error) {
15+
console.error('❌ Clojure formatting failed:', error.message);
16+
process.exit(1);
17+
}
18+
}
19+
20+
if (require.main === module) {
21+
main();
22+
}
23+
24+
module.exports = { main };

scripts/commands/clojure-lint.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Clojure Lint Command
4+
*
5+
* Run clj-kondo linter on Clojure code
6+
*/
7+
8+
const ClojureCommandRunner = require('../clojure/command-runner');
9+
10+
async function main() {
11+
try {
12+
const runner = new ClojureCommandRunner();
13+
await runner.lint(process.argv.slice(2));
14+
} catch (error) {
15+
console.error('❌ Clojure linting failed:', error.message);
16+
process.exit(1);
17+
}
18+
}
19+
20+
if (require.main === module) {
21+
main();
22+
}
23+
24+
module.exports = { main };

0 commit comments

Comments
 (0)