@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.
- package/dist/index.js +38 -35
- 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
|
-
}`,
|
|
265
|
-
function
|
|
266
|
-
|
|
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(
|
|
274
|
-
if (
|
|
268
|
+
resolveId(i) {
|
|
269
|
+
if (i === m)
|
|
275
270
|
return p;
|
|
276
271
|
},
|
|
277
|
-
load(
|
|
278
|
-
var r;
|
|
279
|
-
if (
|
|
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((
|
|
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((
|
|
321
|
-
await bulkInsert.store(${JSON.stringify(
|
|
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
|
|
335
|
+
const T = {
|
|
333
336
|
type: "pfx"
|
|
334
337
|
};
|
|
335
|
-
function
|
|
336
|
-
let
|
|
337
|
-
if (!
|
|
338
|
-
const
|
|
339
|
-
|
|
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: ${
|
|
342
|
-
urls:
|
|
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:
|
|
347
|
+
certificate: t || void 0,
|
|
345
348
|
password: a || void 0
|
|
346
349
|
};
|
|
347
350
|
}
|
|
348
|
-
function
|
|
351
|
+
function v(e) {
|
|
349
352
|
return {
|
|
350
353
|
name: "@strife/astro",
|
|
351
354
|
hooks: {
|
|
352
|
-
"astro:config:setup": ({ command: i, config:
|
|
353
|
-
const
|
|
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
|
|
356
|
-
...
|
|
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(
|
|
367
|
+
console.log("[strifeIntegration] Final mergedOptions:", JSON.stringify(n, null, 2));
|
|
365
368
|
const c = ["urls", "database", "certificate", "password"], u = c.filter(
|
|
366
|
-
(s) => !
|
|
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(
|
|
376
|
+
` + c.map((s) => ` ${s}: ${JSON.stringify(n[s])}`).join(`
|
|
374
377
|
`)
|
|
375
378
|
);
|
|
376
379
|
r({
|
|
377
380
|
vite: {
|
|
378
381
|
plugins: [
|
|
379
|
-
|
|
382
|
+
h(n)
|
|
380
383
|
]
|
|
381
384
|
}
|
|
382
385
|
});
|
|
@@ -385,5 +388,5 @@ Current values:
|
|
|
385
388
|
};
|
|
386
389
|
}
|
|
387
390
|
export {
|
|
388
|
-
|
|
391
|
+
v as default
|
|
389
392
|
};
|