Skip to content

Commit 7a80072

Browse files
authored
Merge pull request #42 from qianmoQ/dev-25.0.2
chore (released): 发布 25.0.2
2 parents 637ea73 + ca0d8f4 commit 7a80072

File tree

11 files changed

+258
-32
lines changed

11 files changed

+258
-32
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ CodeForge 是一款轻量级、高性能的桌面代码执行器,专为开发
2626
- **Clojure**
2727
- **Go**
2828
- **Java**
29+
- **JavaScript (Node.js)**
2930
- **Kotlin**
3031
- **Node.js**
3132
- **Python 2**

docs/content/release/25.0.2.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: 25.0.2
3+
---
4+
5+
CodeForge v25.0.2 隆重登场!本次更新是我们迄今为止最具雄心的版本,大幅扩展了编程语言支持范围,并对编辑器体验进行了全方位优化。从主流语言到小众语言,从界面美化到功能增强,我们致力于为每一位开发者提供更完善的代码执行环境。
6+
7+
---
8+
9+
## 📦 版本信息
10+
11+
- **项目地址**https://github.com/devlive-community/codeforge
12+
- **官方网站**https://codeforge.devlive.org/
13+
- **版本号**:v25.0.2
14+
- **发布日期**:2025年8月24日
15+
16+
---
17+
18+
## 🚀 重大功能更新
19+
20+
### 🌐 编程语言支持大扩展
21+
我们在短时间内新增了 **7 种编程语言**,覆盖了从系统编程到函数式编程的各个领域:
22+
23+
#### 新增语言一览
24+
- **🟡 JavaScript (Node.js 引擎)** - 前端开发必备,服务端 JavaScript 执行
25+
- **⚡ C 语言** - 系统编程之父,性能与控制的完美结合
26+
- **🧩 Clojure** - 现代 Lisp 方言,函数式编程的优雅实现
27+
- **🎯 Kotlin** - Android 开发首选,Java 的现代化替代
28+
- **⚖️ Scala** - 融合面向对象与函数式编程的强大语言
29+
- **🍎 Swift** - Apple 生态开发语言,现代化语法设计
30+
31+
#### 语言生态完善
32+
- **完整资源配套**:每种语言都配备了专属图标、语法高亮和执行模板
33+
- **智能排序**:使用语言标记对语言列表进行智能排序,提升选择效率
34+
- **模板优化**:为不同语言类型提供专门的代码模板
35+
36+
### 🎨 编辑器体验全面升级
37+
38+
#### 界面美化
39+
- **编辑器状态栏美化**:全新设计的状态栏,信息展示更清晰
40+
- **单词提示框优化**:美化代码自动完成提示框,提升编码体验
41+
- **加载状态显示**:状态栏显示加载状态,操作反馈更及时
42+
43+
#### 个性化配置
44+
- **行号显示控制**:支持自定义是否显示编辑器行号
45+
- **字体大小调节**:支持编辑器文字大小个性化设置
46+
- **字段帮助配置**:新增配置项帮助提示功能
47+
48+
### 🧩 UI 组件系统增强
49+
全新的组件库为更丰富的配置界面奠定基础:
50+
51+
- **📝 Input 组件**:标准化文本输入框,支持各种输入场景
52+
- **🏷️ Label 组件**:统一的标签组件,界面更协调
53+
- **🔢 Number 组件**:专门的数字输入组件,数值设置更便捷
54+
- **🔘 Switch 组件**:现代化开关控件,布尔选项更直观
55+
56+
---
57+
58+
## 🔧 核心功能优化
59+
60+
### 应用管理增强
61+
- **应用隐藏功能**:支持将应用隐藏到系统托盘,节省桌面空间
62+
- **跨平台适配**:应用隐藏功能根据不同平台进行优化适配
63+
- **GitHub 集成**:关于页面新增 GitHub 相关链接,方便用户参与社区
64+
65+
### 开发者体验提升
66+
- **模板变量支持**:增加 `$classname` 等模板变量,代码生成更智能
67+
- **初始化优化**:修复初始化语言获取错误,启动更稳定
68+
- **跨平台兼容**:修复 Windows 环境下的元素获取问题
69+
70+
---
71+
72+
## 🐛 问题修复与优化
73+
74+
### 界面问题修复
75+
- **Select 组件优化**:修复开启筛选时内容重叠的问题
76+
- **组件清理**:移除 Switch 组件中未使用的属性,代码更清洁
77+
- **依赖优化**:清理未使用的额外导入依赖,提升性能
78+
79+
### 稳定性提升
80+
- **Windows 兼容性**:专门修复 Windows 环境下的兼容性问题
81+
- **语言切换**:优化语言初始化流程,切换更流畅
82+
83+
---
84+
85+
## 📊 版本数据
86+
87+
- **支持语言总数**:13+ 种编程语言
88+
- **新增语言**:7 种
89+
- **新增 UI 组件**:4 个
90+
- **问题修复**:5+ 项
91+
- **功能优化**:10+ 项
92+
93+
---
94+
95+
## 🎯 适用场景扩展
96+
97+
随着语言支持的大幅扩展,CodeForge 现在适用于更多场景:
98+
99+
- **🎓 编程教育**:从 C 语言基础到现代语言特性的全方位学习
100+
- **📱 移动开发**:支持 Kotlin、Swift 等移动开发语言
101+
- **🌐 Web 开发**:JavaScript/Node.js 前后端开发支持
102+
- **🔬 算法研究**:函数式语言 Clojure、Scala 的算法实现
103+
- **⚡ 系统编程**:C 语言系统级编程验证
104+
- **🏢 企业开发**:Java、Kotlin、Scala 等企业级语言支持

