@code-hike/hike 0.0.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.
Files changed (154) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-path-routes-manifest.json +5 -0
  3. package/.next/build/chunks/[root-of-the-server]__51225daf._.js +206 -0
  4. package/.next/build/chunks/[root-of-the-server]__51225daf._.js.map +8 -0
  5. package/.next/build/chunks/[root-of-the-server]__974941ed._.js +500 -0
  6. package/.next/build/chunks/[root-of-the-server]__974941ed._.js.map +11 -0
  7. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_6920245c._.js +13 -0
  8. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_6920245c._.js.map +5 -0
  9. package/.next/build/chunks/[turbopack]_runtime.js +795 -0
  10. package/.next/build/chunks/[turbopack]_runtime.js.map +10 -0
  11. package/.next/build/chunks/node_modules_fe693df6._.js +6758 -0
  12. package/.next/build/chunks/node_modules_fe693df6._.js.map +47 -0
  13. package/.next/build/package.json +1 -0
  14. package/.next/build/postcss.js +6 -0
  15. package/.next/build/postcss.js.map +5 -0
  16. package/.next/build-manifest.json +19 -0
  17. package/.next/diagnostics/build-diagnostics.json +6 -0
  18. package/.next/diagnostics/framework.json +1 -0
  19. package/.next/export-marker.json +6 -0
  20. package/.next/fallback-build-manifest.json +12 -0
  21. package/.next/images-manifest.json +66 -0
  22. package/.next/next-minimal-server.js.nft.json +1 -0
  23. package/.next/next-server.js.nft.json +1 -0
  24. package/.next/package.json +1 -0
  25. package/.next/prerender-manifest.json +85 -0
  26. package/.next/required-server-files.js +163 -0
  27. package/.next/required-server-files.json +163 -0
  28. package/.next/routes-manifest.json +62 -0
  29. package/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
  30. package/.next/server/app/_global-error/page/build-manifest.json +16 -0
  31. package/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
  32. package/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
  33. package/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
  34. package/.next/server/app/_global-error/page.js +10 -0
  35. package/.next/server/app/_global-error/page.js.map +5 -0
  36. package/.next/server/app/_global-error/page.js.nft.json +1 -0
  37. package/.next/server/app/_global-error/page_client-reference-manifest.js +2 -0
  38. package/.next/server/app/_global-error.html +2 -0
  39. package/.next/server/app/_global-error.meta +15 -0
  40. package/.next/server/app/_global-error.rsc +12 -0
  41. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
  42. package/.next/server/app/_global-error.segments/_full.segment.rsc +12 -0
  43. package/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
  44. package/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
  45. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  46. package/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
  47. package/.next/server/app/_not-found/page/build-manifest.json +16 -0
  48. package/.next/server/app/_not-found/page/next-font-manifest.json +6 -0
  49. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
  50. package/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
  51. package/.next/server/app/_not-found/page.js +13 -0
  52. package/.next/server/app/_not-found/page.js.map +5 -0
  53. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  54. package/.next/server/app/_not-found/page_client-reference-manifest.js +2 -0
  55. package/.next/server/app/_not-found.html +1 -0
  56. package/.next/server/app/_not-found.meta +16 -0
  57. package/.next/server/app/_not-found.rsc +13 -0
  58. package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -0
  59. package/.next/server/app/_not-found.segments/_head.segment.rsc +5 -0
  60. package/.next/server/app/_not-found.segments/_index.segment.rsc +5 -0
  61. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  62. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -0
  63. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
  64. package/.next/server/app/index.html +1 -0
  65. package/.next/server/app/index.meta +14 -0
  66. package/.next/server/app/index.rsc +13 -0
  67. package/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -0
  68. package/.next/server/app/index.segments/_full.segment.rsc +13 -0
  69. package/.next/server/app/index.segments/_head.segment.rsc +5 -0
  70. package/.next/server/app/index.segments/_index.segment.rsc +5 -0
  71. package/.next/server/app/index.segments/_tree.segment.rsc +2 -0
  72. package/.next/server/app/page/app-paths-manifest.json +3 -0
  73. package/.next/server/app/page/build-manifest.json +16 -0
  74. package/.next/server/app/page/next-font-manifest.json +6 -0
  75. package/.next/server/app/page/react-loadable-manifest.json +1 -0
  76. package/.next/server/app/page/server-reference-manifest.json +4 -0
  77. package/.next/server/app/page.js +15 -0
  78. package/.next/server/app/page.js.map +5 -0
  79. package/.next/server/app/page.js.nft.json +1 -0
  80. package/.next/server/app/page_client-reference-manifest.js +2 -0
  81. package/.next/server/app-paths-manifest.json +5 -0
  82. package/.next/server/chunks/ssr/[root-of-the-server]__0c1ef9cf._.js +3 -0
  83. package/.next/server/chunks/ssr/[root-of-the-server]__0c1ef9cf._.js.map +1 -0
  84. package/.next/server/chunks/ssr/[root-of-the-server]__655f8d11._.js +10 -0
  85. package/.next/server/chunks/ssr/[root-of-the-server]__655f8d11._.js.map +1 -0
  86. package/.next/server/chunks/ssr/[root-of-the-server]__709fb98b._.js +3 -0
  87. package/.next/server/chunks/ssr/[root-of-the-server]__709fb98b._.js.map +1 -0
  88. package/.next/server/chunks/ssr/[root-of-the-server]__8756e439._.js +3 -0
  89. package/.next/server/chunks/ssr/[root-of-the-server]__8756e439._.js.map +1 -0
  90. package/.next/server/chunks/ssr/[root-of-the-server]__a23154e7._.js +3 -0
  91. package/.next/server/chunks/ssr/[root-of-the-server]__a23154e7._.js.map +1 -0
  92. package/.next/server/chunks/ssr/[root-of-the-server]__e38816c5._.js +3 -0
  93. package/.next/server/chunks/ssr/[root-of-the-server]__e38816c5._.js.map +1 -0
  94. package/.next/server/chunks/ssr/[turbopack]_runtime.js +795 -0
  95. package/.next/server/chunks/ssr/[turbopack]_runtime.js.map +10 -0
  96. package/.next/server/chunks/ssr/_79531e11._.js +3 -0
  97. package/.next/server/chunks/ssr/_79531e11._.js.map +1 -0
  98. package/.next/server/chunks/ssr/_d98638c1._.js +4 -0
  99. package/.next/server/chunks/ssr/_d98638c1._.js.map +1 -0
  100. package/.next/server/chunks/ssr/_de4e25a4._.js +3 -0
  101. package/.next/server/chunks/ssr/_de4e25a4._.js.map +1 -0
  102. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_75761787.js +3 -0
  103. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_75761787.js.map +1 -0
  104. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_554ec2bf.js +3 -0
  105. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_554ec2bf.js.map +1 -0
  106. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_39d4fc33.js +3 -0
  107. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_39d4fc33.js.map +1 -0
  108. package/.next/server/chunks/ssr/app_layout_tsx_271801d7._.js +3 -0
  109. package/.next/server/chunks/ssr/app_layout_tsx_271801d7._.js.map +1 -0
  110. package/.next/server/chunks/ssr/node_modules_8bc17d92._.js +4 -0
  111. package/.next/server/chunks/ssr/node_modules_8bc17d92._.js.map +1 -0
  112. package/.next/server/chunks/ssr/node_modules_next_dist_08570d7f._.js +4 -0
  113. package/.next/server/chunks/ssr/node_modules_next_dist_08570d7f._.js.map +1 -0
  114. package/.next/server/chunks/ssr/node_modules_next_dist_79ba2726._.js +6 -0
  115. package/.next/server/chunks/ssr/node_modules_next_dist_79ba2726._.js.map +1 -0
  116. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_9774470f._.js +3 -0
  117. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_9774470f._.js.map +1 -0
  118. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_45780354.js +3 -0
  119. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_45780354.js.map +1 -0
  120. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_ece394eb.js +3 -0
  121. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_ece394eb.js.map +1 -0
  122. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_15817684.js +3 -0
  123. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_15817684.js.map +1 -0
  124. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_d92e159d.js +4 -0
  125. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_d92e159d.js.map +1 -0
  126. package/.next/server/functions-config-manifest.json +4 -0
  127. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  128. package/.next/server/middleware-build-manifest.js +20 -0
  129. package/.next/server/middleware-manifest.json +6 -0
  130. package/.next/server/next-font-manifest.js +1 -0
  131. package/.next/server/next-font-manifest.json +6 -0
  132. package/.next/server/pages/404.html +1 -0
  133. package/.next/server/pages/500.html +2 -0
  134. package/.next/server/pages-manifest.json +4 -0
  135. package/.next/server/server-reference-manifest.js +1 -0
  136. package/.next/server/server-reference-manifest.json +5 -0
  137. package/.next/static/6C52FRjOtVZvRQv-BrjRS/_buildManifest.js +11 -0
  138. package/.next/static/6C52FRjOtVZvRQv-BrjRS/_clientMiddlewareManifest.json +1 -0
  139. package/.next/static/6C52FRjOtVZvRQv-BrjRS/_ssgManifest.js +1 -0
  140. package/.next/static/chunks/2f236954d6a65e12.js +1 -0
  141. package/.next/static/chunks/465f799faf41e6df.js +1 -0
  142. package/.next/static/chunks/4a436ca4a648344f.js +5 -0
  143. package/.next/static/chunks/a6dad97d9634a72d.js +1 -0
  144. package/.next/static/chunks/a6dad97d9634a72d.js.map +1 -0
  145. package/.next/static/chunks/ad4cf95c856c591c.js +1 -0
  146. package/.next/static/chunks/dd9a1714ab1cd306.css +1 -0
  147. package/.next/static/chunks/turbopack-8b41c18f1602b01b.js +4 -0
  148. package/.next/trace +1 -0
  149. package/.next/trace-build +1 -0
  150. package/.next/turbopack +0 -0
  151. package/.next/types/routes.d.ts +57 -0
  152. package/.next/types/validator.ts +61 -0
  153. package/bin/hike.js +349 -0
  154. package/package.json +45 -0
