@absolutejs/absolute 0.5.5 → 0.6.1

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.
@@ -0,0 +1 @@
1
+ <svg id="Bun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 70"><title>Bun Logo</title><path id="Shadow" d="M71.09,20.74c-.16-.17-.33-.34-.5-.5s-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5A26.46,26.46,0,0,1,75.5,35.7c0,16.57-16.82,30.05-37.5,30.05-11.58,0-21.94-4.23-28.83-10.86l.5.5.5.5.5.5.5.5.5.5.5.5.5.5C19.55,65.3,30.14,69.75,42,69.75c20.68,0,37.5-13.48,37.5-30C79.5,32.69,76.46,26,71.09,20.74Z"/><g id="Body"><path id="Background" d="M73,35.7c0,15.21-15.67,27.54-35,27.54S3,50.91,3,35.7C3,26.27,9,17.94,18.22,13S33.18,3,38,3s8.94,4.13,19.78,10C67,17.94,73,26.27,73,35.7Z" style="fill:#fbf0df"/><path id="Bottom_Shadow" data-name="Bottom Shadow" d="M73,35.7a21.67,21.67,0,0,0-.8-5.78c-2.73,33.3-43.35,34.9-59.32,24.94A40,40,0,0,0,38,63.24C57.3,63.24,73,50.89,73,35.7Z" style="fill:#f6dece"/><path id="Light_Shine" data-name="Light Shine" d="M24.53,11.17C29,8.49,34.94,3.46,40.78,3.45A9.29,9.29,0,0,0,38,3c-2.42,0-5,1.25-8.25,3.13-1.13.66-2.3,1.39-3.54,2.15-2.33,1.44-5,3.07-8,4.7C8.69,18.13,3,26.62,3,35.7c0,.4,0,.8,0,1.19C9.06,15.48,20.07,13.85,24.53,11.17Z" style="fill:#fffefc"/><path id="Top" d="M35.12,5.53A16.41,16.41,0,0,1,29.49,18c-.28.25-.06.73.3.59,3.37-1.31,7.92-5.23,6-13.14C35.71,5,35.12,5.12,35.12,5.53Zm2.27,0A16.24,16.24,0,0,1,39,19c-.12.35.31.65.55.36C41.74,16.56,43.65,11,37.93,5,37.64,4.74,37.19,5.14,37.39,5.49Zm2.76-.17A16.42,16.42,0,0,1,47,17.12a.33.33,0,0,0,.65.11c.92-3.49.4-9.44-7.17-12.53C40.08,4.54,39.82,5.08,40.15,5.32ZM21.69,15.76a16.94,16.94,0,0,0,10.47-9c.18-.36.75-.22.66.18-1.73,8-7.52,9.67-11.12,9.45C21.32,16.4,21.33,15.87,21.69,15.76Z" style="fill:#ccbea7;fill-rule:evenodd"/><path id="Outline" d="M38,65.75C17.32,65.75.5,52.27.5,35.7c0-10,6.18-19.33,16.53-24.92,3-1.6,5.57-3.21,7.86-4.62,1.26-.78,2.45-1.51,3.6-2.19C32,1.89,35,.5,38,.5s5.62,1.2,8.9,3.14c1,.57,2,1.19,3.07,1.87,2.49,1.54,5.3,3.28,9,5.27C69.32,16.37,75.5,25.69,75.5,35.7,75.5,52.27,58.68,65.75,38,65.75ZM38,3c-2.42,0-5,1.25-8.25,3.13-1.13.66-2.3,1.39-3.54,2.15-2.33,1.44-5,3.07-8,4.7C8.69,18.13,3,26.62,3,35.7,3,50.89,18.7,63.25,38,63.25S73,50.89,73,35.7C73,26.62,67.31,18.13,57.78,13,54,11,51.05,9.12,48.66,7.64c-1.09-.67-2.09-1.29-3-1.84C42.63,4,40.42,3,38,3Z"/></g><g id="Mouth"><g id="Background-2" data-name="Background"><path d="M45.05,43a8.93,8.93,0,0,1-2.92,4.71,6.81,6.81,0,0,1-4,1.88A6.84,6.84,0,0,1,34,47.71,8.93,8.93,0,0,1,31.12,43a.72.72,0,0,1,.8-.81H44.26A.72.72,0,0,1,45.05,43Z" style="fill:#b71422"/></g><g id="Tongue"><path id="Background-3" data-name="Background" d="M34,47.79a6.91,6.91,0,0,0,4.12,1.9,6.91,6.91,0,0,0,4.11-1.9,10.63,10.63,0,0,0,1-1.07,6.83,6.83,0,0,0-4.9-2.31,6.15,6.15,0,0,0-5,2.78C33.56,47.4,33.76,47.6,34,47.79Z" style="fill:#ff6164"/><path id="Outline-2" data-name="Outline" d="M34.16,47a5.36,5.36,0,0,1,4.19-2.08,6,6,0,0,1,4,1.69c.23-.25.45-.51.66-.77a7,7,0,0,0-4.71-1.93,6.36,6.36,0,0,0-4.89,2.36A9.53,9.53,0,0,0,34.16,47Z"/></g><path id="Outline-3" data-name="Outline" d="M38.09,50.19a7.42,7.42,0,0,1-4.45-2,9.52,9.52,0,0,1-3.11-5.05,1.2,1.2,0,0,1,.26-1,1.41,1.41,0,0,1,1.13-.51H44.26a1.44,1.44,0,0,1,1.13.51,1.19,1.19,0,0,1,.25,1h0a9.52,9.52,0,0,1-3.11,5.05A7.42,7.42,0,0,1,38.09,50.19Zm-6.17-7.4c-.16,0-.2.07-.21.09a8.29,8.29,0,0,0,2.73,4.37A6.23,6.23,0,0,0,38.09,49a6.28,6.28,0,0,0,3.65-1.73,8.3,8.3,0,0,0,2.72-4.37.21.21,0,0,0-.2-.09Z"/></g><g id="Face"><ellipse id="Right_Blush" data-name="Right Blush" cx="53.22" cy="40.18" rx="5.85" ry="3.44" style="fill:#febbd0"/><ellipse id="Left_Bluch" data-name="Left Bluch" cx="22.95" cy="40.18" rx="5.85" ry="3.44" style="fill:#febbd0"/><path id="Eyes" d="M25.7,38.8a5.51,5.51,0,1,0-5.5-5.51A5.51,5.51,0,0,0,25.7,38.8Zm24.77,0A5.51,5.51,0,1,0,45,33.29,5.5,5.5,0,0,0,50.47,38.8Z" style="fill-rule:evenodd"/><path id="Iris" d="M24,33.64a2.07,2.07,0,1,0-2.06-2.07A2.07,2.07,0,0,0,24,33.64Zm24.77,0a2.07,2.07,0,1,0-2.06-2.07A2.07,2.07,0,0,0,48.75,33.64Z" style="fill:#fff;fill-rule:evenodd"/></g></svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#FFFFFF">
2
+ <path d="M256,256A112,112,0,1,0,144,144,112,112,0,0,0,256,256Zm0,32c-69.42,0-208,42.88-208,128v64H464V416C464,330.88,325.42,288,256,288Z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
2
+ <path d="M256,256A112,112,0,1,0,144,144,112,112,0,0,0,256,256Zm0,32c-69.42,0-208,42.88-208,128v64H464V416C464,330.88,325.42,288,256,288Z"/>
3
+ </svg>
@@ -0,0 +1,11 @@
1
+ <svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M424.404 470.816C478.089 423.889 512 354.905 512 278C512 136.615 397.385 22 256 22C114.615 22 0 136.615 0 278C0 352.658 31.9583 419.851 82.9409 466.646L83.1767 465L419.144 355L424.404 470.816Z" fill="#333333"/>
3
+ <path d="M189.915 52.7412L144.5 46L151.303 43.9069C155.402 42.6455 159.248 40.6719 162.662 38.0765L163.73 37.2654C167.845 34.1375 171.12 30.0364 173.259 25.3304C174.414 22.7883 175.224 20.1027 175.665 17.3454L176.173 14.1698C176.72 10.7473 176.692 7.25741 176.09 3.84416C175.834 2.39429 177.279 1.23239 178.64 1.79296L180.498 2.55815C182.829 3.51798 185.084 4.65434 187.242 5.95732L194.965 10.6205C205.229 16.8174 214.226 24.9023 221.48 34.4477L226.616 41.2051C228.529 43.7228 230.783 45.9625 233.313 47.8599C236.088 49.9411 239.164 51.5874 242.435 52.7418L246 54L227.274 54.749C214.785 55.2486 202.278 54.5764 189.915 52.7412Z" fill="#CCCCCC"/>
4
+ <path d="M178.321 93.006L191.79 68.3844C191.922 68.143 191.93 67.8528 191.812 67.6042L187.22 57.9361C184.337 51.8673 178.219 48 171.5 48L170.23 47.9562C161.437 47.653 152.704 46.3829 144.188 44.169L142.504 43.731C135.521 41.9153 128.746 39.3732 122.293 36.1463L119.446 34.723C115.159 32.5797 111.099 30.012 107.325 27.0584L103.55 24.1043C102.428 23.2265 100.803 23.4506 99.9606 24.5992C97.3651 28.1384 95.7379 32.2935 95.2395 36.6541L94.5535 42.6571C94.1854 45.8774 94.1446 49.1267 94.4316 52.3552L96.1031 71.1595C97.3467 85.1501 102.175 98.584 110.123 110.165L111.825 112.645C114.267 116.203 117.113 119.466 120.306 122.369C120.756 122.778 121.329 123.03 121.936 123.084C145.029 125.156 167.194 113.348 178.321 93.006Z" fill="#CCCCCC"/>
5
+ <path d="M127.378 123.538L143.376 116.613C150.438 113.557 152.588 104.577 147.676 98.6533C143.683 93.8378 136.58 93.0803 131.661 96.9453L127.867 99.9256C126.958 100.64 126.127 101.448 125.387 102.336L116.263 113.284C114.982 114.822 115.084 117.084 116.5 118.5L119.318 121.721C119.77 122.237 120.296 122.685 120.878 123.049C122.833 124.271 125.263 124.453 127.378 123.538Z" fill="#EDEDED"/>
6
+ <path d="M147.988 44.8437L147.5 45L148.962 45.4651C155.294 47.4798 161.861 48.66 168.498 48.9761C168.83 48.9919 169.163 48.9534 169.483 48.8619L172.5 48L174 47.5L164.419 45.4172C163.158 45.1431 161.982 44.5687 160.991 43.7426C160.218 43.0981 160.223 41.9084 161.002 41.2708L162.423 40.1084C164.12 38.7197 165.493 36.976 166.444 35C160.934 39.3642 154.682 42.6988 147.988 44.8437Z" fill="#B2B2B2"/>
7
+ <path d="M202.776 219.428L72.2905 452.693C71.643 453.851 70.0687 454.069 69.1308 453.131L66.5 450.5L55.5 438L48.4888 428.927C41.8407 420.323 35.9052 411.192 30.7414 401.624L29.7434 399.775C24.2581 389.611 19.6635 378.991 16.0112 368.034L12.5 357.5C7.22519 338.379 6.01447 318.365 8.94583 298.747L9.06961 297.919C10.354 289.323 12.4034 280.86 15.1935 272.629L21 255.5L25.3334 246.385C32.0537 232.249 41.3193 219.472 52.6669 208.691L58.1719 203.462C69.5529 192.65 83.3937 184.769 98.5 180.5C94.967 181.498 91.3608 182.216 87.7149 182.647L80.5 183.5L75 184L69 185L63 185.561L59 186L56.1186 186.18C55.1927 186.238 54.7576 185.057 55.4998 184.5L55.5002 184.5L59.5273 182.57C72.5066 176.351 83.1766 166.172 90 153.5L94.4475 146.562C99.7511 138.288 106.807 131.28 115.116 126.032L116.833 124.948C119.935 122.989 123.246 121.384 126.705 120.163L142.446 114.607C145.348 113.583 147.69 111.39 148.903 108.561L149.143 108C149.705 106.687 149.932 105.255 149.803 103.833C149.608 101.689 148.616 99.6966 147.023 98.2485L144.256 95.7328C144.086 95.5779 143.93 95.4073 143.792 95.2232L126 71.5L111.803 51.9315C108.994 48.0592 107.359 43.4599 107.094 38.6832C107.051 37.9263 107.836 37.4015 108.52 37.7295L123.881 45.1028C137.174 51.4834 152.33 52.825 166.537 48.8786C169.84 47.9612 173.214 47.3242 176.624 46.9745L183.675 46.2513C201.406 44.4328 219.32 45.9054 236.516 50.5953L238 51L254.798 57.0472C275.869 64.6329 292.567 81.0571 300.5 102L304.022 115.734C305.004 119.567 306.392 123.285 308.162 126.824C312.321 135.142 318.495 142.289 326.121 147.613L335.084 153.87C339.023 156.62 343.157 159.078 347.453 161.227L367.289 171.145C368.178 171.589 368.444 172.732 367.843 173.523C362.372 180.721 355.148 186.395 346.859 190.005L335.371 195.008C330.797 197 326.081 198.65 321.262 199.945L312.822 202.212C300.992 205.39 288.796 207 276.546 207H256.333C252.148 207 248.001 206.213 244.108 204.679C228.581 198.562 210.923 204.863 202.776 219.428Z" fill="white"/>
8
+ <path d="M271.185 135.316L279.987 135.418C281.182 135.432 281.452 133.748 280.312 133.388C278.441 132.797 276.623 132.048 274.879 131.15L268.008 127.61C263.35 125.211 258.969 122.308 254.944 118.953L253.592 117.827C250.54 115.283 247.77 112.418 245.33 109.282L243.768 107.273C243.234 106.586 242.134 107.005 242.192 107.873C243.212 123.186 255.839 135.138 271.185 135.316Z" fill="#666666"/>
9
+ <path d="M82.2231 456.395L231.313 323.4C245.367 310.863 257.58 296.403 267.59 280.45L268.5 279C273.404 269.192 275.497 258.217 274.547 247.293L273.24 232.258C272.436 223.009 268.618 214.28 262.373 207.41C262.131 207.144 261.81 206.961 261.457 206.889L237.5 202C220.117 196.752 201.688 195.995 183.933 199.8L183 200L169.06 203.259C128.405 212.763 92.5742 236.685 68.2116 270.592L67.597 271.447C60.8846 280.789 55.1822 290.817 50.5856 301.362L49.765 303.245C38.1544 329.881 34.2409 359.238 38.4684 387.985L39.8511 397.387C41.2751 407.07 44.1931 416.474 48.5011 425.262C52.4798 433.379 57.6014 440.883 63.7095 447.547L71.3177 455.847C74.1911 458.981 79.0498 459.225 82.2231 456.395Z" fill="#CCCCCC"/>
10
+ <path d="M212.749 278.858L212.267 279.133C199.686 286.322 192.918 299.892 193.58 314.367C193.768 318.484 197.893 322.255 201.858 321.132L209.163 319.062C218.607 316.386 227.353 311.681 234.789 305.274L256 287L262.292 282.343C298.871 255.269 344.833 244.113 389.754 251.405C391.14 251.63 391.184 253.607 389.81 253.894L384.5 255L382.093 255.842C377.15 257.572 372.856 260.776 369.79 265.022C369.214 265.819 369.982 266.89 370.922 266.601L372.663 266.065C382.467 263.049 392.751 261.904 402.978 262.691L407 263C428.843 263.95 449.114 274.626 462.254 292.1L467.179 298.65C481.776 318.063 487.953 342.53 484.319 366.545L482.421 379.087C479.837 396.163 473.618 412.486 464.184 426.952L463.5 428L453 442L441.5 455L430.965 465.114C421.346 474.348 410.827 482.597 399.567 489.738L396 492L389.175 495.25C387.417 496.087 385.95 493.678 387.5 492.5L397 483.5L398.953 481.449C404.232 475.906 408.027 469.12 409.986 461.721L410.889 458.309C411.295 456.776 411.5 455.174 411.5 453.588C411.5 444.909 405.354 437.298 396.836 435.631C391.554 434.597 386.085 435.962 381.907 439.356L372.5 447L355.894 460.587C344.995 469.504 333.185 477.245 320.66 483.682L303.5 492.5L274.5 503.5L268.412 505.16C257.822 508.049 247.012 510.06 236.092 511.174L228 512H202L167.5 508.25L148.832 504.21C138.985 502.079 129.456 498.682 120.482 494.103C113.181 490.378 106.293 485.894 99.931 480.725L85.5 469C68.005 455.64 57.0449 435.448 55.3749 413.498L54.5 402L55.5295 385.822C57.134 360.608 66.7911 336.576 83.0792 317.263C89.6652 309.454 97.2376 302.534 105.606 296.675L108.677 294.526C121.458 285.579 135.72 278.961 150.805 274.976L160.947 272.297C174.135 268.813 187.952 268.445 201.307 271.22L211.887 273.418C214.542 273.97 215.103 277.513 212.749 278.858Z" fill="#5E5E5E"/>
11
+ </svg>
package/dist/index.js CHANGED
@@ -4,9 +4,10 @@ var SECONDS_IN_A_MINUTE = 60;
4
4
  var MILLISECONDS_IN_A_SECOND = 1000;
