@decohere/devkit 0.0.1-dev.131 → 0.0.1-dev.20261105.54

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.
@@ -47,6 +47,17 @@ class Git extends _shell.Shell {
47
47
  }, ...args);
48
48
  return result.data[0];
49
49
  }
50
+ /** When HEAD was committed, as seconds since the Unix epoch. */ async getHeadCommitTime(options = defaultOptions) {
51
+ const { cwd } = options;
52
+ const result = await this.run({
53
+ cwd
54
+ }, "show", "-s", "--format=%ct", "HEAD");
55
+ const seconds = Number(result.data[0]);
56
+ if (!Number.isInteger(seconds)) {
57
+ throw new _interoperror.InteropError(`git reported no commit time for HEAD: ${result.data.join(" ")}`);
58
+ }
59
+ return seconds;
60
+ }
50
61
  async tag(tag, options = defaultOptions) {
51
62
  const args = [
52
63
  Commands.tag,
@@ -37,6 +37,17 @@ export class Git extends Shell {
37
37
  }, ...args);
38
38
  return result.data[0];
39
39
  }
40
+ /** When HEAD was committed, as seconds since the Unix epoch. */ async getHeadCommitTime(options = defaultOptions) {
41
+ const { cwd } = options;
42
+ const result = await this.run({
43
+ cwd
44
+ }, "show", "-s", "--format=%ct", "HEAD");
45
+ const seconds = Number(result.data[0]);
46
+ if (!Number.isInteger(seconds)) {
47
+ throw new InteropError(`git reported no commit time for HEAD: ${result.data.join(" ")}`);
48
+ }
49
+ return seconds;
50
+ }
40
51
  async tag(tag, options = defaultOptions) {
41
52
  const args = [
42
53
  Commands.tag,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decohere/devkit",
3
- "version": "0.0.1-dev.131",
3
+ "version": "0.0.1-dev.20261105.54",
4
4
  "description": "The shared base for Decohere's command-line tools: the command framework, git/npm/pnpm/docker wrappers, tracing, and file search and watch. Never needed in a production app.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -48,8 +48,8 @@
48
48
  "test": "echo \"Error: no test specified\" && exit 1"
49
49
  },
50
50
  "dependencies": {
51
- "@decohere/core": "0.0.1-dev.131",
52
- "@decohere/scribe": "0.0.1-dev.131",
51
+ "@decohere/core": "0.0.1-dev.20261105.54",
52
+ "@decohere/scribe": "0.0.1-dev.20261105.54",
53
53
  "commander": "^13.1.0",
54
54
  "glob": "^13.0.1",
55
55
  "picomatch": "^4.0.4"
@@ -5,6 +5,8 @@ export declare class Git extends Shell {
5
5
  protected program: string;
6
6
  getModifiedFiles(options?: GitOptions): Promise<string[]>;
7
7
  getBranchName(options?: GitOptions): Promise<string>;
8
+ /** When HEAD was committed, as seconds since the Unix epoch. */
9
+ getHeadCommitTime(options?: GitOptions): Promise<number>;
8
10
  tag(tag: string, options?: GitOptions): Promise<ShellResponse>;
9
11
  pushTag(tag: string, options?: GitOptions & {
10
12
  remote?: string;