Adds tea.yml support. closes #201
closes #201
What
This PR adds support for a tea.yml and .github/tea.yml config file to drive magic functionality. The schema for the yml file copies that of the existing package.json support.
Eg.
- tea.yml
version: 1.0.1
tea:
dependencies:
nodejs.org: 19
go.dev: 1.19
- package.json
{
"version": "1.0.1",
"dependencies": {
"nodejs.org": 19,
"go.dev": "1.19"
}
}
TODO:
- [x] Add tea.yml loader
- [x] Refactor json logic to support yaml and share schema
- [x] Move common requirements logic/types to
sr/common/directory - [x] Investigate existing behavior whereby a package.json (and now a tea.yml) will prevent markdown scripts from running.
- I would consider this out of the scope of this ticket. I'll create an issue.
running
touch package.jsonin the root of the cli repo will break commands such astea install-self
- I would consider this out of the scope of this ticket. I'll create an issue.
running
- [x] Understand what the version in the config is for
- It's the version of the project using tea, semver string. got it!
- [x] Remove junky console logs
- [ ] Update docs
- [ ] .github/tea.yml support
- [ ] UX - Do we want to let the user know which file has been loaded?
- [ ] fix failing tests
- [ ] add new tests?
- Added a new file
src/common/requirementsCandidate.ts - Modified the existing files:
- src/hooks/useRequirementsFile.ts (line 1) to import from common folder and use it's types, functions etc...
- src/hooks/useVirtualEnv.ts (lines 52-53) to build requirements candidates using function exported by
src\common\requirementsCandidate. This is done because we need this list in two places now instead of one as before when only README was considered for dependencies table search but not TEA_YAML or package json which are also valid sources of dependency information now!
I've come round to this provided we use package.yml thus we are being consistent with our longer term goals.
Sounds good to me! I'm away for Xmas at the moment but I'll set time aside for this in a week or so.
tea.yml or tea.yaml support officially dropped in 0.23.
@mxcl can you please elaborate why support for tea.yaml was dropped?
It's still in the docs: https://docs.tea.xyz/features/developer-environments#supported-files
How can we manage versions declaratively without it? Version files such as .node-version do not exist for all packages and even if they do tea doesn't support all of them.
I believe he means it "dropped", was released, rather than "was dropped", discarded. Indeed, tea.yaml is present and functional in teaxyz/pantry.
Yes sorry to be confusing. I meant it went live. We will be keeping this feature forever!
Thanks @jhheider @mxcl.
It seems that the tea.yaml parameters are not documented anywhere.
Also, is it possible to install all of the dependencies specified in the file like with brew bundle?