@xyd-js/plugin-docs 0.0.0-build-87e0566-20251013171826 → 0.0.0-build-6675456-20251014012658

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyd-js/plugin-docs",
3
- "version": "0.0.0-build-87e0566-20251013171826",
3
+ "version": "0.0.0-build-6675456-20251014012658",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -18,10 +18,11 @@
18
18
  "codehike": "^1.0.3",
19
19
  "@code-hike/lighter": "^1.0.3",
20
20
  "dotenv": "^16.4.7",
21
- "@xyd-js/openapi": "0.0.0-build-87e0566-20251013171826",
22
- "@xyd-js/gql": "0.0.0-build-87e0566-20251013171826",
23
- "@xyd-js/uniform": "0.0.0-build-87e0566-20251013171826",
24
- "@xyd-js/sources": "0.0.0-build-87e0566-20251013171826"
21
+ "@xyd-js/openapi": "0.0.0-build-6675456-20251014012658",
22
+ "@xyd-js/gql": "0.0.0-build-6675456-20251014012658",
23
+ "@xyd-js/uniform": "0.0.0-build-6675456-20251014012658",
24
+ "@xyd-js/sources": "0.0.0-build-6675456-20251014012658",
25
+ "@xyd-js/cli-sdk": "0.1.0-build.0"
25
26
  },
26
27
  "peerDependencies": {
27
28
  "@react-router/dev": "^7.7.1",
@@ -31,12 +32,12 @@
31
32
  "react": "^19.1.0",
32
33
  "react-dom": "^19.1.0",
33
34
  "react-router": "^7.7.1",
34
- "@xyd-js/framework": "0.0.0-build-87e0566-20251013171826",
35
- "@xyd-js/composer": "0.0.0-build-87e0566-20251013171826",
36
- "@xyd-js/themes": "0.0.0-build-87e0566-20251013171826",
37
- "@xyd-js/components": "0.0.0-build-87e0566-20251013171826",
38
- "@xyd-js/content": "0.0.0-build-87e0566-20251013171826",
39
- "@xyd-js/core": "0.0.0-build-87e0566-20251013171826"
35
+ "@xyd-js/framework": "0.0.0-build-6675456-20251014012658",
36
+ "@xyd-js/composer": "0.0.0-build-6675456-20251014012658",
37
+ "@xyd-js/themes": "0.0.0-build-6675456-20251014012658",
38
+ "@xyd-js/components": "0.0.0-build-6675456-20251014012658",
39
+ "@xyd-js/content": "0.0.0-build-6675456-20251014012658",
40
+ "@xyd-js/core": "0.0.0-build-6675456-20251014012658"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@types/react-dom": "^19.1.0",
@@ -6,9 +6,11 @@ import { createServer } from "vite";
6
6
  import { config as dotenvConfig } from "dotenv";
7
7
  import yaml from "js-yaml";
8
8
 
9
- import { Settings } from "@xyd-js/core";
10
9
  import { getThemeColors } from "@code-hike/lighter";
11
10
 
11
+ import { Settings } from "@xyd-js/core";
12
+ import { replaceEnvVars } from "@xyd-js/cli-sdk";
13
+
12
14
  const extensions = ["tsx", "ts", "json"];
13
15
 
14
16
  /**
@@ -299,47 +301,6 @@ async function loadEnvFiles(dirPath: string) {
299
301
  }
300
302
  }
301
303
 
302
- /**
303
- * Recursively replaces environment variable placeholders in an object
304
- * @param obj - The object to process
305
- * @returns The object with environment variables replaced
306
- */
307
- function replaceEnvVars<T>(obj: T): T {
308
- if (obj === null || obj === undefined) {
309
- return obj;
310
- }
311
-
312
- if (typeof obj === "string") {
313
- // Check if the string contains environment variable placeholders
314
- if (obj.includes("$")) {
315
- return obj.replace(/\$([A-Z_][A-Z0-9_]*)/g, (match, varName) => {
316
- const envValue = process.env[varName];
317
- if (envValue === undefined) {
318
- console.warn(
319
- `\n⚠️ Environment variable "${varName}" is not set, keeping placeholder: ${match}`
320
- );
321
- return match;
322
- }
323
- return envValue;
324
- }) as T;
325
- }
326
- return obj;
327
- }
328
-
329
- if (Array.isArray(obj)) {
330
- return obj.map((item) => replaceEnvVars(item)) as T;
331
- }
332
-
333
- if (typeof obj === "object") {
334
- const result: any = {};
335
- for (const [key, value] of Object.entries(obj)) {
336
- result[key] = replaceEnvVars(value);
337
- }
338
- return result;
339
- }
340
-
341
- return obj;
342
- }
343
304
 
344
305
  function isUrl(str: string): boolean {
345
306
  try {