@lowdefy/server-e2e 4.7.3 → 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.
@@ -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) {
@@ -47,16 +50,12 @@ async function createCustomPluginTypesMap({ directories }) {
47
50
  server: {},
48
51
  },
49
52
  requests: {},
50
- styles: {
51
- packages: {},
52
- blocks: {},
53
- },
54
53
  };
55
54
 
56
55
  const pluginDefinitions = await getPluginDefinitions({ directories });
57
56
 
58
57
  for (const plugin of pluginDefinitions) {
59
- const { default: types } = await import(`${plugin.name}/types`);
58
+ const types = require(`${plugin.name}/types`);
60
59
  createPluginTypesMap({
61
60
  packageTypes: types,
62
61
  typesMap: customTypesMap,
package/next.config.js CHANGED
@@ -1,9 +1,9 @@
1
- const withLess = require('next-with-less');
2
1
  const lowdefyConfig = require('./build/config.json');
3
2
 
4
- const nextConfig = withLess({
3
+ const nextConfig = {
5
4
  basePath: lowdefyConfig.basePath,
6
5
  reactStrictMode: true,
6
+ transpilePackages: ['@lowdefy/client', '@lowdefy/blocks-loaders', '@lowdefy/blocks-markdown'],
7
7
  webpack: (config, { isServer }) => {
8
8
  if (!isServer) {
9
9
  config.resolve.fallback = {
@@ -21,10 +21,9 @@ const nextConfig = withLess({
21
21
  },
22
22
  poweredByHeader: false,
23
23
  output: process.env.LOWDEFY_BUILD_OUTPUT_STANDALONE === '1' ? 'standalone' : undefined,
24
- outputFileTracing: true,
25
24
  eslint: {
26
25
  ignoreDuringBuilds: true,
27
26
  },
28
- });
27
+ };
29
28
 
30
29
  module.exports = nextConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-e2e",
3
- "version": "4.7.3",
3
+ "version": "5.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Lowdefy e2e testing server with cookie-based user injection",
6
6
  "homepage": "https://lowdefy.com",
@@ -38,38 +38,40 @@
38
38
  ".npmrc"
39
39
  ],
40
40
  "dependencies": {
41
- "@lowdefy/actions-core": "4.7.3",
42
- "@lowdefy/api": "4.7.3",
43
- "@lowdefy/block-utils": "4.7.3",
44
- "@lowdefy/blocks-antd": "4.7.3",
45
- "@lowdefy/blocks-basic": "4.7.3",
46
- "@lowdefy/blocks-loaders": "4.7.3",
47
- "@lowdefy/blocks-markdown": "4.7.3",
48
- "@lowdefy/client": "4.7.3",
49
- "@lowdefy/connection-axios-http": "4.7.3",
50
- "@lowdefy/connection-mongodb": "4.7.3",
51
- "@lowdefy/errors": "4.7.3",
52
- "@lowdefy/helpers": "4.7.3",
53
- "@lowdefy/layout": "4.7.3",
54
- "@lowdefy/logger": "4.7.3",
55
- "@lowdefy/node-utils": "4.7.3",
56
- "@lowdefy/operators-js": "4.7.3",
57
- "@lowdefy/operators-nunjucks": "4.7.3",
58
- "@lowdefy/operators-uuid": "4.7.3",
59
- "next": "13.5.4",
41
+ "@ant-design/cssinjs": "2.1.2",
42
+ "@lowdefy/actions-core": "5.0.0",
43
+ "@lowdefy/api": "5.0.0",
44
+ "@lowdefy/block-utils": "5.0.0",
45
+ "@lowdefy/blocks-antd": "5.0.0",
46
+ "@lowdefy/blocks-basic": "5.0.0",
47
+ "@lowdefy/blocks-loaders": "5.0.0",
48
+ "@lowdefy/blocks-markdown": "5.0.0",
49
+ "@lowdefy/client": "5.0.0",
50
+ "@lowdefy/connection-axios-http": "5.0.0",
51
+ "@lowdefy/connection-mongodb": "5.0.0",
52
+ "@lowdefy/errors": "5.0.0",
53
+ "@lowdefy/helpers": "5.0.0",
54
+ "@lowdefy/layout": "5.0.0",
55
+ "@lowdefy/logger": "5.0.0",
56
+ "@lowdefy/node-utils": "5.0.0",
57
+ "@lowdefy/operators-js": "5.0.0",
58
+ "@lowdefy/operators-nunjucks": "5.0.0",
59
+ "@lowdefy/operators-uuid": "5.0.0",
60
+ "antd": "6.3.1",
61
+ "dayjs": "1.11.19",
62
+ "next": "16.1.6",
60
63
  "pino": "8.16.2",
61
64
  "process": "0.11.10",
62
65
  "react": "18.2.0",
63
66
  "react-dom": "18.2.0",
64
- "react-icons": "4.12.0",
67
+ "react-icons": "5.6.0",
65
68
  "uuid": "13.0.0"
66
69
  },
67
70
  "devDependencies": {
68
- "@lowdefy/build": "4.7.3",
69
- "@next/eslint-plugin-next": "13.5.4",
70
- "less": "4.2.0",
71
- "less-loader": "11.1.3",
72
- "next-with-less": "3.0.1",
71
+ "@lowdefy/build": "5.0.0",
72
+ "@next/eslint-plugin-next": "16.1.6",
73
+ "@tailwindcss/postcss": "4.2.1",
74
+ "tailwindcss": "4.2.1",
73
75
  "webpack": "5.94.0",
74
76
  "yaml": "2.3.4",
75
77
  "yargs": "17.7.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-e2e",
3
- "version": "4.7.3",
3
+ "version": "5.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Lowdefy e2e testing server with cookie-based user injection",
6
6
  "homepage": "https://lowdefy.com",
@@ -48,38 +48,40 @@
48
48
  "prepublishOnly": "pnpm build"
49
49
  },
50
50
  "dependencies": {
51
- "@lowdefy/actions-core": "4.7.3",
52
- "@lowdefy/api": "4.7.3",
53
- "@lowdefy/block-utils": "4.7.3",
54
- "@lowdefy/blocks-antd": "4.7.3",
55
- "@lowdefy/blocks-basic": "4.7.3",
56
- "@lowdefy/blocks-loaders": "4.7.3",
57
- "@lowdefy/blocks-markdown": "4.7.3",
58
- "@lowdefy/client": "4.7.3",
59
- "@lowdefy/connection-axios-http": "4.7.3",
60
- "@lowdefy/connection-mongodb": "4.7.3",
61
- "@lowdefy/errors": "4.7.3",
62
- "@lowdefy/helpers": "4.7.3",
63
- "@lowdefy/layout": "4.7.3",
64
- "@lowdefy/logger": "4.7.3",
65
- "@lowdefy/node-utils": "4.7.3",
66
- "@lowdefy/operators-js": "4.7.3",
67
- "@lowdefy/operators-nunjucks": "4.7.3",
68
- "@lowdefy/operators-uuid": "4.7.3",
69
- "next": "13.5.4",
51
+ "@ant-design/cssinjs": "2.1.2",
52
+ "@lowdefy/actions-core": "5.0.0",
53
+ "@lowdefy/api": "5.0.0",
54
+ "@lowdefy/block-utils": "5.0.0",
55
+ "@lowdefy/blocks-antd": "5.0.0",
56
+ "@lowdefy/blocks-basic": "5.0.0",
57
+ "@lowdefy/blocks-loaders": "5.0.0",
58
+ "@lowdefy/blocks-markdown": "5.0.0",
59
+ "@lowdefy/client": "5.0.0",
60
+ "@lowdefy/connection-axios-http": "5.0.0",
61
+ "@lowdefy/connection-mongodb": "5.0.0",
62
+ "@lowdefy/errors": "5.0.0",
63
+ "@lowdefy/helpers": "5.0.0",
64
+ "@lowdefy/layout": "5.0.0",
65
+ "@lowdefy/logger": "5.0.0",
66
+ "@lowdefy/node-utils": "5.0.0",
67
+ "@lowdefy/operators-js": "5.0.0",
68
+ "@lowdefy/operators-nunjucks": "5.0.0",
69
+ "@lowdefy/operators-uuid": "5.0.0",
70
+ "antd": "6.3.1",
71
+ "dayjs": "1.11.19",
72
+ "next": "16.1.6",
70
73
  "pino": "8.16.2",
71
74
  "process": "0.11.10",
72
75
  "react": "18.2.0",
73
76
  "react-dom": "18.2.0",
74
- "react-icons": "4.12.0",
77
+ "react-icons": "5.6.0",
75
78
  "uuid": "13.0.0"
76
79
  },
77
80
  "devDependencies": {
78
- "@lowdefy/build": "4.7.3",
79
- "@next/eslint-plugin-next": "13.5.4",
80
- "less": "4.2.0",
81
- "less-loader": "11.1.3",
82
- "next-with-less": "3.0.1",
81
+ "@lowdefy/build": "5.0.0",
82
+ "@next/eslint-plugin-next": "16.1.6",
83
+ "@tailwindcss/postcss": "4.2.1",
84
+ "tailwindcss": "4.2.1",
83
85
  "webpack": "5.94.0",
84
86
  "yaml": "2.3.4",
85
87
  "yargs": "17.7.2"
package/pages/_app.js CHANGED
@@ -14,21 +14,40 @@
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 { StyleProvider } from '@ant-design/cssinjs';
27
+ import { App as AntdApp, ConfigProvider, theme as antdTheme } from 'antd';
21
28
 
22
29
  import Auth from '../lib/client/auth/Auth.js';
23
30
  import createLogUsage from '../lib/client/createLogUsage.js';
24
31
 
25
32
  // Must be in _app due to next specifications.
26
- import '../build/plugins/styles.less';
33
+ import '../build/globals.css';
34
+
35
+ const algorithmMap = {
36
+ default: antdTheme.defaultAlgorithm,
37
+ dark: antdTheme.darkAlgorithm,
38
+ compact: antdTheme.compactAlgorithm,
39
+ };
40
+
41
+ function resolveAlgorithm(algorithm) {
42
+ if (Array.isArray(algorithm)) {
43
+ return algorithm.map((a) => algorithmMap[a] || antdTheme.defaultAlgorithm);
44
+ }
45
+ return algorithmMap[algorithm] || antdTheme.defaultAlgorithm;
46
+ }
27
47
 
28
48
  function App({ Component, pageProps: { session, rootConfig, pageConfig } }) {
29
49
  const usageDataRef = useRef({});
30
50
  const lowdefyRef = useRef({ eventCallback: createLogUsage({ usageDataRef }) });
31
-
32
51
  const handleError = useCallback((error) => {
33
52
  if (lowdefyRef.current?._internal?.handleError) {
34
53
  lowdefyRef.current._internal.handleError(error);
@@ -38,21 +57,34 @@ function App({ Component, pageProps: { session, rootConfig, pageConfig } }) {
38
57
  }, []);
39
58
 
40
59
  return (
41
- <ErrorBoundary fullPage onError={handleError}>
42
- <Auth session={session}>
43
- {(auth) => {
44
- usageDataRef.current.user = auth.session?.hashed_id;
45
- return (
46
- <Component
47
- auth={auth}
48
- lowdefy={lowdefyRef.current}
49
- rootConfig={rootConfig}
50
- pageConfig={pageConfig}
51
- />
52
- );
60
+ <StyleProvider layer>
61
+ <ConfigProvider
62
+ theme={{
63
+ ...lowdefyRef.current.theme?.antd,
64
+ cssVar: { key: 'lowdefy' },
65
+ hashed: false,
66
+ algorithm: resolveAlgorithm(lowdefyRef.current.theme?.antd?.algorithm),
53
67
  }}
54
- </Auth>
55
- </ErrorBoundary>
68
+ >
69
+ <AntdApp>
70
+ <ErrorBoundary fullPage onError={handleError}>
71
+ <Auth session={session}>
72
+ {(auth) => {
73
+ usageDataRef.current.user = auth.session?.hashed_id;
74
+ return (
75
+ <Component
76
+ auth={auth}
77
+ lowdefy={lowdefyRef.current}
78
+ rootConfig={rootConfig}
79
+ pageConfig={pageConfig}
80
+ />
81
+ );
82
+ }}
83
+ </Auth>
84
+ </ErrorBoundary>
85
+ </AntdApp>
86
+ </ConfigProvider>
87
+ </StyleProvider>
56
88
  );
57
89
  }
58
90
 
@@ -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`} />