Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
export VITE_BRANCH="${WORKERS_CI_BRANCH:-${CF_PAGES_BRANCH:-$(git rev-parse --abbrev-ref HEAD 2>/dev/null)}}"
export VITE_VERSION="${WORKERS_CI_COMMIT_SHA:-${CF_PAGES_COMMIT_SHA:-$(git rev-parse HEAD 2>/dev/null)}}"

# VITE_SITE selects the build flavor (branding/data). It is set per-Worker in
# VITE_CATEGORY selects the build flavor (branding/data). It is set per-Worker in
# the Workers Builds environment variables; default to topology if unset.
export VITE_SITE="${VITE_SITE:-topology}"
echo "Building site '${VITE_SITE}' (branch=${VITE_BRANCH}, version=${VITE_VERSION})"
export VITE_CATEGORY="${VITE_CATEGORY:-topology}"
echo "Building site '${VITE_CATEGORY}' (branch=${VITE_BRANCH}, version=${VITE_VERSION})"

# Workers Builds (and the GitHub workflows) run `pnpm install` before invoking
# this script, so only install when dependencies are actually missing — e.g.
Expand Down
4 changes: 2 additions & 2 deletions bin/e2e
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ fi
function baseUrl() {
case "$1" in
pages | production) echo "https://topology.pi-base.org" ;;
workers) echo "https://pi-base-topology.fragrant-boat-7068.workers.dev" ;;
graphs) echo "https://pi-base-graphs.fragrant-boat-7068.workers.dev" ;;
workers) echo "https://topology.pi-base.workers.dev" ;;
graphs) echo "https://graphs.pi-base.workers.dev" ;;
preview) echo "${PREVIEW_URL:-}" ;;
*) echo "" ;;
esac
Expand Down
18 changes: 12 additions & 6 deletions doc/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

The viewer is migrating from Cloudflare Pages to **Cloudflare Workers** (Static
Assets). Two Workers are produced from this single repo, selected at build time
by the `VITE_SITE` flavor flag (see `packages/viewer/src/site.ts`):
by the `VITE_CATEGORY` flavor flag (see `categoryConfig` in
`packages/viewer/src/constants.ts`; unset defaults to `topology`, unsupported
values fail the build):

| Worker | `VITE_SITE` | wrangler env | Site |
| Worker | `VITE_CATEGORY` | wrangler env | Site |
| ------------------ | ----------- | ------------ | -------------------------- |
| `pi-base-topology` | `topology` | `topology` | `topology.pi-base.org` |
| `pi-base-graphs` | `graphs` | `graphs` | `graphs.pi-base.org` (TBD) |
Expand All @@ -19,7 +21,7 @@ variables Workers Builds injects for branch/commit metadata.

```bash
pnpm --filter core build
VITE_SITE=topology pnpm --filter viewer build
VITE_CATEGORY=topology pnpm --filter viewer build
pnpm --filter viewer run cf:deploy:topology # or cf:deploy:graphs
```

Expand All @@ -30,7 +32,7 @@ Each Worker is connected to this repo through Cloudflare Workers Builds

