@xyd-js/host 0.0.0-build-6675456-20251014012658 → 0.0.0-build-e4644f3-20251015210712

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/CHANGELOG.md CHANGED
@@ -1,24 +1,24 @@
1
1
  # @xyd-js/host
2
2
 
3
- ## 0.0.0-build-6675456-20251014012658
3
+ ## 0.0.0-build-e4644f3-20251015210712
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - update all packages
8
8
  - Updated dependencies
9
- - @xyd-js/analytics@0.0.0-build-6675456-20251014012658
10
- - @xyd-js/atlas@0.0.0-build-6675456-20251014012658
11
- - @xyd-js/components@0.0.0-build-6675456-20251014012658
12
- - @xyd-js/composer@0.0.0-build-6675456-20251014012658
13
- - @xyd-js/content@0.0.0-build-6675456-20251014012658
14
- - @xyd-js/core@0.0.0-build-6675456-20251014012658
15
- - @xyd-js/framework@0.0.0-build-6675456-20251014012658
16
- - @xyd-js/plugin-algolia@0.0.0-build-6675456-20251014012658
17
- - @xyd-js/plugin-orama@0.0.0-build-6675456-20251014012658
18
- - @xyd-js/theme-cosmo@0.0.0-build-6675456-20251014012658
19
- - @xyd-js/theme-gusto@0.0.0-build-6675456-20251014012658
20
- - @xyd-js/theme-opener@0.0.0-build-6675456-20251014012658
21
- - @xyd-js/theme-picasso@0.0.0-build-6675456-20251014012658
22
- - @xyd-js/theme-poetry@0.0.0-build-6675456-20251014012658
23
- - @xyd-js/theme-solar@0.0.0-build-6675456-20251014012658
24
- - @xyd-js/themes@0.0.0-build-6675456-20251014012658
9
+ - @xyd-js/analytics@0.0.0-build-e4644f3-20251015210712
10
+ - @xyd-js/atlas@0.0.0-build-e4644f3-20251015210712
11
+ - @xyd-js/components@0.0.0-build-e4644f3-20251015210712
12
+ - @xyd-js/composer@0.0.0-build-e4644f3-20251015210712
13
+ - @xyd-js/content@0.0.0-build-e4644f3-20251015210712
14
+ - @xyd-js/core@0.0.0-build-e4644f3-20251015210712
15
+ - @xyd-js/framework@0.0.0-build-e4644f3-20251015210712
16
+ - @xyd-js/plugin-algolia@0.0.0-build-e4644f3-20251015210712
17
+ - @xyd-js/plugin-orama@0.0.0-build-e4644f3-20251015210712
18
+ - @xyd-js/theme-cosmo@0.0.0-build-e4644f3-20251015210712
19
+ - @xyd-js/theme-gusto@0.0.0-build-e4644f3-20251015210712
20
+ - @xyd-js/theme-opener@0.0.0-build-e4644f3-20251015210712
21
+ - @xyd-js/theme-picasso@0.0.0-build-e4644f3-20251015210712
22
+ - @xyd-js/theme-poetry@0.0.0-build-e4644f3-20251015210712
23
+ - @xyd-js/theme-solar@0.0.0-build-e4644f3-20251015210712
24
+ - @xyd-js/themes@0.0.0-build-e4644f3-20251015210712
@@ -0,0 +1,16 @@
1
+ export const MIME_TYPES: Record<string, string> = {
2
+ ".html": "text/html",
3
+ ".css": "text/css",
4
+ ".js": "text/javascript",
5
+ ".json": "application/json",
6
+ ".png": "image/png",
7
+ ".jpg": "image/jpeg",
8
+ ".jpeg": "image/jpeg",
9
+ ".webp": "image/webp",
10
+ ".gif": "image/gif",
11
+ ".svg": "image/svg+xml",
12
+ ".ico": "image/x-icon",
13
+ ".txt": "text/plain",
14
+ ".md": "text/markdown",
15
+ ".mdx": "text/markdown",
16
+ };
package/app/public.ts CHANGED
@@ -2,21 +2,7 @@ import path from "node:path";
2
2
  import fs from "node:fs/promises";
3
3
 
4
4
  import { redirect } from "react-router";
