Skip to content

feat(cli): export themeTemplate from public API - #6702

Closed
josephfarina wants to merge 1 commit into
mainfrom
feat/cli-export-theme-template
Closed

josephfarina wants to merge 1 commit into
mainfrom
feat/cli-export-theme-template

Conversation

@josephfarina

@josephfarina josephfarina commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

User need

Automation that can run astryx theme template needs the same operation through the supported programmatic API. The function and its docs already exist, but importing it from @astryxdesign/cli/api fails because the entry point doesn't export it.

Problem and solution fit

The theme barrel exports themeTemplate(), while the public API barrel skips it. I added that missing re-export, a direct public-entry regression test, and coverage in the packed consumer type check. I also removed the resolved gap from AST-042.

Current specification

AST-042 FR1 requires each operational command to call a function exported from @astryxdesign/cli/api.

Public delta and caller burden

Before:

import {themeTemplate} from '@astryxdesign/cli/api'; // not exported

After:

import {themeTemplate} from '@astryxdesign/cli/api';

const result = themeTemplate();

This is additive. The function's inputs, defaults, result, errors, and CLI behavior don't change. Callers make no new decisions.

Design and alternatives

A deep import would bypass the package's supported export surface. A second function would duplicate the operation. The existing documented function is the owner, so the public barrel should export it.

Evidence

  • The FunctionDoc already names @astryxdesign/cli/api as the import path.
  • The theme template command already calls themeTemplate().
  • The new test fails if the public entry point drops the export.
  • The packed consumer test now imports the function from the published type surface.

Dependency with #6617

If #6617 merges first, this PR must delete its FR1 allowlist entry for themeTemplate. If this merges first, #6617's stale-entry check fails until that row is removed.

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run packages/cli/api/theme/template/template.test.mjs packages/cli/foundation/discovery/cli-self-docs.test.mjs (22 passed)
  • pnpm exec vitest run packages/cli (5,134 passed, 2 expected failures)
  • node .github/scripts/cli-api-types-verify.mjs
  • pnpm check:repo
  • pnpm --filter @astryxdesign/theme-neutral build && pnpm --filter @astryxdesign/cli typecheck:strict
  • pnpm --filter @astryxdesign/cli typecheck:json-api
  • pnpm --filter @astryxdesign/cli readme:check

The CLI command and docs already use themeTemplate(), but the public API entry point does not export it. Export it and cover the runtime and packed type surfaces.
@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 28, 2026 6:56pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 28, 2026
@astracat-bot

astracat-bot Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
📝 Draft — not reviewed automatically (for maintainers only) Sep 28, 2026, 7:41 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Sep 28, 2026
github-actions Bot added a commit that referenced this pull request Sep 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Preview availability: Storybook and Sandbox are not both ready on the exact-head Vercel preview.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

Status: No visual change across 420 compared shot(s).


Generated by PR Enrichment workflow | View full report

josephfarina added a commit that referenced this pull request Sep 28, 2026
Folded in from #6702. Exports themeTemplate from @astryxdesign/cli/api with runtime and packed-type guards, and removes the resolved known-gap bullet from AST-042.
@josephfarina

Copy link
Copy Markdown
Contributor Author

Folded into #6626, so there is one PR to review, approve, and merge. The commit is there unchanged, on current main, and themeTemplate leaves the CLI structure check's known-gap list in the same PR. Closing this one.

josephfarina added a commit that referenced this pull request Sep 28, 2026
Folded in from #6702. Exports themeTemplate from @astryxdesign/cli/api with runtime and packed-type guards, and removes the resolved known-gap bullet from AST-042.
josephfarina added a commit that referenced this pull request Sep 28, 2026
…emeTemplate export

One change on main after #6695: the docs tree for the CLI and integrations (AST-046), navigable reads with typed links (AST-047), integration templates that replace Core templates (AST-035, from #6265), and the themeTemplate export (from #6702). JSON keeps its 0.6 shapes; the CLI's text reads one level at a time.
josephfarina added a commit that referenced this pull request Sep 28, 2026
…emeTemplate export

One change on main after #6695: the docs tree for the CLI and integrations (AST-046), navigable reads with typed links (AST-047), integration templates that replace Core templates (AST-035, from #6265), and the themeTemplate export (from #6702). JSON keeps its 0.6 shapes; the CLI's text reads one level at a time.
@github-actions
github-actions Bot deleted the feat/cli-export-theme-template branch September 29, 2026 06:24

This branch was successfully deployed

1 active deployment
Preview — 651b81b4 Deployed Sep 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant