@resfortuitae/tcache 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 res fortuitae
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,122 @@
1
- # Temporary Holding Version
1
+ # tcache
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `tcache` is the CLI for a self-hosted Turborepo remote cache. It is MIT licensed.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm i -g @resfortuitae/tcache
9
+ tcache --version
10
+ ```
11
+
12
+ npm installs one native binary for your platform through optional dependencies,
13
+ so keep optional dependencies enabled. Node 22 or later runs the launcher.
14
+ Supported targets: Linux x64/arm64 (glibc and musl), macOS x64/arm64 and Windows x64.
15
+
16
+ In CI, pin the version: `npm i -g @resfortuitae/tcache@0.1.0`.
17
+ Upgrade with `npm i -g @resfortuitae/tcache@latest`. Uninstall with
18
+ `npm rm -g @resfortuitae/tcache`.
19
+
20
+ Without npm, download a binary and `SHA256SUMS` from a
21
+ [GitHub Release](https://github.com/res-fortuitae/turborepo-remote-cache-api/releases)
22
+ (tags `cli-vX.Y.Z`), or use the version-pinned `install.sh` from the same release.
23
+
24
+ ## First use
25
+
26
+ ```sh
27
+ tcache login --api https://cache.example.com
28
+ tcache link --team ORG --project PROJECT_ID
29
+ tcache exec -- turbo run build
30
+ ```
31
+
32
+ ## Verify a release
33
+
34
+ npm packages carry npm provenance. Release binaries carry GitHub build
35
+ attestations, and `SHA256SUMS` has a Sigstore bundle:
36
+
37
+ ```sh
38
+ gh attestation verify ./tcache-linux-x64 \
39
+ --repo res-fortuitae/turborepo-remote-cache-api \
40
+ --signer-workflow res-fortuitae/turborepo-remote-cache-api/.github/workflows/cli-release.yml
41
+ cosign verify-blob --bundle SHA256SUMS.sigstore.json \
42
+ --certificate-identity 'https://github.com/res-fortuitae/turborepo-remote-cache-api/.github/workflows/cli-release.yml@refs/tags/cli-vX.Y.Z' \
43
+ --certificate-oidc-issuer https://token.actions.githubusercontent.com SHA256SUMS
44
+ sha256sum --check SHA256SUMS
45
+ ```
46
+
47
+ ## Build from source
48
+
49
+ Use Bun 1.4.3 from the repository root:
50
+
51
+ ```sh
52
+ bun install --frozen-lockfile
53
+ bun run --cwd packages/cli build
54
+ packages/cli/dist/tcache-darwin-arm64 --help # choose your host's filename
55
+ packages/cli/dist/tcache-darwin-arm64 login --api https://cache.example.com
56
+ packages/cli/dist/tcache-darwin-arm64 link --team ORG --project PROJECT_ID
57
+ packages/cli/dist/tcache-darwin-arm64 exec -- turbo run build
58
+ bun run --cwd packages/cli bench:startup
59
+ ```
60
+
61
+ `build` defaults to the host. `build linux-x64` chooses one target; `build:all`
62
+ compiles Linux x64/arm64 glibc and musl, macOS x64/arm64, and Windows x64.
63
+ Bun downloads the pinned target runtime during cross-compilation. No Node/Bun
64
+ installation or install hook is needed to execute a binary. Linux builds use the
65
+ host runtime libraries; Alpine/musl hosts need `libstdc++` (`apk add libstdc++`). x64 Linux/Windows
66
+ builds use baseline CPU targets. Default dotenv/bunfig/tsconfig/package autoloading
67
+ is disabled in compiled executables. Explicit environment and repo link config
68
+ remain supported. See [Bun executable documentation](https://bun.com/docs/bundler/executables).
69
+
70
+ Each build writes SHA256SUMS, bundled dependency license texts, and the Bun runtime
71
+ license/provenance notice. `LICENSE.bun` is copied unchanged from
72
+ [oven-sh/bun at bun-v1.4.3](https://github.com/oven-sh/bun/blob/bun-v1.4.3/LICENSE.md).
73
+ Bun's notice identifies its linked libraries and the WebKit rebuild procedure.
74
+ Packages also include the repository's MIT `LICENSE`.
75
+
76
+ Budgets: at most 128 MiB per executable; at most 500 ms p95 across twenty `--version`
77
+ process starts on the validation runner. The macOS arm64 local candidate measured
78
+ about 68 MiB and 34 ms p95. These are CLI startup/size budgets, not cache throughput
79
+ claims. `TCACHE_TEST_BINARY=/absolute/path/to/tcache bun test packages/cli/src/cli.test.ts
80
+ packages/cli/src/auth.test.ts` exercises the compiled CLI with fixture servers.
81
+
82
+ ## Containers
83
+
84
+ ```sh
85
+ bun run --cwd packages/cli build linux-arm64
86
+ docker build --build-arg TCACHE_ARCH=arm64 \
87
+ -f packages/cli/distribution/Dockerfile -t tcache-local packages/cli
88
+ docker run --rm tcache-local --version
89
+ ```
90
+
91
+ Use `TCACHE_ARCH=x64` with a matching Linux x64 Docker platform. The pinned
92
+ distroless nonroot image includes only the compiled CLI, runtime libraries and
93
+ notices. No Node/Turbo/shell is present: mount/provide compatible build tools if
94
+ using `exec`, or run the binary in your existing runner image. Native credential
95
+ stores may be unavailable in containers; private-file fallback is documented.
96
+ No image is pushed to GHCR by the current workflow. A future release may publish
97
+ `ghcr.io/res-fortuitae/tcache` after review and explicit publication authorization.
98
+
99
+ ## Releasing
100
+
101
+ The version lives in `packages/cli/package.json`. To release:
102
+
103
+ 1. Bump `version` there and merge to `main`.
104
+ 2. Push a matching tag: `git tag cli-vX.Y.Z && git push origin cli-vX.Y.Z`.
105
+ 3. Approve the run in the `cli-release` environment.
106
+
107
+ `.github/workflows/cli-release.yml` rejects a tag that does not match the
108
+ version. It reuses the build and smoke jobs from `cli-binaries.yml`, then on a
109
+ GitHub-hosted runner: verifies checksums, attests the binaries, signs
110
+ `SHA256SUMS`, publishes the 7 platform packages and then `@resfortuitae/tcache`
111
+ to npm through trusted publishing (no npm token), and uploads the binaries,
112
+ `SHA256SUMS`, its Sigstore bundle, `install.sh` and the Homebrew formula to a
113
+ GitHub Release. Versions already on npm are skipped, so a failed run can be re-run.
114
+
115
+ One-time setup: protect `cli-v*` tag creation with a ruleset, create the
116
+ `cli-release` environment with a required reviewer, and add a trusted publisher
117
+ (this repository, `cli-release.yml`, environment `cli-release`) to each of the
118
+ 8 npm packages. Packages have no install-time scripts.
119
+
120
+ `bun packages/cli/scripts/homebrew.ts` generates `dist/tcache.rb` for a future
121
+ Homebrew tap; no tap is created or updated automatically. No container image is
122
+ published.
@@ -0,0 +1,100 @@
1
+ @effect/platform-bun@4.0.6
2
+ MIT License
3
+
4
+ Copyright (c) 2023 Effectful Technologies Inc
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
23
+
24
+
25
+ ----------
26
+
27
+ @effect/platform-node-shared@4.0.6
28
+ MIT License
29
+
30
+ Copyright (c) 2023 Effectful Technologies Inc
31
+
32
+ Permission is hereby granted, free of charge, to any person obtaining a copy
33
+ of this software and associated documentation files (the "Software"), to deal
34
+ in the Software without restriction, including without limitation the rights
35
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
36
+ copies of the Software, and to permit persons to whom the Software is
37
+ furnished to do so, subject to the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be included in all
40
+ copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
47
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
+ SOFTWARE.
49
+
50
+
51
+ ----------
52
+
53
+ effect@4.0.6
54
+ MIT License
55
+
56
+ Copyright (c) 2023 Effectful Technologies Inc
57
+
58
+ Permission is hereby granted, free of charge, to any person obtaining a copy
59
+ of this software and associated documentation files (the "Software"), to deal
60
+ in the Software without restriction, including without limitation the rights
61
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
62
+ copies of the Software, and to permit persons to whom the Software is
63
+ furnished to do so, subject to the following conditions:
64
+
65
+ The above copyright notice and this permission notice shall be included in all
66
+ copies or substantial portions of the Software.
67
+
68
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
69
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
70
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
71
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
72
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
73
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
74
+ SOFTWARE.
75
+
76
+
77
+ ----------
78
+
79
+ jose@6.2.13
80
+ The MIT License (MIT)
81
+
82
+ Copyright (c) 2018 Filip Skokan
83
+
84
+ Permission is hereby granted, free of charge, to any person obtaining a copy
85
+ of this software and associated documentation files (the "Software"), to deal
86
+ in the Software without restriction, including without limitation the rights
87
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
88
+ copies of the Software, and to permit persons to whom the Software is
89
+ furnished to do so, subject to the following conditions:
90
+
91
+ The above copyright notice and this permission notice shall be included in all
92
+ copies or substantial portions of the Software.
93
+
94
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
95
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
96
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
97
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
98
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
99
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
100
+ SOFTWARE.
package/bin.cjs ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ const { spawnSync } = require("node:child_process");
4
+ const { join, dirname } = require("node:path");
5
+ const metadata = require("./package.json");
6
+ const musl = process.platform === "linux" && !process.report.getReport().header.glibcVersionRuntime;
7
+ const target = `${process.platform === "win32" ? "windows" : process.platform}-${process.arch}${musl ? "-musl" : ""}`;
8
+ try {
9
+ const packageName = `${metadata.name}-${target}`;
10
+ const manifest = require.resolve(`${packageName}/package.json`);
11
+ const file = process.platform === "win32" ? "tcache.exe" : "tcache";
12
+ const binary = join(dirname(manifest), file);
13
+ const child = spawnSync(binary, process.argv.slice(2), { stdio: "inherit", env: process.env });
14
+ if (child.error) throw child.error;
15
+ if (child.signal) process.kill(process.pid, child.signal);
16
+ else process.exitCode = child.status ?? 1;
17
+ } catch {
18
+ console.error(
19
+ `Unable to run tcache for ${target}. Install with optional dependencies enabled or use a verified release binary.`,
20
+ );
21
+ process.exitCode = 1;
22
+ }
package/package.json CHANGED
@@ -1,6 +1,35 @@
1
1
  {
2
2
  "name": "@resfortuitae/tcache",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Self-hosted Turborepo remote cache CLI",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "tcache": "bin.cjs"
8
+ },
9
+ "files": [
10
+ "bin.cjs",
11
+ "LICENSE",
12
+ "THIRD_PARTY_LICENSES.txt",
13
+ "README.md"
14
+ ],
15
+ "engines": {
16
+ "node": ">=22"
17
+ },
18
+ "optionalDependencies": {
19
+ "@resfortuitae/tcache-linux-x64": "0.1.0",
20
+ "@resfortuitae/tcache-linux-arm64": "0.1.0",
21
+ "@resfortuitae/tcache-linux-x64-musl": "0.1.0",
22
+ "@resfortuitae/tcache-linux-arm64-musl": "0.1.0",
23
+ "@resfortuitae/tcache-darwin-x64": "0.1.0",
24
+ "@resfortuitae/tcache-darwin-arm64": "0.1.0",
25
+ "@resfortuitae/tcache-windows-x64": "0.1.0"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/res-fortuitae/turborepo-remote-cache-api.git"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public",
33
+ "provenance": true
34
+ }
6
35
  }