Skip to content

feat(render): Render files into subdirectories#88

Open
dmcilvaney wants to merge 1 commit intomicrosoft:mainfrom
dmcilvaney:damcilva/rendered-spec-output-subdirs
Open

feat(render): Render files into subdirectories#88
dmcilvaney wants to merge 1 commit intomicrosoft:mainfrom
dmcilvaney:damcilva/rendered-spec-output-subdirs

Conversation

@dmcilvaney
Copy link
Copy Markdown
Contributor

Place rendered components into subdirs. i.e., aaa goes into ./specs/a/aaa, BBB goes into ./specs/b/BBB.

Copilot AI review requested due to automatic review settings April 9, 2026 21:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a per-component rendered spec output directory convention (grouped by the lowercase first letter of the component name) and surfaces that directory on resolved component configs.

Changes:

  • Added RenderedSpecDir to projectconfig.ComponentConfig and populate it during component resolution.
  • Introduced components.RenderedSpecDir(renderedSpecsDir, componentName) helper + unit tests.
  • Removed samber/lo usage in component list and expanded tests to cover RenderedSpecDir.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/projectconfig/component.go Adds derived RenderedSpecDir field and carries it through WithAbsolutePaths.
internal/app/azldev/core/components/resolver.go Sets RenderedSpecDir when creating resolved components.
internal/app/azldev/core/components/renderedspecdir.go New helper to compute {renderedSpecsDir}/{letter}/{componentName} output dir.
internal/app/azldev/core/components/renderedspecdir_test.go Unit tests for RenderedSpecDir helper.
internal/app/azldev/cmds/component/list.go Removes lo.Map dependency; builds slice via loop.
internal/app/azldev/cmds/component/list_test.go Adds coverage asserting computed RenderedSpecDir in list results.
Comments suppressed due to low confidence (1)

internal/app/azldev/core/components/resolver.go:458

  • The PR title/description says rendered files will be placed into per-letter/per-component subdirectories, but this change only computes/stores RenderedSpecDir on the resolved config. There are no call sites that use ComponentConfig.RenderedSpecDir (or Project.RenderedSpecsDir) to actually write rendered specs into the new layout, so the runtime behavior appears unchanged.
func (r *Resolver) createComponentFromConfig(componentConfig *projectconfig.ComponentConfig) Component {
	componentConfig.RenderedSpecDir = RenderedSpecDir(
		r.env.Config().Project.RenderedSpecsDir, componentConfig.Name,
	)

	return &resolvedComponent{
		env:    r.env,
		config: *componentConfig,
	}

@dmcilvaney dmcilvaney force-pushed the damcilva/rendered-spec-output-subdirs branch 3 times, most recently from 07caa6f to 94efa01 Compare April 9, 2026 22:22
Copilot AI review requested due to automatic review settings April 9, 2026 22:22
@dmcilvaney dmcilvaney force-pushed the damcilva/rendered-spec-output-subdirs branch from 94efa01 to a7ce5e3 Compare April 9, 2026 22:22
@dmcilvaney dmcilvaney marked this pull request as ready for review April 9, 2026 22:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

@dmcilvaney dmcilvaney force-pushed the damcilva/rendered-spec-output-subdirs branch from a7ce5e3 to 872abb8 Compare April 9, 2026 22:37
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.

3 participants