thinkncollab-cli 0.0.34 → 0.0.36

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/bin/index.js CHANGED
@@ -385,6 +385,26 @@ async function push(roomId, targetPath) {
385
385
  flattenAndStore(uploadedTree);
386
386
  saveVersions(newVersionMap);
387
387
 
388
+ // Determine latest version number from uploaded files
389
+ const versionNumbers = Object.values(newVersionMap).map(f => f.version || 1);
390
+ const latestVersion = versionNumbers.length > 0 ? Math.max(...versionNumbers) : 1;
391
+
392
+ const newPushRecord = {
393
+ version: latestVersion,
394
+ pushedAt: new Date().toISOString(),
395
+ roomId: roomId,
396
+ pushedBy: email,
397
+ projectId: projectId
398
+ };
399
+
400
+
401
+
402
+ const pushFilePath = path.join(CWD, ".tnc", ".tncpush.json");
403
+ fs.writeFileSync(
404
+ pushFilePath,
405
+ JSON.stringify(newPushRecord, null, 2)
406
+ );
407
+
388
408
  console.log(`💾 Saved ${Object.keys(newVersionMap).length} files to .tncversions`);
389
409
 
390
410
  } catch (err) {
package/commands/init.js CHANGED
@@ -36,6 +36,7 @@ async function projectInit() {
36
36
 
37
37
  // Write metadata file
38
38
  const metaFilePath = path.join(tncFolderPath, ".tncmeta.json");
39
+ const pushFilePath = path.join(tncFolderPath, ".tncpush.json");
39
40
  fs.writeFileSync(
40
41
  metaFilePath,
41
42
  JSON.stringify(
@@ -50,6 +51,10 @@ async function projectInit() {
50
51
  2
51
52
  )
52
53
  );
54
+ fs.writeFileSync(
55
+ pushFilePath,
56
+ " {} "
57
+ )
53
58
 
54
59
  console.log("✅ Project initialized successfully!");
55
60
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "thinkncollab-cli",
3
3
  "author": "Raman Singh",
4
- "version": "0.0.34",
4
+ "version": "0.0.36",
5
5
  "description": "CLI tool for ThinkNCollab",
6
6
  "main": "index.js",
7
7
  "bin": {