@lowdefy/server-dev 0.0.0-experimental-20260429140004 → 0.0.0-experimental-20260506095254

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.
@@ -0,0 +1,19 @@
1
+ /*
2
+ Copyright 2020-2026 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
+ import { serializer } from '@lowdefy/helpers';
17
+ import raw from '../../build/i18n.json';
18
+
19
+ export default serializer.deserialize(raw);
@@ -21,6 +21,7 @@ import { serializer } from '@lowdefy/helpers';
21
21
  import { v4 as uuid } from 'uuid';
22
22
 
23
23
  import config from '../build/config.js';
24
+ import i18nConfig from '../build/i18n.js';
24
25
  import connections from '../../build/plugins/connections.js';
25
26
  import createLogger from './log/createLogger.js';
26
27
  import fileCache from './fileCache.js';
@@ -71,6 +72,7 @@ function apiWrapper(handler) {
71
72
  connections,
72
73
  fileCache,
73
74
  headers: req?.headers,
75
+ i18n: i18nConfig,
74
76
  jsMap,
75
77
  handleError: async (err) => {
76
78
  console.error(err);
@@ -93,8 +93,11 @@ function getBuildContext(buildDirectory, configDirectory) {
93
93
  const connectionIds = readJsonFile(path.join(buildDirectory, 'connectionIds.json')) ?? [];
94
94
 
95
95
  const customTypesMap = readJsonFile(path.join(buildDirectory, 'customTypesMap.json')) ?? {};
96
+ const customMessagesMap =
97
+ readJsonFile(path.join(buildDirectory, 'customMessagesMap.json')) ?? {};
96
98
 
97
99
  cachedBuildContext = createContext({
100
+ customMessagesMap,
98
101
  customTypesMap,
99
102
  directories: {
100
103
  build: buildDirectory,
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import { shallowBuild } from '@lowdefy/build/dev';
18
+ import createCustomPluginMessagesMap from '../utils/createCustomPluginMessagesMap.mjs';
18
19
  import createCustomPluginTypesMap from '../utils/createCustomPluginTypesMap.mjs';
19
20
 
20
21
  function formatDuration(ms) {
@@ -27,8 +28,10 @@ function lowdefyBuild({ directories, logger, options }) {
27
28
  logger.info({ spin: 'start' }, 'Building config...');
28
29
  const startTime = Date.now();
29
30
  const customTypesMap = await createCustomPluginTypesMap({ directories, logger });
31
+ const customMessagesMap = await createCustomPluginMessagesMap({ directories, logger });
30
32
 
31
33
  const result = await shallowBuild({
34
+ customMessagesMap,
32
35
  customTypesMap,
33
36
  directories,
34
37
  logger,
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ Copyright 2020-2026 Lowdefy, Inc
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ */
17
+
18
+ import { createRequire } from 'node:module';
19
+ import path from 'path';
20
+ import { get } from '@lowdefy/helpers';
21
+ import { readFile } from '@lowdefy/node-utils';
22
+ import YAML from 'yaml';
23
+
24
+ const require = createRequire(import.meta.url);
25
+
26
+ async function getPluginDefinitions({ directories }) {
27
+ let lowdefyYaml = await readFile(path.join(directories.config, 'lowdefy.yaml'));
28
+ if (!lowdefyYaml) {
29
+ lowdefyYaml = await readFile(path.join(directories.config, 'lowdefy.yml'));
30
+ }
31
+ if (!lowdefyYaml) {
32
+ return [];
33
+ }
34
+ const lowdefy = YAML.parse(lowdefyYaml);
35
+ return get(lowdefy, 'plugins', { default: [] });
36
+ }
37
+
38
+ async function createCustomPluginMessagesMap({ directories, logger }) {
39
+ const customMessagesMap = {};
40
+ const pluginDefinitions = await getPluginDefinitions({ directories });
41
+
42
+ for (const plugin of pluginDefinitions) {
43
+ let messagesModule;
44
+ try {
45
+ messagesModule = require(`${plugin.name}/messages`);
46
+ } catch (e) {
47
+ // Plugin does not ship a `./messages` export — silently skip.
48
+ logger?.debug?.(`Plugin "${plugin.name}" has no "./messages" export; skipping.`);
49
+ continue;
50
+ }
51
+ const messages = messagesModule.default ?? messagesModule;
52
+ if (!messages || typeof messages !== 'object') continue;
53
+ customMessagesMap[plugin.name] = messages;
54
+ }
55
+
56
+ return customMessagesMap;
57
+ }
58
+
59
+ export default createCustomPluginMessagesMap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-dev",
3
- "version": "0.0.0-experimental-20260429140004",
3
+ "version": "0.0.0-experimental-20260506095254",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -36,34 +36,34 @@
36
36
  ".npmrc"
