@lowdefy/server 4.7.2 → 5.0.0
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/lib/client/Page.js +2 -0
- package/lowdefy/createCustomPluginTypesMap.mjs +6 -6
- package/next.config.js +5 -22
- package/package.json +28 -29
- package/package.original.json +28 -29
- package/pages/_app.js +60 -20
- package/pages/_document.js +12 -1
- package/postcss.config.js +1 -0
package/lib/client/Page.js
CHANGED
|
@@ -22,6 +22,7 @@ import Head from 'next/head';
|
|
|
22
22
|
import Link from 'next/link';
|
|
23
23
|
|
|
24
24
|
import actions from '../../build/plugins/actions.js';
|
|
25
|
+
import blockMetas from '../../build/plugins/blockMetas.json';
|
|
25
26
|
import blocks from '../../build/plugins/blocks.js';
|
|
26
27
|
import icons from '../../build/plugins/icons.js';
|
|
27
28
|
import operators from '../../build/plugins/operators/client.js';
|
|
@@ -42,6 +43,7 @@ const Page = ({ auth, lowdefy, pageConfig, rootConfig }) => {
|
|
|
42
43
|
router={router}
|
|
43
44
|
types={{
|
|
44
45
|
actions,
|
|
46
|
+
blockMetas,
|
|
45
47
|
blocks,
|
|
46
48
|
icons,
|
|
47
49
|
operators,
|
|
@@ -15,12 +15,15 @@
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
import { createRequire } from 'node:module';
|
|
18
19
|
import path from 'path';
|
|
19
20
|
import { get } from '@lowdefy/helpers';
|
|
20
21
|
import { readFile } from '@lowdefy/node-utils';
|
|
21
22
|
import { createPluginTypesMap } from '@lowdefy/build';
|
|
22
23
|
import YAML from 'yaml';
|
|
23
24
|
|
|
25
|
+
const require = createRequire(import.meta.url);
|
|
26
|
+
|
|
24
27
|
async function getPluginDefinitions({ directories }) {
|
|
25
28
|
let lowdefyYaml = await readFile(path.join(directories.config, 'lowdefy.yaml'));
|
|
26
29
|
if (!lowdefyYaml) {
|
|
@@ -42,6 +45,7 @@ async function createCustomPluginTypesMap({ directories }) {
|
|
|
42
45
|
events: {},
|
|
43
46
|
providers: {},
|
|
44
47
|
},
|
|
48
|
+
blockMetas: {},
|
|
45
49
|
blocks: {},
|
|
46
50
|
connections: {},
|
|
47
51
|
icons: {},
|
|
@@ -50,18 +54,14 @@ async function createCustomPluginTypesMap({ directories }) {
|
|
|
50
54
|
server: {},
|
|
51
55
|
},
|
|
52
56
|
requests: {},
|
|
53
|
-
styles: {
|
|
54
|
-
packages: {},
|
|
55
|
-
blocks: {},
|
|
56
|
-
},
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
const pluginDefinitions = await getPluginDefinitions({ directories });
|
|
60
60
|
|
|
61
61
|
for (const plugin of pluginDefinitions) {
|
|
62
|
-
const
|
|
62
|
+
const types = require(`${plugin.name}/types`);
|
|
63
63
|
createPluginTypesMap({
|
|
64
|
-
packageTypes: types,
|
|
64
|
+
packageTypes: types.default ?? types,
|
|
65
65
|
typesMap: customTypesMap,
|
|
66
66
|
packageName: plugin.name,
|
|
67
67
|
version: plugin.version,
|
package/next.config.js
CHANGED
|
@@ -1,33 +1,16 @@
|
|
|
1
1
|
const { withSentryConfig } = require('@sentry/nextjs');
|
|
2
|
-
const withLess = require('next-with-less');
|
|
3
2
|
const lowdefyConfig = require('./build/config.json');
|
|
3
|
+
const blockPackages = require('./build/blockPackages.json');
|
|
4
4
|
|
|
5
|
-
const nextConfig =
|
|
5
|
+
const nextConfig = {
|
|
6
6
|
basePath: lowdefyConfig.basePath,
|
|
7
7
|
reactStrictMode: true,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
config.resolve.fallback = {
|
|
11
|
-
assert: false,
|
|
12
|
-
buffer: false,
|
|
13
|
-
crypto: false,
|
|
14
|
-
events: false,
|
|
15
|
-
fs: false,
|
|
16
|
-
path: false,
|
|
17
|
-
process: require.resolve('process/browser'),
|
|
18
|
-
util: false,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
return config;
|
|
22
|
-
},
|
|
8
|
+
transpilePackages: ['@lowdefy/client', ...blockPackages],
|
|
9
|
+
turbopack: {},
|
|
23
10
|
poweredByHeader: false,
|
|
24
11
|
// productionBrowserSourceMaps: true
|
|
25
12
|
output: process.env.LOWDEFY_BUILD_OUTPUT_STANDALONE === '1' ? 'standalone' : undefined,
|
|
26
|
-
|
|
27
|
-
eslint: {
|
|
28
|
-
ignoreDuringBuilds: true,
|
|
29
|
-
},
|
|
30
|
-
});
|
|
13
|
+
};
|
|
31
14
|
|
|
32
15
|
// Only wrap with Sentry if SENTRY_DSN is configured
|
|
33
16
|
// This enables source map uploads when SENTRY_AUTH_TOKEN is present
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -31,46 +31,45 @@
|
|
|
31
31
|
"pages/*",
|
|
32
32
|
"public_default/*",
|
|
33
33
|
"next.config.js",
|
|
34
|
+
"postcss.config.js",
|
|
34
35
|
"package.original.json",
|
|
35
36
|
".eslintrc.yaml",
|
|
36
37
|
".npmrc"
|
|
37
38
|
],
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"@lowdefy/
|
|
41
|
-
"@lowdefy/
|
|
42
|
-
"@lowdefy/
|
|
43
|
-
"@lowdefy/blocks-
|
|
44
|
-
"@lowdefy/blocks-
|
|
45
|
-
"@lowdefy/blocks-
|
|
46
|
-
"@lowdefy/client": "
|
|
47
|
-
"@lowdefy/
|
|
48
|
-
"@lowdefy/
|
|
49
|
-
"@lowdefy/
|
|
50
|
-
"@lowdefy/
|
|
51
|
-
"@lowdefy/
|
|
52
|
-
"@lowdefy/
|
|
53
|
-
"@lowdefy/
|
|
54
|
-
"@lowdefy/operators-js": "4.7.2",
|
|
55
|
-
"@lowdefy/operators-nunjucks": "4.7.2",
|
|
56
|
-
"@lowdefy/operators-uuid": "4.7.2",
|
|
57
|
-
"@lowdefy/plugin-next-auth": "4.7.2",
|
|
40
|
+
"@ant-design/cssinjs": "2.1.2",
|
|
41
|
+
"@lowdefy/actions-core": "5.0.0",
|
|
42
|
+
"@lowdefy/api": "5.0.0",
|
|
43
|
+
"@lowdefy/block-utils": "5.0.0",
|
|
44
|
+
"@lowdefy/blocks-antd": "5.0.0",
|
|
45
|
+
"@lowdefy/blocks-basic": "5.0.0",
|
|
46
|
+
"@lowdefy/blocks-loaders": "5.0.0",
|
|
47
|
+
"@lowdefy/client": "5.0.0",
|
|
48
|
+
"@lowdefy/errors": "5.0.0",
|
|
49
|
+
"@lowdefy/helpers": "5.0.0",
|
|
50
|
+
"@lowdefy/layout": "5.0.0",
|
|
51
|
+
"@lowdefy/logger": "5.0.0",
|
|
52
|
+
"@lowdefy/node-utils": "5.0.0",
|
|
53
|
+
"@lowdefy/operators-js": "5.0.0",
|
|
54
|
+
"@lowdefy/plugin-next-auth": "5.0.0",
|
|
58
55
|
"@sentry/nextjs": "8.53.0",
|
|
59
|
-
"
|
|
60
|
-
"
|
|
56
|
+
"@tailwindcss/postcss": "4.2.1",
|
|
57
|
+
"tailwindcss": "4.2.1",
|
|
58
|
+
"antd": "6.3.1",
|
|
59
|
+
"dayjs": "1.11.19",
|
|
60
|
+
"next": "16.1.6",
|
|
61
|
+
"next-auth": "4.24.10",
|
|
61
62
|
"pino": "8.16.2",
|
|
62
|
-
"process": "0.11.10",
|
|
63
63
|
"react": "18.2.0",
|
|
64
64
|
"react-dom": "18.2.0",
|
|
65
|
-
"react-icons": "
|
|
65
|
+
"react-icons": "5.6.0",
|
|
66
66
|
"uuid": "13.0.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@lowdefy/build": "
|
|
70
|
-
"@next/eslint-plugin-next": "
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"next-with-less": "3.0.1",
|
|
69
|
+
"@lowdefy/build": "5.0.0",
|
|
70
|
+
"@next/eslint-plugin-next": "16.1.6",
|
|
71
|
+
"@tailwindcss/postcss": "4.2.1",
|
|
72
|
+
"tailwindcss": "4.2.1",
|
|
74
73
|
"webpack": "5.94.0",
|
|
75
74
|
"yaml": "2.3.4",
|
|
76
75
|
"yargs": "17.7.2"
|
package/package.original.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"pages/*",
|
|
32
32
|
"public_default/*",
|
|
33
33
|
"next.config.js",
|
|
34
|
+
"postcss.config.js",
|
|
34
35
|
"package.original.json",
|
|
35
36
|
".eslintrc.yaml",
|
|
36
37
|
".npmrc"
|
|
@@ -46,41 +47,39 @@
|
|
|
46
47
|
"prepublishOnly": "pnpm build"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
|
-
"@
|
|
50
|
-
"@lowdefy/
|
|
51
|
-
"@lowdefy/
|
|
52
|
-
"@lowdefy/
|
|
53
|
-
"@lowdefy/blocks-
|
|
54
|
-
"@lowdefy/blocks-
|
|
55
|
-
"@lowdefy/blocks-
|
|
56
|
-
"@lowdefy/client": "
|
|
57
|
-
"@lowdefy/
|
|
58
|
-
"@lowdefy/
|
|
59
|
-
"@lowdefy/
|
|
60
|
-
"@lowdefy/
|
|
61
|
-
"@lowdefy/
|
|
62
|
-
"@lowdefy/
|
|
63
|
-
"@lowdefy/
|
|
64
|
-
"@lowdefy/operators-js": "4.7.2",
|
|
65
|
-
"@lowdefy/operators-nunjucks": "4.7.2",
|
|
66
|
-
"@lowdefy/operators-uuid": "4.7.2",
|
|
67
|
-
"@lowdefy/plugin-next-auth": "4.7.2",
|
|
50
|
+
"@ant-design/cssinjs": "2.1.2",
|
|
51
|
+
"@lowdefy/actions-core": "5.0.0",
|
|
52
|
+
"@lowdefy/api": "5.0.0",
|
|
53
|
+
"@lowdefy/block-utils": "5.0.0",
|
|
54
|
+
"@lowdefy/blocks-antd": "5.0.0",
|
|
55
|
+
"@lowdefy/blocks-basic": "5.0.0",
|
|
56
|
+
"@lowdefy/blocks-loaders": "5.0.0",
|
|
57
|
+
"@lowdefy/client": "5.0.0",
|
|
58
|
+
"@lowdefy/errors": "5.0.0",
|
|
59
|
+
"@lowdefy/helpers": "5.0.0",
|
|
60
|
+
"@lowdefy/layout": "5.0.0",
|
|
61
|
+
"@lowdefy/logger": "5.0.0",
|
|
62
|
+
"@lowdefy/node-utils": "5.0.0",
|
|
63
|
+
"@lowdefy/operators-js": "5.0.0",
|
|
64
|
+
"@lowdefy/plugin-next-auth": "5.0.0",
|
|
68
65
|
"@sentry/nextjs": "8.53.0",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
66
|
+
"@tailwindcss/postcss": "4.2.1",
|
|
67
|
+
"tailwindcss": "4.2.1",
|
|
68
|
+
"antd": "6.3.1",
|
|
69
|
+
"dayjs": "1.11.19",
|
|
70
|
+
"next": "16.1.6",
|
|
71
|
+
"next-auth": "4.24.10",
|
|
71
72
|
"pino": "8.16.2",
|
|
72
|
-
"process": "0.11.10",
|
|
73
73
|
"react": "18.2.0",
|
|
74
74
|
"react-dom": "18.2.0",
|
|
75
|
-
"react-icons": "
|
|
75
|
+
"react-icons": "5.6.0",
|
|
76
76
|
"uuid": "13.0.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@lowdefy/build": "
|
|
80
|
-
"@next/eslint-plugin-next": "
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"next-with-less": "3.0.1",
|
|
79
|
+
"@lowdefy/build": "5.0.0",
|
|
80
|
+
"@next/eslint-plugin-next": "16.1.6",
|
|
81
|
+
"@tailwindcss/postcss": "4.2.1",
|
|
82
|
+
"tailwindcss": "4.2.1",
|
|
84
83
|
"webpack": "5.94.0",
|
|
85
84
|
"yaml": "2.3.4",
|
|
86
85
|
"yargs": "17.7.2"
|
package/pages/_app.js
CHANGED
|
@@ -14,10 +14,18 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
// CSS layer order — MUST be the first CSS import. Next.js treats this as critical
|
|
18
|
+
// CSS that loads before hydration, locking the cascade priority (antd > base/preflight)
|
|
19
|
+
// before antd's StyleProvider injects @layer antd {} at runtime.
|
|
20
|
+
import '../build/layer-order.css';
|
|
21
|
+
|
|
17
22
|
import React, { useCallback, useRef } from 'react';
|
|
18
23
|
import dynamic from 'next/dynamic';
|
|
19
24
|
|
|
20
25
|
import { ErrorBoundary } from '@lowdefy/block-utils';
|
|
26
|
+
import { useDarkMode } from '@lowdefy/client';
|
|
27
|
+
import { StyleProvider } from '@ant-design/cssinjs';
|
|
28
|
+
import { App as AntdApp, ConfigProvider, theme as antdTheme } from 'antd';
|
|
21
29
|
|
|
22
30
|
import Auth from '../lib/client/auth/Auth.js';
|
|
23
31
|
import createLogUsage from '../lib/client/createLogUsage.js';
|
|
@@ -26,7 +34,7 @@ import loggerConfig from '../lib/build/logger.js';
|
|
|
26
34
|
import setSentryUser from '../lib/client/sentry/setSentryUser.js';
|
|
27
35
|
|
|
28
36
|
// Must be in _app due to next specifications.
|
|
29
|
-
import '../build/
|
|
37
|
+
import '../build/globals.css';
|
|
30
38
|
|
|
31
39
|
// Initialize Sentry client once on module load
|
|
32
40
|
initSentryClient({
|
|
@@ -34,9 +42,26 @@ initSentryClient({
|
|
|
34
42
|
sentryConfig: loggerConfig.sentry,
|
|
35
43
|
});
|
|
36
44
|
|
|
45
|
+
function ThemeTokenResolver({ lowdefyRef, children }) {
|
|
46
|
+
const { token } = antdTheme.useToken();
|
|
47
|
+
if (!lowdefyRef.current.theme) {
|
|
48
|
+
lowdefyRef.current.theme = {};
|
|
49
|
+
}
|
|
50
|
+
lowdefyRef.current.theme._resolvedAntdToken = token;
|
|
51
|
+
return children;
|
|
52
|
+
}
|
|
53
|
+
|
|
37
54
|
function App({ Component, pageProps: { session, rootConfig, pageConfig } }) {
|
|
38
55
|
const usageDataRef = useRef({});
|
|
39
56
|
const lowdefyRef = useRef({ eventCallback: createLogUsage({ usageDataRef }) });
|
|
57
|
+
if (rootConfig?.theme) {
|
|
58
|
+
lowdefyRef.current.theme = rootConfig.theme;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const algorithm = useDarkMode({
|
|
62
|
+
baseAlgorithm: lowdefyRef.current.theme?.antd?.algorithm,
|
|
63
|
+
configDarkMode: lowdefyRef.current.theme?.darkMode,
|
|
64
|
+
});
|
|
40
65
|
|
|
41
66
|
const handleError = useCallback((error) => {
|
|
42
67
|
if (lowdefyRef.current?._internal?.handleError) {
|
|
@@ -47,26 +72,41 @@ function App({ Component, pageProps: { session, rootConfig, pageConfig } }) {
|
|
|
47
72
|
}, []);
|
|
48
73
|
|
|
49
74
|
return (
|
|
50
|
-
<
|
|
51
|
-
<
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
sentryConfig: loggerConfig.sentry,
|
|
58
|
-
});
|
|
59
|
-
return (
|
|
60
|
-
<Component
|
|
61
|
-
auth={auth}
|
|
62
|
-
lowdefy={lowdefyRef.current}
|
|
63
|
-
rootConfig={rootConfig}
|
|
64
|
-
pageConfig={pageConfig}
|
|
65
|
-
/>
|
|
66
|
-
);
|
|
75
|
+
<StyleProvider layer>
|
|
76
|
+
<ConfigProvider
|
|
77
|
+
theme={{
|
|
78
|
+
...lowdefyRef.current.theme?.antd,
|
|
79
|
+
cssVar: { key: 'lowdefy' },
|
|
80
|
+
hashed: false,
|
|
81
|
+
algorithm,
|
|
67
82
|
}}
|
|
68
|
-
|
|
69
|
-
|
|
83
|
+
>
|
|
84
|
+
<AntdApp>
|
|
85
|
+
<ThemeTokenResolver lowdefyRef={lowdefyRef}>
|
|
86
|
+
<ErrorBoundary fullPage onError={handleError}>
|
|
87
|
+
<Auth session={session}>
|
|
88
|
+
{(auth) => {
|
|
89
|
+
usageDataRef.current.user = auth.session?.hashed_id;
|
|
90
|
+
// Set Sentry user context when auth changes
|
|
91
|
+
setSentryUser({
|
|
92
|
+
user: auth.session,
|
|
93
|
+
sentryConfig: loggerConfig.sentry,
|
|
94
|
+
});
|
|
95
|
+
return (
|
|
96
|
+
<Component
|
|
97
|
+
auth={auth}
|
|
98
|
+
lowdefy={lowdefyRef.current}
|
|
99
|
+
rootConfig={rootConfig}
|
|
100
|
+
pageConfig={pageConfig}
|
|
101
|
+
/>
|
|
102
|
+
);
|
|
103
|
+
}}
|
|
104
|
+
</Auth>
|
|
105
|
+
</ErrorBoundary>
|
|
106
|
+
</ThemeTokenResolver>
|
|
107
|
+
</AntdApp>
|
|
108
|
+
</ConfigProvider>
|
|
109
|
+
</StyleProvider>
|
|
70
110
|
);
|
|
71
111
|
}
|
|
72
112
|
|
package/pages/_document.js
CHANGED
|
@@ -25,8 +25,19 @@ const basePath = lowdefyConfig.basePath ?? '';
|
|
|
25
25
|
class LowdefyDocument extends Document {
|
|
26
26
|
render() {
|
|
27
27
|
return (
|
|
28
|
-
<Html>
|
|
28
|
+
<Html className="lowdefy">
|
|
29
29
|
<Head>
|
|
30
|
+
{/* Synchronous script that creates the @layer order declaration and keeps
|
|
31
|
+
it as the first child of <head> via MutationObserver. antd's CSS-in-JS
|
|
32
|
+
uses prependQueue to inject <style> tags at the top of <head>, which
|
|
33
|
+
would otherwise make @layer antd the first (lowest priority) layer.
|
|
34
|
+
MutationObserver fires before paint, so the browser never sees the
|
|
35
|
+
wrong cascade order. */}
|
|
36
|
+
<script
|
|
37
|
+
dangerouslySetInnerHTML={{
|
|
38
|
+
__html: `(function(){var s=document.createElement("style");s.id="__lf-layer-order";s.textContent="@layer theme, base, antd, components, utilities;";document.head.prepend(s);new MutationObserver(function(){if(document.head.firstChild!==s)document.head.prepend(s)}).observe(document.head,{childList:true})})();`,
|
|
39
|
+
}}
|
|
40
|
+
/>
|
|
30
41
|
<link rel="manifest" href={`${basePath}/manifest.webmanifest`} />
|
|
31
42
|
<link rel="icon" type="image/svg+xml" href={`${basePath}/icon.svg`} />
|
|
32
43
|
<link rel="apple-touch-icon" href={`${basePath}/apple-touch-icon.png`} />
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = { plugins: { '@tailwindcss/postcss': {} } };
|