@strifeapp/astro 1.0.30-beta.0 → 1.3.0
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/LICENSE +15 -0
- package/README.md +144 -51
- package/dist/LivePreview.astro +17 -0
- package/dist/edit-mode-middleware.d.ts +9 -0
- package/dist/edit-mode-middleware.d.ts.map +1 -0
- package/dist/edit-mode-middleware.js +5 -0
- package/dist/edit-mode-token.d.ts +34 -0
- package/dist/edit-mode-token.d.ts.map +1 -0
- package/dist/edit-mode.d.ts +16 -0
- package/dist/edit-mode.d.ts.map +1 -0
- package/dist/edit-mode.js +36 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -10
- package/dist/vite-plugin-strife-store-B-B_HXbA.js +105 -0
- package/dist/vite-plugin-strife-store-entry.js +1 -1
- package/dist/vite-plugin-strife-store.d.ts.map +1 -1
- package/package.json +52 -19
- package/dist/localized-content-index.js +0 -587
- package/dist/vite-plugin-strife-store-DkxIFvv2.js +0 -89
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { readFileSync as a } from "fs";
|
|
2
|
-
import { dirname as l, resolve as f } from "path";
|
|
3
|
-
import { fileURLToPath as u } from "url";
|
|
4
|
-
import t from "serialize-javascript";
|
|
5
|
-
const n = "strife:store", o = "\0" + n;
|
|
6
|
-
function g(i) {
|
|
7
|
-
const s = u(import.meta.url), c = l(s), r = a(
|
|
8
|
-
f(c, "./localized-content-index.js"),
|
|
9
|
-
"utf-8"
|
|
10
|
-
);
|
|
11
|
-
return {
|
|
12
|
-
name: "strife:store",
|
|
13
|
-
resolveId(e) {
|
|
14
|
-
if (e === n)
|
|
15
|
-
return o;
|
|
16
|
-
},
|
|
17
|
-
load(e) {
|
|
18
|
-
if (e === o)
|
|
19
|
-
return `
|
|
20
|
-
import { DocumentStore, AbstractJavaScriptMultiMapIndexCreationTask } from "ravendb";
|
|
21
|
-
|
|
22
|
-
const indexMappingSource = ${t(r)};
|
|
23
|
-
const defaultConfig = ${t(i)};
|
|
24
|
-
|
|
25
|
-
const urls = process.env.STRIFE_DATABASE_URLS
|
|
26
|
-
? process.env.STRIFE_DATABASE_URLS.split(',')
|
|
27
|
-
: (defaultConfig.urls || []);
|
|
28
|
-
|
|
29
|
-
const database = process.env.STRIFE_DATABASE || defaultConfig.database || '';
|
|
30
|
-
|
|
31
|
-
const certificate = process.env.STRIFE_CERTIFICATE || defaultConfig.certificate;
|
|
32
|
-
const password = process.env.STRIFE_CERTIFICATE_PASSWORD || defaultConfig.password;
|
|
33
|
-
|
|
34
|
-
const hasAuth = certificate && password;
|
|
35
|
-
|
|
36
|
-
const authOptions = hasAuth ? {
|
|
37
|
-
type: defaultConfig.type || 'pfx',
|
|
38
|
-
certificate: Buffer.from(certificate, 'base64'),
|
|
39
|
-
password,
|
|
40
|
-
} : null;
|
|
41
|
-
|
|
42
|
-
const store = new DocumentStore(
|
|
43
|
-
urls,
|
|
44
|
-
database,
|
|
45
|
-
authOptions || undefined,
|
|
46
|
-
).initialize();
|
|
47
|
-
|
|
48
|
-
class Content_ByUrl extends AbstractJavaScriptMultiMapIndexCreationTask {
|
|
49
|
-
constructor() {
|
|
50
|
-
super();
|
|
51
|
-
|
|
52
|
-
this.additionalSources = {"Helper": indexMappingSource};
|
|
53
|
-
|
|
54
|
-
const collections = (defaultConfig.collections && defaultConfig.collections.length)
|
|
55
|
-
? defaultConfig.collections
|
|
56
|
-
: ['Posts'];
|
|
57
|
-
|
|
58
|
-
for (const collection of collections) {
|
|
59
|
-
const name = typeof collection === 'string' ? collection : collection.name;
|
|
60
|
-
this.map(name, function (doc) { return mapDocument(doc); });
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
this.deploymentMode = 'Rolling';
|
|
64
|
-
this.searchEngineType = 'Lucene';
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
console.log('Deploying index...');
|
|
69
|
-
|
|
70
|
-
await store.executeIndex(new Content_ByUrl());
|
|
71
|
-
|
|
72
|
-
const bulkInsert = store.bulkInsert();
|
|
73
|
-
|
|
74
|
-
if (defaultConfig.collections && defaultConfig.collections.length) {
|
|
75
|
-
for (const collection of defaultConfig.collections) {
|
|
76
|
-
await bulkInsert.store(collection, 'templates/' + collection.name, { '@collection': 'Templates' });
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
await bulkInsert.finish();
|
|
81
|
-
|
|
82
|
-
export { store };
|
|
83
|
-
`;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
export {
|
|
88
|
-
g as v
|
|
89
|
-
};
|