This example shows how a committed .struct.yaml can define its own named source and then reference structs from that source.
The example uses a local source so it works offline:
sources:
platform:
path: examples/versioned-sources/structuresIn a real shared-struct repository, pin the source to a tag or commit SHA instead:
sources:
platform:
url: github://httpdss/platform-structures@v1.2.0/structuresor, for branch names that contain slashes:
sources:
platform:
url: github://httpdss/platform-structures/structures?ref=release/1.xplatform/app/baseresolves through the file-localplatformsource.app/base.yamlreferencesapp/ciwithout a source prefix.- The nested
app/cireference inherits the sameplatformsource context. - A future change to the user's global
structkit sourcesconfig will not affect this.struct.yamlfile.
From the StructKit repository root:
structkit generate examples/versioned-sources/.struct.yaml /tmp/structkit-versioned-sources-demoExpected generated files:
/tmp/structkit-versioned-sources-demo/README.md
/tmp/structkit-versioned-sources-demo/pyproject.toml
/tmp/structkit-versioned-sources-demo/.github/workflows/ci.yml
Preview without writing files:
structkit generate examples/versioned-sources/.struct.yaml /tmp/structkit-versioned-sources-demo --dry-run --diff