-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from x0k/packages
Packages
- Loading branch information
Showing
132 changed files
with
9,035 additions
and
5,394 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
pull-requests: write | ||
pages: write | ||
|
||
jobs: | ||
version: | ||
timeout-minutes: 15 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Cache turbo build setup | ||
uses: actions/cache@v4 | ||
with: | ||
path: .turbo | ||
key: ${{ runner.os }}-turbo-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-turbo- | ||
- name: Build | ||
run: pnpm run ci:build | ||
|
||
- name: create and publish versions | ||
uses: changesets/action@v1 | ||
with: | ||
version: pnpm ci:version | ||
publish: pnpm exec changeset publish | ||
commit: "[ci] release" | ||
title: "[ci] release" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Merge apps build outputs | ||
run: mv apps/docs/dist apps/web/dist/docs | ||
|
||
- name: Upload Pages Artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: "apps/web/dist/" | ||
|
||
deploy: | ||
needs: version | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
.direnv/ | ||
|
||
node_modules | ||
|
||
.turbo | ||
|
||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# build output | ||
dist/ | ||
# generated types | ||
.astro/ | ||
|
||
# dependencies | ||
node_modules/ | ||
|
||
# logs | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
|
||
# environment variables | ||
.env | ||
.env.production | ||
|
||
# macOS-specific files | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// @ts-check | ||
import { fileURLToPath } from 'node:url' | ||
import { defineConfig } from "astro/config"; | ||
import starlight from "@astrojs/starlight"; | ||
import svelte from "@astrojs/svelte"; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
site: "https://x0k.github.io", | ||
base: "/json-table/docs/", | ||
trailingSlash: "always", | ||
i18n: { | ||
defaultLocale: "en", | ||
locales: ["en"], | ||
}, | ||
integrations: [ | ||
svelte(), | ||
starlight({ | ||
title: "JSON Table", | ||
social: { | ||
github: "https://github.com/x0k/json-table", | ||
}, | ||
sidebar: [ | ||
// { | ||
// label: "Guides", | ||
// autogenerate: { directory: "guides" }, | ||
// }, | ||
], | ||
components: { | ||
Head: "./src/components/custom-head.astro", | ||
Header: "./src/components/header-with-links.astro", | ||
}, | ||
}), | ||
], | ||
vite: { | ||
resolve: { | ||
alias: { | ||
"@": fileURLToPath(new URL("./src", import.meta.url)), | ||
}, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "docs", | ||
"private": true, | ||
"type": "module", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"dev": "astro dev", | ||
"build": " astro build", | ||
"preview": "astro preview", | ||
"check": "astro check" | ||
}, | ||
"devDependencies": { | ||
"@astrojs/check": "^0.9.4", | ||
"@astrojs/starlight": "^0.28.3", | ||
"@astrojs/svelte": "^5.7.2", | ||
"astro": "^4.16.6", | ||
"astro-vtbot": "^1.10.3", | ||
"sharp": "^0.33.5", | ||
"starlight-package-managers": "^0.7.0", | ||
"svelte": "^5.1.0" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
type DarkOrLight = "light" | "dark"; | ||
type Theme = "auto" | DarkOrLight; | ||
|
||
const STORAGE_KEY = "starlight-theme"; | ||
|
||
const parseTheme = (theme: unknown): Theme => | ||
theme === "auto" || theme === "dark" || theme === "light" ? theme : "auto"; | ||
|
||
const loadTheme = (): Theme => | ||
parseTheme( | ||
typeof localStorage !== "undefined" && localStorage.getItem(STORAGE_KEY) | ||
); | ||
|
||
const getPreferredColorScheme = (): DarkOrLight => | ||
matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark"; | ||
|
||
export function theme() { | ||
let theme = $state(loadTheme()); | ||
|
||
$effect(() => { | ||
const starlightThemeSelect = document | ||
.getElementsByTagName("starlight-theme-select") | ||
.item(0); | ||
if (starlightThemeSelect === null) { | ||
return; | ||
} | ||
const themeSelect = starlightThemeSelect | ||
.getElementsByTagName("select") | ||
.item(0); | ||
if (themeSelect === null) { | ||
return; | ||
} | ||
const updateTheme = (e: Event) => { | ||
if (!(e.currentTarget instanceof HTMLSelectElement)) { | ||
return; | ||
} | ||
theme = parseTheme(e.currentTarget.value); | ||
}; | ||
themeSelect.addEventListener("change", updateTheme); | ||
return () => themeSelect.removeEventListener("change", updateTheme); | ||
}); | ||
|
||
const darkOrLight = $derived( | ||
theme === "auto" ? getPreferredColorScheme() : theme | ||
); | ||
|
||
return { | ||
get theme() { | ||
return theme; | ||
}, | ||
get darkOrLight() { | ||
return darkOrLight; | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
import type { Props } from "@astrojs/starlight/props"; | ||
import StarlightHead from "@astrojs/starlight/components/Head.astro"; | ||
import VtbotStarlight from "astro-vtbot/components/starlight/Base.astro"; | ||
import PageOffset from "astro-vtbot/components/PageOffset.astro"; | ||
--- | ||
|
||
<VtbotStarlight {...Astro.props} transition:animate="fade"> | ||
<StarlightHead {...Astro.props}><slot /></StarlightHead> | ||
</VtbotStarlight> | ||
<PageOffset name="main" /> |
Oops, something went wrong.