@rimelight/config 0.0.7 → 0.0.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/README.md +23 -2
- package/astro/index.js +4 -3
- package/astro/index.ts +10 -3
- package/astro.d.ts +6 -0
- package/drizzle/index.js +17 -0
- package/drizzle/index.ts +19 -0
- package/package.json +20 -2
- package/tsconfig/astro.json +3 -0
package/README.md
CHANGED
|
@@ -79,8 +79,8 @@ Zero-boilerplate setup with preconfigured Cloudflare adapter, Cloudflare cache,
|
|
|
79
79
|
```typescript
|
|
80
80
|
import { defineConfig } from "astro/config"
|
|
81
81
|
import { rimelightAstroConfig } from "@rimelight/config/astro"
|
|
82
|
-
import en from "./src/
|
|
83
|
-
import pt from "./src/
|
|
82
|
+
import en from "./src/i18n/en.json"
|
|
83
|
+
import pt from "./src/i18n/pt.json"
|
|
84
84
|
|
|
85
85
|
export default defineConfig(
|
|
86
86
|
rimelightAstroConfig({
|
|
@@ -124,6 +124,27 @@ export default defineConfig({
|
|
|
124
124
|
})
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
+
## Drizzle Configs
|
|
128
|
+
|
|
129
|
+
Zero-boilerplate Drizzle Kit configuration with standard defaults (`sqlite` dialect, `./drizzle` out directory, `./src/db/schema/index.ts` schema):
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
import { rimelightDrizzleConfig } from "@rimelight/config/drizzle"
|
|
133
|
+
|
|
134
|
+
export default rimelightDrizzleConfig()
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Custom / overridden options:
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { rimelightDrizzleConfig } from "@rimelight/config/drizzle"
|
|
141
|
+
|
|
142
|
+
export default rimelightDrizzleConfig({
|
|
143
|
+
schema: "./src/db/schema.ts",
|
|
144
|
+
tablesFilter: ["custom_*"]
|
|
145
|
+
})
|
|
146
|
+
```
|
|
147
|
+
|
|
127
148
|
## Config Details
|
|
128
149
|
|
|
129
150
|
### TypeScript Base Config
|
package/astro/index.js
CHANGED
|
@@ -80,7 +80,7 @@ export function cloudflarePreset(options = {}) {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
function discoverTranslations(dir = "./src/
|
|
83
|
+
function discoverTranslations(dir = "./src/i18n") {
|
|
84
84
|
const translations = {}
|
|
85
85
|
try {
|
|
86
86
|
const resolvedDir = path.resolve(process.cwd(), dir)
|
|
@@ -173,9 +173,10 @@ function rimelightIntegration(options, imageDomains, domain) {
|
|
|
173
173
|
|
|
174
174
|
if (options.seo) {
|
|
175
175
|
const seoMod = await import("@rimelight/seo")
|
|
176
|
-
const
|
|
176
|
+
const seoFn =
|
|
177
|
+
seoMod.rimelightSeo || seoMod.default?.rimelightSeo || seoMod.default || seoMod
|
|
177
178
|
const seoOpts = typeof options.seo === "object" ? options.seo : {}
|
|
178
|
-
integrations.push(
|
|
179
|
+
integrations.push(seoFn(seoOpts))
|
|
179
180
|
}
|
|
180
181
|
|
|
181
182
|
if (options.cms) {
|
package/astro/index.ts
CHANGED
|
@@ -136,7 +136,10 @@ export interface RimelightAstroOptions {
|
|
|
136
136
|
| {
|
|
137
137
|
robots?: boolean | Record<string, any>
|
|
138
138
|
sitemap?: boolean | Record<string, any>
|
|
139
|
+
rss?: boolean | Record<string, any>
|
|
139
140
|
llms?: boolean | Record<string, any>
|
|
141
|
+
llmsFull?: boolean | Record<string, any>
|
|
142
|
+
assets?: boolean | Record<string, any>
|
|
140
143
|
[key: string]: any
|
|
141
144
|
}
|
|
142
145
|
cms?:
|
|
@@ -162,7 +165,7 @@ export interface RimelightAstroOptions {
|
|
|
162
165
|
[key: string]: any
|
|
163
166
|
}
|
|
164
167
|
|
|
165
|
-
function discoverTranslations(dir = "./src/
|
|
168
|
+
function discoverTranslations(dir = "./src/i18n"): Record<string, any> {
|
|
166
169
|
const translations: Record<string, any> = {}
|
|
167
170
|
try {
|
|
168
171
|
const resolvedDir = path.resolve(process.cwd(), dir)
|
|
@@ -259,9 +262,13 @@ function rimelightIntegration(
|
|
|
259
262
|
|
|
260
263
|
if (options.seo) {
|
|
261
264
|
const seoMod = await import("@rimelight/seo")
|
|
262
|
-
const
|
|
265
|
+
const seoFn =
|
|
266
|
+
(seoMod as any).rimelightSeo ||
|
|
267
|
+
(seoMod as any).default?.rimelightSeo ||
|
|
268
|
+
(seoMod as any).default ||
|
|
269
|
+
seoMod
|
|
263
270
|
const seoOpts = typeof options.seo === "object" ? options.seo : {}
|
|
264
|
-
integrations.push(
|
|
271
|
+
integrations.push(seoFn(seoOpts))
|
|
265
272
|
}
|
|
266
273
|
|
|
267
274
|
if (options.cms) {
|
package/astro.d.ts
ADDED
package/drizzle/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig } from "drizzle-kit"
|
|
2
|
+
|
|
3
|
+
export function rimelightDrizzleConfig(options = {}) {
|
|
4
|
+
const {
|
|
5
|
+
out = "./drizzle",
|
|
6
|
+
schema = "./src/db/schema/index.ts",
|
|
7
|
+
dialect = "sqlite",
|
|
8
|
+
...rest
|
|
9
|
+
} = options
|
|
10
|
+
|
|
11
|
+
return defineConfig({
|
|
12
|
+
out,
|
|
13
|
+
schema,
|
|
14
|
+
dialect,
|
|
15
|
+
...rest
|
|
16
|
+
})
|
|
17
|
+
}
|
package/drizzle/index.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineConfig, type Config } from "drizzle-kit"
|
|
2
|
+
|
|
3
|
+
export type RimelightDrizzleOptions = Partial<Config>
|
|
4
|
+
|
|
5
|
+
export function rimelightDrizzleConfig(options: RimelightDrizzleOptions = {}): Config {
|
|
6
|
+
const {
|
|
7
|
+
out = "./drizzle",
|
|
8
|
+
schema = "./src/db/schema/index.ts",
|
|
9
|
+
dialect = "sqlite",
|
|
10
|
+
...rest
|
|
11
|
+
} = options
|
|
12
|
+
|
|
13
|
+
return defineConfig({
|
|
14
|
+
out,
|
|
15
|
+
schema,
|
|
16
|
+
dialect,
|
|
17
|
+
...rest
|
|
18
|
+
})
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimelight/config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Rimelight Entertainment's shared configuration package",
|
|
6
6
|
"homepage": "https://rimelight.com/docs",
|
|
@@ -16,13 +16,16 @@
|
|
|
16
16
|
"url": "git+https://github.com/Rimelight-Entertainment/rimelight.git"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
|
+
"astro.d.ts",
|
|
19
20
|
"tsconfig",
|
|
20
21
|
"vite-plus",
|
|
21
22
|
"astro",
|
|
23
|
+
"drizzle",
|
|
22
24
|
"src"
|
|
23
25
|
],
|
|
24
26
|
"type": "module",
|
|
25
27
|
"exports": {
|
|
28
|
+
"./astro-env": "./astro.d.ts",
|
|
26
29
|
"./tsconfig/base": "./tsconfig/base.json",
|
|
27
30
|
"./tsconfig/astro": "./tsconfig/astro.json",
|
|
28
31
|
"./tsconfig/astro-solid": "./tsconfig/astro-solid.json",
|
|
@@ -33,6 +36,10 @@
|
|
|
33
36
|
"./astro": {
|
|
34
37
|
"types": "./astro/index.ts",
|
|
35
38
|
"default": "./astro/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./drizzle": {
|
|
41
|
+
"types": "./drizzle/index.ts",
|
|
42
|
+
"default": "./drizzle/index.js"
|
|
36
43
|
}
|
|
37
44
|
},
|
|
38
45
|
"publishConfig": {
|
|
@@ -40,7 +47,14 @@
|
|
|
40
47
|
},
|
|
41
48
|
"devDependencies": {
|
|
42
49
|
"@astrojs/cloudflare": "14.3.1",
|
|
50
|
+
"@rimelight/auth": "0.0.6",
|
|
51
|
+
"@rimelight/cms": "0.0.9",
|
|
52
|
+
"@rimelight/i18n": "0.0.12",
|
|
53
|
+
"@rimelight/security": "0.0.12",
|
|
54
|
+
"@rimelight/seo": "0.0.7",
|
|
55
|
+
"@rimelight/ui": "0.0.51",
|
|
43
56
|
"astro": "7.3.2",
|
|
57
|
+
"drizzle-kit": "0.31.10",
|
|
44
58
|
"typescript": "6.0.3",
|
|
45
59
|
"vite-plus": "0.3.1"
|
|
46
60
|
},
|
|
@@ -52,7 +66,8 @@
|
|
|
52
66
|
"@rimelight/security": ">=0.0.1",
|
|
53
67
|
"@rimelight/seo": ">=0.0.1",
|
|
54
68
|
"@rimelight/ui": ">=0.0.1",
|
|
55
|
-
"astro": ">=7.0.0"
|
|
69
|
+
"astro": ">=7.0.0",
|
|
70
|
+
"drizzle-kit": ">=0.30.0"
|
|
56
71
|
},
|
|
57
72
|
"peerDependenciesMeta": {
|
|
58
73
|
"@astrojs/cloudflare": {
|
|
@@ -78,6 +93,9 @@
|
|
|
78
93
|
},
|
|
79
94
|
"astro": {
|
|
80
95
|
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"drizzle-kit": {
|
|
98
|
+
"optional": true
|
|
81
99
|
}
|
|
82
100
|
},
|
|
83
101
|
"engines": {
|