@callstack/repack-dev-server 1.0.0-next.1 → 1.0.0-next.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/CHANGELOG.md +6 -0
- package/dist/createServer.d.ts +0 -0
- package/dist/createServer.js +2 -2
- package/dist/createServer.js.map +1 -1
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/index.js.map +0 -0
- package/dist/plugins/api/apiPlugin.d.ts +0 -0
- package/dist/plugins/api/apiPlugin.js +0 -0
- package/dist/plugins/api/apiPlugin.js.map +0 -0
- package/dist/plugins/api/index.d.ts +0 -0
- package/dist/plugins/api/index.js +0 -0
- package/dist/plugins/api/index.js.map +0 -0
- package/dist/plugins/compiler/compilerPlugin.d.ts +0 -0
- package/dist/plugins/compiler/compilerPlugin.js +0 -0
- package/dist/plugins/compiler/compilerPlugin.js.map +0 -0
- package/dist/plugins/compiler/index.d.ts +0 -0
- package/dist/plugins/compiler/index.js +0 -0
- package/dist/plugins/compiler/index.js.map +0 -0
- package/dist/plugins/compiler/types.d.ts +0 -0
- package/dist/plugins/compiler/types.js +0 -0
- package/dist/plugins/compiler/types.js.map +0 -0
- package/dist/plugins/devtools/devtoolsPlugin.d.ts +0 -0
- package/dist/plugins/devtools/devtoolsPlugin.js +0 -0
- package/dist/plugins/devtools/devtoolsPlugin.js.map +0 -0
- package/dist/plugins/devtools/index.d.ts +0 -0
- package/dist/plugins/devtools/index.js +0 -0
- package/dist/plugins/devtools/index.js.map +0 -0
- package/dist/plugins/multipart/index.d.ts +0 -0
- package/dist/plugins/multipart/index.js +0 -0
- package/dist/plugins/multipart/index.js.map +0 -0
- package/dist/plugins/multipart/multipartPlugin.d.ts +0 -0
- package/dist/plugins/multipart/multipartPlugin.js +0 -0
- package/dist/plugins/multipart/multipartPlugin.js.map +0 -0
- package/dist/plugins/multipart/types.d.ts +0 -0
- package/dist/plugins/multipart/types.js +0 -0
- package/dist/plugins/multipart/types.js.map +0 -0
- package/dist/plugins/symbolicate/Symbolicator.d.ts +0 -0
- package/dist/plugins/symbolicate/Symbolicator.js +0 -0
- package/dist/plugins/symbolicate/Symbolicator.js.map +0 -0
- package/dist/plugins/symbolicate/index.d.ts +0 -0
- package/dist/plugins/symbolicate/index.js +0 -0
- package/dist/plugins/symbolicate/index.js.map +0 -0
- package/dist/plugins/symbolicate/sybmolicatePlugin.d.ts +0 -0
- package/dist/plugins/symbolicate/sybmolicatePlugin.js +0 -0
- package/dist/plugins/symbolicate/sybmolicatePlugin.js.map +0 -0
- package/dist/plugins/symbolicate/types.d.ts +0 -0
- package/dist/plugins/symbolicate/types.js +0 -0
- package/dist/plugins/symbolicate/types.js.map +0 -0
- package/dist/plugins/wss/WebSocketRouter.d.ts +0 -0
- package/dist/plugins/wss/WebSocketRouter.js +0 -0
- package/dist/plugins/wss/WebSocketRouter.js.map +0 -0
- package/dist/plugins/wss/WebSocketServer.d.ts +0 -0
- package/dist/plugins/wss/WebSocketServer.js +0 -0
- package/dist/plugins/wss/WebSocketServer.js.map +0 -0
- package/dist/plugins/wss/index.d.ts +0 -0
- package/dist/plugins/wss/index.js +0 -0
- package/dist/plugins/wss/index.js.map +0 -0
- package/dist/plugins/wss/servers/HermesInspectorProxy.d.ts +0 -0
- package/dist/plugins/wss/servers/HermesInspectorProxy.js +0 -0
- package/dist/plugins/wss/servers/HermesInspectorProxy.js.map +0 -0
- package/dist/plugins/wss/servers/WebSocketApiServer.d.ts +0 -0
- package/dist/plugins/wss/servers/WebSocketApiServer.js +0 -0
- package/dist/plugins/wss/servers/WebSocketApiServer.js.map +0 -0
- package/dist/plugins/wss/servers/WebSocketDebuggerServer.d.ts +0 -0
- package/dist/plugins/wss/servers/WebSocketDebuggerServer.js +0 -0
- package/dist/plugins/wss/servers/WebSocketDebuggerServer.js.map +0 -0
- package/dist/plugins/wss/servers/WebSocketDevClientServer.d.ts +0 -0
- package/dist/plugins/wss/servers/WebSocketDevClientServer.js +0 -0
- package/dist/plugins/wss/servers/WebSocketDevClientServer.js.map +0 -0
- package/dist/plugins/wss/servers/WebSocketEventsServer.d.ts +0 -0
- package/dist/plugins/wss/servers/WebSocketEventsServer.js +0 -0
- package/dist/plugins/wss/servers/WebSocketEventsServer.js.map +0 -0
- package/dist/plugins/wss/servers/WebSocketHMRServer.d.ts +0 -0
- package/dist/plugins/wss/servers/WebSocketHMRServer.js +0 -0
- package/dist/plugins/wss/servers/WebSocketHMRServer.js.map +0 -0
- package/dist/plugins/wss/servers/WebSocketMessageServer.d.ts +0 -0
- package/dist/plugins/wss/servers/WebSocketMessageServer.js +0 -0
- package/dist/plugins/wss/servers/WebSocketMessageServer.js.map +0 -0
- package/dist/plugins/wss/types.d.ts +0 -0
- package/dist/plugins/wss/types.js +0 -0
- package/dist/plugins/wss/types.js.map +0 -0
- package/dist/plugins/wss/wssPlugin.d.ts +0 -0
- package/dist/plugins/wss/wssPlugin.js +0 -0
- package/dist/plugins/wss/wssPlugin.js.map +0 -0
- package/dist/types.d.ts +0 -0
- package/dist/types.js +0 -0
- package/dist/types.js.map +0 -0
- package/docs/README.md +28 -0
- package/docs/enums/Internal.EventTypes.md +41 -0
- package/docs/functions/createServer.md +21 -0
- package/docs/interfaces/CodeFrame.md +48 -0
- package/docs/interfaces/CompilerDelegate.md +83 -0
- package/docs/interfaces/HmrDelegate.md +51 -0
- package/docs/interfaces/InputStackFrame.md +76 -0
- package/docs/interfaces/ProgressData.md +34 -0
- package/docs/interfaces/ReactNativeStackFrame.md +58 -0
- package/docs/interfaces/Server.Api.Asset.md +36 -0
- package/docs/interfaces/Server.Api.CompilationStats.md +9 -0
- package/docs/interfaces/Server.Api.Delegate.md +75 -0
- package/docs/interfaces/Server.Config.md +49 -0
- package/docs/interfaces/Server.Delegate.md +88 -0
- package/docs/interfaces/Server.DelegateContext.md +134 -0
- package/docs/interfaces/Server.LoggerDelegate.md +33 -0
- package/docs/interfaces/Server.MessagesDelegate.md +44 -0
- package/docs/interfaces/Server.Options.md +70 -0
- package/docs/interfaces/StackFrame.md +85 -0
- package/docs/interfaces/SymbolicatorDelegate.md +77 -0
- package/docs/interfaces/SymbolicatorResults.md +30 -0
- package/docs/modules/Internal.md +11 -0
- package/docs/modules/Server.Api.md +11 -0
- package/docs/modules/Server.md +16 -0
- package/docs/types/SendProgress.md +26 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @callstack/repack-dev-server
|
|
2
2
|
|
|
3
|
+
## 1.0.0-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#200](https://github.com/callstack/repack/pull/200) [`c75cdc7`](https://github.com/callstack/repack/commit/c75cdc7a44351bb4702232e603031e2880f2839d) Thanks [@zamotany](https://github.com/zamotany)! - Prevent server logger from emitting log to API WS server before WS servers are created.
|
|
8
|
+
|
|
3
9
|
## 1.0.0-next.1
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/createServer.d.ts
CHANGED
|
File without changes
|
package/dist/createServer.js
CHANGED
|
@@ -26,11 +26,11 @@ export async function createServer(config) {
|
|
|
26
26
|
level: 'trace',
|
|
27
27
|
stream: new Writable({
|
|
28
28
|
write: (chunk, _encoding, callback) => {
|
|
29
|
-
var _delegate;
|
|
29
|
+
var _delegate, _instance$wss;
|
|
30
30
|
|
|
31
31
|
const log = JSON.parse(chunk.toString());
|
|
32
32
|
(_delegate = delegate) === null || _delegate === void 0 ? void 0 : _delegate.logger.onMessage(log);
|
|
33
|
-
instance.wss.apiServer.send(log);
|
|
33
|
+
(_instance$wss = instance.wss) === null || _instance$wss === void 0 ? void 0 : _instance$wss.apiServer.send(log);
|
|
34
34
|
callback();
|
|
35
35
|
}
|
|
36
36
|
})
|
package/dist/createServer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createServer.js","names":["Writable","Fastify","fastifySensible","fastifyStatic","debuggerAppPath","multipartPlugin","compilerPlugin","devtoolsPlugin","apiPlugin","wssPlugin","Internal","symbolicatePlugin","createServer","config","delegate","instance","logger","level","stream","write","chunk","_encoding","callback","log","JSON","parse","toString","onMessage","wss","apiServer","send","options","https","undefined","notifyBuildStart","platform","event","EventTypes","BuildStart","notifyBuildEnd","BuildEnd","broadcastToHmrClients","clientIds","hmrServer","broadcastToMessageClients","method","params","messageServer","broadcast","register","prefix","root","prefixAvoidTrailingSlash","addHook","request","reply","payload","header","pathname","url","split","endsWith","get","messages","getHello","getStatus","start","listen","port","host","stop","close"],"sources":["../src/createServer.ts"],"sourcesContent":["import { Writable } from 'stream';\nimport Fastify from 'fastify';\nimport fastifySensible from '@fastify/sensible';\nimport fastifyStatic from '@fastify/static';\nimport debuggerAppPath from '@callstack/repack-debugger-app';\nimport multipartPlugin from './plugins/multipart';\nimport compilerPlugin from './plugins/compiler';\nimport devtoolsPlugin from './plugins/devtools';\nimport apiPlugin from './plugins/api';\nimport wssPlugin from './plugins/wss';\nimport { Internal, Server } from './types';\nimport symbolicatePlugin from './plugins/symbolicate';\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
|
|
1
|
+
{"version":3,"file":"createServer.js","names":["Writable","Fastify","fastifySensible","fastifyStatic","debuggerAppPath","multipartPlugin","compilerPlugin","devtoolsPlugin","apiPlugin","wssPlugin","Internal","symbolicatePlugin","createServer","config","delegate","instance","logger","level","stream","write","chunk","_encoding","callback","log","JSON","parse","toString","onMessage","wss","apiServer","send","options","https","undefined","notifyBuildStart","platform","event","EventTypes","BuildStart","notifyBuildEnd","BuildEnd","broadcastToHmrClients","clientIds","hmrServer","broadcastToMessageClients","method","params","messageServer","broadcast","register","prefix","root","prefixAvoidTrailingSlash","addHook","request","reply","payload","header","pathname","url","split","endsWith","get","messages","getHello","getStatus","start","listen","port","host","stop","close"],"sources":["../src/createServer.ts"],"sourcesContent":["import { Writable } from 'stream';\nimport Fastify from 'fastify';\nimport fastifySensible from '@fastify/sensible';\nimport fastifyStatic from '@fastify/static';\nimport debuggerAppPath from '@callstack/repack-debugger-app';\nimport multipartPlugin from './plugins/multipart';\nimport compilerPlugin from './plugins/compiler';\nimport devtoolsPlugin from './plugins/devtools';\nimport apiPlugin from './plugins/api';\nimport wssPlugin from './plugins/wss';\nimport { Internal, Server } from './types';\nimport symbolicatePlugin from './plugins/symbolicate';\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 await instance.register(fastifyStatic, {\n root: debuggerAppPath,\n prefix: '/debugger-ui',\n prefixAvoidTrailingSlash: true,\n });\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.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"],"mappings":"AAAA,SAASA,QAAT,QAAyB,QAAzB;AACA,OAAOC,OAAP,MAAoB,SAApB;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,OAAOC,eAAP,MAA4B,gCAA5B;OACOC,e;OACAC,c;OACAC,c;OACAC,S;OACAC,S;SACEC,Q;OACFC,iB;AAEP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,eAAeC,YAAf,CAA4BC,MAA5B,EAAmD;EACxD,IAAIC,QAAJ;EAEA;;EACA,MAAMC,QAAQ,GAAGd,OAAO,CAAC;IACvBe,MAAM,EAAE;MACNC,KAAK,EAAE,OADD;MAENC,MAAM,EAAE,IAAIlB,QAAJ,CAAa;QACnBmB,KAAK,EAAE,CAACC,KAAD,EAAQC,SAAR,EAAmBC,QAAnB,KAAgC;UAAA;;UACrC,MAAMC,GAAG,GAAGC,IAAI,CAACC,KAAL,CAAWL,KAAK,CAACM,QAAN,EAAX,CAAZ;UACA,aAAAZ,QAAQ,UAAR,8CAAUE,MAAV,CAAiBW,SAAjB,CAA2BJ,GAA3B;UACA,iBAAAR,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AwB,YAAYhD,QAAQ,CAACiD,QAAT,CAAkBE,SAAlB,EAApC;EAEA;;EACA,eAAeC,KAAf,GAAuB;IACrB,MAAMnD,QAAQ,CAACoD,MAAT,CAAgBtD,MAAM,CAACkB,OAAP,CAAeqC,IAA/B,EAAqCvD,MAAM,CAACkB,OAAP,CAAesC,IAApD,CAAN;EACD;EAED;;;EACA,eAAeC,IAAf,GAAsB;IACpB,MAAMvD,QAAQ,CAACwD,KAAT,EAAN;EACD;;EAED,OAAO;IACLL,KADK;IAELI,IAFK;IAGLvD;EAHK,CAAP;AAKD"}
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/index.js.map
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/types.d.ts
CHANGED
|
File without changes
|
package/dist/types.js
CHANGED
|
File without changes
|
package/dist/types.js.map
CHANGED
|
File without changes
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @callstack/repack-dev-server
|
|
2
|
+
|
|
3
|
+
## Table of contents
|
|
4
|
+
|
|
5
|
+
### Namespaces
|
|
6
|
+
|
|
7
|
+
- [Internal](modules/Internal.md)
|
|
8
|
+
- [Server](modules/Server.md)
|
|
9
|
+
|
|
10
|
+
### Interfaces
|
|
11
|
+
|
|
12
|
+
- [CodeFrame](interfaces/CodeFrame.md)
|
|
13
|
+
- [CompilerDelegate](interfaces/CompilerDelegate.md)
|
|
14
|
+
- [HmrDelegate](interfaces/HmrDelegate.md)
|
|
15
|
+
- [InputStackFrame](interfaces/InputStackFrame.md)
|
|
16
|
+
- [ProgressData](interfaces/ProgressData.md)
|
|
17
|
+
- [ReactNativeStackFrame](interfaces/ReactNativeStackFrame.md)
|
|
18
|
+
- [StackFrame](interfaces/StackFrame.md)
|
|
19
|
+
- [SymbolicatorDelegate](interfaces/SymbolicatorDelegate.md)
|
|
20
|
+
- [SymbolicatorResults](interfaces/SymbolicatorResults.md)
|
|
21
|
+
|
|
22
|
+
### Type Aliases
|
|
23
|
+
|
|
24
|
+
- [SendProgress](types/SendProgress.md)
|
|
25
|
+
|
|
26
|
+
### Functions
|
|
27
|
+
|
|
28
|
+
- [createServer](functions/createServer.md)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Enumeration: EventTypes
|
|
2
|
+
|
|
3
|
+
[Internal](../modules/Internal.md).EventTypes
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Enumeration Members
|
|
8
|
+
|
|
9
|
+
- [BuildEnd](Internal.EventTypes.md#buildend)
|
|
10
|
+
- [BuildStart](Internal.EventTypes.md#buildstart)
|
|
11
|
+
- [HmrEvent](Internal.EventTypes.md#hmrevent)
|
|
12
|
+
|
|
13
|
+
## Enumeration Members
|
|
14
|
+
|
|
15
|
+
### BuildEnd
|
|
16
|
+
|
|
17
|
+
• **BuildEnd**
|
|
18
|
+
|
|
19
|
+
#### Defined in
|
|
20
|
+
|
|
21
|
+
[types.ts:200](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/types.ts#L200)
|
|
22
|
+
|
|
23
|
+
___
|
|
24
|
+
|
|
25
|
+
### BuildStart
|
|
26
|
+
|
|
27
|
+
• **BuildStart**
|
|
28
|
+
|
|
29
|
+
#### Defined in
|
|
30
|
+
|
|
31
|
+
[types.ts:199](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/types.ts#L199)
|
|
32
|
+
|
|
33
|
+
___
|
|
34
|
+
|
|
35
|
+
### HmrEvent
|
|
36
|
+
|
|
37
|
+
• **HmrEvent**
|
|
38
|
+
|
|
39
|
+
#### Defined in
|
|
40
|
+
|
|
41
|
+
[types.ts:201](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/types.ts#L201)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Function: createServer
|
|
2
|
+
|
|
3
|
+
▸ **createServer**(`config`): `Promise`<{ `instance`: `FastifyInstance`<`Server`, `IncomingMessage`, `ServerResponse`, `FastifyLoggerInstance`\> & `PromiseLike`<`FastifyInstance`<`Server`, `IncomingMessage`, `ServerResponse`, `FastifyLoggerInstance`\>\> ; `start`: () => `Promise`<`void`\> ; `stop`: () => `Promise`<`void`\> }\>
|
|
4
|
+
|
|
5
|
+
Create instance of development server, powered by Fastify.
|
|
6
|
+
|
|
7
|
+
#### Parameters
|
|
8
|
+
|
|
9
|
+
| Name | Type | Description |
|
|
10
|
+
| :------ | :------ | :------ |
|
|
11
|
+
| `config` | [`Config`](../interfaces/Server.Config.md) | Server configuration. |
|
|
12
|
+
|
|
13
|
+
#### Returns
|
|
14
|
+
|
|
15
|
+
`Promise`<{ `instance`: `FastifyInstance`<`Server`, `IncomingMessage`, `ServerResponse`, `FastifyLoggerInstance`\> & `PromiseLike`<`FastifyInstance`<`Server`, `IncomingMessage`, `ServerResponse`, `FastifyLoggerInstance`\>\> ; `start`: () => `Promise`<`void`\> ; `stop`: () => `Promise`<`void`\> }\>
|
|
16
|
+
|
|
17
|
+
`start` and `stop` functions as well as an underlying Fastify `instance`.
|
|
18
|
+
|
|
19
|
+
#### Defined in
|
|
20
|
+
|
|
21
|
+
[createServer.ts:20](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/createServer.ts#L20)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Interface: CodeFrame
|
|
2
|
+
|
|
3
|
+
Represents [@babel/core-frame](https://babeljs.io/docs/en/babel-code-frame).
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [content](CodeFrame.md#content)
|
|
10
|
+
- [fileName](CodeFrame.md#filename)
|
|
11
|
+
- [location](CodeFrame.md#location)
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### content
|
|
16
|
+
|
|
17
|
+
• **content**: `string`
|
|
18
|
+
|
|
19
|
+
#### Defined in
|
|
20
|
+
|
|
21
|
+
[plugins/symbolicate/types.ts:29](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/plugins/symbolicate/types.ts#L29)
|
|
22
|
+
|
|
23
|
+
___
|
|
24
|
+
|
|
25
|
+
### fileName
|
|
26
|
+
|
|
27
|
+
• **fileName**: `string`
|
|
28
|
+
|
|
29
|
+
#### Defined in
|
|
30
|
+
|
|
31
|
+
[plugins/symbolicate/types.ts:34](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/plugins/symbolicate/types.ts#L34)
|
|
32
|
+
|
|
33
|
+
___
|
|
34
|
+
|
|
35
|
+
### location
|
|
36
|
+
|
|
37
|
+
• **location**: `Object`
|
|
38
|
+
|
|
39
|
+
#### Type declaration
|
|
40
|
+
|
|
41
|
+
| Name | Type |
|
|
42
|
+
| :------ | :------ |
|
|
43
|
+
| `column` | `number` |
|
|
44
|
+
| `row` | `number` |
|
|
45
|
+
|
|
46
|
+
#### Defined in
|
|
47
|
+
|
|
48
|
+
[plugins/symbolicate/types.ts:30](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/plugins/symbolicate/types.ts#L30)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Interface: CompilerDelegate
|
|
2
|
+
|
|
3
|
+
Delegate with implementation for compiler-specific functions.
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Methods
|
|
8
|
+
|
|
9
|
+
- [getAsset](CompilerDelegate.md#getasset)
|
|
10
|
+
- [getMimeType](CompilerDelegate.md#getmimetype)
|
|
11
|
+
- [inferPlatform](CompilerDelegate.md#inferplatform)
|
|
12
|
+
|
|
13
|
+
## Methods
|
|
14
|
+
|
|
15
|
+
### getAsset
|
|
16
|
+
|
|
17
|
+
▸ **getAsset**(`filename`, `platform`, `sendProgress?`): `Promise`<`string` \| `Buffer`\>
|
|
18
|
+
|
|
19
|
+
Get compiled asset content.
|
|
20
|
+
|
|
21
|
+
If the compilation is in progress, it should wait until compilation finishes and then return the asset.
|
|
22
|
+
|
|
23
|
+
#### Parameters
|
|
24
|
+
|
|
25
|
+
| Name | Type | Description |
|
|
26
|
+
| :------ | :------ | :------ |
|
|
27
|
+
| `filename` | `string` | Filename of the asset to get. |
|
|
28
|
+
| `platform` | `string` | Platform of the asset to get. |
|
|
29
|
+
| `sendProgress?` | [`SendProgress`](../types/SendProgress.md) | Function to notify the client who requested the asset about compilation progress. |
|
|
30
|
+
|
|
31
|
+
#### Returns
|
|
32
|
+
|
|
33
|
+
`Promise`<`string` \| `Buffer`\>
|
|
34
|
+
|
|
35
|
+
#### Defined in
|
|
36
|
+
|
|
37
|
+
[plugins/compiler/types.ts:16](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/plugins/compiler/types.ts#L16)
|
|
38
|
+
|
|
39
|
+
___
|
|
40
|
+
|
|
41
|
+
### getMimeType
|
|
42
|
+
|
|
43
|
+
▸ **getMimeType**(`filename`, `platform`, `data`): `string`
|
|
44
|
+
|
|
45
|
+
Detect MIME type of the asset from `filename`, `platform` or `data` (or from combination of either).
|
|
46
|
+
|
|
47
|
+
#### Parameters
|
|
48
|
+
|
|
49
|
+
| Name | Type | Description |
|
|
50
|
+
| :------ | :------ | :------ |
|
|
51
|
+
| `filename` | `string` | Filename of the asset. |
|
|
52
|
+
| `platform` | `string` | Platform of the asset. |
|
|
53
|
+
| `data` | `string` \| `Buffer` | Asset's content. |
|
|
54
|
+
|
|
55
|
+
#### Returns
|
|
56
|
+
|
|
57
|
+
`string`
|
|
58
|
+
|
|
59
|
+
#### Defined in
|
|
60
|
+
|
|
61
|
+
[plugins/compiler/types.ts:29](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/plugins/compiler/types.ts#L29)
|
|
62
|
+
|
|
63
|
+
___
|
|
64
|
+
|
|
65
|
+
### inferPlatform
|
|
66
|
+
|
|
67
|
+
▸ `Optional` **inferPlatform**(`uri`): `undefined` \| `string`
|
|
68
|
+
|
|
69
|
+
Detect the platform from the URI - either from filename, query params or both.
|
|
70
|
+
|
|
71
|
+
#### Parameters
|
|
72
|
+
|
|
73
|
+
| Name | Type | Description |
|
|
74
|
+
| :------ | :------ | :------ |
|
|
75
|
+
| `uri` | `string` | URI string. |
|
|
76
|
+
|
|
77
|
+
#### Returns
|
|
78
|
+
|
|
79
|
+
`undefined` \| `string`
|
|
80
|
+
|
|
81
|
+
#### Defined in
|
|
82
|
+
|
|
83
|
+
[plugins/compiler/types.ts:40](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/plugins/compiler/types.ts#L40)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Interface: HmrDelegate
|
|
2
|
+
|
|
3
|
+
Delegate with implementation for HMR-specific functions.
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Methods
|
|
8
|
+
|
|
9
|
+
- [getUriPath](HmrDelegate.md#geturipath)
|
|
10
|
+
- [onClientConnected](HmrDelegate.md#onclientconnected)
|
|
11
|
+
|
|
12
|
+
## Methods
|
|
13
|
+
|
|
14
|
+
### getUriPath
|
|
15
|
+
|
|
16
|
+
▸ **getUriPath**(): `string`
|
|
17
|
+
|
|
18
|
+
Get URI under which HMR server will be running, e.g: `/hmr`
|
|
19
|
+
|
|
20
|
+
#### Returns
|
|
21
|
+
|
|
22
|
+
`string`
|
|
23
|
+
|
|
24
|
+
#### Defined in
|
|
25
|
+
|
|
26
|
+
[plugins/wss/types.ts:6](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/plugins/wss/types.ts#L6)
|
|
27
|
+
|
|
28
|
+
___
|
|
29
|
+
|
|
30
|
+
### onClientConnected
|
|
31
|
+
|
|
32
|
+
▸ **onClientConnected**(`platform`, `clientId`): `void`
|
|
33
|
+
|
|
34
|
+
Callback for when the new HMR client is connected.
|
|
35
|
+
|
|
36
|
+
Useful for running initial synchronization or any other side effect.
|
|
37
|
+
|
|
38
|
+
#### Parameters
|
|
39
|
+
|
|
40
|
+
| Name | Type | Description |
|
|
41
|
+
| :------ | :------ | :------ |
|
|
42
|
+
| `platform` | `string` | Platform of the connected client. |
|
|
43
|
+
| `clientId` | `string` | Id of the connected client. |
|
|
44
|
+
|
|
45
|
+
#### Returns
|
|
46
|
+
|
|
47
|
+
`void`
|
|
48
|
+
|
|
49
|
+
#### Defined in
|
|
50
|
+
|
|
51
|
+
[plugins/wss/types.ts:16](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/plugins/wss/types.ts#L16)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Interface: InputStackFrame
|
|
2
|
+
|
|
3
|
+
React Native stack frame used as input when processing by {@link Symbolicator}.
|
|
4
|
+
|
|
5
|
+
## Hierarchy
|
|
6
|
+
|
|
7
|
+
- [`ReactNativeStackFrame`](ReactNativeStackFrame.md)
|
|
8
|
+
|
|
9
|
+
↳ **`InputStackFrame`**
|
|
10
|
+
|
|
11
|
+
↳↳ [`StackFrame`](StackFrame.md)
|
|
12
|
+
|
|
13
|
+
## Table of contents
|
|
14
|
+
|
|
15
|
+
### Properties
|
|
16
|
+
|
|
17
|
+
- [column](InputStackFrame.md#column)
|
|
18
|
+
- [file](InputStackFrame.md#file)
|
|
19
|
+
- [lineNumber](InputStackFrame.md#linenumber)
|
|
20
|
+
- [methodName](InputStackFrame.md#methodname)
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
### column
|
|
25
|
+
|
|
26
|
+
• **column**: ``null`` \| `number`
|
|
27
|
+
|
|
28
|
+
#### Inherited from
|
|
29
|
+
|
|
30
|
+
[ReactNativeStackFrame](ReactNativeStackFrame.md).[column](ReactNativeStackFrame.md#column)
|
|
31
|
+
|
|
32
|
+
#### Defined in
|
|
33
|
+
|
|
34
|
+
[plugins/symbolicate/types.ts:6](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/plugins/symbolicate/types.ts#L6)
|
|
35
|
+
|
|
36
|
+
___
|
|
37
|
+
|
|
38
|
+
### file
|
|
39
|
+
|
|
40
|
+
• **file**: `string`
|
|
41
|
+
|
|
42
|
+
#### Overrides
|
|
43
|
+
|
|
44
|
+
[ReactNativeStackFrame](ReactNativeStackFrame.md).[file](ReactNativeStackFrame.md#file)
|
|
45
|
+
|
|
46
|
+
#### Defined in
|
|
47
|
+
|
|
48
|
+
[plugins/symbolicate/types.ts:15](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/plugins/symbolicate/types.ts#L15)
|
|
49
|
+
|
|
50
|
+
___
|
|
51
|
+
|
|
52
|
+
### lineNumber
|
|
53
|
+
|
|
54
|
+
• **lineNumber**: ``null`` \| `number`
|
|
55
|
+
|
|
56
|
+
#### Inherited from
|
|
57
|
+
|
|
58
|
+
[ReactNativeStackFrame](ReactNativeStackFrame.md).[lineNumber](ReactNativeStackFrame.md#linenumber)
|
|
59
|
+
|
|
60
|
+
#### Defined in
|
|
61
|
+
|
|
62
|
+
[plugins/symbolicate/types.ts:5](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/plugins/symbolicate/types.ts#L5)
|
|
63
|
+
|
|
64
|
+
___
|
|
65
|
+
|
|
66
|
+
### methodName
|
|
67
|
+
|
|
68
|
+
• **methodName**: `string`
|
|
69
|
+
|
|
70
|
+
#### Inherited from
|
|
71
|
+
|
|
72
|
+
[ReactNativeStackFrame](ReactNativeStackFrame.md).[methodName](ReactNativeStackFrame.md#methodname)
|
|
73
|
+
|
|
74
|
+
#### Defined in
|
|
75
|
+
|
|
76
|
+
[plugins/symbolicate/types.ts:8](https://github.com/callstack/repack/blob/a067171/packages/dev-server/src/plugins/symbolicate/types.ts#L8)
|