@tamagui/cli 1.13.3 → 1.14.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/dist/cjs/build.js +1 -83
- package/dist/cjs/build.js.map +2 -2
- package/dist/cjs/cli.js +8 -155
- package/dist/cjs/cli.js.map +2 -2
- package/dist/cjs/dev/createDevServer.js +1 -164
- package/dist/cjs/dev/createDevServer.js.map +2 -2
- package/dist/cjs/dev.js +1 -185
- package/dist/cjs/dev.js.map +2 -2
- package/dist/cjs/generate.js +1 -82
- package/dist/cjs/generate.js.map +2 -2
- package/dist/cjs/index.js +1 -8
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/studio.js +1 -94
- package/dist/cjs/studio.js.map +2 -2
- package/dist/cjs/tamaguiConfigUtils.js +1 -85
- package/dist/cjs/tamaguiConfigUtils.js.map +2 -2
- package/dist/cjs/test.js +1 -42
- package/dist/cjs/test.js.map +2 -2
- package/dist/cjs/types.js +1 -16
- package/dist/cjs/types.js.map +2 -2
- package/dist/cjs/update.js +1 -29
- package/dist/cjs/update.js.map +2 -2
- package/dist/cjs/utils/constants.js +1 -28
- package/dist/cjs/utils/constants.js.map +2 -2
- package/dist/cjs/utils.js +1 -115
- package/dist/cjs/utils.js.map +2 -2
- package/dist/cjs/vendor/debugger-app/index.js +1 -28
- package/dist/cjs/vendor/debugger-app/index.js.map +2 -2
- package/dist/cjs/vendor/debugger-app/src/debuggerWorker.js +1 -63
- package/dist/cjs/vendor/debugger-app/src/debuggerWorker.js.map +2 -2
- package/dist/cjs/vendor/debugger-app/src/index.css +1 -40
- package/dist/cjs/vendor/debugger-app/src/index.css.map +1 -1
- package/dist/cjs/vendor/debugger-app/src/index.js +1 -164
- package/dist/cjs/vendor/debugger-app/src/index.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/createServer.js +1 -128
- package/dist/cjs/vendor/repack/dev-server/src/createServer.js.map +2 -2
- package/dist/cjs/vendor/repack/dev-server/src/index.js +1 -19
- 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 +1 -58
- 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 +1 -36
- 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 +1 -98
- 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 +1 -38
- 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 +1 -16
- 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 +1 -118
- 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 +1 -36
- 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 +1 -45
- 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 +1 -36
- 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 +1 -38
- 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 +2 -81
- 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 +1 -16
- 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 +1 -209
- 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 +1 -39
- 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 +1 -66
- 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 +1 -16
- 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 +1 -73
- 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 +1 -55
- 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 +1 -39
- 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 +1 -143
- 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 +1 -75
- 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 +1 -129
- 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 +1 -85
- 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 +1 -187
- 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 +1 -99
- 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 +1 -353
- 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 +1 -16
- 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 +1 -78
- 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 +1 -36
- 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 +1 -36
- package/dist/cjs/vendor/repack/dev-server/vendor/metro-inspector-proxy/src/Device.js.map +2 -2
- package/dist/esm/build.js +1 -48
- package/dist/esm/build.js.map +2 -2
- package/dist/esm/build.mjs +1 -48
- package/dist/esm/build.mjs.map +2 -2
- package/dist/esm/cli.js +8 -132
- package/dist/esm/cli.js.map +2 -2
- package/dist/esm/cli.mjs +8 -132
- package/dist/esm/cli.mjs.map +2 -2
- package/dist/esm/dev/createDevServer.js +1 -140
- package/dist/esm/dev/createDevServer.js.map +2 -2
- package/dist/esm/dev/createDevServer.mjs +1 -140
- package/dist/esm/dev/createDevServer.mjs.map +2 -2
- package/dist/esm/dev.js +1 -151
- package/dist/esm/dev.js.map +2 -2
- package/dist/esm/dev.mjs +1 -151
- package/dist/esm/dev.mjs.map +2 -2
- package/dist/esm/generate.js +1 -47
- package/dist/esm/generate.js.map +2 -2
- package/dist/esm/generate.mjs +1 -47
- package/dist/esm/generate.mjs.map +2 -2
- package/dist/esm/index.js +1 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -7
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/studio.js +1 -59
- package/dist/esm/studio.js.map +2 -2
- package/dist/esm/studio.mjs +1 -59
- package/dist/esm/studio.mjs.map +2 -2
- package/dist/esm/tamaguiConfigUtils.js +1 -50
- package/dist/esm/tamaguiConfigUtils.js.map +2 -2
- package/dist/esm/tamaguiConfigUtils.mjs +1 -50
- package/dist/esm/tamaguiConfigUtils.mjs.map +2 -2
- package/dist/esm/test.js +1 -8
- package/dist/esm/test.js.map +2 -2
- package/dist/esm/test.mjs +1 -8
- package/dist/esm/test.mjs.map +2 -2
- package/dist/esm/update.js +1 -5
- package/dist/esm/update.js.map +2 -2
- package/dist/esm/update.mjs +1 -5
- package/dist/esm/update.mjs.map +2 -2
- package/dist/esm/utils/constants.js +1 -4
- package/dist/esm/utils/constants.js.map +2 -2
- package/dist/esm/utils/constants.mjs +1 -4
- package/dist/esm/utils/constants.mjs.map +2 -2
- package/dist/esm/utils.js +1 -77
- package/dist/esm/utils.js.map +2 -2
- package/dist/esm/utils.mjs +1 -77
- package/dist/esm/utils.mjs.map +2 -2
- package/dist/esm/vendor/debugger-app/index.js +1 -5
- package/dist/esm/vendor/debugger-app/index.js.map +2 -2
- package/dist/esm/vendor/debugger-app/index.mjs +1 -5
- package/dist/esm/vendor/debugger-app/index.mjs.map +2 -2
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.js +1 -62
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.js.map +2 -2
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.mjs +1 -62
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.mjs.map +2 -2
- package/dist/esm/vendor/debugger-app/src/index.css +1 -40
- package/dist/esm/vendor/debugger-app/src/index.css.map +1 -1
- package/dist/esm/vendor/debugger-app/src/index.js +1 -141
- package/dist/esm/vendor/debugger-app/src/index.js.map +2 -2
- package/dist/esm/vendor/debugger-app/src/index.mjs +1 -141
- package/dist/esm/vendor/debugger-app/src/index.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/createServer.js +1 -94
- package/dist/esm/vendor/repack/dev-server/src/createServer.js.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/createServer.mjs +1 -94
- package/dist/esm/vendor/repack/dev-server/src/createServer.mjs.map +2 -2
- package/dist/esm/vendor/repack/dev-server/src/index.js +1 -2
- package/dist/esm/vendor/repack/dev-server/src/index.js.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/index.mjs +1 -2
- 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 +1 -36
- 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 +1 -36
- 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 +1 -4
- 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 +1 -4
- 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 +1 -66
- 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 +1 -66
- 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 +1 -5
- 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 +1 -5
- 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 +1 -86
- 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 +1 -86
- 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 +1 -4
- 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 +1 -4
- 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 +1 -12
- 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 +1 -12
- 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 +1 -4
- 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 +1 -4
- 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 +1 -5
- 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 +1 -5
- 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 +2 -49
- 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 +2 -49
- 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 +1 -185
- 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 +1 -185
- 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 +1 -6
- 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 +1 -6
- 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 +1 -34
- 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 +1 -34
- 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 +1 -49
- 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 +1 -49
- 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 +1 -31
- 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 +1 -31
- 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 +1 -6
- 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 +1 -6
- 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 +1 -109
- 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 +1 -109
- 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 +1 -51
- 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 +1 -51
- 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 +1 -105
- 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 +1 -105
- 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 +1 -61
- 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 +1 -61
- 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 +1 -153
- 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 +1 -153
- 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 +1 -75
- 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 +1 -75
- 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 +1 -329
- 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 +1 -329
- 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 +1 -46
- 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 +1 -46
- 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 +1 -12
- package/dist/esm/vendor/repack/dev-server/src/types.js.map +1 -1
- package/dist/esm/vendor/repack/dev-server/src/types.mjs +1 -12
- 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 +1 -4
- 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 +1 -4
- package/dist/esm/vendor/repack/dev-server/vendor/metro-inspector-proxy/src/Device.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -1,95 +1,2 @@
|
|
|
1
|
-
import
|
|
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
|
-
};
|
|
1
|
+
import{Writable as g}from"stream";import d from"@fastify/sensible";import f from"fastify";import c from"./plugins/api";import u from"./plugins/compiler";import w from"./plugins/devtools";import v from"./plugins/multipart";import S from"./plugins/symbolicate";import y from"./plugins/wss";import{Internal as l}from"./types";async function k(r){let s;const e=f({logger:{level:"trace",stream:new g({write:(t,o,i)=>{var n;const a=JSON.parse(t.toString());s==null||s.logger.onMessage(a),(n=e.wss)==null||n.apiServer.send(a),i()}})},...r.options.https?{https:r.options.https}:void 0});s=r.delegate({log:e.log,notifyBuildStart:t=>{e.wss.apiServer.send({event:l.EventTypes.BuildStart,platform:t})},notifyBuildEnd:t=>{e.wss.apiServer.send({event:l.EventTypes.BuildEnd,platform:t})},broadcastToHmrClients:(t,o,i)=>{e.wss.hmrServer.send(t,o,i)},broadcastToMessageClients:({method:t,params:o})=>{e.wss.messageServer.broadcast(t,o)}}),await e.register(d),await e.register(y,{options:r.options,delegate:s}),await e.register(v),await e.register(c,{delegate:s,prefix:"/api"}),await e.register(u,{delegate:s}),await e.register(S,{delegate:s}),await e.register(w,{options:r.options}),console.warn("disable debugger-ui + favicon for now"),e.addHook("onSend",async(t,o,i)=>{o.header("X-Content-Type-Options","nosniff");const[a]=t.url.split("?");return a.endsWith(".map")&&o.header("Access-Control-Allow-Origin","devtools://devtools"),i}),e.head("/",async()=>""),e.get("/",async()=>s.messages.getHello()),e.get("/status",async()=>s.messages.getStatus());async function p(){await e.listen(r.options.port,r.options.host)}async function m(){await e.close()}return{start:p,stop:m,instance:e}}export{k as createServer};
|
|
95
2
|
//# 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,OAAS,YAAAA,MAAgB,SAGzB,OAAOC,MAAqB,oBAE5B,OAAOC,MAAa,UAEpB,OAAOC,MAAe,gBACtB,OAAOC,MAAoB,qBAC3B,OAAOC,MAAoB,qBAE3B,OAAOC,MAAqB,sBAC5B,OAAOC,MAAuB,wBAC9B,OAAOC,MAAe,gBACtB,OAAS,YAAAC,MAAwB,UAQjC,eAAsBC,EAAaC,EAAuB,CACxD,IAAIC,EAGJ,MAAMC,EAAWX,EAAQ,CACvB,OAAQ,CACN,MAAO,QACP,OAAQ,IAAIF,EAAS,CACnB,MAAO,CAACc,EAAOC,EAAWC,IAAa,CA9B/C,IAAAC,EA+BU,MAAMC,EAAM,KAAK,MAAMJ,EAAM,SAAS,CAAC,EACvCF,GAAA,MAAAA,EAAU,OAAO,UAAUM,IAC3BD,EAAAJ,EAAS,MAAT,MAAAI,EAAc,UAAU,KAAKC,GAC7BF,EAAS,CACX,CACF,CAAC,CACH,EACA,GAAIL,EAAO,QAAQ,MAAQ,CAAE,MAAOA,EAAO,QAAQ,KAAM,EAAI,MAC/D,CAAC,EAEDC,EAAWD,EAAO,SAAS,CACzB,IAAKE,EAAS,IACd,iBAAmBM,GAAa,CAC9BN,EAAS,IAAI,UAAU,KAAK,CAC1B,MAAOJ,EAAS,WAAW,WAC3B,SAAAU,CACF,CAAC,CACH,EACA,eAAiBA,GAAa,CAC5BN,EAAS,IAAI,UAAU,KAAK,CAC1B,MAAOJ,EAAS,WAAW,SAC3B,SAAAU,CACF,CAAC,CACH,EACA,sBAAuB,CAACC,EAAOD,EAAUE,IAAc,CACrDR,EAAS,IAAI,UAAU,KAAKO,EAAOD,EAAUE,CAAS,CACxD,EACA,0BAA2B,CAAC,CAAE,OAAAC,EAAQ,OAAAC,CAAO,IAAM,CACjDV,EAAS,IAAI,cAAc,UAAUS,EAAQC,CAAM,CACrD,CACF,CAAC,EAGD,MAAMV,EAAS,SAASZ,CAAe,EACvC,MAAMY,EAAS,SAASL,EAAW,CACjC,QAASG,EAAO,QAChB,SAAAC,CACF,CAAC,EACD,MAAMC,EAAS,SAASP,CAAe,EACvC,MAAMO,EAAS,SAASV,EAAW,CACjC,SAAAS,EACA,OAAQ,MACV,CAAC,EACD,MAAMC,EAAS,SAAST,EAAgB,CACtC,SAAAQ,CACF,CAAC,EACD,MAAMC,EAAS,SAASN,EAAmB,CACzC,SAAAK,CACF,CAAC,EACD,MAAMC,EAAS,SAASR,EAAgB,CACtC,QAASM,EAAO,OAClB,CAAC,EAED,QAAQ,KAAK,uCAAuC,EAWpDE,EAAS,QAAQ,SAAU,MAAOW,EAASC,EAAOC,IAAY,CAC5DD,EAAM,OAAO,yBAA0B,SAAS,EAEhD,KAAM,CAACE,CAAQ,EAAIH,EAAQ,IAAI,MAAM,GAAG,EACxC,OAAIG,EAAS,SAAS,MAAM,GAC1BF,EAAM,OAAO,8BAA+B,qBAAqB,EAG5DC,CACT,CAAC,EAGDb,EAAS,KAAK,IAAK,SAAY,EAAE,EACjCA,EAAS,IAAI,IAAK,SAAYD,EAAS,SAAS,SAAS,CAAC,EAC1DC,EAAS,IAAI,UAAW,SAAYD,EAAS,SAAS,UAAU,CAAC,EAGjE,eAAegB,GAAQ,CACrB,MAAMf,EAAS,OAAOF,EAAO,QAAQ,KAAMA,EAAO,QAAQ,IAAI,CAChE,CAGA,eAAekB,GAAO,CACpB,MAAMhB,EAAS,MAAM,CACvB,CAEA,MAAO,CACL,MAAAe,EACA,KAAAC,EACA,SAAAhB,CACF,CACF",
|
|
6
|
+
"names": ["Writable", "fastifySensible", "Fastify", "apiPlugin", "compilerPlugin", "devtoolsPlugin", "multipartPlugin", "symbolicatePlugin", "wssPlugin", "Internal", "createServer", "config", "delegate", "instance", "chunk", "_encoding", "callback", "_a", "log", "platform", "event", "clientIds", "method", "params", "request", "reply", "payload", "pathname", "start", "stop"]
|
|
7
7
|
}
|
|
@@ -1,95 +1,2 @@
|
|
|
1
|
-
import
|
|
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
|
-
};
|
|
1
|
+
import{Writable as g}from"stream";import d from"@fastify/sensible";import f from"fastify";import c from"./plugins/api";import u from"./plugins/compiler";import w from"./plugins/devtools";import v from"./plugins/multipart";import S from"./plugins/symbolicate";import y from"./plugins/wss";import{Internal as l}from"./types";async function k(r){let s;const e=f({logger:{level:"trace",stream:new g({write:(t,o,i)=>{var n;const a=JSON.parse(t.toString());s==null||s.logger.onMessage(a),(n=e.wss)==null||n.apiServer.send(a),i()}})},...r.options.https?{https:r.options.https}:void 0});s=r.delegate({log:e.log,notifyBuildStart:t=>{e.wss.apiServer.send({event:l.EventTypes.BuildStart,platform:t})},notifyBuildEnd:t=>{e.wss.apiServer.send({event:l.EventTypes.BuildEnd,platform:t})},broadcastToHmrClients:(t,o,i)=>{e.wss.hmrServer.send(t,o,i)},broadcastToMessageClients:({method:t,params:o})=>{e.wss.messageServer.broadcast(t,o)}}),await e.register(d),await e.register(y,{options:r.options,delegate:s}),await e.register(v),await e.register(c,{delegate:s,prefix:"/api"}),await e.register(u,{delegate:s}),await e.register(S,{delegate:s}),await e.register(w,{options:r.options}),console.warn("disable debugger-ui + favicon for now"),e.addHook("onSend",async(t,o,i)=>{o.header("X-Content-Type-Options","nosniff");const[a]=t.url.split("?");return a.endsWith(".map")&&o.header("Access-Control-Allow-Origin","devtools://devtools"),i}),e.head("/",async()=>""),e.get("/",async()=>s.messages.getHello()),e.get("/status",async()=>s.messages.getStatus());async function p(){await e.listen(r.options.port,r.options.host)}async function m(){await e.close()}return{start:p,stop:m,instance:e}}export{k as createServer};
|
|
95
2
|
//# 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,OAAS,YAAAA,MAAgB,SAGzB,OAAOC,MAAqB,oBAE5B,OAAOC,MAAa,UAEpB,OAAOC,MAAe,gBACtB,OAAOC,MAAoB,qBAC3B,OAAOC,MAAoB,qBAE3B,OAAOC,MAAqB,sBAC5B,OAAOC,MAAuB,wBAC9B,OAAOC,MAAe,gBACtB,OAAS,YAAAC,MAAwB,UAQjC,eAAsBC,EAAaC,EAAuB,CACxD,IAAIC,EAGJ,MAAMC,EAAWX,EAAQ,CACvB,OAAQ,CACN,MAAO,QACP,OAAQ,IAAIF,EAAS,CACnB,MAAO,CAACc,EAAOC,EAAWC,IAAa,CA9B/C,IAAAC,EA+BU,MAAMC,EAAM,KAAK,MAAMJ,EAAM,SAAS,CAAC,EACvCF,GAAA,MAAAA,EAAU,OAAO,UAAUM,IAC3BD,EAAAJ,EAAS,MAAT,MAAAI,EAAc,UAAU,KAAKC,GAC7BF,EAAS,CACX,CACF,CAAC,CACH,EACA,GAAIL,EAAO,QAAQ,MAAQ,CAAE,MAAOA,EAAO,QAAQ,KAAM,EAAI,MAC/D,CAAC,EAEDC,EAAWD,EAAO,SAAS,CACzB,IAAKE,EAAS,IACd,iBAAmBM,GAAa,CAC9BN,EAAS,IAAI,UAAU,KAAK,CAC1B,MAAOJ,EAAS,WAAW,WAC3B,SAAAU,CACF,CAAC,CACH,EACA,eAAiBA,GAAa,CAC5BN,EAAS,IAAI,UAAU,KAAK,CAC1B,MAAOJ,EAAS,WAAW,SAC3B,SAAAU,CACF,CAAC,CACH,EACA,sBAAuB,CAACC,EAAOD,EAAUE,IAAc,CACrDR,EAAS,IAAI,UAAU,KAAKO,EAAOD,EAAUE,CAAS,CACxD,EACA,0BAA2B,CAAC,CAAE,OAAAC,EAAQ,OAAAC,CAAO,IAAM,CACjDV,EAAS,IAAI,cAAc,UAAUS,EAAQC,CAAM,CACrD,CACF,CAAC,EAGD,MAAMV,EAAS,SAASZ,CAAe,EACvC,MAAMY,EAAS,SAASL,EAAW,CACjC,QAASG,EAAO,QAChB,SAAAC,CACF,CAAC,EACD,MAAMC,EAAS,SAASP,CAAe,EACvC,MAAMO,EAAS,SAASV,EAAW,CACjC,SAAAS,EACA,OAAQ,MACV,CAAC,EACD,MAAMC,EAAS,SAAST,EAAgB,CACtC,SAAAQ,CACF,CAAC,EACD,MAAMC,EAAS,SAASN,EAAmB,CACzC,SAAAK,CACF,CAAC,EACD,MAAMC,EAAS,SAASR,EAAgB,CACtC,QAASM,EAAO,OAClB,CAAC,EAED,QAAQ,KAAK,uCAAuC,EAWpDE,EAAS,QAAQ,SAAU,MAAOW,EAASC,EAAOC,IAAY,CAC5DD,EAAM,OAAO,yBAA0B,SAAS,EAEhD,KAAM,CAACE,CAAQ,EAAIH,EAAQ,IAAI,MAAM,GAAG,EACxC,OAAIG,EAAS,SAAS,MAAM,GAC1BF,EAAM,OAAO,8BAA+B,qBAAqB,EAG5DC,CACT,CAAC,EAGDb,EAAS,KAAK,IAAK,SAAY,EAAE,EACjCA,EAAS,IAAI,IAAK,SAAYD,EAAS,SAAS,SAAS,CAAC,EAC1DC,EAAS,IAAI,UAAW,SAAYD,EAAS,SAAS,UAAU,CAAC,EAGjE,eAAegB,GAAQ,CACrB,MAAMf,EAAS,OAAOF,EAAO,QAAQ,KAAMA,EAAO,QAAQ,IAAI,CAChE,CAGA,eAAekB,GAAO,CACpB,MAAMhB,EAAS,MAAM,CACvB,CAEA,MAAO,CACL,MAAAe,EACA,KAAAC,EACA,SAAAhB,CACF,CACF",
|
|
6
|
+
"names": ["Writable", "fastifySensible", "Fastify", "apiPlugin", "compilerPlugin", "devtoolsPlugin", "multipartPlugin", "symbolicatePlugin", "wssPlugin", "Internal", "createServer", "config", "delegate", "instance", "chunk", "_encoding", "callback", "_a", "log", "platform", "event", "clientIds", "method", "params", "request", "reply", "payload", "pathname", "start", "stop"]
|
|
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,WAAc,iBACd,WAAc",
|
|
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,WAAc,iBACd,WAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,37 +1,2 @@
|
|
|
1
|
-
const
|
|
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
|
-
};
|
|
1
|
+
const p={type:"object",properties:{platform:{type:"string"}},required:["platform"]};async function i(s,{delegate:t}){s.get("/platforms",async(e,a)=>t.api?a.send({data:await t.api.getPlatforms()}):a.notImplemented("Missing API delegate implementation")),s.get("/:platform/assets",{schema:{params:p}},async(e,a)=>t.api?a.send({data:await t.api.getAssets(e.params.platform)}):a.notImplemented("Missing API delegate implementation")),s.get("/:platform/stats",{schema:{params:p}},async(e,a)=>{var m;return t.api?a.send({data:await((m=t.api)==null?void 0:m.getCompilationStats(e.params.platform))}):a.notImplemented("Missing API delegate implementation")})}var r=i;export{r as default};
|
|
37
2
|
//# 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,MAAMA,EAAe,CACnB,KAAM,SACN,WAAY,CACV,SAAU,CACR,KAAM,QACR,CACF,EACA,SAAU,CAAC,UAAU,CACvB,EAIA,eAAeC,EACbC,EACA,CAAE,SAAAC,CAAS,EACX,CACAD,EAAS,IAAI,aAAc,MAAOE,EAAUC,IAC1CF,EAAS,IACLE,EAAM,KAAK,CAAE,KAAM,MAAMF,EAAS,IAAI,aAAa,CAAE,CAAC,EACtDE,EAAM,eAAe,qCAAqC,CAChE,EAEAH,EAAS,IACP,oBACA,CAAE,OAAQ,CAAE,OAAQF,CAAa,CAAE,EACnC,MAAOM,EAASD,IACdF,EAAS,IACLE,EAAM,KAAK,CACT,KAAM,MAAMF,EAAS,IAAI,UAAUG,EAAQ,OAAO,QAAQ,CAC5D,CAAC,EACDD,EAAM,eAAe,qCAAqC,CAClE,EAEAH,EAAS,IACP,mBACA,CAAE,OAAQ,CAAE,OAAQF,CAAa,CAAE,EACnC,MAAOM,EAASD,IAAO,CAxC3B,IAAAE,EAyCM,OAAAJ,EAAS,IACLE,EAAM,KAAK,CACT,KAAM,OAAME,EAAAJ,EAAS,MAAT,YAAAI,EAAc,oBAAoBD,EAAQ,OAAO,UAC/D,CAAC,EACDD,EAAM,eAAe,qCAAqC,EAClE,CACF,CAEA,IAAOG,EAAQP",
|
|
6
|
+
"names": ["paramsSchema", "apiPlugin", "instance", "delegate", "_request", "reply", "request", "_a", "apiPlugin_default"]
|
|
7
7
|
}
|
|
@@ -1,37 +1,2 @@
|
|
|
1
|
-
const
|
|
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
|
-
};
|
|
1
|
+
const p={type:"object",properties:{platform:{type:"string"}},required:["platform"]};async function i(s,{delegate:t}){s.get("/platforms",async(e,a)=>t.api?a.send({data:await t.api.getPlatforms()}):a.notImplemented("Missing API delegate implementation")),s.get("/:platform/assets",{schema:{params:p}},async(e,a)=>t.api?a.send({data:await t.api.getAssets(e.params.platform)}):a.notImplemented("Missing API delegate implementation")),s.get("/:platform/stats",{schema:{params:p}},async(e,a)=>{var m;return t.api?a.send({data:await((m=t.api)==null?void 0:m.getCompilationStats(e.params.platform))}):a.notImplemented("Missing API delegate implementation")})}var r=i;export{r as default};
|
|
37
2
|
//# 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,MAAMA,EAAe,CACnB,KAAM,SACN,WAAY,CACV,SAAU,CACR,KAAM,QACR,CACF,EACA,SAAU,CAAC,UAAU,CACvB,EAIA,eAAeC,EACbC,EACA,CAAE,SAAAC,CAAS,EACX,CACAD,EAAS,IAAI,aAAc,MAAOE,EAAUC,IAC1CF,EAAS,IACLE,EAAM,KAAK,CAAE,KAAM,MAAMF,EAAS,IAAI,aAAa,CAAE,CAAC,EACtDE,EAAM,eAAe,qCAAqC,CAChE,EAEAH,EAAS,IACP,oBACA,CAAE,OAAQ,CAAE,OAAQF,CAAa,CAAE,EACnC,MAAOM,EAASD,IACdF,EAAS,IACLE,EAAM,KAAK,CACT,KAAM,MAAMF,EAAS,IAAI,UAAUG,EAAQ,OAAO,QAAQ,CAC5D,CAAC,EACDD,EAAM,eAAe,qCAAqC,CAClE,EAEAH,EAAS,IACP,mBACA,CAAE,OAAQ,CAAE,OAAQF,CAAa,CAAE,EACnC,MAAOM,EAASD,IAAO,CAxC3B,IAAAE,EAyCM,OAAAJ,EAAS,IACLE,EAAM,KAAK,CACT,KAAM,OAAME,EAAAJ,EAAS,MAAT,YAAAI,EAAc,oBAAoBD,EAAQ,OAAO,UAC/D,CAAC,EACDD,EAAM,eAAe,qCAAqC,EAClE,CACF,CAEA,IAAOG,EAAQP",
|
|
6
|
+
"names": ["paramsSchema", "apiPlugin", "instance", "delegate", "_request", "reply", "request", "_a", "apiPlugin_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,OAAS,WAAAA,MAAe",
|
|
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,OAAS,WAAAA,MAAe",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -1,67 +1,2 @@
|
|
|
1
|
-
import
|
|
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
|
-
};
|
|
1
|
+
import g from"fastify-plugin";async function d(l,{delegate:a}){l.route({method:["GET","POST","PUT","DELETE","OPTIONS","HEAD"],url:"/*",schema:{querystring:{type:"object",properties:{platform:{type:"string"}}}},handler:async(n,s)=>{var f,p;let o=n.params["*"],{platform:t}=n.query;if(!o)return n.log.error("File was not provided"),s.notFound();if(t=((p=(f=a.compiler).inferPlatform)==null?void 0:p.call(f,n.url))??t,!t)return n.log.error("Cannot detect platform"),s.badRequest("Cannot detect platform");o.startsWith(`${t}/`)&&(o=o.replace(`${t}/`,""));const r=s.asMultipart(),c=({completed:e,total:i})=>{r==null||r.writeChunk({"Content-Type":"application/json"},JSON.stringify({done:e,total:i}))};try{const e=await a.compiler.getAsset(o,t,c),i=a.compiler.getMimeType(o,t,e);if(r){const m=Buffer.isBuffer(e)?e:Buffer.from(e);r.setHeader("Content-Type",`${i}; charset=UTF-8`),r.setHeader("Content-Length",String(Buffer.byteLength(m))),r.end(m)}else return s.code(200).type(i).send(e)}catch(e){return n.log.error(e),s.notFound(e.message)}}})}var y=g(d,{name:"compiler-plugin",dependencies:["fastify-sensible","multipart-plugin"]});export{y as default};
|
|
67
2
|
//# 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,OAAOA,MAAmB,iBAK1B,eAAeC,EACbC,EACA,CAAE,SAAAC,CAAS,EACX,CACAD,EAAS,MAAM,CACb,OAAQ,CAAC,MAAO,OAAQ,MAAO,SAAU,UAAW,MAAM,EAC1D,IAAK,KACL,OAAQ,CACN,YAAa,CACX,KAAM,SACN,WAAY,CACV,SAAU,CACR,KAAM,QACR,CACF,CACF,CACF,EAEA,QAAS,MAAOE,EAASC,IAAU,CAxBvC,IAAAC,EAAAC,EAyBM,IAAIC,EAAQJ,EAAQ,OAA4B,GAAG,EAC/C,CAAE,SAAAK,CAAS,EAAIL,EAAQ,MAE3B,GAAI,CAACI,EAEH,OAAAJ,EAAQ,IAAI,MAAM,uBAAuB,EAClCC,EAAM,SAAS,EAOxB,GAFAI,IAAWF,GAAAD,EAAAH,EAAS,UAAS,gBAAlB,YAAAI,EAAA,KAAAD,EAAkCF,EAAQ,OAAQK,EAEzD,CAACA,EACH,OAAAL,EAAQ,IAAI,MAAM,wBAAwB,EACnCC,EAAM,WAAW,wBAAwB,EAI9CG,EAAK,WAAW,GAAGC,IAAW,IAChCD,EAAOA,EAAK,QAAQ,GAAGC,KAAa,EAAE,GAGxC,MAAMC,EAAYL,EAAM,YAAY,EAE9BM,EAA6B,CAAC,CAAE,UAAAC,EAAW,MAAAC,CAAM,IAAM,CAC3DH,GAAA,MAAAA,EAAW,WACT,CAAE,eAAgB,kBAAmB,EACrC,KAAK,UAAU,CACb,KAAME,EACN,MAAAC,CACF,CAAC,EAEL,EAEA,GAAI,CACF,MAAMC,EAAQ,MAAMX,EAAS,SAAS,SAASK,EAAMC,EAAUE,CAAY,EACrEI,EAAWZ,EAAS,SAAS,YAAYK,EAAMC,EAAUK,CAAK,EAEpE,GAAIJ,EAAW,CACb,MAAMM,EAAS,OAAO,SAASF,CAAK,EAAIA,EAAQ,OAAO,KAAKA,CAAK,EACjEJ,EAAU,UAAU,eAAgB,GAAGK,kBAAyB,EAChEL,EAAU,UAAU,iBAAkB,OAAO,OAAO,WAAWM,CAAM,CAAC,CAAC,EACvEN,EAAU,IAAIM,CAAM,CACtB,KACE,QAAOX,EAAM,KAAK,GAAG,EAAE,KAAKU,CAAQ,EAAE,KAAKD,CAAK,CAEpD,OAASG,EAAP,CACA,OAAAb,EAAQ,IAAI,MAAMa,CAAK,EAChBZ,EAAM,SAAUY,EAAgB,OAAO,CAChD,CACF,CACF,CAAC,CACH,CAEA,IAAOC,EAAQlB,EAAcC,EAAgB,CAC3C,KAAM,kBACN,aAAc,CAAC,mBAAoB,kBAAkB,CACvD,CAAC",
|
|
6
|
+
"names": ["fastifyPlugin", "compilerPlugin", "instance", "delegate", "request", "reply", "_a", "_b", "file", "platform", "multipart", "sendProgress", "completed", "total", "asset", "mimeType", "buffer", "error", "compilerPlugin_default"]
|
|
7
7
|
}
|
|
@@ -1,67 +1,2 @@
|
|
|
1
|
-
import
|
|
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
|
-
};
|
|
1
|
+
import g from"fastify-plugin";async function d(l,{delegate:a}){l.route({method:["GET","POST","PUT","DELETE","OPTIONS","HEAD"],url:"/*",schema:{querystring:{type:"object",properties:{platform:{type:"string"}}}},handler:async(n,s)=>{var f,p;let o=n.params["*"],{platform:t}=n.query;if(!o)return n.log.error("File was not provided"),s.notFound();if(t=((p=(f=a.compiler).inferPlatform)==null?void 0:p.call(f,n.url))??t,!t)return n.log.error("Cannot detect platform"),s.badRequest("Cannot detect platform");o.startsWith(`${t}/`)&&(o=o.replace(`${t}/`,""));const r=s.asMultipart(),c=({completed:e,total:i})=>{r==null||r.writeChunk({"Content-Type":"application/json"},JSON.stringify({done:e,total:i}))};try{const e=await a.compiler.getAsset(o,t,c),i=a.compiler.getMimeType(o,t,e);if(r){const m=Buffer.isBuffer(e)?e:Buffer.from(e);r.setHeader("Content-Type",`${i}; charset=UTF-8`),r.setHeader("Content-Length",String(Buffer.byteLength(m))),r.end(m)}else return s.code(200).type(i).send(e)}catch(e){return n.log.error(e),s.notFound(e.message)}}})}var y=g(d,{name:"compiler-plugin",dependencies:["fastify-sensible","multipart-plugin"]});export{y as default};
|
|
67
2
|
//# sourceMappingURL=compilerPlugin.mjs.map
|