@xyd-js/host 0.0.0-build-56377ca-20251013180714 → 0.0.0-build-1f6458c-20251015205119
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 +17 -17
- package/app/constants.ts +16 -0
- package/app/public.ts +1 -15
- package/app/rawFile.ts +29 -0
- package/app/routes.ts +9 -2
- package/package.json +17 -17
- package/react-router.config.ts +5 -0
- package/app/raw.ts +0 -31
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
# @xyd-js/host
|
|
2
2
|
|
|
3
|
-
## 0.0.0-build-
|
|
3
|
+
## 0.0.0-build-1f6458c-20251015205119
|
|
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-
|
|
10
|
-
- @xyd-js/atlas@0.0.0-build-
|
|
11
|
-
- @xyd-js/components@0.0.0-build-
|
|
12
|
-
- @xyd-js/composer@0.0.0-build-
|
|
13
|
-
- @xyd-js/content@0.0.0-build-
|
|
14
|
-
- @xyd-js/core@0.0.0-build-
|
|
15
|
-
- @xyd-js/framework@0.0.0-build-
|
|
16
|
-
- @xyd-js/plugin-algolia@0.0.0-build-
|
|
17
|
-
- @xyd-js/plugin-orama@0.0.0-build-
|
|
18
|
-
- @xyd-js/theme-cosmo@0.0.0-build-
|
|
19
|
-
- @xyd-js/theme-gusto@0.0.0-build-
|
|
20
|
-
- @xyd-js/theme-opener@0.0.0-build-
|
|
21
|
-
- @xyd-js/theme-picasso@0.0.0-build-
|
|
22
|
-
- @xyd-js/theme-poetry@0.0.0-build-
|
|
23
|
-
- @xyd-js/theme-solar@0.0.0-build-
|
|
24
|
-
- @xyd-js/themes@0.0.0-build-
|
|
9
|
+
- @xyd-js/analytics@0.0.0-build-1f6458c-20251015205119
|
|
10
|
+
- @xyd-js/atlas@0.0.0-build-1f6458c-20251015205119
|
|
11
|
+
- @xyd-js/components@0.0.0-build-1f6458c-20251015205119
|
|
12
|
+
- @xyd-js/composer@0.0.0-build-1f6458c-20251015205119
|
|
13
|
+
- @xyd-js/content@0.0.0-build-1f6458c-20251015205119
|
|
14
|
+
- @xyd-js/core@0.0.0-build-1f6458c-20251015205119
|
|
15
|
+
- @xyd-js/framework@0.0.0-build-1f6458c-20251015205119
|
|
16
|
+
- @xyd-js/plugin-algolia@0.0.0-build-1f6458c-20251015205119
|
|
17
|
+
- @xyd-js/plugin-orama@0.0.0-build-1f6458c-20251015205119
|
|
18
|
+
- @xyd-js/theme-cosmo@0.0.0-build-1f6458c-20251015205119
|
|
19
|
+
- @xyd-js/theme-gusto@0.0.0-build-1f6458c-20251015205119
|
|
20
|
+
- @xyd-js/theme-opener@0.0.0-build-1f6458c-20251015205119
|
|
21
|
+
- @xyd-js/theme-picasso@0.0.0-build-1f6458c-20251015205119
|
|
22
|
+
- @xyd-js/theme-poetry@0.0.0-build-1f6458c-20251015205119
|
|
23
|
+
- @xyd-js/theme-solar@0.0.0-build-1f6458c-20251015205119
|
|
24
|
+
- @xyd-js/themes@0.0.0-build-1f6458c-20251015205119
|
package/app/constants.ts
ADDED
|
@@ -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-
|
|
3
|
+
"version": "0.0.0-build-1f6458c-20251015205119",
|
|
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-
|
|
17
|
-
"@xyd-js/core": "0.0.0-build-
|
|
18
|
-
"@xyd-js/components": "0.0.0-build-
|
|
19
|
-
"@xyd-js/
|
|
20
|
-
"@xyd-js/
|
|
21
|
-
"@xyd-js/composer": "0.0.0-build-
|
|
22
|
-
"@xyd-js/themes": "0.0.0-build-
|
|
23
|
-
"@xyd-js/atlas": "0.0.0-build-
|
|
24
|
-
"@xyd-js/theme-poetry": "0.0.0-build-
|
|
25
|
-
"@xyd-js/theme-cosmo": "0.0.0-build-
|
|
26
|
-
"@xyd-js/theme-opener": "0.0.0-build-
|
|
27
|
-
"@xyd-js/theme-picasso": "0.0.0-build-
|
|
28
|
-
"@xyd-js/theme-gusto": "0.0.0-build-
|
|
29
|
-
"@xyd-js/theme-solar": "0.0.0-build-
|
|
30
|
-
"@xyd-js/plugin-orama": "0.0.0-build-
|
|
31
|
-
"@xyd-js/plugin-algolia": "0.0.0-build-
|
|
16
|
+
"@xyd-js/analytics": "0.0.0-build-1f6458c-20251015205119",
|
|
17
|
+
"@xyd-js/core": "0.0.0-build-1f6458c-20251015205119",
|
|
18
|
+
"@xyd-js/components": "0.0.0-build-1f6458c-20251015205119",
|
|
19
|
+
"@xyd-js/framework": "0.0.0-build-1f6458c-20251015205119",
|
|
20
|
+
"@xyd-js/content": "0.0.0-build-1f6458c-20251015205119",
|
|
21
|
+
"@xyd-js/composer": "0.0.0-build-1f6458c-20251015205119",
|
|
22
|
+
"@xyd-js/themes": "0.0.0-build-1f6458c-20251015205119",
|
|
23
|
+
"@xyd-js/atlas": "0.0.0-build-1f6458c-20251015205119",
|
|
24
|
+
"@xyd-js/theme-poetry": "0.0.0-build-1f6458c-20251015205119",
|
|
25
|
+
"@xyd-js/theme-cosmo": "0.0.0-build-1f6458c-20251015205119",
|
|
26
|
+
"@xyd-js/theme-opener": "0.0.0-build-1f6458c-20251015205119",
|
|
27
|
+
"@xyd-js/theme-picasso": "0.0.0-build-1f6458c-20251015205119",
|
|
28
|
+
"@xyd-js/theme-gusto": "0.0.0-build-1f6458c-20251015205119",
|
|
29
|
+
"@xyd-js/theme-solar": "0.0.0-build-1f6458c-20251015205119",
|
|
30
|
+
"@xyd-js/plugin-orama": "0.0.0-build-1f6458c-20251015205119",
|
|
31
|
+
"@xyd-js/plugin-algolia": "0.0.0-build-1f6458c-20251015205119"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"autoprefixer": "^10.4.20",
|
package/react-router.config.ts
CHANGED
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
|
-
}
|