Skip to content

Commit

Permalink
Introduce nativelink webapp including docs
Browse files Browse the repository at this point in the history
Made with astro & qwik
  • Loading branch information
SchahinRohani committed Aug 27, 2024
1 parent 503fb76 commit 40e954c
Show file tree
Hide file tree
Showing 104 changed files with 3,243 additions and 157 deletions.
14 changes: 14 additions & 0 deletions .github/styles/config/vocabularies/TraceMachina/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ LLVM
Machina
[Mm]onorepo
NVMe
[email protected]
NativeLink
OCI
OSSF
Expand Down Expand Up @@ -55,3 +56,16 @@ Grafana
GitHub
Deno
shipstorm
hermiticity
performant
unscalable
Warewulf
Apptainer
Verissimo
Delangue
Lackriet
Wainer
Gert
Bruer
Eagan
plattform
24 changes: 16 additions & 8 deletions .github/workflows/docs.yaml → .github/workflows/web.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
---
name: Deploy NativeLink Docs
name: Deploy NativeLink Web
on:
push:
branches: [main]
paths:
- 'web/app/**'
- '**/*.md'
- 'nativelink-config/**'
pull_request:
branches: [main]
paths:
- 'web/app/**'
- '**/*.md'
- 'nativelink-config/**'

permissions: read-all

jobs:
deploy:
name: Docs Deployment
runs-on: ubuntu-24.04
name: Web App Deployment
runs-on: ubuntu-24.04

steps:
- name: Checkout
Expand All @@ -26,18 +34,18 @@ jobs:
uses: >- # v4
DeterminateSystems/magic-nix-cache-action@fc6aaceb40b9845a02b91e059ec147e78d1b4e41
- name: Test deployment
working-directory: docs
- name: Test deployment
working-directory: web/app
run: |
nix develop --impure --command bash -c "
bun staging --project=nativelink-docs --org=nativelink
bun staging --project=nativelink --org=nativelink
"
if: github.event_name == 'pull_request'

- name: Production deployment
working-directory: docs
working-directory: web/app
run: |
nix develop --impure --command bash -c "
bun prod --project=nativelink-docs --org=nativelink
bun prod --project=nativelink --org=nativelink
"
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
46 changes: 0 additions & 46 deletions docs/.gitignore

This file was deleted.

Binary file removed docs/bun.lockb
Binary file not shown.
54 changes: 0 additions & 54 deletions docs/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions docs/src/content/config.ts

This file was deleted.

1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@
pkgs.bun # got patched to the newest version (v.1.1.25)
pkgs.deno
pkgs.lychee
pkgs.nodejs

# Additional tools from within our development environment.
local-image-test
Expand Down
4 changes: 2 additions & 2 deletions tools/pre-commit-hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ in {
# Testdata for fastcdc.
"nativelink-util/tests/data/SekienAkashita.jpg"

# Buns binary lockfile
"docs/bun.lockb"
# Bun binary lockfile
"web/app/bun.lockb"
];
enable = true;
types = ["binary"];
Expand Down
49 changes: 49 additions & 0 deletions web/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# build output
dist/

# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
bun-debug.log*
bun-error.log*

# tests
test-results

# environment variables
.env
.env.production

# macOS-specific files
.DS_Store

# Generated by wrangler during local development.
.wrangler

# Generated during the build and only intended to debug bundle size.
stats.html

# Deno Deploy file
deno.json

# Astro test route
# src/pages/test.astro

# Generated files
src/content/docs/docs/contribute/docs.mdx
src/content/docs/docs/contribute/guidelines.mdx
src/content/docs/docs/explanations/lre.mdx
src/content/docs/docs/deployment-examples/chromium.mdx
src/content/docs/docs/config/configuration-intro.mdx
src/content/docs/docs/deployment-examples/kubernetes.mdx
src/content/docs/docs/introduction/setup.mdx
src/content/docs/docs/reference/changelog.mdx
src/content/docs/docs/reference/nativelink-config.mdx
File renamed without changes.
38 changes: 19 additions & 19 deletions docs/astro.config.ts → web/app/astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import { defineConfig, passthroughImageService } from "astro/config";

import mdx from "@astrojs/mdx";
import react from "@astrojs/react";
import sitemap from "@astrojs/sitemap";
import starlight from "@astrojs/starlight";
import { qwikReact } from "@builder.io/qwik-react/vite";
import deno from "@deno/astro-adapter";
// import partytown from "@astrojs/partytown";
import qwik from "@qwikdev/astro";
import tailwindcss from "@tailwindcss/vite";

import { rehypeHeadingIds } from "@astrojs/markdown-remark";
import { rehypeMermaid } from "@beoe/rehype-mermaid"; // "rehype-mermaid";
import tailwindcss from "@tailwindcss/vite";
import rehypeAutolinkHeadings from "rehype-autolink-headings";

import { starlightConfig } from "./starlight.conf.ts";
// import { default as playformCompress } from "@playform/compress";

// https://astro.build/config
export default defineConfig({
site: "https://docs.nativelink.com",
trailingSlash: "never",
site: "https://nativelink.com",
output: "hybrid",
image: {
service: passthroughImageService(),
Expand All @@ -25,28 +26,27 @@ export default defineConfig({
port: 8881,
hostname: "localhost",
}),
integrations: [
qwik(),
react({
include: ["**/components/react/**/*"],
}),
starlight(starlightConfig),
// tailwind() // Tailwind 3.x
mdx(),
sitemap(),
],
markdown: {
rehypePlugins: [
rehypeHeadingIds,
[
rehypeAutolinkHeadings,
{
behavior: "wrap",
},
],
[rehypeAutolinkHeadings, { behavior: "wrap" }],
[
rehypeMermaid,
// TODO(aaronmondal): The "@beoe/cache" package doesn't build on
// Cloudflare. Reimplement our own.
{
class: "not-content",
strategy: "img-class-dark-mode",
},
{ class: "not-content", strategy: "img-class-dark-mode" },
],
],
},
vite: {
plugins: [tailwindcss()],
plugins: [tailwindcss(), qwikReact()], // Tailwindcss 4.0.
},
integrations: [sitemap(), starlight(starlightConfig), mdx()],
});
2 changes: 1 addition & 1 deletion docs/biome.json → web/app/biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"javascript": {
"globals": ["Bun"]
"globals": ["Bun", "React", "Timer"]
},
"files": {
"ignore": ["*.astro", "dist", "node_modules"]
Expand Down
Binary file added web/app/bun.lockb
Binary file not shown.
28 changes: 18 additions & 10 deletions docs/deno.lock → web/app/deno.lock

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

Loading

0 comments on commit 40e954c

Please sign in to comment.