sessionpipe 0.5.0 → 0.6.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/README.md +44 -0
- package/dist/cli.js +946 -243
- package/dist/cli.js.map +4 -4
- package/dist/control/autoupdate.d.ts +156 -0
- package/dist/control/autoupdate.d.ts.map +1 -0
- package/dist/control/cli.d.ts +4 -0
- package/dist/control/cli.d.ts.map +1 -1
- package/dist/control/daemon.d.ts +54 -1
- package/dist/control/daemon.d.ts.map +1 -1
- package/dist/control/local.d.ts +4 -0
- package/dist/control/local.d.ts.map +1 -1
- package/dist/control/pair.d.ts +3 -0
- package/dist/control/pair.d.ts.map +1 -1
- package/dist/control/route.d.ts +6 -0
- package/dist/control/route.d.ts.map +1 -1
- package/dist/control/store.d.ts +4 -0
- package/dist/control/store.d.ts.map +1 -1
- package/dist/hook.js +1 -1
- package/dist/hook.js.map +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/update.d.ts +70 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/worker.js +1 -1
- package/dist/worker.js.map +2 -2
- package/package.json +1 -1
package/dist/update.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const REGISTRY_LATEST = "https://registry.npmjs.org/sessionpipe/latest";
|
|
2
|
+
/** Order two versions: <0, 0, >0, or null if either isn't one. A release sorts above
|
|
3
|
+
* its own prereleases; prereleases compare by their tag. */
|
|
4
|
+
export declare function compareVersions(a: string, b: string): number | null;
|
|
5
|
+
/** `a` is a release newer than `b`. A prerelease is never offered as an update: the
|
|
6
|
+
* `latest` dist-tag is a release, and anything else is someone's experiment. */
|
|
7
|
+
export declare function isNewer(a: string, b: string): boolean;
|
|
8
|
+
/** The registry's `latest` for sessionpipe: one GET, nothing sent but the request. */
|
|
9
|
+
export declare function latestVersion(f?: typeof fetch, timeoutMs?: number): Promise<string>;
|
|
10
|
+
/** The prefix a global npm install of sessionpipe lives under, from the running copy's
|
|
11
|
+
* dist folder (`<prefix>/lib/node_modules/sessionpipe/dist`, on Windows
|
|
12
|
+
* `<prefix>\node_modules\sessionpipe\dist`). */
|
|
13
|
+
export declare function prefixOf(distDir: string, platform?: NodeJS.Platform): string | null;
|
|
14
|
+
/** The npm prefix this copy was installed into with `npm install -g`, or null when it
|
|
15
|
+
* isn't a global npm install (the npx cache, a git checkout, a project's
|
|
16
|
+
* node_modules, a dev build). A global install always has its bin link in the prefix. */
|
|
17
|
+
export declare function globalPrefix(distDir: string, platform?: NodeJS.Platform): string | null;
|
|
18
|
+
/** Why npm can't write this prefix (installed with sudo, a read-only image), or null. */
|
|
19
|
+
export declare function unwritable(prefix: string, platform?: NodeJS.Platform): string | null;
|
|
20
|
+
/** npm, run by this very node: under launchd PATH is /usr/bin:/bin, so neither `npm`
|
|
21
|
+
* nor the `node` its shebang asks for is on it. Its npm-cli.js sits beside the node
|
|
22
|
+
* binary (nvm, Homebrew, the official builds, the node Docker images). */
|
|
23
|
+
export declare function npmArgv(node: string, platform?: NodeJS.Platform): string[];
|
|
24
|
+
export interface ExecResult {
|
|
25
|
+
code: number | null;
|
|
26
|
+
stdout: string;
|
|
27
|
+
stderr: string;
|
|
28
|
+
error?: string;
|
|
29
|
+
}
|
|
30
|
+
export type Exec = (argv: string[], o: {
|
|
31
|
+
env: NodeJS.ProcessEnv;
|
|
32
|
+
timeoutMs: number;
|
|
33
|
+
}) => Promise<ExecResult>;
|
|
34
|
+
/** Run a command to the end, keeping the tail of its output. */
|
|
35
|
+
export declare const execCapture: Exec;
|
|
36
|
+
export interface InstallOptions {
|
|
37
|
+
/** The node running this copy (process.execPath). */
|
|
38
|
+
node: string;
|
|
39
|
+
/** The running copy's dist folder: where the new one lands, under the same prefix. */
|
|
40
|
+
distDir: string;
|
|
41
|
+
/** Harnesses whose hooks to re-arm afterwards (config.harnesses that are enabled). */
|
|
42
|
+
harnesses: string[];
|
|
43
|
+
env?: NodeJS.ProcessEnv;
|
|
44
|
+
exec?: Exec;
|
|
45
|
+
platform?: NodeJS.Platform;
|
|
46
|
+
}
|
|
47
|
+
export type InstallResult = {
|
|
48
|
+
ok: true;
|
|
49
|
+
ms: number;
|
|
50
|
+
hooks: string;
|
|
51
|
+
} | {
|
|
52
|
+
ok: false;
|
|
53
|
+
ms: number;
|
|
54
|
+
error: string;
|
|
55
|
+
stage: "prefix" | "npm" | "verify";
|
|
56
|
+
};
|
|
57
|
+
/** The version of the copy on disk (which may not be the one running). */
|
|
58
|
+
export declare function installedVersion(o: {
|
|
59
|
+
node: string;
|
|
60
|
+
distDir: string;
|
|
61
|
+
env?: NodeJS.ProcessEnv;
|
|
62
|
+
exec?: Exec;
|
|
63
|
+
}): Promise<string | null>;
|
|
64
|
+
/** `npm install -g sessionpipe@<version>` into the prefix the running copy came from,
|
|
65
|
+
* check the copy on disk says that version, then re-copy the hook launcher's files
|
|
66
|
+
* (the hooks run copies in ~/.local/share/sessionpipe, which npm never touches) for
|
|
67
|
+
* the harnesses already set up here. Lifecycle scripts are off: sessionpipe has none,
|
|
68
|
+
* and an unattended install runs nothing it fetched. */
|
|
69
|
+
export declare function installVersion(version: string, o: InstallOptions): Promise<InstallResult>;
|
|
70
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../src/update.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,eAAe,kDAAkD,CAAC;AAc/E;6DAC6D;AAC7D,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASnE;AAED;iFACiF;AACjF,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAKrD;AAED,sFAAsF;AACtF,wBAAsB,aAAa,CAAC,CAAC,GAAE,OAAO,KAAa,EAAE,SAAS,SAAO,GAAG,OAAO,CAAC,MAAM,C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