Skip to content

Commit

Permalink
Merge pull request #534 from KBVE/alpha
Browse files Browse the repository at this point in the history
Preparing Beta Branch
  • Loading branch information
h0lybyte authored Jan 24, 2024
2 parents 0df03e9 + dca1e29 commit a4dd6ac
Show file tree
Hide file tree
Showing 34 changed files with 950 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
handle:
name: "Alpna to Beta"
name: "Alpha to Beta"
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
36 changes: 34 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions apps/herbmail.com/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ import partytown from '@astrojs/partytown';
import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';
import prefetch from '@astrojs/prefetch';
import mdx from '@astrojs/mdx';

import { fileURLToPath } from 'node:url';
import markdownConfig from './markdown.config';


// https://astro.build/config
export default defineConfig({
site: 'https://herbmail.com/',
outDir: '../../dist/apps/herbmail.com',
markdown: markdownConfig,

integrations: [
react(),
svelte(),
Expand All @@ -19,6 +25,10 @@ export default defineConfig({
prefetch({
throttle: 5,
}),
mdx({
...markdownConfig,
//extendPlugins: "astroDefaults"
}),
tailwind({
configFile: fileURLToPath(
new URL('./tailwind.config.cjs', import.meta.url)
Expand Down
32 changes: 32 additions & 0 deletions apps/herbmail.com/markdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import rehypeExternalLinks from 'rehype-external-links';
import { rehypeHeadingIds } from '@astrojs/markdown-remark';

export default {
extendMarkdownConfig: true,
rehypePlugins: [
rehypeHeadingIds,
[
rehypeExternalLinks,
{
rel: ['nofollow', 'noopener', 'noreferrer'],
target: ['_blank'],
},
],
//! rehypeSlug errors
],

//? Shiki Configuration

shikiConfig: {
// https://github.com/shikijs/shiki/blob/main/docs/themes.md
theme: 'dracula',
// https://github.com/shikijs/shiki/blob/main/docs/languages.md
langs: [],
wrap: true,
},

//? External Plugins -> True
extendPlugins: true,
gfm: true,
remarkPlugins: [],
};
Empty file.
Binary file not shown.
6 changes: 6 additions & 0 deletions apps/herbmail.com/public/embed/rust/herbwasm_sri_details.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
js_integrity: sha384-rAy-EZo4HNlaraoZefpIwnIo5DOKe1OfwGlRbYviFz6t9UQ1jqb2ZxFTGjZdJcuH
js_file: /rust_wasm_embed-345c5430996d84b3.js
wasm_integrity: sha384-fbMP2hfBLcr7hV3_EMdnFnEde35FXuwDZXj2a6S14JIQgkKP7tYFls8bey2naLr_
wasm_file: /rust_wasm_embed-345c5430996d84b3_bg.wasm
---
2 changes: 2 additions & 0 deletions apps/herbmail.com/public/embed/rust/herbwasm_sri_hashes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
JS File: /rust_wasm_embed-345c5430996d84b3.js, JS Integrity: sha384-rAy-EZo4HNlaraoZefpIwnIo5DOKe1OfwGlRbYviFz6t9UQ1jqb2ZxFTGjZdJcuH
WASM File: /rust_wasm_embed-345c5430996d84b3_bg.wasm, WASM Integrity: sha384-fbMP2hfBLcr7hV3_EMdnFnEde35FXuwDZXj2a6S14JIQgkKP7tYFls8bey2naLr_
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/herbmail.com/public/embed/rust/icon-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/herbmail.com/public/embed/rust/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><meta content="text/html; charset=utf-8" http-equiv=Content-Type><meta content="width=device-width,initial-scale=1.0,user-scalable=no" name=viewport><title>eframe template</title><script type=module>import a,*as b from"/rust_wasm_embed-345c5430996d84b3.js";a(`/rust_wasm_embed-345c5430996d84b3_bg.wasm`);window.wasmBindings=b</script><base href=/><link href=/favicon-f402c8741ce815ec.ico integrity=sha384-jNOAE6jgE03LznIulCTVP6BH4NrTuROFjP9wj8bV1UUMJKtZAvstFpIAP3PDcFpx rel=icon><link href=manifest.json rel=manifest><link href=icon_ios_touch_192.png rel=apple-touch-icon><meta media="(prefers-color-scheme: light)" content=white name=theme-color><meta media="(prefers-color-scheme: dark)" content=#404040 name=theme-color><style>html{touch-action:manipulation}body{background:#909090}@media (prefers-color-scheme:dark){body{background:#404040}}html,body{width:100%;height:100%;overflow:hidden;margin:0!important;padding:0!important}canvas{margin-left:auto;margin-right:auto;display:block;position:absolute;top:0%;left:50%;transform:translate(-50%)}.centered{color:#f0f0f0;text-align:center;margin-left:auto;margin-right:auto;font-family:Ubuntu-Light,Helvetica,sans-serif;font-size:24px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.lds-dual-ring{width:24px;height:24px;display:inline-block}.lds-dual-ring:after{content:" ";border:3px solid #fff;border-color:#fff #0000;border-radius:50%;width:24px;height:24px;margin:0;animation:1.2s linear infinite lds-dual-ring;display:block}@keyframes lds-dual-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}</style><link as=fetch crossorigin href=/rust_wasm_embed-345c5430996d84b3_bg.wasm integrity=sha384-fbMP2hfBLcr7hV3_EMdnFnEde35FXuwDZXj2a6S14JIQgkKP7tYFls8bey2naLr_ rel=preload type=application/wasm><link crossorigin href=/rust_wasm_embed-345c5430996d84b3.js integrity=sha384-rAy-EZo4HNlaraoZefpIwnIo5DOKe1OfwGlRbYviFz6t9UQ1jqb2ZxFTGjZdJcuH rel=modulepreload></head><body><canvas id=the_canvas_id></canvas><script>if(`serviceWorker` in navigator&&window.location.hash!==`#dev`){window.addEventListener(`load`,(()=>{navigator.serviceWorker.register(`sw.js`)}))}</script></body></html>
28 changes: 28 additions & 0 deletions apps/herbmail.com/public/embed/rust/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "egui Template PWA",
"short_name": "egui-template-pwa",
"icons": [
{
"src": "./icon-256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "./maskable_icon_x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "./icon-1024.png",
"sizes": "1024x1024",
"type": "image/png"
}
],
"lang": "en-US",
"id": "/index.html",
"start_url": "./index.html",
"display": "standalone",
"background_color": "white",
"theme_color": "white"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Binary file not shown.
25 changes: 25 additions & 0 deletions apps/herbmail.com/public/embed/rust/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var cacheName = 'egui-template-pwa';
var filesToCache = [
'./',
'./index.html',
'./rust_wasm_embed.js',
'./rust_wasm_embed_bg.wasm',
];

/* Start the service worker and cache all of the app's content */
self.addEventListener('install', function (e) {
e.waitUntil(
caches.open(cacheName).then(function (cache) {
return cache.addAll(filesToCache);
})
);
});

/* Serve cached content when offline */
self.addEventListener('fetch', function (e) {
e.respondWith(
caches.match(e.request).then(function (response) {
return response || fetch(e.request);
})
);
});
Empty file.
19 changes: 19 additions & 0 deletions apps/herbmail.com/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { z, defineCollection } from 'astro:content';

//* [Tools]
const tools = defineCollection({
schema: z.object({
title: z.string(),
description: z.string(),
js_integrity: z.string().optional(),
js_file: z.string().optional(),
wasm_integrity: z.string().optional(),
wasm_file: z.string().optional()
}),
});


export const collections = {

tools: tools,
}
9 changes: 9 additions & 0 deletions apps/herbmail.com/src/content/tools/wasm.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
js_integrity: sha384-rAy-EZo4HNlaraoZefpIwnIo5DOKe1OfwGlRbYviFz6t9UQ1jqb2ZxFTGjZdJcuH
js_file: /rust_wasm_embed-345c5430996d84b3.js
wasm_integrity: sha384-fbMP2hfBLcr7hV3_EMdnFnEde35FXuwDZXj2a6S14JIQgkKP7tYFls8bey2naLr_
wasm_file: /rust_wasm_embed-345c5430996d84b3_bg.wasm
title: The WASM Embed
description: The WASM Embed Test Case
slug: wasm
---
1 change: 1 addition & 0 deletions apps/herbmail.com/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
74 changes: 74 additions & 0 deletions apps/herbmail.com/src/pages/wasm.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
import Layout from '../layouts/Layout.astro';
import { AstroVe as VE } from '@kbve/astro-ve';
import { getEntry } from 'astro:content';
const wasmy = await getEntry('tools', 'wasm');
let title = wasmy.data.title;
let description = wasmy.data.description;
let js_file = wasmy.data.js_file;
js_file = `/embed/rust${js_file}`;
let wasm_file = wasmy.data.wasm_file;
wasm_file = `/embed/rust${wasm_file}`;
let js_integrity = wasmy.data.js_integrity;
let wasm_integrity = wasmy.data.wasm_integrity;
---

<Layout title={title} description={description}>

<link
as="fetch"
id="wasm-file-link"
crossorigin
href={wasm_file}
integrity={wasm_integrity}
rel="preload"
type="application/wasm"
/>
<link
crossorigin
id="wasm-js-link"
href={js_file}
integrity={js_integrity}
rel="modulepreload"
/>


<script type="module">
const wasmUrl = document.getElementById('wasm-file-link').getAttribute('href');
const jsUrl = document.getElementById('wasm-js-link').getAttribute('href');

try {
const wasmModule = await import(jsUrl);

wasmModule.default(wasmUrl);
window.wasmBindings = wasmModule;
} catch (e) {
console.error("Failed to load WASM module:", e);
}

</script>


<script is:inline>
if (`serviceWorker` in navigator && window.location.hash !== `#dev`) {
window.addEventListener(`load`, (() => {
navigator.serviceWorker.register(`sw.js`)
}))
}
</script>


<main class="md:p-96 overflow-hidden relative">
<canvas
id="the_canvas_id"
class="mx-auto block absolute top-0 left-1/2 w-full"
style="transform: translateX(-50%);"
>
</canvas>
</main>
</Layout>
4 changes: 2 additions & 2 deletions apps/kbve.com/public/data/outpost/nx/report.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Report
description: Report
date: 2024-01-17
date: 2024-01-19
---

## Report
Expand Down Expand Up @@ -50,5 +50,5 @@ Community plugins:
```

```
'Report Timestamp: 1705528801'
'Report Timestamp: 1705667674'
```
Empty file.
Loading

0 comments on commit a4dd6ac

Please sign in to comment.