@@ -0,0 +1 @@
1
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--spacing:.25rem;--container-3xl:48rem;--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-bold:700;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.mx-auto{margin-inline:auto}.max-w-3xl{max-width:var(--container-3xl)}.p-8{padding:calc(var(--spacing)*8)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}}@property --tw-font-weight{syntax:"*";inherits:false}
@@ -0,0 +1,4 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/465f799faf41e6df.js","static/chunks/ad4cf95c856c591c.js","static/chunks/4a436ca4a648344f.js"],runtimeModuleIds:[94553]}]),(()=>{let e;if(!Array.isArray(globalThis.TURBOPACK))return;let t="/_next/",r=(self.TURBOPACK_CHUNK_SUFFIX??document?.currentScript?.getAttribute?.("src")?.replace(/^(.*(?=\?)|^.*$)/,""))||"",n=new WeakMap;function o(e,t){this.m=e,this.e=t}let l=o.prototype,i=Object.prototype.hasOwnProperty,s="u">typeof Symbol&&Symbol.toStringTag;function u(e,t,r){i.call(e,t)||Object.defineProperty(e,t,r)}function a(e,t){let r=e[t];return r||(r=c(t),e[t]=r),r}function c(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function f(e,t){u(e,"__esModule",{value:!0}),s&&u(e,s,{value:"Module"});let r=0;for(;r<t.length;){let n=t[r++],o=t[r++];if("number"==typeof o)if(0===o)u(e,n,{value:t[r++],enumerable:!0,writable:!1});else throw Error(`unexpected tag: ${o}`);else"function"==typeof t[r]?u(e,n,{get:o,set:t[r++],enumerable:!0}):u(e,n,{get:o,enumerable:!0})}Object.seal(e)}l.s=function(e,t){let r,n;null!=t?n=(r=a(this.c,t)).exports:(r=this.m,n=this.e),r.namespaceObject=n,f(n,e)},l.j=function(e,t){var r,o;let l,s,u;null!=t?s=(l=a(this.c,t)).exports:(l=this.m,s=this.e);let c=(r=l,o=s,(u=n.get(r))||(n.set(r,u=[]),r.exports=r.namespaceObject=new Proxy(o,{get(e,t){if(i.call(e,t)||"default"===t||"__esModule"===t)return Reflect.get(e,t);for(let e of u){let r=Reflect.get(e,t);if(void 0!==r)return r}},ownKeys(e){let t=Reflect.ownKeys(e);for(let e of u)for(let r of Reflect.ownKeys(e))"default"===r||t.includes(r)||t.push(r);return t}})),u);"object"==typeof e&&null!==e&&c.push(e)},l.v=function(e,t){(null!=t?a(this.c,t):this.m).exports=e},l.n=function(e,t){let r;(r=null!=t?a(this.c,t):this.m).exports=r.namespaceObject=e};let p=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,h=[null,p({}),p([]),p(p)];function d(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!h.includes(t);t=p(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),f(t,n),t}function m(e){let t=B(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=d(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function b(e){let t=e.indexOf("#");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("?");return -1!==r&&(e=e.substring(0,r)),e}function y(){let e,t;return{promise:new Promise((r,n)=>{t=n,e=r}),resolve:e,reject:t}}l.i=m,l.A=function(e){return this.r(e)(m.bind(this))},l.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},l.r=function(e){return B(e,this.m).exports},l.f=function(e){function t(t){if(t=b(t),i.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(t=b(t),i.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let O=Symbol("turbopack queues"),g=Symbol("turbopack exports"),w=Symbol("turbopack error");function C(e){e&&1!==e.status&&(e.status=1,e.forEach(e=>e.queueCount--),e.forEach(e=>e.queueCount--?e.queueCount++:e()))}l.a=function(e,t){let r=this.m,n=t?Object.assign([],{status:-1}):void 0,o=new Set,{resolve:l,reject:i,promise:s}=y(),u=Object.assign(s,{[g]:r.exports,[O]:e=>{n&&e(n),o.forEach(e),u.catch(()=>{})}}),a={get:()=>u,set(e){e!==u&&(u[g]=e)}};Object.defineProperty(r,"exports",a),Object.defineProperty(r,"namespaceObject",a),e(function(e){let t=e.map(e=>{if(null!==e&&"object"==typeof e){if(O in e)return e;if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then){let t=Object.assign([],{status:0}),r={[g]:{},[O]:e=>e(t)};return e.then(e=>{r[g]=e,C(t)},e=>{r[w]=e,C(t)}),r}}return{[g]:e,[O]:()=>{}}}),r=()=>t.map(e=>{if(e[w])throw e[w];return e[g]}),{promise:l,resolve:i}=y(),s=Object.assign(()=>i(r),{queueCount:0});function u(e){e!==n&&!o.has(e)&&(o.add(e),e&&0===e.status&&(s.queueCount++,e.push(s)))}return t.map(e=>e[O](u)),s.queueCount?l:r()},function(e){e?i(u[w]=e):l(u[g]),C(n)}),n&&-1===n.status&&(n.status=0)};let U=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function R(e,t){throw Error(`Invariant: ${t(e)}`)}U.prototype=URL.prototype,l.U=U,l.z=function(e){throw Error("dynamic usage of require is not supported")},l.g=globalThis;let j=o.prototype;var _,k=((_=k||{})[_.Runtime=0]="Runtime",_[_.Parent=1]="Parent",_[_.Update=2]="Update",_);let v=new Map;l.M=v;let $=new Map,P=new Map;async function S(e,t,r){let n;if("string"==typeof r)return E(e,t,K(r));let o=r.included||[],l=o.map(e=>!!v.has(e)||$.get(e));if(l.length>0&&l.every(e=>e))return void await Promise.all(l);let i=r.moduleChunks||[],s=i.map(e=>P.get(e)).filter(e=>e);if(s.length>0){if(s.length===i.length)return void await Promise.all(s);let r=new Set;for(let e of i)P.has(e)||r.add(e);for(let n of r){let r=E(e,t,K(n));P.set(n,r),s.push(r)}n=Promise.all(s)}else{for(let o of(n=E(e,t,K(r.path)),i))P.has(o)||P.set(o,n)}for(let e of o)$.has(e)||$.set(e,n);await n}j.l=function(e){return S(1,this.m.id,e)};let T=Promise.resolve(void 0),A=new WeakMap;function E(t,r,n){let o=e.loadChunkCached(t,n),l=A.get(o);if(void 0===l){let e=A.set.bind(A,o,T);l=o.then(e).catch(e=>{let o;switch(t){case 0:o=`as a runtime dependency of chunk ${r}`;break;case 1:o=`from module ${r}`;break;case 2:o="from an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}let l=Error(`Failed to load chunk ${n} ${o}${e?`: ${e}`:""}`,e?{cause:e}:void 0);throw l.name="ChunkLoadError",l}),A.set(o,l)}return l}function K(e){return`${t}${e.split("/").map(e=>encodeURIComponent(e)).join("/")}${r}`}j.L=function(e){return E(1,this.m.id,e)},j.R=function(e){let t=this.r(e);return t?.default??t},j.P=function(e){return`/ROOT/${e??""}`},j.b=function(e){let t=new Blob([`self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};
2
+ self.TURBOPACK_CHUNK_SUFFIX = ${JSON.stringify(r)};
3
+ self.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(e.reverse().map(K),null,2)};
4
+ importScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`],{type:"text/javascript"});return URL.createObjectURL(t)};let x=/\.js(?:\?[^#]*)?(?:#.*)?$/,N=/\.css(?:\?[^#]*)?(?:#.*)?$/;function M(e){return N.test(e)}l.w=function(t,r,n){return e.loadWebAssembly(1,this.m.id,t,r,n)},l.u=function(t,r){return e.loadWebAssemblyModule(1,this.m.id,t,r)};let L={};l.c=L;let B=(e,t)=>{let r=L[e];if(r){if(r.error)throw r.error;return r}return q(e,k.Parent,t.id)};function q(e,t,r){let n=v.get(e);if("function"!=typeof n)throw Error(function(e,t,r){let n;switch(t){case 0:n=`as a runtime entry of chunk ${r}`;break;case 1:n=`because it was required from module ${r}`;break;case 2:n="because of an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}return`Module ${e} was instantiated ${n}, but the module factory is not available.`}(e,t,r));let l=c(e),i=l.exports;L[e]=l;let s=new o(l,i);try{n(s,l,i)}catch(e){throw l.error=e,e}return l.namespaceObject&&l.exports!==l.namespaceObject&&d(l.exports,l.namespaceObject),l}function I(r){let n,o=function(e){if("string"==typeof e)return e;let r=decodeURIComponent(("u">typeof TURBOPACK_NEXT_CHUNK_URLS?TURBOPACK_NEXT_CHUNK_URLS.pop():e.getAttribute("src")).replace(/[?#].*$/,""));return r.startsWith(t)?r.slice(t.length):r}(r[0]);return 2===r.length?n=r[1]:(n=void 0,!function(e,t,r,n){let o=1;for(;o<e.length;){let t=e[o],n=o+1;for(;n<e.length&&"function"!=typeof e[n];)n++;if(n===e.length)throw Error("malformed chunk format, expected a factory function");if(!r.has(t)){let l=e[n];for(Object.defineProperty(l,"name",{value:"module evaluation"});o<n;o++)t=e[o],r.set(t,l)}o=n+1}}(r,0,v)),e.registerChunk(o,n)}let W=new Map;function H(e){let t=W.get(e);if(!t){let r,n;t={resolved:!1,loadingStarted:!1,promise:new Promise((e,t)=>{r=e,n=t}),resolve:()=>{t.resolved=!0,r()},reject:n},W.set(e,t)}return t}e={async registerChunk(e,t){if(H(K(e)).resolve(),null!=t){for(let e of t.otherChunks)H(K("string"==typeof e?e:e.path));if(await Promise.all(t.otherChunks.map(t=>S(0,e,t))),t.runtimeModuleIds.length>0)for(let r of t.runtimeModuleIds)!function(e,t){let r=L[t];if(r){if(r.error)throw r.error;return}q(t,k.Runtime,e)}(e,r)}},loadChunkCached:(e,t)=>(function(e,t){let r=H(t);if(r.loadingStarted)return r.promise;if(e===k.Runtime)return r.loadingStarted=!0,M(t)&&r.resolve(),r.promise;if("function"==typeof importScripts)if(M(t));else if(x.test(t))self.TURBOPACK_NEXT_CHUNK_URLS.push(t),importScripts(TURBOPACK_WORKER_LOCATION+t);else throw Error(`can't infer type of chunk from URL ${t} in worker`);else{let e=decodeURI(t);if(M(t))if(document.querySelectorAll(`link[rel=stylesheet][href="${t}"],link[rel=stylesheet][href^="${t}?"],link[rel=stylesheet][href="${e}"],link[rel=stylesheet][href^="${e}?"]`).length>0)r.resolve();else{let e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onerror=()=>{r.reject()},e.onload=()=>{r.resolve()},document.head.appendChild(e)}else if(x.test(t)){let n=document.querySelectorAll(`script[src="${t}"],script[src^="${t}?"],script[src="${e}"],script[src^="${e}?"]`);if(n.length>0)for(let e of Array.from(n))e.addEventListener("error",()=>{r.reject()});else{let e=document.createElement("script");e.src=t,e.onerror=()=>{r.reject()},document.head.appendChild(e)}}else throw Error(`can't infer type of chunk from URL ${t}`)}return r.loadingStarted=!0,r.promise})(e,t),async loadWebAssembly(e,t,r,n,o){let l=fetch(K(r)),{instance:i}=await WebAssembly.instantiateStreaming(l,o);return i.exports},async loadWebAssemblyModule(e,t,r,n){let o=fetch(K(r));return await WebAssembly.compileStreaming(o)}};let F=globalThis.TURBOPACK;globalThis.TURBOPACK={push:I},F.forEach(I)})();
package/.next/trace ADDED
@@ -0,0 +1 @@
1
+ [{"name":"generate-buildid","duration":76,"timestamp":1381890113702,"id":4,"parentId":1,"tags":{},"startTime":1771068719524,"traceId":"b875dede1d1b5be9"},{"name":"load-custom-routes","duration":107,"timestamp":1381890113810,"id":5,"parentId":1,"tags":{},"startTime":1771068719524,"traceId":"b875dede1d1b5be9"},{"name":"create-dist-dir","duration":52,"timestamp":1381890113953,"id":6,"parentId":1,"tags":{},"startTime":1771068719525,"traceId":"b875dede1d1b5be9"},{"name":"clean","duration":12690,"timestamp":1381890114218,"id":7,"parentId":1,"tags":{},"startTime":1771068719525,"traceId":"b875dede1d1b5be9"},{"name":"create-pages-mapping","duration":83,"timestamp":1381890132037,"id":8,"parentId":1,"tags":{},"startTime":1771068719543,"traceId":"b875dede1d1b5be9"},{"name":"collect-app-files","duration":511,"timestamp":1381890132134,"id":9,"parentId":1,"tags":{},"startTime":1771068719543,"traceId":"b875dede1d1b5be9"},{"name":"create-app-mapping","duration":195,"timestamp":1381890132653,"id":10,"parentId":1,"tags":{},"startTime":1771068719543,"traceId":"b875dede1d1b5be9"},{"name":"create-app-layouts","duration":42,"timestamp":1381890132898,"id":11,"parentId":1,"tags":{},"startTime":1771068719544,"traceId":"b875dede1d1b5be9"},{"name":"collect-default-files","duration":54,"timestamp":1381890133426,"id":13,"parentId":1,"tags":{},"startTime":1771068719544,"traceId":"b875dede1d1b5be9"},{"name":"generate-route-types","duration":1290,"timestamp":1381890133263,"id":12,"parentId":1,"tags":{},"startTime":1771068719544,"traceId":"b875dede1d1b5be9"},{"name":"public-dir-conflict-check","duration":22,"timestamp":1381890134603,"id":14,"parentId":1,"tags":{},"startTime":1771068719545,"traceId":"b875dede1d1b5be9"},{"name":"generate-routes-manifest","duration":5528,"timestamp":1381890134644,"id":15,"parentId":1,"tags":{},"startTime":1771068719545,"traceId":"b875dede1d1b5be9"},{"name":"run-turbopack","duration":1028087,"timestamp":1381890141278,"id":17,"parentId":1,"tags":{},"startTime":1771068719552,"traceId":"b875dede1d1b5be9"},{"name":"run-typescript","duration":650462,"timestamp":1381891182611,"id":19,"parentId":1,"tags":{},"startTime":1771068720593,"traceId":"b875dede1d1b5be9"},{"name":"generate-required-server-files","duration":592,"timestamp":1381891833762,"id":21,"parentId":1,"tags":{},"startTime":1771068721244,"traceId":"b875dede1d1b5be9"},{"name":"check-static-error-page","duration":783,"timestamp":1381891839111,"id":23,"parentId":22,"tags":{},"startTime":1771068721250,"traceId":"b875dede1d1b5be9"},{"name":"is-page-static","duration":113663,"timestamp":1381891840298,"id":27,"parentId":25,"tags":{},"startTime":1771068721251,"traceId":"b875dede1d1b5be9"},{"name":"check-page","duration":114210,"timestamp":1381891839811,"id":25,"parentId":22,"tags":{"page":"/_global-error"},"startTime":1771068721250,"traceId":"b875dede1d1b5be9"},{"name":"is-page-static","duration":128727,"timestamp":1381891843763,"id":29,"parentId":26,"tags":{},"startTime":1771068721254,"traceId":"b875dede1d1b5be9"},{"name":"check-page","duration":132678,"timestamp":1381891839875,"id":26,"parentId":22,"tags":{"page":"/"},"startTime":1771068721250,"traceId":"b875dede1d1b5be9"},{"name":"is-page-static","duration":131927,"timestamp":1381891840692,"id":28,"parentId":24,"tags":{},"startTime":1771068721251,"traceId":"b875dede1d1b5be9"},{"name":"check-page","duration":133204,"timestamp":1381891839431,"id":24,"parentId":22,"tags":{"page":"/_not-found"},"startTime":1771068721250,"traceId":"b875dede1d1b5be9"},{"name":"static-check","duration":133851,"timestamp":1381891838798,"id":22,"parentId":1,"tags":{},"startTime":1771068721249,"traceId":"b875dede1d1b5be9"},{"name":"write-routes-manifest","duration":1295,"timestamp":1381891974198,"id":31,"parentId":1,"tags":{},"startTime":1771068721385,"traceId":"b875dede1d1b5be9"},{"name":"load-dotenv","duration":12,"timestamp":1381891983004,"id":34,"parentId":33,"tags":{},"startTime":1771068721394,"traceId":"b875dede1d1b5be9"},{"name":"run-export-path-map","duration":149,"timestamp":1381891983765,"id":35,"parentId":33,"tags":{},"startTime":1771068721394,"traceId":"b875dede1d1b5be9"},{"name":"next-export","duration":114509,"timestamp":1381891982560,"id":33,"parentId":1,"tags":{},"startTime":1771068721393,"traceId":"b875dede1d1b5be9"},{"name":"move-exported-app-not-found-","duration":241,"timestamp":1381892097519,"id":36,"parentId":32,"tags":{},"startTime":1771068721508,"traceId":"b875dede1d1b5be9"},{"name":"move-exported-app-global-error-","duration":157,"timestamp":1381892097779,"id":37,"parentId":32,"tags":{},"startTime":1771068721508,"traceId":"b875dede1d1b5be9"},{"name":"static-generation","duration":120238,"timestamp":1381891978242,"id":32,"parentId":1,"tags":{},"startTime":1771068721389,"traceId":"b875dede1d1b5be9"},{"name":"write-routes-manifest","duration":95,"timestamp":1381892098516,"id":38,"parentId":1,"tags":{},"startTime":1771068721509,"traceId":"b875dede1d1b5be9"},{"name":"print-tree-view","duration":805,"timestamp":1381892103299,"id":39,"parentId":1,"tags":{},"startTime":1771068721514,"traceId":"b875dede1d1b5be9"},{"name":"telemetry-flush","duration":189211,"timestamp":1381892104110,"id":40,"parentId":1,"tags":{},"startTime":1771068721515,"traceId":"b875dede1d1b5be9"},{"name":"next-build","duration":2337784,"timestamp":1381889955572,"id":1,"tags":{"buildMode":"default","version":"16.1.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1771068719366,"traceId":"b875dede1d1b5be9"}]
@@ -0,0 +1 @@
1
+ [{"name":"run-turbopack","duration":1028087,"timestamp":1381890141278,"id":17,"parentId":1,"tags":{},"startTime":1771068719552,"traceId":"b875dede1d1b5be9"},{"name":"run-typescript","duration":650462,"timestamp":1381891182611,"id":19,"parentId":1,"tags":{},"startTime":1771068720593,"traceId":"b875dede1d1b5be9"},{"name":"static-check","duration":133851,"timestamp":1381891838798,"id":22,"parentId":1,"tags":{},"startTime":1771068721249,"traceId":"b875dede1d1b5be9"},{"name":"static-generation","duration":120238,"timestamp":1381891978242,"id":32,"parentId":1,"tags":{},"startTime":1771068721389,"traceId":"b875dede1d1b5be9"},{"name":"telemetry-flush","duration":189211,"timestamp":1381892104110,"id":40,"parentId":1,"tags":{},"startTime":1771068721515,"traceId":"b875dede1d1b5be9"},{"name":"next-build","duration":2337784,"timestamp":1381889955572,"id":1,"tags":{"buildMode":"default","version":"16.1.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1771068719366,"traceId":"b875dede1d1b5be9"}]
File without changes
@@ -0,0 +1,57 @@
1
+ // This file is generated automatically by Next.js
2
+ // Do not edit this file manually
3
+
4
+ type AppRoutes = "/"
5
+ type PageRoutes = never
6
+ type LayoutRoutes = "/"
7
+ type RedirectRoutes = never
8
+ type RewriteRoutes = never
9
+ type Routes = AppRoutes | PageRoutes | LayoutRoutes | RedirectRoutes | RewriteRoutes
10
+
11
+
12
+ interface ParamMap {
13
+ "/": {}
14
+ }
15
+
16
+
17
+ export type ParamsOf<Route extends Routes> = ParamMap[Route]
18
+
19
+ interface LayoutSlotMap {
20
+ "/": never
21
+ }
22
+
23
+
24
+ export type { AppRoutes, PageRoutes, LayoutRoutes, RedirectRoutes, RewriteRoutes, ParamMap }
25
+
26
+ declare global {
27
+ /**
28
+ * Props for Next.js App Router page components
29
+ * @example
30
+ * ```tsx
31
+ * export default function Page(props: PageProps<'/blog/[slug]'>) {
32
+ * const { slug } = await props.params
33
+ * return <div>Blog post: {slug}</div>
34
+ * }
35
+ * ```
36
+ */
37
+ interface PageProps<AppRoute extends AppRoutes> {
38
+ params: Promise<ParamMap[AppRoute]>
39
+ searchParams: Promise<Record<string, string | string[] | undefined>>
40
+ }
41
+
42
+ /**
43
+ * Props for Next.js App Router layout components
44
+ * @example
45
+ * ```tsx
46
+ * export default function Layout(props: LayoutProps<'/dashboard'>) {
47
+ * return <div>{props.children}</div>
48
+ * }
49
+ * ```
50
+ */
51
+ type LayoutProps<LayoutRoute extends LayoutRoutes> = {
52
+ params: Promise<ParamMap[LayoutRoute]>
53
+ children: React.ReactNode
54
+ } & {
55
+ [K in LayoutSlotMap[LayoutRoute]]: React.ReactNode
56
+ }
57
+ }
@@ -0,0 +1,61 @@
1
+ // This file is generated automatically by Next.js
2
+ // Do not edit this file manually
3
+ // This file validates that all pages and layouts export the correct types
4
+
5
+ import type { AppRoutes, LayoutRoutes, ParamMap } from "./routes.js"
6
+ import type { ResolvingMetadata, ResolvingViewport } from "next/types.js"
7
+
8
+ type AppPageConfig<Route extends AppRoutes = AppRoutes> = {
9
+ default: React.ComponentType<{ params: Promise<ParamMap[Route]> } & any> | ((props: { params: Promise<ParamMap[Route]> } & any) => React.ReactNode | Promise<React.ReactNode> | never | void | Promise<void>)
10
+ generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise<any[]> | any[]
11
+ generateMetadata?: (
12
+ props: { params: Promise<ParamMap[Route]> } & any,
13
+ parent: ResolvingMetadata
14
+ ) => Promise<any> | any
15
+ generateViewport?: (
16
+ props: { params: Promise<ParamMap[Route]> } & any,
17
+ parent: ResolvingViewport
18
+ ) => Promise<any> | any
19
+ metadata?: any
20
+ viewport?: any
21
+ }
22
+
23
+ type LayoutConfig<Route extends LayoutRoutes = LayoutRoutes> = {
24
+ default: React.ComponentType<LayoutProps<Route>> | ((props: LayoutProps<Route>) => React.ReactNode | Promise<React.ReactNode> | never | void | Promise<void>)
25
+ generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise<any[]> | any[]
26
+ generateMetadata?: (
27
+ props: { params: Promise<ParamMap[Route]> } & any,
28
+ parent: ResolvingMetadata
29
+ ) => Promise<any> | any
30
+ generateViewport?: (
31
+ props: { params: Promise<ParamMap[Route]> } & any,
32
+ parent: ResolvingViewport
33
+ ) => Promise<any> | any
34
+ metadata?: any
35
+ viewport?: any
36
+ }
37
+
38
+
39
+ // Validate ../../app/page.tsx
40
+ {
41
+ type __IsExpected<Specific extends AppPageConfig<"/">> = Specific
42
+ const handler = {} as typeof import("../../app/page.js")
43
+ type __Check = __IsExpected<typeof handler>
44
+ // @ts-ignore
45
+ type __Unused = __Check
46
+ }
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+ // Validate ../../app/layout.tsx
55
+ {
56
+ type __IsExpected<Specific extends LayoutConfig<"/">> = Specific
57
+ const handler = {} as typeof import("../../app/layout.js")
58
+ type __Check = __IsExpected<typeof handler>
59
+ // @ts-ignore
60
+ type __Unused = __Check
61
+ }
package/bin/hike.js ADDED
@@ -0,0 +1,349 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require("node:child_process");
4
+ const fs = require("node:fs");
5
+ const path = require("node:path");
6
+ const net = require("node:net");
7
+
8
+ const DEFAULT_PORT = 8849;
9
+
10
+ function isProcessRunning(pid) {
11
+ try {
12
+ process.kill(pid, 0);
13
+ return true;
14
+ } catch (e) {
15
+ return false;
16
+ }
17
+ }
18
+
19
+ function getPidFilePath() {
20
+ return path.join(process.cwd(), ".hike", ".pid");
21
+ }
22
+
23
+ function getRunningInstance() {
24
+ const pidFile = getPidFilePath();
25
+ try {
26
+ const content = fs.readFileSync(pidFile, "utf8");
27
+ const [pidStr, portStr] = content.trim().split("\n");
28
+ const pid = parseInt(pidStr, 10);
29
+ const port = parseInt(portStr, 10);
30
+ if (pid && isProcessRunning(pid) && port) {
31
+ return { pid, port };
32
+ }
33
+ } catch (e) {
34
+ // File doesn't exist or can't be read
35
+ }
36
+ return null;
37
+ }
38
+
39
+ function writeInstanceInfo(port) {
40
+ const pidFile = getPidFilePath();
41
+ try {
42
+ fs.writeFileSync(pidFile, `${process.pid}\n${port}`);
43
+ } catch (e) {
44
+ // If we can't write, continue anyway
45
+ }
46
+ }
47
+
48
+ function shouldOpenBrowser() {
49
+ const instance = getRunningInstance();
50
+ if (instance) {
51
+ return false; // Another instance is running
52
+ }
53
+ return true;
54
+ }
55
+
56
+ function openBrowser(url, { forceOpen = false } = {}) {
57
+ if (
58
+ process.env.CI ||
59
+ process.env.HIKE_NO_OPEN === "1" ||
60
+ process.env.HIKE_NO_OPEN === "true"
61
+ ) {
62
+ return;
63
+ }
64
+
65
+ if (!forceOpen && !shouldOpenBrowser()) {
66
+ return;
67
+ }
68
+
69
+ const platform = process.platform;
70
+
71
+ if (platform === "darwin") {
72
+ spawn("open", [url], { stdio: "ignore", detached: true }).unref();
73
+ return;
74
+ }
75
+
76
+ if (platform === "win32") {
77
+ spawn("cmd", ["/c", "start", "", url], {
78
+ stdio: "ignore",
79
+ detached: true,
80
+ }).unref();
81
+ return;
82
+ }
83
+
84
+ // linux, etc.
85
+ spawn("xdg-open", [url], { stdio: "ignore", detached: true }).unref();
86
+ }
87
+
88
+ function parseArgs(argv) {
89
+ const result = {
90
+ command: "start",
91
+ port: undefined,
92
+ help: false,
93
+ page: undefined,
94
+ };
95
+
96
+ const args = argv.slice(2);
97
+ for (let i = 0; i < args.length; i++) {
98
+ const a = args[i];
99
+
100
+ if (a === "dev" || a === "start") {
101
+ result.command = a;
102
+ continue;
103
+ }
104
+
105
+ if (a === "-h" || a === "--help") {
106
+ result.help = true;
107
+ continue;
108
+ }
109
+
110
+ if (a === "-p" || a === "--port") {
111
+ const v = args[i + 1];
112
+ i++;
113
+ result.port = v;
114
+ continue;
115
+ }
116
+
117
+ if (a.startsWith("--port=")) {
118
+ result.port = a.slice("--port=".length);
119
+ continue;
120
+ }
121
+
122
+ // Treat any other non-flag argument as the page name
123
+ if (!a.startsWith("-")) {
124
+ result.page = a.replace(/\.mdx$/i, ""); // strip .mdx if provided
125
+ continue;
126
+ }
127
+ }
128
+
129
+ return result;
130
+ }
131
+
132
+ function usage() {
133
+ return [
134
+ "Usage:",
135
+ " hike [page] # run production build, optionally open specific page",
136
+ " hike start [page] # same as above",
137
+ " hike dev [page] # run Next.js dev server",
138
+ "",
139
+ "Arguments:",
140
+ " page Page name to open (e.g., 'test' or 'folder/page')",
141
+ "",
142
+ "Options:",
143
+ ` -p, --port <port> Port to listen on (default: ${DEFAULT_PORT})`,
144
+ " -h, --help Show this help",
145
+ ].join("\n");
146
+ }
147
+
148
+ function coercePort(portLike) {
149
+ const port = Number(portLike ?? process.env.PORT ?? DEFAULT_PORT);
150
+ if (!Number.isFinite(port) || port <= 0) return null;
151
+ return port;
152
+ }
153
+
154
+ function isPortAvailable(port) {
155
+ return new Promise((resolve) => {
156
+ const server = net.createServer();
157
+ server.once("error", () => resolve(false));
158
+ server.once("listening", () => {
159
+ server.close(() => resolve(true));
160
+ });
161
+ server.listen(port, "127.0.0.1");
162
+ });
163
+ }
164
+
165
+ async function findAvailablePort(startPort, maxAttempts = 10) {
166
+ for (let i = 0; i < maxAttempts; i++) {
167
+ const port = startPort + i;
168
+ if (await isPortAvailable(port)) {
169
+ return port;
170
+ }
171
+ }
172
+ return null;
173
+ }
174
+
175
+ function runDev({ root, port, page }) {
176
+ const baseUrl = `http://localhost:${port}`;
177
+ const url = page ? `${baseUrl}/${page}` : baseUrl;
178
+ let opened = false;
179
+
180
+ let nextBin;
181
+ try {
182
+ nextBin = require.resolve("next/dist/bin/next", { paths: [root] });
183
+ } catch (e) {
184
+ console.error(
185
+ [
186
+ "Missing Next.js dependency.",
187
+ "Expected to resolve: next/dist/bin/next",
188
+ "",
189
+ "If you're running from source, install deps first:",
190
+ " npm install",
191
+ ].join("\n"),
192
+ );
193
+ process.exit(1);
194
+ }
195
+
196
+ const child = spawn(process.execPath, [nextBin, "dev", "-p", String(port)], {
197
+ cwd: root,
198
+ env: {
199
+ ...process.env,
200
+ PORT: String(port),
201
+ HIKE_CWD: process.cwd(),
202
+ },
203
+ stdio: ["inherit", "pipe", "pipe"],
204
+ });
205
+
206
+ const onOutput = (chunk) => {
207
+ const text = String(chunk);
208
+ process.stdout.write(text);
209
+
210
+ if (opened) return;
211
+ if (
212
+ text.includes(baseUrl) ||
213
+ /ready|listening|started server/i.test(text)
214
+ ) {
215
+ opened = true;
216
+ writeInstanceInfo(port);
217
+ openBrowser(url);
218
+ }
219
+ };
220
+
221
+ child.stdout.on("data", onOutput);
222
+ child.stderr.on("data", (chunk) => process.stderr.write(String(chunk)));
223
+ child.on("exit", (code, signal) => {
224
+ if (signal) process.kill(process.pid, signal);
225
+ process.exit(code ?? 0);
226
+ });
227
+ process.on("SIGINT", () => child.kill("SIGINT"));
228
+ process.on("SIGTERM", () => child.kill("SIGTERM"));
229
+ }
230
+
231
+ function runProd({ root, port, page }) {
232
+ const nextDir = path.join(root, ".next");
233
+ if (!fs.existsSync(nextDir)) {
234
+ console.error(
235
+ [
236
+ "Missing build output.",
237
+ `Expected: ${nextDir}`,
238
+ "",
239
+ "If you're running from source, build first:",
240
+ " npm install",
241
+ " npm run build",
242
+ ].join("\n"),
243
+ );
244
+ process.exit(1);
245
+ }
246
+
247
+ const baseUrl = `http://localhost:${port}`;
248
+ const url = page ? `${baseUrl}/${page}` : baseUrl;
249
+ let opened = false;
250
+
251
+ let nextBin;
252
+ try {
253
+ nextBin = require.resolve("next/dist/bin/next", { paths: [root] });
254
+ } catch (e) {
255
+ console.error(
256
+ [
257
+ "Missing Next.js dependency.",
258
+ "Expected to resolve: next/dist/bin/next",
259
+ "",
260
+ "If you're running from source, install deps first:",
261
+ " npm install",
262
+ ].join("\n"),
263
+ );
264
+ process.exit(1);
265
+ }
266
+
267
+ const child = spawn(
268
+ process.execPath,
269
+ [nextBin, "start", "-p", String(port)],
270
+ {
271
+ cwd: root,
272
+ env: {
273
+ ...process.env,
274
+ PORT: String(port),
275
+ HIKE_CWD: process.cwd(),
276
+ },
277
+ stdio: ["inherit", "pipe", "pipe"],
278
+ },
279
+ );
280
+
281
+ const onOutput = (chunk) => {
282
+ const text = String(chunk);
283
+ process.stdout.write(text);
284
+
285
+ if (opened) return;
286
+ if (
287
+ text.includes(baseUrl) ||
288
+ /ready|listening|started server/i.test(text)
289
+ ) {
290
+ opened = true;
291
+ writeInstanceInfo(port);
292
+ openBrowser(url);
293
+ }
294
+ };
295
+
296
+ child.stdout.on("data", onOutput);
297
+ child.stderr.on("data", (chunk) => process.stderr.write(String(chunk)));
298
+ child.on("exit", (code, signal) => {
299
+ if (signal) process.kill(process.pid, signal);
300
+ process.exit(code ?? 0);
301
+ });
302
+ process.on("SIGINT", () => child.kill("SIGINT"));
303
+ process.on("SIGTERM", () => child.kill("SIGTERM"));
304
+ }
305
+
306
+ async function main() {
307
+ const args = parseArgs(process.argv);
308
+ if (args.help) {
309
+ process.stdout.write(`${usage()}\n`);
310
+ return;
311
+ }
312
+
313
+ // If a page is specified and an instance is already running, just open the browser
314
+ if (args.page) {
315
+ const instance = getRunningInstance();
316
+ if (instance) {
317
+ const url = `http://localhost:${instance.port}/${args.page}`;
318
+ openBrowser(url, { forceOpen: true });
319
+ return;
320
+ }
321
+ }
322
+
323
+ const requestedPort = coercePort(args.port);
324
+ if (requestedPort == null) {
325
+ console.error(`Invalid port: ${String(args.port ?? process.env.PORT)}`);
326
+ process.exit(1);
327
+ }
328
+
329
+ const port = await findAvailablePort(requestedPort);
330
+ if (port == null) {
331
+ console.error(`No available port found starting from ${requestedPort}`);
332
+ process.exit(1);
333
+ }
334
+
335
+ if (port !== requestedPort) {
336
+ console.log(`Port ${requestedPort} is in use, using ${port} instead`);
337
+ }
338
+
339
+ const root = path.resolve(__dirname, "..");
340
+
341
+ if (args.command === "dev") {
342
+ runDev({ root, port, page: args.page });
343
+ return;
344
+ }
345
+
346
+ runProd({ root, port, page: args.page });
347
+ }
348
+
349
+ main();
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@code-hike/hike",
3
+ "version": "0.0.1",
4
+ "description": "Run the Hike Next.js app via npx.",
5
+ "private": false,
6
+ "license": "MIT",
7
+ "author": "",
8
+ "main": "bin/hike.js",
9
+ "bin": {
10
+ "hike": "bin/hike.js"
11
+ },
12
+ "engines": {
13
+ "node": ">=18"
14
+ },
15
+ "scripts": {
16
+ "dev": "next dev",
17
+ "build": "next build",
18
+ "postbuild": "node scripts/clean-next.mjs",
19
+ "start": "node bin/hike.js",
20
+ "prepack": "npm run build",
21
+ "clean": "rm -rf .next"
22
+ },
23
+ "files": [
24
+ "bin/",
25
+ ".next/"
26
+ ],
27
+ "keywords": [
28
+ "nextjs",
29
+ "cli",
30
+ "npx"
31
+ ],
32
+ "dependencies": {
33
+ "next": "16.1.3",
34
+ "react": "19.2.3",
35
+ "react-dom": "19.2.3"
36
+ },
37
+ "devDependencies": {
38
+ "@tailwindcss/postcss": "^4",
39
+ "@types/node": "^20",
40
+ "@types/react": "^19",
41
+ "@types/react-dom": "^19",
42
+ "tailwindcss": "^4",
43
+ "typescript": "^5"
44
+ }
45
+ }