@things-factory/shell 7.0.1-alpha.10 → 7.0.1-alpha.13
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-server/server-dev.js +1 -5
- package/dist-server/server-dev.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/typeorm/round-transform.js +1 -1
- package/dist-server/typeorm/round-transform.js.map +1 -1
- package/package.json +2 -2
- package/server/server-dev.ts +1 -8
@@ -10,7 +10,7 @@ exports.roundTransformer = {
|
|
10
10
|
* @param {number | null} value - Floating point value to round or null
|
11
11
|
* @returns {number | null} - Rounded number or null
|
12
12
|
*/
|
13
|
-
to: (value) => (value !== null && !isNaN(value) ? Math.round(value *
|
13
|
+
to: (value) => (value !== null && !isNaN(value) ? Math.round(value * 10000) / 10000 : undefined),
|
14
14
|
/**
|
15
15
|
* Returns the entity field value as it is without any transformation when reading from the database.
|
16
16
|
* @param {number} value - Number value read from the database
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"round-transform.js","sourceRoot":"","sources":["../../server/typeorm/round-transform.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACU,QAAA,gBAAgB,GAAqB;IAChD;;;;OAIG;IACH,EAAE,EAAE,CAAC,KAAoB,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,
|
1
|
+
{"version":3,"file":"round-transform.js","sourceRoot":"","sources":["../../server/typeorm/round-transform.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACU,QAAA,gBAAgB,GAAqB;IAChD;;;;OAIG;IACH,EAAE,EAAE,CAAC,KAAoB,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAE/G;;;;OAIG;IACH,IAAI,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK;CAC/B,CAAA","sourcesContent":["import { ValueTransformer } from 'typeorm'\n\n/**\n * ValueTransformer object for rounding floating point values.\n */\nexport const roundTransformer: ValueTransformer = {\n /**\n * Rounds the entity field value before storing it in the database.\n * @param {number | null} value - Floating point value to round or null\n * @returns {number | null} - Rounded number or null\n */\n to: (value: number | null) => (value !== null && !isNaN(value) ? Math.round(value * 10000) / 10000 : undefined),\n\n /**\n * Returns the entity field value as it is without any transformation when reading from the database.\n * @param {number} value - Number value read from the database\n * @returns {number} - The number value as is\n */\n from: (value: number) => value\n}\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/shell",
|
3
|
-
"version": "7.0.1-alpha.
|
3
|
+
"version": "7.0.1-alpha.13",
|
4
4
|
"description": "Core module for framework",
|
5
5
|
"bin": {
|
6
6
|
"things-factory": "bin/things-factory",
|
@@ -133,5 +133,5 @@
|
|
133
133
|
"pg": "^8.7.3",
|
134
134
|
"sqlite3": "^5.0.8"
|
135
135
|
},
|
136
|
-
"gitHead": "
|
136
|
+
"gitHead": "58eaf3ce7403c0722fe948041bad0185e57fdc81"
|
137
137
|
}
|
package/server/server-dev.ts
CHANGED
@@ -20,7 +20,6 @@ import { useServer } from 'graphql-ws/lib/use/ws'
|
|
20
20
|
import { createServer } from 'http'
|
21
21
|
import Koa from 'koa'
|
22
22
|
import koaBodyParser from 'koa-bodyparser'
|
23
|
-
import koaStatic from 'koa-static'
|
24
23
|
import compose from 'koa-compose'
|
25
24
|
import { historyApiFallback } from 'koa2-connect-history-api-fallback'
|
26
25
|
import { WebSocketServer } from 'ws'
|
@@ -269,17 +268,11 @@ const bootstrap = async () => {
|
|
269
268
|
app.use(graphqlRouter.routes())
|
270
269
|
app.use(graphqlRouter.allowedMethods())
|
271
270
|
|
272
|
-
/* should follow this order : history-fallback => webpack-middleware
|
271
|
+
/* should follow this order : history-fallback => webpack-middleware */
|
273
272
|
app.use(historyApiFallback({ whiteList: [] }))
|
274
273
|
|
275
274
|
app.use(middleware)
|
276
275
|
|
277
|
-
app.use(
|
278
|
-
koaStatic(compiler.outputPath, {
|
279
|
-
index: false
|
280
|
-
})
|
281
|
-
)
|
282
|
-
|
283
276
|
httpServer.listen({ port: PORT }, () => {
|
284
277
|
logger.info(`🚀 Server ready at http://0.0.0.0:${PORT}/graphql`)
|
285
278
|
logger.info(`🚀 Subscriptions ready at ws://0.0.0.0:${PORT}/graphql`)
|