Tea

统一包管理器(brew2)

README

tea

tea 不是包管理器。

tea 是统一的包基础工具.

从[brew]的创建者那里,tea是一个面向所有人的独立二进制下载让整个开放的平台源生态系统触手可及。轻轻松松地使用最新并且从任何堆栈的任何层中最大或最古老和最成熟。打破在编程社区之间的筒仓中使用完全独立的工具和语言,并与世界共享一个简单的单线。

你只需要 tea.

 

tea 是v1之前的。这意味着在日常使用中可能仍有一些粗糙的边缘。

这也意味着你绝对应该参与其中。这是关键。

参与其中的黄金时期既简单又有趣。我们非常期待与您见面 👊


 


tea/cli 0.18.1


开源是一个宝库,但这些都加了锁
tea 是key:

  1. ```sh
  2. $ tea +rust-lang.org

  3. tea: installing rust-lang.org and 13 other packages into a temporary sandbox
  4. when done type: exit

  5. tea $ cat <<EOF >hello.rs
  6. fn main() {
  7.   println!("Hello World!");
  8. }
  9. EOF
  10. $ rustc hello.rs -o hello
  11. $ ./hello
  12. Hello World!

  13. tea $ exit

  14. $ rustc
  15. command not found: rustc
  16. ```

tea 不安装软件包,至少在传统意义上不是这样。它们在 ~/.tea†中. 您的系统保持原始状态,并与tea’s的活动隔离。 但当你需要的时候,一切都在那里。

最后是一个包管理器,其中所有的包都是可重定位的(应该是这样的)。


tea 流水线


tea’s 的 +pkg 语法让整个开源生态系统触手可及,如果您在+pkg处停止,则会发生上述情况,我们将在环境中打开一个带有这些包的新shell,但如果您继续键入,则可以构造直接使用:

  1. ```sh
  2. $ tea +nodejs.org npx --yes browser-sync start --server
  3. # ^^ one-liner to start a local web server with live reload

  4. $ sh <(curl tea.xyz) +nodejs.org npx --yes browser-sync start --server
  5. # ^^ same one-liner but works for anyone on the Internet
  6. # (if tea is already installed, it uses it, if not it *doesn’t* install tea,
  7. #  a temporary sandbox is created)
  8. ```

像UNIX一样,组合一切,组合一切设想的。这将我们引向tea 流水线:

  1. ```sh
  2. $ tea +gnu.org/wget wget -qO- tea.xyz/white-paper | tea +charm.sh/glow glow -
  3. ```

这个例子下载了我们的白皮书,并使用[charm]’s 出色的发光终端markdown渲染器进行渲染。这是一个基本的示例,但UNIX受到包管理器的限制太久了。这是tea设计要克服的一个基本限制。

值得注意的是,使用-X语法可以更简洁地表达:

  1. ```sh
  2. $ tea -X wget -qO- tea.xyz/white-paper | tea -X glow -
  3. ```

其他示例

现在是202x,显然我们也可以从互联网下载脚本:

  1. ```sh
  2. $ sh <(curl tea.xyz) +charm.sh/gum https://github.com/charmbracelet/gum/blob/main/examples/demo.sh
  3. ```

