@lowdefy/server-dev 4.0.0-rc.4 → 4.0.0-rc.6
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.
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { getServerSession as getNextAuthServerSession } from 'next-auth/next';
|
|
18
18
|
import { authOptions } from '../../pages/api/auth/[...nextauth].js';
|
|
19
19
|
import authJson from '../../build/auth.json';
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
function getServerSession({ req, res }) {
|
|
22
22
|
if (authJson.configured === true) {
|
|
23
|
-
return
|
|
23
|
+
return getNextAuthServerSession(req, res, authOptions);
|
|
24
24
|
}
|
|
25
25
|
return undefined;
|
|
26
26
|
}
|
|
@@ -19,6 +19,7 @@ import createCustomPluginTypesMap from '../utils/createCustomPluginTypesMap.mjs'
|
|
|
19
19
|
|
|
20
20
|
function lowdefyBuild({ directories, logger, options }) {
|
|
21
21
|
return async () => {
|
|
22
|
+
logger.info({ print: 'spin' }, 'Building config...');
|
|
22
23
|
const customTypesMap = await createCustomPluginTypesMap({ directories, logger });
|
|
23
24
|
await build({
|
|
24
25
|
customTypesMap,
|
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
import crypto from 'crypto';
|
|
18
18
|
import path from 'path';
|
|
19
19
|
import { readFile } from '@lowdefy/node-utils';
|
|
20
|
+
import { type } from '@lowdefy/helpers';
|
|
20
21
|
import setupWatcher from '../utils/setupWatcher.mjs';
|
|
21
22
|
|
|
22
23
|
const hashes = {};
|
|
23
24
|
|
|
24
|
-
const
|
|
25
|
+
const trackedFiles = [
|
|
25
26
|
'build/app.json',
|
|
26
27
|
'build/auth.json',
|
|
27
28
|
'build/config.json',
|
|
@@ -41,7 +42,16 @@ const watchedFiles = [
|
|
|
41
42
|
];
|
|
42
43
|
|
|
43
44
|
async function sha1(filePath) {
|
|
44
|
-
|
|
45
|
+
let content = await readFile(filePath);
|
|
46
|
+
if (filePath.endsWith('.json')) {
|
|
47
|
+
content = JSON.stringify(
|
|
48
|
+
JSON.parse(content, (_, value) => {
|
|
49
|
+
if (!type.isObject(value)) return value;
|
|
50
|
+
delete value._k_;
|
|
51
|
+
return value;
|
|
52
|
+
})
|
|
53
|
+
);
|
|
54
|
+
}
|
|
45
55
|
return crypto
|
|
46
56
|
.createHash('sha1')
|
|
47
57
|
.update(content || '')
|
|
@@ -52,17 +62,16 @@ async function nextBuildWatcher(context) {
|
|
|
52
62
|
// Initialize hashes so that app does not rebuild the first time
|
|
53
63
|
// Lowdefy build is run.
|
|
54
64
|
await Promise.all(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
hashes[fullPath] = await sha1(fullPath);
|
|
65
|
+
trackedFiles.map(async (filePath) => {
|
|
66
|
+
hashes[filePath] = await sha1(filePath);
|
|
58
67
|
})
|
|
59
68
|
);
|
|
60
69
|
|
|
61
|
-
const callback = async (
|
|
70
|
+
const callback = async () => {
|
|
62
71
|
let install = false;
|
|
63
72
|
let build = false;
|
|
64
73
|
await Promise.all(
|
|
65
|
-
|
|
74
|
+
trackedFiles.map(async (filePath) => {
|
|
66
75
|
const hash = await sha1(filePath);
|
|
67
76
|
if (hashes[filePath] === hash) {
|
|
68
77
|
return;
|
|
@@ -74,7 +83,6 @@ async function nextBuildWatcher(context) {
|
|
|
74
83
|
hashes[filePath] = hash;
|
|
75
84
|
})
|
|
76
85
|
);
|
|
77
|
-
|
|
78
86
|
if (!build) {
|
|
79
87
|
context.logger.info({ print: 'succeed' }, 'Reloaded app.');
|
|
80
88
|
return;
|
|
@@ -82,6 +90,7 @@ async function nextBuildWatcher(context) {
|
|
|
82
90
|
|
|
83
91
|
context.shutdownServer();
|
|
84
92
|
if (install) {
|
|
93
|
+
context.logger.warn('Plugin dependencies have changed and will be reinstalled.');
|
|
85
94
|
await context.installPlugins();
|
|
86
95
|
}
|
|
87
96
|
await context.nextBuild();
|
|
@@ -92,7 +101,7 @@ async function nextBuildWatcher(context) {
|
|
|
92
101
|
callback,
|
|
93
102
|
context,
|
|
94
103
|
watchDotfiles: true,
|
|
95
|
-
watchPaths:
|
|
104
|
+
watchPaths: [path.join(context.directories.server, 'package.json')],
|
|
96
105
|
});
|
|
97
106
|
}
|
|
98
107
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-dev",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -42,34 +42,34 @@
|
|
|
42
42
|
"next": "next"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@lowdefy/actions-core": "4.0.0-rc.
|
|
46
|
-
"@lowdefy/api": "4.0.0-rc.
|
|
47
|
-
"@lowdefy/blocks-antd": "4.0.0-rc.
|
|
48
|
-
"@lowdefy/blocks-basic": "4.0.0-rc.
|
|
49
|
-
"@lowdefy/blocks-color-selectors": "4.0.0-rc.
|
|
50
|
-
"@lowdefy/blocks-echarts": "4.0.0-rc.
|
|
51
|
-
"@lowdefy/blocks-loaders": "4.0.0-rc.
|
|
52
|
-
"@lowdefy/blocks-markdown": "4.0.0-rc.
|
|
53
|
-
"@lowdefy/blocks-qr": "4.0.0-rc.
|
|
54
|
-
"@lowdefy/build": "4.0.0-rc.
|
|
55
|
-
"@lowdefy/client": "4.0.0-rc.
|
|
56
|
-
"@lowdefy/connection-axios-http": "4.0.0-rc.
|
|
57
|
-
"@lowdefy/engine": "4.0.0-rc.
|
|
58
|
-
"@lowdefy/helpers": "4.0.0-rc.
|
|
59
|
-
"@lowdefy/layout": "4.0.0-rc.
|
|
60
|
-
"@lowdefy/node-utils": "4.0.0-rc.
|
|
61
|
-
"@lowdefy/operators-change-case": "4.0.0-rc.
|
|
62
|
-
"@lowdefy/operators-diff": "4.0.0-rc.
|
|
63
|
-
"@lowdefy/operators-js": "4.0.0-rc.
|
|
64
|
-
"@lowdefy/operators-mql": "4.0.0-rc.
|
|
65
|
-
"@lowdefy/operators-nunjucks": "4.0.0-rc.
|
|
66
|
-
"@lowdefy/operators-uuid": "4.0.0-rc.
|
|
67
|
-
"@lowdefy/operators-yaml": "4.0.0-rc.
|
|
68
|
-
"@lowdefy/plugin-next-auth": "4.0.0-rc.
|
|
45
|
+
"@lowdefy/actions-core": "4.0.0-rc.6",
|
|
46
|
+
"@lowdefy/api": "4.0.0-rc.6",
|
|
47
|
+
"@lowdefy/blocks-antd": "4.0.0-rc.6",
|
|
48
|
+
"@lowdefy/blocks-basic": "4.0.0-rc.6",
|
|
49
|
+
"@lowdefy/blocks-color-selectors": "4.0.0-rc.6",
|
|
50
|
+
"@lowdefy/blocks-echarts": "4.0.0-rc.6",
|
|
51
|
+
"@lowdefy/blocks-loaders": "4.0.0-rc.6",
|
|
52
|
+
"@lowdefy/blocks-markdown": "4.0.0-rc.6",
|
|
53
|
+
"@lowdefy/blocks-qr": "4.0.0-rc.6",
|
|
54
|
+
"@lowdefy/build": "4.0.0-rc.6",
|
|
55
|
+
"@lowdefy/client": "4.0.0-rc.6",
|
|
56
|
+
"@lowdefy/connection-axios-http": "4.0.0-rc.6",
|
|
57
|
+
"@lowdefy/engine": "4.0.0-rc.6",
|
|
58
|
+
"@lowdefy/helpers": "4.0.0-rc.6",
|
|
59
|
+
"@lowdefy/layout": "4.0.0-rc.6",
|
|
60
|
+
"@lowdefy/node-utils": "4.0.0-rc.6",
|
|
61
|
+
"@lowdefy/operators-change-case": "4.0.0-rc.6",
|
|
62
|
+
"@lowdefy/operators-diff": "4.0.0-rc.6",
|
|
63
|
+
"@lowdefy/operators-js": "4.0.0-rc.6",
|
|
64
|
+
"@lowdefy/operators-mql": "4.0.0-rc.6",
|
|
65
|
+
"@lowdefy/operators-nunjucks": "4.0.0-rc.6",
|
|
66
|
+
"@lowdefy/operators-uuid": "4.0.0-rc.6",
|
|
67
|
+
"@lowdefy/operators-yaml": "4.0.0-rc.6",
|
|
68
|
+
"@lowdefy/plugin-next-auth": "4.0.0-rc.6",
|
|
69
69
|
"chokidar": "3.5.3",
|
|
70
70
|
"dotenv": "16.0.3",
|
|
71
71
|
"next": "12.3.1",
|
|
72
|
-
"next-auth": "4.
|
|
72
|
+
"next-auth": "4.20.1",
|
|
73
73
|
"opener": "1.5.2",
|
|
74
74
|
"pino": "8.8.0",
|
|
75
75
|
"process": "0.11.10",
|
|
@@ -85,11 +85,11 @@
|
|
|
85
85
|
"less": "4.1.3",
|
|
86
86
|
"less-loader": "11.1.0",
|
|
87
87
|
"next-with-less": "2.0.5",
|
|
88
|
-
"webpack": "5.
|
|
88
|
+
"webpack": "5.76.0"
|
|
89
89
|
},
|
|
90
90
|
"packageManager": "pnpm@7.11.0",
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "8238145a9eb26c6f3dc48661ab6eca6e3aca4f83"
|
|
95
95
|
}
|
package/package.original.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-dev",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -42,34 +42,34 @@
|
|
|
42
42
|
"next": "next"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@lowdefy/actions-core": "4.0.0-rc.
|
|
46
|
-
"@lowdefy/api": "4.0.0-rc.
|
|
47
|
-
"@lowdefy/blocks-antd": "4.0.0-rc.
|
|
48
|
-
"@lowdefy/blocks-basic": "4.0.0-rc.
|
|
49
|
-
"@lowdefy/blocks-color-selectors": "4.0.0-rc.
|
|
50
|
-
"@lowdefy/blocks-echarts": "4.0.0-rc.
|
|
51
|
-
"@lowdefy/blocks-loaders": "4.0.0-rc.
|
|
52
|
-
"@lowdefy/blocks-markdown": "4.0.0-rc.
|
|
53
|
-
"@lowdefy/blocks-qr": "4.0.0-rc.
|
|
54
|
-
"@lowdefy/build": "4.0.0-rc.
|
|
55
|
-
"@lowdefy/client": "4.0.0-rc.
|
|
56
|
-
"@lowdefy/connection-axios-http": "4.0.0-rc.
|
|
57
|
-
"@lowdefy/engine": "4.0.0-rc.
|
|
58
|
-
"@lowdefy/helpers": "4.0.0-rc.
|
|
59
|
-
"@lowdefy/layout": "4.0.0-rc.
|
|
60
|
-
"@lowdefy/node-utils": "4.0.0-rc.
|
|
61
|
-
"@lowdefy/operators-change-case": "4.0.0-rc.
|
|
62
|
-
"@lowdefy/operators-diff": "4.0.0-rc.
|
|
63
|
-
"@lowdefy/operators-js": "4.0.0-rc.
|
|
64
|
-
"@lowdefy/operators-mql": "4.0.0-rc.
|
|
65
|
-
"@lowdefy/operators-nunjucks": "4.0.0-rc.
|
|
66
|
-
"@lowdefy/operators-uuid": "4.0.0-rc.
|
|
67
|
-
"@lowdefy/operators-yaml": "4.0.0-rc.
|
|
68
|
-
"@lowdefy/plugin-next-auth": "4.0.0-rc.
|
|
45
|
+
"@lowdefy/actions-core": "4.0.0-rc.6",
|
|
46
|
+
"@lowdefy/api": "4.0.0-rc.6",
|
|
47
|
+
"@lowdefy/blocks-antd": "4.0.0-rc.6",
|
|
48
|
+
"@lowdefy/blocks-basic": "4.0.0-rc.6",
|
|
49
|
+
"@lowdefy/blocks-color-selectors": "4.0.0-rc.6",
|
|
50
|
+
"@lowdefy/blocks-echarts": "4.0.0-rc.6",
|
|
51
|
+
"@lowdefy/blocks-loaders": "4.0.0-rc.6",
|
|
52
|
+
"@lowdefy/blocks-markdown": "4.0.0-rc.6",
|
|
53
|
+
"@lowdefy/blocks-qr": "4.0.0-rc.6",
|
|
54
|
+
"@lowdefy/build": "4.0.0-rc.6",
|
|
55
|
+
"@lowdefy/client": "4.0.0-rc.6",
|
|
56
|
+
"@lowdefy/connection-axios-http": "4.0.0-rc.6",
|
|
57
|
+
"@lowdefy/engine": "4.0.0-rc.6",
|
|
58
|
+
"@lowdefy/helpers": "4.0.0-rc.6",
|
|
59
|
+
"@lowdefy/layout": "4.0.0-rc.6",
|
|
60
|
+
"@lowdefy/node-utils": "4.0.0-rc.6",
|
|
61
|
+
"@lowdefy/operators-change-case": "4.0.0-rc.6",
|
|
62
|
+
"@lowdefy/operators-diff": "4.0.0-rc.6",
|
|
63
|
+
"@lowdefy/operators-js": "4.0.0-rc.6",
|
|
64
|
+
"@lowdefy/operators-mql": "4.0.0-rc.6",
|
|
65
|
+
"@lowdefy/operators-nunjucks": "4.0.0-rc.6",
|
|
66
|
+
"@lowdefy/operators-uuid": "4.0.0-rc.6",
|
|
67
|
+
"@lowdefy/operators-yaml": "4.0.0-rc.6",
|
|
68
|
+
"@lowdefy/plugin-next-auth": "4.0.0-rc.6",
|
|
69
69
|
"chokidar": "3.5.3",
|
|
70
70
|
"dotenv": "16.0.3",
|
|
71
71
|
"next": "12.3.1",
|
|
72
|
-
"next-auth": "4.
|
|
72
|
+
"next-auth": "4.20.1",
|
|
73
73
|
"opener": "1.5.2",
|
|
74
74
|
"pino": "8.8.0",
|
|
75
75
|
"process": "0.11.10",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"less": "4.1.3",
|
|
86
86
|
"less-loader": "11.1.0",
|
|
87
87
|
"next-with-less": "2.0.5",
|
|
88
|
-
"webpack": "5.
|
|
88
|
+
"webpack": "5.76.0"
|
|
89
89
|
},
|
|
90
90
|
"packageManager": "pnpm@7.11.0",
|
|
91
91
|
"publishConfig": {
|