@strifeapp/astro 1.0.17 → 1.0.18

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.
Files changed (2) hide show
  1. package/dist/index.js +38 -35
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -261,24 +261,27 @@ function storeAs(name, value) {
261
261
  });
262
262
 
263
263
  return result;
264
- }`, h = {}, m = "strife:store", p = "\0" + m;
265
- function T(e) {
266
- var i;
267
- return console.log("[vitePluginStrifeStore] Config received:", JSON.stringify(e, null, 2)), h.get(((i = e.urls) == null ? void 0 : i[0]) || "", (t) => {
268
- console.log("Test SSR fetch to RavenDB:", t.statusCode);
269
- }).on("error", (t) => {
270
- console.error("SSR network error to RavenDB:", t);
271
- }), {
264
+ }`, m = "strife:store", p = "\0" + m;
265
+ function h(e) {
266
+ return console.log("[vitePluginStrifeStore] Config received:", JSON.stringify(e, null, 2)), {
272
267
  name: "strife:store",
273
- resolveId(t) {
274
- if (t === m)
268
+ resolveId(i) {
269
+ if (i === m)
275
270
  return p;
276
271
  },
277
- load(t) {
278
- var r;
279
- if (t === p)
272
+ load(i) {
273
+ var o, r;
274
+ if (i === p)
280
275
  return `
281
276
  import { DocumentStore, AbstractJavaScriptMultiMapIndexCreationTask, IndexCreation } from "ravendb";
277
+ import https from 'https';
278
+
279
+ https.get(${l(((o = e.urls) == null ? void 0 : o[0]) || "")}, (res) => {
280
+ console.log('Test SSR fetch to RavenDB:', res.statusCode);
281
+ }).on('error', (e) => {
282
+ console.error('SSR network error to RavenDB:', e);
283
+ });
284
+
282
285
 
283
286
  const authOptions = {
284
287
  type: 'pfx',
@@ -302,7 +305,7 @@ function T(e) {
302
305
 
303
306
  this.additionalSources = {"Helper": ${l(y)}}
304
307
 
305
- ${(e.collections || ["Posts"]).map((n) => `this.map("${typeof n == "string" ? n : n.name}", (doc) => { return mapDocument(doc) });`).join(`
308
+ ${(e.collections || ["Posts"]).map((t) => `this.map("${typeof t == "string" ? t : t.name}", (doc) => { return mapDocument(doc) });`).join(`
306
309
  `)}
307
310
 
308
311
  this.deploymentMode = 'Rolling';
@@ -317,8 +320,8 @@ function T(e) {
317
320
 
318
321
  const bulkInsert = store.bulkInsert();
319
322
 
320
- ${(r = e.collections) == null ? void 0 : r.map((n) => `
321
- await bulkInsert.store(${JSON.stringify(n)}, 'templates/${n.name}', { '@collection': 'Templates' });
323
+ ${(r = e.collections) == null ? void 0 : r.map((t) => `
324
+ await bulkInsert.store(${JSON.stringify(t)}, 'templates/${t.name}', { '@collection': 'Templates' });
322
325
  `).join(`
323
326
  `)}
324
327
 
@@ -329,31 +332,31 @@ function T(e) {
329
332
  }
330
333
  };
331
334
  }
332
- const g = {
335
+ const T = {
333
336
  type: "pfx"
334
337
  };
335
- function R(e, i) {
336
- let t = process.env.STRIFE_DATABASE_URLS, r = process.env.STRIFE_DATABASE, n = process.env.STRIFE_CERTIFICATE, a = process.env.STRIFE_CERTIFICATE_PASSWORD;
337
- if (!t || !r || !n || !a) {
338
- const o = f(e, i ?? "", "");
339
- t = t || o.STRIFE_DATABASE_URLS, r = r || o.STRIFE_DATABASE, n = n || o.STRIFE_CERTIFICATE, a = a || o.STRIFE_CERTIFICATE_PASSWORD;
338
+ function g(e, i) {
339
+ let o = process.env.STRIFE_DATABASE_URLS, r = process.env.STRIFE_DATABASE, t = process.env.STRIFE_CERTIFICATE, a = process.env.STRIFE_CERTIFICATE_PASSWORD;
340
+ if (!o || !r || !t || !a) {
341
+ const n = f(e, i ?? "", "");
342
+ o = o || n.STRIFE_DATABASE_URLS, r = r || n.STRIFE_DATABASE, t = t || n.STRIFE_CERTIFICATE, a = a || n.STRIFE_CERTIFICATE_PASSWORD;
340
343
  }
341
- return console.log("[strifeIntegration] Loaded environment variables:"), console.log(` STRIFE_DATABASE_URLS: ${t ? "[SET]" : "[NOT SET]"}`), console.log(` STRIFE_DATABASE: ${r || "[NOT SET]"}`), console.log(` STRIFE_CERTIFICATE: ${n ? `[SET, length=${n.length}]` : "[NOT SET]"}`), console.log(` STRIFE_CERTIFICATE_PASSWORD: ${a ? "[SET]" : "[NOT SET]"}`), {
342
- urls: t ? t.split(",").map((o) => o.trim()).filter(Boolean) : void 0,
344
+ return console.log("[strifeIntegration] Loaded environment variables:"), console.log(` STRIFE_DATABASE_URLS: ${o ? "[SET]" : "[NOT SET]"}`), console.log(` STRIFE_DATABASE: ${r || "[NOT SET]"}`), console.log(` STRIFE_CERTIFICATE: ${t ? `[SET, length=${t.length}]` : "[NOT SET]"}`), console.log(` STRIFE_CERTIFICATE_PASSWORD: ${a ? "[SET]" : "[NOT SET]"}`), {
345
+ urls: o ? o.split(",").map((n) => n.trim()).filter(Boolean) : void 0,
343
346
  database: r || void 0,
344
- certificate: n || void 0,
347
+ certificate: t || void 0,
345
348
  password: a || void 0
346
349
  };
347
350
  }
348
- function A(e) {
351
+ function v(e) {
349
352
  return {
350
353
  name: "@strife/astro",
351
354
  hooks: {
352
- "astro:config:setup": ({ command: i, config: t, updateConfig: r }) => {
353
- const n = t.vite.envDir || process.cwd(), a = R(i, n);
355
+ "astro:config:setup": ({ command: i, config: o, updateConfig: r }) => {
356
+ const t = o.vite.envDir || process.cwd(), a = g(i, t);
354
357
  console.log("[strifeIntegration] envOptions:", JSON.stringify(a, null, 2)), e ? console.log("[strifeIntegration] options passed by user:", JSON.stringify(e, null, 2)) : console.log("[strifeIntegration] No options explicitly passed.");
355
- const o = {
356
- ...g,
358
+ const n = {
359
+ ...T,
357
360
  ...Object.fromEntries(
358
361
  Object.entries(a).filter(([s, d]) => !!d)
359
362
  ),
@@ -361,22 +364,22 @@ function A(e) {
361
364
  Object.entries(e).filter(([s, d]) => !!d)
362
365
  ) : {}
363
366
  };
364
- console.log("[strifeIntegration] Final mergedOptions:", JSON.stringify(o, null, 2));
367
+ console.log("[strifeIntegration] Final mergedOptions:", JSON.stringify(n, null, 2));
365
368
  const c = ["urls", "database", "certificate", "password"], u = c.filter(
366
- (s) => !o[s] || Array.isArray(o[s]) && o[s].length === 0
369
+ (s) => !n[s] || Array.isArray(n[s]) && n[s].length === 0
367
370
  );
368
371
  if (u.length > 0)
369
372
  throw new Error(
370
373
  `[strifeIntegration] Missing required environment variables: ${u.join(", ")}.
371
374
  Set them in your .env file (for local) or Vercel project settings (for deployment).
372
375
  Current values:
373
- ` + c.map((s) => ` ${s}: ${JSON.stringify(o[s])}`).join(`
376
+ ` + c.map((s) => ` ${s}: ${JSON.stringify(n[s])}`).join(`
374
377
  `)
375
378
  );
376
379
  r({
377
380
  vite: {
378
381
  plugins: [
379
- T(o)
382
+ h(n)
380
383
  ]
381
384
  }
382
385
  });
@@ -385,5 +388,5 @@ Current values:
385
388
  };
386
389
  }
387
390
  export {
388
- A as default
391
+ v as default
389
392
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strifeapp/astro",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "Official Strife Astro integration",
5
5
  "keywords": [
6
6
  "astro-integration",