Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support !yamlscript v0: ... meta section #211

Open
ingydotnet opened this issue Jan 10, 2025 · 1 comment
Open

Support !yamlscript v0: ... meta section #211

ingydotnet opened this issue Jan 10, 2025 · 1 comment
Labels

Comments

@ingydotnet
Copy link
Member

ingydotnet commented Jan 10, 2025

A YAMLScript file needs to declare up front many things that the compiler should be aware of.

The initial !yamlscript/v0/... tags let you control "ys version" and "starting mode" but there are many more things we need including:

  • YAML Schema
  • SchemaYS Schema
  • YS version(s) required
  • Capabilities
  • Vars file(s) to import
  • Libraries to use
  • Namespace to use
  • Dependency sources to use
  • Experimental features to use

A YS document (must be a top level map) can have a first pair whose key is !yamlscript v0:.

For example:

!yamlscript v0:
  mode: data/code/bare
  yaml: 1.2 core
  scys: schemays-url
  need: 0.1.87
  with: capabilities-config
  vars: vars-url
  name: namespace
  uses: [module-urls]
  deps: dep-specs
  exps: [experimental features]

The values can also be stored outside in any importable form:

!yamlscript v0: ./meta.yaml

or

!yamlscript v0: github:user/repo/meta.yaml

NOTE: If the special key tag is used, the special document is not used. (one or the other)

@ingydotnet
Copy link
Member Author

Top level sequences can be used like so:

!yamlscript v0:
  mode: data
  yaml: 1.2 json
:::
- foo
- bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant