@rimelight/config 0.0.9 → 0.0.10

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.d.ts CHANGED
@@ -3,4 +3,3 @@
3
3
  declare module "*.astro" {
4
4
  export default {} as import("astro/runtime/server").AstroComponentFactory
5
5
  }
6
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rimelight/config",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "private": false,
5
5
  "description": "Rimelight Entertainment's shared configuration package",
6
6
  "homepage": "https://rimelight.com/docs",
@@ -47,12 +47,6 @@
47
47
  },
48
48
  "devDependencies": {
49
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",
56
50
  "astro": "7.3.2",
57
51
  "drizzle-kit": "0.31.10",
58
52
  "typescript": "6.0.3",
@@ -61,11 +55,11 @@
61
55
  "peerDependencies": {
62
56
  "@astrojs/cloudflare": ">=14.0.0",
63
57
  "@astrojs/solid-js": ">=7.0.0",
64
- "@rimelight/cms": ">=0.0.1",
65
- "@rimelight/i18n": ">=0.0.1",
66
- "@rimelight/security": ">=0.0.1",
67
- "@rimelight/seo": ">=0.0.1",
68
- "@rimelight/ui": ">=0.0.1",
58
+ "@rimelight/cms": "workspace:*",
59
+ "@rimelight/i18n": "workspace:*",
60
+ "@rimelight/security": "workspace:*",
61
+ "@rimelight/seo": "workspace:*",
62
+ "@rimelight/ui": "workspace:*",
69
63
  "astro": ">=7.0.0",
70
64
  "drizzle-kit": ">=0.30.0"
71
65
  },
@@ -100,5 +94,6 @@
100
94
  },
101
95
  "engines": {
102
96
  "node": ">=26.8.2"
103
- }
104
- }
97
+ },
98
+ "packageManager": "pnpm@12.4.1"
99
+ }
@@ -6,9 +6,7 @@
6
6
  "name": "@astrojs/ts-plugin"
7
7
  }
8
8
  ],
9
- "types": [
10
- "@rimelight/config/astro-env"
11
- ]
9
+ "types": ["@rimelight/config/astro-env"]
12
10
  },
13
11
  "display": "Rimelight Astro",
14
12
  "extends": "./base.json"
package/vite-plus/base.js CHANGED
@@ -59,6 +59,13 @@ export function rimelightConfig() {
59
59
  },
60
60
  test: {
61
61
  environment: "node"
62
+ },
63
+ run: {
64
+ tasks: {
65
+ test: {
66
+ command: "vp test"
67
+ }
68
+ }
62
69
  }
63
70
  }
64
71
  }
@@ -116,6 +123,34 @@ export function verifyPackageExports(pkgJsonPath = "package.json", srcDir = "src
116
123
  }
117
124
  }
118
125
 
126
+ export function findVirtualExternals(baseDir = "src") {
127
+ if (!fs.existsSync(baseDir)) {
128
+ return []
129
+ }
130
+
131
+ const externals = new Set()
132
+
133
+ function walk(currentDir) {
134
+ const files = fs.readdirSync(currentDir, { withFileTypes: true })
135
+ for (const file of files) {
136
+ const fullPath = path.join(currentDir, file.name)
137
+ if (file.isDirectory()) {
138
+ walk(fullPath)
139
+ } else if (file.isFile() && /\.(ts|tsx|js|jsx|astro|vue)$/.test(file.name)) {
140
+ const content = fs.readFileSync(fullPath, "utf8")
141
+ const regex = /["']((?:virtual|cloudflare):[^"']+)["']/g
142
+ let match
143
+ while ((match = regex.exec(content)) !== null) {
144
+ externals.add(match[1])
145
+ }
146
+ }
147
+ }
148
+ }
149
+
150
+ walk(baseDir)
151
+ return Array.from(externals)
152
+ }
153
+
119
154
  export function rimelightPackConfig(options = {}) {
120
155
  const { entry, autoEntry, pack = {}, autoExternal = true, ...rest } = options
121
156
 
@@ -134,22 +169,35 @@ export function rimelightPackConfig(options = {}) {
134
169
  }
135
170
 
136
171
  const discoveredExternals = autoExternal ? findPackageExternals() : []
172
+ const discoveredVirtualExternals = autoExternal ? findVirtualExternals() : []
137
173
  const userExternal = pack["external"] || []
138
174
  const userExternalList = Array.isArray(userExternal) ? userExternal : [userExternal]
139
- const userNeverBundle = pack["deps"]?.["neverBundle"] || []
175
+ const userDeps = pack["deps"] || {}
176
+ const userNeverBundle = userDeps["neverBundle"] || []
140
177
  const userNeverBundleList = Array.isArray(userNeverBundle) ? userNeverBundle : [userNeverBundle]
141
178
  const mergedExternal = Array.from(
142
- new Set([...userExternalList, ...userNeverBundleList, ...discoveredExternals])
179
+ new Set([
180
+ ...userExternalList,
181
+ ...userNeverBundleList,
182
+ ...discoveredExternals,
183
+ ...discoveredVirtualExternals
184
+ ])
143
185
  ).filter(Boolean)
144
186
 
187
+ const hasUserDeps = pack["deps"] !== undefined
188
+ const hasExternals = mergedExternal.length > 0
189
+
145
190
  return {
146
191
  ...rimelightConfig(),
147
192
  ...rest,
148
193
  pack: {
149
194
  entry: resolvedEntry,
150
195
  dts: true,
151
- ...(mergedExternal.length > 0 ? { deps: { neverBundle: mergedExternal } } : {}),
152
- ...pack
196
+ checks: { pluginTimings: false },
197
+ ...pack,
198
+ ...(hasUserDeps || hasExternals
199
+ ? { deps: { ...userDeps, ...(hasExternals ? { neverBundle: mergedExternal } : {}) } }
200
+ : {})
153
201
  }
154
202
  }
155
203
  }