37
37
  ],
38
38
  "dependencies": {
39
- "@lowdefy/actions-core": "0.0.0-experimental-20260429140004",
40
- "@lowdefy/api": "0.0.0-experimental-20260429140004",
41
- "@lowdefy/block-utils": "0.0.0-experimental-20260429140004",
42
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260429140004",
43
- "@lowdefy/blocks-antd": "0.0.0-experimental-20260429140004",
44
- "@lowdefy/blocks-basic": "0.0.0-experimental-20260429140004",
45
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20260429140004",
46
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20260429140004",
47
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20260429140004",
48
- "@lowdefy/blocks-tiptap": "0.0.0-experimental-20260429140004",
49
- "@lowdefy/build": "0.0.0-experimental-20260429140004",
50
- "@lowdefy/client": "0.0.0-experimental-20260429140004",
51
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20260429140004",
52
- "@lowdefy/engine": "0.0.0-experimental-20260429140004",
53
- "@lowdefy/errors": "0.0.0-experimental-20260429140004",
54
- "@lowdefy/helpers": "0.0.0-experimental-20260429140004",
55
- "@lowdefy/layout": "0.0.0-experimental-20260429140004",
56
- "@lowdefy/logger": "0.0.0-experimental-20260429140004",
57
- "@lowdefy/node-utils": "0.0.0-experimental-20260429140004",
58
- "@lowdefy/operators-change-case": "0.0.0-experimental-20260429140004",
59
- "@lowdefy/operators-dayjs": "0.0.0-experimental-20260429140004",
60
- "@lowdefy/operators-diff": "0.0.0-experimental-20260429140004",
61
- "@lowdefy/operators-js": "0.0.0-experimental-20260429140004",
62
- "@lowdefy/operators-mql": "0.0.0-experimental-20260429140004",
63
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260429140004",
64
- "@lowdefy/operators-uuid": "0.0.0-experimental-20260429140004",
65
- "@lowdefy/operators-yaml": "0.0.0-experimental-20260429140004",
66
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260429140004",
39
+ "@lowdefy/actions-core": "0.0.0-experimental-20260506095254",
40
+ "@lowdefy/api": "0.0.0-experimental-20260506095254",
41
+ "@lowdefy/block-utils": "0.0.0-experimental-20260506095254",
42
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260506095254",
43
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20260506095254",
44
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20260506095254",
45
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20260506095254",
46
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20260506095254",
47
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20260506095254",
48
+ "@lowdefy/blocks-tiptap": "0.0.0-experimental-20260506095254",
49
+ "@lowdefy/build": "0.0.0-experimental-20260506095254",
50
+ "@lowdefy/client": "0.0.0-experimental-20260506095254",
51
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20260506095254",
52
+ "@lowdefy/engine": "0.0.0-experimental-20260506095254",
53
+ "@lowdefy/errors": "0.0.0-experimental-20260506095254",
54
+ "@lowdefy/helpers": "0.0.0-experimental-20260506095254",
55
+ "@lowdefy/layout": "0.0.0-experimental-20260506095254",
56
+ "@lowdefy/logger": "0.0.0-experimental-20260506095254",
57
+ "@lowdefy/node-utils": "0.0.0-experimental-20260506095254",
58
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20260506095254",
59
+ "@lowdefy/operators-dayjs": "0.0.0-experimental-20260506095254",
60
+ "@lowdefy/operators-diff": "0.0.0-experimental-20260506095254",
61
+ "@lowdefy/operators-js": "0.0.0-experimental-20260506095254",
62
+ "@lowdefy/operators-mql": "0.0.0-experimental-20260506095254",
63
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260506095254",
64
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20260506095254",
65
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20260506095254",
66
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260506095254",
67
67
  "@ant-design/cssinjs": "2.1.2",
68
68
  "antd": "6.3.1",
69
69
  "dayjs": "1.11.19",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-dev",
3
- "version": "0.0.0-experimental-20260429140004",
3
+ "version": "0.0.0-experimental-20260506095254",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -44,34 +44,34 @@
44
44
  "prepublishOnly": "pnpm build"
45
45
  },
