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/dist/index.mjs CHANGED
@@ -4463,14 +4463,14 @@ class UserConfig {
4463
4463
  */
4464
4464
 
4465
4465
 
4466
- const __filename$3 = fileURLToPath(import.meta.url);
4467
- const __dirname$3 = path.dirname(__filename$3);
4466
+ const __filename$4 = fileURLToPath(import.meta.url);
4467
+ const __dirname$4 = path.dirname(__filename$4);
4468
4468
 
4469
4469
  // Determine proto path based on whether we're running from dist or src
4470
- const inDist$3 = __dirname$3.includes('/dist') || __dirname$3.includes('\\dist');
4470
+ const inDist$3 = __dirname$4.includes('/dist') || __dirname$4.includes('\\dist');
4471
4471
  const protoDir$3 = inDist$3
4472
- ? path.join(__dirname$3, '..', 'src', 'protos')
4473
- : path.join(__dirname$3, '..', 'protos');
4472
+ ? path.join(__dirname$4, '..', 'src', 'protos')
4473
+ : path.join(__dirname$4, '..', 'protos');
4474
4474
 
4475
4475
  class JJCheckout {
4476
4476
  constructor(fs, dir) {
@@ -4545,14 +4545,14 @@ class JJCheckout {
4545
4545
  */
4546
4546
 
4547
4547
 
4548
- const __filename$2 = fileURLToPath(import.meta.url);
4549
- const __dirname$2 = path.dirname(__filename$2);
4548
+ const __filename$3 = fileURLToPath(import.meta.url);
4549
+ const __dirname$3 = path.dirname(__filename$3);
4550
4550
 
4551
4551
  // Determine proto path based on whether we're running from dist or src
4552
- const inDist$2 = __dirname$2.includes('/dist') || __dirname$2.includes('\\dist');
4552
+ const inDist$2 = __dirname$3.includes('/dist') || __dirname$3.includes('\\dist');
4553
4553
  const protoDir$2 = inDist$2
4554
- ? path.join(__dirname$2, '..', 'src', 'protos')
4555
- : path.join(__dirname$2, '..', 'protos');
4554
+ ? path.join(__dirname$3, '..', 'src', 'protos')
4555
+ : path.join(__dirname$3, '..', 'protos');
4556
4556
 
4557
4557
  class JJTreeState {
4558
4558
  constructor(fs, dir) {
@@ -4643,14 +4643,14 @@ class JJTreeState {
4643
4643
  */
4644
4644
 
4645
4645
 
4646
- const __filename$1 = fileURLToPath(import.meta.url);
4647
- const __dirname$1 = path.dirname(__filename$1);
4646
+ const __filename$2 = fileURLToPath(import.meta.url);
4647
+ const __dirname$2 = path.dirname(__filename$2);
4648
4648
 
4649
4649
  // Determine proto path based on whether we're running from dist or src
4650
- const inDist$1 = __dirname$1.includes('/dist') || __dirname$1.includes('\\dist');
4650
+ const inDist$1 = __dirname$2.includes('/dist') || __dirname$2.includes('\\dist');
4651
4651
  const protoDir$1 = inDist$1
4652
- ? path.join(__dirname$1, '..', 'src', 'protos')
4653
- : path.join(__dirname$1, '..', 'protos');
4652
+ ? path.join(__dirname$2, '..', 'src', 'protos')
4653
+ : path.join(__dirname$2, '..', 'protos');
4654
4654
 
4655
4655
  class JJOperationStore {
4656
4656
  constructor(fs, dir) {
@@ -4767,14 +4767,14 @@ class JJOperationStore {
4767
4767
  */
4768
4768
 
4769
4769
 
4770
- const __filename = fileURLToPath(import.meta.url);
4771
- const __dirname = path.dirname(__filename);
4770
+ const __filename$1 = fileURLToPath(import.meta.url);
4771
+ const __dirname$1 = path.dirname(__filename$1);
4772
4772
 
4773
4773
  // Determine proto path based on whether we're running from dist or src
4774
- const inDist = __dirname.includes('/dist') || __dirname.includes('\\dist');
4774
+ const inDist = __dirname$1.includes('/dist') || __dirname$1.includes('\\dist');
4775
4775
  const protoDir = inDist
4776
- ? path.join(__dirname, '..', 'src', 'protos')
4777
- : path.join(__dirname, '..', 'protos');
4776
+ ? path.join(__dirname$1, '..', 'src', 'protos')
4777
+ : path.join(__dirname$1, '..', 'protos');
4778
4778
 
4779
4779
  class JJViewStore {
4780
4780
  constructor(fs, dir) {
@@ -6619,6 +6619,11 @@ async function createJJ(options) {
6619
6619
  change.timestamp = new Date().toISOString();
6620
6620
  }
6621
6621
 
6622
+ // Update metadata
6623
+ if (args.metadata !== undefined) {
6624
+ change.metadata = args.metadata;
6625
+ }
6626
+
6622
6627
  // Only snapshot files if describing working copy
6623
6628
  if (isWorkingCopy) {
6624
6629
  // Snapshot current file contents for conflict detection
@@ -7223,10 +7228,11 @@ async function createJJ(options) {
7223
7228
  * @param {Object} [args={}] - Arguments
7224
7229
  * @param {string} [args.message] - Description for current change
7225
7230
  * @param {Object} [args.author] - Author for current change
7231
+ * @param {Object} [args.metadata] - Metadata to attach to the change
7226
7232
  * @returns {Promise<Object>} The newly created change
7227
7233
  */
7228
7234
  async commit(args = {}) {
7229
- await this.describe({ message: args.message, author: args.author });
7235
+ await this.describe({ message: args.message, author: args.author, metadata: args.metadata });
7230
7236
  return await this.new({ message: args.nextMessage });
7231
7237
  },
7232
7238