package/vite-plus/base.ts CHANGED
@@ -60,6 +60,13 @@ export function rimelightConfig(): UserConfig {
60
60
  },
61
61
  test: {
62
62
  environment: "node"
63
+ },
64
+ run: {
65
+ tasks: {
66
+ test: {
67
+ command: "vp test"
68
+ }
69
+ }
63
70
  }
64
71
  }
65
72
  }
@@ -126,6 +133,34 @@ export function verifyPackageExports(
126
133
  }
127
134
  }
128
135
 
136
+ export function findVirtualExternals(baseDir = "src"): string[] {
137
+ if (!fs.existsSync(baseDir)) {
138
+ return []
139
+ }
140
+
141
+ const externals = new Set<string>()
142
+
143
+ function walk(currentDir: string) {
144
+ const files = fs.readdirSync(currentDir, { withFileTypes: true })
145
+ for (const file of files) {
146
+ const fullPath = path.join(currentDir, file.name)
147
+ if (file.isDirectory()) {
148
+ walk(fullPath)
149
+ } else if (file.isFile() && /\.(ts|tsx|js|jsx|astro|vue)$/.test(file.name)) {
150
+ const content = fs.readFileSync(fullPath, "utf8")
151
+ const regex = /["']((?:virtual|cloudflare):[^"']+)["']/g
152
+ let match: RegExpExecArray | null
153
+ while ((match = regex.exec(content)) !== null) {
154
+ externals.add(match[1]!)
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ walk(baseDir)
161
+ return Array.from(externals)
162
+ }
163
+
129
164
  export interface RimelightPackOptions {
130
165
  entry?: string[] | "auto"
131
166
  autoEntry?: boolean | string
@@ -152,22 +187,35 @@ export function rimelightPackConfig(options: RimelightPackOptions = {}): any {
152
187
  }
153
188
 
154
189
  const discoveredExternals = autoExternal ? findPackageExternals() : []
190
+ const discoveredVirtualExternals = autoExternal ? findVirtualExternals() : []
155
191
  const userExternal = pack["external"] || []
156
192
  const userExternalList = Array.isArray(userExternal) ? userExternal : [userExternal]
157
- const userNeverBundle = (pack["deps"] as Record<string, any> | undefined)?.["neverBundle"] || []
193
+ const userDeps = (pack["deps"] as Record<string, any> | undefined) || {}
194
+ const userNeverBundle = userDeps["neverBundle"] || []
158
195
  const userNeverBundleList = Array.isArray(userNeverBundle) ? userNeverBundle : [userNeverBundle]
159
196
  const mergedExternal = Array.from(
160
- new Set([...userExternalList, ...userNeverBundleList, ...discoveredExternals])
197
+ new Set([
198
+ ...userExternalList,
199
+ ...userNeverBundleList,
200
+ ...discoveredExternals,
201
+ ...discoveredVirtualExternals
202
+ ])
161
203
  ).filter(Boolean)
162
204
 
205
+ const hasUserDeps = pack["deps"] !== undefined
206
+ const hasExternals = mergedExternal.length > 0
207
+
163
208
  return {
164
209
  ...rimelightConfig(),
165
210
  ...rest,
166
211
  pack: {
167
212
  entry: resolvedEntry,
168
213
  dts: true,
169
- ...(mergedExternal.length > 0 ? { deps: { neverBundle: mergedExternal } } : {}),
170
- ...pack
214
+ checks: { pluginTimings: false },
215
+ ...pack,
216
+ ...(hasUserDeps || hasExternals
217
+ ? { deps: { ...userDeps, ...(hasExternals ? { neverBundle: mergedExternal } : {}) } }
218
+ : {})
171
219
  }
172
220
  }
173
221
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Rimelight Entertainment
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.