@lowdefy/server-dev 4.0.0-alpha.16 → 4.0.0-alpha.19

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.
@@ -16,7 +16,10 @@
16
16
 
17
17
  import request from './request.js';
18
18
 
19
+ const MAX_COUNT = 1200; // 10 mins
20
+
19
21
  function waitForRestartedServer(basePath) {
22
+ let count = 0;
20
23
  setTimeout(async () => {
21
24
  try {
22
25
  await request({
@@ -24,7 +27,10 @@ function waitForRestartedServer(basePath) {
24
27
  });
25
28
  window.location.reload();
26
29
  } catch (error) {
27
- waitForRestartedServer(basePath);
30
+ count += 1;
31
+ if (count <= MAX_COUNT) {
32
+ waitForRestartedServer(basePath);
33
+ }
28
34
  }
29
35
  }, 500); // TODO: this ping should be shorter than rerender delay until we can pass a rebuild flag to reload.
30
36
  }
package/manager/run.mjs CHANGED
@@ -81,6 +81,7 @@ async function run() {
81
81
  const serverPromise = startServer(context);
82
82
  await wait(800);
83
83
  if (process.env.LOWDEFY_SERVER_DEV_OPEN_BROWSER === 'true') {
84
+ // TODO: Wait 1 sec for a ping and don't open if a ping is seen
84
85
  opener(`http://localhost:${context.options.port}`);
85
86
  }
86
87
  await serverPromise;
package/next.config.js CHANGED
@@ -24,7 +24,7 @@ module.exports = withLess({
24
24
  }
25
25
  return config;
26
26
  },
27
- swcMinify: true,
27
+ swcMinify: false,
28
28
  compress: false,
29
29
  outputFileTracing: false,
30
30
  poweredByHeader: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-dev",
3
- "version": "4.0.0-alpha.16",
3
+ "version": "4.0.0-alpha.19",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -39,33 +39,33 @@
39
39
  "next": "next"
40
40
  },
41
41
  "dependencies": {
42
- "@lowdefy/actions-core": "4.0.0-alpha.16",
43
- "@lowdefy/api": "4.0.0-alpha.16",
44
- "@lowdefy/blocks-antd": "4.0.0-alpha.16",
45
- "@lowdefy/blocks-basic": "4.0.0-alpha.16",
46
- "@lowdefy/blocks-color-selectors": "4.0.0-alpha.16",
47
- "@lowdefy/blocks-echarts": "4.0.0-alpha.16",
48
- "@lowdefy/blocks-loaders": "4.0.0-alpha.16",
49
- "@lowdefy/blocks-markdown": "4.0.0-alpha.16",
50
- "@lowdefy/build": "4.0.0-alpha.16",
51
- "@lowdefy/client": "4.0.0-alpha.16",
52
- "@lowdefy/connection-axios-http": "4.0.0-alpha.16",
53
- "@lowdefy/engine": "4.0.0-alpha.16",
54
- "@lowdefy/helpers": "4.0.0-alpha.16",
55
- "@lowdefy/layout": "4.0.0-alpha.16",
56
- "@lowdefy/node-utils": "4.0.0-alpha.16",
57
- "@lowdefy/operators-change-case": "4.0.0-alpha.16",
58
- "@lowdefy/operators-diff": "4.0.0-alpha.16",
59
- "@lowdefy/operators-js": "4.0.0-alpha.16",
60
- "@lowdefy/operators-mql": "4.0.0-alpha.16",
61
- "@lowdefy/operators-nunjucks": "4.0.0-alpha.16",
62
- "@lowdefy/operators-uuid": "4.0.0-alpha.16",
63
- "@lowdefy/operators-yaml": "4.0.0-alpha.16",
64
- "@lowdefy/plugin-next-auth": "4.0.0-alpha.16",
42
+ "@lowdefy/actions-core": "4.0.0-alpha.19",
43
+ "@lowdefy/api": "4.0.0-alpha.19",
44
+ "@lowdefy/blocks-antd": "4.0.0-alpha.19",
45
+ "@lowdefy/blocks-basic": "4.0.0-alpha.19",
46
+ "@lowdefy/blocks-color-selectors": "4.0.0-alpha.19",
47
+ "@lowdefy/blocks-echarts": "4.0.0-alpha.19",
48
+ "@lowdefy/blocks-loaders": "4.0.0-alpha.19",
49
+ "@lowdefy/blocks-markdown": "4.0.0-alpha.19",
50
+ "@lowdefy/build": "4.0.0-alpha.19",
51
+ "@lowdefy/client": "4.0.0-alpha.19",
52
+ "@lowdefy/connection-axios-http": "4.0.0-alpha.19",
53
+ "@lowdefy/engine": "4.0.0-alpha.19",
54
+ "@lowdefy/helpers": "4.0.0-alpha.19",
55
+ "@lowdefy/layout": "4.0.0-alpha.19",
56
+ "@lowdefy/node-utils": "4.0.0-alpha.19",
57
+ "@lowdefy/operators-change-case": "4.0.0-alpha.19",
58
+ "@lowdefy/operators-diff": "4.0.0-alpha.19",
59
+ "@lowdefy/operators-js": "4.0.0-alpha.19",
60
+ "@lowdefy/operators-mql": "4.0.0-alpha.19",
61
+ "@lowdefy/operators-nunjucks": "4.0.0-alpha.19",
62
+ "@lowdefy/operators-uuid": "4.0.0-alpha.19",
63
+ "@lowdefy/operators-yaml": "4.0.0-alpha.19",
64
+ "@lowdefy/plugin-next-auth": "4.0.0-alpha.19",
65
65
  "chokidar": "3.5.3",
66
66
  "dotenv": "16.0.1",
67
67
  "next": "12.1.6",
68
- "next-auth": "4.3.4",
68
+ "next-auth": "4.5.0",
69
69
  "opener": "1.5.2",
70
70
  "process": "0.11.10",
71
71
  "react": "18.1.0",
@@ -84,5 +84,5 @@
84
84
  "publishConfig": {
85
85
  "access": "public"
86
86
  },
87
- "gitHead": "91459befdeb9b22aaba40e8c51d6a173a11ea939"
87
+ "gitHead": "5240a074f7225295a8c92aaf0236b7680c296b57"
88
88
  }
@@ -22,4 +22,20 @@ import callbacks from '../../../build/plugins/auth/callbacks.js';
22
22
  import events from '../../../build/plugins/auth/events.js';
23
23
  import providers from '../../../build/plugins/auth/providers.js';
24
24
 
25
- export default NextAuth(getNextAuthConfig({ authJson, plugins: { callbacks, events, providers } }));
25
+ // TODO: make createApiContext synchronous
26
+ export default async function auth(req, res) {
27
+ if (authJson.configured === true) {
28
+ return await NextAuth(
29
+ req,
30
+ res,
31
+ getNextAuthConfig(
32
+ { logger: console },
33
+ { authJson, plugins: { callbacks, events, providers } }
34
+ )
35
+ );
36
+ }
37
+
38
+ return res.status(404).json({
39
+ message: 'Auth not configured',
40
+ });
41
+ }