- **Root directory:** repo root
- **Build command:** `bin/build`
- **Build environment variable:** `VITE_SITE=topology` (or `graphs`)
- **Build environment variable:** `VITE_CATEGORY=topology` (or `graphs`)
- **Deploy command:** `pnpm --filter viewer run cf:deploy:topology` (or `:graphs`)
- **Non-production (preview) deploy command:**
`pnpm --filter viewer run cf:preview:topology` (or `:graphs`)
Expand Down Expand Up @@ -69,5 +71,9 @@ Add a semver tag to trigger the [Publish Images CI step](https://github.com/pi-b

## Data

Changes to the data repo invoke the released [compile action](https://github.com/pi-base/data/blob/6cc73f720751910ad4ede8a320c1eeff975ee5c3/.github/workflows/compile.yml#L12),
and upload the compiled bundles to the `pi-base-bundles` S3 bucket.
Changes to a data repo ([pi-base/data](https://github.com/pi-base/data),
[pi-base/data-graphs](https://github.com/pi-base/data-graphs)) invoke that
repo's compile workflow, which uploads the compiled bundle to the
corresponding category's public R2 bucket — the `bundleHost` values in
`packages/viewer/src/constants.ts`. (`pi-base/data` also uploads to the legacy
`pi-base-bundles` S3 bucket.)
2 changes: 1 addition & 1 deletion packages/viewer/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from 'cypress'

// The account's workers.dev subdomain for the viewer Workers (see
// doc/deployment.md). Used to address the deployed Workers directly.
const WORKERS_SUBDOMAIN = 'fragrant-boat-7068.workers.dev'
const WORKERS_SUBDOMAIN = 'pi-base.workers.dev'

type Mode = 'fixture' | 'live'
type Target = { baseUrl: string; mode: Mode }
Expand Down
2 changes: 2 additions & 0 deletions packages/viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"hast-to-hyperscript": "^10.0.3",
"hyperscript": "^2.0.2",
"jquery": "^3.7.1",
"markdown-it": "^14.2.0",
"rehype-katex": "^6.0.3",
"remark-rehype": "^10.1.0",
"unified": "^10.1.2",
Expand All @@ -53,6 +54,7 @@
"@types/debug": "^4.1.13",
"@types/hyperscript": "0.0.7",
"@types/katex": "^0.16.8",
"@types/markdown-it": "^14.1.2",
"@types/page": "^1.11.9",
"@types/unist": "^2.0.10",
"cypress": "^15.18.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/viewer/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

<meta name="author" content="James Dabbs" />
<meta name="description"
content="A community database of topological theorems and spaces, with powerful search and automated proof deduction." />
content="A community database of mathematical objects, with powerful search and automated proof deduction." />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="π-Base" />
<meta property="og:url" name="twitter:url" content="https://topology.pi-base.org" />
<meta property="og:title" name="twitter:title" content="π-Base" />
<meta property="og:description" name="twitter:description"
content="A community database of topological theorems and spaces, with powerful search and automated proof deduction." />
content="A community database of mathematical objects, with powerful search and automated proof deduction." />
<meta property="og:image" content="%sveltekit.assets%/pi-base.png" />
<meta name="twitter:site" content="π-Base" />
<meta name="twitter:creator" content="@jamesdabbs" />
Expand Down
3 changes: 2 additions & 1 deletion packages/viewer/src/components/Dev/Explore.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import context from '@/context'
import Log from './Log.svelte'
import { reset } from '@/util'
import { categoryConfig } from '@/constants'
import { showLeanLinks, showRedundancy } from '@/stores/settings'

const { spaces, properties, theorems, traits } = context()
Expand All @@ -11,7 +12,7 @@
<table class="table">
<tbody>
<tr>
<th>Spaces</th>
<th>{categoryConfig.objects}</th>
<td>{$spaces.all.length}</td>
</tr>
<tr>
Expand Down
4 changes: 2 additions & 2 deletions packages/viewer/src/components/Dev/Preview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ This is a list of external references:
<code>{'{uid}'}</code>
- e.g.
<code>{'{S1}'}</code>
for space 1
for object 1
<br />
<code>{'{S1|P2}'}</code>
for space 1's value of property 2
for object 1's value of property 2
</td>
</tr>
<tr>
Expand Down
20 changes: 12 additions & 8 deletions packages/viewer/src/components/Footer.svelte
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<script lang="ts">
import { categoryConfig } from '@/constants'
import markdownit from 'markdown-it'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<Typeset body={...}> should do something comparable, but we can take that as a TODO to come back on.

const md = markdownit()
import Sync from './Dev/Sync.svelte'
</script>

<!-- Footer -->
<footer class="text-center bg-light text-muted">
<div class="pt-4">
Data © {new Date().getFullYear()} Steven Clontz and James Dabbs (<a
class="text-dark"
href="https://github.com/pi-base/data/blob/main/LICENSE.md">CC-BY</a
>) | Software © {new Date().getFullYear()} James Dabbs (<a
class="text-dark"
href="https://github.com/pi-base/web/blob/main/LICENSE.md">MIT License</a
>) |
<a class="text-dark" href="https://github.com/pi-base">GitHub</a>
{@html md.renderInline(
categoryConfig.footer(new Date().getFullYear().toString()),
)}
</div>
<div class="p-2">
Data last synchonized: <Sync />
</div>
</footer>

<style>
:global(footer a) {
color: #343a40;
}
</style>
146 changes: 34 additions & 112 deletions packages/viewer/src/components/Home.svelte
Original file line number Diff line number Diff line change
@@ -1,126 +1,48 @@
<script lang="ts">
import Cite from './Shared/Cite.svelte'
import markdownit from 'markdown-it'
const md = markdownit()

import { contributingUrl } from '@/constants'
import { categoryConfig } from '@/constants'
</script>

<div class="wide jumbotron home-jumbotron">
<div class="container">
<h1 class="display-4">π-Base</h1>
<p class="lead">a community database of topological counterexamples</p>
<div class="ml-3 mt-4">
<p>
➜ Search spaces by name/description:
<a href="/spaces?text=compactification" class="text-info"
>compactifications</a
>
</p>
<p>
➜ Search spaces by properties:
<a
href="/spaces?q=compact%20%2B%20connected%20%2B%20t_2%20%2B%20~metrizable"
class="text-info">non-metric continua</a
>
</p>
<p class="mb-0">
➜ Find counterexamples:
<a href="/theorems/T000040" class="text-info"
>connected spaces need not be path connected</a
>
</p>
<h1 class="display-4">π-Base: {categoryConfig.subject}</h1>
<p class="lead">{categoryConfig.slogan}</p>
<div class="ml-3 mt-4 calloutFeatures">
{#each categoryConfig.calloutFeatures as feature}
<p>
➜ {@html md.renderInline(feature)}
</p>
{/each}
</div>
</div>
</div>

<main class="container">
<blockquote class="blockquote text-center mt-5 mb-5">
<p class="mb-0">
Topology is a dense forest of counterexamples. A usable map of the forest
is a fine thing.
</p>
<footer class="blockquote-footer">
Paraphrased from Mary Ellen Rudin's review of
<cite title="Counterexamples in Topology"
>Counterexamples in Topology</cite
>
</footer>
<p class="mt-3">
<small>
Dedicated to the memory of our friend and mentor Gary Gruenhage
(1947-2023).
</small>
</p>
</blockquote>
<hr />
<h3>Contributing</h3>
<p>
π-Base's data and software are open-sourced on <a
href="https://github.com/pi-base/">GitHub</a
>. We rely on
<a href="https://github.com/pi-base/data/graphs/contributors"
>volunteers like yourself</a
>
to <a href={contributingUrl}>contribute</a> new spaces, properties, and theorems.
</p>
<h3>About Us</h3>
<p>
The π-Base was founded in 2014 by its lead maintainer
<a href="https://github.com/jamesdabbs">James Dabbs</a>. π-Base's lead
mathematical editor and contributing research software engineer
<a href="https://clontz.org">Steven Clontz</a>
joined the project in 2017.
</p>
<h3>Community</h3>
<p>
The π-Base is part of the
<a href="https://code4math.org" style="font-family:monospace">code4math</a>
community. Join the conversation on either the
<a href="https://code4math.zulipchat.com/">code4math Zulip</a>
or the
<a href="https://github.com/orgs/pi-base/discussions">
π-Base GitHub Discussion board</a
>.
</p>
<p>
More databases may be discovered at the
<a href="https://mathbases.org/">Index of Mathematical DataBases</a>.
</p>
<h3>Special Acknowledgements</h3>
<p>
Many people have contributed to this project, but a few individuals and
organizations deserve particular recognition:
</p>
<ul>
<li>
Steen and Seebach for writing the inspiration for this project,
<a href="https://en.wikipedia.org/wiki/Counterexamples_in_Topology">
<cite>Counterexamples in Topology</cite></a
>.
</li>
<li>
<a href="http://www.montevallo.edu/staff-bio/scott-varagona/"
>Scott Varagona</a
>
for his heroic work serializing <cite>Counterexamples</cite> into the first
version of the π-Base.
</li>
<li>
Steven and James' graduate advisor,
<a href="http://www.auburn.edu/~gruengf/">Gary Gruenhage</a>, for all his
support and guidance.
</li>
<li>
<a href="http://austinmohr.com/home/">Austin Mohr</a>
for his work and feedback using the π-Base as a pedagogical tool and promoting
us on
<a href="https://math.stackexchange.com">Math.StackExchange</a>.
</li>
<li>
Funding from the <a href="https://www.southalabama.edu/"
>University of South Alabama</a
>
Faculty Development Council from 2017-2018.
</li>
</ul>
{#if categoryConfig.acknowledgement}
<blockquote class="blockquote text-center mt-5 mb-5">
<p class="mb-0">
{categoryConfig.acknowledgement.quote}
</p>
<footer class="blockquote-footer">
{categoryConfig.acknowledgement.footer}
</footer>
<p class="mt-3">
<small>
{categoryConfig.acknowledgement.dedication}
</small>
</p>
</blockquote>
<hr />
{/if}
{@html md.render(categoryConfig.homeContent)}
</main>
<Cite />

<style>
:global(.calloutFeatures a) {
color: #17a2b8;
}
</style>
17 changes: 9 additions & 8 deletions packages/viewer/src/components/Nav.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<script lang="ts">
import context from '@/context'
import { contributingUrl, mainBranch, helpUrl } from '@/constants'
import { site } from '@/site'
import Branch from './Shared/Icons/Branch.svelte'
import { categoryConfig, mainBranch } from '@/constants'
import { Branch } from './Shared/Icons'

const { showDev, source } = context()

Expand All @@ -12,14 +11,16 @@

<nav class="navbar navbar-expand-lg navbar-{bg} bg-{bg}">
<div class="container">
<a class="navbar-brand" href="/">{site.label}</a>
<a class="navbar-brand" href="/">π-Base: {categoryConfig.subject}</a>

<div class="navbar-nav mr-auto">
<a class="nav-link" href="/spaces">Explore</a>
<a class="nav-link" href="/spaces/all">Spaces</a>
<a class="nav-link" href="/spaces/all">{categoryConfig.objects}</a>
<a class="nav-link" href="/properties">Properties</a>
<a class="nav-link" href="/theorems">Theorems</a>
<a class="nav-link" href="/questions">Questions</a>
{#if categoryConfig.showQuestions}<a class="nav-link" href="/questions"
>Questions</a
>{/if}
</div>

<div class="navbar-nav">
Expand All @@ -30,8 +31,8 @@
Advanced
{/if}
</a>
<a class="nav-link" href={contributingUrl}>Contribute</a>
<a class="nav-link" href={helpUrl}>Help</a>
<a class="nav-link" href={categoryConfig.contributingUrl}>Contribute</a>
<a class="nav-link" href={categoryConfig.helpUrl}>Help</a>
</div>
</div>
</nav>
Loading
Loading