46
46
  "dependencies": {
47
- "@lowdefy/actions-core": "0.0.0-experimental-20260429140004",
48
- "@lowdefy/api": "0.0.0-experimental-20260429140004",
49
- "@lowdefy/block-utils": "0.0.0-experimental-20260429140004",
50
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260429140004",
51
- "@lowdefy/blocks-antd": "0.0.0-experimental-20260429140004",
52
- "@lowdefy/blocks-basic": "0.0.0-experimental-20260429140004",
53
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20260429140004",
54
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20260429140004",
55
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20260429140004",
56
- "@lowdefy/blocks-tiptap": "0.0.0-experimental-20260429140004",
57
- "@lowdefy/build": "0.0.0-experimental-20260429140004",
58
- "@lowdefy/client": "0.0.0-experimental-20260429140004",
59
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20260429140004",
60
- "@lowdefy/engine": "0.0.0-experimental-20260429140004",
61
- "@lowdefy/errors": "0.0.0-experimental-20260429140004",
62
- "@lowdefy/helpers": "0.0.0-experimental-20260429140004",
63
- "@lowdefy/layout": "0.0.0-experimental-20260429140004",
64
- "@lowdefy/logger": "0.0.0-experimental-20260429140004",
65
- "@lowdefy/node-utils": "0.0.0-experimental-20260429140004",
66
- "@lowdefy/operators-change-case": "0.0.0-experimental-20260429140004",
67
- "@lowdefy/operators-dayjs": "0.0.0-experimental-20260429140004",
68
- "@lowdefy/operators-diff": "0.0.0-experimental-20260429140004",
69
- "@lowdefy/operators-js": "0.0.0-experimental-20260429140004",
70
- "@lowdefy/operators-mql": "0.0.0-experimental-20260429140004",
71
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260429140004",
72
- "@lowdefy/operators-uuid": "0.0.0-experimental-20260429140004",
73
- "@lowdefy/operators-yaml": "0.0.0-experimental-20260429140004",
74
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260429140004",
47
+ "@lowdefy/actions-core": "0.0.0-experimental-20260506095254",
48
+ "@lowdefy/api": "0.0.0-experimental-20260506095254",
49
+ "@lowdefy/block-utils": "0.0.0-experimental-20260506095254",
50
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260506095254",
51
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20260506095254",
52
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20260506095254",
53
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20260506095254",
54
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20260506095254",
55
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20260506095254",
56
+ "@lowdefy/blocks-tiptap": "0.0.0-experimental-20260506095254",
57
+ "@lowdefy/build": "0.0.0-experimental-20260506095254",
58
+ "@lowdefy/client": "0.0.0-experimental-20260506095254",
59
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20260506095254",
60
+ "@lowdefy/engine": "0.0.0-experimental-20260506095254",
61
+ "@lowdefy/errors": "0.0.0-experimental-20260506095254",
62
+ "@lowdefy/helpers": "0.0.0-experimental-20260506095254",
63
+ "@lowdefy/layout": "0.0.0-experimental-20260506095254",
64
+ "@lowdefy/logger": "0.0.0-experimental-20260506095254",
65
+ "@lowdefy/node-utils": "0.0.0-experimental-20260506095254",
66
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20260506095254",
67
+ "@lowdefy/operators-dayjs": "0.0.0-experimental-20260506095254",
68
+ "@lowdefy/operators-diff": "0.0.0-experimental-20260506095254",
69
+ "@lowdefy/operators-js": "0.0.0-experimental-20260506095254",
70
+ "@lowdefy/operators-mql": "0.0.0-experimental-20260506095254",
71
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260506095254",
72
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20260506095254",
73
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20260506095254",
74
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260506095254",
75
75
  "@ant-design/cssinjs": "2.1.2",
76
76
  "antd": "6.3.1",
77
77
  "dayjs": "1.11.19",
@@ -101,6 +101,11 @@
101
101
  "engines": {
102
102
  "node": ">=18"
103
103
  },
104
+ "pnpm": {
105
+ "onlyBuiltDependencies": [
106
+ "better-sqlite3"
107
+ ]
108
+ },
104
109
  "publishConfig": {
105
110
  "access": "public"
106
111
  }
package/pages/_app.js CHANGED
@@ -25,10 +25,12 @@ import { useRouter } from 'next/router';
25
25
  import useSWR from 'swr';
26
26
 
27
27
  import { ErrorBoundary } from '@lowdefy/block-utils';
28
- import { useDarkMode } from '@lowdefy/client';
28
+ import { useDarkMode, useLocale } from '@lowdefy/client';
29
29
  import { StyleProvider } from '@ant-design/cssinjs';
30
30
  import { App as AntdApp, ConfigProvider, theme as antdTheme } from 'antd';
31
31
 
32
+ import antdLocaleLoaders from '../build/i18n/antdLocales.js';
33
+ import dayjsLocaleMap from '../build/i18n/dayjsLocales.js';
32
34
  import Auth from '../lib/client/auth/Auth.js';
33
35
  import ErrorBar from '../lib/client/ErrorBar.js';
34
36
  import request from '../lib/client/utils/request.js';
@@ -62,6 +64,16 @@ function App({ Component }) {
62
64
  configDarkMode: lowdefyRef.current.theme?.darkMode,
63
65
  });
