@things-factory/shell 8.0.0-alpha.19 → 8.0.0-alpha.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/shell",
3
- "version": "8.0.0-alpha.19",
3
+ "version": "8.0.0-alpha.22",
4
4
  "description": "Core module for framework",
5
5
  "bin": {
6
6
  "things-factory": "bin/things-factory",
@@ -42,7 +42,6 @@
42
42
  "@graphql-tools/schema": "^8.5.0",
43
43
  "@graphql-tools/utils": "^10.1.2",
44
44
  "@graphql-yoga/redis-event-target": "^3.0.1",
45
- "@hatiolab/koa-webpack": "^7.0.9",
46
45
  "@hatiolab/things-scene": "^8.0.0-alpha",
47
46
  "@koa/cors": "^5.0.0",
48
47
  "@material-design-icons/font": "^0.14.9",
@@ -123,6 +122,7 @@
123
122
  "uuid": "^10.0.0",
124
123
  "web-animations-js": "^2.3.2",
125
124
  "web-push": "^3.5.0",
125
+ "webpack-dev-middleware": "^7.4.2",
126
126
  "ws": "^8.8.1"
127
127
  },
128
128
  "optionalDependencies": {
@@ -133,5 +133,5 @@
133
133
  "pg": "^8.7.3",
134
134
  "sqlite3": "^5.0.8"
135
135
  },
136
- "gitHead": "9519b20f754d4e3cf0d21cf65660af7a4f50c4e0"
136
+ "gitHead": "27cd29ef5f60c8fc8a177dd52eb0f4979b463991"
137
137
  }
@@ -26,7 +26,6 @@ import { WebSocketServer } from 'ws'
26
26
  import co from 'co'
27
27
  import http from 'http'
28
28
 
29
- import koaWebpack from '@hatiolab/koa-webpack'
30
29
  import cors from '@koa/cors'
31
30
 
32
31
  import crypto from 'crypto'
@@ -47,6 +46,7 @@ import { schema } from './schema'
47
46
  import { Domain } from './service'
48
47
  import { EntityManager } from 'typeorm'
49
48
  import { domainMiddleware } from './middlewares'
49
+ const wdm = require('webpack-dev-middleware')
50
50
 
51
51
  process.on('uncaughtException', error => {
52
52
  logger.error('uncaughtException: ', error)
@@ -244,19 +244,11 @@ const bootstrap = async () => {
244
244
  debug: false
245
245
  })
246
246
 
247
- const middleware = await koaWebpack({
248
- compiler,
249
- hotClient: {},
250
- devMiddleware: {
251
- publicPath: webpackConfig.output.publicPath,
252
- stats: { colors: true }
253
- }
254
- })
255
-
256
- // only for development mode. triggered after webpack compilation is done.
257
- compiler.hooks.done.tap({ name: 'server-dev' }, stats => {
258
- process.emit('client-rebuilt' as any, app, compiler.outputFileSystem)
259
- })
247
+ const middleware =
248
+ // only for development mode. triggered after webpack compilation is done.
249
+ compiler.hooks.done.tap({ name: 'server-dev' }, stats => {
250
+ process.emit('client-rebuilt' as any, app, compiler.outputFileSystem)
251
+ })
260
252
 
261
253
  app.use(koaBodyParser(bodyParserOption))
262
254
 
@@ -297,7 +289,11 @@ const bootstrap = async () => {
297
289
  /* should follow this order : history-fallback => webpack-middleware */
298
290
  app.use(historyApiFallback({ whiteList: [] }))
299
291
 
300
- app.use(middleware)
292
+ app.use(
293
+ wdm.koaWrapper(compiler, {
294
+ publicPath: webpackConfig.output.publicPath
295
+ })
296
+ )
301
297
 
302
298
  httpServer.listen({ port: PORT }, () => {
303
299
  logger.info(`🚀 Server ready at http://0.0.0.0:${PORT}/graphql`)