isomorphic-jj 1.3.0 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isomorphic-jj",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "description": "A pure-JavaScript library that brings Jujutsu (jj) version control semantics to Node.js and browsers",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1084,6 +1084,11 @@ export async function createJJ(options) {
1084
1084
  change.timestamp = new Date().toISOString();
1085
1085
  }
1086
1086
 
1087
+ // Update metadata
1088
+ if (args.metadata !== undefined) {
1089
+ change.metadata = args.metadata;
1090
+ }
1091
+
1087
1092
  // Only snapshot files if describing working copy
1088
1093
  if (isWorkingCopy) {
1089
1094
  // Snapshot current file contents for conflict detection
@@ -1688,10 +1693,11 @@ export async function createJJ(options) {
1688
1693
  * @param {Object} [args={}] - Arguments
1689
1694
  * @param {string} [args.message] - Description for current change
1690
1695
  * @param {Object} [args.author] - Author for current change
1696
+ * @param {Object} [args.metadata] - Metadata to attach to the change
1691
1697
  * @returns {Promise<Object>} The newly created change
1692
1698
  */
1693
1699
  async commit(args = {}) {
1694
- await this.describe({ message: args.message, author: args.author });
1700
+ await this.describe({ message: args.message, author: args.author, metadata: args.metadata });
1695
1701
  return await this.new({ message: args.nextMessage });
1696
1702
  },
1697
1703
 
package/src/types.d.ts CHANGED
@@ -76,6 +76,7 @@ export interface Change {
76
76
  description: string;
77
77
  timestamp: Date;
78
78
  fileSnapshot?: Record<string, FileSnapshot>;
79
+ metadata?: Record<string, any>;
79
80
  }
80
81
 
81
82
  /**
@@ -385,6 +386,7 @@ export interface WriteStreamArgs {
385
386
  export interface DescribeArgs {
386
387
  message?: string;
387
388
  author?: User;
389
+ metadata?: Record<string, any>;
388
390
  }
389
391
 
390
392
  /**
@@ -411,6 +413,7 @@ export interface AmendArgs {
411
413
  export interface CommitArgs {
412
414
  message?: string;
413
415
  author?: User;
416
+ metadata?: Record<string, any>;
414
417
  nextMessage?: string;
415
418
  }
416
419