Fix Windows CI for the Turbopack loader changes#72
Open
esetnik wants to merge 2 commits into
Open
Conversation
The emitted file path (this.resourcePath split at pages/app) carries backslashes on Windows, failing the cross-platform toEqual assertions added in markdoc#67 and shipping OS-dependent path metadata to the app. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The 'import as frontend component' test replaced a posix-joined substring inside a path.join-built resourcePath, which never matched on Windows — leaving the test exercising the page pathway there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
This targets the #70 retry branch and fixes the
windows-latestCI failure that got #67 reverted in #69 — without updating any snapshots. The failures turned out to be three real cross-platform bugs, sonpm run test -- -uon Windows would have masked them (and produced snapshots that fail on Linux):getRelativeImportPathemitted OS-native separators.path.relativeproduces backslashes on Windows and the oldnormalize()helper double-escaped them into the emitted import specifiers — making loader output differ per OS (the snapshot failures) and emitting separators bundlers don't treat as path delimiters. Now converts to posix separators, so emitted code is byte-identical on every platform; the previously-unusednormalize()helper is removed.pathmetadata carried backslashes on Windows (this.resourcePath.split('pages')[1]), failing the cross-platformtoEqualassertions Enhance Turbopack support and improve loader functionality #67 added and shipping OS-dependent path values to the app. Normalized to posix, with a guard for non-page resources (e.g..mdimported as a component) where the split yieldsundefined.import as frontend componenttest replaced a posix-joined substring inside apath.join-built resourcePath, which never matches on Windows — so on Windows that test silently exercised the page pathway.Proof: this exact CI matrix passes on both platforms on my fork: ubuntu + windows green (vs the branch without these fixes failing windows). All 18 tests / 4 snapshots pass unmodified.
Context: we run
@markdoc/next.json Next 16 under Turbopack in production (via a local shim replicating #67's resolution fixes) and would love to retire the shim when 0.6.0 (#68) ships — happy to adjust anything here.Authored with Claude (AI) under my direction and review; commits carry co-author attribution.