@warp-drive/holodeck 0.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (C) 2023 EmberData and WarpDrive contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="1200pt" height="1200pt" version="1.1" viewBox="0 0 1200 1200" xmlns="http://www.w3.org/2000/svg">
3
+ <path fill="#0969da" d="m1096.3 402.82c-53.148-53.008-117.12-79.516-191.93-79.516-67.488 0-126.55 21.938-177.16 65.805-50.617 43.871-80.988 98.285-91.113 163.25l53.57 4.2188c14.625 0.28125 25.449 6.75 32.48 19.406h18.984c11.809 0 17.715 5.7617 17.715 17.293s-5.9062 17.293-17.715 17.293h-17.297c-6.75 14.344-18.137 21.797-34.168 22.359l-53.57 4.6406c10.125 64.68 40.496 118.95 91.113 162.82 50.617 43.871 109.68 65.805 177.16 65.805 74.805 0 138.78-26.574 191.93-79.723 53.152-53.148 79.727-116.98 79.727-191.51 0-75.086-26.574-139.13-79.727-192.14zm-79.422 185.27c0 2.9531 2.3906 5.3477 5.3438 5.3477 2.9531 0 5.3477-2.3945 5.3477-5.3477 0-2.9492-2.3945-5.3438-5.3477-5.3438-2.9531 0-5.3438 2.3945-5.3438 5.3438zm-104.54-111.07c0 2.9531 2.3945 5.3477 5.3438 5.3477 2.9531 0 5.3477-2.3945 5.3477-5.3477s-2.3945-5.3438-5.3477-5.3438c-2.9492 0-5.3438 2.3906-5.3438 5.3438zm-12.473 0c0 2.9531 2.3906 5.3477 5.3438 5.3477s5.3477-2.3945 5.3477-5.3477-2.3945-5.3438-5.3477-5.3438-5.3438 2.3906-5.3438 5.3438zm117.01 123.55c0 2.9492 2.3906 5.3438 5.3438 5.3438 2.9531 0 5.3477-2.3945 5.3477-5.3438 0-2.9531-2.3945-5.3477-5.3477-5.3477-2.9531 0-5.3438 2.3945-5.3438 5.3477zm-104.54 111.66c0 2.9531 2.3945 5.3477 5.3438 5.3477 2.9531 0 5.3477-2.3945 5.3477-5.3477s-2.3945-5.3438-5.3477-5.3438c-2.9492 0-5.3438 2.3906-5.3438 5.3438zm-12.473 0c0 2.9531 2.3906 5.3477 5.3438 5.3477s5.3477-2.3945 5.3477-5.3477-2.3945-5.3438-5.3477-5.3438-5.3438 2.3906-5.3438 5.3438zm-848-318.48c14.062-2.5312 30.934-4.5 50.621-5.9062l-46.402-0.84375zm499.86 169.15c-8.7188-2.25-18.141-8.7188-28.266-19.402l-101.23-103.35h-111.36l173.79 126.12v4.2188c21.652 6.1836 44.008 3.6562 67.07-7.5938zm47.664-148.48c-0.84375 3.3711-2.8125 6.6055-5.9062 9.6992h-5.0625l-6.3242-5.0625h-79.305v-4.6367zm-5.9062-16.031c3.0938 3.0938 5.0625 6.4688 5.9062 10.125h-96.598v-4.6406h79.305l6.3242-5.4844zm-541.62 397.78 4.2188 6.7461 46.402-0.84375c-22.5-2.2461-39.371-4.2148-50.621-5.9023zm499.86-169.15c-23.062-11.531-45.418-14.062-67.07-7.5938v4.2188l-173.79 126.12h111.36l101.23-103.77c10.406-10.684 19.828-17.012 28.266-18.98zm47.664 148.48h-96.598v-4.6406h79.305l6.3242-5.4805h5.0625c3.0938 3.6523 5.0625 7.0273 5.9062 10.121zm-5.9062 15.609h-5.0625l-6.3242-5.0625h-79.305v-4.6406h96.598c-0.84375 3.0938-2.8125 6.3281-5.9062 9.7031zm-102.5 9.6992c3.6562 1.4062 7.4531 2.1094 11.391 2.1094h64.961c24.746 0 37.121-8.4336 37.121-25.309 0-8.4375-4.6406-14.691-13.922-18.77-9.2773-4.0781-17.012-6.1172-23.199-6.1172h-64.961c-4.7812 0-8.5781 0.5625-11.391 1.6875h-333.66c-5.0625 0-28.543 1.6172-70.445 4.8516-41.902 3.2344-62.852 7.3828-62.852 12.441v11.812c0 4.5 20.949 8.5078 62.852 12.023 41.902 3.5156 65.383 5.2695 70.445 5.2695zm125.28-207.54h-42.602c-3.375 1.125-3.375 2.25 0 3.375h42.602zm-43.445 8.4375h-5.4844v-13.5h5.4844c17.152-6.1875 33.605-9.9844 49.352-11.391l4.6406-25.309 4.6406 0.42188c0.5625-4.2188 1.6875-10.262 3.375-18.137-28.684-0.5625-64.398 1.6875-107.14 6.75 3.6562 4.2148 7.4531 7.8711 11.391 10.965 4.7812 3.375 9.4219 5.625 13.918 6.75l12.656 2.9531-11.812 5.9062c-13.496 6.75-30.23 10.121-50.195 10.121-5.0625 0-8.5781-0.14062-10.547-0.42188-4.2188-0.5625-7.5898-1.1211-10.121-1.6836l-3.375-1.2656v-5.4844l-24.043-17.297c-41.34 5.625-69.32 8.5781-83.945 8.8594-31.496 0.28125-47.242 11.953-47.242 35.012 0 22.215 15.746 33.887 47.242 35.012 18.844 0.28125 46.824 3.2344 83.945 8.8594l24.043-17.297v-5.4844l3.375-1.2656c2.5312-0.84375 5.9023-1.4062 10.121-1.6875 1.9688-0.28125 5.4844-0.42187 10.547-0.42187 19.965 0 36.699 3.375 50.195 10.125l11.812 5.4844-12.656 3.375c-4.4961 0.84375-9.1367 3.0938-13.918 6.75-3.6562 2.2461-7.4531 5.7617-11.391 10.543 40.777 5.0625 76.492 7.4531 107.14 7.1719-1.6875-7.3125-2.8125-13.359-3.375-18.137h-4.6406l-4.6406-24.891c-17.434-2.25-33.887-6.043-49.352-11.387zm48.508-20.25c-12.652 1.6875-23.762 3.9375-33.324 6.75h29.105l3.7969-4.2188zm-4.2188 20.25h-29.105c9.5625 2.5312 20.672 4.7812 33.324 6.7461l-0.42188-2.5273zm136.67-8.4375c0-8.4375-4.2188-12.656-12.652-12.656h-21.516c-6.4688-12.652-16.59-18.98-30.371-18.98l-58.211-5.0625-5.9062 29.527-4.2188 5.0625v7.5938l4.2188 5.0625 5.9062 29.105 58.211-5.0625c15.469 0 26.012-7.3125 31.637-21.934h20.25c8.4336 0 12.652-4.2188 12.652-12.656zm-46.82 1.6875c0-11.531-5.9062-17.297-17.719-17.297-11.527 0-17.293 5.7656-17.293 17.297 0 11.812 5.7656 17.715 17.293 17.715 11.812 0 17.719-5.9023 17.719-17.715zm4.6406 0c0 14.902-7.4531 22.355-22.359 22.355-14.902 0-22.355-7.4531-22.355-22.355 0-14.906 7.4531-22.355 22.355-22.355 14.906 0 22.359 7.4492 22.359 22.355zm-13.922 0c0-5.625-2.8125-8.4375-8.4375-8.4375-5.3438 0-8.0156 2.8125-8.0156 8.4375s2.6719 8.4375 8.0156 8.4375c5.625 0 8.4375-2.8125 8.4375-8.4375zm4.6406 0c0 8.7188-4.3594 13.078-13.078 13.078-8.4375 0-12.652-4.3594-12.652-13.078s4.2148-13.078 12.652-13.078c8.7188 0 13.078 4.3594 13.078 13.078zm-43.871-2.1094v4.2188h-35.012v-4.2188zm258.58 2.1094c-0.5625-8.4375-4.7812-12.656-12.656-12.656-8.4336 0-12.652 4.2188-12.652 12.656s4.2188 12.656 12.652 12.656c8.4375 0 12.656-4.2188 12.656-12.656zm4.6406 0c0 11.531-5.7656 17.293-17.297 17.293-11.527 0-17.293-5.7617-17.293-17.293s5.7656-17.297 17.293-17.297c11.531 0 17.297 5.7656 17.297 17.297zm32.48 0c0-13.781-4.9219-25.59-14.766-35.434-9.5586-9.5625-21.23-14.344-35.012-14.344-15.184 0-31.777 5.7656-49.773 17.297-18.559 11.531-27.84 22.355-27.84 32.48 0 9.8438 9.2812 20.668 27.84 32.48 17.996 11.531 34.59 17.293 49.773 17.293 13.781 0 25.453-4.918 35.012-14.762 9.8438-9.5625 14.766-21.234 14.766-35.012zm5.0625 0c0 14.902-5.3438 27.699-16.031 38.387-10.684 10.684-23.621 16.027-38.809 16.027-15.746 0-33.18-6.0469-52.305-18.137-20.246-12.656-30.371-24.746-30.371-36.277s10.125-23.762 30.371-36.699c19.125-12.094 36.559-18.137 52.305-18.137 14.625 0 27.562 5.3398 38.809 16.027 10.688 10.969 16.031 23.902 16.031 38.809zm-54.418-29.105c-3.9336 0-10.262 1.6875-18.98 5.0625-7.875 3.9375-11.812 6.4648-11.812 7.5898v32.48c0 3.0938 3.9375 5.625 11.812 7.5938 7.875 3.375 14.203 5.0625 18.98 5.0625 19.406 0 29.391-9.2812 29.953-27.84 0-19.688-9.9844-29.668-29.953-29.949zm34.59 29.105v0.84375c0 21.371-11.527 32.34-34.59 32.902-4.4961 0-11.527-1.8281-21.09-5.4844-7.0312-3.9375-10.969-6.3281-11.809-7.1719-1.6875-1.4062-2.5312-3.0938-2.5312-5.0625v-32.48c0-1.4062 0.70312-2.9492 2.1094-4.6367 3.0898-2.8125 7.168-5.2031 12.23-7.1719 9-3.6562 16.031-5.4844 21.09-5.4844 22.5 0.28125 34.027 11.531 34.59 33.746zm-448.4-206.27h-333.66c-5.0625 0-28.543 1.6875-70.445 5.0625-41.902 3.375-62.852 7.5938-62.852 12.656v11.387c0 4.7812 20.949 8.8594 62.852 12.234 41.902 3.375 65.383 5.0625 70.445 5.0625h333.66c3.6562 1.4062 7.4531 2.1094 11.391 2.1094h64.961c5.3438 0 12.867-2.25 22.566-6.75 9.7031-4.5 14.555-10.547 14.555-18.137 0.28125-16.875-12.094-25.312-37.121-25.312h-64.961c-4.7812 0-8.5781 0.5625-11.391 1.6875z" fill-rule="evenodd"/>
4
+ </svg>
package/NCC-1701-a.svg ADDED
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="1200pt" height="1200pt" version="1.1" viewBox="0 0 1200 1200" xmlns="http://www.w3.org/2000/svg">
3
+ <path fill="#FFFFFF" d="m1096.3 402.82c-53.148-53.008-117.12-79.516-191.93-79.516-67.488 0-126.55 21.938-177.16 65.805-50.617 43.871-80.988 98.285-91.113 163.25l53.57 4.2188c14.625 0.28125 25.449 6.75 32.48 19.406h18.984c11.809 0 17.715 5.7617 17.715 17.293s-5.9062 17.293-17.715 17.293h-17.297c-6.75 14.344-18.137 21.797-34.168 22.359l-53.57 4.6406c10.125 64.68 40.496 118.95 91.113 162.82 50.617 43.871 109.68 65.805 177.16 65.805 74.805 0 138.78-26.574 191.93-79.723 53.152-53.148 79.727-116.98 79.727-191.51 0-75.086-26.574-139.13-79.727-192.14zm-79.422 185.27c0 2.9531 2.3906 5.3477 5.3438 5.3477 2.9531 0 5.3477-2.3945 5.3477-5.3477 0-2.9492-2.3945-5.3438-5.3477-5.3438-2.9531 0-5.3438 2.3945-5.3438 5.3438zm-104.54-111.07c0 2.9531 2.3945 5.3477 5.3438 5.3477 2.9531 0 5.3477-2.3945 5.3477-5.3477s-2.3945-5.3438-5.3477-5.3438c-2.9492 0-5.3438 2.3906-5.3438 5.3438zm-12.473 0c0 2.9531 2.3906 5.3477 5.3438 5.3477s5.3477-2.3945 5.3477-5.3477-2.3945-5.3438-5.3477-5.3438-5.3438 2.3906-5.3438 5.3438zm117.01 123.55c0 2.9492 2.3906 5.3438 5.3438 5.3438 2.9531 0 5.3477-2.3945 5.3477-5.3438 0-2.9531-2.3945-5.3477-5.3477-5.3477-2.9531 0-5.3438 2.3945-5.3438 5.3477zm-104.54 111.66c0 2.9531 2.3945 5.3477 5.3438 5.3477 2.9531 0 5.3477-2.3945 5.3477-5.3477s-2.3945-5.3438-5.3477-5.3438c-2.9492 0-5.3438 2.3906-5.3438 5.3438zm-12.473 0c0 2.9531 2.3906 5.3477 5.3438 5.3477s5.3477-2.3945 5.3477-5.3477-2.3945-5.3438-5.3477-5.3438-5.3438 2.3906-5.3438 5.3438zm-848-318.48c14.062-2.5312 30.934-4.5 50.621-5.9062l-46.402-0.84375zm499.86 169.15c-8.7188-2.25-18.141-8.7188-28.266-19.402l-101.23-103.35h-111.36l173.79 126.12v4.2188c21.652 6.1836 44.008 3.6562 67.07-7.5938zm47.664-148.48c-0.84375 3.3711-2.8125 6.6055-5.9062 9.6992h-5.0625l-6.3242-5.0625h-79.305v-4.6367zm-5.9062-16.031c3.0938 3.0938 5.0625 6.4688 5.9062 10.125h-96.598v-4.6406h79.305l6.3242-5.4844zm-541.62 397.78 4.2188 6.7461 46.402-0.84375c-22.5-2.2461-39.371-4.2148-50.621-5.9023zm499.86-169.15c-23.062-11.531-45.418-14.062-67.07-7.5938v4.2188l-173.79 126.12h111.36l101.23-103.77c10.406-10.684 19.828-17.012 28.266-18.98zm47.664 148.48h-96.598v-4.6406h79.305l6.3242-5.4805h5.0625c3.0938 3.6523 5.0625 7.0273 5.9062 10.121zm-5.9062 15.609h-5.0625l-6.3242-5.0625h-79.305v-4.6406h96.598c-0.84375 3.0938-2.8125 6.3281-5.9062 9.7031zm-102.5 9.6992c3.6562 1.4062 7.4531 2.1094 11.391 2.1094h64.961c24.746 0 37.121-8.4336 37.121-25.309 0-8.4375-4.6406-14.691-13.922-18.77-9.2773-4.0781-17.012-6.1172-23.199-6.1172h-64.961c-4.7812 0-8.5781 0.5625-11.391 1.6875h-333.66c-5.0625 0-28.543 1.6172-70.445 4.8516-41.902 3.2344-62.852 7.3828-62.852 12.441v11.812c0 4.5 20.949 8.5078 62.852 12.023 41.902 3.5156 65.383 5.2695 70.445 5.2695zm125.28-207.54h-42.602c-3.375 1.125-3.375 2.25 0 3.375h42.602zm-43.445 8.4375h-5.4844v-13.5h5.4844c17.152-6.1875 33.605-9.9844 49.352-11.391l4.6406-25.309 4.6406 0.42188c0.5625-4.2188 1.6875-10.262 3.375-18.137-28.684-0.5625-64.398 1.6875-107.14 6.75 3.6562 4.2148 7.4531 7.8711 11.391 10.965 4.7812 3.375 9.4219 5.625 13.918 6.75l12.656 2.9531-11.812 5.9062c-13.496 6.75-30.23 10.121-50.195 10.121-5.0625 0-8.5781-0.14062-10.547-0.42188-4.2188-0.5625-7.5898-1.1211-10.121-1.6836l-3.375-1.2656v-5.4844l-24.043-17.297c-41.34 5.625-69.32 8.5781-83.945 8.8594-31.496 0.28125-47.242 11.953-47.242 35.012 0 22.215 15.746 33.887 47.242 35.012 18.844 0.28125 46.824 3.2344 83.945 8.8594l24.043-17.297v-5.4844l3.375-1.2656c2.5312-0.84375 5.9023-1.4062 10.121-1.6875 1.9688-0.28125 5.4844-0.42187 10.547-0.42187 19.965 0 36.699 3.375 50.195 10.125l11.812 5.4844-12.656 3.375c-4.4961 0.84375-9.1367 3.0938-13.918 6.75-3.6562 2.2461-7.4531 5.7617-11.391 10.543 40.777 5.0625 76.492 7.4531 107.14 7.1719-1.6875-7.3125-2.8125-13.359-3.375-18.137h-4.6406l-4.6406-24.891c-17.434-2.25-33.887-6.043-49.352-11.387zm48.508-20.25c-12.652 1.6875-23.762 3.9375-33.324 6.75h29.105l3.7969-4.2188zm-4.2188 20.25h-29.105c9.5625 2.5312 20.672 4.7812 33.324 6.7461l-0.42188-2.5273zm136.67-8.4375c0-8.4375-4.2188-12.656-12.652-12.656h-21.516c-6.4688-12.652-16.59-18.98-30.371-18.98l-58.211-5.0625-5.9062 29.527-4.2188 5.0625v7.5938l4.2188 5.0625 5.9062 29.105 58.211-5.0625c15.469 0 26.012-7.3125 31.637-21.934h20.25c8.4336 0 12.652-4.2188 12.652-12.656zm-46.82 1.6875c0-11.531-5.9062-17.297-17.719-17.297-11.527 0-17.293 5.7656-17.293 17.297 0 11.812 5.7656 17.715 17.293 17.715 11.812 0 17.719-5.9023 17.719-17.715zm4.6406 0c0 14.902-7.4531 22.355-22.359 22.355-14.902 0-22.355-7.4531-22.355-22.355 0-14.906 7.4531-22.355 22.355-22.355 14.906 0 22.359 7.4492 22.359 22.355zm-13.922 0c0-5.625-2.8125-8.4375-8.4375-8.4375-5.3438 0-8.0156 2.8125-8.0156 8.4375s2.6719 8.4375 8.0156 8.4375c5.625 0 8.4375-2.8125 8.4375-8.4375zm4.6406 0c0 8.7188-4.3594 13.078-13.078 13.078-8.4375 0-12.652-4.3594-12.652-13.078s4.2148-13.078 12.652-13.078c8.7188 0 13.078 4.3594 13.078 13.078zm-43.871-2.1094v4.2188h-35.012v-4.2188zm258.58 2.1094c-0.5625-8.4375-4.7812-12.656-12.656-12.656-8.4336 0-12.652 4.2188-12.652 12.656s4.2188 12.656 12.652 12.656c8.4375 0 12.656-4.2188 12.656-12.656zm4.6406 0c0 11.531-5.7656 17.293-17.297 17.293-11.527 0-17.293-5.7617-17.293-17.293s5.7656-17.297 17.293-17.297c11.531 0 17.297 5.7656 17.297 17.297zm32.48 0c0-13.781-4.9219-25.59-14.766-35.434-9.5586-9.5625-21.23-14.344-35.012-14.344-15.184 0-31.777 5.7656-49.773 17.297-18.559 11.531-27.84 22.355-27.84 32.48 0 9.8438 9.2812 20.668 27.84 32.48 17.996 11.531 34.59 17.293 49.773 17.293 13.781 0 25.453-4.918 35.012-14.762 9.8438-9.5625 14.766-21.234 14.766-35.012zm5.0625 0c0 14.902-5.3438 27.699-16.031 38.387-10.684 10.684-23.621 16.027-38.809 16.027-15.746 0-33.18-6.0469-52.305-18.137-20.246-12.656-30.371-24.746-30.371-36.277s10.125-23.762 30.371-36.699c19.125-12.094 36.559-18.137 52.305-18.137 14.625 0 27.562 5.3398 38.809 16.027 10.688 10.969 16.031 23.902 16.031 38.809zm-54.418-29.105c-3.9336 0-10.262 1.6875-18.98 5.0625-7.875 3.9375-11.812 6.4648-11.812 7.5898v32.48c0 3.0938 3.9375 5.625 11.812 7.5938 7.875 3.375 14.203 5.0625 18.98 5.0625 19.406 0 29.391-9.2812 29.953-27.84 0-19.688-9.9844-29.668-29.953-29.949zm34.59 29.105v0.84375c0 21.371-11.527 32.34-34.59 32.902-4.4961 0-11.527-1.8281-21.09-5.4844-7.0312-3.9375-10.969-6.3281-11.809-7.1719-1.6875-1.4062-2.5312-3.0938-2.5312-5.0625v-32.48c0-1.4062 0.70312-2.9492 2.1094-4.6367 3.0898-2.8125 7.168-5.2031 12.23-7.1719 9-3.6562 16.031-5.4844 21.09-5.4844 22.5 0.28125 34.027 11.531 34.59 33.746zm-448.4-206.27h-333.66c-5.0625 0-28.543 1.6875-70.445 5.0625-41.902 3.375-62.852 7.5938-62.852 12.656v11.387c0 4.7812 20.949 8.8594 62.852 12.234 41.902 3.375 65.383 5.0625 70.445 5.0625h333.66c3.6562 1.4062 7.4531 2.1094 11.391 2.1094h64.961c5.3438 0 12.867-2.25 22.566-6.75 9.7031-4.5 14.555-10.547 14.555-18.137 0.28125-16.875-12.094-25.312-37.121-25.312h-64.961c-4.7812 0-8.5781 0.5625-11.391 1.6875z" fill-rule="evenodd"/>
4
+ </svg>
package/README.md ADDED
@@ -0,0 +1,150 @@
1
+ <p align="center">
2
+ <img
3
+ class="project-logo"
4
+ src="./NCC-1701-a-blue.svg#gh-light-mode-only"
5
+ alt="WarpDrive"
6
+ width="120px"
7
+ title="WarpDrive" />
8
+ <img
9
+ class="project-logo"
10
+ src="./NCC-1701-a.svg#gh-dark-mode-only"
11
+ alt="WarpDrive"
12
+ width="120px"
13
+ title="WarpDrive" />
14
+ </p>
15
+
16
+ <h3 align="center">⚡️ Simple, Fast HTTP Mocking</h3>
17
+ <p align="center">Ideal for Test Suites</p>
18
+
19
+ <p align="center">
20
+ <img
21
+ src="./pnpm-install-logo.png"
22
+ alt="WarpDrive Holodeck"
23
+ width="320px"
24
+ title="WarpDrive Holodeck" />
25
+ </p>
26
+
27
+
28
+ - ⚡️ Real network requests
29
+ - brotli compression
30
+ - http/2
31
+ - no CORS preflight requests
32
+ - 💜 Unparalleled DX
33
+ - debug real network requests
34
+ - every request is scoped to a test
35
+ - run as many tests as desired simultaneously
36
+ - 🔥 Blazing Fast Tests
37
+ - record your tests when you change them
38
+ - replays from cache until you change them again
39
+ - zero-work: setup work is skipped when in replay mode
40
+
41
+ ## Installation
42
+
43
+ > ⚠️ Private
44
+
45
+ This package may currently only be used within EmberData. A public version is coming soon 💜
46
+
47
+ ```json
48
+ "devDependencies": {
49
+ "@warp-drive/holodeck": "workspace:*"
50
+ }
51
+ ```
52
+
53
+ ## Usage
54
+ #### Mocking from Within a Test
55
+
56
+ ```ts
57
+ import { GET } from '@warp-drive/holodeck/mock';
58
+
59
+ await GET(context, 'users/1', () => ({
60
+ data: {
61
+ id: '1',
62
+ type: 'user',
63
+ attributes: {
64
+ name: 'Chris Thoburn',
65
+ },
66
+ },
67
+
68
+ // set RECORD to false or remove
69
+ // the options hash entirely once the request
70
+ // has been recorded
71
+ }), { RECORD: true });
72
+ ```
73
+
74
+ ## Motivations
75
+
76
+ Comprehensive DX around data management should extend to testing.
77
+
78
+ ### ✨ Amazing Developer Experience
79
+
80
+ EmberData already understands your data schemas. Building a mocking utility with tight integration into your data usage patterns could bring enormous DX and test suite performance benefits.
81
+
82
+ Building a real mock server instead of intercepting requests in the browser or via ServiceWorker gives us out-of-the-box DX, better tunability, and greater ability to optimize test suite performance. Speed is the ultimate DX.
83
+
84
+ ### 🔥 Blazing Fast Tests
85
+
86
+ We've noticed test suites spending an enormous amount of time creating and tearing down mock state in between tests. To combat this, we want to provide
87
+ an approach built over `http/3` (`http/2` for now) utilizing aggressive caching
88
+ and `brotli` minification in a way that can be replayed over and over again.
89
+
90
+ Basically, pay the cost when you write the test. Forever after skip the cost until you need to edit the test again.
91
+
92
+ ### ♥️ Credits
93
+
94
+ <details>
95
+ <summary>Brought to you with ♥️ love by <a href="https://emberjs.com" title="EmberJS">🐹 Ember</a></summary>
96
+
97
+ <style type="text/css">
98
+ img.project-logo {
99
+ padding: 0 5em 1em 5em;
100
+ width: 100px;
101
+ border-bottom: 2px solid #0969da;
102
+ margin: 0 auto;
103
+ display: block;
104
+ }
105
+ details > summary {
106
+ font-size: 1.1rem;
107
+ line-height: 1rem;
108
+ margin-bottom: 1rem;
109
+ }
110
+ details {
111
+ font-size: 1rem;
112
+ }
113
+ details > summary strong {
114
+ display: inline-block;
115
+ padding: .2rem 0;
116
+ color: #000;
117
+ border-bottom: 3px solid #0969da;
118
+ }
119
+
120
+ details > details {
121
+ margin-left: 2rem;
122
+ }
123
+ details > details > summary {
124
+ font-size: 1rem;
125
+ line-height: 1rem;
126
+ margin-bottom: 1rem;
127
+ }
128
+ details > details > summary strong {
129
+ display: inline-block;
130
+ padding: .2rem 0;
131
+ color: #555;
132
+ border-bottom: 2px solid #555;
133
+ }
134
+ details > details {
135
+ font-size: .85rem;
136
+ }
137
+
138
+ @media (prefers-color-scheme: dark) {
139
+ details > summary strong {
140
+ color: #fff;
141
+ }
142
+ }
143
+ @media (prefers-color-scheme: dark) {
144
+ details > details > summary strong {
145
+ color: #afaba0;
146
+ border-bottom: 2px solid #afaba0;
147
+ }
148
+ }
149
+ </style>
150
+ </details>
@@ -0,0 +1,3 @@
1
+ import pm2 from './pm2.js';
2
+
3
+ await pm2('start', process.argv.slice(2));
@@ -0,0 +1,3 @@
1
+ import pm2 from './pm2.js';
2
+
3
+ await pm2('stop', process.argv.slice(2));
package/bin/cmd/pm2.js ADDED
@@ -0,0 +1,38 @@
1
+ /* eslint-disable no-console */
2
+ /* global Bun, globalThis */
3
+ const { process } = globalThis;
4
+ import pm2 from 'pm2';
5
+ import fs from 'fs';
6
+
7
+ export default async function pm2Delegate(cmd, _args) {
8
+ const pkg = JSON.parse(fs.readFileSync('./package.json'), 'utf8');
9
+
10
+ return new Promise((resolve, reject) => {
11
+ pm2.connect((err) => {
12
+ if (err) {
13
+ console.log('not able to connect to pm2');
14
+ console.error(err);
15
+ process.exit(2);
16
+ }
17
+
18
+ const options = {
19
+ script: './holodeck.mjs',
20
+ name: pkg.name + '::holodeck',
21
+ cwd: process.cwd(),
22
+ args: cmd === 'start' ? '-f' : '',
23
+ };
24
+
25
+ pm2[cmd](cmd === 'start' ? options : options.name, (err, apps) => {
26
+ pm2.disconnect(); // Disconnects from PM2
27
+ if (err) {
28
+ console.log(`not able to ${cmd} pm2 for ${options.name}`);
29
+ console.error(err);
30
+ reject(err);
31
+ } else {
32
+ console.log(`pm2 ${cmd} successful for ${options.name}`);
33
+ resolve();
34
+ }
35
+ });
36
+ });
37
+ });
38
+ }
package/bin/cmd/run.js ADDED
@@ -0,0 +1,50 @@
1
+ /* eslint-disable no-console */
2
+ /* global Bun, globalThis */
3
+ const isBun = typeof Bun !== 'undefined';
4
+ const { process } = globalThis;
5
+ import { spawn } from './spawn.js';
6
+ import fs from 'fs';
7
+
8
+ export default async function run(args) {
9
+ const pkg = JSON.parse(fs.readFileSync('./package.json'), 'utf8');
10
+ const cmd = args[0];
11
+ const isPkgScript = pkg.scripts[cmd];
12
+
13
+ if (isBun) {
14
+ await spawn(['bun', 'run', 'holodeck:start-program']);
15
+
16
+ let exitCode = 0;
17
+ try {
18
+ await spawn(['bun', 'run', ...args]);
19
+ } catch (e) {
20
+ exitCode = e;
21
+ }
22
+ await spawn(['bun', 'run', 'holodeck:end-program']);
23
+ if (exitCode !== 0) {
24
+ process.exit(exitCode);
25
+ }
26
+ return;
27
+ } else {
28
+ await spawn(['pnpm', 'run', 'holodeck:start-program']);
29
+
30
+ let exitCode = 0;
31
+ try {
32
+ if (isPkgScript) {
33
+ const cmdArgs = pkg.scripts[cmd].split(' ');
34
+ if (args.length > 1) {
35
+ cmdArgs.push(...args.slice(1));
36
+ }
37
+ console.log({ cmdArgs });
38
+ await spawn(cmdArgs);
39
+ } else {
40
+ await spawn(['pnpm', 'exec', ...args]);
41
+ }
42
+ } catch (e) {
43
+ exitCode = e;
44
+ }
45
+ await spawn(['pnpm', 'run', 'holodeck:end-program']);
46
+ if (exitCode !== 0) {
47
+ process.exit(exitCode);
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,40 @@
1
+ /* eslint-disable no-console */
2
+ /* global Bun, globalThis */
3
+ const isBun = typeof Bun !== 'undefined';
4
+
5
+ export async function spawn(args, options) {
6
+ if (isBun) {
7
+ const proc = Bun.spawn(args, {
8
+ env: process.env,
9
+ cwd: process.cwd(),
10
+ stdout: 'inherit',
11
+ stderr: 'inherit',
12
+ });
13
+ await proc.exited;
14
+ if (proc.exitCode !== 0) {
15
+ throw proc.exitCode;
16
+ }
17
+ return;
18
+ }
19
+
20
+ const { spawn } = await import('node:child_process');
21
+
22
+ // eslint-disable-next-line no-inner-declarations
23
+ function pSpawn(cmd, args, opts) {
24
+ return new Promise((resolve, reject) => {
25
+ const proc = spawn(cmd, args, opts);
26
+ proc.on('exit', (code) => {
27
+ if (code === 0) {
28
+ resolve();
29
+ } else {
30
+ reject(code);
31
+ }
32
+ });
33
+ });
34
+ }
35
+
36
+ await pSpawn(args.shift(), args, {
37
+ stdio: 'inherit',
38
+ shell: true,
39
+ });
40
+ }
@@ -0,0 +1,63 @@
1
+ #!/bin/sh -
2
+ ':'; /*-
3
+ test1=$(bun --version 2>&1) && exec bun "$0" "$@"
4
+ test2=$(node --version 2>&1) && exec node "$0" "$@"
5
+ exec printf '%s\n' "$test1" "$test2" 1>&2
6
+ */
7
+ /* eslint-disable no-console */
8
+ /* global Bun, globalThis */
9
+
10
+ import chalk from 'chalk';
11
+ import { spawn } from './cmd/spawn.js';
12
+
13
+ const isBun = typeof Bun !== 'undefined';
14
+ const { process } = globalThis;
15
+
16
+ const args = isBun ? Bun.argv.slice(2) : process.argv.slice(2);
17
+ const command = args.shift();
18
+
19
+ const BUN_SUPPORTS_PM2 = false;
20
+ const BUN_SUPPORTS_HTTP2 = false;
21
+
22
+ if (command === 'run') {
23
+ console.log(
24
+ chalk.grey(
25
+ `\n\t@${chalk.greenBright('warp-drive')}/${chalk.magentaBright(
26
+ 'holodeck'
27
+ )} 🌅\n\t=================================}\n`
28
+ ) +
29
+ chalk.grey(
30
+ `\n\tHolodeck Access Granted\n\t\tprogram: ${chalk.green(args.join(' '))}\n\t\tengine: ${chalk.cyan(
31
+ isBun ? 'bun@' + Bun.version : 'node'
32
+ )}`
33
+ )
34
+ );
35
+ const run = await import('./cmd/run.js');
36
+ await run.default(args);
37
+ } else if (command === 'start') {
38
+ console.log(chalk.grey(`\n\tStarting Subroutines (mode:${chalk.cyan(isBun ? 'bun' : 'node')})`));
39
+
40
+ if (!isBun || (BUN_SUPPORTS_HTTP2 && BUN_SUPPORTS_PM2)) {
41
+ const pm2 = await import('./cmd/pm2.js');
42
+ await pm2.default('start', args);
43
+ } else {
44
+ console.log(`Downgrading to node to run pm2 due lack of http/2 or pm2 support in Bun`);
45
+ const __dirname = import.meta.dir;
46
+ const programPath = __dirname + '/cmd/_start.js';
47
+ await spawn(['node', programPath, ...args]);
48
+ }
49
+ } else if (command === 'end') {
50
+ console.log(chalk.grey(`\n\tEnding Subroutines (mode:${chalk.cyan(isBun ? 'bun' : 'node')})`));
51
+
52
+ if (!isBun || (BUN_SUPPORTS_HTTP2 && BUN_SUPPORTS_PM2)) {
53
+ const pm2 = await import('./cmd/pm2.js');
54
+ await pm2.default('stop', args);
55
+ } else {
56
+ console.log(`Downgrading to node to run pm2 due lack of http/2 or pm2 support in Bun`);
57
+ const __dirname = import.meta.dir;
58
+ const programPath = __dirname + '/cmd/_stop.js';
59
+ await spawn(['node', programPath, ...args]);
60
+ }
61
+
62
+ console.log(`\n\t${chalk.grey('The Computer has ended the program')}\n`);
63
+ }
package/dist/index.js ADDED
@@ -0,0 +1,69 @@
1
+ const TEST_IDS = new WeakMap();
2
+ function setTestId(context, str) {
3
+ if (str && TEST_IDS.has(context)) {
4
+ throw new Error(`MockServerHandler is already configured with a testId.`);
5
+ }
6
+ if (str) {
7
+ TEST_IDS.set(context, {
8
+ id: str,
9
+ request: 0,
10
+ mock: 0
11
+ });
12
+ } else {
13
+ TEST_IDS.delete(context);
14
+ }
15
+ }
16
+ let IS_RECORDING = false;
17
+ function setIsRecording(value) {
18
+ IS_RECORDING = Boolean(value);
19
+ }
20
+ function getIsRecording() {
21
+ return IS_RECORDING;
22
+ }
23
+ class MockServerHandler {
24
+ constructor(owner) {
25
+ this.owner = owner;
26
+ }
27
+ async request(context, next) {
28
+ const test = TEST_IDS.get(this.owner);
29
+ if (!test) {
30
+ throw new Error(`MockServerHandler is not configured with a testId. Use setTestId to set the testId for each test`);
31
+ }
32
+ const request = Object.assign({}, context.request);
33
+ const isRecording = request.url.endsWith('/__record');
34
+ const firstChar = request.url.includes('?') ? '&' : '?';
35
+ const queryForTest = `${firstChar}__xTestId=${test.id}&__xTestRequestNumber=${isRecording ? test.mock++ : test.request++}`;
36
+ request.url = request.url + queryForTest;
37
+ request.mode = 'cors';
38
+ request.credentials = 'omit';
39
+ request.referrerPolicy = '';
40
+ try {
41
+ return await next(request);
42
+ } catch (e) {
43
+ if (e instanceof Error && !(e instanceof DOMException)) {
44
+ e.message = e.message.replace(queryForTest, '');
45
+ }
46
+ throw e;
47
+ }
48
+ }
49
+ }
50
+ async function mock(owner, generate, isRecording) {
51
+ const test = TEST_IDS.get(owner);
52
+ if (!test) {
53
+ throw new Error(`Cannot call "mock" before configuring a testId. Use setTestId to set the testId for each test`);
54
+ }
55
+ const testMockNum = test.mock++;
56
+ if (getIsRecording() || isRecording) {
57
+ const url = `https://localhost:1135/__record?__xTestId=${test.id}&__xTestRequestNumber=${testMockNum}`;
58
+ await fetch(url, {
59
+ method: 'POST',
60
+ body: JSON.stringify(generate()),
61
+ mode: 'cors',
62
+ credentials: 'omit',
63
+ referrerPolicy: ''
64
+ });
65
+ }
66
+ }
67
+
68
+ export { MockServerHandler, getIsRecording, mock, setIsRecording, setTestId };
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../client/index.ts"],"sourcesContent":["import type { Handler, NextFn, RequestContext, RequestInfo, StructuredDataDocument } from '@ember-data/request';\n\nimport type { ScaffoldGenerator } from './mock';\n\nconst TEST_IDS = new WeakMap<object, { id: string; request: number; mock: number }>();\n\nexport function setTestId(context: object, str: string | null) {\n if (str && TEST_IDS.has(context)) {\n throw new Error(`MockServerHandler is already configured with a testId.`);\n }\n if (str) {\n TEST_IDS.set(context, { id: str, request: 0, mock: 0 });\n } else {\n TEST_IDS.delete(context);\n }\n}\n\nlet IS_RECORDING = false;\nexport function setIsRecording(value: boolean) {\n IS_RECORDING = Boolean(value);\n}\nexport function getIsRecording() {\n return IS_RECORDING;\n}\n\nexport class MockServerHandler implements Handler {\n declare owner: object;\n constructor(owner: object) {\n this.owner = owner;\n }\n async request<T>(context: RequestContext, next: NextFn<T>): Promise<StructuredDataDocument<T>> {\n const test = TEST_IDS.get(this.owner);\n if (!test) {\n throw new Error(\n `MockServerHandler is not configured with a testId. Use setTestId to set the testId for each test`\n );\n }\n\n const request: RequestInfo = Object.assign({}, context.request);\n const isRecording = request.url!.endsWith('/__record');\n const firstChar = request.url!.includes('?') ? '&' : '?';\n const queryForTest = `${firstChar}__xTestId=${test.id}&__xTestRequestNumber=${\n isRecording ? test.mock++ : test.request++\n }`;\n request.url = request.url + queryForTest;\n\n request.mode = 'cors';\n request.credentials = 'omit';\n request.referrerPolicy = '';\n\n try {\n return await next(request);\n } catch (e) {\n if (e instanceof Error && !(e instanceof DOMException)) {\n e.message = e.message.replace(queryForTest, '');\n }\n throw e;\n }\n }\n}\n\nexport async function mock(owner: object, generate: ScaffoldGenerator, isRecording?: boolean) {\n const test = TEST_IDS.get(owner);\n if (!test) {\n throw new Error(`Cannot call \"mock\" before configuring a testId. Use setTestId to set the testId for each test`);\n }\n const testMockNum = test.mock++;\n if (getIsRecording() || isRecording) {\n const url = `https://localhost:1135/__record?__xTestId=${test.id}&__xTestRequestNumber=${testMockNum}`;\n await fetch(url, {\n method: 'POST',\n body: JSON.stringify(generate()),\n mode: 'cors',\n credentials: 'omit',\n referrerPolicy: '',\n });\n }\n}\n"],"names":["TEST_IDS","WeakMap","setTestId","context","str","has","Error","set","id","request","mock","delete","IS_RECORDING","setIsRecording","value","Boolean","getIsRecording","MockServerHandler","constructor","owner","next","test","get","Object","assign","isRecording","url","endsWith","firstChar","includes","queryForTest","mode","credentials","referrerPolicy","e","DOMException","message","replace","generate","testMockNum","fetch","method","body","JSON","stringify"],"mappings":"AAIA,MAAMA,QAAQ,GAAG,IAAIC,OAAO,EAAyD,CAAA;AAE9E,SAASC,SAASA,CAACC,OAAe,EAAEC,GAAkB,EAAE;EAC7D,IAAIA,GAAG,IAAIJ,QAAQ,CAACK,GAAG,CAACF,OAAO,CAAC,EAAE;AAChC,IAAA,MAAM,IAAIG,KAAK,CAAE,CAAA,sDAAA,CAAuD,CAAC,CAAA;AAC3E,GAAA;AACA,EAAA,IAAIF,GAAG,EAAE;AACPJ,IAAAA,QAAQ,CAACO,GAAG,CAACJ,OAAO,EAAE;AAAEK,MAAAA,EAAE,EAAEJ,GAAG;AAAEK,MAAAA,OAAO,EAAE,CAAC;AAAEC,MAAAA,IAAI,EAAE,CAAA;AAAE,KAAC,CAAC,CAAA;AACzD,GAAC,MAAM;AACLV,IAAAA,QAAQ,CAACW,MAAM,CAACR,OAAO,CAAC,CAAA;AAC1B,GAAA;AACF,CAAA;AAEA,IAAIS,YAAY,GAAG,KAAK,CAAA;AACjB,SAASC,cAAcA,CAACC,KAAc,EAAE;AAC7CF,EAAAA,YAAY,GAAGG,OAAO,CAACD,KAAK,CAAC,CAAA;AAC/B,CAAA;AACO,SAASE,cAAcA,GAAG;AAC/B,EAAA,OAAOJ,YAAY,CAAA;AACrB,CAAA;AAEO,MAAMK,iBAAiB,CAAoB;EAEhDC,WAAWA,CAACC,KAAa,EAAE;IACzB,IAAI,CAACA,KAAK,GAAGA,KAAK,CAAA;AACp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AE,EAAE,CAAC,CAAA;AACjD,OAAA;AACA,MAAA,MAAMI,CAAC,CAAA;AACT,KAAA;AACF,GAAA;AACF,CAAA;AAEO,eAAexB,IAAIA,CAACS,KAAa,EAAEmB,QAA2B,EAAEb,WAAqB,EAAE;AAC5F,EAAA,MAAMJ,IAAI,GAAGrB,QAAQ,CAACsB,GAAG,CAACH,KAAK,CAAC,CAAA;EAChC,IAAI,CAACE,IAAI,EAAE;AACT,IAAA,MAAM,IAAIf,KAAK,CAAE,CAAA,6FAAA,CAA8F,CAAC,CAAA;AAClH,GAAA;AACA,EAAA,MAAMiC,WAAW,GAAGlB,IAAI,CAACX,IAAI,EAAE,CAAA;AAC/B,EAAA,IAAIM,cAAc,EAAE,IAAIS,WAAW,EAAE;IACnC,MAAMC,GAAG,GAAI,CAA4CL,0CAAAA,EAAAA,IAAI,CAACb,EAAG,CAAA,sBAAA,EAAwB+B,WAAY,CAAC,CAAA,CAAA;IACtG,MAAMC,KAAK,CAACd,GAAG,EAAE;AACfe,MAAAA,MAAM,EAAE,MAAM;MACdC,IAAI,EAAEC,IAAI,CAACC,SAAS,CAACN,QAAQ,EAAE,CAAC;AAChCP,MAAAA,IAAI,EAAE,MAAM;AACZC,MAAAA,WAAW,EAAE,MAAM;AACnBC,MAAAA,cAAc,EAAE,EAAA;AAClB,KAAC,CAAC,CAAA;AACJ,GAAA;AACF;;;;"}
package/dist/mock.js ADDED
@@ -0,0 +1,38 @@
1
+ import { mock, getIsRecording } from './index.js';
2
+
3
+ /**
4
+ * Sets up Mocking for a GET request on the mock server
5
+ * for the supplied url.
6
+ *
7
+ * The response body is generated by the supplied response function.
8
+ *
9
+ * Available options:
10
+ * - status: the status code to return (default: 200)
11
+ * - headers: the headers to return (default: {})
12
+ * - body: the body to match against for the request (default: null)
13
+ * - RECORD: whether to record the request (default: false)
14
+ *
15
+ * @param url the url to mock, relative to the mock server host (e.g. `users/1`)
16
+ * @param response a function which generates the response to return
17
+ * @param options status, headers for the response, body to match against for the request, and whether to record the request
18
+ * @return
19
+ */
20
+ function GET(owner, url, response, options) {
21
+ return mock(owner, () => ({
22
+ status: options?.status ?? 200,
23
+ statusText: options?.statusText ?? 'OK',
24
+ headers: options?.headers ?? {},
25
+ body: options?.body ?? null,
26
+ method: 'GET',
27
+ url,
28
+ response: response()
29
+ }), getIsRecording() || (options?.RECORD ?? false));
30
+ }
31
+ function POST() {}
32
+ function PUT() {}
33
+ function PATCH() {}
34
+ function DELETE() {}
35
+ function QUERY() {}
36
+
37
+ export { DELETE, GET, PATCH, POST, PUT, QUERY };
38
+ //# sourceMappingURL=mock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock.js","sources":["../client/mock.ts"],"sourcesContent":["import { getIsRecording, mock } from '.';\n\nexport interface Scaffold {\n status: number;\n statusText?: string;\n headers: Record<string, string>;\n body: Record<string, string> | string | null;\n method: string;\n url: string;\n response: Record<string, unknown>;\n}\n\nexport type ScaffoldGenerator = () => Scaffold;\nexport type ResponseGenerator = () => Record<string, unknown>;\n\n/**\n * Sets up Mocking for a GET request on the mock server\n * for the supplied url.\n *\n * The response body is generated by the supplied response function.\n *\n * Available options:\n * - status: the status code to return (default: 200)\n * - headers: the headers to return (default: {})\n * - body: the body to match against for the request (default: null)\n * - RECORD: whether to record the request (default: false)\n *\n * @param url the url to mock, relative to the mock server host (e.g. `users/1`)\n * @param response a function which generates the response to return\n * @param options status, headers for the response, body to match against for the request, and whether to record the request\n * @return\n */\nexport function GET(\n owner: object,\n url: string,\n response: ResponseGenerator,\n options?: Partial<Omit<Scaffold, 'response' | 'url' | 'method'>> & { RECORD?: boolean }\n): Promise<void> {\n return mock(\n owner,\n () => ({\n status: options?.status ?? 200,\n statusText: options?.statusText ?? 'OK',\n headers: options?.headers ?? {},\n body: options?.body ?? null,\n method: 'GET',\n url,\n response: response(),\n }),\n getIsRecording() || (options?.RECORD ?? false)\n );\n}\nexport function POST() {}\nexport function PUT() {}\nexport function PATCH() {}\nexport function DELETE() {}\nexport function QUERY() {}\n"],"names":["GET","owner","url","response","options","mock","status","statusText","headers","body","method","getIsRecording","RECORD","POST","PUT","PATCH","DELETE","QUERY"],"mappings":";;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,GAAGA,CACjBC,KAAa,EACbC,GAAW,EACXC,QAA2B,EAC3BC,OAAuF,EACxE;AACf,EAAA,OAAOC,IAAI,CACTJ,KAAK,EACL,OAAO;AACLK,IAAAA,MAAM,EAAEF,OAAO,EAAEE,MAAM,IAAI,GAAG;AAC9BC,IAAAA,UAAU,EAAEH,OAAO,EAAEG,UAAU,IAAI,IAAI;AACvCC,IAAAA,OAAO,EAAEJ,OAAO,EAAEI,OAAO,IAAI,EAAE;AAC/BC,IAAAA,IAAI,EAAEL,OAAO,EAAEK,IAAI,IAAI,IAAI;AAC3BC,IAAAA,MAAM,EAAE,KAAK;IACbR,GAAG;IACHC,QAAQ,EAAEA,QAAQ,EAAC;AACrB,GAAC,CAAC,EACFQ,cAAc,EAAE,KAAKP,OAAO,EAAEQ,MAAM,IAAI,KAAK,CAC/C,CAAC,CAAA;AACH,CAAA;AACO,SAASC,IAAIA,GAAG,EAAC;AACjB,SAASC,GAAGA,GAAG,EAAC;AAChB,SAASC,KAAKA,GAAG,EAAC;AAClB,SAASC,MAAMA,GAAG,EAAC;AACnB,SAASC,KAAKA,GAAG;;;;"}
package/package.json ADDED
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "@warp-drive/holodeck",
3
+ "description": "⚡️ Simple, Fast HTTP Mocking for Tests",
4
+ "version": "0.0.0-alpha.3",
5
+ "license": "MIT",
6
+ "author": "Chris Thoburn <runspired@users.noreply.github.com>",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+ssh://git@github.com:emberjs/data.git",
10
+ "directory": "packages/holodeck"
11
+ },
12
+ "homepage": "https://github.com/emberjs/data",
13
+ "bugs": "https://github.com/emberjs/data/issues",
14
+ "engines": {
15
+ "node": ">= 20.11.0"
16
+ },
17
+ "keywords": [
18
+ "http-mock"
19
+ ],
20
+ "volta": {
21
+ "extends": "../../package.json"
22
+ },
23
+ "dependencies": {
24
+ "@hono/node-server": "^1.3.3",
25
+ "chalk": "^4.1.2",
26
+ "hono": "^3.11.3",
27
+ "pm2": "^5.3.1",
28
+ "pnpm-sync-dependencies-meta-injected": "0.0.10"
29
+ },
30
+ "files": [
31
+ "bin",
32
+ "dist",
33
+ "README.md",
34
+ "LICENSE.md",
35
+ "server",
36
+ "NCC-1701-a.svg",
37
+ "NCC-1701-a-blue.svg"
38
+ ],
39
+ "bin": {
40
+ "holodeck": "./bin/holodeck.js"
41
+ },
42
+ "peerDependencies": {
43
+ "@ember-data/request": "5.4.0-alpha.17",
44
+ "@warp-drive/core-types": "0.0.0-alpha.3"
45
+ },
46
+ "devDependencies": {
47
+ "@babel/cli": "^7.23.4",
48
+ "@babel/core": "^7.23.7",
49
+ "@babel/plugin-transform-typescript": "^7.23.6",
50
+ "@babel/preset-env": "^7.23.8",
51
+ "@babel/preset-typescript": "^7.23.3",
52
+ "@babel/runtime": "^7.23.8",
53
+ "@ember-data/request": "5.4.0-alpha.17",
54
+ "@embroider/addon-dev": "^4.1.2",
55
+ "@rollup/plugin-babel": "^6.0.4",
56
+ "@rollup/plugin-node-resolve": "^15.2.3",
57
+ "@warp-drive/core-types": "0.0.0-alpha.3",
58
+ "@warp-drive/internal-config": "5.4.0-alpha.17",
59
+ "rollup": "^4.9.6",
60
+ "typescript": "^5.3.3",
61
+ "walk-sync": "^3.0.0"
62
+ },
63
+ "type": "module",
64
+ "exports": {
65
+ ".": {
66
+ "node": "./server/index.js",
67
+ "bun": "./server/index.js",
68
+ "deno": "./server/index.js",
69
+ "browser": {
70
+ "default": "./dist/index.js"
71
+ },
72
+ "import": {
73
+ "default": "./dist/index.js"
74
+ },
75
+ "default": "./server/index.js"
76
+ },
77
+ "./mock": {
78
+ "default": "./dist/mock.js"
79
+ }
80
+ },
81
+ "dependenciesMeta": {
82
+ "@ember-data/request": {
83
+ "injected": true
84
+ },
85
+ "@warp-drive/core-types": {
86
+ "injected": true
87
+ }
88
+ },
89
+ "scripts": {
90
+ "build:types": "echo \"Types are private\" && exit 0",
91
+ "build:client": "rollup --config",
92
+ "_build": "bun run build:client && bun run build:types",
93
+ "start": "rollup --config --watch",
94
+ "_syncPnpm": "bun run sync-dependencies-meta-injected"
95
+ }
96
+ }
package/server/CERT.md ADDED
@@ -0,0 +1,3 @@
1
+ Generated with `mkcert`
2
+
3
+ It will expire on 9 January 2026 🗓
@@ -0,0 +1,228 @@
1
+ import { serve } from '@hono/node-server';
2
+ import { Hono } from 'hono';
3
+ import { cors } from 'hono/cors';
4
+ import { logger } from 'hono/logger';
5
+ import crypto from 'node:crypto';
6
+ import fs from 'node:fs';
7
+ import http2 from 'node:http2';
8
+ import { dirname } from 'node:path';
9
+ import zlib from 'node:zlib';
10
+ import { fileURLToPath } from 'url';
11
+ import { HTTPException } from 'hono/http-exception';
12
+
13
+ const __dirname = dirname(fileURLToPath(import.meta.url));
14
+
15
+ const DEFAULT_PORT = 1135;
16
+ const BROTLI_OPTIONS = {
17
+ params: {
18
+ [zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT,
19
+ // brotli currently defaults to 11 but lets be explicit
20
+ [zlib.constants.BROTLI_PARAM_QUALITY]: zlib.constants.BROTLI_MAX_QUALITY,
21
+ },
22
+ };
23
+ function compress(code) {
24
+ return zlib.brotliCompressSync(code, BROTLI_OPTIONS);
25
+ }
26
+
27
+ /**
28
+ * removes the protocol, host, and port from a url
29
+ */
30
+ function getNiceUrl(url) {
31
+ const urlObj = new URL(url);
32
+ urlObj.searchParams.delete('__xTestId');
33
+ urlObj.searchParams.delete('__xTestRequestNumber');
34
+ return (urlObj.pathname + urlObj.searchParams.toString()).slice(1);
35
+ }
36
+
37
+ /*
38
+ {
39
+ projectRoot: string;
40
+ testId: string;
41
+ url: string;
42
+ method: string;
43
+ body: string;
44
+ testRequestNumber: number
45
+ }
46
+ */
47
+ function generateFilepath(options) {
48
+ const { body } = options;
49
+ const bodyHash = body ? crypto.createHash('md5').update(body).digest('hex') : null;
50
+ const cacheDir = generateFileDir(options);
51
+ return `${cacheDir}/${bodyHash ? `${bodyHash}-` : 'res'}`;
52
+ }
53
+ function generateFileDir(options) {
54
+ const { projectRoot, testId, url, method, testRequestNumber } = options;
55
+ return `${projectRoot}/.mock-cache/${testId}/${method}-${testRequestNumber}-${url}`;
56
+ }
57
+
58
+ function replayRequest(context, cacheKey) {
59
+ let meta;
60
+ try {
61
+ meta = fs.readFileSync(`${cacheKey}.meta.json`, 'utf-8');
62
+ } catch (e) {
63
+ context.header('Content-Type', 'application/vnd.api+json');
64
+ context.status(400);
65
+ return context.body(
66
+ JSON.stringify({
67
+ errors: [
68
+ {
69
+ status: '400',
70
+ code: 'MOCK_NOT_FOUND',
71
+ title: 'Mock not found',
72
+ detail: `No mock found for ${context.req.method} ${context.req.url}. You may need to record a mock for this request.`,
73
+ },
74
+ ],
75
+ })
76
+ );
77
+ }
78
+
79
+ const metaJson = JSON.parse(meta);
80
+ const bodyPath = `${cacheKey}.body.br`;
81
+
82
+ const headers = new Headers(metaJson.headers || {});
83
+ const bodyInit = metaJson.status !== 204 && metaJson.status < 500 ? fs.createReadStream(bodyPath) : '';
84
+ const response = new Response(bodyInit, {
85
+ status: metaJson.status,
86
+ statusText: metaJson.statusText,
87
+ headers,
88
+ });
89
+
90
+ if (metaJson.status > 400) {
91
+ throw new HTTPException(metaJson.status, { res: response, message: metaJson.statusText });
92
+ }
93
+
94
+ return response;
95
+ }
96
+
97
+ function createTestHandler(projectRoot) {
98
+ const TestHandler = async (context) => {
99
+ const { req } = context;
100
+
101
+ const testId = req.query('__xTestId');
102
+ const testRequestNumber = req.query('__xTestRequestNumber');
103
+ const niceUrl = getNiceUrl(req.url);
104
+
105
+ if (!testId) {
106
+ context.header('Content-Type', 'application/vnd.api+json');
107
+ context.status(400);
108
+ return context.body(
109
+ JSON.stringify({
110
+ errors: [
111
+ {
112
+ status: '400',
113
+ code: 'MISSING_X_TEST_ID_HEADER',
114
+ title: 'Request to the http mock server is missing the `X-Test-Id` header',
115
+ detail:
116
+ "The `X-Test-Id` header is used to identify the test that is making the request to the mock server. This is used to ensure that the mock server is only used for the test that is currently running. If using @ember-data/request add import { MockServerHandler } from '@warp-drive/holodeck'; to your request handlers.",
117
+ source: { header: 'X-Test-Id' },
118
+ },
119
+ ],
120
+ })
121
+ );
122
+ }
123
+
124
+ if (!testRequestNumber) {
125
+ context.header('Content-Type', 'application/vnd.api+json');
126
+ context.status(400);
127
+ return context.body(
128
+ JSON.stringify({
129
+ errors: [
130
+ {
131
+ status: '400',
132
+ code: 'MISSING_X_TEST_REQUEST_NUMBER_HEADER',
133
+ title: 'Request to the http mock server is missing the `X-Test-Request-Number` header',
134
+ detail:
135
+ "The `X-Test-Request-Number` header is used to identify the request number for the current test. This is used to ensure that the mock server response is deterministic for the test that is currently running. If using @ember-data/request add import { MockServerHandler } from '@warp-drive/holodeck'; to your request handlers.",
136
+ source: { header: 'X-Test-Request-Number' },
137
+ },
138
+ ],
139
+ })
140
+ );
141
+ }
142
+
143
+ if (req.method === 'POST' || niceUrl === '__record') {
144
+ const payload = await req.json();
145
+ const { url, headers, method, status, statusText, body, response } = payload;
146
+ const cacheKey = generateFilepath({
147
+ projectRoot,
148
+ testId,
149
+ url,
150
+ method,
151
+ body: body ? JSON.stringify(body) : null,
152
+ testRequestNumber,
153
+ });
154
+ // allow Content-Type to be overridden
155
+ headers['Content-Type'] = headers['Content-Type'] || 'application/vnd.api+json';
156
+ // We always compress and chunk the response
157
+ headers['Content-Encoding'] = 'br';
158
+ // we don't cache since tests will often reuse similar urls for different payload
159
+ headers['Cache-Control'] = 'no-store';
160
+
161
+ const cacheDir = generateFileDir({
162
+ projectRoot,
163
+ testId,
164
+ url,
165
+ method,
166
+ testRequestNumber,
167
+ });
168
+
169
+ fs.mkdirSync(cacheDir, { recursive: true });
170
+ fs.writeFileSync(
171
+ `${cacheKey}.meta.json`,
172
+ JSON.stringify({ url, status, statusText, headers, method, requestBody: body }, null, 2)
173
+ );
174
+ fs.writeFileSync(`${cacheKey}.body.br`, compress(JSON.stringify(response)));
175
+ context.status(204);
176
+ return context.body(null);
177
+ } else {
178
+ const body = await req.text();
179
+ const cacheKey = generateFilepath({
180
+ projectRoot,
181
+ testId,
182
+ url: niceUrl,
183
+ method: req.method,
184
+ body,
185
+ testRequestNumber,
186
+ });
187
+ return replayRequest(context, cacheKey);
188
+ }
189
+ };
190
+
191
+ return TestHandler;
192
+ }
193
+
194
+ /*
195
+ { port?: number, projectRoot: string }
196
+ */
197
+ export function createServer(options) {
198
+ const app = new Hono();
199
+ app.use('*', logger());
200
+ app.use(
201
+ '*',
202
+ cors({
203
+ origin: (origin) =>
204
+ origin.startsWith('http://localhost:') || origin.startsWith('https://localhost:') ? origin : '*',
205
+ allowHeaders: ['Accept', 'Content-Type'],
206
+ allowMethods: ['GET', 'HEAD', 'OPTIONS', 'PUT', 'POST', 'DELETE', 'PATCH'],
207
+ exposeHeaders: ['Content-Length', 'Content-Type'],
208
+ maxAge: 60_000,
209
+ credentials: false,
210
+ })
211
+ );
212
+ app.all('*', createTestHandler(options.projectRoot));
213
+
214
+ serve({
215
+ fetch: app.fetch,
216
+ createServer: (_, requestListener) => {
217
+ return http2.createSecureServer(
218
+ {
219
+ key: fs.readFileSync(`${__dirname}/localhost-key.pem`),
220
+ cert: fs.readFileSync(`${__dirname}/localhost.pem`),
221
+ },
222
+ requestListener
223
+ );
224
+ },
225
+ port: options.port ?? DEFAULT_PORT,
226
+ hostname: 'localhost',
227
+ });
228
+ }
@@ -0,0 +1,28 @@
1
+ -----BEGIN PRIVATE KEY-----
2
+ MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCz8yulPBPYYZH+
3
+ M+kBVOCSj4EmN7Texxd/DXjOJTTpDI8aophZhf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