@tamagui/cli 1.14.0 → 1.14.2
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/dist/cjs/build.js +83 -1
- package/dist/cjs/build.js.map +2 -2
- package/dist/cjs/cli.js +155 -8
- package/dist/cjs/cli.js.map +2 -2
- package/dist/cjs/dev/createDevServer.js +164 -1
- package/dist/cjs/dev/createDevServer.js.map +2 -2
- package/dist/cjs/dev.js +185 -1
- package/dist/cjs/dev.js.map +2 -2
- package/dist/cjs/generate.js +82 -1
- package/dist/cjs/generate.js.map +2 -2
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/studio.js +94 -1
- package/dist/cjs/studio.js.map +2 -2
- package/dist/cjs/tamaguiConfigUtils.js +85 -1
- package/dist/cjs/tamaguiConfigUtils.js.map +2 -2
- package/dist/cjs/test.js +42 -1
- package/dist/cjs/test.js.map +2 -2
- package/dist/cjs/types.js +16 -1
- package/dist/cjs/types.js.map +2 -2
- package/dist/cjs/update.js +29 -1
- package/dist/cjs/update.js.map +2 -2
- package/dist/cjs/utils/constants.js +28 -1
- package/dist/cjs/utils/constants.js.map +2 -2
- package/dist/cjs/utils.js +115 -1
- package/dist/cjs/utils.js.map +2 -2
- package/dist/cjs/vendor/debugger-app/index.js +28 -1
- package/dist/cjs/vendor/debugger-app/index.js.map +2 -2
- package/dist/cjs/vendor/debugger-app/src/debuggerWorker.js +63 -1
- package/dist/cjs/vendor/debugger-app/src/debuggerWorker.js.map +2 -2
- package/dist/cjs/vendor/debugger-app/src/index.css +40 -1
- package/dist/cjs/vendor/debugger-app/src/index.css.map +1 -1
- package/dist/cjs/vendor/debugger-app/src/index.js +164 -1
- package/dist/cjs/vendor/debugger-app/src/index.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/createServer.js +128 -1
- package/dist/cjs/vendor/repack/dev-server/src/createServer.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/index.js +19 -1
- package/dist/cjs/vendor/repack/dev-server/src/index.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/api/apiPlugin.js +58 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/api/apiPlugin.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/api/index.js +36 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/api/index.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/compiler/compilerPlugin.js +98 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/compiler/compilerPlugin.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/compiler/index.js +38 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/compiler/index.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/compiler/types.js +16 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/compiler/types.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/devtools/devtoolsPlugin.js +118 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/devtools/devtoolsPlugin.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/devtools/index.js +36 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/devtools/index.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/favicon/faviconPlugin.js +45 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/favicon/faviconPlugin.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/favicon/index.js +36 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/favicon/index.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/multipart/index.js +38 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/multipart/index.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/multipart/multipartPlugin.js +81 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/multipart/multipartPlugin.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/multipart/types.js +16 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/multipart/types.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/symbolicate/Symbolicator.js +209 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/symbolicate/Symbolicator.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/symbolicate/index.js +39 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/symbolicate/index.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/symbolicate/sybmolicatePlugin.js +66 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/symbolicate/sybmolicatePlugin.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/symbolicate/types.js +16 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/symbolicate/types.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/WebSocketRouter.js +73 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/WebSocketRouter.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/WebSocketServer.js +55 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/WebSocketServer.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/index.js +39 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/index.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/HermesInspectorProxy.js +143 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/HermesInspectorProxy.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketApiServer.js +75 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketApiServer.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketDebuggerServer.js +129 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketDebuggerServer.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketDevClientServer.js +85 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketDevClientServer.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketEventsServer.js +187 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketEventsServer.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketHMRServer.js +99 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketHMRServer.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketMessageServer.js +353 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketMessageServer.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/types.js +16 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/types.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/wssPlugin.js +78 -1
- package/dist/cjs/vendor/repack/dev-server/src/plugins/wss/wssPlugin.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/types.js +36 -1
- package/dist/cjs/vendor/repack/dev-server/src/types.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/vendor/metro-inspector-proxy/src/Device.js +36 -1
- package/dist/cjs/vendor/repack/dev-server/vendor/metro-inspector-proxy/src/Device.js.map +2 -2
- package/dist/esm/build.js +48 -1
- package/dist/esm/build.js.map +2 -2
- package/dist/esm/build.mjs +48 -1
- package/dist/esm/build.mjs.map +2 -2
- package/dist/esm/cli.js +132 -8
- package/dist/esm/cli.js.map +2 -2
- package/dist/esm/cli.mjs +132 -8
- package/dist/esm/cli.mjs.map +2 -2
- package/dist/esm/dev/createDevServer.js +140 -1
- package/dist/esm/dev/createDevServer.js.map +2 -2
- package/dist/esm/dev/createDevServer.mjs +140 -1
- package/dist/esm/dev/createDevServer.mjs.map +2 -2
- package/dist/esm/dev.js +151 -1
- package/dist/esm/dev.js.map +2 -2
- package/dist/esm/dev.mjs +151 -1
- package/dist/esm/dev.mjs.map +2 -2
- package/dist/esm/generate.js +47 -1
- package/dist/esm/generate.js.map +2 -2
- package/dist/esm/generate.mjs +47 -1
- package/dist/esm/generate.mjs.map +2 -2
- package/dist/esm/index.js +7 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +7 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/studio.js +59 -1
- package/dist/esm/studio.js.map +2 -2
- package/dist/esm/studio.mjs +59 -1
- package/dist/esm/studio.mjs.map +2 -2
- package/dist/esm/tamaguiConfigUtils.js +50 -1
- package/dist/esm/tamaguiConfigUtils.js.map +2 -2
- package/dist/esm/tamaguiConfigUtils.mjs +50 -1
- package/dist/esm/tamaguiConfigUtils.mjs.map +2 -2
- package/dist/esm/test.js +8 -1
- package/dist/esm/test.js.map +2 -2
- package/dist/esm/test.mjs +8 -1
- package/dist/esm/test.mjs.map +2 -2
- package/dist/esm/update.js +5 -1
- package/dist/esm/update.js.map +2 -2
- package/dist/esm/update.mjs +5 -1
- package/dist/esm/update.mjs.map +2 -2
- package/dist/esm/utils/constants.js +4 -1
- package/dist/esm/utils/constants.js.map +2 -2
- package/dist/esm/utils/constants.mjs +4 -1
- package/dist/esm/utils/constants.mjs.map +2 -2
- package/dist/esm/utils.js +77 -1
- package/dist/esm/utils.js.map +2 -2
- package/dist/esm/utils.mjs +77 -1
- package/dist/esm/utils.mjs.map +2 -2
- package/dist/esm/vendor/debugger-app/index.js +5 -1
- package/dist/esm/vendor/debugger-app/index.js.map +2 -2
- package/dist/esm/vendor/debugger-app/index.mjs +5 -1
- package/dist/esm/vendor/debugger-app/index.mjs.map +2 -2
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.js +62 -1
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.js.map +2 -2
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.mjs +62 -1
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.mjs.map +2 -2
- package/dist/esm/vendor/debugger-app/src/index.css +40 -1
- package/dist/esm/vendor/debugger-app/src/index.css.map +1 -1
- package/dist/esm/vendor/debugger-app/src/index.js +141 -1
- package/dist/esm/vendor/debugger-app/src/index.js.map +2 -2
- package/dist/esm/vendor/debugger-app/src/index.mjs +141 -1
- package/dist/esm/vendor/debugger-app/src/index.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/createServer.js +94 -1
- package/dist/esm/vendor/repack/dev-server/src/createServer.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/createServer.mjs +94 -1
- package/dist/esm/vendor/repack/dev-server/src/createServer.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/index.js +2 -1
- package/dist/esm/vendor/repack/dev-server/src/index.js.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/index.mjs +2 -1
- package/dist/esm/vendor/repack/dev-server/src/index.mjs.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/api/apiPlugin.js +36 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/api/apiPlugin.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/api/apiPlugin.mjs +36 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/api/apiPlugin.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/api/index.js +4 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/api/index.js.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/api/index.mjs +4 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/api/index.mjs.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/compiler/compilerPlugin.js +66 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/compiler/compilerPlugin.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/compiler/compilerPlugin.mjs +66 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/compiler/compilerPlugin.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/compiler/index.js +5 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/compiler/index.js.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/compiler/index.mjs +5 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/compiler/index.mjs.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/devtools/devtoolsPlugin.js +86 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/devtools/devtoolsPlugin.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/devtools/devtoolsPlugin.mjs +86 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/devtools/devtoolsPlugin.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/devtools/index.js +4 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/devtools/index.js.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/devtools/index.mjs +4 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/devtools/index.mjs.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/favicon/faviconPlugin.js +12 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/favicon/faviconPlugin.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/favicon/faviconPlugin.mjs +12 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/favicon/faviconPlugin.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/favicon/index.js +4 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/favicon/index.js.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/favicon/index.mjs +4 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/favicon/index.mjs.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/multipart/index.js +5 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/multipart/index.js.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/multipart/index.mjs +5 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/multipart/index.mjs.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/multipart/multipartPlugin.js +49 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/multipart/multipartPlugin.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/multipart/multipartPlugin.mjs +49 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/multipart/multipartPlugin.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/symbolicate/Symbolicator.js +185 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/symbolicate/Symbolicator.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/symbolicate/Symbolicator.mjs +185 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/symbolicate/Symbolicator.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/symbolicate/index.js +6 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/symbolicate/index.js.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/symbolicate/index.mjs +6 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/symbolicate/index.mjs.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/symbolicate/sybmolicatePlugin.js +34 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/symbolicate/sybmolicatePlugin.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/symbolicate/sybmolicatePlugin.mjs +34 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/symbolicate/sybmolicatePlugin.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/WebSocketRouter.js +49 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/WebSocketRouter.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/WebSocketRouter.mjs +49 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/WebSocketRouter.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/WebSocketServer.js +31 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/WebSocketServer.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/WebSocketServer.mjs +31 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/WebSocketServer.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/index.js +6 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/index.js.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/index.mjs +6 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/index.mjs.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/HermesInspectorProxy.js +109 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/HermesInspectorProxy.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/HermesInspectorProxy.mjs +109 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/HermesInspectorProxy.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketApiServer.js +51 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketApiServer.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketApiServer.mjs +51 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketApiServer.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketDebuggerServer.js +105 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketDebuggerServer.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketDebuggerServer.mjs +105 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketDebuggerServer.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketDevClientServer.js +61 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketDevClientServer.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketDevClientServer.mjs +61 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketDevClientServer.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketEventsServer.js +153 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketEventsServer.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketEventsServer.mjs +153 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketEventsServer.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketHMRServer.js +75 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketHMRServer.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketHMRServer.mjs +75 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketHMRServer.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketMessageServer.js +329 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketMessageServer.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketMessageServer.mjs +329 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/servers/WebSocketMessageServer.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/wssPlugin.js +46 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/wssPlugin.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/wssPlugin.mjs +46 -1
- package/dist/esm/vendor/repack/dev-server/src/plugins/wss/wssPlugin.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/types.js +12 -1
- package/dist/esm/vendor/repack/dev-server/src/types.js.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/types.mjs +12 -1
- package/dist/esm/vendor/repack/dev-server/src/types.mjs.map +1 -1
- package/dist/esm/vendor/repack/dev-server/vendor/metro-inspector-proxy/src/Device.js +4 -1
- package/dist/esm/vendor/repack/dev-server/vendor/metro-inspector-proxy/src/Device.js.map +1 -1
- package/dist/esm/vendor/repack/dev-server/vendor/metro-inspector-proxy/src/Device.mjs +4 -1
- package/dist/esm/vendor/repack/dev-server/vendor/metro-inspector-proxy/src/Device.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -1,2 +1,95 @@
|
|
|
1
|
-
import{Writable
|
|
1
|
+
import { Writable } from "stream";
|
|
2
|
+
import fastifySensible from "@fastify/sensible";
|
|
3
|
+
import Fastify from "fastify";
|
|
4
|
+
import apiPlugin from "./plugins/api";
|
|
5
|
+
import compilerPlugin from "./plugins/compiler";
|
|
6
|
+
import devtoolsPlugin from "./plugins/devtools";
|
|
7
|
+
import multipartPlugin from "./plugins/multipart";
|
|
8
|
+
import symbolicatePlugin from "./plugins/symbolicate";
|
|
9
|
+
import wssPlugin from "./plugins/wss";
|
|
10
|
+
import { Internal } from "./types";
|
|
11
|
+
async function createServer(config) {
|
|
12
|
+
let delegate;
|
|
13
|
+
const instance = Fastify({
|
|
14
|
+
logger: {
|
|
15
|
+
level: "trace",
|
|
16
|
+
stream: new Writable({
|
|
17
|
+
write: (chunk, _encoding, callback) => {
|
|
18
|
+
var _a;
|
|
19
|
+
const log = JSON.parse(chunk.toString());
|
|
20
|
+
delegate == null ? void 0 : delegate.logger.onMessage(log);
|
|
21
|
+
(_a = instance.wss) == null ? void 0 : _a.apiServer.send(log);
|
|
22
|
+
callback();
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
...config.options.https ? { https: config.options.https } : void 0
|
|
27
|
+
});
|
|
28
|
+
delegate = config.delegate({
|
|
29
|
+
log: instance.log,
|
|
30
|
+
notifyBuildStart: (platform) => {
|
|
31
|
+
instance.wss.apiServer.send({
|
|
32
|
+
event: Internal.EventTypes.BuildStart,
|
|
33
|
+
platform
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
notifyBuildEnd: (platform) => {
|
|
37
|
+
instance.wss.apiServer.send({
|
|
38
|
+
event: Internal.EventTypes.BuildEnd,
|
|
39
|
+
platform
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
broadcastToHmrClients: (event, platform, clientIds) => {
|
|
43
|
+
instance.wss.hmrServer.send(event, platform, clientIds);
|
|
44
|
+
},
|
|
45
|
+
broadcastToMessageClients: ({ method, params }) => {
|
|
46
|
+
instance.wss.messageServer.broadcast(method, params);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
await instance.register(fastifySensible);
|
|
50
|
+
await instance.register(wssPlugin, {
|
|
51
|
+
options: config.options,
|
|
52
|
+
delegate
|
|
53
|
+
});
|
|
54
|
+
await instance.register(multipartPlugin);
|
|
55
|
+
await instance.register(apiPlugin, {
|
|
56
|
+
delegate,
|
|
57
|
+
prefix: "/api"
|
|
58
|
+
});
|
|
59
|
+
await instance.register(compilerPlugin, {
|
|
60
|
+
delegate
|
|
61
|
+
});
|
|
62
|
+
await instance.register(symbolicatePlugin, {
|
|
63
|
+
delegate
|
|
64
|
+
});
|
|
65
|
+
await instance.register(devtoolsPlugin, {
|
|
66
|
+
options: config.options
|
|
67
|
+
});
|
|
68
|
+
console.warn("disable debugger-ui + favicon for now");
|
|
69
|
+
instance.addHook("onSend", async (request, reply, payload) => {
|
|
70
|
+
reply.header("X-Content-Type-Options", "nosniff");
|
|
71
|
+
const [pathname] = request.url.split("?");
|
|
72
|
+
if (pathname.endsWith(".map")) {
|
|
73
|
+
reply.header("Access-Control-Allow-Origin", "devtools://devtools");
|
|
74
|
+
}
|
|
75
|
+
return payload;
|
|
76
|
+
});
|
|
77
|
+
instance.head("/", async () => "");
|
|
78
|
+
instance.get("/", async () => delegate.messages.getHello());
|
|
79
|
+
instance.get("/status", async () => delegate.messages.getStatus());
|
|
80
|
+
async function start() {
|
|
81
|
+
await instance.listen(config.options.port, config.options.host);
|
|
82
|
+
}
|
|
83
|
+
async function stop() {
|
|
84
|
+
await instance.close();
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
start,
|
|
88
|
+
stop,
|
|
89
|
+
instance
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
createServer
|
|
94
|
+
};
|
|
2
95
|
//# sourceMappingURL=createServer.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/vendor/repack/dev-server/src/createServer.ts"],
|
|
4
4
|
"sourcesContent": ["import { Writable } from 'stream'\n\n// import debuggerAppPath from '@callstack/repack-debugger-app'\nimport fastifySensible from '@fastify/sensible'\nimport fastifyStatic from '@fastify/static'\nimport Fastify from 'fastify'\n\nimport apiPlugin from './plugins/api'\nimport compilerPlugin from './plugins/compiler'\nimport devtoolsPlugin from './plugins/devtools'\n// import faviconPlugin from './plugins/favicon'\nimport multipartPlugin from './plugins/multipart'\nimport symbolicatePlugin from './plugins/symbolicate'\nimport wssPlugin from './plugins/wss'\nimport { Internal, Server } from './types'\n\n/**\n * Create instance of development server, powered by Fastify.\n *\n * @param config Server configuration.\n * @returns `start` and `stop` functions as well as an underlying Fastify `instance`.\n */\nexport async function createServer(config: Server.Config) {\n let delegate: Server.Delegate\n\n /** Fastify instance powering the development server. */\n const instance = Fastify({\n logger: {\n level: 'trace',\n stream: new Writable({\n write: (chunk, _encoding, callback) => {\n const log = JSON.parse(chunk.toString())\n delegate?.logger.onMessage(log)\n instance.wss?.apiServer.send(log)\n callback()\n },\n }),\n },\n ...(config.options.https ? { https: config.options.https } : undefined),\n })\n\n delegate = config.delegate({\n log: instance.log,\n notifyBuildStart: (platform) => {\n instance.wss.apiServer.send({\n event: Internal.EventTypes.BuildStart,\n platform,\n })\n },\n notifyBuildEnd: (platform) => {\n instance.wss.apiServer.send({\n event: Internal.EventTypes.BuildEnd,\n platform,\n })\n },\n broadcastToHmrClients: (event, platform, clientIds) => {\n instance.wss.hmrServer.send(event, platform, clientIds)\n },\n broadcastToMessageClients: ({ method, params }) => {\n instance.wss.messageServer.broadcast(method, params)\n },\n })\n\n // Register plugins\n await instance.register(fastifySensible)\n await instance.register(wssPlugin, {\n options: config.options,\n delegate,\n })\n await instance.register(multipartPlugin)\n await instance.register(apiPlugin, {\n delegate,\n prefix: '/api',\n })\n await instance.register(compilerPlugin, {\n delegate,\n })\n await instance.register(symbolicatePlugin, {\n delegate,\n })\n await instance.register(devtoolsPlugin, {\n options: config.options,\n })\n\n console.warn('disable debugger-ui + favicon for now')\n // await instance.register(fastifyStatic, {\n // root: debuggerAppPath,\n // prefix: '/debugger-ui',\n // prefixAvoidTrailingSlash: true,\n // })\n\n // below is to prevent showing `GET 400 /favicon.ico`\n // errors in console when requesting the bundle via browser\n // await instance.register(faviconPlugin)\n\n instance.addHook('onSend', async (request, reply, payload) => {\n reply.header('X-Content-Type-Options', 'nosniff')\n\n const [pathname] = request.url.split('?')\n if (pathname.endsWith('.map')) {\n reply.header('Access-Control-Allow-Origin', 'devtools://devtools')\n }\n\n return payload\n })\n\n // Register routes\n instance.head('/', async () => '')\n instance.get('/', async () => delegate.messages.getHello())\n instance.get('/status', async () => delegate.messages.getStatus())\n\n /** Start the development server. */\n async function start() {\n await instance.listen(config.options.port, config.options.host)\n }\n\n /** Stop the development server. */\n async function stop() {\n await instance.close()\n }\n\n return {\n start,\n stop,\n instance,\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,SAAS,gBAAgB;AAGzB,OAAO,qBAAqB;AAE5B,OAAO,aAAa;AAEpB,OAAO,eAAe;AACtB,OAAO,oBAAoB;AAC3B,OAAO,oBAAoB;AAE3B,OAAO,qBAAqB;AAC5B,OAAO,uBAAuB;AAC9B,OAAO,eAAe;AACtB,SAAS,gBAAwB;AAQjC,eAAsB,aAAa,QAAuB;AACxD,MAAI;AAGJ,QAAM,WAAW,QAAQ;AAAA,IACvB,QAAQ;AAAA,MACN,OAAO;AAAA,MACP,QAAQ,IAAI,SAAS;AAAA,QACnB,OAAO,CAAC,OAAO,WAAW,aAAa;AA9B/C;AA+BU,gBAAM,MAAM,KAAK,MAAM,MAAM,SAAS,CAAC;AACvC,+CAAU,OAAO,UAAU;AAC3B,yBAAS,QAAT,mBAAc,UAAU,KAAK;AAC7B,mBAAS;AAAA,QACX;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,GAAI,OAAO,QAAQ,QAAQ,EAAE,OAAO,OAAO,QAAQ,MAAM,IAAI;AAAA,EAC/D,CAAC;AAED,aAAW,OAAO,SAAS;AAAA,IACzB,KAAK,SAAS;AAAA,IACd,kBAAkB,CAAC,aAAa;AAC9B,eAAS,IAAI,UAAU,KAAK;AAAA,QAC1B,OAAO,SAAS,WAAW;AAAA,QAC3B;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,gBAAgB,CAAC,aAAa;AAC5B,eAAS,IAAI,UAAU,KAAK;AAAA,QAC1B,OAAO,SAAS,WAAW;AAAA,QAC3B;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,uBAAuB,CAAC,OAAO,UAAU,cAAc;AACrD,eAAS,IAAI,UAAU,KAAK,OAAO,UAAU,SAAS;AAAA,IACxD;AAAA,IACA,2BAA2B,CAAC,EAAE,QAAQ,OAAO,MAAM;AACjD,eAAS,IAAI,cAAc,UAAU,QAAQ,MAAM;AAAA,IACrD;AAAA,EACF,CAAC;AAGD,QAAM,SAAS,SAAS,eAAe;AACvC,QAAM,SAAS,SAAS,WAAW;AAAA,IACjC,SAAS,OAAO;AAAA,IAChB;AAAA,EACF,CAAC;AACD,QAAM,SAAS,SAAS,eAAe;AACvC,QAAM,SAAS,SAAS,WAAW;AAAA,IACjC;AAAA,IACA,QAAQ;AAAA,EACV,CAAC;AACD,QAAM,SAAS,SAAS,gBAAgB;AAAA,IACtC;AAAA,EACF,CAAC;AACD,QAAM,SAAS,SAAS,mBAAmB;AAAA,IACzC;AAAA,EACF,CAAC;AACD,QAAM,SAAS,SAAS,gBAAgB;AAAA,IACtC,SAAS,OAAO;AAAA,EAClB,CAAC;AAED,UAAQ,KAAK,uCAAuC;AAWpD,WAAS,QAAQ,UAAU,OAAO,SAAS,OAAO,YAAY;AAC5D,UAAM,OAAO,0BAA0B,SAAS;AAEhD,UAAM,CAAC,QAAQ,IAAI,QAAQ,IAAI,MAAM,GAAG;AACxC,QAAI,SAAS,SAAS,MAAM,GAAG;AAC7B,YAAM,OAAO,+BAA+B,qBAAqB;AAAA,IACnE;AAEA,WAAO;AAAA,EACT,CAAC;AAGD,WAAS,KAAK,KAAK,YAAY,EAAE;AACjC,WAAS,IAAI,KAAK,YAAY,SAAS,SAAS,SAAS,CAAC;AAC1D,WAAS,IAAI,WAAW,YAAY,SAAS,SAAS,UAAU,CAAC;AAGjE,iBAAe,QAAQ;AACrB,UAAM,SAAS,OAAO,OAAO,QAAQ,MAAM,OAAO,QAAQ,IAAI;AAAA,EAChE;AAGA,iBAAe,OAAO;AACpB,UAAM,SAAS,MAAM;AAAA,EACvB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,95 @@
|
|
|
1
|
-
import{Writable
|
|
1
|
+
import { Writable } from "stream";
|
|
2
|
+
import fastifySensible from "@fastify/sensible";
|
|
3
|
+
import Fastify from "fastify";
|
|
4
|
+
import apiPlugin from "./plugins/api";
|
|
5
|
+
import compilerPlugin from "./plugins/compiler";
|
|
6
|
+
import devtoolsPlugin from "./plugins/devtools";
|
|
7
|
+
import multipartPlugin from "./plugins/multipart";
|
|
8
|
+
import symbolicatePlugin from "./plugins/symbolicate";
|
|
9
|
+
import wssPlugin from "./plugins/wss";
|
|
10
|
+
import { Internal } from "./types";
|
|
11
|
+
async function createServer(config) {
|
|
12
|
+
let delegate;
|
|
13
|
+
const instance = Fastify({
|
|
14
|
+
logger: {
|
|
15
|
+
level: "trace",
|
|
16
|
+
stream: new Writable({
|
|
17
|
+
write: (chunk, _encoding, callback) => {
|
|
18
|
+
var _a;
|
|
19
|
+
const log = JSON.parse(chunk.toString());
|
|
20
|
+
delegate == null ? void 0 : delegate.logger.onMessage(log);
|
|
21
|
+
(_a = instance.wss) == null ? void 0 : _a.apiServer.send(log);
|
|
22
|
+
callback();
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
...config.options.https ? { https: config.options.https } : void 0
|
|
27
|
+
});
|
|
28
|
+
delegate = config.delegate({
|
|
29
|
+
log: instance.log,
|
|
30
|
+
notifyBuildStart: (platform) => {
|
|
31
|
+
instance.wss.apiServer.send({
|
|
32
|
+
event: Internal.EventTypes.BuildStart,
|
|
33
|
+
platform
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
notifyBuildEnd: (platform) => {
|
|
37
|
+
instance.wss.apiServer.send({
|
|
38
|
+
event: Internal.EventTypes.BuildEnd,
|
|
39
|
+
platform
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
broadcastToHmrClients: (event, platform, clientIds) => {
|
|
43
|
+
instance.wss.hmrServer.send(event, platform, clientIds);
|
|
44
|
+
},
|
|
45
|
+
broadcastToMessageClients: ({ method, params }) => {
|
|
46
|
+
instance.wss.messageServer.broadcast(method, params);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
await instance.register(fastifySensible);
|
|
50
|
+
await instance.register(wssPlugin, {
|
|
51
|
+
options: config.options,
|
|
52
|
+
delegate
|
|
53
|
+
});
|
|
54
|
+
await instance.register(multipartPlugin);
|
|
55
|
+
await instance.register(apiPlugin, {
|
|
56
|
+
delegate,
|
|
57
|
+
prefix: "/api"
|
|
58
|
+
});
|
|
59
|
+
await instance.register(compilerPlugin, {
|
|
60
|
+
delegate
|
|
61
|
+
});
|
|
62
|
+
await instance.register(symbolicatePlugin, {
|
|
63
|
+
delegate
|
|
64
|
+
});
|
|
65
|
+
await instance.register(devtoolsPlugin, {
|
|
66
|
+
options: config.options
|
|
67
|
+
});
|
|
68
|
+
console.warn("disable debugger-ui + favicon for now");
|
|
69
|
+
instance.addHook("onSend", async (request, reply, payload) => {
|
|
70
|
+
reply.header("X-Content-Type-Options", "nosniff");
|
|
71
|
+
const [pathname] = request.url.split("?");
|
|
72
|
+
if (pathname.endsWith(".map")) {
|
|
73
|
+
reply.header("Access-Control-Allow-Origin", "devtools://devtools");
|
|
74
|
+
}
|
|
75
|
+
return payload;
|
|
76
|
+
});
|
|
77
|
+
instance.head("/", async () => "");
|
|
78
|
+
instance.get("/", async () => delegate.messages.getHello());
|
|
79
|
+
instance.get("/status", async () => delegate.messages.getStatus());
|
|
80
|
+
async function start() {
|
|
81
|
+
await instance.listen(config.options.port, config.options.host);
|
|
82
|
+
}
|
|
83
|
+
async function stop() {
|
|
84
|
+
await instance.close();
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
start,
|
|
88
|
+
stop,
|
|
89
|
+
instance
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
createServer
|
|
94
|
+
};
|
|
2
95
|
//# sourceMappingURL=createServer.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/vendor/repack/dev-server/src/createServer.ts"],
|
|
4
4
|
"sourcesContent": ["import { Writable } from 'stream'\n\n// import debuggerAppPath from '@callstack/repack-debugger-app'\nimport fastifySensible from '@fastify/sensible'\nimport fastifyStatic from '@fastify/static'\nimport Fastify from 'fastify'\n\nimport apiPlugin from './plugins/api'\nimport compilerPlugin from './plugins/compiler'\nimport devtoolsPlugin from './plugins/devtools'\n// import faviconPlugin from './plugins/favicon'\nimport multipartPlugin from './plugins/multipart'\nimport symbolicatePlugin from './plugins/symbolicate'\nimport wssPlugin from './plugins/wss'\nimport { Internal, Server } from './types'\n\n/**\n * Create instance of development server, powered by Fastify.\n *\n * @param config Server configuration.\n * @returns `start` and `stop` functions as well as an underlying Fastify `instance`.\n */\nexport async function createServer(config: Server.Config) {\n let delegate: Server.Delegate\n\n /** Fastify instance powering the development server. */\n const instance = Fastify({\n logger: {\n level: 'trace',\n stream: new Writable({\n write: (chunk, _encoding, callback) => {\n const log = JSON.parse(chunk.toString())\n delegate?.logger.onMessage(log)\n instance.wss?.apiServer.send(log)\n callback()\n },\n }),\n },\n ...(config.options.https ? { https: config.options.https } : undefined),\n })\n\n delegate = config.delegate({\n log: instance.log,\n notifyBuildStart: (platform) => {\n instance.wss.apiServer.send({\n event: Internal.EventTypes.BuildStart,\n platform,\n })\n },\n notifyBuildEnd: (platform) => {\n instance.wss.apiServer.send({\n event: Internal.EventTypes.BuildEnd,\n platform,\n })\n },\n broadcastToHmrClients: (event, platform, clientIds) => {\n instance.wss.hmrServer.send(event, platform, clientIds)\n },\n broadcastToMessageClients: ({ method, params }) => {\n instance.wss.messageServer.broadcast(method, params)\n },\n })\n\n // Register plugins\n await instance.register(fastifySensible)\n await instance.register(wssPlugin, {\n options: config.options,\n delegate,\n })\n await instance.register(multipartPlugin)\n await instance.register(apiPlugin, {\n delegate,\n prefix: '/api',\n })\n await instance.register(compilerPlugin, {\n delegate,\n })\n await instance.register(symbolicatePlugin, {\n delegate,\n })\n await instance.register(devtoolsPlugin, {\n options: config.options,\n })\n\n console.warn('disable debugger-ui + favicon for now')\n // await instance.register(fastifyStatic, {\n // root: debuggerAppPath,\n // prefix: '/debugger-ui',\n // prefixAvoidTrailingSlash: true,\n // })\n\n // below is to prevent showing `GET 400 /favicon.ico`\n // errors in console when requesting the bundle via browser\n // await instance.register(faviconPlugin)\n\n instance.addHook('onSend', async (request, reply, payload) => {\n reply.header('X-Content-Type-Options', 'nosniff')\n\n const [pathname] = request.url.split('?')\n if (pathname.endsWith('.map')) {\n reply.header('Access-Control-Allow-Origin', 'devtools://devtools')\n }\n\n return payload\n })\n\n // Register routes\n instance.head('/', async () => '')\n instance.get('/', async () => delegate.messages.getHello())\n instance.get('/status', async () => delegate.messages.getStatus())\n\n /** Start the development server. */\n async function start() {\n await instance.listen(config.options.port, config.options.host)\n }\n\n /** Stop the development server. */\n async function stop() {\n await instance.close()\n }\n\n return {\n start,\n stop,\n instance,\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,SAAS,gBAAgB;AAGzB,OAAO,qBAAqB;AAE5B,OAAO,aAAa;AAEpB,OAAO,eAAe;AACtB,OAAO,oBAAoB;AAC3B,OAAO,oBAAoB;AAE3B,OAAO,qBAAqB;AAC5B,OAAO,uBAAuB;AAC9B,OAAO,eAAe;AACtB,SAAS,gBAAwB;AAQjC,eAAsB,aAAa,QAAuB;AACxD,MAAI;AAGJ,QAAM,WAAW,QAAQ;AAAA,IACvB,QAAQ;AAAA,MACN,OAAO;AAAA,MACP,QAAQ,IAAI,SAAS;AAAA,QACnB,OAAO,CAAC,OAAO,WAAW,aAAa;AA9B/C;AA+BU,gBAAM,MAAM,KAAK,MAAM,MAAM,SAAS,CAAC;AACvC,+CAAU,OAAO,UAAU;AAC3B,yBAAS,QAAT,mBAAc,UAAU,KAAK;AAC7B,mBAAS;AAAA,QACX;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,GAAI,OAAO,QAAQ,QAAQ,EAAE,OAAO,OAAO,QAAQ,MAAM,IAAI;AAAA,EAC/D,CAAC;AAED,aAAW,OAAO,SAAS;AAAA,IACzB,KAAK,SAAS;AAAA,IACd,kBAAkB,CAAC,aAAa;AAC9B,eAAS,IAAI,UAAU,KAAK;AAAA,QAC1B,OAAO,SAAS,WAAW;AAAA,QAC3B;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,gBAAgB,CAAC,aAAa;AAC5B,eAAS,IAAI,UAAU,KAAK;AAAA,QAC1B,OAAO,SAAS,WAAW;AAAA,QAC3B;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,uBAAuB,CAAC,OAAO,UAAU,cAAc;AACrD,eAAS,IAAI,UAAU,KAAK,OAAO,UAAU,SAAS;AAAA,IACxD;AAAA,IACA,2BAA2B,CAAC,EAAE,QAAQ,OAAO,MAAM;AACjD,eAAS,IAAI,cAAc,UAAU,QAAQ,MAAM;AAAA,IACrD;AAAA,EACF,CAAC;AAGD,QAAM,SAAS,SAAS,eAAe;AACvC,QAAM,SAAS,SAAS,WAAW;AAAA,IACjC,SAAS,OAAO;AAAA,IAChB;AAAA,EACF,CAAC;AACD,QAAM,SAAS,SAAS,eAAe;AACvC,QAAM,SAAS,SAAS,WAAW;AAAA,IACjC;AAAA,IACA,QAAQ;AAAA,EACV,CAAC;AACD,QAAM,SAAS,SAAS,gBAAgB;AAAA,IACtC;AAAA,EACF,CAAC;AACD,QAAM,SAAS,SAAS,mBAAmB;AAAA,IACzC;AAAA,EACF,CAAC;AACD,QAAM,SAAS,SAAS,gBAAgB;AAAA,IACtC,SAAS,OAAO;AAAA,EAClB,CAAC;AAED,UAAQ,KAAK,uCAAuC;AAWpD,WAAS,QAAQ,UAAU,OAAO,SAAS,OAAO,YAAY;AAC5D,UAAM,OAAO,0BAA0B,SAAS;AAEhD,UAAM,CAAC,QAAQ,IAAI,QAAQ,IAAI,MAAM,GAAG;AACxC,QAAI,SAAS,SAAS,MAAM,GAAG;AAC7B,YAAM,OAAO,+BAA+B,qBAAqB;AAAA,IACnE;AAEA,WAAO;AAAA,EACT,CAAC;AAGD,WAAS,KAAK,KAAK,YAAY,EAAE;AACjC,WAAS,IAAI,KAAK,YAAY,SAAS,SAAS,SAAS,CAAC;AAC1D,WAAS,IAAI,WAAW,YAAY,SAAS,SAAS,UAAU,CAAC;AAGjE,iBAAe,QAAQ;AACrB,UAAM,SAAS,OAAO,OAAO,QAAQ,MAAM,OAAO,QAAQ,IAAI;AAAA,EAChE;AAGA,iBAAe,OAAO;AACpB,UAAM,SAAS,MAAM;AAAA,EACvB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/vendor/repack/dev-server/src/index.ts"],
|
|
4
4
|
"sourcesContent": ["export * from './createServer'\nexport * from './types'\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/vendor/repack/dev-server/src/index.ts"],
|
|
4
4
|
"sourcesContent": ["export * from './createServer'\nexport * from './types'\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,37 @@
|
|
|
1
|
-
const
|
|
1
|
+
const paramsSchema = {
|
|
2
|
+
type: "object",
|
|
3
|
+
properties: {
|
|
4
|
+
platform: {
|
|
5
|
+
type: "string"
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
required: ["platform"]
|
|
9
|
+
};
|
|
10
|
+
async function apiPlugin(instance, { delegate }) {
|
|
11
|
+
instance.get(
|
|
12
|
+
"/platforms",
|
|
13
|
+
async (_request, reply) => delegate.api ? reply.send({ data: await delegate.api.getPlatforms() }) : reply.notImplemented("Missing API delegate implementation")
|
|
14
|
+
);
|
|
15
|
+
instance.get(
|
|
16
|
+
"/:platform/assets",
|
|
17
|
+
{ schema: { params: paramsSchema } },
|
|
18
|
+
async (request, reply) => delegate.api ? reply.send({
|
|
19
|
+
data: await delegate.api.getAssets(request.params.platform)
|
|
20
|
+
}) : reply.notImplemented("Missing API delegate implementation")
|
|
21
|
+
);
|
|
22
|
+
instance.get(
|
|
23
|
+
"/:platform/stats",
|
|
24
|
+
{ schema: { params: paramsSchema } },
|
|
25
|
+
async (request, reply) => {
|
|
26
|
+
var _a;
|
|
27
|
+
return delegate.api ? reply.send({
|
|
28
|
+
data: await ((_a = delegate.api) == null ? void 0 : _a.getCompilationStats(request.params.platform))
|
|
29
|
+
}) : reply.notImplemented("Missing API delegate implementation");
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
var apiPlugin_default = apiPlugin;
|
|
34
|
+
export {
|
|
35
|
+
apiPlugin_default as default
|
|
36
|
+
};
|
|
2
37
|
//# sourceMappingURL=apiPlugin.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/vendor/repack/dev-server/src/plugins/api/apiPlugin.ts"],
|
|
4
4
|
"sourcesContent": ["import type { FastifyInstance } from 'fastify'\n\nimport type { Server } from '../../types'\n\nconst paramsSchema = {\n type: 'object',\n properties: {\n platform: {\n type: 'string',\n },\n },\n required: ['platform'],\n}\n\ntype Params = { platform: string }\n\nasync function apiPlugin(\n instance: FastifyInstance,\n { delegate }: { delegate: Server.Delegate }\n) {\n instance.get('/platforms', async (_request, reply) =>\n delegate.api\n ? reply.send({ data: await delegate.api.getPlatforms() })\n : reply.notImplemented('Missing API delegate implementation')\n )\n\n instance.get<{ Params: Params }>(\n '/:platform/assets',\n { schema: { params: paramsSchema } },\n async (request, reply) =>\n delegate.api\n ? reply.send({\n data: await delegate.api.getAssets(request.params.platform),\n })\n : reply.notImplemented('Missing API delegate implementation')\n )\n\n instance.get<{ Params: Params }>(\n '/:platform/stats',\n { schema: { params: paramsSchema } },\n async (request, reply) =>\n delegate.api\n ? reply.send({\n data: await delegate.api?.getCompilationStats(request.params.platform),\n })\n : reply.notImplemented('Missing API delegate implementation')\n )\n}\n\nexport default apiPlugin\n"],
|
|
5
|
-
"mappings": "AAIA,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAIA,MAAM,eAAe;AAAA,EACnB,MAAM;AAAA,EACN,YAAY;AAAA,IACV,UAAU;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,UAAU,CAAC,UAAU;AACvB;AAIA,eAAe,UACb,UACA,EAAE,SAAS,GACX;AACA,WAAS;AAAA,IAAI;AAAA,IAAc,OAAO,UAAU,UAC1C,SAAS,MACL,MAAM,KAAK,EAAE,MAAM,MAAM,SAAS,IAAI,aAAa,EAAE,CAAC,IACtD,MAAM,eAAe,qCAAqC;AAAA,EAChE;AAEA,WAAS;AAAA,IACP;AAAA,IACA,EAAE,QAAQ,EAAE,QAAQ,aAAa,EAAE;AAAA,IACnC,OAAO,SAAS,UACd,SAAS,MACL,MAAM,KAAK;AAAA,MACT,MAAM,MAAM,SAAS,IAAI,UAAU,QAAQ,OAAO,QAAQ;AAAA,IAC5D,CAAC,IACD,MAAM,eAAe,qCAAqC;AAAA,EAClE;AAEA,WAAS;AAAA,IACP;AAAA,IACA,EAAE,QAAQ,EAAE,QAAQ,aAAa,EAAE;AAAA,IACnC,OAAO,SAAS,UAAO;AAxC3B;AAyCM,sBAAS,MACL,MAAM,KAAK;AAAA,QACT,MAAM,QAAM,cAAS,QAAT,mBAAc,oBAAoB,QAAQ,OAAO;AAAA,MAC/D,CAAC,IACD,MAAM,eAAe,qCAAqC;AAAA;AAAA,EAClE;AACF;AAEA,IAAO,oBAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,37 @@
|
|
|
1
|
-
const
|
|
1
|
+
const paramsSchema = {
|
|
2
|
+
type: "object",
|
|
3
|
+
properties: {
|
|
4
|
+
platform: {
|
|
5
|
+
type: "string"
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
required: ["platform"]
|
|
9
|
+
};
|
|
10
|
+
async function apiPlugin(instance, { delegate }) {
|
|
11
|
+
instance.get(
|
|
12
|
+
"/platforms",
|
|
13
|
+
async (_request, reply) => delegate.api ? reply.send({ data: await delegate.api.getPlatforms() }) : reply.notImplemented("Missing API delegate implementation")
|
|
14
|
+
);
|
|
15
|
+
instance.get(
|
|
16
|
+
"/:platform/assets",
|
|
17
|
+
{ schema: { params: paramsSchema } },
|
|
18
|
+
async (request, reply) => delegate.api ? reply.send({
|
|
19
|
+
data: await delegate.api.getAssets(request.params.platform)
|
|
20
|
+
}) : reply.notImplemented("Missing API delegate implementation")
|
|
21
|
+
);
|
|
22
|
+
instance.get(
|
|
23
|
+
"/:platform/stats",
|
|
24
|
+
{ schema: { params: paramsSchema } },
|
|
25
|
+
async (request, reply) => {
|
|
26
|
+
var _a;
|
|
27
|
+
return delegate.api ? reply.send({
|
|
28
|
+
data: await ((_a = delegate.api) == null ? void 0 : _a.getCompilationStats(request.params.platform))
|
|
29
|
+
}) : reply.notImplemented("Missing API delegate implementation");
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
var apiPlugin_default = apiPlugin;
|
|
34
|
+
export {
|
|
35
|
+
apiPlugin_default as default
|
|
36
|
+
};
|
|
2
37
|
//# sourceMappingURL=apiPlugin.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/vendor/repack/dev-server/src/plugins/api/apiPlugin.ts"],
|
|
4
4
|
"sourcesContent": ["import type { FastifyInstance } from 'fastify'\n\nimport type { Server } from '../../types'\n\nconst paramsSchema = {\n type: 'object',\n properties: {\n platform: {\n type: 'string',\n },\n },\n required: ['platform'],\n}\n\ntype Params = { platform: string }\n\nasync function apiPlugin(\n instance: FastifyInstance,\n { delegate }: { delegate: Server.Delegate }\n) {\n instance.get('/platforms', async (_request, reply) =>\n delegate.api\n ? reply.send({ data: await delegate.api.getPlatforms() })\n : reply.notImplemented('Missing API delegate implementation')\n )\n\n instance.get<{ Params: Params }>(\n '/:platform/assets',\n { schema: { params: paramsSchema } },\n async (request, reply) =>\n delegate.api\n ? reply.send({\n data: await delegate.api.getAssets(request.params.platform),\n })\n : reply.notImplemented('Missing API delegate implementation')\n )\n\n instance.get<{ Params: Params }>(\n '/:platform/stats',\n { schema: { params: paramsSchema } },\n async (request, reply) =>\n delegate.api\n ? reply.send({\n data: await delegate.api?.getCompilationStats(request.params.platform),\n })\n : reply.notImplemented('Missing API delegate implementation')\n )\n}\n\nexport default apiPlugin\n"],
|
|
5
|
-
"mappings": "AAIA,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAIA,MAAM,eAAe;AAAA,EACnB,MAAM;AAAA,EACN,YAAY;AAAA,IACV,UAAU;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,UAAU,CAAC,UAAU;AACvB;AAIA,eAAe,UACb,UACA,EAAE,SAAS,GACX;AACA,WAAS;AAAA,IAAI;AAAA,IAAc,OAAO,UAAU,UAC1C,SAAS,MACL,MAAM,KAAK,EAAE,MAAM,MAAM,SAAS,IAAI,aAAa,EAAE,CAAC,IACtD,MAAM,eAAe,qCAAqC;AAAA,EAChE;AAEA,WAAS;AAAA,IACP;AAAA,IACA,EAAE,QAAQ,EAAE,QAAQ,aAAa,EAAE;AAAA,IACnC,OAAO,SAAS,UACd,SAAS,MACL,MAAM,KAAK;AAAA,MACT,MAAM,MAAM,SAAS,IAAI,UAAU,QAAQ,OAAO,QAAQ;AAAA,IAC5D,CAAC,IACD,MAAM,eAAe,qCAAqC;AAAA,EAClE;AAEA,WAAS;AAAA,IACP;AAAA,IACA,EAAE,QAAQ,EAAE,QAAQ,aAAa,EAAE;AAAA,IACnC,OAAO,SAAS,UAAO;AAxC3B;AAyCM,sBAAS,MACL,MAAM,KAAK;AAAA,QACT,MAAM,QAAM,cAAS,QAAT,mBAAc,oBAAoB,QAAQ,OAAO;AAAA,MAC/D,CAAC,IACD,MAAM,eAAe,qCAAqC;AAAA;AAAA,EAClE;AACF;AAEA,IAAO,oBAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/vendor/repack/dev-server/src/plugins/api/index.ts"],
|
|
4
4
|
"sourcesContent": ["export { default } from './apiPlugin'\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
5
|
+
"mappings": "AAAA,SAAS,WAAAA,gBAAe;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/vendor/repack/dev-server/src/plugins/api/index.ts"],
|
|
4
4
|
"sourcesContent": ["export { default } from './apiPlugin'\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
5
|
+
"mappings": "AAAA,SAAS,WAAAA,gBAAe;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,67 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fastifyPlugin from "fastify-plugin";
|
|
2
|
+
async function compilerPlugin(instance, { delegate }) {
|
|
3
|
+
instance.route({
|
|
4
|
+
method: ["GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD"],
|
|
5
|
+
url: "/*",
|
|
6
|
+
schema: {
|
|
7
|
+
querystring: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
platform: {
|
|
11
|
+
type: "string"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
handler: async (request, reply) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
let file = request.params["*"];
|
|
19
|
+
let { platform } = request.query;
|
|
20
|
+
if (!file) {
|
|
21
|
+
request.log.error(`File was not provided`);
|
|
22
|
+
return reply.notFound();
|
|
23
|
+
}
|
|
24
|
+
platform = ((_b = (_a = delegate.compiler).inferPlatform) == null ? void 0 : _b.call(_a, request.url)) ?? platform;
|
|
25
|
+
if (!platform) {
|
|
26
|
+
request.log.error("Cannot detect platform");
|
|
27
|
+
return reply.badRequest("Cannot detect platform");
|
|
28
|
+
}
|
|
29
|
+
if (file.startsWith(`${platform}/`)) {
|
|
30
|
+
file = file.replace(`${platform}/`, "");
|
|
31
|
+
}
|
|
32
|
+
const multipart = reply.asMultipart();
|
|
33
|
+
const sendProgress = ({ completed, total }) => {
|
|
34
|
+
multipart == null ? void 0 : multipart.writeChunk(
|
|
35
|
+
{ "Content-Type": "application/json" },
|
|
36
|
+
JSON.stringify({
|
|
37
|
+
done: completed,
|
|
38
|
+
total
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
try {
|
|
43
|
+
const asset = await delegate.compiler.getAsset(file, platform, sendProgress);
|
|
44
|
+
const mimeType = delegate.compiler.getMimeType(file, platform, asset);
|
|
45
|
+
if (multipart) {
|
|
46
|
+
const buffer = Buffer.isBuffer(asset) ? asset : Buffer.from(asset);
|
|
47
|
+
multipart.setHeader("Content-Type", `${mimeType}; charset=UTF-8`);
|
|
48
|
+
multipart.setHeader("Content-Length", String(Buffer.byteLength(buffer)));
|
|
49
|
+
multipart.end(buffer);
|
|
50
|
+
} else {
|
|
51
|
+
return reply.code(200).type(mimeType).send(asset);
|
|
52
|
+
}
|
|
53
|
+
} catch (error) {
|
|
54
|
+
request.log.error(error);
|
|
55
|
+
return reply.notFound(error.message);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
var compilerPlugin_default = fastifyPlugin(compilerPlugin, {
|
|
61
|
+
name: "compiler-plugin",
|
|
62
|
+
dependencies: ["fastify-sensible", "multipart-plugin"]
|
|
63
|
+
});
|
|
64
|
+
export {
|
|
65
|
+
compilerPlugin_default as default
|
|
66
|
+
};
|
|
2
67
|
//# sourceMappingURL=compilerPlugin.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/vendor/repack/dev-server/src/plugins/compiler/compilerPlugin.ts"],
|
|
4
4
|
"sourcesContent": ["import type { FastifyInstance } from 'fastify'\nimport fastifyPlugin from 'fastify-plugin'\n\nimport type { Server } from '../../types'\nimport type { SendProgress } from '../../types'\n\nasync function compilerPlugin(\n instance: FastifyInstance,\n { delegate }: { delegate: Server.Delegate }\n) {\n instance.route({\n method: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'HEAD'],\n url: '/*',\n schema: {\n querystring: {\n type: 'object',\n properties: {\n platform: {\n type: 'string',\n },\n },\n },\n },\n\n handler: async (request, reply) => {\n let file = (request.params as { '*'?: string })['*']\n let { platform } = request.query as { platform?: string }\n\n if (!file) {\n // This technically should never happen - this route should not be called if file is missing.\n request.log.error(`File was not provided`)\n return reply.notFound()\n }\n\n // Let consumer infer the platform. If function is not provided fallback\n // to platform query param.\n platform = delegate.compiler.inferPlatform?.(request.url) ?? platform\n\n if (!platform) {\n request.log.error('Cannot detect platform')\n return reply.badRequest('Cannot detect platform')\n }\n\n // If platform happens to be in front of an asset remove it.\n if (file.startsWith(`${platform}/`)) {\n file = file.replace(`${platform}/`, '')\n }\n\n const multipart = reply.asMultipart()\n\n const sendProgress: SendProgress = ({ completed, total }) => {\n multipart?.writeChunk(\n { 'Content-Type': 'application/json' },\n JSON.stringify({\n done: completed,\n total,\n })\n )\n }\n\n try {\n const asset = await delegate.compiler.getAsset(file, platform, sendProgress)\n const mimeType = delegate.compiler.getMimeType(file, platform, asset)\n\n if (multipart) {\n const buffer = Buffer.isBuffer(asset) ? asset : Buffer.from(asset)\n multipart.setHeader('Content-Type', `${mimeType}; charset=UTF-8`)\n multipart.setHeader('Content-Length', String(Buffer.byteLength(buffer)))\n multipart.end(buffer)\n } else {\n return reply.code(200).type(mimeType).send(asset)\n }\n } catch (error) {\n request.log.error(error)\n return reply.notFound((error as Error).message)\n }\n },\n })\n}\n\nexport default fastifyPlugin(compilerPlugin, {\n name: 'compiler-plugin',\n dependencies: ['fastify-sensible', 'multipart-plugin'],\n})\n"],
|
|
5
|
-
"mappings": "AACA,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AACA,OAAO,mBAAmB;AAK1B,eAAe,eACb,UACA,EAAE,SAAS,GACX;AACA,WAAS,MAAM;AAAA,IACb,QAAQ,CAAC,OAAO,QAAQ,OAAO,UAAU,WAAW,MAAM;AAAA,IAC1D,KAAK;AAAA,IACL,QAAQ;AAAA,MACN,aAAa;AAAA,QACX,MAAM;AAAA,QACN,YAAY;AAAA,UACV,UAAU;AAAA,YACR,MAAM;AAAA,UACR;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IAEA,SAAS,OAAO,SAAS,UAAU;AAxBvC;AAyBM,UAAI,OAAQ,QAAQ,OAA4B,GAAG;AACnD,UAAI,EAAE,SAAS,IAAI,QAAQ;AAE3B,UAAI,CAAC,MAAM;AAET,gBAAQ,IAAI,MAAM,uBAAuB;AACzC,eAAO,MAAM,SAAS;AAAA,MACxB;AAIA,mBAAW,oBAAS,UAAS,kBAAlB,4BAAkC,QAAQ,SAAQ;AAE7D,UAAI,CAAC,UAAU;AACb,gBAAQ,IAAI,MAAM,wBAAwB;AAC1C,eAAO,MAAM,WAAW,wBAAwB;AAAA,MAClD;AAGA,UAAI,KAAK,WAAW,GAAG,WAAW,GAAG;AACnC,eAAO,KAAK,QAAQ,GAAG,aAAa,EAAE;AAAA,MACxC;AAEA,YAAM,YAAY,MAAM,YAAY;AAEpC,YAAM,eAA6B,CAAC,EAAE,WAAW,MAAM,MAAM;AAC3D,+CAAW;AAAA,UACT,EAAE,gBAAgB,mBAAmB;AAAA,UACrC,KAAK,UAAU;AAAA,YACb,MAAM;AAAA,YACN;AAAA,UACF,CAAC;AAAA;AAAA,MAEL;AAEA,UAAI;AACF,cAAM,QAAQ,MAAM,SAAS,SAAS,SAAS,MAAM,UAAU,YAAY;AAC3E,cAAM,WAAW,SAAS,SAAS,YAAY,MAAM,UAAU,KAAK;AAEpE,YAAI,WAAW;AACb,gBAAM,SAAS,OAAO,SAAS,KAAK,IAAI,QAAQ,OAAO,KAAK,KAAK;AACjE,oBAAU,UAAU,gBAAgB,GAAG,yBAAyB;AAChE,oBAAU,UAAU,kBAAkB,OAAO,OAAO,WAAW,MAAM,CAAC,CAAC;AACvE,oBAAU,IAAI,MAAM;AAAA,QACtB,OAAO;AACL,iBAAO,MAAM,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAE,KAAK,KAAK;AAAA,QAClD;AAAA,MACF,SAAS,OAAP;AACA,gBAAQ,IAAI,MAAM,KAAK;AACvB,eAAO,MAAM,SAAU,MAAgB,OAAO;AAAA,MAChD;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEA,IAAO,yBAAQ,cAAc,gBAAgB;AAAA,EAC3C,MAAM;AAAA,EACN,cAAc,CAAC,oBAAoB,kBAAkB;AACvD,CAAC;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,67 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fastifyPlugin from "fastify-plugin";
|
|
2
|
+
async function compilerPlugin(instance, { delegate }) {
|
|
3
|
+
instance.route({
|
|
4
|
+
method: ["GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD"],
|
|
5
|
+
url: "/*",
|
|
6
|
+
schema: {
|
|
7
|
+
querystring: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
platform: {
|
|
11
|
+
type: "string"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
handler: async (request, reply) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
let file = request.params["*"];
|
|
19
|
+
let { platform } = request.query;
|
|
20
|
+
if (!file) {
|
|
21
|
+
request.log.error(`File was not provided`);
|
|
22
|
+
return reply.notFound();
|
|
23
|
+
}
|
|
24
|
+
platform = ((_b = (_a = delegate.compiler).inferPlatform) == null ? void 0 : _b.call(_a, request.url)) ?? platform;
|
|
25
|
+
if (!platform) {
|
|
26
|
+
request.log.error("Cannot detect platform");
|
|
27
|
+
return reply.badRequest("Cannot detect platform");
|
|
28
|
+
}
|
|
29
|
+
if (file.startsWith(`${platform}/`)) {
|
|
30
|
+
file = file.replace(`${platform}/`, "");
|
|
31
|
+
}
|
|
32
|
+
const multipart = reply.asMultipart();
|
|
33
|
+
const sendProgress = ({ completed, total }) => {
|
|
34
|
+
multipart == null ? void 0 : multipart.writeChunk(
|
|
35
|
+
{ "Content-Type": "application/json" },
|
|
36
|
+
JSON.stringify({
|
|
37
|
+
done: completed,
|
|
38
|
+
total
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
try {
|
|
43
|
+
const asset = await delegate.compiler.getAsset(file, platform, sendProgress);
|
|
44
|
+
const mimeType = delegate.compiler.getMimeType(file, platform, asset);
|
|
45
|
+
if (multipart) {
|
|
46
|
+
const buffer = Buffer.isBuffer(asset) ? asset : Buffer.from(asset);
|
|
47
|
+
multipart.setHeader("Content-Type", `${mimeType}; charset=UTF-8`);
|
|
48
|
+
multipart.setHeader("Content-Length", String(Buffer.byteLength(buffer)));
|
|
49
|
+
multipart.end(buffer);
|
|
50
|
+
} else {
|
|
51
|
+
return reply.code(200).type(mimeType).send(asset);
|
|
52
|
+
}
|
|
53
|
+
} catch (error) {
|
|
54
|
+
request.log.error(error);
|
|
55
|
+
return reply.notFound(error.message);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
var compilerPlugin_default = fastifyPlugin(compilerPlugin, {
|
|
61
|
+
name: "compiler-plugin",
|
|
62
|
+
dependencies: ["fastify-sensible", "multipart-plugin"]
|
|
63
|
+
});
|
|
64
|
+
export {
|
|
65
|
+
compilerPlugin_default as default
|
|
66
|
+
};
|
|
2
67
|
//# sourceMappingURL=compilerPlugin.mjs.map
|