[Shock][CLI][Docs] - Load themes from git repositories (Resolves #213)#214
Draft
matthew-carroll wants to merge 1 commit intomainfrom
Draft
[Shock][CLI][Docs] - Load themes from git repositories (Resolves #213)#214matthew-carroll wants to merge 1 commit intomainfrom
matthew-carroll wants to merge 1 commit intomainfrom
Conversation
matthew-carroll
commented
Aug 2, 2025
| componentContent.content ?? componentContent.value, | ||
| ), | ||
| ); | ||
| final sourceSets = {_sourceFiles, ..._sourceExtensions}; |
Collaborator
Author
There was a problem hiding this comment.
These should be ordered from extensions to source files so source files can overwrite extensions. We already do this in _pickAllSourceFiles(). We should probably create a central method that returns all source sets in that priority order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Shock][CLI][Docs] - Load themes from git repositories (Resolves #213)
Git theme specification
A git theme is specified by a URL, and an optional path within the repository.
The path is important because it's very likely that a theme will be stored in a subdirectory so that it doesn't include things like the
.gitignorefile at the root. That said, a website could always use anExcluderto keep files like.gitignoreout of the pipeline.Git theme implementation
Based on initial research, it looks like Git doesn't support any standard repository directory traversal. My hope was that we could navigate the repo over HTTP and only pull down what's picked, but Git doesn't support that.
Instead, we clone the entire theme repository, but we tell git to only bring down the content at the given
path. This should avoid excessive clone size for things like mono-repos.The theme repo is cloned to the a new root level
.shock/build/build cache directory. It's contents are added as a source set so that its files can be picked, like the regular source set.Infrastructure changes
.shockdirectory at the root of the project structure. I couldn't place it in/buildbecause that directory is cleared on every build, and also it's meant to be directly deployable. I also didn't want to place it in/sourcebecause it isn't actually source./source/.shock/is no longer git ignored. We commit it so that things like screenshots don't need to be regenerated in CI, or over time, if not desired.FileRelativePaths toSourceFiles because we no longer know that every file exists relative to the primary source directory.