docs/pageforge.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repo:
1414
branch: dev
1515

1616
banner:
17-
content: 💗 <a href="https://github.com/devlive-community/codeforge" target="_blank">CodeForge <em>2025.0.1</em> 已经发布, 如果喜欢我们的软件,请点击这里支持我们</a> ❤️
17+
content: 💗 <a href="https://github.com/devlive-community/codeforge" target="_blank">CodeForge <em>2025.0.2</em> 已经发布, 如果喜欢我们的软件,请点击这里支持我们</a> ❤️
1818

1919
feature:
2020
lucide:
@@ -43,5 +43,6 @@ footer:
4343

4444
nav:
4545
- 发布日志:
46+
- /release/25.0.2.md
4647
- /release/25.0.1.md
4748
- /release/25.0.0.md

public/icons/javascript-nodejs.svg

Lines changed: 12 additions & 0 deletions
Loading
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
use super::{LanguagePlugin, PluginConfig};
2+
use std::vec;
3+
4+
pub struct LanguageNodeJsPlugin;
5+
6+
impl LanguagePlugin for LanguageNodeJsPlugin {
7+
fn get_order(&self) -> i32 {
8+
13
9+
}
10+
11+
fn get_language_name(&self) -> &'static str {
12+
"JavaScript (Node.js)"
13+
}
14+
15+
fn get_language_key(&self) -> &'static str {
16+
"javascript-nodejs"
17+
}
18+
19+
fn get_file_extension(&self) -> String {
20+
self.get_config()
21+
.map(|config| config.extension.clone())
22+
.unwrap_or_else(|| "js".to_string())
23+
}
24+
25+
fn get_version_args(&self) -> Vec<&'static str> {
26+
vec!["--version"]
27+
}
28+
29+
fn get_path_command(&self) -> String {
30+
"which node".to_string()
31+
}
32+
33+
fn get_default_config(&self) -> PluginConfig {
34+
PluginConfig {
35+
enabled: true,
36+
language: String::from("javascript-nodejs"),
37+
before_compile: None,
38+
extension: String::from("js"),
39+
execute_home: None,
40+
run_command: Some(String::from("node $filename")),
41+
after_compile: None,
42+
template: Some(String::from(
43+
"// JavaScript (Node.js) 示例代码 - CodeForge 代码执行环境\n\nconsole.log('🎉 欢迎使用 CodeForge!');\nconsole.log('Welcome to CodeForge!');\nconsole.log('');\n\nconsole.log('=========================================');\nconsole.log(' CodeForge JavaScript ');\nconsole.log('=========================================');\nconsole.log('');\n\n// 基本输出示例\nconsole.log('✅ JavaScript 运行成功! (JavaScript is working!)');\nconsole.log('🌟 这是 Node.js 脚本 (This is Node.js script)');\nconsole.log('');\n\n// 变量操作\nconst name = 'CodeForge';\nconst version = 'JavaScript';\nconst number1 = 10;\nconst number2 = 20;\nconst result = number1 + number2;\n\nconsole.log('🔢 简单计算 (Simple calculation):');\nconsole.log(`${number1} + ${number2} = ${result}`);\nconsole.log('');\n\n// 字符串操作\nconsole.log('📝 字符串操作 (String operations):');\nconsole.log(`平台名称 (Platform): ${name}`);\nconsole.log(`语言版本 (Language): ${version}`);\nconsole.log(`完整信息 (Full info): ${name} - ${version}`);\nconsole.log('');\n\n// 循环示例\nconsole.log('🔄 循环输出 (Loop output):');\nfor (let i = 1; i <= 5; i++) {\n console.log(`第 ${i} 次输出 (Output #${i}): Hello from CodeForge!`);\n}\nconsole.log('');\n\n// 数组操作\nconst fruits = ['苹果', '香蕉', '橙子', '葡萄'];\nconsole.log('🍎 水果列表 (Fruit list):');\nfruits.forEach((fruit, index) => {\n console.log(`${index + 1}. ${fruit}`);\n});\nconsole.log('');\n\n// 条件判断\nconst score = 85;\nconsole.log('📊 成绩评估 (Score evaluation):');\nif (score >= 90) {\n console.log('优秀! (Excellent!)');\n} else if (score >= 80) {\n console.log('良好! (Good!)');\n} else if (score >= 60) {\n console.log('及格 (Pass)');\n} else {\n console.log('需要努力 (Need improvement)');\n}\nconsole.log('');\n\n// undefined 和 null 示例\nconsole.log('🔍 undefined/null 示例 (undefined/null example):');\nlet optionalValue = 42;\nif (optionalValue !== undefined && optionalValue !== null) {\n console.log(`可选值: ${optionalValue} (Optional value: ${optionalValue})`);\n} else {\n console.log('值为空 (Value is undefined/null)');\n}\nconsole.log('');\n\n// 函数示例\nfunction greetUser(username) {\n return `Hello, ${username}! 👋`;\n}\n\nconsole.log('🎭 函数示例 (Function example):');\nconst greeting = greetUser('CodeForge用户');\nconsole.log(greeting);\nconsole.log('');\n\n// 箭头函数示例\nconst addNumbers = (a, b) => a + b;\nconst multiplyNumbers = (a, b) => {\n return a * b;\n};\n\nconsole.log('⚡ 箭头函数示例 (Arrow function example):');\nconsole.log(`5 + 3 = ${addNumbers(5, 3)}`);\nconsole.log(`6 × 7 = ${multiplyNumbers(6, 7)}`);\nconsole.log('');\n\n// 数组高阶函数示例\nconsole.log('🔧 数组高阶函数示例 (Array higher-order functions):');\nconst numbers = Array.from({length: 10}, (_, i) => i + 1);\nconst evenNumbers = numbers.filter(num => num % 2 === 0);\nconst doubled = numbers.map(num => num * 2);\nconst sum = numbers.reduce((acc, num) => acc + num, 0);\n\nconsole.log(`原始数字 (Original): ${numbers.join(', ')}`);\nconsole.log(`偶数 (Even numbers): ${evenNumbers.join(', ')}`);\nconsole.log(`翻倍 (Doubled): ${doubled.join(', ')}`);\nconsole.log(`总和 (Sum): ${sum}`);\nconsole.log('');\n\n// 对象操作示例\nconsole.log('👤 对象示例 (Object example):');\nconst person = {\n name: '张三',\n age: 25,\n city: '北京',\n introduce() {\n return `我是${this.name},今年${this.age}岁,住在${this.city}`;\n }\n};\n\nconsole.log(`姓名: ${person.name}, 年龄: ${person.age}, 城市: ${person.city}`);\nconsole.log(person.introduce());\nconsole.log('');\n\n// 解构赋值示例\nconsole.log('🔍 解构赋值示例 (Destructuring assignment):');\nconst {name: personName, age: personAge} = person;\nconst [first, second, ...rest] = fruits;\n\nconsole.log(`解构对象 (Destructured object): ${personName}, ${personAge}`);\nconsole.log(`解构数组 (Destructured array): ${first}, ${second}, 其他: [${rest.join(', ')}]`);\nconsole.log('');\n\n// Promise 示例\nconsole.log('🎯 Promise 示例 (Promise example):');\nconst delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));\n\n// 使用 Promise\ndelay(100)\n .then(() => {\n console.log('Promise 已完成! (Promise completed!)');\n return '异步操作结果';\n })\n .then(result => {\n console.log(`异步结果: ${result}`);\n })\n .catch(error => {\n console.error('Promise 错误:', error);\n });\n\n// async/await 示例\nasync function asyncExample() {\n try {\n console.log('⏳ 开始异步操作...');\n await delay(50);\n console.log('✅ async/await 完成!');\n return '异步函数结果';\n } catch (error) {\n console.error('async/await 错误:', error);\n }\n}\n\n// 立即执行异步函数\n(async () => {\n const result = await asyncExample();\n console.log(`异步函数返回: ${result}`);\n console.log('');\n})();\n\n// 类和继承示例\nconsole.log('🏗️ 类示例 (Class example):');\nclass Animal {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n \n speak() {\n return `${this.name} 发出声音`;\n }\n}\n\nclass Dog extends Animal {\n constructor(name) {\n super(name, '狗');\n }\n \n speak() {\n return `${this.name} 汪汪叫`;\n }\n}\n\nconst dog = new Dog('小黄');\nconsole.log(dog.speak());\nconsole.log('');\n\n// 模块和导出示例(注释版本,因为这是单文件)\nconsole.log('📦 模块概念示例 (Module concept example):');\n// export const utilities = {\n// formatDate: (date) => date.toLocaleDateString('zh-CN'),\n// randomNumber: () => Math.floor(Math.random() * 100)\n// };\n\nconst utilities = {\n formatDate: (date) => date.toLocaleDateString('zh-CN'),\n randomNumber: () => Math.floor(Math.random() * 100)\n};\n\nconsole.log(`当前日期: ${utilities.formatDate(new Date())}`);\nconsole.log(`随机数: ${utilities.randomNumber()}`);\nconsole.log('');\n\n// JSON 操作示例\nconsole.log('📄 JSON 操作示例 (JSON operations):');\nconst data = {\n users: [\n {id: 1, name: 'Alice', active: true},\n {id: 2, name: 'Bob', active: false},\n {id: 3, name: 'Charlie', active: true}\n ]\n};\n\nconst jsonString = JSON.stringify(data, null, 2);\nconsole.log('JSON 字符串:');\nconsole.log(jsonString);\n\nconst parsedData = JSON.parse(jsonString);\nconst activeUsers = parsedData.users.filter(user => user.active);\nconsole.log(`活跃用户: ${activeUsers.map(u => u.name).join(', ')}`);\nconsole.log('');\n\n// 错误处理示例\nconsole.log('🚨 错误处理示例 (Error handling):');\ntry {\n const riskyOperation = () => {\n const random = Math.random();\n if (random < 0.5) {\n throw new Error('随机错误发生了!');\n }\n return '操作成功!';\n };\n \n const result2 = riskyOperation();\n console.log(result2);\n} catch (error) {\n console.log(`捕获错误: ${error.message}`);\n} finally {\n console.log('错误处理完成');\n}\nconsole.log('');\n\n// 正则表达式示例\nconsole.log('🔤 正则表达式示例 (Regular expressions):');\nconst text = 'CodeForge 是一个很棒的代码执行环境! Email: contact@codeforge.com';\nconst emailRegex = /\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b/g;\nconst emails = text.match(emailRegex);\n\nconsole.log(`文本: ${text}`);\nconsole.log(`找到的邮箱: ${emails ? emails.join(', ') : '无'}`);\nconsole.log('');\n\nconsole.log('🎯 CodeForge JavaScript 代码执行完成!');\nconsole.log('🎯 CodeForge JavaScript execution completed!');\nconsole.log('');\nconsole.log('感谢使用 CodeForge 代码执行环境! 🚀');\nconsole.log('Thank you for using CodeForge! 🚀');",
44+
)),
45+
timeout: Some(30),
46+
}
47+
}
48+
49+
fn get_default_command(&self) -> String {
50+
self.get_config()
51+
.and_then(|config| config.run_command.clone())
52+
.unwrap_or_else(|| "node".to_string())
53+
}
54+
}

