devnote-dev / devnote-dev/geode

Project Templates

未关闭
#1 0 条评论 0 个 reaction 已指派 1 人 已被 @devnote-dev 认领 在 GitHub 查看
enhancement help wanted
主要语言
Crystal
星标
13
派生
3
PR 合并指标
30 天内没有已合并 PR

描述

Project templates will be an improved design of the existing `crystal init` command to build default and custom project file structures. An old, experimental concept of this exists in the project which doesn't have a clear design or structure. This issue provides the design and scope for this, with subsequent issues & PRs to follow the implementation.

### Project-level setup
###### (note: these are all mock concepts that probably need to be finalised).

In `shard.yml`: custom field `project-templates: path/to/dir`

In project directory:

```yaml
# templates.yml
namespace: root-name
author: ...
version: ...
source: ...
files:
- a/b/c
- d/e/f

templates:
- name: foo
control: path/to/control_file.lua
```

Control files will *control* how projects are setup according to the template. Scripts are executed in a Lua sandbox with limited functions.

```lua
-- control_file.lua
println "welcome to the setup"
print "enter your project name: "
name = get_str_input() -- also available: 'get_bool_input()' & 'get_int_input()'

make_dir "src"
write_file("src/" .. name .. ".cr")
...
```

Full list of functions TBD.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。