Install dependencies and build everything:
rush install
rush buildTo build a single project:
cd examples/webpart-minimal
rushx buildcd tests/spfx-template-test
rushx buildThis repo uses explicit Rush phases defined in common/config/rush/command-line.json:
_phase:build_phase:test_phase:package-solution
Script expectations by project type:
- All Rush projects should define a
_phase:buildpackage.jsonscript. - SPFx solution projects should also define
_phase:package-solution. - Non-SPFx projects (for example, API/tooling packages) should not add
_phase:package-solution. - Projects with tests should define
_phase:test.
When a template is scaffolded in non-CI mode, these scripts will be stripped out.
For projects where a phase does not apply but is still expected, use an empty script ("") as an explicit no-op.
The test suite uses a golden-master snapshot approach:
- For each template, the test scaffolds a project using
spfx createinto a temp directory (common/temp/examples/<template-name>/). - It compares the scaffolded output file-by-file against the committed example in
examples/<template-name>/. - Binary files (images, fonts) and build artifacts are excluded from comparison. Line endings are normalized.
- If any file differs — or a file is missing/extra — the test fails.
This means the examples/ directories are the source of truth. Any template change that alters output will be caught automatically.
The test suite has an update mode that scaffolds templates directly into examples/ instead of a temp directory. It is triggered by --update or -u in process.argv, but this flag does not currently propagate through heft/Jest workers. A fix is tracked separately.
In the meantime, if you change a template and need to regenerate examples, use the CLI directly to re-scaffold into the example directory, then verify with a test run.
Change files are only required when modifying published packages:
@microsoft/spfx-cli(apps/spfx-cli/)@microsoft/spfx-template-api(api/spfx-template-api/)
To create one:
rush change| Type | Use for |
|---|---|
none |
Dev dependency or config-only changes |
patch |
Bug fixes |
minor |
New features |
Do not use major — this project is pre-1.0 so the maximum bump is minor.