Skip to content

Add option to anonymise the build with env variable - #13

Open
jacobpake wants to merge 2 commits into
mainfrom
anonymise-build-option
Open

jacobpake wants to merge 2 commits into
mainfrom
anonymise-build-option

Conversation

@jacobpake

Copy link
Copy Markdown
Contributor

Supports an ANONYMOUS=true environment variable at build time to produce a website with any identifying features removed

@antstei
antstei self-requested a review September 16, 2026 11:15
@antstei

antstei commented Sep 16, 2026

Copy link
Copy Markdown
Member

Thanks, @jacobpake!

We could also update package.json to support anonymous development and builds:

{
  "scripts": {
    "dev:anonymous": "cross-env ANONYMOUS=true vite dev",
    "build:anonymous": "cross-env ANONYMOUS=true vite build"
  }
}

This requires adding cross-env to devDependencies.

Additionally, we should update README.md to document the new anonymous development and build commands.

Comment thread src/lib/config/anon.ts
Comment on lines +3 to +20
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,
};

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.

Could we define a shared SiteConfig type and use satisfies SiteConfig for both configuration objects, public_config and anon_config?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is there any benefit in doing that?

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.

I’d argue it gives us compile-time shape validation and safer refactors, all while preserving exact literal types—so I see it as a nice-to-have for safety and maintainability.

@jacobpake

Copy link
Copy Markdown
Contributor Author

Thanks, @jacobpake!

We could also update package.json to support anonymous development and builds:

{
  "scripts": {
    "dev:anonymous": "cross-env ANONYMOUS=true vite dev",
    "build:anonymous": "cross-env ANONYMOUS=true vite build"
  }
}

This requires adding cross-env to devDependencies.

Is there a benefit in doing this vs just setting the environment variable? Is it worth the dependency?

@antstei

antstei commented Sep 16, 2026

Copy link
Copy Markdown
Member

Is there a benefit in doing this vs just setting the environment variable? Is it worth the dependency?

Adding cross-env is worth it if any of us develops on Windows or plans to. So for now, I think we can skip it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants