Implement HTTP template pipeline and CLI commands#68
Conversation
TarasMazepa
left a comment
There was a problem hiding this comment.
Let's start smaller. I see that there were some trade-offs made during implementation.
|
I went back through the incubation spec and tightened the implementation around the parts that were not being tested strictly enough. The PR now checks the full pipeline more carefully, not just the final IR. It validates the hydrated request output, shift maps, chained hydrate functions, dynamic provided-body handling, and the CLI flag format from the spec. I also fixed a GitHub CI issue caused by Windows vs Linux line endings in the fixture maps, so the tests should behave consistently now. Local result: Latest changes are pushed to the same PR branch, so the existing PR should pick them up automatically. |
|
I’ve pushed another update to cover the remaining items from the incubation spec. This adds static contract verification, CLI verify support, CLI stream file mapping, smart stream extraction from data, async SDK input support for readable/byte templates, stream reference validation, and the remaining Phase 3 fixtures. I also added tests for the new behavior and the full local suite is passing: 75/75 tests passing |
|
I fixed hydrate(template, data, streams = []) according to incubation.md section 1.2. It now runs as a single-pass character state machine, supports streamed template input, tracks source-map cursor shifts during hydration, handles dynamic body/head insertion correctly, and throws BodyConflictError immediately when required. I also added tests for chunked stream hydration and ran the full suite. Result: npm.cmd test passes with 77/77 tests. Please review it when you get a chance. If you still see anything that does not match the specification, let me know and I’ll focus on that exact part next. |
|
I cleaned it up again and made the hydrate state machine easier to read. The behavior is the same, but the code is flatter now with clearer state names and less helper-heavy structure. Tests are passing: 77/77. If it still feels too much for one review, I’m happy to split it further and start with only the basic tag replacement + source-map part. |
|
That is our old work and new work on pull no 77, you can check there |
Implemented the JavaScript HTTP Template pipeline and CLI commands.
Changes:
Validation: