@enhance-eng/sandbox 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Enhance sandbox library for adding preview functionality to your application.
4
4
 
5
- **Supported frameworks:** React SPAs and statically generated sites. SSR is not supported.
5
+ **Supported frameworks:** React SPAs, Next.js (App Router), and statically generated sites.
6
6
 
7
7
  ## Installation
8
8
 
@@ -10,6 +10,32 @@ Enhance sandbox library for adding preview functionality to your application.
10
10
  npm install @enhance-eng/sandbox
11
11
  ```
12
12
 
13
+ ## Next.js (App Router)
14
+
15
+ To enable Enhance in your Next.js application and resolve hydration errors, add the `EnhanceScripts` component to your root layout.
16
+
17
+ ```tsx
18
+ // app/layout.tsx
19
+ import { EnhanceScripts } from "@enhance-eng/sandbox/next";
20
+
21
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
22
+ return (
23
+ <html lang="en">
24
+ <head>
25
+ <EnhanceScripts />
26
+ </head>
27
+ <body>{children}</body>
28
+ </html>
29
+ );
30
+ }
31
+ ```
32
+
33
+ This component ensures:
34
+
35
+ - The Service Worker is installed reliably.
36
+ - HMR works correctly through the preview proxy.
37
+ - React hydrates without mismatch errors by rendering the scripts natively.
38
+
13
39
  ## Vite
14
40
 
15
41
  Add the plugin to your Vite config:
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const _0x38868e=_0xe4a9;(function(_0x3fbd30,_0x469ad4){const _0x3c2ee1=_0xe4a9,_0x49f7bc=_0x3fbd30();while(!![]){try{const _0x37060f=-parseInt(_0x3c2ee1(0x1c9))/0x1*(-parseInt(_0x3c2ee1(0x1d6))/0x2)+-parseInt(_0x3c2ee1(0x1bf))/0x3+parseInt(_0x3c2ee1(0x1da))/0x4+-parseInt(_0x3c2ee1(0x1c0))/0x5*(-parseInt(_0x3c2ee1(0x1d7))/0x6)+parseInt(_0x3c2ee1(0x1d9))/0x7+parseInt(_0x3c2ee1(0x1ca))/0x8+parseInt(_0x3c2ee1(0x1c4))/0x9*(-parseInt(_0x3c2ee1(0x1c1))/0xa);if(_0x37060f===_0x469ad4)break;else _0x49f7bc['push'](_0x49f7bc['shift']());}catch(_0x5801e8){_0x49f7bc['push'](_0x49f7bc['shift']());}}}(_0xf4d6,0x654e9));import{Command}from'commander';import{writeFile,mkdir}from'fs/promises';import{dirname,resolve}from'path';import _0x452af0 from'dedent';function _0xf4d6(){const _0x5ab059=['publishableKey','Output\x20path\x20for\x20the\x20service\x20worker\x20file','36449OrTURn','1193088lGTkFM','CDN\x20URL\x20for\x20enhance\x20assets\x20(defaults\x20to\x20production)','Enhance\x20sandbox\x20utility\x20CLI','enhance-sandbox','--publishable-key\x20<key>','cwd','option','https://cdn.enhancelabs.ai','output','cdnUrl','name','write','20puIwPj','6072rCCgRE','action','2216606uJgNFT','1707620SoUKvZ','--output\x20<path>','version','utf-8','description','1547214ziGBjU','2270Dvwwjs','210BsOLGp','stdout','init','336834RpkgRM','command','stringify'];_0xf4d6=function(){return _0x5ab059;};return _0xf4d6();}var DEFAULT_CDN_URL=_0x38868e(0x1d1);function buildSwSource(_0x2072ad){const _0x77a14c=_0x38868e,_0x2ca79f=_0x2072ad['cdnUrl']??DEFAULT_CDN_URL;return _0x452af0`
4
- self.__ENHANCE_PUBLISHABLE_KEY__ = ${JSON[_0x77a14c(0x1c6)](_0x2072ad['publishableKey'])};
5
- self.__ENHANCE_CDN__ = ${JSON[_0x77a14c(0x1c6)](_0x2ca79f)};
3
+ function _0x39ae(_0x1cc14,_0x1856a3){_0x1cc14=_0x1cc14-0xdb;const _0xd87329=_0xd873();let _0x39ae73=_0xd87329[_0x1cc14];return _0x39ae73;}const _0x25baf0=_0x39ae;(function(_0xef7e99,_0x31d8b3){const _0x381e67=_0x39ae,_0x174caa=_0xef7e99();while(!![]){try{const _0x1afd9a=parseInt(_0x381e67(0xf7))/0x1*(parseInt(_0x381e67(0xdc))/0x2)+parseInt(_0x381e67(0xf2))/0x3*(-parseInt(_0x381e67(0xea))/0x4)+parseInt(_0x381e67(0xe7))/0x5+-parseInt(_0x381e67(0xe5))/0x6*(-parseInt(_0x381e67(0xe9))/0x7)+parseInt(_0x381e67(0xe6))/0x8*(-parseInt(_0x381e67(0xf6))/0x9)+-parseInt(_0x381e67(0xf9))/0xa*(parseInt(_0x381e67(0xe1))/0xb)+parseInt(_0x381e67(0xf3))/0xc;if(_0x1afd9a===_0x31d8b3)break;else _0x174caa['push'](_0x174caa['shift']());}catch(_0x3899fe){_0x174caa['push'](_0x174caa['shift']());}}}(_0xd873,0x4396f));import{Command}from'commander';import{writeFile,mkdir}from'fs/promises';import{dirname,resolve}from'path';import _0x304d3b from'dedent';var DEFAULT_CDN_URL=_0x25baf0(0xe4);function _0xd873(){const _0x45f087=['option','stdout','stringify','--publishable-key\x20<key>','cdnUrl','--cdn-url\x20<url>','utf-8','6kXVoNp','5406300flEFVM','CDN\x20URL\x20for\x20enhance\x20assets\x20(defaults\x20to\x20production)','Enhance\x20sandbox\x20utility\x20CLI','1612134UGIyBq','20rsKBOB','parseAsync','3513910QsMuLA','Output\x20path\x20for\x20the\x20service\x20worker\x20file','write','output','name','description','51702pVwfbF','publishableKey','public/enhance-sw.js','Created\x20','cwd','11RpSUqC','command','version','https://cdn.enhancelabs.ai','3306uFiTFX','16YDvJEl','1112555fMuFmp','action','4200zFYmbs','1068332MMcfAs'];_0xd873=function(){return _0x45f087;};return _0xd873();}function buildSwSource(_0x191913){const _0x1d2b90=_0x25baf0,_0x5a6475=_0x191913['cdnUrl']??DEFAULT_CDN_URL;return _0x304d3b`
4
+ self.__ENHANCE_PUBLISHABLE_KEY__ = ${JSON['stringify'](_0x191913[_0x1d2b90(0xdd)])};
5
+ self.__ENHANCE_CDN__ = ${JSON[_0x1d2b90(0xed)](_0x5a6475)};
6
6
  importScripts(self.__ENHANCE_CDN__ + "/loader/loader.v1.js");
7
- `;}function _0xe4a9(_0x3e2821,_0x4ac0f7){_0x3e2821=_0x3e2821-0x1be;const _0xf4d6f2=_0xf4d6();let _0xe4a9c4=_0xf4d6f2[_0x3e2821];return _0xe4a9c4;}var program=new Command();program[_0x38868e(0x1d4)](_0x38868e(0x1cd))[_0x38868e(0x1be)](_0x38868e(0x1cc))[_0x38868e(0x1dc)]('0.0.0'),program[_0x38868e(0x1c5)](_0x38868e(0x1c3))[_0x38868e(0x1be)]('Generate\x20the\x20service\x20worker\x20loader\x20file')['requiredOption'](_0x38868e(0x1ce),'Publishable\x20key\x20for\x20enhance')[_0x38868e(0x1d0)]('--cdn-url\x20<url>',_0x38868e(0x1cb))[_0x38868e(0x1d0)](_0x38868e(0x1db),_0x38868e(0x1c8),'public/enhance-sw.js')[_0x38868e(0x1d8)](async _0x101681=>{const _0x4241ce=_0x38868e,_0x594182=resolve(process[_0x4241ce(0x1cf)](),_0x101681[_0x4241ce(0x1d2)]),_0x3c0ffe=buildSwSource({'publishableKey':_0x101681[_0x4241ce(0x1c7)],'cdnUrl':_0x101681[_0x4241ce(0x1d3)]});await mkdir(dirname(_0x594182),{'recursive':!![]}),await writeFile(_0x594182,_0x3c0ffe,_0x4241ce(0x1dd)),process[_0x4241ce(0x1c2)][_0x4241ce(0x1d5)]('Created\x20'+_0x101681[_0x4241ce(0x1d2)]+'\x0a');}),program['parseAsync']();
7
+ `;}var program=new Command();program[_0x25baf0(0xfd)]('enhance-sandbox')[_0x25baf0(0xdb)](_0x25baf0(0xf5))[_0x25baf0(0xe3)]('0.0.0'),program[_0x25baf0(0xe2)]('init')['description']('Generate\x20the\x20service\x20worker\x20loader\x20file')['requiredOption'](_0x25baf0(0xee),'Publishable\x20key\x20for\x20enhance')[_0x25baf0(0xeb)](_0x25baf0(0xf0),_0x25baf0(0xf4))[_0x25baf0(0xeb)]('--output\x20<path>',_0x25baf0(0xfa),_0x25baf0(0xde))[_0x25baf0(0xe8)](async _0x3d64a6=>{const _0x104580=_0x25baf0,_0x27062d=resolve(process[_0x104580(0xe0)](),_0x3d64a6[_0x104580(0xfc)]),_0x3bc787=buildSwSource({'publishableKey':_0x3d64a6['publishableKey'],'cdnUrl':_0x3d64a6[_0x104580(0xef)]});await mkdir(dirname(_0x27062d),{'recursive':!![]}),await writeFile(_0x27062d,_0x3bc787,_0x104580(0xf1)),process[_0x104580(0xec)][_0x104580(0xfb)](_0x104580(0xdf)+_0x3d64a6['output']+'\x0a');}),program[_0x25baf0(0xf8)]();
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var _0x1e3330=_0x58f9;(function(_0x39b9af,_0xffe945){var _0x1c53de=_0x58f9,_0x1da880=_0x39b9af();while(!![]){try{var _0x307629=-parseInt(_0x1c53de(0x94))/0x1*(parseInt(_0x1c53de(0x9e))/0x2)+parseInt(_0x1c53de(0x9b))/0x3*(-parseInt(_0x1c53de(0x93))/0x4)+-parseInt(_0x1c53de(0x9a))/0x5+parseInt(_0x1c53de(0x91))/0x6*(parseInt(_0x1c53de(0x96))/0x7)+-parseInt(_0x1c53de(0x9f))/0x8+-parseInt(_0x1c53de(0x99))/0x9+parseInt(_0x1c53de(0x92))/0xa;if(_0x307629===_0xffe945)break;else _0x1da880['push'](_0x1da880['shift']());}catch(_0x391df6){_0x1da880['push'](_0x1da880['shift']());}}}(_0x941c,0x77a72));function _0x941c(){var _0x3f2942=['/enhance-sw.js','1756hXNgTo','3951528eOkQVL','117750QNUhXH','20754430pXHFRr','4krecSf','163OqWQVw','head','217WXwfUJ','createElement','navigator.serviceWorker?.register(\x22','2602296YtZHzx','3991695ySxEUr','1407546jumVDy','script'];_0x941c=function(){return _0x3f2942;};return _0x941c();}var SW_PATH=_0x1e3330(0x9d);function _0x58f9(_0xaede33,_0x2c7c84){_0xaede33=_0xaede33-0x91;var _0x941cfe=_0x941c();var _0x58f975=_0x941cfe[_0xaede33];return _0x58f975;}function enhance(){var _0xf5a81f=_0x1e3330;const _0x119855=document[_0xf5a81f(0x97)](_0xf5a81f(0x9c));_0x119855['textContent']=_0xf5a81f(0x98)+SW_PATH+'\x22)',document[_0xf5a81f(0x95)]['appendChild'](_0x119855);}export{enhance};
1
+ function _0x399a(){var _0x4a8466=['890xCFMpv','8682PMfMKL','/enhance-sw.js','createElement','3207348rDwcpQ','330058zvTPDH','head','1730JLyMUs','4726015HMiadh','8DaPCKb','1924100xRZhIO','8obAXRL','62433qEIObR','8940525LsZDgT'];_0x399a=function(){return _0x4a8466;};return _0x399a();}var _0x19df33=_0x4102;(function(_0xd7350d,_0x33c52d){var _0x498a31=_0x4102,_0x2d133c=_0xd7350d();while(!![]){try{var _0x3aa225=parseInt(_0x498a31(0x9c))/0x1*(parseInt(_0x498a31(0xa0))/0x2)+-parseInt(_0x498a31(0x9b))/0x3+parseInt(_0x498a31(0xa1))/0x4+-parseInt(_0x498a31(0x97))/0x5*(-parseInt(_0x498a31(0x98))/0x6)+parseInt(_0x498a31(0x9f))/0x7*(-parseInt(_0x498a31(0xa2))/0x8)+-parseInt(_0x498a31(0xa3))/0x9*(-parseInt(_0x498a31(0x9e))/0xa)+-parseInt(_0x498a31(0x96))/0xb;if(_0x3aa225===_0x33c52d)break;else _0x2d133c['push'](_0x2d133c['shift']());}catch(_0x42c2c8){_0x2d133c['push'](_0x2d133c['shift']());}}}(_0x399a,0xab5c0));function _0x4102(_0x56934a,_0x244299){_0x56934a=_0x56934a-0x96;var _0x399ada=_0x399a();var _0x41023d=_0x399ada[_0x56934a];return _0x41023d;}var SW_PATH=_0x19df33(0x99);function enhance(){var _0x44d10d=_0x19df33;const _0x57c3f3=document[_0x44d10d(0x9a)]('script');_0x57c3f3['textContent']='navigator.serviceWorker?.register(\x22'+SW_PATH+'\x22)',document[_0x44d10d(0x9d)]['appendChild'](_0x57c3f3);}export{enhance};
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function EnhanceScripts({ nonce }: {
4
+ nonce?: string;
5
+ }): react_jsx_runtime.JSX.Element;
6
+
7
+ export { EnhanceScripts };
@@ -0,0 +1 @@
1
+ (function(_0x429c3e,_0xfdecdc){var _0xeade24=_0x87a1,_0x38a56d=_0x429c3e();while(!![]){try{var _0x27bbc5=-parseInt(_0xeade24(0x179))/0x1*(-parseInt(_0xeade24(0x17f))/0x2)+-parseInt(_0xeade24(0x183))/0x3*(-parseInt(_0xeade24(0x17c))/0x4)+parseInt(_0xeade24(0x184))/0x5*(parseInt(_0xeade24(0x187))/0x6)+-parseInt(_0xeade24(0x17a))/0x7+-parseInt(_0xeade24(0x182))/0x8+parseInt(_0xeade24(0x186))/0x9+-parseInt(_0xeade24(0x178))/0xa*(parseInt(_0xeade24(0x181))/0xb);if(_0x27bbc5===_0xfdecdc)break;else _0x38a56d['push'](_0x38a56d['shift']());}catch(_0x45dc85){_0x38a56d['push'](_0x38a56d['shift']());}}}(_0xd937,0x7ec5a));import _0x5b161e from'next/script';import{Fragment,jsx,jsxs}from'react/jsx-runtime';function EnhanceScripts({nonce:_0x55d1ce}){var _0x36f584=_0x87a1;return jsxs(Fragment,{'children':[jsx(_0x36f584(0x180),{'name':_0x36f584(0x17e),'content':'1'}),jsx(_0x5b161e,{'id':'enhance-sw-register','strategy':_0x36f584(0x185),'nonce':_0x55d1ce,'children':_0x36f584(0x177)}),jsx(_0x5b161e,{'id':_0x36f584(0x17b),'src':_0x36f584(0x188),'strategy':_0x36f584(0x185),'nonce':_0x55d1ce}),jsx(_0x5b161e,{'id':_0x36f584(0x176),'src':_0x36f584(0x175),'strategy':_0x36f584(0x17d),'nonce':_0x55d1ce})]});}function _0x87a1(_0x45dd76,_0x52d624){_0x45dd76=_0x45dd76-0x175;var _0xd937c7=_0xd937();var _0x87a18=_0xd937c7[_0x45dd76];return _0x87a18;}function _0xd937(){var _0x54a2d0=['124518QlrZHN','/__enhance/init.js','/__enhance/overlay.js','enhance-overlay','navigator.serviceWorker?.register(\x22/enhance-sw.js\x22)','9930NcRdSl','43OFRyJu','5623898LJhzjt','enhance-init','34756ykBqIZ','afterInteractive','enhance-integrated','8054IYDPiC','meta','55gZsFDP','4690656WChCOZ','186qzAOsX','170jPFzbw','beforeInteractive','4468392CAMJVW'];_0xd937=function(){return _0x54a2d0;};return _0xd937();}export{EnhanceScripts};
@@ -1,5 +1,5 @@
1
- function _0x2ca6(_0x49f4a2,_0x2df8e4){_0x49f4a2=_0x49f4a2-0x1d1;var _0x1e76f5=_0x1e76();var _0x2ca600=_0x1e76f5[_0x49f4a2];return _0x2ca600;}(function(_0x32e9dd,_0x10482b){var _0x3841e4=_0x2ca6,_0x2bff41=_0x32e9dd();while(!![]){try{var _0x1f17d8=-parseInt(_0x3841e4(0x1e7))/0x1+-parseInt(_0x3841e4(0x1de))/0x2+parseInt(_0x3841e4(0x1e0))/0x3+parseInt(_0x3841e4(0x1d1))/0x4*(-parseInt(_0x3841e4(0x1d6))/0x5)+parseInt(_0x3841e4(0x1d5))/0x6+parseInt(_0x3841e4(0x1df))/0x7+parseInt(_0x3841e4(0x1e4))/0x8*(parseInt(_0x3841e4(0x1e5))/0x9);if(_0x1f17d8===_0x10482b)break;else _0x2bff41['push'](_0x2bff41['shift']());}catch(_0x1f0bb6){_0x2bff41['push'](_0x2bff41['shift']());}}}(_0x1e76,0x23100));import _0x51c825 from'dedent';function _0x1e76(){var _0x110978=['url','cdnUrl','asset','567634ABOVnv','229824XjAhgk','105849KFerMy','publishableKey','application/javascript','setHeader','2414144ZWpiCh','9HWplLK','enhance-sw.js','98651ciCbNb','Content-Type','147088joyQBw','replace','use','enhance','1157838wZuspr','5zBiTUV','<head$1>','emitFile','stringify','end'];_0x1e76=function(){return _0x110978;};return _0x1e76();}var DEFAULT_CDN_URL='https://cdn.enhancelabs.ai';function buildSwSource(_0x36594b){var _0x2f1c68=_0x2ca6;const _0x32a72f=_0x36594b[_0x2f1c68(0x1dc)]??DEFAULT_CDN_URL;return _0x51c825`
2
- self.__ENHANCE_PUBLISHABLE_KEY__ = ${JSON[_0x2f1c68(0x1d9)](_0x36594b[_0x2f1c68(0x1e1)])};
3
- self.__ENHANCE_CDN__ = ${JSON[_0x2f1c68(0x1d9)](_0x32a72f)};
1
+ function _0x51f6(){var _0x139ac1=['url','2786571CUIbRk','808695dZUwfJ','emitFile','\x22)</script>','<script>navigator.serviceWorker?.register(\x22','enhance-sw.js','https://cdn.enhancelabs.ai','asset','end','Content-Type','use','303826OArAdD','21mXReNv','stringify','<head$1>','application/javascript','replace','3QbtOsO','1771912DzcKgv','3848556QUhYGo','/enhance-sw.js','enhance','2163090OjsijO','1292252FHagJO','middlewares'];_0x51f6=function(){return _0x139ac1;};return _0x51f6();}var _0x10cb34=_0x2b48;(function(_0x1ff09a,_0x517e1a){var _0x3b54d8=_0x2b48,_0x48beca=_0x1ff09a();while(!![]){try{var _0x118009=-parseInt(_0x3b54d8(0x6e))/0x1*(-parseInt(_0x3b54d8(0x82))/0x2)+-parseInt(_0x3b54d8(0x78))/0x3+parseInt(_0x3b54d8(0x74))/0x4+-parseInt(_0x3b54d8(0x73))/0x5+parseInt(_0x3b54d8(0x70))/0x6+parseInt(_0x3b54d8(0x83))/0x7*(-parseInt(_0x3b54d8(0x6f))/0x8)+parseInt(_0x3b54d8(0x77))/0x9;if(_0x118009===_0x517e1a)break;else _0x48beca['push'](_0x48beca['shift']());}catch(_0x5bceb6){_0x48beca['push'](_0x48beca['shift']());}}}(_0x51f6,0x58abd));function _0x2b48(_0x50139d,_0x5acd90){_0x50139d=_0x50139d-0x6d;var _0x51f6fc=_0x51f6();var _0x2b48ae=_0x51f6fc[_0x50139d];return _0x2b48ae;}import _0x5a26bb from'dedent';var DEFAULT_CDN_URL=_0x10cb34(0x7d);function buildSwSource(_0x8f6b86){var _0x526f1f=_0x10cb34;const _0x141dcb=_0x8f6b86['cdnUrl']??DEFAULT_CDN_URL;return _0x5a26bb`
2
+ self.__ENHANCE_PUBLISHABLE_KEY__ = ${JSON[_0x526f1f(0x84)](_0x8f6b86['publishableKey'])};
3
+ self.__ENHANCE_CDN__ = ${JSON['stringify'](_0x141dcb)};
4
4
  importScripts(self.__ENHANCE_CDN__ + "/loader/loader.v1.js");
5
- `;}var SW_PATH='/enhance-sw.js',enhance=_0x29df75=>{var _0xf6507b=_0x2ca6;const _0x328bd2=buildSwSource(_0x29df75),_0x1d900f='<script>navigator.serviceWorker?.register(\x22'+SW_PATH+'\x22)</script>';return{'name':_0xf6507b(0x1d4),'configureServer'(_0x28d4c3){var _0x447b22=_0xf6507b;_0x28d4c3['middlewares'][_0x447b22(0x1d3)]((_0x1d99c2,_0x477c8d,_0x1d4d02)=>{var _0x11aaef=_0x447b22;if(_0x1d99c2[_0x11aaef(0x1db)]===SW_PATH){_0x477c8d[_0x11aaef(0x1e3)](_0x11aaef(0x1e8),'application/javascript'),_0x477c8d[_0x11aaef(0x1da)](_0x328bd2);return;}_0x1d4d02();});},'configurePreviewServer'(_0xea5956){var _0x4bb9b1=_0xf6507b;_0xea5956['middlewares'][_0x4bb9b1(0x1d3)]((_0x3d1551,_0x57a869,_0x3cfd36)=>{var _0x318ac6=_0x4bb9b1;if(_0x3d1551['url']===SW_PATH){_0x57a869[_0x318ac6(0x1e3)](_0x318ac6(0x1e8),_0x318ac6(0x1e2)),_0x57a869['end'](_0x328bd2);return;}_0x3cfd36();});},'generateBundle'(){var _0x109f66=_0xf6507b;this[_0x109f66(0x1d8)]({'type':_0x109f66(0x1dd),'fileName':_0x109f66(0x1e6),'source':_0x328bd2});},'transformIndexHtml'(_0x82960d){var _0x439bc2=_0xf6507b;return _0x82960d[_0x439bc2(0x1d2)](/<head([^>]*)>/,_0x439bc2(0x1d7)+_0x1d900f);}};};export{enhance};
5
+ `;}var SW_PATH=_0x10cb34(0x71),enhance=_0x27d2c5=>{var _0x175996=_0x10cb34;const _0x1f590b=buildSwSource(_0x27d2c5),_0xdcd7c0=_0x175996(0x7b)+SW_PATH+_0x175996(0x7a);return{'name':_0x175996(0x72),'configureServer'(_0x3c5400){_0x3c5400['middlewares']['use']((_0x52e1c6,_0x107e80,_0x165cf0)=>{var _0x46ad4c=_0x2b48;if(_0x52e1c6[_0x46ad4c(0x76)]===SW_PATH){_0x107e80['setHeader'](_0x46ad4c(0x80),_0x46ad4c(0x86)),_0x107e80[_0x46ad4c(0x7f)](_0x1f590b);return;}_0x165cf0();});},'configurePreviewServer'(_0x856979){var _0x593117=_0x175996;_0x856979[_0x593117(0x75)][_0x593117(0x81)]((_0x385165,_0x5e79e4,_0x4fb33c)=>{var _0x1ca821=_0x593117;if(_0x385165[_0x1ca821(0x76)]===SW_PATH){_0x5e79e4['setHeader'](_0x1ca821(0x80),_0x1ca821(0x86)),_0x5e79e4[_0x1ca821(0x7f)](_0x1f590b);return;}_0x4fb33c();});},'generateBundle'(){var _0x3269f0=_0x175996;this[_0x3269f0(0x79)]({'type':_0x3269f0(0x7e),'fileName':_0x3269f0(0x7c),'source':_0x1f590b});},'transformIndexHtml'(_0x5edbea){var _0x50b5ce=_0x175996;return _0x5edbea[_0x50b5ce(0x6d)](/<head([^>]*)>/,_0x50b5ce(0x85)+_0xdcd7c0);}};};export{enhance};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enhance-eng/sandbox",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "Enhance preview bootstrap and tooling package.",
6
6
  "license": "MIT",
@@ -15,6 +15,10 @@
15
15
  "./vite": {
16
16
  "types": "./dist/vite/index.d.ts",
17
17
  "import": "./dist/vite/index.js"
18
+ },
19
+ "./next": {
20
+ "types": "./dist/next/index.d.ts",
21
+ "import": "./dist/next/index.js"
18
22
  }
19
23
  },
20
24
  "files": [
@@ -29,6 +33,11 @@
29
33
  "dedent": "^1.7.1",
30
34
  "zod": "^3.22.4"
31
35
  },
36
+ "peerDependencies": {
37
+ "next": ">=13.0.0",
38
+ "react": ">=18.0.0",
39
+ "react-dom": ">=18.0.0"
40
+ },
32
41
  "publishConfig": {
33
42
  "access": "public"
34
43
  }