Skip to content

Commit

Permalink
Introduce nativelink web platform including docs & website
Browse files Browse the repository at this point in the history
Made with astro & qwik
  • Loading branch information
SchahinRohani committed Sep 10, 2024
1 parent cbb5835 commit e64b176
Show file tree
Hide file tree
Showing 116 changed files with 4,559 additions and 140 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
48 changes: 23 additions & 25 deletions .github/workflows/docs.yaml → .github/workflows/web.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: Deploy NativeLink Docs
name: Deploy NativeLink Web
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'web/platform/**'
- '**/*.md'
- 'nativelink-config/**'
- 'tools/**'
Expand All @@ -13,7 +13,7 @@ on:
pull_request:
branches: [main]
paths:
- 'docs/**'
- 'web/platform/**'
- '**/*.md'
- 'nativelink-config/**'
- 'tools/**'
Expand All @@ -29,7 +29,7 @@ jobs:
matrix:
os: [ ubuntu-24.04, macos-14 ]

name: Docs Deployment / ${{ matrix.os }}
name: Web Platform Deployment / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
environment: production

Expand All @@ -42,22 +42,6 @@ jobs:
uses: >- # v4.1.1
actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Install Nix
uses: >- # v10
DeterminateSystems/nix-installer-action@de22e16c4711fca50c816cc9081563429d1cf563
- name: Cache Nix derivations
uses: >- # v4
DeterminateSystems/magic-nix-cache-action@fc6aaceb40b9845a02b91e059ec147e78d1b4e41
- name: Test Build on Ubuntu
if: matrix.os == 'ubuntu-24.04' && github.event_name == 'pull_request'
working-directory: docs
run: |
nix develop --impure --command bash -c "
bun setup && bun docs && bun run build
"
- name: Free disk space
uses: >- # v2.0.0
endersonmenezes/free-disk-space@3f9ec39ebae520864ac93467ee395f5237585c21
Expand All @@ -77,18 +61,32 @@ jobs:
echo "Deleting iOS Simulator caches"
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
- name: Install Nix
uses: >- # v10
DeterminateSystems/nix-installer-action@de22e16c4711fca50c816cc9081563429d1cf563
- name: Cache Nix derivations
uses: >- # v4
DeterminateSystems/magic-nix-cache-action@fc6aaceb40b9845a02b91e059ec147e78d1b4e41
- name: Test Build on Ubuntu
if: matrix.os == 'ubuntu-24.04' && github.event_name == 'pull_request'
working-directory: web/platform
run: |
nix develop --impure --command bash -c "
bun setup && bun docs && bun run build
"
- name: Test Build on macOS
if: matrix.os == 'macos-14' && github.event_name == 'pull_request'
working-directory: docs
working-directory: web/platform
run: |
nix develop --impure --command bash -c "bun setup && bun run build"
- name: Production deployment
if: matrix.os == 'ubuntu-24.04' && github.ref == 'refs/heads/main'
working-directory: docs
env:
DENO_DEPLOY_TOKEN: ${{ secrets.DENO_DEPLOY_TOKEN }}
working-directory: web/platform
run: |
nix develop --impure --command bash -c "
bun prod --project=nativelink-docs --org=nativelink --token=$DENO_DEPLOY_TOKEN
bun prod --project=nativelink --org=nativelink --token=$DENO_DEPLOY_TOKEN
"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div id="logo" align="center">
<a href="https://www.nativelink.com">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/src/assets/logo-dark.svg" />
<source media="(prefers-color-scheme: light)" srcset="docs/src/assets/logo-light.svg" />
<img alt="NativeLink" src="docs/src/assets/logo-light.svg" width="376" height="100" />
<source media="(prefers-color-scheme: dark)" srcset="web/plattform/src/assets/logo-dark.svg" />
<source media="(prefers-color-scheme: light)" srcset="web/plattform/src/assets/logo-light.svg" />
<img alt="NativeLink" src="web/plattform/src/assets/logo-light.svg" width="376" height="100" />
</picture>
</a>

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

This file was deleted.

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

This file was deleted.

10 changes: 0 additions & 10 deletions docs/tsconfig.json

This file was deleted.

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/platform/bun.lockb"
];
enable = true;
types = ["binary"];
Expand Down
18 changes: 9 additions & 9 deletions docs/.gitignore → web/platform/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ stats.html
deno.json

# Generated files
src/content/docs/contribute/docs.mdx
src/content/docs/contribute/guidelines.mdx
src/content/docs/explanations/lre.mdx
src/content/docs/deployment-examples/chromium.mdx
src/content/docs/config/configuration-intro.mdx
src/content/docs/deployment-examples/kubernetes.mdx
src/content/docs/introduction/setup.mdx
src/content/docs/reference/changelog.mdx
src/content/docs/reference/nativelink-config.mdx
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.
33 changes: 24 additions & 9 deletions docs/astro.config.ts → web/platform/astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import { defineConfig, passthroughImageService } from "astro/config";

import mdx from "@astrojs/mdx";
import { rehypeHeadingIds } from "@astrojs/markdown-remark";
// import mdx from "@astrojs/mdx";
import react from "@astrojs/react";
import sitemap from "@astrojs/sitemap";
import starlight from "@astrojs/starlight";

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

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

import { starlightConfig } from "./starlight.conf";

// import Biome from "@playform/format";

// 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,6 +30,19 @@ export default defineConfig({
port: 8881,
hostname: "localhost",
}),
integrations: [
qwik({
include: ["**/components/qwik/**/*"],
}),
react({
include: ["**/components/react/*"],
}),
starlight(starlightConfig),
// tailwind() // Tailwind 3.x
// mdx(), // Works also without...
sitemap(),
// Biome({}), // Linting and formatting for the generated build.
],
markdown: {
rehypePlugins: [
rehypeHeadingIds,
Expand All @@ -36,8 +54,6 @@ export default defineConfig({
],
[
rehypeMermaid,
// TODO(aaronmondal): The "@beoe/cache" package doesn't build on
// Cloudflare. Reimplement our own.
{
class: "not-content",
strategy: "img-class-dark-mode",
Expand All @@ -46,7 +62,6 @@ export default defineConfig({
],
},
vite: {
plugins: [tailwindcss()],
plugins: [qwikReact(), tailwindcss()], // Tailwindcss 4.0.
},
integrations: [sitemap(), starlight(starlightConfig), mdx()],
});
2 changes: 1 addition & 1 deletion docs/biome.json → web/platform/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/platform/bun.lockb
Binary file not shown.
37 changes: 27 additions & 10 deletions docs/deno.lock → web/platform/deno.lock

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

Loading

0 comments on commit e64b176

Please sign in to comment.