@rimelight/config 0.0.11 → 0.0.13
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/astro/index.js +10 -0
- package/astro/index.ts +30 -3
- package/astro.d.ts +50 -0
- package/package.json +8 -8
package/astro/index.js
CHANGED
|
@@ -218,6 +218,16 @@ function rimelightIntegration(options, imageDomains, domain) {
|
|
|
218
218
|
)
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
+
if (options.auth) {
|
|
222
|
+
const authMod = await import("@rimelight/auth/vite")
|
|
223
|
+
const { auth: authFn } = authMod
|
|
224
|
+
const authOpts =
|
|
225
|
+
typeof options.auth === "object"
|
|
226
|
+
? options.auth
|
|
227
|
+
: { adapter: options.auth === true ? "cf-access" : options.auth }
|
|
228
|
+
plugins.push(authFn(authOpts))
|
|
229
|
+
}
|
|
230
|
+
|
|
221
231
|
if (options.i18n) {
|
|
222
232
|
const i18nMod = await import("@rimelight/i18n")
|
|
223
233
|
const { i18n: i18nFn } = i18nMod
|
package/astro/index.ts
CHANGED
|
@@ -150,6 +150,16 @@ export interface RimelightAstroOptions {
|
|
|
150
150
|
auth?: string
|
|
151
151
|
[key: string]: any
|
|
152
152
|
}
|
|
153
|
+
auth?:
|
|
154
|
+
| boolean
|
|
155
|
+
| "cf-access"
|
|
156
|
+
| "auth0"
|
|
157
|
+
| "mock"
|
|
158
|
+
| {
|
|
159
|
+
adapter?: "cf-access" | "auth0" | "mock" | "custom" | (string & {})
|
|
160
|
+
customModule?: string
|
|
161
|
+
[key: string]: any
|
|
162
|
+
}
|
|
153
163
|
ui?:
|
|
154
164
|
| boolean
|
|
155
165
|
| {
|
|
@@ -241,7 +251,8 @@ function defaultShortcuts(): Record<string, any> {
|
|
|
241
251
|
function rimelightIntegration(
|
|
242
252
|
options: RimelightAstroOptions,
|
|
243
253
|
imageDomains: string[],
|
|
244
|
-
domain?: string
|
|
254
|
+
domain?: string,
|
|
255
|
+
site?: string
|
|
245
256
|
) {
|
|
246
257
|
return {
|
|
247
258
|
name: "rimelight-auto-plugins",
|
|
@@ -268,7 +279,13 @@ function rimelightIntegration(
|
|
|
268
279
|
(seoMod as any).default ||
|
|
269
280
|
seoMod
|
|
270
281
|
const seoOpts = typeof options.seo === "object" ? options.seo : {}
|
|
271
|
-
integrations.push(
|
|
282
|
+
integrations.push(
|
|
283
|
+
seoFn({
|
|
284
|
+
id: domain,
|
|
285
|
+
url: site || (domain ? `https://${domain}` : undefined),
|
|
286
|
+
...seoOpts
|
|
287
|
+
})
|
|
288
|
+
)
|
|
272
289
|
}
|
|
273
290
|
|
|
274
291
|
if (options.cms) {
|
|
@@ -310,6 +327,16 @@ function rimelightIntegration(
|
|
|
310
327
|
)
|
|
311
328
|
}
|
|
312
329
|
|
|
330
|
+
if (options.auth) {
|
|
331
|
+
const authMod = await import("@rimelight/auth/vite")
|
|
332
|
+
const { auth: authFn } = authMod as any
|
|
333
|
+
const authOpts =
|
|
334
|
+
typeof options.auth === "object"
|
|
335
|
+
? options.auth
|
|
336
|
+
: { adapter: options.auth === true ? "cf-access" : options.auth }
|
|
337
|
+
plugins.push(authFn(authOpts))
|
|
338
|
+
}
|
|
339
|
+
|
|
313
340
|
if (options.i18n) {
|
|
314
341
|
const i18nMod = await import("@rimelight/i18n")
|
|
315
342
|
const { i18n: i18nFn } = i18nMod as any
|
|
@@ -413,7 +440,7 @@ export function rimelightAstroConfig(options: RimelightAstroOptions = {}): any {
|
|
|
413
440
|
syntaxHighlight: "prism" as const
|
|
414
441
|
},
|
|
415
442
|
integrations: [
|
|
416
|
-
...(hasFlags ? [rimelightIntegration(options, imageDomains, domain)] : []),
|
|
443
|
+
...(hasFlags ? [rimelightIntegration(options, imageDomains, domain, site)] : []),
|
|
417
444
|
...integrations
|
|
418
445
|
],
|
|
419
446
|
vite,
|
package/astro.d.ts
CHANGED
|
@@ -3,3 +3,53 @@
|
|
|
3
3
|
declare module "*.astro" {
|
|
4
4
|
export default {} as import("astro/runtime/server").AstroComponentFactory
|
|
5
5
|
}
|
|
6
|
+
|
|
7
|
+
declare module "virtual:rimelight/seo" {
|
|
8
|
+
export const siteConfig: import("@rimelight/seo").SiteConfig
|
|
9
|
+
export const SEO_LOCALES:
|
|
10
|
+
| import("@rimelight/seo").LocaleConfig
|
|
11
|
+
| Record<string, string>
|
|
12
|
+
| undefined
|
|
13
|
+
export const PRIVATE_PATH_PREFIXES: string[]
|
|
14
|
+
export const seoConfig: {
|
|
15
|
+
SEO_LOCALES?: import("@rimelight/seo").LocaleConfig | Record<string, string>
|
|
16
|
+
PRIVATE_PATH_PREFIXES: string[]
|
|
17
|
+
}
|
|
18
|
+
export default siteConfig
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare module "virtual:rimelight/i18n" {
|
|
22
|
+
export const locales: string[]
|
|
23
|
+
export const languages: string[]
|
|
24
|
+
export const defaultLocale: string
|
|
25
|
+
export const prefixDefaultLocale: boolean
|
|
26
|
+
export const translations: Record<string, Record<string, any>> | undefined
|
|
27
|
+
export default {
|
|
28
|
+
locales: [] as string[],
|
|
29
|
+
defaultLocale: ""
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare module "virtual:rimelight-auth" {
|
|
34
|
+
export const auth: import("@rimelight/auth").AuthAdapter
|
|
35
|
+
export const authAdapter: import("@rimelight/auth").AuthAdapter
|
|
36
|
+
export default auth
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module "virtual:rimelight-auth-client" {
|
|
40
|
+
export const authClient: import("@rimelight/auth/client").AuthClient
|
|
41
|
+
export const createAuthClient: typeof import("@rimelight/auth/client").createAuthClient
|
|
42
|
+
export default authClient
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare module "#auth/auth" {
|
|
46
|
+
export const auth: import("@rimelight/auth").AuthAdapter
|
|
47
|
+
export const authAdapter: import("@rimelight/auth").AuthAdapter
|
|
48
|
+
export default auth
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare module "#auth/auth-client" {
|
|
52
|
+
export const authClient: import("@rimelight/auth/client").AuthClient
|
|
53
|
+
export const createAuthClient: typeof import("@rimelight/auth/client").createAuthClient
|
|
54
|
+
export default authClient
|
|
55
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimelight/config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Rimelight Entertainment's shared configuration package",
|
|
6
6
|
"homepage": "https://rimelight.com/docs",
|
|
@@ -47,19 +47,19 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@astrojs/cloudflare": "14.3.1",
|
|
50
|
-
"astro": "7.3.
|
|
50
|
+
"astro": "7.3.3",
|
|
51
51
|
"drizzle-kit": "0.31.10",
|
|
52
52
|
"typescript": "6.0.3",
|
|
53
|
-
"vite-plus": "0.3.
|
|
53
|
+
"vite-plus": "0.3.2"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@astrojs/cloudflare": ">=14.0.0",
|
|
57
57
|
"@astrojs/solid-js": ">=7.0.0",
|
|
58
|
-
"@rimelight/cms": "0.0.
|
|
59
|
-
"@rimelight/i18n": "0.0.
|
|
60
|
-
"@rimelight/security": "0.0.
|
|
61
|
-
"@rimelight/seo": "0.0.
|
|
62
|
-
"@rimelight/ui": "0.0.
|
|
58
|
+
"@rimelight/cms": "0.0.14",
|
|
59
|
+
"@rimelight/i18n": "0.0.16",
|
|
60
|
+
"@rimelight/security": "0.0.17",
|
|
61
|
+
"@rimelight/seo": "0.0.11",
|
|
62
|
+
"@rimelight/ui": "0.0.55",
|
|
63
63
|
"astro": ">=7.0.0",
|
|
64
64
|
"drizzle-kit": ">=0.30.0"
|
|
65
65
|
},
|