Hide typescript import from consumer bundlers - #422
Open
freekh wants to merge 3327 commits into
Open
Conversation
RemirrorError: `getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor. Called 2 times For more information visit https://remirror.io/docs/errors#rmr0201 See: remirror/remirror#2260
UI refactor val provider
Use worker thread for searching
... unvibing it a bit
Adds experimental AI features (disabled by default) to Val
Version Packages
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…gration Co-authored-by: Copilot <copilot@github.com>
…operations and update validation for non-file operations Co-authored-by: Copilot <copilot@github.com>
…oving error reporting Co-authored-by: Copilot <copilot@github.com>
- Renamed `convert_session_image_to_patch` to `convert_session_image_field` and added new tools: `convert_session_image_richtext` and `convert_session_image_gallery`. - Updated the `TOOL_DISPLAY` record in `AIChat.tsx` to reflect the new tool names and descriptions. - Created `aiImageToolPatches.ts` to handle patch building for image fields, richtext, and galleries. - Added tests for the new patch building functions in `aiImageToolPatches.test.ts`. - Refactored `useAI.ts` to utilize the new tools and handle image patching more effectively. - Updated tool names in `toolNames.ts` to match the new naming conventions.
…ding tools and tests
- Add `expandSessionKeysInPatch` function to handle session key transformations in patches. - Introduce `planSessionKeyExpansion` to plan and validate session key usage in patches. - Create tests for session key expansion scenarios in `expandSessionKeysInPatch.test.ts`. - Update `useAI` hook to integrate session key expansion and handle related errors. - Replace deprecated tools for session image handling with a new tool `add_session_image_to_gallery`. - Update tool descriptions and documentation to reflect changes in session key handling.
…improve metadata processing Co-authored-by: Copilot <copilot@github.com>
…o manage auth states Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
AI chat support for images
Version Packages
@valbuild/server's built ESM bundle previously opened with a static
`import ts from 'typescript'`. When a Next.js consumer (e.g. via
@valbuild/next) ran `next build --webpack` or Turbopack, the bundler
walked the import graph through @valbuild/server → typescript and
landed inside lib/typescript.js, where TypeScript's optional
`require("source-map-support").install()` is buried in a try/catch.
The require is harmless at runtime, but the bundler's static analysis
emitted "Module not found: Can't resolve 'source-map-support'" warnings
on every consumer build.
Centralize the runtime `typescript` import in
packages/server/src/internal/typescript.ts via `createRequire(import.meta.url)`.
Bundlers can't statically follow createRequire, so they no longer trace
into typescript's distribution. Each consumer file now imports the
namespace type-only (`import type * as ts from "typescript"` — erased at
compile time, also invisible to bundlers) and the runtime value through
the wrapper as `tsLib`. Module augmentation in patch/ts/ops.ts is
preserved through the type-only side.
Rollup auto-transforms `import.meta.url` for Preconstruct's CJS bundle,
so both CJS and ESM consumers work unchanged at runtime. Jest evaluates
sources as CJS and would reject the literal `import.meta` token, so the
package's jest.config.js maps the wrapper import to `typescript`
directly for tests.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 15bd779 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
freekh
force-pushed
the
main
branch
2 times, most recently
from
May 19, 2026 19:39
a72dec0 to
9a45969
Compare
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.
@valbuild/server's built ESM bundle previously opened with a static
import ts from 'typescript'. When a Next.js consumer (e.g. via @valbuild/next) rannext build --webpackor Turbopack, the bundler walked the import graph through @valbuild/server → typescript and landed inside lib/typescript.js, where TypeScript's optionalrequire("source-map-support").install()is buried in a try/catch. The require is harmless at runtime, but the bundler's static analysis emitted "Module not found: Can't resolve 'source-map-support'" warnings on every consumer build.Centralize the runtime
typescriptimport inpackages/server/src/internal/typescript.ts via
createRequire(import.meta.url). Bundlers can't statically follow createRequire, so they no longer trace into typescript's distribution. Each consumer file now imports the namespace type-only (import type * as ts from "typescript"— erased at compile time, also invisible to bundlers) and the runtime value through the wrapper astsLib. Module augmentation in patch/ts/ops.ts is preserved through the type-only side.Rollup auto-transforms
import.meta.urlfor Preconstruct's CJS bundle, so both CJS and ESM consumers work unchanged at runtime. Jest evaluates sources as CJS and would reject the literalimport.metatoken, so the package's jest.config.js maps the wrapper import totypescriptdirectly for tests.