commit da47bc53d6cc852619cd54a54727422ec348162c Author: muer <2024302111042@whu.edu.cn> Date: Fri Jul 10 23:10:43 2026 +0800 chore: initialize MoonBit module and repository metadata diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ccb400c --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +# MoonBit / build outputs +.moon/ +target/ +*.wasm +*.wat +*.js +*.c +*.o +*.a + +# Editor / OS +.DS_Store +.vscode/ +.idea/ + +# Local scratch +.tmp/ +dist/ +coverage/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..dbec4d4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,45 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work. + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on or derived from the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link or bind by name to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, provided that You meet the conditions in this section. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You shall be under the terms and conditions of this License. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +8. Limitation of Liability. In no event and under no legal theory shall any Contributor be liable to You for damages arising in any way out of the use of or inability to use the Work. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer support, warranty, indemnity, or other liability obligations only on Your own behalf. + +END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md new file mode 100644 index 0000000..8a1acf5 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# Moon Layout Core + +Moon Layout Core 是一个面向 MoonBit 生态的轻量图布局核心库,计划为流程图、状态机、数据流图、IDE 插件和 Web 可视化工具提供可复用的基础布局能力。 + +本项目参考 Eclipse Layout Kernel(ELK)的图模型思想和 JSON 交换方式,但不完整复刻 ELK 的 Java/Eclipse 插件体系,也不复制上游源码。 + +## 当前阶段 + +- [x] 初始化 MoonBit 模块和仓库元数据 +- [x] 添加开源许可证与第三方项目说明 +- [ ] 实现图数据模型 +- [ ] 实现基础布局算法 +- [ ] 增加测试、示例和 CI + +## Planned API + +```moonbit +let graph = new_graph("demo") +let report = layout(graph, grid_options(3)) +``` + +## License + +Apache-2.0。 diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md new file mode 100644 index 0000000..9bd13a7 --- /dev/null +++ b/THIRD_PARTY_NOTICES.md @@ -0,0 +1,11 @@ +# Third-party Notices + +## Eclipse Layout Kernel + +This project is inspired by the graph model and layout exchange ideas of Eclipse Layout Kernel (ELK), but the MVP implementation does not copy source code from ELK. + +- Upstream project: Eclipse Layout Kernel +- Repository: https://github.com/eclipse-elk/elk +- License: Eclipse Public License 2.0 + +If future versions directly port upstream ELK source code, algorithms, generated test cases or documentation, the project license and notices must be reviewed before release. diff --git a/moon.mod.json b/moon.mod.json new file mode 100644 index 0000000..a46b676 --- /dev/null +++ b/moon.mod.json @@ -0,0 +1,15 @@ +{ + "name": "yourname/moon-layout-core", + "version": "0.1.0", + "readme": "README.md", + "repository": "https://github.com/YOUR_GITHUB_USERNAME/moon-layout-core", + "license": "Apache-2.0", + "keywords": [ + "graph", + "layout", + "elk-json", + "visualization", + "moonbit" + ], + "description": "A lightweight graph layout core library for MoonBit, with an ELK JSON compatible subset." +} diff --git a/moon.pkg b/moon.pkg new file mode 100644 index 0000000..1d086a7 --- /dev/null +++ b/moon.pkg @@ -0,0 +1,7 @@ +import { + "moonbitlang/core/json", +} + +options( + "is-main": false, +)