5
-
6
- const MIME_TYPES: Record<string, string> = {
7
- ".html": "text/html",
8
- ".css": "text/css",
9
- ".js": "text/javascript",
10
- ".json": "application/json",
11
- ".png": "image/png",
12
- ".jpg": "image/jpeg",
13
- ".jpeg": "image/jpeg",
14
- ".webp": "image/webp",
15
- ".gif": "image/gif",
16
- ".svg": "image/svg+xml",
17
- ".ico": "image/x-icon",
18
- ".txt": "text/plain",
19
- };
5
+ import { MIME_TYPES } from "./constants";
20
6
 
21
7
  const BINARY_FILE_EXTENSIONS = [
22
8
  ".png",
package/app/rawFile.ts ADDED
@@ -0,0 +1,29 @@
1
+ import path from "node:path";
2
+ import { MIME_TYPES } from "./constants";
3
+
4
+ // Declare the global property type
5
+ declare global {
6
+ var __xydRawRouteFiles: { [path: string]: string };
7
+ }
8
+
9
+ export async function loader({ request }: any) {
10
+ const url = new URL(request.url);
11
+ const pathname = url.pathname;
12
+ // Get the content from globalThis.__xydRawRouteFiles for this path
13
+ const content = globalThis.__xydRawRouteFiles?.[pathname];
14
+
15
+ if (!content) {
16
+ throw new Response("Not Found", { status: 404 });
17
+ }
18
+
19
+ // Determine content type based on file extension
20
+ const ext = path.extname(pathname).toLowerCase();
21
+ const contentType = MIME_TYPES[ext] || "text/plain";
22
+
23
+ return new Response(content, {
24
+ status: 200,
25
+ headers: {
26
+ "Content-Type": `${contentType}; charset=utf-8`,
27
+ },
28
+ });
29
+ }
package/app/routes.ts CHANGED
@@ -7,6 +7,7 @@ import {pathRoutes} from "./pathRoutes";
7
7
  // Declare the global property type
8
8
  declare global {
9
9
  var __xydBasePath: string;
10
+ var __xydRawRouteFiles: {[path: string]: string};
10
11
  }
11
12
 
12
13
  const basePath = globalThis.__xydBasePath
@@ -19,8 +20,8 @@ export const routes = [
19
20
  ...docsRoutes,
20
21
 
21
22
  // TODO: in the future better sitemap + robots.txt
22
- route("/sitemap.xml", "./sitemap.ts"),
23
- route("/robots.txt", "./robots.ts"),
23
+ route("/sitemap.xml", "./sitemap.ts"), // TODO: it should be __xydRawRouteFiles + overwrite
24
+ route("/robots.txt", "./robots.ts"), // TODO: it should be __xydRawRouteFiles + overwrite
24
25
  route(
25
26
  "/.well-known/appspecific/com.chrome.devtools.json",
26
27
  "./debug-null.tsx",
@@ -31,5 +32,11 @@ if (globalThis.__xydStaticFiles?.length) {
31
32
  routes.push(route("/public/*", "./public.ts"))
32
33
  }
33
34
 
35
+ if (globalThis.__xydRawRouteFiles) {
36
+ Object.keys(globalThis.__xydRawRouteFiles).forEach(path => {
37
+ routes.push(route(path, "./rawFile.ts", {id: path}))
38
+ })
39
+ }
40
+
34
41
  export default routes
35
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyd-js/host",
3
- "version": "0.0.0-build-6675456-20251014012658",
3
+ "version": "0.0.0-build-e4644f3-20251015210712",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "katex": "^0.16.22",
@@ -13,22 +13,22 @@
13
13
  "@react-router/serve": "^7.7.1",
14
14
  "openux-js": "0.0.0-pre.1",
15
15
  "pluganalytics": "0.0.0-pre.3",
16
- "@xyd-js/analytics": "0.0.0-build-6675456-20251014012658",
17
- "@xyd-js/core": "0.0.0-build-6675456-20251014012658",
18
- "@xyd-js/components": "0.0.0-build-6675456-20251014012658",
19
- "@xyd-js/content": "0.0.0-build-6675456-20251014012658",
20
- "@xyd-js/framework": "0.0.0-build-6675456-20251014012658",
21
- "@xyd-js/composer": "0.0.0-build-6675456-20251014012658",
22
- "@xyd-js/themes": "0.0.0-build-6675456-20251014012658",
23
- "@xyd-js/atlas": "0.0.0-build-6675456-20251014012658",
24
- "@xyd-js/theme-poetry": "0.0.0-build-6675456-20251014012658",
25
- "@xyd-js/theme-cosmo": "0.0.0-build-6675456-20251014012658",
26
- "@xyd-js/theme-opener": "0.0.0-build-6675456-20251014012658",
27
- "@xyd-js/theme-picasso": "0.0.0-build-6675456-20251014012658",
28
- "@xyd-js/theme-gusto": "0.0.0-build-6675456-20251014012658",
29
- "@xyd-js/theme-solar": "0.0.0-build-6675456-20251014012658",
30
- "@xyd-js/plugin-orama": "0.0.0-build-6675456-20251014012658",
31
- "@xyd-js/plugin-algolia": "0.0.0-build-6675456-20251014012658"
16
+ "@xyd-js/analytics": "0.0.0-build-e4644f3-20251015210712",
17
+ "@xyd-js/core": "0.0.0-build-e4644f3-20251015210712",
18
+ "@xyd-js/components": "0.0.0-build-e4644f3-20251015210712",
19
+ "@xyd-js/content": "0.0.0-build-e4644f3-20251015210712",
20
+ "@xyd-js/framework": "0.0.0-build-e4644f3-20251015210712",
21
+ "@xyd-js/composer": "0.0.0-build-e4644f3-20251015210712",
22
+ "@xyd-js/themes": "0.0.0-build-e4644f3-20251015210712",
23
+ "@xyd-js/atlas": "0.0.0-build-e4644f3-20251015210712",
24
+ "@xyd-js/theme-poetry": "0.0.0-build-e4644f3-20251015210712",
25
+ "@xyd-js/theme-cosmo": "0.0.0-build-e4644f3-20251015210712",
26
+ "@xyd-js/theme-opener": "0.0.0-build-e4644f3-20251015210712",
27
+ "@xyd-js/theme-picasso": "0.0.0-build-e4644f3-20251015210712",
28
+ "@xyd-js/theme-gusto": "0.0.0-build-e4644f3-20251015210712",
29
+ "@xyd-js/theme-solar": "0.0.0-build-e4644f3-20251015210712",
30
+ "@xyd-js/plugin-orama": "0.0.0-build-e4644f3-20251015210712",
31
+ "@xyd-js/plugin-algolia": "0.0.0-build-e4644f3-20251015210712"
32
32
  },
33
33
  "devDependencies": {
34
34
  "autoprefixer": "^10.4.20",
@@ -89,6 +89,11 @@ if (prerenderPaths.length) {
89
89
  )
90
90
  }
91
91
 
92
+ if (globalThis.__xydRawRouteFiles) {
93
+ const routes = Object.keys(globalThis.__xydRawRouteFiles)
94
+ prerenderPaths.push(...routes)
95
+ }
96
+
92
97
  const cwd = process.cwd();
93
98
 
94
99
  export default {
package/app/raw.ts DELETED
@@ -1,31 +0,0 @@
1
- import path from "node:path";
2
- import fs from "node:fs/promises";
3
-
4
- import { redirect } from "react-router";
5
-
6
- const MIME_TYPES: Record<string, string> = {
7
- '.md': 'text/markdown',
8
- '.mdx': 'text/markdown',
9
- };
10
-
11
- // TODO: !!! FINISH !!!
12
- export async function loader({ params }: any) {
13
- const filePath = path.join(process.cwd(), "/docs/guides/quickstart.md")
14
-
15
- try {
16
- await fs.access(filePath)
17
- } catch (e) {
18
- return redirect("/404")
19
- }
20
-
21
- const ext = path.extname(filePath).toLowerCase();
22
- const fileContent = await fs.readFile(filePath, 'utf-8');
23
- const contentType = MIME_TYPES[ext] || 'application/octet-stream';
24
-
25
- return new Response(fileContent, {
26
- status: 200,
27
- headers: {
28
- 'Content-Type': contentType,
29
- },
30
- });
31
- }