@tnldotdev/tnl 0.0.0 → 0.1.0-rc.13

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 Chase Adams
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,4 +1,34 @@
1
1
  # `@tnldotdev/tnl`
2
2
 
3
- This is an inert placeholder used to configure trusted publishing for the tnl client.
4
- It does not contain an executable or library entry point.
3
+ This package installs the `tnl` client for macOS or Linux on arm64 or x64. It
4
+ does not include the `tnld` server daemon.
5
+
6
+ ## Install
7
+
8
+ Install the client:
9
+
10
+ ```console
11
+ pnpm add --save-dev @tnldotdev/tnl@next
12
+ ```
13
+
14
+ Add `@tnldotdev/next` or `@tnldotdev/vite` for framework integration.
15
+
16
+ Then invoke `tnl` from a package script:
17
+
18
+ ```json
19
+ {
20
+ "scripts": {
21
+ "dev:public": "tnl dev -- pnpm dev"
22
+ }
23
+ }
24
+ ```
25
+
26
+ Use `tnl publish 3000 --open` or `tnl dev --open -- pnpm dev` to launch the
27
+ public URL once it is ready.
28
+
29
+ The package selects an exact-version native optional dependency for the current
30
+ platform. It does not run an install script or download executable code from a
31
+ third-party host. Node.js 22.15 or newer is required by the launcher.
32
+
33
+ Deploy `tnld` with the release container or install it from Homebrew or a
34
+ release archive.
package/bin/tnl.mjs ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+
3
+ import process from "node:process";
4
+ import { resolveNativeBinary } from "../lib/launcher.mjs";
5
+
6
+ try {
7
+ const binary = resolveNativeBinary();
8
+ process.execve(binary, [binary, ...process.argv.slice(2)], process.env);
9
+ } catch (error) {
10
+ const message = error instanceof Error ? error.message : String(error);
11
+ process.stderr.write(`tnl: ${message}\n`);
12
+ process.exitCode = 1;
13
+ }
@@ -0,0 +1,64 @@
1
+ import { constants, accessSync, readFileSync } from "node:fs";
2
+ import { createRequire } from "node:module";
3
+ import path from "node:path";
4
+ import process from "node:process";
5
+
6
+ const require = createRequire(import.meta.url);
7
+ const launcherManifest = new URL("../package.json", import.meta.url);
8
+
9
+ const nativePackages = new Map([
10
+ ["darwin-arm64", "@tnldotdev/tnl-darwin-arm64"],
11
+ ["darwin-x64", "@tnldotdev/tnl-darwin-x64"],
12
+ ["linux-arm64", "@tnldotdev/tnl-linux-arm64"],
13
+ ["linux-x64", "@tnldotdev/tnl-linux-x64"],
14
+ ]);
15
+
16
+ export function nativePackageName(platform, architecture) {
17
+ const packageName = nativePackages.get(`${platform}-${architecture}`);
18
+ if (packageName === undefined) {
19
+ throw new Error(
20
+ `unsupported platform ${platform}-${architecture}; tnl supports macOS and Linux on arm64 and x64`,
21
+ );
22
+ }
23
+ return packageName;
24
+ }
25
+
26
+ export function resolveNativeBinary({
27
+ architecture = process.arch,
28
+ platform = process.platform,
29
+ resolve = require.resolve,
30
+ } = {}) {
31
+ const packageName = nativePackageName(platform, architecture);
32
+ let nativeManifestPath;
33
+ try {
34
+ nativeManifestPath = resolve(`${packageName}/package.json`);
35
+ } catch (error) {
36
+ if (error instanceof Error && "code" in error && error.code === "MODULE_NOT_FOUND") {
37
+ throw new Error(
38
+ `${packageName} is missing; reinstall @tnldotdev/tnl without disabling optional dependencies`,
39
+ { cause: error },
40
+ );
41
+ }
42
+ throw error;
43
+ }
44
+
45
+ const mainManifest = readManifest(launcherManifest);
46
+ const nativeManifest = readManifest(nativeManifestPath);
47
+ if (nativeManifest.version !== mainManifest.version) {
48
+ throw new Error(
49
+ `${packageName}@${String(nativeManifest.version)} does not match @tnldotdev/tnl@${String(mainManifest.version)}`,
50
+ );
51
+ }
52
+
53
+ const binary = path.join(path.dirname(nativeManifestPath), "bin", "tnl");
54
+ try {
55
+ accessSync(binary, constants.X_OK);
56
+ } catch (error) {
57
+ throw new Error(`${packageName} does not contain an executable tnl binary`, { cause: error });
58
+ }
59
+ return binary;
60
+ }
61
+
62
+ function readManifest(file) {
63
+ return JSON.parse(readFileSync(file, "utf8"));
64
+ }
package/package.json CHANGED
@@ -1,17 +1,34 @@
1
1
  {
2
2
  "name": "@tnldotdev/tnl",
3
- "version": "0.0.0",
4
- "description": "Bootstrap placeholder for the tnl client.",
3
+ "version": "0.1.0-rc.13",
4
+ "description": "The tnl client for project-local development workflows.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/tnldotdev/tnl.git",
9
9
  "directory": "packages/tnl"
10
10
  },
11
+ "bin": {
12
+ "tnl": "bin/tnl.mjs"
13
+ },
11
14
  "files": [
12
- "README.md"
15
+ "bin",
16
+ "lib"
13
17
  ],
18
+ "type": "module",
14
19
  "publishConfig": {
15
20
  "access": "public"
21
+ },
22
+ "engines": {
23
+ "node": ">=22.15"
24
+ },
25
+ "optionalDependencies": {
26
+ "@tnldotdev/tnl-darwin-arm64": "0.1.0-rc.13",
27
+ "@tnldotdev/tnl-darwin-x64": "0.1.0-rc.13",
28
+ "@tnldotdev/tnl-linux-arm64": "0.1.0-rc.13",
29
+ "@tnldotdev/tnl-linux-x64": "0.1.0-rc.13"
30
+ },
31
+ "tnl": {
32
+ "commit": "5ea468a77835db128d4ff826c126dc234595704a"
16
33
  }
17
34
  }