64
66
 
67
+ const { active: activeLocale, antdLocale } = useLocale({
68
+ i18n: rootConfig?.i18n,
69
+ antdLocaleLoaders,
70
+ dayjsLocaleMap,
71
+ });
72
+
73
+ if (rootConfig?.i18n?.defaultLocale) {
74
+ lowdefyRef.current.i18n = { ...rootConfig.i18n, active: activeLocale };
75
+ }
76
+
65
77
  const {
66
78
  lightToken: _lightToken,
67
79
  darkToken: _darkToken,
@@ -102,6 +114,12 @@ function App({ Component }) {
102
114
  return (
103
115
  <StyleProvider layer>
104
116
  <ConfigProvider
117
+ locale={antdLocale ?? undefined}
118
+ form={
119
+ antdLocale?.Form?.defaultValidateMessages
120
+ ? { validateMessages: antdLocale.Form.defaultValidateMessages }
121
+ : undefined
122
+ }
105
123
  theme={{
106
124
  ...antdConfig,
107
125
  token,
@@ -23,7 +23,7 @@ async function handler({ context, req, res }) {
23
23
  throw new Error('Only POST requests are supported.');
24
24
  }
25
25
  const segments = req.query.path;
26
- if (!segments || segments.length < 2) {
26
+ if (!Array.isArray(segments) || segments.length < 2) {
27
27
  res.status(400).json({ error: 'Invalid request path' });
28
28
  return;
29
29
  }