Skip to content

Commit

Permalink
Rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
OreQr committed Oct 26, 2024
1 parent e7c8e18 commit 7f73a69
Show file tree
Hide file tree
Showing 140 changed files with 10,752 additions and 676 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches:
- "**"
pull_request:
branches:
- "**"

jobs:
ci:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check formatting
run: pnpm format:check

- name: Check Astro
run: pnpm check
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build

on:
workflow_run:
workflows: ["CI"]
types:
- completed

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }}

name: Publish to retype branch

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build embeds
run: pnpm build:embeds

- uses: retypeapp/action-build@latest

- uses: retypeapp/action-github-pages@latest
with:
update-branch: true
24 changes: 0 additions & 24 deletions .github/workflows/retype-action.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wiki/static/embeds/
embeds/.astro/

pnpm-lock.yaml
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
}
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"editor.wordBasedSuggestions": false
}
"typescript.tsdk": "./embeds/node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"[ignore]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
}
}
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
[![Retype](https://img.shields.io/badge/Retype-white?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzNiIgaGVpZ2h0PSIzMSIgdmlld0JveD0iMCAwIDM2IDMxIj48cGF0aCBkPSJNMCAwdjMxaDIxLjI0VjBIMHptMTcuNDMgMjcuMTlIMy44MlYzLjgxaDEzLjYxdjIzLjM4ek0yNC42OSAzMWgzLjgxVjcuMjRsLTMuODEtMy44MXpNMzEuOTUgMTAuNjhWMzFoMy44MlYxNC40OHoiLz48L3N2Zz4K&link=https://retype.com/)](https://retype.com/)
![Astro](https://img.shields.io/badge/astro-%232C2052.svg?style=for-the-badge&logo=astro&logoColor=white)
[![shadcn/ui](https://img.shields.io/badge/shadcn/ui-black?style=for-the-badge&logo=shadcnui&link=https://ui.shadcn.com/)](https://ui.shadcn.com/)

# wiki
Oficjalna baza wiedzy hostingu Hostyard!

Oficjalna baza wiedzy hostingu Hostyard!
21 changes: 21 additions & 0 deletions embeds/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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

# jetbrains setting folder
.idea/
21 changes: 21 additions & 0 deletions embeds/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @ts-check
import { defineConfig } from "astro/config"

import react from "@astrojs/react"

import tailwind from "@astrojs/tailwind"

// https://astro.build/config
export default defineConfig({
output: "static",
outDir: "../wiki/static/embeds",
build: {
assetsPrefix: "/static/embeds",
},
integrations: [
react(),
tailwind({
applyBaseStyles: false,
}),
],
})
20 changes: 20 additions & 0 deletions embeds/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.mjs",
"css": "src/styles/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
56 changes: 56 additions & 0 deletions embeds/embed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
function createIframe() {
const currentScript = document.currentScript

const parentElement = currentScript.parentNode

const url = "/static/embeds/" + currentScript.getAttribute("embed")

const iframe = document.createElement("iframe")

iframe.style = "width: 100%;"
iframe.src = url

iframe.width = 0
iframe.height = 0

parentElement.appendChild(iframe)

iframe.onload = function () {
updateClasses()
updateIframeSize()

const resizeObserver = new ResizeObserver(() => {
updateIframeSize()
})

resizeObserver.observe(iframe.contentWindow.document.body)
}

function updateIframeSize() {
iframe.width = iframe.contentWindow.document.body.scrollWidth
iframe.height = iframe.contentWindow.document.body.scrollHeight
}

function updateClasses() {
const classes = document.documentElement.className
.replace("no-transitions", "transition-none")
.split(" ")
.slice(1)

const iframeDocument =
iframe.contentDocument.documentElement ||
iframe.contentWindow.document.documentElement

iframeDocument.className = classes
}

const observer = new MutationObserver(([mutation]) => {
if (mutation.attributeName === "class") {
updateClasses()
}
})

observer.observe(document.documentElement, { attributes: true })
}

createIframe()
37 changes: 37 additions & 0 deletions embeds/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "embeds",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"dev:embed": "esbuild ./embed.js --outfile=../wiki/static/embeds/embed.js --watch",
"build:embed": "esbuild ./embed.js --minify --outfile=../wiki/static/embeds/embed.js",
"build": "astro build && pnpm build:embed",
"check": "astro check"
},
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/react": "^3.6.2",
"@astrojs/tailwind": "^5.1.2",
"@fontsource-variable/inter": "^5.1.0",
"@hookform/resolvers": "^3.9.0",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"astro": "^4.16.7",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"esbuild": "^0.24.0",
"ky": "^1.7.2",
"lucide-react": "^0.453.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.53.1",
"tailwind-merge": "^2.5.4",
"tailwindcss": "^3.4.14",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.6.3",
"zod": "^3.23.8"
}
}
Loading

0 comments on commit 7f73a69

Please sign in to comment.