src-tauri/src/plugins/manager.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::plugins::c::CPlugin;
33
use crate::plugins::clojure::ClojurePlugin;
44
use crate::plugins::go::GoPlugin;
55
use crate::plugins::java::JavaPlugin;
6+
use crate::plugins::javascript_nodejs::LanguageNodeJsPlugin;
67
use crate::plugins::kotlin::KotlinPlugin;
78
use crate::plugins::nodejs::NodeJSPlugin;
89
use crate::plugins::python2::Python2Plugin;
@@ -33,6 +34,10 @@ impl PluginManager {
3334
plugins.insert("kotlin".to_string(), Box::new(KotlinPlugin));
3435
plugins.insert("clojure".to_string(), Box::new(ClojurePlugin));
3536
plugins.insert("c".to_string(), Box::new(CPlugin));
37+
plugins.insert(
38+
"javascript-nodejs".to_string(),
39+
Box::new(LanguageNodeJsPlugin),
40+
);
3641

3742
Self { plugins }
3843
}

src-tauri/src/plugins/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ pub mod c;
349349
pub mod clojure;
350350
pub mod go;
351351
pub mod java;
352+
pub mod javascript_nodejs;
352353
pub mod kotlin;
353354
pub mod manager;
354355
pub mod nodejs;

src/components/AppHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="bg-white border-b border-gray-200 px-4 py-3 flex items-center justify-between">
33
<div class="flex items-center space-x-3">
44
<Select v-model="selectedLanguage"
5-
class="w-48"
5+
class="w-64"
66
searchable
77
:options="supportedLanguages as any"
88
:disabled="isRunning"

src/components/setting/Language.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
type="card"
55
size="md"
66
position="left"
7-
:tab-button-class="['w-36']"
7+
:tab-button-class="['w-48']"
88
:tabs="tabsPluginData"
99
@change="handleTabChange">
1010
<template #[activePlugin]="{ tab }">

0 commit comments

Comments
 (0)