Tea
统一包管理器(brew2)
README

tea 不是包管理器。
tea 是统一的包基础工具.
从[brew]的创建者那里,tea是一个面向所有人的独立二进制下载让整个开放的平台源生态系统触手可及。轻轻松松地使用最新并且从任何堆栈的任何层中最大或最古老和最成熟。打破在编程社区之间的筒仓中使用完全独立的工具和语言,并与世界共享一个简单的单线。
你只需要 tea.
tea 是v1之前的。这意味着在日常使用中可能仍有一些粗糙的边缘。
这也意味着你绝对应该参与其中。这是关键。
参与其中的黄金时期既简单又有趣。我们非常期待与您见面 👊
tea/cli 0.18.1
开源是一个宝库,但这些都加了锁
tea 是key:
- ```sh
- $ tea +rust-lang.org
- tea: installing rust-lang.org and 13 other packages into a temporary sandbox
- when done type: exit
- tea $ cat <<EOF >hello.rs
- fn main() {
- println!("Hello World!");
- }
- EOF
- $ rustc hello.rs -o hello
- $ ./hello
- Hello World!
- tea $ exit
- $ rustc
- command not found: rustc
- ```
tea 不安装软件包,至少在传统意义上不是这样。它们在 ~/.tea†中. 您的系统保持原始状态,并与tea’s的活动隔离。 但当你需要的时候,一切都在那里。
† 最后是一个包管理器,其中所有的包都是可重定位的(应该是这样的)。
tea 流水线
tea’s 的 +pkg 语法让整个开源生态系统触手可及,如果您在+pkg处停止,则会发生上述情况,我们将在环境中打开一个带有这些包的新shell,但如果您继续键入,则可以构造直接使用:
- ```sh
- $ tea +nodejs.org npx --yes browser-sync start --server
- # ^^ one-liner to start a local web server with live reload
- $ sh <(curl tea.xyz) +nodejs.org npx --yes browser-sync start --server
- # ^^ same one-liner but works for anyone on the Internet
- # (if tea is already installed, it uses it, if not it *doesn’t* install tea,
- # a temporary sandbox is created)
- ```
像UNIX一样,组合一切,组合一切设想的。这将我们引向tea 流水线:
- ```sh
- $ tea +gnu.org/wget wget -qO- tea.xyz/white-paper | tea +charm.sh/glow glow -
- ```
这个例子下载了我们的白皮书,并使用[charm]’s 出色的发光终端markdown渲染器进行渲染。这是一个基本的示例,但UNIX受到包管理器的限制太久了。这是tea设计要克服的一个基本限制。
值得注意的是,使用-X语法可以更简洁地表达:
- ```sh
- $ tea -X wget -qO- tea.xyz/white-paper | tea -X glow -
- ```
其他示例
现在是202x,显然我们也可以从互联网下载脚本:
- ```sh
- $ sh <(curl tea.xyz) +charm.sh/gum https://github.com/charmbracelet/gum/blob/main/examples/demo.sh
- ```
想试用最新版本的node,但不确定它是否适用于您的项目tea很容易
- ```sh
- $ tea +nodejs.org^19 npm start
- ```
- 创建react应用程序的一行代码:
- ```sh
- $ sh <(curl tea.xyz) -X npx create-react-app my-app
- ```
- </details>
- ### 马上就来
- tea 流水线 是如此有趣,我们打算专门为它们展示。
-
- ## tea: 通用解释程序
- ```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
…
- ```
- 在这个基本示例中,我们知道首先根据文件扩展名安装`go`。很明显,对吗?这就是为什么我们没有停下来:
- ```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…]
- ```
- tea读取文件的YAML前端内容,允许您在整个开源生态系统中滚动脚本、gist和一行程序。当脚本运行时,它的环境中有这些依赖项,但系统的其他部分永远不会知道这些依赖项。
- 我们还知道更多的魔法:
- ```sh
$ tea -X node
tea: installing node@18.9.1
Welcome to Node.js v18.9.1.
Type ".help" for more information.
>
- ```
- 通常,`tea`对包使用完全限定的名称,但我们知道他们提供的工具,所以只要你知道你在寻找什么工具,我们就可以解决剩下的问题。
- Notably if you create a symlink of `foo` to `tea` (or `tea_foo`) we will
- interpret that as `tea -X foo [args…]`, yet another way using `tea` can be
- completely transparent to your everyday workflows.
- Even better, you can include semver ranges in your link name, so `ln -s tea node^16`
- will let you run `node^16` via the symlink of the same name. For even, even more
- goodness, we will follow a symlink one deep to see if a base link goes to a versioned
- link. Example:
- ```sh
$ ln -s tea /usr/local/bin/node^16
$ ln -s node^16 /usr/local/bin/node
$ node --version
v16.19.0
- ```
- Some tools, like `python` expect versioned binary names as well. `python.org` provides
- `python`, `python{{version.major}}` and `python{{version.major}}.{{version.minor}}`,
- so `ln -s tea /usr/local/bin/python3` works as expected, but this provides an equivalent
- method for achieving this if not provided by the package, via:
- ```sh
$ ln -s tea /usr/local/bin/python^3
$ ln -s python^3 /usr/local/bin/python3
- ```
- > ### Coming Soon
- >
- > ```yaml
- > ---
- > dependencies:
- > nodejs.org: 19
- > npmjs.com:
- > package.json:
- > dependencies:
- > react: ^18
- > ---
- > ```
-
- ## tea: the universal virtual‑environment manager
- ```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=…
…
- ```
- > <details><summary><i>What is this sourcery?</i>summary><br>
- >
- > tea uses a shell hook to insert the precise tooling your project needs into
- > your shell environment. Development is now containerized at the
- > *package manager* level. No longer do you need to worry about your team
- > being on different versions of foundational tooling nor do you need to worry
- > about system level updates breaking different projects you’re working on.
- >
- > There are thousands of version managers for the thousands of tools they
- > support. Probably it’s time we stopped that duplicated effort.
- >
- > Projects can specify precisely what they need and you can install those
- > requirements precisely be it today, tomorrow or in ten years.
- >
- > In the above example if `deno` is not yet installed we insert a hook so
- > trying to execute it will install it first.
- > </details>
- > <details><summary><i>PSA:</i> Stop using Dockersummary><br>
- >
- > Docker is great for deployment and cross compilation, but… let’s face it: it
- > sucks for dev.
- >
- > *Docker stifles builders*.
- > It constricts you; you’re immalleable; tech marches onwards but your docker
- > container remains immobile. *Nobody knows how to use `docker`*. Once that
- > `Dockerfile` is set up, nobody dares touch it.
- >
- > And let’s face it, getting your personal dev and debug tools working inside
- > that image is incredibly frustrating. Why limit your potential?
- >
- > Keep deploying with Docker, but use tea to develop.
- >
- > Then when you do deploy you may as well install those deps with tea.
- >
- > Frankly, tea is properly versioned unlike system packagers, so with tea your
- > deployments actually remain *more* stable.
- > </details>
- You need 34 dependencies to compile our white-paper but with tea there’s
- nothing to think about:
- ```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
- ```
- Our white-paper’s dependencies are written in plain markdown in our `README`.
- tea sets up a virtual environment for them simply by stepping into the
- directory.
- > † prefixing with tea ensures all the deps get installed before `make` is run
- > in general tea is a *shell* that injects a packaging environment before
- > executing other commands.
- > ### Coming Soon
- >
- > * we’ll automatically load and unload completions as you change directory
- > * we’ll allow customizations per package for your project
-
- ## Executable Markdown
- [Markdown] has (justifiably) become the standard documentation format of
- development. How about instead of writing scripts with comments, we write
- documentation that can be *run*.
- ```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
- ```
- Using these scripts in CI is easy:
- ```yaml
steps:
- uses: teaxyz/setup@v0
with:
target: build
- ```
- Check out [teaxyz/setup] for all that you can do with our GitHub Action.
- > ### Coming Soon
- >
- > This is a limited set of first steps exploring the idea of executable
- > markdown. We intend to sensibly build out concepts for making entire
- > documents executable, and we’d like your help with that.
- > Start a [discussion] about it.
-
- # Getting Started
- tea is a standalone binary. Grab it from [releases] or `curl` it:
- ```sh
$ curl -Lo tea https://tea.xyz/$(uname)/$(uname -m)
$ chmod u+x ./tea
$ echo '# tea really is a standalone binary' | ./tea -X glow -
- ```
- However, we recommend our installer:
- ```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
- ```
- <details><summary><code>`preview.gif`</code>summary>
- 
- </details>
- <details><summary>If you <code>fish</code>, read this…summary>
- ```fish
sh <(curl https://tea.xyz | psub)
- ```
- </details>
- In fact, the tea one-liner abstracts away installation:
- ```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
- ```
- > Now in your blog posts, tweets and tutorials you don’t have to start
- > with any “how to install tea” preamble nor will they need to google anything.
- > If they want to learn about tea first they can go to the same URL as they’re
- > curl’ing. We already work on Linux, macOS, and WSL; soon we’ll support Windows
- > natively.
- As a bonus the installer also updates tea.
- ## *Now see here fella’, I \*hate\* installers…*
- Us too! *That’s why we wrote a package manager!*
- > <details><summary><i>Installing without the installer</i>summary><br>
- >
- > Take your pick:
- >
- > * Grab the latest [release][releases] with your browser. On macOS you’ll
- > have to unquarantine the binary:
- >
- > ```sh
- > $ xattr -d com.apple.quarantine ./tea
- > ```
- >
- > * Or get a plain text listing of binary downloads:
- >
- > ```sh
- > $ curl dist.tea.xyz # pick your platform and `curl` it
- > ```
- >
- > * Or if you want to get fancy there’s this:
- >
- > ```sh
- > $ sudo install -m 755 <(curl --compressed -LSsf https://tea.xyz/$(uname)/$(uname -m)) /usr/local/bin/tea
- > ```
- >
- > Our (optional) virtual environment manager functionality needs a shell hook
- > in the relevant `.rc` file:
- >
- > ```sh
- > add-zsh-hook -Uz chpwd(){ source <(tea -Eds) }
- > ```
- >
- > </details>
- > <details><summary><i>Uninstalling tea</i>summary><br>
- >
- > * You can delete everything under `~/.tea`
- > * There’s also a one-liner added to your `~/.zshrc` you should remove.
- > * Finally delete `/usr/local/bin/tea`
- >
- > </details>
-
- ## Usage as an Environment Manager
- You’re a developer, installing tools globally makes no sense. With tea the
- tools you need per project or script are available to that workspace as
- *virtual environments*. Our magic works from depths of libc to the heights of
- the latests fads in CSS precompilers. All versions†. All platforms‡.
- > † We’re new software, give us time to achieve this promise.\
- > ‡ Windows (native, we support WSL), Raspberry Pi, BeOS, etc. coming soon!
- When you `cd` into a project in your terminal, tea sets up the environment so
- your tools “just work”. To do this it looks for a dependencies table in
- your `README`.
- > Using the `README` may seem weird, but really it's the right place to
- > document your dependencies. Typically in open source this information is
- > barely documented, incorrectly documented or duplicated (incorrectly) in
- > various hard to find places. No longer.
- >
- > Additionally this makes use of tea *optional*. Your team or your users can
- > source your dependencies themselves if they want. It says right there in a
- > human readable form in the `README` what they need to get.
- >
- > <details><summary><i>Umm, I hate this, can I use a different file?</i>summary>
- >
- > You can use `package.json` instead:
- >
- > ```json
- > {
- > "tea": {
- > "dependencies": [{ "nodejs.org": 18 }]
- > }
- > }
- > ```
- >
- > We check `README.md` before `package.json`. You can force use of
- > `package.json` by disabling magic with `--disable-magic`.
- >
- > </details>
- For an example see our “[dependencies](#dependencies)” section
- (teaception: we use tea to build tea).
- You can check what environment this generates with `tea`:
- ```sh
tea --env --dump
- ```
- `--env` specifies that tea will generate an environment based on the source
- control checkout. So if you’re using git we’ll look around for a `.git`
- directory and consider that the `SRCROOT` for your project. Then we check the
- `README.md` there to gather the environment information.
- tea attempts to further enhance your environment based on your workspace
- context:
- | Variable | Description |
- | --------- | ------------------------------------------------------------------------- |
- | `VERSION` | Extracted from the `README.md`, `VERSION` or `package.json` |
- | `SRCROOT` | We descend towards root until we find a source control marker, eg. `.git` |
- | `MANPATH` | So `man …` works for your deps |
- We also provide eg. `PKG_CONFIG_PATH`, `LD_LIBRARY_PATH`, `DEVELOPER_DIR`,
- etc. so other tools can find your dependencies. We provide other variables for
- convenience too, like `GITHUB_SLUG` (extracted from your `git remote`) which
- can be surprisingly useful to automation scripts.
- These variables are also available to “tea Scripts”.
- > Our shell magic controls this feature, if you don’t want to add our
- > one-liner to your shell rc then you can just `tea sh` in your project
- > directory to get the same effect—albeit more laboriously.
- >
- > Or you can run tools directly with eg. `tea foo`
-
- ## Usage as an Interpreter
- You can use tea to execute pretty much any script from any location. We’ll
- auto-magically install the right interpreter (as an isolated virtual
- environment—there are no global consequences to your system).
- ```sh
$ tea my-script.py
- ```
- tea sees the `.py` file extension, so it installs the latest version of Python
- and then executes the script.
- If you want more control over the python version then we need to edit the
- script’s YAML front-matter, eg:
- ```python
#!/usr/bin/env python
"""
dependencies:
python.org: ^3.11
"""
snip …
- ```
- tea will run the script with the latest version of Python that is >=3.11 but
- less than 4.0. If it's not installed we grab it, otherwise we use what is
- available.
- We also support `args` and `env` parameters which are useful for tools that
- require a `run` command like deno or go.
- ```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
- ```
- > Note strictly you don’t need the above, we automatically do this (if magic
- > is enabled) for `.ts` scripts.
- ### Using a `tea` Shebang
- You can `#!/usr/bin/env tea`, and you’d possibly choose this because tea can
- do more than install dependencies. You may recall our earlier diatribe about
- tools sticking to what they’re good at—*we really believe this*. Thus
- having tools evolve to be configurable for project environments is something
- we think should be left to *us*.
- For example, `deno` is a wonderful interpreter for JavaScript and TypeScript,
- but it has no project configuration capabilities which means if you want to
- use it for scripts you may have to mess around a little. We think deno should
- stay this way, and instead we can use tea:
- ```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 …
- ```
- Which would go like this:
- ```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
- ```
- > When called with `-E` tea reads the virtual environment and injects any
- > dependencies from there. Probably your project already specifies your `deno`
- > dependency, so the above YAML is possibly being redundant.
-
- # Magic
- `tea` formalizes (in a CLI/TUI sense) the concept of magic.
- In an environment where there
- is magic we try to be clever and infer what you want. Without magic we are
- strict and require precise specification of your intent.
- You can disable magic by specifying `--disable-magic` or exporting `MAGIC=0`
- to your shell environment.
- The primary magic we apply is determining if you want to use your virtual
- environment or not. Strictly `tea --env` is required to inject it, but when
- magic is enabled we try to figure out if you *just wanted that*. Our goal is
- to be smart and useful for your productivity.
- We do some magic per dependency. This is currently hard-coded logic in tea/cli
- itself, but we intend to make it general with a `magic.ts` file per package
- in the [pantry].
- Currently magic is limited (and a great place for contributions†).
- For example, if we detect that your project is a GitHub Action we read the
- `action.yml` and make the right version of node available.
- > † is there a file that your environment or language always has and thus
- > `tea` should know to add packages to that environment? Open a [discussion]
- > or just go straight to contributing the PR!
- > Magic lives in `useVirtualEnv.ts`.
-
- # Contributing
- If you have suggestions or ideas, start a [discussion]. If we agree we’ll
- move it to an issue. Bug fixes straight to pull request or issue please!
- Probably the place you’ll want to start is by supplementing the
- [pantry][pantry.extra].
- ## Hacking on `tea`
- `tea` is written in [TypeScript] using [deno].
- ```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
- ```
- This alias makes it so you can execute your local checkout from anywhere:
- ```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
- ```
- ### Things we Need
- * We really need more tests!
- * We need test coverage information
- * More magic for dependencies, eg. knowing what version of node should be in
- the env based on `.node-version` files used for other version managers.
- ## Token Rewards
- There isn’t a token *yet* but when it’s brewed it’s quite possible there will
- be a little something extra for those who helped build tea. ����️
-
- # FAQ
- ## How do I update packages
- ```sh
$ tea --sync
^^ updates the pantries, and any packages in the virtual-environment
$ tea --sync +deno.land
^^ updates specific packages
- ```
- Of course this is limited and more is required here. We’re working on it.
- ## Where’s `tea install`?
- tea works differently. It’s not “I want to install Freetype” it’s
- “I want to *use* Freetype”.
- Look, we’re not idiots. We know there are occasions where a good ol’
- `brew install` is what you need. So—*for now*—continue using `brew install`.
- Longer term, we have plans for an extensible commands system.
- *tea is a set of packaging primitives*. We want you to build entirely new
- things on top of tea. We want to integrate tea into your existing build tools,
- we eventually want to be the authoritative packaging datastore (isn’t it about
- time there was one of those?)
- Coming soon is [tea/cmd]. tea/cli will expose forks of this repo as commands
- the user can run utilizing the power of tea’s packaging primitives to do all
- that they can imagine. Maybe it’ll be you who writes the `tea install`
- command? (If you do, try to do something new, eh? ��)
- ### May we interest you in a hack?
- If you really want to put `tea` through its paces, you can combine the search
- magic with your shell’s “command not found” logic, to get automatic `tea`
- lookups.
- > <details open><summary><h4><code>zsh</code>h4></summary>
- >
- > ```sh
- > function command_not_found_handler {
- > tea -X $*
- > }
- > ```
- >
- > </details>
- > <details><summary><h4><code>bash</code>h4></summary>
- >
- > The following requires `bash^4`; sadly macOS ships with v3.2, but `tea`
- > provides `+gnu.org/bash`, and we’ve met very few people who want to use
- > `bash` on macs, though I bet you're out there).
- >
- > ```sh
- > function command_not_found_handle {
- > tea -X $*
- > }
- > ```
- >
- > </details>
- > <details><summary><h4><code>fish</code>h4></summary>
- >
- > ```sh
- > function fish_command_not_found
- > tea -X $argv
- > end
- > ```
- >
- > </details>
- ## How do I find available packages?
- We list all packages at [tea.xyz](https://tea.xyz/+/).
- Or `open ~/.tea/tea.xyz/var/pantry`. We
- agree this is not great UX.
- ## What are you doing to my computer?
- We install compartmentalized packages to `~/.tea`.
- We then suggest you add our one-liner to your shell `.rc` and a symlink
- for `/usr/local/bin/tea`.
- We might not have installed tea, if you used `sh <(curl tea.xyz) foo` and tea
- wasn’t already installed, then we only fetched any packages, including
- tea, temporarily.
- ## I thought you were decentralized and web3 and shit
- [tea is creating new technologies that will change how open source is funded][white-paper].
- tea/cli is an essential part of that endeavor and is released
- prior to our protocol in order to bootstrap our holistic vision.
- We don’t subscribe to any particular “web” at tea.xyz, our blockchain
- component will be an implementation detail that you won’t need to think about
- (but we think you will want to).
- ## Am I or my employer going to have to pay for open source now?
- No. Software is a multi-trillion industry. We only have to skim a little off
- that to pay the entire open source ecosystem. Check out our [white-paper] for
- the deets.
- ## Packaging up tea packages with your `.app`, etc.
- Our packages are relocatable by default. Just keep the directory structure the
- same. And ofc. you are licensed to do so (by us! each package has its own
- license!). Honestly we think you should
- absolutely bundle and deploy tea’s prefix with your software. We designed it
- so that it would be easier for you to do this than anything that has come
- before.
- ## Will you support platform `foo`
- We want to support *all* platforms.
- Start a [discussion] and let’s talk about how to move forward with that.
- ## I have another question
- Start a [discussion] and we’ll get back to you.
-
-
- # Appendix
- ## Philosophy
- * Be non‑intrusive
- > don’t interfere with our users’ systems or habits
- * Be “just works”
- > our users have better things to do than fix us
- * Error messages must be excellent
- > trust that if it comes to it, our users can fix things provided we give
- > them a helping hand
- * Be intuitive
- > being clever is good—but don’t be so clever nobody gets it
- * Resist complexity
- > rethink the problem until a simpler solution emerges
- * Be fast
- > we are in the way of our users’ real work, don’t make them wait
- ## Troubleshooting
- ### `env: tea: No such file or directory`
- If you got this error message, you need to install tea:
- `sh <(curl https://tea.xyz)`.
- ## vs. `brew`
- We don’t aim to replace `brew`, we see our offerings as somewhat
- complementary. Still where we have overlapping features:
- * tea supports more platforms
- * tea is transparently cross-platform in usage
- * tea packages are relocatable
- * tea aims to be zippy and stay zippy
- * tea doesn’t make global changes to your system
- * tea doesn’t require you install the Xcode Command Line Tools
- * tea aims to enhance the way you work, rather than dictate the way you work
- * tea installs independently for every user on the machine
- * tea is somewhat decentralized and aims to be completely decentralized
- * tea is a handful of tight, easy-to-understand codebases
- * tea starts building new releases for tools almost instantly
- * tea’s packages are named in a fully-qualified manner
- * tea’s philosophy is user-first and not tea-maintainer-first
-
- ## Tea Scripts
- You can execute each of these with `tea foo` where `foo` is the name of the
- section.
- ### Test
- > `FIXME` would be nice to be able to specify tests here
- > deno supports `--filter` but that would require a little
- > massaging.
- ```sh
deno task test
- ```
- ### Typecheck
- ```sh
deno task typecheck
- ```
- ### Run
- ```sh
deno task run
- ```
- ### Compile
- ```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"
- ```
- ### Install Self
- Installs this working copy into `~/.tea/tea.xyz/vx.y.z`.
- ```sh
tea compile "$TEA_PREFIX/tea.xyz/v$VERSION/bin/tea"
"$SRCROOT"/scripts/repair.ts tea.xyz
- ```
- ## Dependencies
- | Project | Version |
- | --------- | ------- |
- | deno.land | ^1.27 |
- | tea.xyz | ^0 |
- > macOS >= 11 || linux:glibc >= 23
-
- ## A Brief Diatribe
- Every programming language, every build system, every compiler, web server,
- database and email client seem to gravitate towards adding infinite features
- and complexity so that their users can do ever more and more.
- This is contrary to the UNIX philosophy: tools should do one thing and
- —by being tight and focused—
- do it *damn* well.
- If they are composable and flexible then they can be combined,
- piped and leveraged into a larger,
- more capable toolbox.
- *The Internet is built with this toolbox.*
- Nowadays every programming language
- reimplements the same set of libraries and tools because using a
- well-maintained, mature and portable library that lives higher up the stack
- adds too much complexity.
- This extends the adolescence of new languages,
- results in no single language even becoming truly state of the art
- and leads to degrees of
- duplication that make the open source ecosystem *fragile*.
- This is to the detriment of all software, everywhere.
- tea removes this complexity and adds some much needed robustness for the good
- of the entire open source ecosystem, the larger Internet and the whole world
- of software.
- [pantry]: https://github.com/teaxyz/pantry.core
- [Markdown]: https://daringfireball.net/projects/markdown/
- [releases]: ../../releases
- [teaxyz/setup]: https://github.com/teaxyz/setup
- [deno]: https://deno.land
- [tea/cmd]: https://github.com/teaxyz/cmd
- [TypeScript]: https://www.typescriptlang.org
- [discussion]: https://github.com/orgs/teaxyz/discussions
- [white-paper]: https://github.com/teaxyz/white-paper
- [`brew`]: https://brew.sh
- [charm]: https://charm.sh
- [pantry.extra]: https://github.com/teaxyz/pantry.extra
探客时代
