From c39fd67448335108535d169865c21ad0c336ad2c Mon Sep 17 00:00:00 2001
From: Jacob Pake
Date: Wed, 16 Sep 2026 10:20:09 +0100
Subject: [PATCH 1/2] anonymous: option to anonymise the build with env
variable
---
.gitignore | 2 ++
package.json | 7 +++++--
src/app.html | 5 -----
src/env.ts | 14 +++++++++++++
src/lib/config/anon.ts | 20 +++++++++++++++++++
src/routes/+layout.server.ts | 8 ++++++++
src/routes/+layout.svelte | 26 ++++++++++++++++--------
src/routes/+page.svelte | 38 ++++++++++++++++--------------------
svelte.config.js | 3 +++
yarn.lock | 18 ++++++++++++-----
10 files changed, 100 insertions(+), 41 deletions(-)
create mode 100644 src/env.ts
create mode 100644 src/lib/config/anon.ts
create mode 100644 src/routes/+layout.server.ts
diff --git a/.gitignore b/.gitignore
index 76a65fc..0877746 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,5 @@ node_modules/
/build/
/.svelte-kit/
/.yarn/install-state.gz
+.env
+.env.local
diff --git a/package.json b/package.json
index 8c7c32a..9f111ac 100644
--- a/package.json
+++ b/package.json
@@ -15,7 +15,7 @@
"devDependencies": {
"@eslint/js": "^10.0.1",
"@sveltejs/adapter-static": "^3.0.10",
- "@sveltejs/kit": "^2.49.1",
+ "@sveltejs/kit": "^2.70.3",
"@sveltejs/vite-plugin-svelte": "^6.2.1",
"@types/node": "^24",
"eslint": "^10.4.1",
@@ -30,5 +30,8 @@
"typescript-eslint": "^8.60.1",
"vite": "^7.2.6"
},
- "packageManager": "yarn@4.17.0"
+ "packageManager": "yarn@4.17.0",
+ "dependencies": {
+ "zod": "^4.5.4"
+ }
}
diff --git a/src/app.html b/src/app.html
index 83057d1..adf8bd8 100644
--- a/src/app.html
+++ b/src/app.html
@@ -2,12 +2,7 @@
-
-
%sveltekit.head%
diff --git a/src/env.ts b/src/env.ts
new file mode 100644
index 0000000..063274b
--- /dev/null
+++ b/src/env.ts
@@ -0,0 +1,14 @@
+import { defineEnvVars } from "@sveltejs/kit/env";
+
+import { z } from "zod";
+
+export const variables = defineEnvVars({
+ ANONYMOUS: {
+ public: false, // this should only be used serverside to ensure no leakage
+ static: true,
+ schema: z
+ .string()
+ .optional()
+ .transform((x) => x === "true"),
+ },
+});
diff --git a/src/lib/config/anon.ts b/src/lib/config/anon.ts
new file mode 100644
index 0000000..10d7b9b
--- /dev/null
+++ b/src/lib/config/anon.ts
@@ -0,0 +1,20 @@
+import logo from "$lib/assets/image/logo.png";
+
+export const public_config = {
+ name: "PurePy",
+ logo: logo,
+ github: "https://github.com/pure-py/pure-py-spec",
+ spec: "https://github.com/pure-py/pure-py-spec/releases/latest",
+ favicon: "/favicon.png",
+} as const;
+
+const NO_LOGO =
+ "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
+
+export const anon_config = {
+ name: "This Project",
+ logo: NO_LOGO,
+ github: "https://github.com",
+ spec: "https://github.com", // we need an anoymous spec
+ favicon: NO_LOGO,
+};
diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts
new file mode 100644
index 0000000..643abfe
--- /dev/null
+++ b/src/routes/+layout.server.ts
@@ -0,0 +1,8 @@
+import * as env from "$app/env/private";
+import { anon_config, public_config } from "$lib/config/anon";
+
+export const load = () => {
+ return {
+ config: env.ANONYMOUS ? anon_config : public_config,
+ };
+};
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 000451c..bc93241 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -1,14 +1,25 @@
+
+ {data.config.name}
+
+
+
+
+
Overview
- PurePy defines a pure, side-effect-free subset of Python. It is aimed
- initially at researchers in programming languages and pedagogy, and is
- intended to grow into a common language for scientific computing, supporting
- portable applications in modelling, data processing, analysis, and
- visualisation.
+ {data.config.name} defines a pure, side-effect-free subset of Python. It is aimed
+ initially at researchers in programming languages and pedagogy, and is intended
+ to grow into a common language for scientific computing, supporting portable applications
+ in modelling, data processing, analysis, and visualisation.
The standard defines a versioned formal grammar, a formal semantics, and a
- reference checker. Every compliant implementation accepts any valid PurePy
+ reference checker. Every compliant implementation accepts any valid {data
+ .config.name}
program and behaves according to the formal semantics.
@@ -75,7 +71,7 @@
- Why PurePy
+ Why {data.config.name}
Pure & functional
@@ -84,8 +80,8 @@
Pythonic
- A strict subset of Python: every valid PurePy program is valid Python,
- and runs with exactly the same runtime behaviour.
+ A strict subset of Python: every valid {data.config.name} program is valid
+ Python, and runs with exactly the same runtime behaviour.
diff --git a/svelte.config.js b/svelte.config.js
index 0f5c616..c22b6b2 100644
--- a/svelte.config.js
+++ b/svelte.config.js
@@ -8,6 +8,9 @@ const config = {
kit: {
adapter: adapter(),
paths: { base: process.env.BASE_PATH ?? "" },
+ experimental: {
+ explicitEnvironmentVariables: true,
+ },
},
};
diff --git a/yarn.lock b/yarn.lock
index dca22d9..d6858f1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -564,9 +564,9 @@ __metadata:
languageName: node
linkType: hard
-"@sveltejs/kit@npm:^2.49.1":
- version: 2.66.0
- resolution: "@sveltejs/kit@npm:2.66.0"
+"@sveltejs/kit@npm:^2.70.3":
+ version: 2.70.3
+ resolution: "@sveltejs/kit@npm:2.70.3"
dependencies:
"@standard-schema/spec": "npm:^1.0.0"
"@sveltejs/acorn-typescript": "npm:^1.0.9"
@@ -593,7 +593,7 @@ __metadata:
optional: true
bin:
svelte-kit: svelte-kit.js
- checksum: 10c0/c90f595b7ac67aecc70c7eb737b4dc0df2063ee7bbaa796eff53c9cdd7719baf00b5f5d472d9bb0f202044f7f3cfecea91589c2448088c8fbf11613db17da226
+ checksum: 10c0/af0888aa65bfe71ed18fb1450449de4be8096a910536eb3a2695b013c18b9a1b0efe7efc5dc2b1f52f4ff990bc8ea4471c365010d5cf5eb4e76bd5d5d91b1a84
languageName: node
linkType: hard
@@ -1797,7 +1797,7 @@ __metadata:
dependencies:
"@eslint/js": "npm:^10.0.1"
"@sveltejs/adapter-static": "npm:^3.0.10"
- "@sveltejs/kit": "npm:^2.49.1"
+ "@sveltejs/kit": "npm:^2.70.3"
"@sveltejs/vite-plugin-svelte": "npm:^6.2.1"
"@types/node": "npm:^24"
eslint: "npm:^10.4.1"
@@ -1811,6 +1811,7 @@ __metadata:
typescript: "npm:^5.9.3"
typescript-eslint: "npm:^8.60.1"
vite: "npm:^7.2.6"
+ zod: "npm:^4.5.4"
languageName: unknown
linkType: soft
@@ -2269,3 +2270,10 @@ __metadata:
checksum: 10c0/9470cbf22cefae975ab413c7158a119d082b354ddcf0da48a842f2f42246fa15943cd9b92c047de39db38015e3b866e32f383bc217e8e4f4192945c7d425536b
languageName: node
linkType: hard
+
+"zod@npm:^4.5.4":
+ version: 4.5.4
+ resolution: "zod@npm:4.5.4"
+ checksum: 10c0/511a2a4d1a6f875dfdd70a1586989a8b14ef126776cd6218a2c760b9f65f14ef389ec20d92ee1aa4fcb4566d4ff3fa012956044f9dc503510d82e4c756a8ba92
+ languageName: node
+ linkType: hard
From cac9f3937a4ea78f9e51c8f5b21be8b8f704a32f Mon Sep 17 00:00:00 2001
From: Jacob Pake
Date: Wed, 16 Sep 2026 10:21:16 +0100
Subject: [PATCH 2/2] prefer dev dependencies
---
package.json | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index 9f111ac..29cef56 100644
--- a/package.json
+++ b/package.json
@@ -28,10 +28,8 @@
"svelte-check": "^4.3.4",
"typescript": "^5.9.3",
"typescript-eslint": "^8.60.1",
- "vite": "^7.2.6"
- },
- "packageManager": "yarn@4.17.0",
- "dependencies": {
+ "vite": "^7.2.6",
"zod": "^4.5.4"
- }
+ },
+ "packageManager": "yarn@4.17.0"
}