diff --git a/.gitignore b/.gitignore index fd3dbb5..2199f4f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ # dependencies /node_modules +package-lock.json /.pnp .pnp.js .yarn/install-state.gz @@ -34,3 +35,13 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +# SW proxies - general +public/aeroHandleSimple.js +public/sw.js + +# aero +public/aero/ +**/aeroConfigBuild/ + +# TODO: Add UV public build files here (not the UV config file) \ No newline at end of file diff --git a/deps.sh b/deps.sh new file mode 100644 index 0000000..7370da5 --- /dev/null +++ b/deps.sh @@ -0,0 +1,7 @@ +# Your bash variables here +$AERO_PATH="public/aero" # The directory where aero's files should be + +./node_modules/aero-proxy/examples/install-aero.sh + +curl https://raw.githubusercontent.com/vortexdeveloperlabs/sdk/refs/heads/main/aeroHandleSimple.js -o public/aeroHandleSimple.js +cp ./node_modules/aero-proxy/examples/swWithSwitcher.js public/sw.js diff --git a/src/app/uv/[uv]/route.ts b/src/app/uv/[uv]/route.ts index c00a32f..5c95891 100644 --- a/src/app/uv/[uv]/route.ts +++ b/src/app/uv/[uv]/route.ts @@ -4,7 +4,7 @@ import { NextRequest } from 'next/server' export async function GET(_req: NextRequest, { params }: { params: { uv: string } }) { const requestedFile = params.uv - if (requestedFile === 'uv.config.js' || requestedFile === 'sw.js') { + if (requestedFile === 'uv.config.js') { const file = fs.readFileSync(process.cwd() + `/src/lib/uv/${requestedFile}`) const fileBlob = new Blob([file]) return new Response(fileBlob, { diff --git a/src/lib/uv/sw.js b/src/lib/uv/sw.js deleted file mode 100644 index 0862771..0000000 --- a/src/lib/uv/sw.js +++ /dev/null @@ -1,14 +0,0 @@ -/*global UVServiceWorker,__uv$config*/ -/* - * Stock service worker script. - * Users can provide their own sw.js if they need to extend the functionality of the service worker. - * Ideally, this will be registered under the scope in uv.config.js so it will not need to be modified. - * However, if a user changes the location of uv.bundle.js/uv.config.js or sw.js is not relative to them, they will need to modify this script locally. - */ -importScripts('/uv/uv.bundle.js'); -importScripts('/uv/uv.config.js'); -importScripts(__uv$config.sw || '/uv/uv.sw.js'); - -const sw = new UVServiceWorker(); - -self.addEventListener('fetch', (event) => event.respondWith(sw.fetch(event)));