zen-fs-config 0.3.6 → 0.3.8

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
@@ -1196,10 +1196,14 @@ var ConfigRepo = class {
1196
1196
  for (const part of parts) {
1197
1197
  current += `/${part}`;
1198
1198
  const exists = await this.fullFS.exists(current);
1199
+ console.log(`[ensureDir] ${current} exists=${exists}`);
1199
1200
  if (!exists) {
1200
1201
  try {
1201
- await this.fullFS.mkdir(current, { recursive: true });
1202
- } catch {
1202
+ console.log(`[ensureDir] mkdir(${current})`);
1203
+ await this.fullFS.mkdir(current);
1204
+ console.log(`[ensureDir] mkdir(${current}) OK`);
1205
+ } catch (err) {
1206
+ console.error(`[ensureDir] mkdir(${current}) FAILED:`, err.message);
1203
1207
  }
1204
1208
  }
1205
1209
  }
@@ -1230,11 +1234,14 @@ var ConfigRepo = class {
1230
1234
  return results;
1231
1235
  }
1232
1236
  async writeMetaFile(path, data) {
1237
+ console.log(`[writeMetaFile] ${path}, ensuring dir...`);
1233
1238
  await this.ensureDir(path);
1239
+ console.log(`[writeMetaFile] ${path}, writing ${JSON.stringify(data).length} bytes...`);
1234
1240
  await this.cachedFS.writeFile(
1235
1241
  path,
1236
1242
  new TextEncoder().encode(JSON.stringify(data, null, 2))
1237
1243
  );
1244
+ console.log(`[writeMetaFile] ${path} done`);
1238
1245
  }
1239
1246
  async readMetaFile(path) {
1240
1247
  try {
@@ -1303,6 +1310,17 @@ async function createConfigRepo(appId, options) {
1303
1310
  ttlMs: options.cache?.ttlMs ?? 0
1304
1311
  }
1305
1312
  );
1313
+ try {
1314
+ const metaExists = await primaryInstance.exists(META_DIR);
1315
+ console.log(`[createConfigRepo] /.meta/ exists: ${metaExists}`);
1316
+ if (!metaExists) {
1317
+ console.log(`[createConfigRepo] Creating /.meta/ via primaryInstance...`);
1318
+ await primaryInstance.mkdir(META_DIR);
1319
+ console.log(`[createConfigRepo] /.meta/ created`);
1320
+ }
1321
+ } catch (err) {
1322
+ console.error(`[createConfigRepo] Failed to ensure /.meta/:`, err.message);
1323
+ }
1306
1324
  const tempRepo = new ConfigRepo(
1307
1325
  appId,
1308
1326
  "",
package/dist/index.mjs CHANGED
@@ -1149,10 +1149,14 @@ var ConfigRepo = class {
1149
1149
  for (const part of parts) {
1150
1150
  current += `/${part}`;
1151
1151
  const exists = await this.fullFS.exists(current);
1152
+ console.log(`[ensureDir] ${current} exists=${exists}`);
1152
1153
  if (!exists) {
1153
1154
  try {
1154
- await this.fullFS.mkdir(current, { recursive: true });
1155
- } catch {
1155
+ console.log(`[ensureDir] mkdir(${current})`);
1156
+ await this.fullFS.mkdir(current);
1157
+ console.log(`[ensureDir] mkdir(${current}) OK`);
1158
+ } catch (err) {
1159
+ console.error(`[ensureDir] mkdir(${current}) FAILED:`, err.message);
1156
1160
  }
1157
1161
  }
1158
1162
  }
@@ -1183,11 +1187,14 @@ var ConfigRepo = class {
1183
1187
  return results;
1184
1188
  }
1185
1189
  async writeMetaFile(path, data) {
1190
+ console.log(`[writeMetaFile] ${path}, ensuring dir...`);
1186
1191
  await this.ensureDir(path);
1192
+ console.log(`[writeMetaFile] ${path}, writing ${JSON.stringify(data).length} bytes...`);
1187
1193
  await this.cachedFS.writeFile(
1188
1194
  path,
1189
1195
  new TextEncoder().encode(JSON.stringify(data, null, 2))
1190
1196
  );
1197
+ console.log(`[writeMetaFile] ${path} done`);
1191
1198
  }
1192
1199
  async readMetaFile(path) {
1193
1200
  try {
@@ -1256,6 +1263,17 @@ async function createConfigRepo(appId, options) {
1256
1263
  ttlMs: options.cache?.ttlMs ?? 0
1257
1264
  }
1258
1265
  );
1266
+ try {
1267
+ const metaExists = await primaryInstance.exists(META_DIR);
1268
+ console.log(`[createConfigRepo] /.meta/ exists: ${metaExists}`);
1269
+ if (!metaExists) {
1270
+ console.log(`[createConfigRepo] Creating /.meta/ via primaryInstance...`);
1271
+ await primaryInstance.mkdir(META_DIR);
1272
+ console.log(`[createConfigRepo] /.meta/ created`);
1273
+ }
1274
+ } catch (err) {
1275
+ console.error(`[createConfigRepo] Failed to ensure /.meta/:`, err.message);
1276
+ }
1259
1277
  const tempRepo = new ConfigRepo(
1260
1278
  appId,
1261
1279
  "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-fs-config",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
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",