Comments (5)
Landing some of this here: #1398
from moon.
All great ideas. A few comments:
- Sort prompts - Would an
order
config for each prompt be enough for this? - Conditional prompts - This seems tricky, but maybe doable if other things land first.
- Internal variables - Easy enough.
- Dynamic template chain - Would have to look into.
- Automatic template help - We'll be adding template related commands in the future.
- Shared mutable memory properties - Would have to look into.
- Iterate variables - I think you can use
__tera_context
for this: https://keats.github.io/tera/docs/#variables
from moon.
@milesj great to hear there are! I see moon as the tool that will be always there, so the greater its template support the better! 🥳
from moon.
Looks like I forgot to actually send the detailed response:
- Sort prompts - Would an
order
config for each prompt be enough for this?
For sorting, yes. But if you ever want to support prompt flows, maybe it is better to move it to an array of objects.
- Conditional prompts - This seems tricky, but maybe doable if other things land first.
There's a way you can add features little by little and get conditional, and a more flexible prompt flow, way better than sorted
- Make it an array which allows ordering
- Make it a tree by add a
prompts
property to a prompt. Order moves to a depth-first tree walk - add a
guard
|when
property to the prompt, and only go down the tree if the parent value matches theguard
It could look something like this (I'm sure you'll pick better names):
variables:
- name: color
type: 'enum'
values: ['red', 'green']
default: 'red'
prompt: 'Favorite color?'
next:
# only one will execute
# but that can be decided by the tree visitor
# there's no need to pre-evaluate the flow
- case: 'red'
name: question_1
type: string
prompt: 'Name 3 red fruits'
next: # both will be executed
# no case here
- name: question_2
type: string
prompt: 'Another red question'
# neither here
- name: question_3
type: string
prompt: 'Another red question'
- case: 'green'
name: question_1
type: string
prompt: 'Name 3 mostly green country flags'
next:
- ...
- Iterate variables - I think you can use
__tera_context
for this: https://keats.github.io/tera/docs/#variables
I tried but it doesn't work. As they say, it is a magical
... I guess it is magical because you can't touch it, only print it lol
from moon.
Landed some of these in v1.23.
from moon.
Related Issues (20)
- [bug] Task hasher looks at VCS root rather than workspace root HOT 4
- 1.23.0 build failure HOT 2
- [bug] moon clean fails to clean HOT 1
- [bug] Runnable target isn't distributed HOT 2
- [feature] Generic "Tooling Provider" Integration HOT 2
- [feature] Gitlab merged results and merge train support HOT 4
- [bug] `runDepsInParallel: false` does not seem to work correctly when the dependent task has its own dependencies HOT 5
- [feature] being able to set a "mutex" option for tasks HOT 1
- [bug] Started getting `Too many open files (os error 24)` on `fs:read` after upgrading 1.20.2 -> 1.23.4 on MacOS HOT 7
- [bug] Docker example doesn't work when using bun base image HOT 4
- [bug] Running a basic task hangs indefinitely for large app HOT 2
- [bug] Double bun install HOT 10
- [bug] After update to 1.24, VSCode complains about `moon.yml` matching multiple schemas HOT 2
- [feature] How to create alias for hardcoded words? HOT 1
- [bug] `moon` overwrites files in git's `core.hooksPath` HOT 1
- [feat] Dynamic Bash/Fish tab completion for CLI HOT 1
- [bug] Regression on 1.24.3 on CI environment HOT 5
- [bug] Regression on proto after upgrade to 0.35.0 HOT 8
- [bug] Process /bin/zsh failed with a -1 exit code HOT 7
- [bug] 'moon' is not recognized as an internal or external command, operable program or batch file. HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moon.