Skip to content

Commit a012214

Browse files
committed
github pages site
1 parent dbac8b5 commit a012214

16 files changed

Lines changed: 20967 additions & 6385 deletions

File tree

.github/workflows/pages.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Build Gatsby site for Github Pages
2+
name: GitHub Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["main"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow one concurrent deployment
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: true
22+
23+
jobs:
24+
# Build job
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v6
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v5
32+
- name: Install Dependencies
33+
run: npm install
34+
- name: Build Gatsby Site
35+
run: npm run build
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v4
38+
with:
39+
path: docs/public/
40+
41+
# Deployment job
42+
deploy:
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
runs-on: ubuntu-latest
47+
needs: build
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.github/workflows/test.yml

Lines changed: 59 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -3,65 +3,62 @@ name: Package Tests
33
on: [push, pull_request]
44

55
jobs:
6-
npm:
7-
name: "@wq/${{ matrix.package }}"
8-
runs-on: ubuntu-latest
9-
env:
10-
PACKAGE: ${{ matrix.package }}
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
python-version: ["3.14"]
15-
node-version: [24]
16-
package:
17-
- form-common
18-
- form
19-
- form-web
20-
- form-native
21-
steps:
22-
- uses: actions/checkout@v6
23-
with:
24-
fetch-depth: 0
25-
- name: Set up Node ${{ matrix.node-version }}
26-
uses: actions/setup-node@v6
27-
with:
28-
node-version: ${{ matrix.node-version }}
29-
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v6
31-
with:
32-
python-version: ${{ matrix.python-version }}
33-
- name: Install dependencies
34-
run: |
35-
echo "@wq:registry=https://npm.pkg.github.com/wq" > .npmrc
36-
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
37-
npm ci && npm run build
38-
- name: Install native dependencies
39-
if: matrix.package == 'form-native'
40-
run: |
41-
cd packages/$PACKAGE
42-
echo "@wq:registry=https://npm.pkg.github.com/wq" > .npmrc
43-
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
44-
npm ci
45-
- name: Lint with ESLint
46-
run: npm run lint
47-
- name: Start test server
48-
run: python -m tests.server &
49-
- name: Test with Jest
50-
run: |
51-
cd packages/$PACKAGE
52-
npm run test
53-
- uses: smartsquaregmbh/delete-old-packages@v0.4.0
54-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
55-
with:
56-
keep: 5
57-
names: ${{ matrix.package }}
58-
- name: Publish to Github Packages
59-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
60-
run: |
61-
python -m pip install setuptools_scm
62-
./set_dev_version.sh
63-
echo "registry=https://npm.pkg.github.com/wq" > .npmrc
64-
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
65-
cp .npmrc packages/$PACKAGE/.npmrc # for native builds
66-
cd packages/$PACKAGE
67-
npm publish --tag latest
6+
npm:
7+
name: "@wq/${{ matrix.package }}"
8+
runs-on: ubuntu-latest
9+
env:
10+
PACKAGE: ${{ matrix.package }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: ["3.14"]
15+
node-version: [24]
16+
package:
17+
- form-common
18+
- form
19+
- form-web
20+
- form-native
21+
steps:
22+
- uses: actions/checkout@v6
23+
with:
24+
fetch-depth: 0
25+
- name: Set up Node ${{ matrix.node-version }}
26+
uses: actions/setup-node@v6
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v6
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
- name: Install dependencies
34+
run: npm ci && npm run build
35+
- name: Install native dependencies
36+
if: matrix.package == 'form-native'
37+
run: |
38+
cd packages/$PACKAGE
39+
echo "@wq:registry=https://npm.pkg.github.com/wq" > .npmrc
40+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
41+
- name: Lint with ESLint
42+
run: npm run lint
43+
- name: Start test server
44+
run: python -m tests.server &
45+
- name: Test with Jest
46+
run: |
47+
cd packages/$PACKAGE
48+
npm run test
49+
- uses: actions/delete-package-versions@v5
50+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
51+
with:
52+
package-type: npm
53+
package-name: ${{ matrix.package }}
54+
min-versions-to-keep: 5
55+
- name: Publish to Github Packages
56+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
57+
run: |
58+
python -m pip install setuptools_scm
59+
./set_dev_version.sh
60+
echo "registry=https://npm.pkg.github.com/wq" > .npmrc
61+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
62+
cp .npmrc packages/$PACKAGE/.npmrc # for native builds
63+
cd packages/$PACKAGE
64+
npm publish --tag latest

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.cache/
2+
public

docs/gatsby-config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @type {import('gatsby').GatsbyConfig}
3+
*/
4+
module.exports = {
5+
siteMetadata: {
6+
title: `@wq/form`,
7+
siteUrl: `https://form.wq.io`,
8+
},
9+
plugins: [
10+
"gatsby-plugin-emotion",
11+
"gatsby-plugin-mdx",
12+
{
13+
resolve: "gatsby-source-filesystem",
14+
options: {
15+
name: "pages",
16+
path: "./src/pages/",
17+
},
18+
__key: "pages",
19+
},
20+
],
21+
};

docs/package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "@wq/form-docs",
3+
"version": "0.0.1",
4+
"private": true,
5+
"description": "@wq/form docs",
6+
"author": "S. Andrew Sheppard",
7+
"keywords": [
8+
"gatsby"
9+
],
10+
"scripts": {
11+
"develop": "gatsby develop",
12+
"start": "gatsby develop",
13+
"build": "gatsby build",
14+
"serve": "gatsby serve",
15+
"clean": "gatsby clean"
16+
},
17+
"dependencies": {
18+
"@emotion/react": "^11.14.0",
19+
"@emotion/styled": "^11.14.1",
20+
"@wq/gatsby-components": "^0.1.0",
21+
"@wq/material": "^3.0.0-alpha.0",
22+
"@wq/material-web": "^3.0.0-alpha.0",
23+
"gatsby": "^5.14.6",
24+
"gatsby-plugin-emotion": "^8.15.0",
25+
"gatsby-plugin-mdx": "^5.15.0",
26+
"gatsby-source-filesystem": "^5.15.0",
27+
"react": "^18.2.0",
28+
"react-dom": "^18.2.0"
29+
}
30+
}

docs/src/components/Layout.jsx

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import React from "react";
2+
import {
3+
Root,
4+
Container,
5+
Header,
6+
Main,
7+
Footer,
8+
NavMenuFixed,
9+
} from "@wq/material";
10+
import {
11+
NavMenu,
12+
Content,
13+
usePageTitle,
14+
useNav,
15+
useReverse,
16+
useRouteInfo,
17+
useBreadcrumbs,
18+
} from "@wq/gatsby-components";
19+
import { Link } from "gatsby";
20+
import { Info, Javascript as NpmPackage } from "@mui/icons-material";
21+
import "./styles.css";
22+
23+
const config = {
24+
site_title: "@wq/form",
25+
logo: "https://wq.io/images/icons/wq.svg",
26+
};
27+
28+
const components = {
29+
NavLink: Link,
30+
NavMenu,
31+
useNav,
32+
useReverse,
33+
useRouteInfo,
34+
useBreadcrumbs,
35+
};
36+
37+
const icons = {
38+
Info,
39+
NpmPackage,
40+
};
41+
42+
const overrides = { config, components, icons };
43+
44+
const theme = {
45+
primary: "#7500ae",
46+
secondary: "#0088bd",
47+
};
48+
49+
export default function Layout({ children }) {
50+
return (
51+
<Root wq={overrides} theme={theme}>
52+
<Container>
53+
<Header />
54+
<Main>
55+
<NavMenuFixed />
56+
<Content>{children}</Content>
57+
</Main>
58+
<Footer />
59+
</Container>
60+
</Root>
61+
);
62+
}
63+
64+
export function Head() {
65+
const pageTitle = usePageTitle();
66+
return (
67+
<>
68+
<title>
69+
{pageTitle} - {overrides.config.site_title}
70+
</title>
71+
</>
72+
);
73+
}

docs/src/components/styles.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.MuiAppBar-colorPrimary img {
2+
border-radius: 4px;
3+
padding: 4px;
4+
margin-left: -18px !important;
5+
margin-top: 4px;
6+
margin-bottom: 4px;
7+
background-color: rgba(0, 0, 0, 0.6);
8+
}

docs/src/pages/404.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 404 Not Found
2+
3+
{props.path} was not found.
4+
5+
export { default } from "../components/Layout.jsx";

docs/src/pages/@wq/form-common.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
section: Packages
3+
icon: npm-package
4+
---
5+
6+
# @wq/form-common
7+
8+
WIP
9+
10+
export { default, Head } from "../../components/Layout.jsx";

docs/src/pages/@wq/form-native.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
section: Packages
3+
icon: npm-package
4+
---
5+
6+
# @wq/form-native
7+
8+
WIP
9+
10+
export { default, Head } from "../../components/Layout.jsx";

0 commit comments

Comments
 (0)