Skip to content

feat: template creation in the admin menu - #118

Merged
robsimmons merged 12 commits into
manage-toolchainfrom
push-nzvyknulwqyt
Sep 9, 2026
Merged

feat: template creation in the admin menu#118
robsimmons merged 12 commits into
manage-toolchainfrom
push-nzvyknulwqyt

Conversation

@robsimmons

@robsimmons robsimmons commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

This PR makes it possible to create templates in the admin menu. Addresses (but does not close) #21. After selecting an installed toolchain, the interface will let you select:

  • A "Basic Lean" template, similar to the seed script's "hello" template
  • A "Mathlib template", identical (or nearly identical) to the seed script's mathlib template
  • A "CSLib template", like the mathlib tempate but for cslib

The Mathlib and CSLib options will only be presented for standard release toolchains (no nightly-testing) where we've checked that the tag corresponds to a valid Mathlib/CSLib (respectively) tag. This is done with the GitHub API, and uses the higher 5000-requests-an-hour rate limit by authorizing with the configured GitHub OAuth App.

image

@robsimmons
robsimmons marked this pull request as draft September 3, 2026 02:10
@robsimmons
robsimmons changed the base branch from main to manage-toolchain September 3, 2026 02:12
@robsimmons
robsimmons force-pushed the push-nzvyknulwqyt branch 2 times, most recently from d4732a5 to 152ee64 Compare September 3, 2026 15:44
@robsimmons
robsimmons force-pushed the push-nzvyknulwqyt branch 2 times, most recently from c60ea13 to 4562ad7 Compare September 3, 2026 17:08
@robsimmons
robsimmons marked this pull request as ready for review September 3, 2026 17:21
@robsimmons
robsimmons force-pushed the push-nzvyknulwqyt branch 2 times, most recently from 87ed48c to d86830d Compare September 5, 2026 02:09
@robsimmons
robsimmons force-pushed the push-nzvyknulwqyt branch 2 times, most recently from 40d0869 to 33c65f0 Compare September 5, 2026 17:02
@robsimmons
robsimmons force-pushed the push-nzvyknulwqyt branch 2 times, most recently from d5d1b3c to d6a3d84 Compare September 6, 2026 12:46
@robsimmons
robsimmons requested a review from jcreedcmu September 7, 2026 13:21
Comment thread src/app/admin/components/TemplateManagement.tsx Outdated
Comment thread src/lib/server/projectTemplate.ts
Comment thread src/lib/server/projectTemplate.ts Outdated

@jcreedcmu jcreedcmu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it the case that seed-volume.sh makes package-sets/mathlib-$LEAN_VERSION e.g. mathlib-v4.32.0 and yet create-tagged-lib.sh makes package-sets/mathlib-${LEAN_VERSION//./-} e.g. mathlib-v4-32-0? Seems like it would be better to be consistent. (I think the template name always has dashes in either path)

@jcreedcmu

Copy link
Copy Markdown
Collaborator

Also: totally optional but I think I would add like padding: 0.5em to the <select> tags that hold "Installed Toolchain" and "Template Schema".

@robsimmons

Copy link
Copy Markdown
Collaborator Author

Is it the case that seed-volume.sh makes package-sets/mathlib-$LEAN_VERSION e.g. mathlib-v4.32.0 and yet create-tagged-lib.sh makes package-sets/mathlib-${LEAN_VERSION//./-} e.g. mathlib-v4-32-0? Seems like it would be better to be consistent. (I think the template name always has dashes in either path)

It would be better to be consistent - but it might be better to be consistent between package-sets and templates, leave this PR's behavior alone, and let the seed-volume.sh behavior go away anyway in #121. Do you agree?

@jcreedcmu

Copy link
Copy Markdown
Collaborator

Is it the case that seed-volume.sh makes package-sets/mathlib-$LEAN_VERSION e.g. mathlib-v4.32.0 and yet create-tagged-lib.sh makes package-sets/mathlib-${LEAN_VERSION//./-} e.g. mathlib-v4-32-0? Seems like it would be better to be consistent. (I think the template name always has dashes in either path)

It would be better to be consistent - but it might be better to be consistent between package-sets and templates, leave this PR's behavior alone, and let the seed-volume.sh behavior go away anyway in #121. Do you agree?

ah, if #121 obviates this, then my concern is moot. Thanks for explaining.

@jcreedcmu jcreedcmu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved now given changes you are planning.

@robsimmons
robsimmons merged commit ec58f7a into main Sep 9, 2026
1 check passed
@robsimmons
robsimmons deleted the push-nzvyknulwqyt branch September 9, 2026 19:00
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