5
5
  var MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
6
6
  var MINUTES_IN_AN_HOUR = 60;
7
- var HOURS_IN_A_DAY = 24;
8
- var MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_A_DAY;
7
+ var HOURS_IN_DAY = 24;
8
+ var MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
9
9
  var TIME_PRECISION = 2;
10
+ var TWO_THIRDS = 2 / 3;
10
11
  var DEFAULT_PORT = 3000;
11
12
  // src/core/build.ts
12
13
  import { rm, mkdir, writeFile as writeFile2 } from "fs/promises";
@@ -18,25 +19,22 @@ var {$, build: bunBuild, Glob: Glob2 } = globalThis.Bun;
18
19
  import { readFile, writeFile } from "fs/promises";
19
20
  var {Glob } = globalThis.Bun;
20
21
  var updateScriptTags = async (manifest, htmlDir) => {
21
- const htmlGlob = new Glob("*.html");
22
+ const glob = new Glob("*.html");
22
23
  const htmlFiles = [];
23
- for await (const file of htmlGlob.scan({
24
- cwd: htmlDir,
25
- absolute: true
26
- })) {
27
- htmlFiles.push(file);
28
- }
29
- for (const filePath of htmlFiles) {
30
- let content = await readFile(filePath, "utf8");
31
- for (const [scriptName, newPath] of Object.entries(manifest)) {
32
- const escapedScriptName = scriptName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
33
- const regex = new RegExp(`(<script[^>]+src=["'])(/?(?:.*\\/)?${escapedScriptName})(?:\\.[^."'/]+)?(\\.js)(["'][^>]*>)`, "g");
34
- content = content.replace(regex, (_, prefix, _oldBase, _ext, suffix) => {
35
- return `${prefix}${newPath}${suffix}`;
36
- });
37
- }
38
- await writeFile(filePath, content, "utf8");
24
+ const fileIterator = glob.scan({ absolute: true, cwd: htmlDir });
25
+ for await (const filePath of fileIterator) {
26
+ htmlFiles.push(filePath);
39
27
  }
28
+ const tasks = htmlFiles.map(async (filePath) => {
29
+ const original = await readFile(filePath, "utf8");
30
+ const updated = Object.entries(manifest).reduce((html, [scriptName, newPath]) => {
31
+ const esc = scriptName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
32
+ const regex = new RegExp(`(<script[^>]+src=["'])(/?(?:.*/)?${esc})(?:\\.[^."'/]+)?(\\.js)(["'][^>]*>)`, "g");
33
+ return html.replace(regex, (_, prefix, __, ___, suffix) => `${prefix}${newPath}${suffix}`);
34
+ }, original);
35
+ await writeFile(filePath, updated, "utf8");
36
+ });
37
+ await Promise.all(tasks);
40
38
  };
41
39
 
42
40
  // src/core/build.ts
@@ -44,32 +42,48 @@ var build = async ({
44
42
  buildDirectory = "build",
45
43
  assetsDirectory,
46
44
  reactDirectory,
47
- html,
45
+ htmlDirectory,
48
46
  htmxDirectory,
49
47
  tailwind
50
48
  }) => {
51
49
  const start = performance.now();
52
50
  const projectRoot = cwd();
53
- const buildDirAbsolute = join(projectRoot, buildDirectory);
54
- const assetsDirAbsolute = assetsDirectory && join(projectRoot, assetsDirectory);
55
- const reactIndexDirAbsolute = reactDirectory && join(projectRoot, reactDirectory, "indexes");
56
- const reactPagesDirAbsolute = reactDirectory && join(projectRoot, reactDirectory, "pages");
57
- const htmlDirAbsolute = html?.directory ? join(projectRoot, html.directory) : undefined;
58
- const htmxDirAbsolute = htmxDirectory && join(projectRoot, htmxDirectory);
59
- await rm(buildDirAbsolute, { force: true, recursive: true });
60
- await mkdir(buildDirAbsolute);
61
- reactPagesDirAbsolute && reactIndexDirAbsolute && await generateReactIndexFiles(reactPagesDirAbsolute, reactIndexDirAbsolute);
62
- const reactEntryPaths = reactIndexDirAbsolute && await scanEntryPoints(reactIndexDirAbsolute, "*.tsx");
63
- const entryPaths = [...reactEntryPaths ?? []];
51
+ const buildDirectoryAbsolute = join(projectRoot, buildDirectory);
52
+ const assetsDirectoryAbsolute = assetsDirectory && join(projectRoot, assetsDirectory);
53
+ const reactIndexesDirectory = reactDirectory && join(projectRoot, reactDirectory, "indexes");
54
+ const reactPagesDirectory = reactDirectory && join(projectRoot, reactDirectory, "pages");
55
+ const htmlPagesDirectory = htmlDirectory && join(projectRoot, htmlDirectory, "pages");
56
+ const htmlScriptsDirectory = htmlDirectory && join(projectRoot, htmlDirectory, "scripts");
57
+ const htmxDirectoryAbsolute = htmxDirectory && join(projectRoot, htmxDirectory);
58
+ await rm(buildDirectoryAbsolute, { force: true, recursive: true });
59
+ await mkdir(buildDirectoryAbsolute);
60
+ reactPagesDirectory && reactIndexesDirectory && await generateReactIndexFiles(reactPagesDirectory, reactIndexesDirectory);
61
+ assetsDirectoryAbsolute && await $`cp -R ${assetsDirectoryAbsolute} ${buildDirectoryAbsolute}`;
62
+ if (htmlPagesDirectory) {
63
+ await mkdir(join(buildDirectoryAbsolute, "html", "pages"), {
64
+ recursive: true
65
+ });
66
+ await $`cp -R ${htmlPagesDirectory} ${join(buildDirectoryAbsolute, "html")}`;
67
+ }
68
+ if (htmxDirectoryAbsolute) {
69
+ await mkdir(join(buildDirectoryAbsolute, "htmx"));
70
+ await $`cp -R ${htmxDirectoryAbsolute} ${join(buildDirectoryAbsolute)}`;
71
+ }
72
+ if (tailwind) {
73
+ await $`bunx @tailwindcss/cli -i ${tailwind.input} -o ${join(buildDirectoryAbsolute, tailwind.output)}`;
74
+ }
75
+ const reactEntryPaths = reactIndexesDirectory && await scanEntryPoints(reactIndexesDirectory, "*.tsx");
76
+ const htmlEntryPaths = htmlScriptsDirectory && await scanEntryPoints(htmlScriptsDirectory, "*.{js,ts}");
77
+ const entryPaths = [...reactEntryPaths || [], ...htmlEntryPaths || []];
64
78
  if (entryPaths.length === 0) {
65
- console.warn("No entry points found, skipping build");
79
+ console.warn("No entry points found, skipping building manifest");
66
80
  return null;
67
81
  }
68
82
  const { logs, outputs } = await bunBuild({
69
83
  entrypoints: entryPaths,
70
84
  format: "esm",
71
85
  naming: `[dir]/[name].[hash].[ext]`,
72
- outdir: buildDirAbsolute,
86
+ outdir: buildDirectoryAbsolute,
73
87
  target: "bun"
74
88
  }).catch((error) => {
75
89
  console.error("Build failed:", error);
@@ -83,22 +97,10 @@ var build = async ({
83
97
  else if (log.level === "info" || log.level === "debug")
84
98
  console.info(log);
85
99
  });
86
- assetsDirAbsolute && await $`cp -R ${assetsDirAbsolute} ${buildDirAbsolute}`;
87
- if (htmlDirAbsolute) {
88
- await mkdir(join(buildDirAbsolute, "html"));
89
- await $`cp -R ${htmlDirAbsolute} ${join(buildDirAbsolute)}`;
90
- }
91
- if (htmxDirAbsolute) {
92
- await mkdir(join(buildDirAbsolute, "htmx"));
93
- await $`cp -R ${htmxDirAbsolute} ${join(buildDirAbsolute)}`;
94
- }
95
- if (tailwind) {
96
- await $`bunx @tailwindcss/cli -i ${tailwind.input} -o ${join(buildDirAbsolute, tailwind.output)}`;
97
- }
98
100
  const manifest = outputs.reduce((acc, artifact) => {
99
101
  let relativePath = artifact.path;
100
- if (relativePath.startsWith(buildDirAbsolute)) {
101
- relativePath = relativePath.slice(buildDirAbsolute.length);
102
+ if (relativePath.startsWith(buildDirectoryAbsolute)) {
103
+ relativePath = relativePath.slice(buildDirectoryAbsolute.length);
102
104
  }
103
105
  relativePath = relativePath.replace(/^\/+/, "");
104
106
  const baseName = relativePath.split("/").pop();
@@ -109,10 +111,10 @@ var build = async ({
109
111
  throw new Error(`Expected hash delimiter ${hashDelimiter} in ${baseName}`);
110
112
  }
111
113
  const [fileName] = baseName.split(hashDelimiter);
112
- acc[fileName] = "/" + relativePath;
114
+ acc[fileName] = `/${relativePath}`;
113
115
  return acc;
114
116
  }, {});
115
- htmlDirAbsolute && await updateScriptTags(manifest, htmlDirAbsolute);
117
+ htmlPagesDirectory && await updateScriptTags(manifest, join(buildDirectoryAbsolute, "html", "pages"));
116
118
  const end = performance.now();
117
119
  const durationMs = end - start;
118
120
  let duration;
@@ -126,12 +128,12 @@ var build = async ({
126
128
  console.log(`Build completed in ${duration}`);
127
129
  return manifest;
128
130
  };
129
- var generateReactIndexFiles = async (reactPagesDirAbsolute, reactIndexDirAbsolute) => {
130
- await rm(reactIndexDirAbsolute, { force: true, recursive: true });
131
- await mkdir(reactIndexDirAbsolute);
131
+ var generateReactIndexFiles = async (reactPagesDirectory, reactIndexesDirectory) => {
132
+ await rm(reactIndexesDirectory, { force: true, recursive: true });
133
+ await mkdir(reactIndexesDirectory);
132
134
  const pagesGlob = new Glob2("*.*");
133
135
  const files = [];
134
- for await (const file of pagesGlob.scan({ cwd: reactPagesDirAbsolute })) {
136
+ for await (const file of pagesGlob.scan({ cwd: reactPagesDirectory })) {
135
137
  files.push(file);
136
138
  }
137
139
  const promises = files.map(async (file) => {
@@ -139,12 +141,21 @@ var generateReactIndexFiles = async (reactPagesDirAbsolute, reactIndexDirAbsolut
139
141
  const [componentName] = fileName.split(".");
140
142
  const content = [
141
143
  `import { hydrateRoot } from 'react-dom/client';`,
144
+ `import type { ComponentType } from 'react'`,
142
145
  `import { ${componentName} } from '../pages/${componentName}';
143
146
  `,
144
- `hydrateRoot(document, <${componentName} />);`
147
+ `type PropsOf<C> = C extends ComponentType<infer P> ? P : never;
148
+ `,
149
+ `declare global {
150
+ interface Window {
151
+ __INITIAL_PROPS__: PropsOf<typeof ReactExample>
152
+ }
153
+ }
154
+ `,
155
+ `hydrateRoot(document, <${componentName} {...window.__INITIAL_PROPS__} />);`
145
156
  ].join(`
146
157
  `);
147
- return writeFile2(join(reactIndexDirAbsolute, `${componentName}Index.tsx`), content);
158
+ return writeFile2(join(reactIndexesDirectory, `${componentName}Index.tsx`), content);
148
159
  });
149
160
  await Promise.all(promises);
150
161
  };
@@ -157,18 +168,21 @@ var scanEntryPoints = async (dir, pattern) => {
157
168
  return entryPaths;
158
169
  };
159
170
  // src/core/pageHandlers.ts
171
+ var {file } = globalThis.Bun;
160
172
  import { createElement } from "react";
161
- import { renderToReadableStream } from "react-dom/server.browser";
162
- var handleReactPageRequest = async (pageComponent, index) => {
163
- const page = createElement(pageComponent);
164
- const stream = await renderToReadableStream(page, {
165
- bootstrapModules: [index]
173
+ import { renderToReadableStream } from "react-dom/server";
174
+ var handleReactPageRequest = async (pageComponent, index, ...props) => {
175
+ const [maybeProps] = props;
176
+ const element = maybeProps !== undefined ? createElement(pageComponent, maybeProps) : createElement(pageComponent);
177
+ const stream = await renderToReadableStream(element, {
178
+ bootstrapModules: [index],
179
+ bootstrapScriptContent: maybeProps ? `window.__INITIAL_PROPS__=${JSON.stringify(maybeProps)}` : undefined
166
180
  });
167
181
  return new Response(stream, {
168
182
  headers: { "Content-Type": "text/html" }
169
183
  });
170
184
  };
171
- var handleHTMLPageRequest = (html) => Bun.file(html);
185
+ var handleHTMLPageRequest = (html) => file(html);
172
186
  // src/plugins/networkingPlugin.ts
173
187
  import { argv } from "process";
174
188
  var {env } = globalThis.Bun;
@@ -206,22 +220,28 @@ var networkingPlugin = (app) => app.listen({
206
220
  console.log(`Server started on http://${host}:${port}`);
207
221
  }
208
222
  });
223
+ // src/plugins/pageRouterPlugin.ts
224
+ var pageRouterPlugin = () => {
225
+ console.log("Page Router Plugin Not Implemented Yet");
226
+ };
209
227
  export {
210
228
  updateScriptTags,
229
+ pageRouterPlugin,
211
230
  networkingPlugin,
212
231
  handleReactPageRequest,
213
232
  handleHTMLPageRequest,
214
233
  getLocalIPAddress,
215
234
  build,
235
+ TWO_THIRDS,
216
236
  TIME_PRECISION,
217
237
  SECONDS_IN_A_MINUTE,
218
238
  MINUTES_IN_AN_HOUR,
219
239
  MILLISECONDS_IN_A_SECOND,
220
240
  MILLISECONDS_IN_A_MINUTE,
221
241
  MILLISECONDS_IN_A_DAY,
222
- HOURS_IN_A_DAY,
242
+ HOURS_IN_DAY,
223
243
  DEFAULT_PORT
224
244
  };
225
245
 
226
- //# debugId=4B58AC7ADCAED78C64756E2164756E21
246
+ //# debugId=CEF8ABE147BC74FE64756E2164756E21
227
247
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/constants.ts", "../src/core/build.ts", "../src/utils/updateScriptTags.ts", "../src/core/pageHandlers.ts", "../src/plugins/networkingPlugin.ts", "../src/utils/networking.ts"],
3
+ "sources": ["../src/constants.ts", "../src/core/build.ts", "../src/utils/updateScriptTags.ts", "../src/core/pageHandlers.ts", "../src/plugins/networkingPlugin.ts", "../src/utils/networking.ts", "../src/plugins/pageRouterPlugin.ts"],
4
4
  "sourcesContent": [
5
- "export const SECONDS_IN_A_MINUTE = 60;\nexport const MILLISECONDS_IN_A_SECOND = 1000;\nexport const MILLISECONDS_IN_A_MINUTE =\n\tMILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;\nexport const MINUTES_IN_AN_HOUR = 60;\nexport const HOURS_IN_A_DAY = 24;\nexport const MILLISECONDS_IN_A_DAY =\n\tMILLISECONDS_IN_A_SECOND *\n\tSECONDS_IN_A_MINUTE *\n\tMINUTES_IN_AN_HOUR *\n\tHOURS_IN_A_DAY;\nexport const TIME_PRECISION = 2;\nexport const DEFAULT_PORT = 3000;\n",
6
- "import { rm, mkdir, writeFile } from \"node:fs/promises\";\nimport { join, basename } from \"node:path\";\nimport { cwd, exit } from \"node:process\";\nimport { $, build as bunBuild, Glob } from \"bun\";\nimport {\n\tMILLISECONDS_IN_A_MINUTE,\n\tMILLISECONDS_IN_A_SECOND,\n\tTIME_PRECISION\n} from \"../constants\";\nimport { updateScriptTags } from \"../utils/updateScriptTags\";\nimport { BuildConfig } from \"../types\";\n\nexport const build = async ({\n\tbuildDirectory = \"build\",\n\tassetsDirectory,\n\treactDirectory,\n\thtml,\n\thtmxDirectory,\n\ttailwind\n}: BuildConfig) => {\n\tconst start = performance.now();\n\n\tconst projectRoot = cwd();\n\tconst buildDirAbsolute = join(projectRoot, buildDirectory);\n\tconst assetsDirAbsolute =\n\t\tassetsDirectory && join(projectRoot, assetsDirectory);\n\tconst reactIndexDirAbsolute =\n\t\treactDirectory && join(projectRoot, reactDirectory, \"indexes\");\n\tconst reactPagesDirAbsolute =\n\t\treactDirectory && join(projectRoot, reactDirectory, \"pages\");\n\tconst htmlDirAbsolute = html?.directory\n\t\t? join(projectRoot, html.directory)\n\t\t: undefined;\n\n\tconst htmxDirAbsolute = htmxDirectory && join(projectRoot, htmxDirectory);\n\n\tawait rm(buildDirAbsolute, { force: true, recursive: true });\n\tawait mkdir(buildDirAbsolute);\n\n\treactPagesDirAbsolute &&\n\t\treactIndexDirAbsolute &&\n\t\t(await generateReactIndexFiles(\n\t\t\treactPagesDirAbsolute,\n\t\t\treactIndexDirAbsolute\n\t\t));\n\n\tconst reactEntryPaths =\n\t\treactIndexDirAbsolute &&\n\t\t(await scanEntryPoints(reactIndexDirAbsolute, \"*.tsx\"));\n\n\tconst entryPaths = [...(reactEntryPaths ?? [])];\n\n\tif (entryPaths.length === 0) {\n\t\tconsole.warn(\"No entry points found, skipping build\");\n\t\treturn null;\n\t}\n\n\tconst { logs, outputs } = await bunBuild({\n\t\tentrypoints: entryPaths,\n\t\tformat: \"esm\",\n\t\tnaming: `[dir]/[name].[hash].[ext]`,\n\t\toutdir: buildDirAbsolute,\n\t\ttarget: \"bun\"\n\t}).catch((error) => {\n\t\tconsole.error(\"Build failed:\", error);\n\t\texit(1);\n\t});\n\n\tlogs.forEach((log) => {\n\t\tif (log.level === \"error\") console.error(log);\n\t\telse if (log.level === \"warning\") console.warn(log);\n\t\telse if (log.level === \"info\" || log.level === \"debug\")\n\t\t\tconsole.info(log);\n\t});\n\n\tassetsDirAbsolute &&\n\t\t(await $`cp -R ${assetsDirAbsolute} ${buildDirAbsolute}`);\n\n\tif (htmlDirAbsolute) {\n\t\tawait mkdir(join(buildDirAbsolute, \"html\"));\n\t\tawait $`cp -R ${htmlDirAbsolute} ${join(buildDirAbsolute)}`;\n\t}\n\n\tif (htmxDirAbsolute) {\n\t\tawait mkdir(join(buildDirAbsolute, \"htmx\"));\n\t\tawait $`cp -R ${htmxDirAbsolute} ${join(buildDirAbsolute)}`;\n\t}\n\n\tif (tailwind) {\n\t\tawait $`bunx @tailwindcss/cli -i ${tailwind.input} -o ${join(buildDirAbsolute, tailwind.output)}`;\n\t}\n\n\tconst manifest = outputs.reduce<Record<string, string>>((acc, artifact) => {\n\t\tlet relativePath = artifact.path;\n\n\t\tif (relativePath.startsWith(buildDirAbsolute)) {\n\t\t\trelativePath = relativePath.slice(buildDirAbsolute.length);\n\t\t}\n\n\t\trelativePath = relativePath.replace(/^\\/+/, \"\");\n\n\t\tconst baseName = relativePath.split(\"/\").pop();\n\t\tif (!baseName) return acc;\n\n\t\tconst hashDelimiter = `.${artifact.hash}.`;\n\t\tif (!baseName.includes(hashDelimiter)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Expected hash delimiter ${hashDelimiter} in ${baseName}`\n\t\t\t);\n\t\t}\n\n\t\tconst [fileName] = baseName.split(hashDelimiter);\n\t\tacc[fileName] = \"/\" + relativePath;\n\t\treturn acc;\n\t}, {});\n\n\thtmlDirAbsolute && (await updateScriptTags(manifest, htmlDirAbsolute));\n\n\tconst end = performance.now();\n\tconst durationMs = end - start;\n\tlet duration;\n\tif (durationMs < MILLISECONDS_IN_A_SECOND) {\n\t\tduration = `${durationMs.toFixed(TIME_PRECISION)}ms`;\n\t} else if (durationMs < MILLISECONDS_IN_A_MINUTE) {\n\t\tduration = `${(durationMs / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;\n\t} else {\n\t\tduration = `${(durationMs / MILLISECONDS_IN_A_MINUTE).toFixed(TIME_PRECISION)}m`;\n\t}\n\tconsole.log(`Build completed in ${duration}`);\n\n\treturn manifest;\n};\n\nconst generateReactIndexFiles = async (\n\treactPagesDirAbsolute: string,\n\treactIndexDirAbsolute: string\n) => {\n\tawait rm(reactIndexDirAbsolute, { force: true, recursive: true });\n\tawait mkdir(reactIndexDirAbsolute);\n\n\tconst pagesGlob = new Glob(\"*.*\");\n\tconst files: string[] = [];\n\tfor await (const file of pagesGlob.scan({ cwd: reactPagesDirAbsolute })) {\n\t\tfiles.push(file);\n\t}\n\tconst promises = files.map(async (file) => {\n\t\tconst fileName = basename(file);\n\t\tconst [componentName] = fileName.split(\".\");\n\t\tconst content = [\n\t\t\t`import { hydrateRoot } from 'react-dom/client';`,\n\t\t\t`import { ${componentName} } from '../pages/${componentName}';\\n`,\n\t\t\t`hydrateRoot(document, <${componentName} />);`\n\t\t].join(\"\\n\");\n\n\t\treturn writeFile(\n\t\t\tjoin(reactIndexDirAbsolute, `${componentName}Index.tsx`),\n\t\t\tcontent\n\t\t);\n\t});\n\tawait Promise.all(promises);\n};\n\nconst scanEntryPoints = async (dir: string, pattern: string) => {\n\tconst entryPaths: string[] = [];\n\tconst glob = new Glob(pattern);\n\tfor await (const file of glob.scan({ absolute: true, cwd: dir })) {\n\t\tentryPaths.push(file);\n\t}\n\treturn entryPaths;\n};\n",
7
- "// TODO : this script seems to only work after building twice maybe due to the async nature of it\n\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { Glob } from \"bun\";\n\n/**\n * Updates <script> tags in all HTML files within htmlDir.\n * For each script tag whose src file base (with or without a hash) is a key in the manifest,\n * the src attribute is replaced with the new hashed file path.\n *\n * @param manifest - An object mapping script base names to the new file path.\n * @param htmlDir - The directory that contains the HTML files.\n */\nexport const updateScriptTags = async (\n\tmanifest: Record<string, string>,\n\thtmlDir: string\n) => {\n\t// Use Glob to find all HTML files in the specified directory\n\tconst htmlGlob = new Glob(\"*.html\");\n\tconst htmlFiles: string[] = [];\n\tfor await (const file of htmlGlob.scan({\n\t\tcwd: htmlDir,\n\t\tabsolute: true\n\t})) {\n\t\thtmlFiles.push(file);\n\t}\n\n\t// Process each HTML file\n\tfor (const filePath of htmlFiles) {\n\t\tlet content = await readFile(filePath, \"utf8\");\n\n\t\t// For each script in the manifest, update matching <script> tags\n\t\tfor (const [scriptName, newPath] of Object.entries(manifest)) {\n\t\t\t// Escape special regex characters in the scriptName\n\t\t\tconst escapedScriptName = scriptName.replace(\n\t\t\t\t/[.*+?^${}()|[\\]\\\\]/g,\n\t\t\t\t\"\\\\$&\"\n\t\t\t);\n\t\t\t// The regex explanation:\n\t\t\t// (1) (<script[^>]+src=[\"']) — capture the opening of the script tag up to the src attribute value\n\t\t\t// (2) (\\/?(?:.*\\\\/)?${escapedScriptName}) — capture any preceding path and the base script name\n\t\t\t// (3) (?:\\.[^.\"'/]+)? — optionally capture a dot and hash (if already hashed)\n\t\t\t// (4) (\\.js) — then capture the js extension\n\t\t\t// (5) ([\"'][^>]*>) — capture the closing quote and remainder of the script tag\n\t\t\tconst regex = new RegExp(\n\t\t\t\t`(<script[^>]+src=[\"'])(\\/?(?:.*\\\\/)?${escapedScriptName})(?:\\\\.[^.\"'/]+)?(\\\\.js)([\"'][^>]*>)`,\n\t\t\t\t\"g\"\n\t\t\t);\n\t\t\t// Replace the matched src attribute with the new value from the manifest\n\t\t\tcontent = content.replace(\n\t\t\t\tregex,\n\t\t\t\t(_, prefix, _oldBase, _ext, suffix) => {\n\t\t\t\t\treturn `${prefix}${newPath}${suffix}`;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tawait writeFile(filePath, content, \"utf8\");\n\t}\n};\n",
8
- "import { ComponentType, createElement } from \"react\";\n//@ts-expect-error - TODO: Remove this when we upgrade to React 19\nimport { renderToReadableStream } from \"react-dom/server.browser\";\n\nexport const handleReactPageRequest = async (\n\tpageComponent: ComponentType,\n\tindex: string\n) => {\n\tconst page = createElement(pageComponent);\n\tconst stream = await renderToReadableStream(page, {\n\t\tbootstrapModules: [index]\n\t});\n\n\treturn new Response(stream, {\n\t\theaders: { \"Content-Type\": \"text/html\" }\n\t});\n};\n\nexport const handleHTMLPageRequest = (html: string) => Bun.file(html);\n",
9
- "import { argv } from \"node:process\";\nimport { env } from \"bun\";\nimport { Elysia } from \"elysia\";\nimport { getLocalIPAddress } from \"../utils/networking\";\nimport { DEFAULT_PORT } from \"../constants\";\n\nlet host = env.HOST ?? \"localhost\";\nconst port = env.PORT ?? DEFAULT_PORT;\nlet localIP: string | undefined;\n\nconst args = argv;\nconst hostFlag = args.includes(\"--host\");\n\nif (hostFlag) {\n\tlocalIP = getLocalIPAddress();\n\thost = \"0.0.0.0\";\n}\n\nexport const networkingPlugin = (app: Elysia) =>\n\tapp.listen(\n\t\t{\n\t\t\thostname: host,\n\t\t\tport: port\n\t\t},\n\t\t() => {\n\t\t\t//TODO: I dont think this works properly\n\t\t\tif (hostFlag) {\n\t\t\t\tconsole.log(`Server started on http://localhost:${port}`);\n\t\t\t\tconsole.log(\n\t\t\t\t\t`Server started on network: http://${localIP}:${port}`\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconsole.log(`Server started on http://${host}:${port}`);\n\t\t\t}\n\t\t}\n\t);\n",
10
- "import os from \"os\";\n\nexport const getLocalIPAddress = () => {\n\tconst interfaces = os.networkInterfaces();\n\tconst addresses = Object.values(interfaces)\n\t\t.flat()\n\t\t.filter(\n\t\t\t(iface): iface is os.NetworkInterfaceInfo => iface !== undefined\n\t\t);\n\tconst ipAddress = addresses.find(\n\t\t(iface) => iface.family === \"IPv4\" && !iface.internal\n\t);\n\n\tif (ipAddress) return ipAddress.address; // Return the first non-internal IPv4 address\n\n\tconsole.warn(\"No IP address found, falling back to localhost\");\n\n\treturn \"localhost\"; // Fallback to localhost if no IP found\n};\n"
5
+ "export const SECONDS_IN_A_MINUTE = 60;\nexport const MILLISECONDS_IN_A_SECOND = 1000;\nexport const MILLISECONDS_IN_A_MINUTE =\n\tMILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;\nexport const MINUTES_IN_AN_HOUR = 60;\nexport const HOURS_IN_DAY = 24;\nexport const MILLISECONDS_IN_A_DAY =\n\tMILLISECONDS_IN_A_SECOND *\n\tSECONDS_IN_A_MINUTE *\n\tMINUTES_IN_AN_HOUR *\n\tHOURS_IN_DAY;\nexport const TIME_PRECISION = 2;\nexport const TWO_THIRDS = 2 / 3;\nexport const DEFAULT_PORT = 3000;\n",
6
+ "import { rm, mkdir, writeFile } from \"node:fs/promises\";\nimport { join, basename } from \"node:path\";\nimport { cwd, exit } from \"node:process\";\nimport { $, build as bunBuild, Glob } from \"bun\";\nimport {\n\tMILLISECONDS_IN_A_MINUTE,\n\tMILLISECONDS_IN_A_SECOND,\n\tTIME_PRECISION\n} from \"../constants\";\nimport { BuildConfig } from \"../types\";\nimport { updateScriptTags } from \"../utils/updateScriptTags\";\n\nexport const build = async ({\n\tbuildDirectory = \"build\",\n\tassetsDirectory,\n\treactDirectory,\n\thtmlDirectory,\n\thtmxDirectory,\n\ttailwind\n}: BuildConfig) => {\n\tconst start = performance.now();\n\n\tconst projectRoot = cwd();\n\tconst buildDirectoryAbsolute = join(projectRoot, buildDirectory);\n\tconst assetsDirectoryAbsolute =\n\t\tassetsDirectory && join(projectRoot, assetsDirectory);\n\tconst reactIndexesDirectory =\n\t\treactDirectory && join(projectRoot, reactDirectory, \"indexes\");\n\tconst reactPagesDirectory =\n\t\treactDirectory && join(projectRoot, reactDirectory, \"pages\");\n\tconst htmlPagesDirectory =\n\t\thtmlDirectory && join(projectRoot, htmlDirectory, \"pages\");\n\tconst htmlScriptsDirectory =\n\t\thtmlDirectory && join(projectRoot, htmlDirectory, \"scripts\");\n\tconst htmxDirectoryAbsolute =\n\t\thtmxDirectory && join(projectRoot, htmxDirectory);\n\n\tawait rm(buildDirectoryAbsolute, { force: true, recursive: true });\n\tawait mkdir(buildDirectoryAbsolute);\n\n\tvoid (\n\t\treactPagesDirectory &&\n\t\treactIndexesDirectory &&\n\t\t(await generateReactIndexFiles(\n\t\t\treactPagesDirectory,\n\t\t\treactIndexesDirectory\n\t\t))\n\t);\n\n\tvoid (\n\t\tassetsDirectoryAbsolute &&\n\t\t(await $`cp -R ${assetsDirectoryAbsolute} ${buildDirectoryAbsolute}`)\n\t);\n\n\tif (htmlPagesDirectory) {\n\t\tawait mkdir(join(buildDirectoryAbsolute, \"html\", \"pages\"), {\n\t\t\trecursive: true\n\t\t});\n\t\tawait $`cp -R ${htmlPagesDirectory} ${join(buildDirectoryAbsolute, \"html\")}`;\n\t}\n\n\tif (htmxDirectoryAbsolute) {\n\t\tawait mkdir(join(buildDirectoryAbsolute, \"htmx\"));\n\t\tawait $`cp -R ${htmxDirectoryAbsolute} ${join(buildDirectoryAbsolute)}`;\n\t}\n\n\tif (tailwind) {\n\t\tawait $`bunx @tailwindcss/cli -i ${tailwind.input} -o ${join(buildDirectoryAbsolute, tailwind.output)}`;\n\t}\n\n\tconst reactEntryPaths =\n\t\treactIndexesDirectory &&\n\t\t(await scanEntryPoints(reactIndexesDirectory, \"*.tsx\"));\n\n\tconst htmlEntryPaths =\n\t\thtmlScriptsDirectory &&\n\t\t(await scanEntryPoints(htmlScriptsDirectory, \"*.{js,ts}\"));\n\n\tconst entryPaths = [...(reactEntryPaths || []), ...(htmlEntryPaths || [])];\n\n\tif (entryPaths.length === 0) {\n\t\tconsole.warn(\"No entry points found, skipping building manifest\");\n\n\t\treturn null;\n\t}\n\n\tconst { logs, outputs } = await bunBuild({\n\t\tentrypoints: entryPaths,\n\t\tformat: \"esm\",\n\t\tnaming: `[dir]/[name].[hash].[ext]`,\n\t\toutdir: buildDirectoryAbsolute,\n\t\ttarget: \"bun\"\n\t}).catch((error) => {\n\t\tconsole.error(\"Build failed:\", error);\n\t\texit(1);\n\t});\n\n\tlogs.forEach((log) => {\n\t\tif (log.level === \"error\") console.error(log);\n\t\telse if (log.level === \"warning\") console.warn(log);\n\t\telse if (log.level === \"info\" || log.level === \"debug\")\n\t\t\tconsole.info(log);\n\t});\n\n\tconst manifest = outputs.reduce<Record<string, string>>((acc, artifact) => {\n\t\tlet relativePath = artifact.path;\n\n\t\tif (relativePath.startsWith(buildDirectoryAbsolute)) {\n\t\t\trelativePath = relativePath.slice(buildDirectoryAbsolute.length);\n\t\t}\n\n\t\trelativePath = relativePath.replace(/^\\/+/, \"\");\n\n\t\tconst baseName = relativePath.split(\"/\").pop();\n\t\tif (!baseName) return acc;\n\n\t\tconst hashDelimiter = `.${artifact.hash}.`;\n\t\tif (!baseName.includes(hashDelimiter)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Expected hash delimiter ${hashDelimiter} in ${baseName}`\n\t\t\t);\n\t\t}\n\n\t\tconst [fileName] = baseName.split(hashDelimiter);\n\t\tacc[fileName] = `/${relativePath}`;\n\n\t\treturn acc;\n\t}, {});\n\n\tvoid (\n\t\thtmlPagesDirectory &&\n\t\t(await updateScriptTags(\n\t\t\tmanifest,\n\t\t\tjoin(buildDirectoryAbsolute, \"html\", \"pages\")\n\t\t))\n\t);\n\n\tconst end = performance.now();\n\tconst durationMs = end - start;\n\tlet duration;\n\tif (durationMs < MILLISECONDS_IN_A_SECOND) {\n\t\tduration = `${durationMs.toFixed(TIME_PRECISION)}ms`;\n\t} else if (durationMs < MILLISECONDS_IN_A_MINUTE) {\n\t\tduration = `${(durationMs / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;\n\t} else {\n\t\tduration = `${(durationMs / MILLISECONDS_IN_A_MINUTE).toFixed(TIME_PRECISION)}m`;\n\t}\n\tconsole.log(`Build completed in ${duration}`);\n\n\treturn manifest;\n};\n\nconst generateReactIndexFiles = async (\n\treactPagesDirectory: string,\n\treactIndexesDirectory: string\n) => {\n\tawait rm(reactIndexesDirectory, { force: true, recursive: true });\n\tawait mkdir(reactIndexesDirectory);\n\n\tconst pagesGlob = new Glob(\"*.*\");\n\tconst files: string[] = [];\n\tfor await (const file of pagesGlob.scan({ cwd: reactPagesDirectory })) {\n\t\tfiles.push(file);\n\t}\n\tconst promises = files.map(async (file) => {\n\t\tconst fileName = basename(file);\n\t\tconst [componentName] = fileName.split(\".\");\n\t\tconst content = [\n\t\t\t`import { hydrateRoot } from 'react-dom/client';`,\n\t\t\t`import type { ComponentType } from 'react'`,\n\t\t\t`import { ${componentName} } from '../pages/${componentName}';\\n`,\n\t\t\t`type PropsOf<C> = C extends ComponentType<infer P> ? P : never;\\n`,\n\t\t\t`declare global {\n\t\t\t\tinterface Window {\n\t\t\t\t\t__INITIAL_PROPS__: PropsOf<typeof ReactExample>\n\t\t\t\t}\n\t\t\t}\\n`,\n\t\t\t`hydrateRoot(document, <${componentName} {...window.__INITIAL_PROPS__} />);`\n\t\t].join(\"\\n\");\n\n\t\treturn writeFile(\n\t\t\tjoin(reactIndexesDirectory, `${componentName}Index.tsx`),\n\t\t\tcontent\n\t\t);\n\t});\n\tawait Promise.all(promises);\n};\n\nconst scanEntryPoints = async (dir: string, pattern: string) => {\n\tconst entryPaths: string[] = [];\n\tconst glob = new Glob(pattern);\n\tfor await (const file of glob.scan({ absolute: true, cwd: dir })) {\n\t\tentryPaths.push(file);\n\t}\n\n\treturn entryPaths;\n};\n",
7
+ "import { readFile, writeFile } from \"node:fs/promises\";\nimport { Glob } from \"bun\";\n\nexport const updateScriptTags = async (\n\tmanifest: Record<string, string>,\n\thtmlDir: string\n) => {\n\tconst glob = new Glob(\"*.html\");\n\tconst htmlFiles: string[] = [];\n\tconst fileIterator = glob.scan({ absolute: true, cwd: htmlDir });\n\tfor await (const filePath of fileIterator) {\n\t\thtmlFiles.push(filePath);\n\t}\n\n\tconst tasks = htmlFiles.map(async (filePath) => {\n\t\tconst original = await readFile(filePath, \"utf8\");\n\t\tconst updated = Object.entries(manifest).reduce(\n\t\t\t(html, [scriptName, newPath]) => {\n\t\t\t\tconst esc = scriptName.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\t\t\t\tconst regex = new RegExp(\n\t\t\t\t\t`(<script[^>]+src=[\"'])(/?(?:.*/)?${esc})(?:\\\\.[^.\"'/]+)?(\\\\.js)([\"'][^>]*>)`,\n\t\t\t\t\t\"g\"\n\t\t\t\t);\n\n\t\t\t\treturn html.replace(\n\t\t\t\t\tregex,\n\t\t\t\t\t(_, prefix, __, ___, suffix) =>\n\t\t\t\t\t\t`${prefix}${newPath}${suffix}`\n\t\t\t\t);\n\t\t\t},\n\t\t\toriginal\n\t\t);\n\n\t\tawait writeFile(filePath, updated, \"utf8\");\n\t});\n\n\tawait Promise.all(tasks);\n};\n",
8
+ "import { file } from \"bun\";\nimport { ComponentType, createElement } from \"react\";\nimport { renderToReadableStream } from \"react-dom/server\";\n\nexport const handleReactPageRequest = async <P extends object>(\n\tpageComponent: ComponentType<P>,\n\tindex: string,\n\t...props: keyof P extends never ? [] : [props: P]\n): Promise<Response> => {\n\tconst [maybeProps] = props;\n\tconst element =\n\t\tmaybeProps !== undefined\n\t\t\t? createElement(pageComponent, maybeProps)\n\t\t\t: createElement(pageComponent);\n\n\tconst stream = await renderToReadableStream(element, {\n\t\tbootstrapModules: [index],\n\t\tbootstrapScriptContent: maybeProps\n\t\t\t? `window.__INITIAL_PROPS__=${JSON.stringify(maybeProps)}`\n\t\t\t: undefined\n\t});\n\n\treturn new Response(stream, {\n\t\theaders: { \"Content-Type\": \"text/html\" }\n\t});\n};\n\nexport const handleHTMLPageRequest = (html: string) => file(html);\n",
9
+ "import { argv } from \"node:process\";\nimport { env } from \"bun\";\nimport { Elysia } from \"elysia\";\nimport { DEFAULT_PORT } from \"../constants\";\nimport { getLocalIPAddress } from \"../utils/networking\";\n\nlet host = env.HOST ?? \"localhost\";\nconst port = env.PORT ?? DEFAULT_PORT;\nlet localIP: string | undefined;\n\nconst args = argv;\nconst hostFlag = args.includes(\"--host\");\n\nif (hostFlag) {\n\tlocalIP = getLocalIPAddress();\n\thost = \"0.0.0.0\";\n}\n\nexport const networkingPlugin = (app: Elysia) =>\n\tapp.listen(\n\t\t{\n\t\t\thostname: host,\n\t\t\tport: port\n\t\t},\n\t\t() => {\n\t\t\t//TODO: I dont think this works properly\n\t\t\tif (hostFlag) {\n\t\t\t\tconsole.log(`Server started on http://localhost:${port}`);\n\t\t\t\tconsole.log(\n\t\t\t\t\t`Server started on network: http://${localIP}:${port}`\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconsole.log(`Server started on http://${host}:${port}`);\n\t\t\t}\n\t\t}\n\t);\n",
10
+ "import os from \"os\";\n\nexport const getLocalIPAddress = () => {\n\tconst interfaces = os.networkInterfaces();\n\tconst addresses = Object.values(interfaces)\n\t\t.flat()\n\t\t.filter(\n\t\t\t(iface): iface is os.NetworkInterfaceInfo => iface !== undefined\n\t\t);\n\tconst ipAddress = addresses.find(\n\t\t(iface) => iface.family === \"IPv4\" && !iface.internal\n\t);\n\n\tif (ipAddress) return ipAddress.address; // Return the first non-internal IPv4 address\n\n\tconsole.warn(\"No IP address found, falling back to localhost\");\n\n\treturn \"localhost\"; // Fallback to localhost if no IP found\n};\n",
11
+ "export const pageRouterPlugin = () => {\n\tconsole.log(\"Page Router Plugin Not Implemented Yet\");\n};\n"
11
12
  ],
12
- "mappings": ";;AAAO,IAAM,sBAAsB;AAC5B,IAAM,2BAA2B;AACjC,IAAM,2BACZ,2BAA2B;AACrB,IAAM,qBAAqB;AAC3B,IAAM,iBAAiB;AACvB,IAAM,wBACZ,2BACA,sBACA,qBACA;AACM,IAAM,iBAAiB;AACvB,IAAM,eAAe;;ACZ5B,iCAAoB;AACpB;AACA;AACA;;;ACDA;AACA;AAUO,IAAM,mBAAmB,OAC/B,UACA,YACI;AAAA,EAEJ,MAAM,WAAW,IAAI,KAAK,QAAQ;AAAA,EAClC,MAAM,YAAsB,CAAC;AAAA,EAC7B,iBAAiB,QAAQ,SAAS,KAAK;AAAA,IACtC,KAAK;AAAA,IACL,UAAU;AAAA,EACX,CAAC,GAAG;AAAA,IACH,UAAU,KAAK,IA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AAM,aAAa,GAAG,kBAAkB;AAAA,EACxC,MAAM,YAAY,OAAO,OAAO,UAAU,EACxC,KAAK,EACL,OACA,CAAC,UAA4C,UAAU,SACxD;AAAA,EACD,MAAM,YAAY,UAAU,KAC3B,CAAC,UAAU,MAAM,WAAW,WAAW,MAAM,QAC9C;AAAA,EAEA,IAAI;AAAA,IAAW,OAAO,UAAU;AAAA,EAEhC,QAAQ,KAAK,gDAAgD;AAAA,EAE7D,OAAO;AAAA;;;ADXR,IAAI,OAAO,IAAI,QAAQ;AACvB,IAAM,OAAO,IAAI,QAAQ;AACzB,IAAI;AAEJ,IAAM,OAAO;AACb,IAAM,WAAW,KAAK,SAAS,QAAQ;AAEvC,IAAI,UAAU;AAAA,EACb,UAAU,kBAAkB;AAAA,EAC5B,OAAO;AACR;AAEO,IAAM,mBAAmB,CAAC,QAChC,IAAI,OACH;AAAA,EACC,UAAU;AAAA,EACV;AACD,GACA,MAAM;AAAA,EAEL,IAAI,UAAU;AAAA,IACb,QAAQ,IAAI,sCAAsC,MAAM;AAAA,IACxD,QAAQ,IACP,qCAAqC,WAAW,MACjD;AAAA,EACD,EAAO;AAAA,IACN,QAAQ,IAAI,4BAA4B,QAAQ,MAAM;AAAA;AAAA,CAGzD;;AEnCM,IAAM,mBAAmB,MAAM;AAAA,EACrC,QAAQ,IAAI,wCAAwC;AAAA;",
14
+ "debugId": "CEF8ABE147BC74FE64756E2164756E21",
14
15
  "names": []
15
16
  }
@@ -2,7 +2,8 @@ export declare const SECONDS_IN_A_MINUTE = 60;
2
2
  export declare const MILLISECONDS_IN_A_SECOND = 1000;
3
3
  export declare const MILLISECONDS_IN_A_MINUTE: number;
4
4
  export declare const MINUTES_IN_AN_HOUR = 60;
5
- export declare const HOURS_IN_A_DAY = 24;
5
+ export declare const HOURS_IN_DAY = 24;
6
6
  export declare const MILLISECONDS_IN_A_DAY: number;
7
7
  export declare const TIME_PRECISION = 2;
8
+ export declare const TWO_THIRDS: number;
8
9
  export declare const DEFAULT_PORT = 3000;
@@ -1,2 +1,2 @@
1
1
  import { BuildConfig } from "../types";
2
- export declare const build: ({ buildDirectory, assetsDirectory, reactDirectory, html, htmxDirectory, tailwind }: BuildConfig) => Promise<Record<string, string> | null>;
2
+ export declare const build: ({ buildDirectory, assetsDirectory, reactDirectory, htmlDirectory, htmxDirectory, tailwind }: BuildConfig) => Promise<Record<string, string> | null>;
@@ -1,3 +1,3 @@
1
1
  import { ComponentType } from "react";
2
- export declare const handleReactPageRequest: (pageComponent: ComponentType, index: string) => Promise<Response>;
3
- export declare const handleHTMLPageRequest: (html: string) => import("bun").BunFile;
2
+ export declare const handleReactPageRequest: <P extends object>(pageComponent: ComponentType<P>, index: string, ...props: keyof P extends never ? [] : [props: P]) => Promise<Response>;
3
+ export declare const handleHTMLPageRequest: (html: string) => Bun.BunFile;
@@ -5,10 +5,11 @@ export declare const networkingPlugin: (app: Elysia) => Elysia<"", {
5
5
  derive: {};
6
6
  resolve: {};
7
7
  }, {
8
- typebox: import("@sinclair/typebox").TModule<{}>;
8
+ typebox: {};
9
9
  error: {};
10
10
  }, {
11
11
  schema: {};
12
+ standaloneSchema: {};
12
13
  macro: {};
13
14
  macroFn: {};
14
15
  parser: {};
@@ -16,8 +17,10 @@ export declare const networkingPlugin: (app: Elysia) => Elysia<"", {
16
17
  derive: {};
17
18
  resolve: {};
18
19
  schema: {};
20
+ standaloneSchema: {};
19
21
  }, {
20
22
  derive: {};
21
23
  resolve: {};
22
24
  schema: {};
25
+ standaloneSchema: {};
23
26
  }>;
@@ -1 +1 @@
1
- export {};
1
+ export declare const pageRouterPlugin: () => void;
@@ -1,4 +1,3 @@
1
- export type HTMLScriptOption = "ts" | "js" | "ts+ssr" | "js+ssr" | undefined;
2
1
  export type BuildConfig = {
3
2
  buildDirectory?: string;
4
3
  assetsDirectory?: string;
@@ -7,10 +6,7 @@ export type BuildConfig = {
7
6
  angularDirectory?: string;
8
7
  astroDirectory?: string;
9
8
  svelteDirectory?: string;
10
- html?: {
11
- directory?: string;
12
- scriptingOption: HTMLScriptOption;
13
- };
9
+ htmlDirectory?: string;
14
10
  htmxDirectory?: string;
15
11
  tailwind?: {
16
12
  input: string;
@@ -1,9 +1 @@
1
- /**
2
- * Updates <script> tags in all HTML files within htmlDir.
3
- * For each script tag whose src file base (with or without a hash) is a key in the manifest,
4
- * the src attribute is replaced with the new hashed file path.
5
- *
6
- * @param manifest - An object mapping script base names to the new file path.
7
- * @param htmlDir - The directory that contains the HTML files.
8
- */
9
1
  export declare const updateScriptTags: (manifest: Record<string, string>, htmlDir: string) => Promise<void>;