Skip to content

refactor(config-typescript): extend the shared typescript library config - #416

Merged
alexgrozav merged 2 commits into
mainfrom
extend-library-config-uxf-953
Nov 22, 2026
Merged

alexgrozav merged 2 commits into
mainfrom
extend-library-config-uxf-953

Conversation

@alexgrozav

@alexgrozav alexgrozav commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

The @styleframe/config-typescript package repeated the first 11 options of @uxfront/typescript-config and added the library options by hand. Its outDir: "dist" also resolved inside this config package, not in the package that extends it, so engine/core resolved outDir to ../../config/typescript/dist.

It now extends @uxfront/typescript-config/library.json (0.2.0) and sets only what differs from it: module: "esnext", moduleResolution: "bundler", declarationMap and sourceMap. It also sets "include": ["${configDir}/**/*"], since the base's own include resolves inside node_modules, and a config that relied on the default include, like the root tsconfig.json, would match nothing. Along with that, this PR changes three more things:

  • @uxfront/typescript-config is a dependency (from the default catalog, ^0.2.0), because a project that extends this config resolves it at type-check time.
  • config/AGENTS.md now says what the package extends, lists only its own options, and explains the dist/src output layout and the exclude a custom outDir needs.
  • A patch changeset for @styleframe/config-typescript.

These are the checks I ran:

  • tsc --showConfig in all 15 configs that extend it (the root, the engine, theme, tooling and testing packages) gives the same compilerOptions and the same files before and after, apart from outDir (now ./dist), noEmit (now false, or the package's own true in the plugin playground) and exclude. Every typecheck script runs tsc --noEmit, so nothing new is written.
  • pnpm build:nodocs writes byte-identical dist/ output (2,400 files, shasum) with the old and the new config.
  • The packed manifest names "@uxfront/typescript-config": "^0.2.0", not catalog:.
  • Scratch projects outside the repository that extend the config build twice in a row with exit 0: with no outDir, with "outDir": "dist", with "outDir": "lib" plus the documented exclude, and with "outDir": "lib" plus "include": ["src"].

Related issue

None in this repository.

Type of change

  • 🐞 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📖 Documentation
  • ♻️ Refactor / internal (no functional change)
  • 🔧 Build / tooling / CI

Checklist

  • My commits follow Conventional Commits with a package scope (e.g. feat(theme): …)
  • I ran pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm test and everything passes
  • I added a changeset (pnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/tests
  • I added or updated tests where relevant
  • I updated documentation where relevant
  • I did not edit generated files (dist/, .styleframe/)
  • My PR targets main and stays focused in scope

Notes / screenshots

The scope box refers to the PR title, which becomes the squash commit. The first commit on the branch has no scope. No tests changed, since the package is a config file and the checks above cover it. The format check (pnpm format:check) passes too.

For external users of @styleframe/config-typescript, the change behaves differently in three ways:

  • The output folder moves. A project that sets no outDir now writes to its own dist, where before it wrote inside node_modules/@styleframe/config-typescript/dist.
  • The default include is the project's own files. A project with no include now type-checks every file in its own folder.
  • A custom outDir needs an exclude. A project that sets its own outDir or declarationDir outside dist and keeps the default include now stops with TS5055 on its second build, because the inherited exclude replaces TypeScript's default one, which left out the outDir. The fix is one line, an exclude like ["node_modules", "dist", "lib"] or an include like ["src"], and both the changeset and config/AGENTS.md give it. On 3.0.1 the same project builds twice. The changeset stays a patch, as the owner decided.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

@alexgrozav alexgrozav changed the title refactor: extend the shared typescript library config refactor(config-typescript): extend the shared typescript library config Nov 22, 2026
@alexgrozav
alexgrozav marked this pull request as ready for review November 22, 2026 08:41
@alexgrozav
alexgrozav merged commit e727598 into main Nov 22, 2026
15 checks passed
@alexgrozav
alexgrozav deleted the extend-library-config-uxf-953 branch November 22, 2026 08:46
This was referenced Nov 22, 2026
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.

1 participant