@lowdefy/server-dev 4.0.0-alpha.6 → 4.0.0-alpha.9

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.
Files changed (49) hide show
  1. package/next.config.js +6 -4
  2. package/package.json +36 -36
  3. package/src/components/App.js +0 -55
  4. package/src/components/Context.js +0 -62
  5. package/src/components/Head.js +0 -28
  6. package/src/components/LowdefyContext.js +0 -50
  7. package/src/components/Page.js +0 -54
  8. package/src/components/Reload.js +0 -43
  9. package/src/components/block/Block.js +0 -57
  10. package/src/components/block/CategorySwitch.js +0 -120
  11. package/src/components/block/Container.js +0 -87
  12. package/src/components/block/List.js +0 -94
  13. package/src/components/block/LoadingBlock.js +0 -22
  14. package/src/components/block/MountEvents.js +0 -46
  15. package/src/components/components.js +0 -25
  16. package/src/manager/BatchChanges.mjs +0 -66
  17. package/src/manager/getContext.mjs +0 -64
  18. package/src/manager/initialBuild.mjs +0 -24
  19. package/src/manager/processes/installPlugins.mjs +0 -36
  20. package/src/manager/processes/lowdefyBuild.mjs +0 -38
  21. package/src/manager/processes/nextBuild.mjs +0 -31
  22. package/src/manager/processes/reloadClients.mjs +0 -26
  23. package/src/manager/processes/startServer.mjs +0 -31
  24. package/src/manager/processes/startServerProcess.mjs +0 -34
  25. package/src/manager/run.mjs +0 -41
  26. package/src/manager/spawnProcess.mjs +0 -55
  27. package/src/manager/watchers/configWatcher.mjs +0 -28
  28. package/src/manager/watchers/envWatcher.mjs +0 -32
  29. package/src/manager/watchers/setupWatcher.mjs +0 -43
  30. package/src/manager/watchers/startWatchers.mjs +0 -64
  31. package/src/pages/404.js +0 -19
  32. package/src/pages/[pageId].js +0 -19
  33. package/src/pages/_app.js +0 -37
  34. package/src/pages/_document.js +0 -38
  35. package/src/pages/api/auth/[...nextauth].js +0 -28
  36. package/src/pages/api/page/[pageId].js +0 -29
  37. package/src/pages/api/ping.js +0 -19
  38. package/src/pages/api/reload.js +0 -52
  39. package/src/pages/api/request/[pageId]/[requestId].js +0 -44
  40. package/src/pages/api/root.js +0 -25
  41. package/src/pages/index.js +0 -19
  42. package/src/utils/callRequest.js +0 -27
  43. package/src/utils/request.js +0 -36
  44. package/src/utils/setPageId.js +0 -33
  45. package/src/utils/setupLink.js +0 -44
  46. package/src/utils/useMutateCache.js +0 -34
  47. package/src/utils/usePageConfig.js +0 -32
  48. package/src/utils/useRootConfig.js +0 -29
  49. package/src/utils/waitForRestartedServer.js +0 -32
@@ -1,32 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
- http://www.apache.org/licenses/LICENSE-2.0
7
- Unless required by applicable law or agreed to in writing, software
8
- distributed under the License is distributed on an "AS IS" BASIS,
9
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- See the License for the specific language governing permissions and
11
- limitations under the License.
12
- */
13
-
14
- import useSWR from 'swr';
15
-
16
- import request from './request.js';
17
-
18
- // TODO: Handle TokenExpiredError
19
-
20
- function fetchPageConfig(url) {
21
- return request({ url });
22
- }
23
-
24
- function usePageConfig(pageId) {
25
- if (!pageId) {
26
- pageId = 'NULL';
27
- }
28
- const { data } = useSWR(`/api/page/${pageId}`, fetchPageConfig, { suspense: true });
29
- return { data };
30
- }
31
-
32
- export default usePageConfig;
@@ -1,29 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
- http://www.apache.org/licenses/LICENSE-2.0
7
- Unless required by applicable law or agreed to in writing, software
8
- distributed under the License is distributed on an "AS IS" BASIS,
9
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- See the License for the specific language governing permissions and
11
- limitations under the License.
12
- */
13
-
14
- import useSWR from 'swr';
15
-
16
- import request from './request.js';
17
-
18
- // TODO: Handle TokenExpiredError
19
-
20
- function fetchRootConfig() {
21
- return request({ url: '/api/root' });
22
- }
23
-
24
- function useRootConfig() {
25
- const { data } = useSWR('root', fetchRootConfig, { suspense: true });
26
- return { data };
27
- }
28
-
29
- export default useRootConfig;
@@ -1,32 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */
16
-
17
- import request from './request.js';
18
-
19
- function waitForRestartedServer(lowdefy) {
20
- setTimeout(async () => {
21
- try {
22
- await request({
23
- url: '/api/ping',
24
- });
25
- lowdefy._internal.window.location.reload();
26
- } catch (error) {
27
- waitForRestartedServer(lowdefy);
28
- }
29
- }, 1500);
30
- }
31
-
32
- export default waitForRestartedServer;