@procedures/snapshot 0.59.1 → 0.60.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/CHANGELOG.md +47 -0
- package/README.md +1 -1
- package/dist/procedures/snapshot/commands.d.ts +7 -5
- package/dist/procedures/snapshot/commands.d.ts.map +1 -1
- package/dist/procedures/snapshot/commands.js +9 -18
- package/dist/procedures/snapshot/commands.js.map +1 -1
- package/dist/procedures/snapshot/create.js +3 -3
- package/dist/procedures/snapshot/create.js.map +1 -1
- package/package.json +6 -7
- package/src/procedures/snapshot/commands.ts +9 -18
- package/src/procedures/snapshot/create.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @procedures/snapshot
|
|
2
2
|
|
|
3
|
+
## 0.60.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6e6805f: `snapshot.create` reads the pnpm version from the `package.json` of the pnpm package. It starts no program, so its declared effects hold without `process`.
|
|
8
|
+
|
|
9
|
+
- The new function `installedPnpmVersion()` of `@procedures/pnpm` gives the version of the pnpm that `resolvePnpm()` finds. It starts no program.
|
|
10
|
+
- For a global shim of pnpm 12, it reads the target in `.pnpm-shim-v1-<name>-target`, or in the line `# cmd-shim-target=` of a shell shim.
|
|
11
|
+
- When it finds no `package.json` of a pnpm package, the snapshot records the version as `unknown`.
|
|
12
|
+
- `@procedures/snapshot` does not depend on `@procedures/shell`.
|
|
13
|
+
- Updated dependencies [beca782]
|
|
14
|
+
- Updated dependencies [6dbc47e]
|
|
15
|
+
- Updated dependencies [663465c]
|
|
16
|
+
- Updated dependencies [264e6a1]
|
|
17
|
+
- Updated dependencies [11fcffb]
|
|
18
|
+
- Updated dependencies [66585f5]
|
|
19
|
+
- Updated dependencies [511d820]
|
|
20
|
+
- Updated dependencies [02a7074]
|
|
21
|
+
- Updated dependencies [265f41c]
|
|
22
|
+
- Updated dependencies [e8e88ac]
|
|
23
|
+
- Updated dependencies [a87cdda]
|
|
24
|
+
- Updated dependencies [a6fd4f3]
|
|
25
|
+
- Updated dependencies [6e6805f]
|
|
26
|
+
- Updated dependencies [94b5f88]
|
|
27
|
+
- Updated dependencies [ca23351]
|
|
28
|
+
- Updated dependencies [84e1b25]
|
|
29
|
+
- Updated dependencies [fe6cd23]
|
|
30
|
+
- Updated dependencies [e9b7551]
|
|
31
|
+
- @procedures/client@0.60.1
|
|
32
|
+
- @procedures/fs@0.60.1
|
|
33
|
+
- @procedures/git@0.60.1
|
|
34
|
+
- @procedures/pnpm@0.60.1
|
|
35
|
+
- @procedures/s3@0.60.1
|
|
36
|
+
|
|
37
|
+
## 0.60.0
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [7250ac5]
|
|
42
|
+
- Updated dependencies [3075d86]
|
|
43
|
+
- @procedures/shell@0.60.0
|
|
44
|
+
- @procedures/client@0.60.0
|
|
45
|
+
- @procedures/git@0.60.0
|
|
46
|
+
- @procedures/pnpm@0.60.0
|
|
47
|
+
- @procedures/fs@0.60.0
|
|
48
|
+
- @procedures/s3@0.60.0
|
|
49
|
+
|
|
3
50
|
## 0.59.1
|
|
4
51
|
|
|
5
52
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -478,7 +478,7 @@ interface SnapshotMetadata {
|
|
|
478
478
|
environment: {
|
|
479
479
|
os: string; // win32, darwin, linux
|
|
480
480
|
nodeVersion: string;
|
|
481
|
-
pnpmVersion: string;
|
|
481
|
+
pnpmVersion: string; // From the package.json of pnpm, or "unknown"
|
|
482
482
|
username: string;
|
|
483
483
|
hostname: string;
|
|
484
484
|
};
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* this package. Under a root of the files, the rules of the root then apply to each git command:
|
|
6
6
|
* the working folder in the root, no hooks, no configuration that starts a program (tracker
|
|
7
7
|
* item O46).
|
|
8
|
-
* -
|
|
9
|
-
*
|
|
8
|
+
* - The version of pnpm comes from the `package.json` of the pnpm package. No program starts, so the
|
|
9
|
+
* declared effects of `snapshot.create` do not need `process`. Under a root, the version is
|
|
10
|
+
* "unknown".
|
|
10
11
|
*/
|
|
11
12
|
import type { ProcedureContext, ProcedurePath } from "@procedures/client";
|
|
12
13
|
/**
|
|
@@ -16,8 +17,9 @@ import type { ProcedureContext, ProcedurePath } from "@procedures/client";
|
|
|
16
17
|
*/
|
|
17
18
|
export declare function gitCall<T>(ctx: ProcedureContext, path: ProcedurePath, input: Record<string, unknown>): Promise<T | undefined>;
|
|
18
19
|
/**
|
|
19
|
-
* This function gives the version of pnpm, or "unknown" when pnpm
|
|
20
|
-
*
|
|
20
|
+
* This function gives the version of pnpm, or "unknown" when no pnpm package names it. It reads the
|
|
21
|
+
* version with `installedPnpmVersion()` of `@procedures/pnpm`, and it starts no program. Under a
|
|
22
|
+
* root of the files (`fsRoot`), it reads no file and gives "unknown".
|
|
21
23
|
*/
|
|
22
|
-
export declare function pnpmVersion(
|
|
24
|
+
export declare function pnpmVersion(fsRoot?: string): string;
|
|
23
25
|
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/procedures/snapshot/commands.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/procedures/snapshot/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAI1E;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAOnI;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAGnD"}
|
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
* this package. Under a root of the files, the rules of the root then apply to each git command:
|
|
6
6
|
* the working folder in the root, no hooks, no configuration that starts a program (tracker
|
|
7
7
|
* item O46).
|
|
8
|
-
* -
|
|
9
|
-
*
|
|
8
|
+
* - The version of pnpm comes from the `package.json` of the pnpm package. No program starts, so the
|
|
9
|
+
* declared effects of `snapshot.create` do not need `process`. Under a root, the version is
|
|
10
|
+
* "unknown".
|
|
10
11
|
*/
|
|
11
12
|
import { isOutsideRoot } from "@procedures/fs/root";
|
|
12
|
-
import {
|
|
13
|
-
import { resolvePnpm } from "@procedures/pnpm";
|
|
14
|
-
/** The longest time of one pnpm query, in milliseconds. */
|
|
15
|
-
const QUERY_TIMEOUT_MS = 30_000;
|
|
13
|
+
import { installedPnpmVersion } from "@procedures/pnpm";
|
|
16
14
|
/**
|
|
17
15
|
* This function starts a `git.*` procedure of the host and gives its output. It gives `undefined`
|
|
18
16
|
* when the procedure fails, for example in a folder that is not a repository. A refusal of the
|
|
@@ -29,20 +27,13 @@ export async function gitCall(ctx, path, input) {
|
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
29
|
/**
|
|
32
|
-
* This function gives the version of pnpm, or "unknown" when pnpm
|
|
33
|
-
*
|
|
30
|
+
* This function gives the version of pnpm, or "unknown" when no pnpm package names it. It reads the
|
|
31
|
+
* version with `installedPnpmVersion()` of `@procedures/pnpm`, and it starts no program. Under a
|
|
32
|
+
* root of the files (`fsRoot`), it reads no file and gives "unknown".
|
|
34
33
|
*/
|
|
35
|
-
export
|
|
34
|
+
export function pnpmVersion(fsRoot) {
|
|
36
35
|
if (fsRoot !== undefined)
|
|
37
36
|
return "unknown";
|
|
38
|
-
|
|
39
|
-
try {
|
|
40
|
-
pnpm = resolvePnpm();
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
return "unknown";
|
|
44
|
-
}
|
|
45
|
-
const result = await runCommand(pnpm.command, { args: [...pnpm.prefix, "--version"], signal, timeout: QUERY_TIMEOUT_MS });
|
|
46
|
-
return result.success ? result.stdout.trim() : "unknown";
|
|
37
|
+
return installedPnpmVersion() ?? "unknown";
|
|
47
38
|
}
|
|
48
39
|
//# sourceMappingURL=commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/procedures/snapshot/commands.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/procedures/snapshot/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAI,GAAqB,EAAE,IAAmB,EAAE,KAA8B;IACzG,IAAI,CAAC;QACH,OAAO,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAA6B,IAAI,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,aAAa,CAAC,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QACtC,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,MAAe;IACzC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,oBAAoB,EAAE,IAAI,SAAS,CAAC;AAC7C,CAAC"}
|
|
@@ -30,7 +30,7 @@ export async function snapshotCreate(input, ctx) {
|
|
|
30
30
|
// Gather repository info
|
|
31
31
|
const repositories = await Promise.all(repoPaths.map((path) => getRepositoryInfo(path, ctx)));
|
|
32
32
|
// Get environment info
|
|
33
|
-
const environment =
|
|
33
|
+
const environment = getEnvironmentInfo(ctx.fsRoot);
|
|
34
34
|
// Create metadata
|
|
35
35
|
const metadata = {
|
|
36
36
|
id,
|
|
@@ -173,11 +173,11 @@ async function getRepositoryInfo(repoPath, ctx) {
|
|
|
173
173
|
/**
|
|
174
174
|
* Get environment info
|
|
175
175
|
*/
|
|
176
|
-
|
|
176
|
+
function getEnvironmentInfo(fsRoot) {
|
|
177
177
|
return {
|
|
178
178
|
os: process.platform,
|
|
179
179
|
nodeVersion: process.version,
|
|
180
|
-
pnpmVersion:
|
|
180
|
+
pnpmVersion: pnpmVersion(fsRoot),
|
|
181
181
|
username: process.env["USER"] || process.env["USERNAME"] || "unknown",
|
|
182
182
|
hostname: hostname(),
|
|
183
183
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/procedures/snapshot/create.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AASrD,mEAAmE;AACnE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AS,CAAC;QACT,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@procedures/snapshot",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.60.1",
|
|
5
5
|
"description": "Snapshot and restore development environments with S3: git state, packages and files, with streamed archives and a safe restore.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"snapshot",
|
|
@@ -66,12 +66,11 @@
|
|
|
66
66
|
"provenance": true
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@procedures/client": "0.
|
|
70
|
-
"@procedures/fs": "0.
|
|
71
|
-
"@procedures/git": "0.
|
|
72
|
-
"@procedures/pnpm": "0.
|
|
73
|
-
"@procedures/s3": "0.
|
|
74
|
-
"@procedures/shell": "0.59.1",
|
|
69
|
+
"@procedures/client": "0.60.1",
|
|
70
|
+
"@procedures/fs": "0.60.1",
|
|
71
|
+
"@procedures/git": "0.60.1",
|
|
72
|
+
"@procedures/pnpm": "0.60.1",
|
|
73
|
+
"@procedures/s3": "0.60.1",
|
|
75
74
|
"tar": "^7.5.0",
|
|
76
75
|
"zod": "^4.6.5"
|
|
77
76
|
},
|
|
@@ -5,17 +5,14 @@
|
|
|
5
5
|
* this package. Under a root of the files, the rules of the root then apply to each git command:
|
|
6
6
|
* the working folder in the root, no hooks, no configuration that starts a program (tracker
|
|
7
7
|
* item O46).
|
|
8
|
-
* -
|
|
9
|
-
*
|
|
8
|
+
* - The version of pnpm comes from the `package.json` of the pnpm package. No program starts, so the
|
|
9
|
+
* declared effects of `snapshot.create` do not need `process`. Under a root, the version is
|
|
10
|
+
* "unknown".
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import type { ProcedureContext, ProcedurePath } from "@procedures/client";
|
|
13
14
|
import { isOutsideRoot } from "@procedures/fs/root";
|
|
14
|
-
import {
|
|
15
|
-
import { resolvePnpm } from "@procedures/pnpm";
|
|
16
|
-
|
|
17
|
-
/** The longest time of one pnpm query, in milliseconds. */
|
|
18
|
-
const QUERY_TIMEOUT_MS = 30_000;
|
|
15
|
+
import { installedPnpmVersion } from "@procedures/pnpm";
|
|
19
16
|
|
|
20
17
|
/**
|
|
21
18
|
* This function starts a `git.*` procedure of the host and gives its output. It gives `undefined`
|
|
@@ -32,17 +29,11 @@ export async function gitCall<T>(ctx: ProcedureContext, path: ProcedurePath, inp
|
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
/**
|
|
35
|
-
* This function gives the version of pnpm, or "unknown" when pnpm
|
|
36
|
-
*
|
|
32
|
+
* This function gives the version of pnpm, or "unknown" when no pnpm package names it. It reads the
|
|
33
|
+
* version with `installedPnpmVersion()` of `@procedures/pnpm`, and it starts no program. Under a
|
|
34
|
+
* root of the files (`fsRoot`), it reads no file and gives "unknown".
|
|
37
35
|
*/
|
|
38
|
-
export
|
|
36
|
+
export function pnpmVersion(fsRoot?: string): string {
|
|
39
37
|
if (fsRoot !== undefined) return "unknown";
|
|
40
|
-
|
|
41
|
-
try {
|
|
42
|
-
pnpm = resolvePnpm();
|
|
43
|
-
} catch {
|
|
44
|
-
return "unknown";
|
|
45
|
-
}
|
|
46
|
-
const result = await runCommand(pnpm.command, { args: [...pnpm.prefix, "--version"], signal, timeout: QUERY_TIMEOUT_MS });
|
|
47
|
-
return result.success ? result.stdout.trim() : "unknown";
|
|
38
|
+
return installedPnpmVersion() ?? "unknown";
|
|
48
39
|
}
|
|
@@ -50,7 +50,7 @@ export async function snapshotCreate(
|
|
|
50
50
|
);
|
|
51
51
|
|
|
52
52
|
// Get environment info
|
|
53
|
-
const environment =
|
|
53
|
+
const environment = getEnvironmentInfo(ctx.fsRoot);
|
|
54
54
|
|
|
55
55
|
// Create metadata
|
|
56
56
|
const metadata: SnapshotMetadata = {
|
|
@@ -213,11 +213,11 @@ async function getRepositoryInfo(
|
|
|
213
213
|
/**
|
|
214
214
|
* Get environment info
|
|
215
215
|
*/
|
|
216
|
-
|
|
216
|
+
function getEnvironmentInfo(fsRoot?: string): SnapshotMetadata["environment"] {
|
|
217
217
|
return {
|
|
218
218
|
os: process.platform,
|
|
219
219
|
nodeVersion: process.version,
|
|
220
|
-
pnpmVersion:
|
|
220
|
+
pnpmVersion: pnpmVersion(fsRoot),
|
|
221
221
|
username: process.env["USER"] || process.env["USERNAME"] || "unknown",
|
|
222
222
|
hostname: hostname(),
|
|
223
223
|
};
|