Code extraction into separate packages - #36
Merged
Conversation
…ence Update extraction plan status from "In progress (Steps 1-2 complete)" to "In progress (Steps 1-3 complete)". Mark steps 3-5 as complete in progress table with test counts and verification details. Add completion evidence sections for core (26 tests, p-retry dependency), adapters (40 tests, Remark parser), and providers (33 tests, Workers AI/Anthropic factories) packages. Add corresponding pnpm-lock.yaml entries for packages/core, packages/adapters, and packages
Reorganize from single-package to monorepo with fixed-version group: @cloudflare/polystella-core (translation engine), @cloudflare/polystella-adapters (file format parsers), @cloudflare/polystella-providers (AI transport factories), and @cloudflare/polystella (Astro integration). Update Changesets config to link all four packages at same version. Split test suite into package-level, workerd, and boundary tests with increased CI timeout. Update all
Replace `pnpm exec tsc --noEmit` with `pnpm typecheck` in pull request template checklist.
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
polystella-docs | cc06e0c | Commit Preview URL Branch Preview URL |
Aug 31 2026, 03:06 PM |
Contributor
Scope checkThis PR changes 12,594 lines across 277 files. PolyStella is maintained by a small team, so smaller focused PRs are more likely to be reviewed. If this scope is intentional, no action is required. |
@cloudflare/polystella-adapters
@cloudflare/polystella-astro
@cloudflare/polystella-core
@cloudflare/polystella
@cloudflare/polystella-providers
commit: |
…sion group Add `@cloudflare/polystella-astro` compatibility package to Changesets fixed group alongside core, adapters, providers, and polystella packages. Update all documentation, workflows, and examples to reference five packages instead of four. Update install instructions and import examples to prefer `@cloudflare/polystella-astro` as the canonical Astro integration name. Add CLI smoke test for astro-alias package. Update exports reference to document all 29
Rename `packages/astro-alias/` to `packages/polystella/` to reflect that `@cloudflare/polystella` is the compatibility package forwarding to the canonical `@cloudflare/polystella-astro` integration. Update all references across CI workflows, documentation, changeset descriptions, and test paths. Clarify in exports reference and install guide that `@cloudflare/polystella` forwards to `@cloudflare/polystella-astro` rather than the reverse.
… boundaries and ownership Add PACKAGE_ARCHITECTURE.md as fourth companion doc explaining package graph, dependency direction, per-package responsibilities, key file locations, and boundary enforcement checks. Update AGENTS.md, ARCHITECTURE.md, CONTRIBUTING.md, and README.md to reference new guide. Add PACKAGE_ARCHITECTURE.md to docs workflow triggers and llms-full.txt generation. Update ARCHITECTURE.md runtime bridge section to clarify custom-loader vs
…o core translateSegments Move flat(groups) === segments validation from markdownAdapter.groupSegments to translateSegments in core package. Update changeset description to reflect enforcement in format-neutral core. Refactor cache.test.ts to use groupSegments callback pattern instead of pre-computed groups array. Add test case for groups that omit segments. Remove "How It Connects" section from core README.
…eResponse, and translateSegments Add assertUniqueSegmentIds helper to segment.ts and call it from buildPrompt, parseResponse, and translateSegments to reject duplicate IDs. Export only Segment type from core index (not assertUniqueSegmentIds). Add test cases for duplicate ID rejection in prompt.test.ts and translate-segments.test.ts. Update changeset description to mention duplicate ID rejection alongside grouping invariants.
…ubdirectory Move markdown.ts, extract.ts, apply.ts, mdx-rules.ts, mdx-placeholders.ts, mdx-jsx-attributes.ts, mdx-static-data.ts, parser.ts, and traverse.ts from src/ to src/adapters/markdown/. Update adapter.ts to make FileAdapter generic over extract/apply options types. Update index.ts barrel exports to reference new paths. Update README.md file locations to reflect new structure. Add MarkdownExtractOptions and MarkdownApplyOptions interfaces extending base adapter options with
…s, and extract shared MDX utilities Recursively protect inline JSX nested in Markdown formatting (bold, italic, links, strikethrough) by traversing children arrays and building placeholders from inside out. Restore nested placeholders in reverse order to reconstruct from innermost to outermost. Extract shared helpers (allowedAttributesForElement, findQuotedAttributeValueSpan, isMdxJsxAttribute, readArrayProperty, readPositionSpan, walkUnknown, getPatternMatcher)
…ders packages Remove core, adapters, and providers from Changesets fixed group, keeping only Astro and compatibility packages locked together. Update workspace dependencies from `workspace:*` to `workspace:^` for independently versioned packages. Update documentation across README.md, AGENTS.md, ARCHITECTURE.md, PACKAGE_ARCHITECTURE.md, and changeset README to reflect independent versioning model. Update check-packages.mjs to validate caret ranges for independent packages and
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Extracts PolyStella from a single Astro package into five packages with explicit dependency boundaries. Astro and its compatibility package share a version; core, adapters, and providers are versioned independently:
@cloudflare/polystella-astrothe canonical Astro integration.@cloudflare/polystellaas a forwarding compatibility package.nodejs_compat.PACKAGE_ARCHITECTURE.md.The extraction also hardens the new package boundaries:
Migration notes
@cloudflare/polystella-astro.@cloudflare/polystellaintegration imports continue through the compatibility package.@cloudflare/polystella-core, formats from@cloudflare/polystella-adapters, and transports from@cloudflare/polystella-providers.MarkdownAdapterExtractOptionsandMarkdownAdapterApplyOptionsformdxRules; the generic adapter options are now format-neutral.Type of change
PolyStella invariants touched
Checklist
CONTRIBUTING.mdpnpm testpassespnpm typecheckpassesAI-generated code disclosure
Screenshots / logs / test output
pnpm test: 1,299 tests passed, including package, Astro, workerd, and boundary suites.pnpm typecheck: all five public packages passed strict typechecking.pnpm check:packages: five tarballs, 17 runtime imports, clean Astro consumers, and both CLIs passed.pnpm check:baseline: passed.pnpm format:checkandgit diff --check: passed.