zen-fs-config 0.3.7 → 0.3.9

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
@@ -339,6 +339,9 @@ async function wrapZenFSFileSystem(config) {
339
339
  await isolatedFS.mkdir(dir, { uid: 0, gid: 0, mode: 493 });
340
340
  }
341
341
  }
342
+ if (!await isolatedFS.exists(path)) {
343
+ await isolatedFS.createFile(path, { uid: 0, gid: 0, mode: 420 });
344
+ }
342
345
  await isolatedFS.write(path, bytes, 0);
343
346
  },
344
347
  async readdir(path) {
@@ -1310,6 +1313,17 @@ async function createConfigRepo(appId, options) {
1310
1313
  ttlMs: options.cache?.ttlMs ?? 0
1311
1314
  }
1312
1315
  );
1316
+ try {
1317
+ const metaExists = await primaryInstance.exists(META_DIR);
1318
+ console.log(`[createConfigRepo] /.meta/ exists: ${metaExists}`);
1319
+ if (!metaExists) {
1320
+ console.log(`[createConfigRepo] Creating /.meta/ via primaryInstance...`);
1321
+ await primaryInstance.mkdir(META_DIR);
1322
+ console.log(`[createConfigRepo] /.meta/ created`);
1323
+ }
1324
+ } catch (err) {
1325
+ console.error(`[createConfigRepo] Failed to ensure /.meta/:`, err.message);
1326
+ }
1313
1327
  const tempRepo = new ConfigRepo(
1314
1328
  appId,
1315
1329
  "",
package/dist/index.mjs CHANGED
@@ -292,6 +292,9 @@ async function wrapZenFSFileSystem(config) {
292
292
  await isolatedFS.mkdir(dir, { uid: 0, gid: 0, mode: 493 });
293
293
  }
294
294
  }
295
+ if (!await isolatedFS.exists(path)) {
296
+ await isolatedFS.createFile(path, { uid: 0, gid: 0, mode: 420 });
297
+ }
295
298
  await isolatedFS.write(path, bytes, 0);
296
299
  },
297
300
  async readdir(path) {
@@ -1263,6 +1266,17 @@ async function createConfigRepo(appId, options) {
1263
1266
  ttlMs: options.cache?.ttlMs ?? 0
1264
1267
  }
1265
1268
  );
1269
+ try {
1270
+ const metaExists = await primaryInstance.exists(META_DIR);
1271
+ console.log(`[createConfigRepo] /.meta/ exists: ${metaExists}`);
1272
+ if (!metaExists) {
1273
+ console.log(`[createConfigRepo] Creating /.meta/ via primaryInstance...`);
1274
+ await primaryInstance.mkdir(META_DIR);
1275
+ console.log(`[createConfigRepo] /.meta/ created`);
1276
+ }
1277
+ } catch (err) {
1278
+ console.error(`[createConfigRepo] Failed to ensure /.meta/:`, err.message);
1279
+ }
1266
1280
  const tempRepo = new ConfigRepo(
1267
1281
  appId,
1268
1282
  "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-fs-config",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
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",