想试用最新版本的node,但不确定它是否适用于您的项目tea很容易
  1. ```sh
  2. $ tea +nodejs.org^19 npm start
  3. ```

  4. 创建react应用程序的一行代码

  5. ```sh
  6. $ sh <(curl tea.xyz) -X npx create-react-app my-app
  7. ```

  8. </details>

  9. ### 马上就来

  10. tea 流水线 是如此有趣我们打算专门为它们展示

  11. &nbsp;


  12. ## tea: 通用解释程序

  13. ```sh
$ tea https://gist.githubusercontent.com/i0bj/2b3afbe07a44179250474b5f36e7bd9b/raw/colors.go --yellow
tea: installing go 1.18.3
go: installing deps
go: running colors.go
  1. ```

  2. 在这个基本示例中我们知道首先根据文件扩展名安装`go`很明显对吗这就是为什么我们没有停下来:

  3. ```sh
$ tea favicon-generator.sh input.png
tea: installing image-magick, optipng, guetzli and 3 other packages…
output: favicon-128.png…

$ cat favicon-generator.sh
#!/usr/bin/env tea
#---

args: [/bin/sh, -e]

dependencies:

    imagemagick.org: 4

    optipng.sourceforge.net: 1

#---

[snip…]
  1. ```

  2. tea读取文件的YAML前端内容允许您在整个开源生态系统中滚动脚本gist和一行程序当脚本运行时它的环境中有这些依赖项但系统的其他部分永远不会知道这些依赖项

  3. 我们还知道更多的魔法:

  4. ```sh
$ tea -X node
tea: installing node@18.9.1
Welcome to Node.js v18.9.1.
Type ".help" for more information.
>
  1. ```

  2. 通常`tea`对包使用完全限定的名称但我们知道他们提供的工具所以只要你知道你在寻找什么工具我们就可以解决剩下的问题

  3. Notably if you create a symlink of `foo` to `tea` (or `tea_foo`) we will
  4. interpret that as `tea -X foo [args]`, yet another way using `tea` can be
  5. completely transparent to your everyday workflows.

  6. Even better, you can include semver ranges in your link name, so `ln -s tea node^16`
  7. will let you run `node^16` via the symlink of the same name. For even, even more
  8. goodness, we will follow a symlink one deep to see if a base link goes to a versioned
  9. link. Example:

  10. ```sh
$ ln -s tea /usr/local/bin/node^16
$ ln -s node^16 /usr/local/bin/node
$ node --version
v16.19.0
  1. ```

  2. Some tools, like `python` expect versioned binary names as well. `python.org` provides
  3. `python`, `python{{version.major}}` and `python{{version.major}}.{{version.minor}}`,
  4. so `ln -s tea /usr/local/bin/python3` works as expected, but this provides an equivalent
  5. method for achieving this if not provided by the package, via:

  6. ```sh
$ ln -s tea /usr/local/bin/python^3
$ ln -s python^3 /usr/local/bin/python3
  1. ```

  2. > ### Coming Soon
  3. >
  4. > ```yaml
  5. > ---
  6. > dependencies:
  7. >  nodejs.org: 19
  8. >  npmjs.com:
  9. >    package.json:
  10. >      dependencies:
  11. >        react: ^18
  12. > ---
  13. > ```

  14. &nbsp;


  15. ## tea: the universal virtualenvironment manager

  16. ```sh
$ deno
zsh: command not found: deno

$ echo $PATH
/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin

$ cd my-project
$ deno
tea: installing deno.land^1.22
deno 1.27.0

^D


$ env
PATH=~/.tea/deno.land/v1.27.0/bin:/usr/bin:/bin
SRCROOT=/src/my-project
VERSION=…
  1. ```

  2. > <details><summary><i>What is this sourcery?</i>summary><br>
  3. >
  4. > tea uses a shell hook to insert the precise tooling your project needs into
  5. > your shell environment. Development is now containerized at the
  6. > *package manager* level. No longer do you need to worry about your team
  7. > being on different versions of foundational tooling nor do you need to worry
  8. > about system level updates breaking different projects youre working on.
  9. >
  10. > There are thousands of version managers for the thousands of tools they
  11. > support. Probably its time we stopped that duplicated effort.
  12. >
  13. > Projects can specify precisely what they need and you can install those
  14. > requirements precisely be it today, tomorrow or in ten years.
  15. >
  16. > In the above example if `deno` is not yet installed we insert a hook so
  17. > trying to execute it will install it first.
  18. > </details>

  19. > <details><summary><i>PSA:</i> Stop using Dockersummary><br>
  20. >
  21. > Docker is great for deployment and cross compilation, but lets face it: it
  22. > sucks for dev.
  23. >
  24. > *Docker stifles builders*.
  25. > It constricts you; youre immalleable; tech marches onwards but your docker
  26. > container remains immobile. *Nobody knows how to use `docker`*. Once that
  27. > `Dockerfile` is set up, nobody dares touch it.
  28. >
  29. > And lets face it, getting your personal dev and debug tools working inside
  30. > that image is incredibly frustrating. Why limit your potential?
  31. >
  32. > Keep deploying with Docker, but use tea to develop.
  33. >
  34. > Then when you do deploy you may as well install those deps with tea.
  35. >
  36. > Frankly, tea is properly versioned unlike system packagers, so with tea your
  37. > deployments actually remain *more* stable.
  38. > </details>

  39. You need 34 dependencies to compile our white-paper but with tea theres
  40. nothing to think about:

  41. ```sh
$ git clone https://github.com/teaxyz/white-paper
$ cd white-paper
$ tea make  #†
tea: installing pandoc.org and 33 other dependencies…
$ open tea.white-paper.pdf
  1. ```

  2. Our white-papers dependencies are written in plain markdown in our `README`.
  3. tea sets up a virtual environment for them simply by stepping into the
  4. directory.

  5. > prefixing with tea ensures all the deps get installed before `make` is run
  6. > in general tea is a *shell* that injects a packaging environment before
  7. > executing other commands.

  8. > ### Coming Soon
  9. >
  10. > * we’ll automatically load and unload completions as you change directory
  11. > * we’ll allow customizations per package for your project

  12. &nbsp;


  13. ## Executable Markdown

  14. [Markdown] has (justifiably) become the standard documentation format of
  15. development. How about instead of writing scripts with comments, we write
  16. documentation that can be *run*.

  17. ```sh
$ tea .  # interprets # Getting Started, could also be tea ./README.md
tea: npm install
tea: npm start

$ git clone https://github.com/my/project
$ cd project
$ tea build
tea: executing # Build
  1. ```

  2. Using these scripts in CI is easy:

  3. ```yaml
steps:
  - uses: teaxyz/setup@v0
    with:
      target: build
  1. ```

  2. Check out [teaxyz/setup] for all that you can do with our GitHub Action.

  3. > ### Coming Soon
  4. >
  5. > This is a limited set of first steps exploring the idea of executable
  6. > markdown. We intend to sensibly build out concepts for making entire
  7. > documents executable, and wed like your help with that.
  8. > Start a [discussion] about it.

  9. &nbsp;



  10. # Getting Started

  11. tea is a standalone binary. Grab it from [releases] or `curl` it:

  12. ```sh
$ curl -Lo tea https://tea.xyz/$(uname)/$(uname -m)
$ chmod u+x ./tea

$ echo '# tea really is a standalone binary' | ./tea -X glow -
  1. ```

  2. However, we recommend our installer:

  3. ```sh
sh <(curl https://tea.xyz)

• asks you to confirm before it sets up ~/.tea

• asks you to confirm before adding one line to your ~/.shellrc

• asks you to confirm before making a /usr/local/bin/tea symlink

  1. ```

  2. <details><summary><code>`preview.gif`</code>summary>

  3. ![charm.sh/vhs recording](https://teaxyz.github.io/setup/sample.gif)

  4. </details>

  5. <details><summary>If you <code>fish</code>, read this…summary>

  6. ```fish
sh <(curl https://tea.xyz | psub)
  1. ```

  2. </details>

  3. In fact, the tea one-liner abstracts away installation:

  4. ```sh
$ sh <(curl tea.xyz) https://examples.deno.land/color-logging.ts

if tea is installed, our one-liner uses the tea installation, if it’s not

installed then it doesn’t install tea or any dependencies, it creates a

sandbox and runs everything in there


and btw, the above works the same as:

$ tea https://examples.deno.land/color-logging.ts

which really is:

$ tea -X deno run https://examples.deno.land/color-logging.ts

which really, really is:

$ tea +deno.land deno run https://examples.deno.land/color-logging.ts
  1. ```

  2. > Now in your blog posts, tweets and tutorials you dont have to start
  3. > with any how to install tea preamble nor will they need to google anything.
  4. > If they want to learn about tea first they can go to the same URL as theyre
  5. > curling. We already work on Linux, macOS, and WSL; soon well support Windows
  6. > natively.

  7. As a bonus the installer also updates tea.

  8. ## *Now see here fella’, I \*hate\* installers…*

  9. Us too! *That’s why we wrote a package manager!*

  10. > <details><summary><i>Installing without the installer</i>summary><br>
  11. >
  12. > Take your pick:
  13. >
  14. > * Grab the latest [release][releases] with your browser. On macOS you’ll
  15. >   have to unquarantine the binary:
  16. >
  17. >   ```sh
  18. >   $ xattr -d com.apple.quarantine ./tea
  19. >   ```
  20. >
  21. > * Or get a plain text listing of binary downloads:
  22. >
  23. >   ```sh
  24. >   $ curl dist.tea.xyz   # pick your platform and `curl` it
  25. >   ```
  26. >
  27. > * Or if you want to get fancy there’s this:
  28. >
  29. >   ```sh
  30. >   $ sudo install -m 755 <(curl --compressed -LSsf https://tea.xyz/$(uname)/$(uname -m)) /usr/local/bin/tea
  31. >   ```
  32. >
  33. > Our (optional) virtual environment manager functionality needs a shell hook
  34. > in the relevant `.rc` file:
  35. >
  36. > ```sh
  37. > add-zsh-hook -Uz chpwd(){ source <(tea -Eds) }
  38. > ```
  39. >
  40. > </details>

  41. > <details><summary><i>Uninstalling tea</i>summary><br>
  42. >
  43. > * You can delete everything under `~/.tea`
  44. > * There’s also a one-liner added to your `~/.zshrc` you should remove.
  45. > * Finally delete `/usr/local/bin/tea`
  46. >
  47. > </details>

  48. &nbsp;


  49. ## Usage as an Environment Manager

  50. Youre a developer, installing tools globally makes no sense. With tea the
  51. tools you need per project or script are available to that workspace as
  52. *virtual environments*. Our magic works from depths of libc to the heights of
  53. the latests fads in CSS precompilers. All versions. All platforms.

  54. > Were new software, give us time to achieve this promise.\
  55. > Windows (native, we support WSL), Raspberry Pi, BeOS, etc. coming soon!

  56. When you `cd` into a project in your terminal, tea sets up the environment so
  57. your tools just work. To do this it looks for a dependencies table in
  58. your `README`.

  59. > Using the `README` may seem weird, but really it's the right place to
  60. > document your dependencies. Typically in open source this information is
  61. > barely documented, incorrectly documented or duplicated (incorrectly) in
  62. > various hard to find places. No longer.
  63. >
  64. > Additionally this makes use of tea *optional*. Your team or your users can
  65. > source your dependencies themselves if they want. It says right there in a
  66. > human readable form in the `README` what they need to get.
  67. >
  68. > <details><summary><i>Umm, I hate this, can I use a different file?</i>summary>
  69. >
  70. > You can use `package.json` instead:
  71. >
  72. > ```json
  73. > {
  74. >   "tea": {
  75. >     "dependencies": [{ "nodejs.org": 18 }]
  76. >   }
  77. > }
  78. > ```
  79. >
  80. > We check `README.md` before `package.json`. You can force use of
  81. > `package.json` by disabling magic with `--disable-magic`.
  82. >
  83. > </details>

  84. For an example see our [dependencies](#dependencies) section
  85. (teaception: we use tea to build tea).

  86. You can check what environment this generates with `tea`:

  87. ```sh
tea --env --dump
  1. ```

  2. `--env` specifies that tea will generate an environment based on the source
  3. control checkout. So if youre using git well look around for a `.git`
  4. directory and consider that the `SRCROOT` for your project. Then we check the
  5. `README.md` there to gather the environment information.

  6. tea attempts to further enhance your environment based on your workspace
  7. context:

  8. | Variable  | Description                                                               |
  9. | --------- | ------------------------------------------------------------------------- |
  10. | `VERSION` | Extracted from the `README.md`, `VERSION` or `package.json`               |
  11. | `SRCROOT` | We descend towards root until we find a source control marker, eg. `.git` |
  12. | `MANPATH` | So `man ` works for your deps                                            |

  13. We also provide eg. `PKG_CONFIG_PATH`, `LD_LIBRARY_PATH`, `DEVELOPER_DIR`,
  14. etc. so other tools can find your dependencies. We provide other variables for
  15. convenience too, like `GITHUB_SLUG` (extracted from your `git remote`) which
  16. can be surprisingly useful to automation scripts.

  17. These variables are also available to tea Scripts.

  18. > Our shell magic controls this feature, if you dont want to add our
  19. > one-liner to your shell rc then you can just `tea sh` in your project
  20. > directory to get the same effectalbeit more laboriously.
  21. >
  22. > Or you can run tools directly with eg. `tea foo`

  23. &nbsp;


  24. ## Usage as an Interpreter

  25. You can use tea to execute pretty much any script from any location. Well
  26. auto-magically install the right interpreter (as an isolated virtual
  27. environmentthere are no global consequences to your system).

  28. ```sh
$ tea my-script.py
  1. ```

  2. tea sees the `.py` file extension, so it installs the latest version of Python
  3. and then executes the script.

  4. If you want more control over the python version then we need to edit the
  5. scripts YAML front-matter, eg:

  6. ```python
#!/usr/bin/env python

"""
dependencies:
  python.org: ^3.11
"""

snip …

  1. ```

  2. tea will run the script with the latest version of Python that is >=3.11 but
  3. less than 4.0. If it's not installed we grab it, otherwise we use what is
  4. available.

  5. We also support `args` and `env` parameters which are useful for tools that
  6. require a `run` command like deno or go.

  7. ```ts
#!/usr/bin/env deno

/*---
dependencies:
  deno.land: ^1.27
args:
  - deno
  - run
  # we put the script filename on the end for you here
env:
  foo: {{srcroot}}/bar
  1. ```

  2. > Note strictly you dont need the above, we automatically do this (if magic
  3. > is enabled) for `.ts` scripts.

  4. ### Using a `tea` Shebang

  5. You can `#!/usr/bin/env tea`, and youd possibly choose this because tea can
  6. do more than install dependencies. You may recall our earlier diatribe about
  7. tools sticking to what theyre good at*we really believe this*. Thus
  8. having tools evolve to be configurable for project environments is something
  9. we think should be left to *us*.

  10. For example, `deno` is a wonderful interpreter for JavaScript and TypeScript,
  11. but it has no project configuration capabilities which means if you want to
  12. use it for scripts you may have to mess around a little. We think deno should
  13. stay this way, and instead we can use tea:

  14. ```ts
#!/usr/bin/env -S tea -E

/* ---
dependencies:
  deno.land: ^1.18
args:
  - deno
  - run
  - --allow-net
  - --import-map={{ srcroot }}/import-map.json
  # ^^ we provide {{srcroot}} which can be enormously useful for scripting
  # note that you must use a tea -E shebang for this to work

// snip …
  1. ```

  2. Which would go like this:

  3. ```sh
$ pwd
/src
$ ./script.ts my-arg
tea: ~/.tea/deno.land/v1.18/bin/deno run \
  --allow-net \
  --import-map=/src/import-map.json \
  /src/script.ts \
  my-arg
  1. ```

  2. > When called with `-E` tea reads the virtual environment and injects any
  3. > dependencies from there. Probably your project already specifies your `deno`
  4. > dependency, so the above YAML is possibly being redundant.

  5. &nbsp;


  6. # Magic

  7. `tea` formalizes (in a CLI/TUI sense) the concept of magic.

  8. In an environment where there
  9. is magic we try to be clever and infer what you want. Without magic we are
  10. strict and require precise specification of your intent.

  11. You can disable magic by specifying `--disable-magic` or exporting `MAGIC=0`
  12. to your shell environment.

  13. The primary magic we apply is determining if you want to use your virtual
  14. environment or not. Strictly `tea --env` is required to inject it, but when
  15. magic is enabled we try to figure out if you *just wanted that*. Our goal is
  16. to be smart and useful for your productivity.

  17. We do some magic per dependency. This is currently hard-coded logic in tea/cli
  18. itself, but we intend to make it general with a `magic.ts` file per package
  19. in the [pantry].

  20. Currently magic is limited (and a great place for contributions).

  21. For example, if we detect that your project is a GitHub Action we read the
  22. `action.yml` and make the right version of node available.

  23. > is there a file that your environment or language always has and thus
  24. > `tea` should know to add packages to that environment? Open a [discussion]
  25. > or just go straight to contributing the PR!
  26. > Magic lives in `useVirtualEnv.ts`.

  27. &nbsp;


  28. # Contributing

  29. If you have suggestions or ideas, start a [discussion]. If we agree well
  30. move it to an issue. Bug fixes straight to pull request or issue please!

  31. Probably the place youll want to start is by supplementing the
  32. [pantry][pantry.extra].

  33. ## Hacking on `tea`

  34. `tea` is written in [TypeScript] using [deno].

  35. ```sh
git clone https://github.com/teaxyz/cli tea
cd tea

tea run foo       # runs the local checkout passing foo as an argument
tea install-self  # deploys the local checkout into your ~/.tea
  1. ```

  2. This alias makes it so you can execute your local checkout from anywhere:

  3. ```sh
alias teal="$HOME/.tea/deno.land/v1/bin/deno run \
  --import-map=$HOME/tea/cli/import-map.json \
  --unstable \
  --allow-all \
  $HOME/tea/cli/src/app.ts"

^^ change the paths!

^^ add to your ~/.shellrc file

  1. ```

  2. ### Things we Need

  3. * We really need more tests!
  4. * We need test coverage information
  5. * More magic for dependencies, eg. knowing what version of node should be in
  6.     the env based on `.node-version` files used for other version managers.

  7. ## Token Rewards

  8. There isnt a token *yet* but when it’s brewed it’s quite possible there will
  9. be a little something extra for those who helped build tea.

  10. &nbsp;


  11. # FAQ

  12. ## How do I update packages

  13. ```sh
$ tea --sync

^^ updates the pantries, and any packages in the virtual-environment


$ tea --sync +deno.land

^^ updates specific packages

  1. ```

  2. Of course this is limited and more is required here. Were working on it.

  3. ## Wheres `tea install`?

  4. tea works differently. Its not I want to install Freetype its
  5. I want to *use* Freetype”.

  6. Look, were not idiots. We know there are occasions where a good ol
  7. `brew install` is what you need. So*for now*—continue using `brew install`.
  8. Longer term, we have plans for an extensible commands system.

  9. *tea is a set of packaging primitives*. We want you to build entirely new
  10. things on top of tea. We want to integrate tea into your existing build tools,
  11. we eventually want to be the authoritative packaging datastore (isnt it about
  12. time there was one of those?)

  13. Coming soon is [tea/cmd]. tea/cli will expose forks of this repo as commands
  14. the user can run utilizing the power of teas packaging primitives to do all
  15. that they can imagine. Maybe itll be you who writes the `tea install`
  16. command? (If you do, try to do something new, eh? )

  17. ### May we interest you in a hack?

  18. If you really want to put `tea` through its paces, you can combine the search
  19. magic with your shells command not found logic, to get automatic `tea`
  20. lookups.

  21. > <details open><summary><h4><code>zsh</code>h4></summary>
  22. >
  23. > ```sh
  24. > function command_not_found_handler {
  25. >   tea -X $*
  26. > }
  27. > ```
  28. >
  29. > </details>

  30. > <details><summary><h4><code>bash</code>h4></summary>
  31. >
  32. > The following requires `bash^4`; sadly macOS ships with v3.2, but `tea`
  33. > provides `+gnu.org/bash`, and weve met very few people who want to use
  34. > `bash` on macs, though I bet you're out there).
  35. >
  36. > ```sh
  37. > function command_not_found_handle {
  38. >   tea -X $*
  39. > }
  40. > ```
  41. >
  42. > </details>

  43. > <details><summary><h4><code>fish</code>h4></summary>
  44. >
  45. > ```sh
  46. > function fish_command_not_found
  47. >   tea -X $argv
  48. > end
  49. > ```
  50. >
  51. > </details>

  52. ## How do I find available packages?

  53. We list all packages at [tea.xyz](https://tea.xyz/+/).
  54. Or `open ~/.tea/tea.xyz/var/pantry`. We
  55. agree this is not great UX.

  56. ## What are you doing to my computer?

  57. We install compartmentalized packages to `~/.tea`.

  58. We then suggest you add our one-liner to your shell `.rc` and a symlink
  59. for `/usr/local/bin/tea`.

  60. We might not have installed tea, if you used `sh <(curl tea.xyz) foo` and tea
  61. wasnt already installed, then we only fetched any packages, including
  62. tea, temporarily.

  63. ## I thought you were decentralized and web3 and shit

  64. [tea is creating new technologies that will change how open source is funded][white-paper].
  65. tea/cli is an essential part of that endeavor and is released
  66. prior to our protocol in order to bootstrap our holistic vision.

  67. We dont subscribe to any particular web at tea.xyz, our blockchain
  68. component will be an implementation detail that you wont need to think about
  69. (but we think you will want to).

  70. ## Am I or my employer going to have to pay for open source now?

  71. No. Software is a multi-trillion industry. We only have to skim a little off
  72. that to pay the entire open source ecosystem. Check out our [white-paper] for
  73. the deets.

  74. ## Packaging up tea packages with your `.app`, etc.

  75. Our packages are relocatable by default. Just keep the directory structure the
  76. same. And ofc. you are licensed to do so (by us! each package has its own
  77. license!). Honestly we think you should
  78. absolutely bundle and deploy teas prefix with your software. We designed it
  79. so that it would be easier for you to do this than anything that has come
  80. before.

  81. ## Will you support platform `foo`

  82. We want to support *all* platforms.
  83. Start a [discussion] and lets talk about how to move forward with that.

  84. ## I have another question

  85. Start a [discussion] and well get back to you.


  86. &nbsp;

  87. &nbsp;



  88. # Appendix

  89. ## Philosophy

  90. * Be non‑intrusive
  91.     > dont interfere with our users systems or habits
  92. * Be “just works”
  93.     > our users have better things to do than fix us
  94. * Error messages must be excellent
  95.     > trust that if it comes to it, our users can fix things provided we give
  96.     > them a helping hand
  97. * Be intuitive
  98.     > being clever is goodbut dont be so clever nobody gets it
  99. * Resist complexity
  100.     > rethink the problem until a simpler solution emerges
  101. * Be fast
  102.     > we are in the way of our users real work, dont make them wait

  103. ## Troubleshooting

  104. ### `env: tea: No such file or directory`

  105. If you got this error message, you need to install tea:
  106. `sh <(curl https://tea.xyz)`.

  107. ## vs. `brew`

  108. We dont aim to replace `brew`, we see our offerings as somewhat
  109. complementary. Still where we have overlapping features:

  110. * tea supports more platforms
  111. * tea is transparently cross-platform in usage
  112. * tea packages are relocatable
  113. * tea aims to be zippy and stay zippy
  114. * tea doesn’t make global changes to your system
  115. * tea doesn’t require you install the Xcode Command Line Tools
  116. * tea aims to enhance the way you work, rather than dictate the way you work
  117. * tea installs independently for every user on the machine
  118. * tea is somewhat decentralized and aims to be completely decentralized
  119. * tea is a handful of tight, easy-to-understand codebases
  120. * tea starts building new releases for tools almost instantly
  121. * tea’s packages are named in a fully-qualified manner
  122. * tea’s philosophy is user-first and not tea-maintainer-first


  123. &nbsp;

  124. ## Tea Scripts

  125. You can execute each of these with `tea foo` where `foo` is the name of the
  126. section.

  127. ### Test

  128. > `FIXME` would be nice to be able to specify tests here
  129. > deno supports `--filter` but that would require a little
  130. > massaging.

  131. ```sh
deno task test
  1. ```

  2. ### Typecheck

  3. ```sh
deno task typecheck
  1. ```

  2. ### Run

  3. ```sh
deno task run
  1. ```

  2. ### Compile

  3. ```sh
OUT="$1"
if test -z "$OUT"; then
  OUT="./tea"
else
  shift
fi

deno compile \
  --allow-read \
  --allow-write \
  --allow-net \
  --allow-run \
  --allow-env \
  --unstable \
  --import-map="$SRCROOT/import-map.json" \
  --output "$OUT" \
  "$@" \
  "$SRCROOT/src/app.ts"
  1. ```

  2. ### Install Self

  3. Installs this working copy into `~/.tea/tea.xyz/vx.y.z`.

  4. ```sh
tea compile "$TEA_PREFIX/tea.xyz/v$VERSION/bin/tea"
"$SRCROOT"/scripts/repair.ts tea.xyz
  1. ```

  2. ## Dependencies

  3. | Project   | Version |
  4. | --------- | ------- |
  5. | deno.land | ^1.27   |
  6. | tea.xyz   | ^0      |

  7. > macOS >= 11 || linux:glibc >= 23


  8. &nbsp;


  9. ## A Brief Diatribe

  10. Every programming language, every build system, every compiler, web server,
  11. database and email client seem to gravitate towards adding infinite features
  12. and complexity so that their users can do ever more and more.

  13. This is contrary to the UNIX philosophy: tools should do one thing and
  14. by being tight and focused
  15. do it *damn* well.
  16. If they are composable and flexible then they can be combined,
  17. piped and leveraged into a larger,
  18. more capable toolbox.
  19. *The Internet is built with this toolbox.*

  20. Nowadays every programming language
  21. reimplements the same set of libraries and tools because using a
  22. well-maintained, mature and portable library that lives higher up the stack
  23. adds too much complexity.
  24. This extends the adolescence of new languages,
  25. results in no single language even becoming truly state of the art
  26. and leads to degrees of
  27. duplication that make the open source ecosystem *fragile*.
  28. This is to the detriment of all software, everywhere.

  29. tea removes this complexity and adds some much needed robustness for the good
  30. of the entire open source ecosystem, the larger Internet and the whole world
  31. of software.


  32. [pantry]: https://github.com/teaxyz/pantry.core
  33. [Markdown]: https://daringfireball.net/projects/markdown/
  34. [releases]: ../../releases
  35. [teaxyz/setup]: https://github.com/teaxyz/setup
  36. [deno]: https://deno.land
  37. [tea/cmd]: https://github.com/teaxyz/cmd
  38. [TypeScript]: https://www.typescriptlang.org
  39. [discussion]: https://github.com/orgs/teaxyz/discussions
  40. [white-paper]: https://github.com/teaxyz/white-paper
  41. [`brew`]: https://brew.sh
  42. [charm]: https://charm.sh
  43. [pantry.extra]: https://github.com/teaxyz/pantry.extra