@cordfuse/crosstalk 7.0.0-alpha.5 → 7.0.0-alpha.7
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 +23 -18
- package/bin/crosstalk.js +2 -0
- package/commands/auth.js +218 -0
- package/commands/channel.js +3 -2
- package/commands/chat.js +90 -24
- package/commands/down.js +18 -15
- package/commands/init.js +213 -68
- package/commands/logs.js +8 -10
- package/commands/pull.js +7 -9
- package/commands/replies.js +4 -3
- package/commands/restart.js +16 -11
- package/commands/rm.js +109 -0
- package/commands/run.js +4 -3
- package/commands/status.js +15 -10
- package/commands/up.js +81 -169
- package/commands/version.js +3 -2
- package/lib/api-client.js +43 -17
- package/lib/argv.js +4 -2
- package/lib/resolve.js +192 -0
- package/package.json +1 -1
- package/lib/transport.js +0 -51
package/lib/transport.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// transport.js — locate the current Crosstalk transport on the host,
|
|
2
|
-
// derive its conventional names (compose project, container name, etc.).
|
|
3
|
-
//
|
|
4
|
-
// A transport is identified by a CROSSTALK-VERSION file at its root.
|
|
5
|
-
// `crosstalk` walks up from the operator's cwd to find it — same pattern
|
|
6
|
-
// as `git`, `npm`, etc. discovering their root directories.
|
|
7
|
-
|
|
8
|
-
import { existsSync, statSync } from 'fs';
|
|
9
|
-
import { resolve, basename, dirname, join } from 'path';
|
|
10
|
-
|
|
11
|
-
export function findTransportRoot(startDir = process.cwd()) {
|
|
12
|
-
let dir = resolve(startDir);
|
|
13
|
-
for (;;) {
|
|
14
|
-
if (existsSync(join(dir, 'CROSSTALK-VERSION'))) {
|
|
15
|
-
try {
|
|
16
|
-
if (statSync(join(dir, 'CROSSTALK-VERSION')).isFile()) return dir;
|
|
17
|
-
} catch { /* fall through */ }
|
|
18
|
-
}
|
|
19
|
-
const parent = dirname(dir);
|
|
20
|
-
if (parent === dir) return null;
|
|
21
|
-
dir = parent;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function requireTransportRoot(startDir = process.cwd()) {
|
|
26
|
-
const root = findTransportRoot(startDir);
|
|
27
|
-
if (!root) {
|
|
28
|
-
process.stderr.write(
|
|
29
|
-
`crosstalk: not inside a Crosstalk transport ` +
|
|
30
|
-
`(no CROSSTALK-VERSION found from ${resolve(startDir)} upward).\n` +
|
|
31
|
-
`Create one with 'crosstalk init <dir>' or cd into an existing transport.\n`,
|
|
32
|
-
);
|
|
33
|
-
process.exit(2);
|
|
34
|
-
}
|
|
35
|
-
return root;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// transport-name is the basename of the transport root. Used for the
|
|
39
|
-
// compose project, container name, volume names — gives each transport
|
|
40
|
-
// on a host distinct docker objects without an explicit registry.
|
|
41
|
-
export function transportName(transportRoot) {
|
|
42
|
-
return basename(transportRoot);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function containerName(transportRoot) {
|
|
46
|
-
return `crosstalk-${transportName(transportRoot)}`;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function composeFile(transportRoot) {
|
|
50
|
-
return join(transportRoot, 'docker-compose.yml');
|
|
51
|
-
}
|