pkgx icon indicating copy to clipboard operation
pkgx copied to clipboard

Adds tea.yml support. closes #201

Open jakenvac opened this issue 3 years ago • 1 comments

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.json in the root of the cli repo will break commands such as tea install-self
  • [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?

jakenvac avatar Nov 26 '22 21:11 jakenvac

  • 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!

what-the-diff[bot] avatar Nov 26 '22 21:11 what-the-diff[bot]

I've come round to this provided we use package.yml thus we are being consistent with our longer term goals.

mxcl avatar Dec 21 '22 14:12 mxcl

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.

jakenvac avatar Dec 25 '22 13:12 jakenvac

tea.yml or tea.yaml support officially dropped in 0.23.

mxcl avatar Feb 12 '23 12:02 mxcl

@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.

dudicoco avatar May 10 '23 19:05 dudicoco

I believe he means it "dropped", was released, rather than "was dropped", discarded. Indeed, tea.yaml is present and functional in teaxyz/pantry.

jhheider avatar May 10 '23 20:05 jhheider

Yes sorry to be confusing. I meant it went live. We will be keeping this feature forever!

mxcl avatar May 10 '23 21:05 mxcl

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?

dudicoco avatar May 11 '23 06:05 dudicoco