vite-plugin-io1 0.1.0 → 0.1.1
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/README.md +11 -7
- package/dist/announce.d.ts +2 -2
- package/dist/announce.js +2 -2
- package/dist/binary.d.ts +2 -2
- package/dist/binary.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/announce.ts +2 -2
- package/src/binary.ts +2 -2
- package/src/index.ts +1 -1
package/README.md
CHANGED
|
@@ -10,11 +10,15 @@ startup output.
|
|
|
10
10
|
|
|
11
11
|
## Why
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
A tunnel is only worth anything if it points at the dev server you are actually editing, and this
|
|
14
|
+
one does: the public URL is your running `vite dev` - HMR and all - so a teammate (or your phone)
|
|
15
|
+
hits the same live server you have open, and a save reloads their page in place. It arrives over a
|
|
16
|
+
genuine HTTPS cert, so the secure-context APIs that quietly refuse to run on plain HTTP - service
|
|
17
|
+
workers, the camera, WebCrypto - just work.
|
|
18
|
+
|
|
19
|
+
Set `allowedEmails` and the preview turns shared-but-not-public: a visitor verifies one of those
|
|
20
|
+
addresses before the host resolves for them. And because the relay presents the upstream's own Host,
|
|
21
|
+
Vite's host check never trips - there is no `server.allowedHosts` to wrangle.
|
|
18
22
|
|
|
19
23
|
## Install
|
|
20
24
|
|
|
@@ -71,14 +75,14 @@ explicitly for a shared demo host.
|
|
|
71
75
|
|
|
72
76
|
The `bitmot` CLI carries a version (`bitmot version`), and the gateway advertises the latest one on
|
|
73
77
|
every relay handshake; run by hand, the CLI nudges you when you are out of date. That nudge is
|
|
74
|
-
deliberately silent when its output is piped or `CI` is set
|
|
78
|
+
deliberately silent when its output is piped or `CI` is set - that is, whenever this plugin runs it.
|
|
75
79
|
So the plugin keeps the CLI current a different way: auto-download resolves the **currently deployed**
|
|
76
80
|
bytes by content hash, so a plugin-managed CLI is always up to date and the nudge is moot. A CLI you
|
|
77
81
|
installed yourself on your PATH is respected as-is and never replaced.
|
|
78
82
|
|
|
79
83
|
## Caveats
|
|
80
84
|
|
|
81
|
-
- **macOS and Linux**
|
|
85
|
+
- **macOS and Linux** - published binaries cover macOS (arm64/x86_64) and Linux (x86_64/aarch64).
|
|
82
86
|
Elsewhere (e.g. native Windows), install `bitmot` yourself (the plugin will use it) or set
|
|
83
87
|
`bitmotPath`.
|
|
84
88
|
- **Middleware mode** (e.g. Nuxt) exposes no `httpServer` for the plugin to hook; not yet supported.
|
package/dist/announce.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure argument-building and output-parsing for the bitmot io1 relay. Kept free of I/O so the wire
|
|
3
|
-
* contract with the CLI
|
|
3
|
+
* contract with the CLI - which flags it takes, and how it announces a live host - is unit-tested
|
|
4
4
|
* in isolation and lives in one place.
|
|
5
5
|
*/
|
|
6
6
|
export interface RelayInvocation {
|
|
@@ -30,7 +30,7 @@ export declare function buildRelayArgs(invocation: RelayInvocation): string[];
|
|
|
30
30
|
* The public URL from a relay's per-host announcement line, or null for any other line. The relay
|
|
31
31
|
* prints one `<arrow> <url> live` line per claimed host once its link is up (uncolored when its
|
|
32
32
|
* stderr is piped, as it is under this plugin). Tolerant of the arrow glyph and surrounding spaces so
|
|
33
|
-
* both the native and JVM CLIs
|
|
33
|
+
* both the native and JVM CLIs - and any cached older build - parse the same; the trailing `live`
|
|
34
34
|
* badge is what distinguishes it from the pending-requests and update-nudge lines, which also carry
|
|
35
35
|
* URLs but must not be mistaken for a live host.
|
|
36
36
|
*/
|
package/dist/announce.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure argument-building and output-parsing for the bitmot io1 relay. Kept free of I/O so the wire
|
|
3
|
-
* contract with the CLI
|
|
3
|
+
* contract with the CLI - which flags it takes, and how it announces a live host - is unit-tested
|
|
4
4
|
* in isolation and lives in one place.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
@@ -31,7 +31,7 @@ export function buildRelayArgs(invocation) {
|
|
|
31
31
|
* The public URL from a relay's per-host announcement line, or null for any other line. The relay
|
|
32
32
|
* prints one `<arrow> <url> live` line per claimed host once its link is up (uncolored when its
|
|
33
33
|
* stderr is piped, as it is under this plugin). Tolerant of the arrow glyph and surrounding spaces so
|
|
34
|
-
* both the native and JVM CLIs
|
|
34
|
+
* both the native and JVM CLIs - and any cached older build - parse the same; the trailing `live`
|
|
35
35
|
* badge is what distinguishes it from the pending-requests and update-nudge lines, which also carry
|
|
36
36
|
* URLs but must not be mistaken for a live host.
|
|
37
37
|
*/
|
package/dist/binary.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface ResolvedBinary {
|
|
|
22
22
|
* The published artifact name for a platform/arch, or null when unsupported. Mirrors the server's
|
|
23
23
|
* download whitelist (io/io1/gateway/download/DownloadRoutesImpl.kt) and the installer's `uname`
|
|
24
24
|
* mapping: macOS and Linux, on x86_64 or 64-bit ARM. Node's arch is translated to the server's
|
|
25
|
-
* spelling
|
|
25
|
+
* spelling - 'x64' -> 'x86_64' on both, but 64-bit ARM is 'arm64' on macOS and 'aarch64' on Linux.
|
|
26
26
|
*/
|
|
27
27
|
export declare function artifactFor(platform: NodeJS.Platform, arch: string): string | null;
|
|
28
28
|
/** `bitmot version` -> "0.2.1", or null if the binary is missing or its output is unexpected. */
|
|
@@ -33,7 +33,7 @@ export declare function readVersion(binary: string): string | null;
|
|
|
33
33
|
* followed response's checksum header names the current version: if a file for that hash is already
|
|
34
34
|
* cached the body is dropped undownloaded, otherwise it is streamed, verified against the advertised
|
|
35
35
|
* checksum, and atomically installed. This is what makes a plugin-managed CLI track production
|
|
36
|
-
* automatically
|
|
36
|
+
* automatically - so the CLI's own "you're out of date" nudge (suppressed anyway when its stderr is
|
|
37
37
|
* piped, as it is here) does not matter for the auto-managed case.
|
|
38
38
|
*/
|
|
39
39
|
export declare function ensureDownloaded(baseUrl: string, artifact: string, cacheDir: string, log?: (message: string) => void): Promise<{
|
package/dist/binary.js
CHANGED
|
@@ -11,7 +11,7 @@ const DEFAULT_BASE_URL = 'https://bitmot.com';
|
|
|
11
11
|
* The published artifact name for a platform/arch, or null when unsupported. Mirrors the server's
|
|
12
12
|
* download whitelist (io/io1/gateway/download/DownloadRoutesImpl.kt) and the installer's `uname`
|
|
13
13
|
* mapping: macOS and Linux, on x86_64 or 64-bit ARM. Node's arch is translated to the server's
|
|
14
|
-
* spelling
|
|
14
|
+
* spelling - 'x64' -> 'x86_64' on both, but 64-bit ARM is 'arm64' on macOS and 'aarch64' on Linux.
|
|
15
15
|
*/
|
|
16
16
|
export function artifactFor(platform, arch) {
|
|
17
17
|
if (platform === 'darwin') {
|
|
@@ -63,7 +63,7 @@ function onPath() {
|
|
|
63
63
|
* followed response's checksum header names the current version: if a file for that hash is already
|
|
64
64
|
* cached the body is dropped undownloaded, otherwise it is streamed, verified against the advertised
|
|
65
65
|
* checksum, and atomically installed. This is what makes a plugin-managed CLI track production
|
|
66
|
-
* automatically
|
|
66
|
+
* automatically - so the CLI's own "you're out of date" nudge (suppressed anyway when its stderr is
|
|
67
67
|
* piped, as it is here) does not matter for the auto-managed case.
|
|
68
68
|
*/
|
|
69
69
|
export async function ensureDownloaded(baseUrl, artifact, cacheDir, log) {
|
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export interface Io1PluginOptions {
|
|
|
28
28
|
/**
|
|
29
29
|
* Vite plugin: while the dev (or preview) server runs, publish it to the internet over a
|
|
30
30
|
* `bitmot io1 relay` child process, proxying to the server's real bound port. The relay's lifetime is
|
|
31
|
-
* tied to the server
|
|
31
|
+
* tied to the server - spawned once it is listening, killed when it closes - so a shared URL never
|
|
32
32
|
* outlives the session. The CLI is located on PATH or auto-downloaded (content-addressed, so it tracks
|
|
33
33
|
* the deployed build). Reconnects are the relay's own concern; a non-zero exit is a definitive refusal
|
|
34
34
|
* (bad auth, host held by another account) and is surfaced, not retried.
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ function normalizeHosts(host) {
|
|
|
10
10
|
/**
|
|
11
11
|
* Vite plugin: while the dev (or preview) server runs, publish it to the internet over a
|
|
12
12
|
* `bitmot io1 relay` child process, proxying to the server's real bound port. The relay's lifetime is
|
|
13
|
-
* tied to the server
|
|
13
|
+
* tied to the server - spawned once it is listening, killed when it closes - so a shared URL never
|
|
14
14
|
* outlives the session. The CLI is located on PATH or auto-downloaded (content-addressed, so it tracks
|
|
15
15
|
* the deployed build). Reconnects are the relay's own concern; a non-zero exit is a definitive refusal
|
|
16
16
|
* (bad auth, host held by another account) and is surfaced, not retried.
|
package/package.json
CHANGED
package/src/announce.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure argument-building and output-parsing for the bitmot io1 relay. Kept free of I/O so the wire
|
|
3
|
-
* contract with the CLI
|
|
3
|
+
* contract with the CLI - which flags it takes, and how it announces a live host - is unit-tested
|
|
4
4
|
* in isolation and lives in one place.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -44,7 +44,7 @@ export function buildRelayArgs(invocation: RelayInvocation): string[] {
|
|
|
44
44
|
* The public URL from a relay's per-host announcement line, or null for any other line. The relay
|
|
45
45
|
* prints one `<arrow> <url> live` line per claimed host once its link is up (uncolored when its
|
|
46
46
|
* stderr is piped, as it is under this plugin). Tolerant of the arrow glyph and surrounding spaces so
|
|
47
|
-
* both the native and JVM CLIs
|
|
47
|
+
* both the native and JVM CLIs - and any cached older build - parse the same; the trailing `live`
|
|
48
48
|
* badge is what distinguishes it from the pending-requests and update-nudge lines, which also carry
|
|
49
49
|
* URLs but must not be mistaken for a live host.
|
|
50
50
|
*/
|
package/src/binary.ts
CHANGED
|
@@ -36,7 +36,7 @@ const DEFAULT_BASE_URL = 'https://bitmot.com'
|
|
|
36
36
|
* The published artifact name for a platform/arch, or null when unsupported. Mirrors the server's
|
|
37
37
|
* download whitelist (io/io1/gateway/download/DownloadRoutesImpl.kt) and the installer's `uname`
|
|
38
38
|
* mapping: macOS and Linux, on x86_64 or 64-bit ARM. Node's arch is translated to the server's
|
|
39
|
-
* spelling
|
|
39
|
+
* spelling - 'x64' -> 'x86_64' on both, but 64-bit ARM is 'arm64' on macOS and 'aarch64' on Linux.
|
|
40
40
|
*/
|
|
41
41
|
export function artifactFor(platform: NodeJS.Platform, arch: string): string | null {
|
|
42
42
|
if (platform === 'darwin') {
|
|
@@ -87,7 +87,7 @@ function onPath(): boolean {
|
|
|
87
87
|
* followed response's checksum header names the current version: if a file for that hash is already
|
|
88
88
|
* cached the body is dropped undownloaded, otherwise it is streamed, verified against the advertised
|
|
89
89
|
* checksum, and atomically installed. This is what makes a plugin-managed CLI track production
|
|
90
|
-
* automatically
|
|
90
|
+
* automatically - so the CLI's own "you're out of date" nudge (suppressed anyway when its stderr is
|
|
91
91
|
* piped, as it is here) does not matter for the auto-managed case.
|
|
92
92
|
*/
|
|
93
93
|
export async function ensureDownloaded(
|
package/src/index.ts
CHANGED
|
@@ -42,7 +42,7 @@ type ServeServer = ViteDevServer | PreviewServer
|
|
|
42
42
|
/**
|
|
43
43
|
* Vite plugin: while the dev (or preview) server runs, publish it to the internet over a
|
|
44
44
|
* `bitmot io1 relay` child process, proxying to the server's real bound port. The relay's lifetime is
|
|
45
|
-
* tied to the server
|
|
45
|
+
* tied to the server - spawned once it is listening, killed when it closes - so a shared URL never
|
|
46
46
|
* outlives the session. The CLI is located on PATH or auto-downloaded (content-addressed, so it tracks
|
|
47
47
|
* the deployed build). Reconnects are the relay's own concern; a non-zero exit is a definitive refusal
|
|
48
48
|
* (bad auth, host held by another account) and is surfaced, not retried.
|