zen-fs-config 0.3.28 → 0.3.30

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.js CHANGED
@@ -990,16 +990,9 @@ var ConfigRepo = class {
990
990
  let current = "";
991
991
  for (const part of parts) {
992
992
  current += `/${part}`;
993
- const exists = await this.fullFS.exists(current);
994
- console.log(`[ensureDir] ${current} exists=${exists}`);
995
- if (!exists) {
996
- try {
997
- console.log(`[ensureDir] mkdir(${current})`);
998
- await this.fullFS.mkdir(current);
999
- console.log(`[ensureDir] mkdir(${current}) OK`);
1000
- } catch (err) {
1001
- console.error(`[ensureDir] mkdir(${current}) FAILED:`, err.message);
1002
- }
993
+ try {
994
+ await this.fullFS.mkdir(current);
995
+ } catch {
1003
996
  }
1004
997
  }
1005
998
  }
@@ -1029,16 +1022,13 @@ var ConfigRepo = class {
1029
1022
  return results;
1030
1023
  }
1031
1024
  async writeMetaFile(path, data) {
1032
- console.log(`[writeMetaFile] ${path}, ensuring dir...`);
1033
1025
  await this.ensureDir(path);
1034
1026
  const bytes = new TextEncoder().encode(JSON.stringify(data, null, 2));
1035
- console.log(`[writeMetaFile] ${path}, writing ${bytes.length} bytes...`);
1036
1027
  await this.cachedFS.writeFile(path, bytes);
1037
1028
  const author = `${this.appId}/${this.nodeId}`;
1038
1029
  const version = await incrementVersion(this.fullFS, path, bytes, author);
1039
1030
  await this.ensureDir(versionPathFor(path));
1040
1031
  await writeVersion(this.fullFS, versionPathFor(path), version);
1041
- console.log(`[writeMetaFile] ${path} done (version=${version.version})`);
1042
1032
  }
1043
1033
  async readMetaFile(path) {
1044
1034
  try {
@@ -1086,13 +1076,8 @@ async function createConfigRepo(appId, options) {
1086
1076
  });
1087
1077
  const cachedFS = primaryInstance;
1088
1078
  try {
1089
- const metaExists = await primaryInstance.exists(META_DIR);
1090
- console.log(`[createConfigRepo] /.meta/ exists: ${metaExists}`);
1091
- if (!metaExists) {
1092
- console.log(`[createConfigRepo] Creating /.meta/ via primaryInstance...`);
1093
- await primaryInstance.mkdir(META_DIR);
1094
- console.log(`[createConfigRepo] /.meta/ created`);
1095
- }
1079
+ await primaryInstance.mkdir(META_DIR);
1080
+ console.log(`[createConfigRepo] /.meta/ ready`);
1096
1081
  } catch (err) {
1097
1082
  console.error(`[createConfigRepo] Failed to ensure /.meta/:`, err.message);
1098
1083
  }
package/dist/index.mjs CHANGED
@@ -941,16 +941,9 @@ var ConfigRepo = class {
941
941
  let current = "";
942
942
  for (const part of parts) {
943
943
  current += `/${part}`;
944
- const exists = await this.fullFS.exists(current);
945
- console.log(`[ensureDir] ${current} exists=${exists}`);
946
- if (!exists) {
947
- try {
948
- console.log(`[ensureDir] mkdir(${current})`);
949
- await this.fullFS.mkdir(current);
950
- console.log(`[ensureDir] mkdir(${current}) OK`);
951
- } catch (err) {
952
- console.error(`[ensureDir] mkdir(${current}) FAILED:`, err.message);
953
- }
944
+ try {
945
+ await this.fullFS.mkdir(current);
946
+ } catch {
954
947
  }
955
948
  }
956
949
  }
@@ -980,16 +973,13 @@ var ConfigRepo = class {
980
973
  return results;
981
974
  }
982
975
  async writeMetaFile(path, data) {
983
- console.log(`[writeMetaFile] ${path}, ensuring dir...`);
984
976
  await this.ensureDir(path);
985
977
  const bytes = new TextEncoder().encode(JSON.stringify(data, null, 2));
986
- console.log(`[writeMetaFile] ${path}, writing ${bytes.length} bytes...`);
987
978
  await this.cachedFS.writeFile(path, bytes);
988
979
  const author = `${this.appId}/${this.nodeId}`;
989
980
  const version = await incrementVersion(this.fullFS, path, bytes, author);
990
981
  await this.ensureDir(versionPathFor(path));
991
982
  await writeVersion(this.fullFS, versionPathFor(path), version);
992
- console.log(`[writeMetaFile] ${path} done (version=${version.version})`);
993
983
  }
994
984
  async readMetaFile(path) {
995
985
  try {
@@ -1037,13 +1027,8 @@ async function createConfigRepo(appId, options) {
1037
1027
  });
1038
1028
  const cachedFS = primaryInstance;
1039
1029
  try {
1040
- const metaExists = await primaryInstance.exists(META_DIR);
1041
- console.log(`[createConfigRepo] /.meta/ exists: ${metaExists}`);
1042
- if (!metaExists) {
1043
- console.log(`[createConfigRepo] Creating /.meta/ via primaryInstance...`);
1044
- await primaryInstance.mkdir(META_DIR);
1045
- console.log(`[createConfigRepo] /.meta/ created`);
1046
- }
1030
+ await primaryInstance.mkdir(META_DIR);
1031
+ console.log(`[createConfigRepo] /.meta/ ready`);
1047
1032
  } catch (err) {
1048
1033
  console.error(`[createConfigRepo] Failed to ensure /.meta/:`, err.message);
1049
1034
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-fs-config",
3
- "version": "0.3.28",
3
+ "version": "0.3.30",
4
4
  "description": "Distributed config management library built on ZenFS, zen-fs-cache, and zen-fs-sync",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",