@lowdefy/build 5.3.0 → 5.4.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/dist/index.js CHANGED
@@ -43,11 +43,14 @@ import updateServerPackageJson from './build/full/updateServerPackageJson.js';
43
43
  import validateConfig from './build/validateConfig.js';
44
44
  import writeAgents from './build/writeAgents.js';
45
45
  import writeApp from './build/writeApp.js';
46
+ import writeAppMeta from './build/writeAppMeta.js';
46
47
  import writeAuth from './build/writeAuth.js';
47
48
  import writeConfig from './build/writeConfig.js';
48
49
  import writeConnections from './build/writeConnections.js';
49
50
  import writeApi from './build/writeApi.js';
50
51
  import writeGlobal from './build/writeGlobal.js';
52
+ import codegenI18nLocales from './build/codegenI18nLocales.js';
53
+ import writeI18n from './build/writeI18n.js';
51
54
  import writeTheme from './build/writeTheme.js';
52
55
  import writeJs from './build/buildJs/writeJs.js';
53
56
  import writeLogger from './build/writeLogger.js';
@@ -185,6 +188,10 @@ async function build(options) {
185
188
  components,
186
189
  context
187
190
  });
191
+ await writeAppMeta({
192
+ components,
193
+ context
194
+ });
188
195
  await writeAuth({
189
196
  components,
190
197
  context
@@ -221,6 +228,14 @@ async function build(options) {
221
228
  components,
222
229
  context
223
230
  });
231
+ await writeI18n({
232
+ components,
233
+ context
234
+ });
235
+ await codegenI18nLocales({
236
+ components,
237
+ context
238
+ });
224
239
  await writeLogger({
225
240
  components,
226
241
  context
@@ -1324,6 +1324,16 @@ export default {
1324
1324
  type: 'MenuGroup "type" should be a string.'
1325
1325
  }
1326
1326
  },
1327
+ style: {
1328
+ errorMessage: {
1329
+ type: 'MenuGroup "style" should be an object, string, or array.'
1330
+ }
1331
+ },
1332
+ class: {
1333
+ errorMessage: {
1334
+ type: 'MenuGroup "class" should be a string, array, or object.'
1335
+ }
1336
+ },
1327
1337
  properties: {
1328
1338
  type: 'object',
1329
1339
  errorMessage: {
@@ -1348,8 +1358,81 @@ export default {
1348
1358
  }
1349
1359
  }
1350
1360
  },
1361
+ menuDivider: {
1362
+ type: 'object',
1363
+ additionalProperties: false,
1364
+ required: [
1365
+ 'id',
1366
+ 'type'
1367
+ ],
1368
+ properties: {
1369
+ '~ignoreBuildChecks': {
1370
+ oneOf: [
1371
+ {
1372
+ const: true
1373
+ },
1374
+ {
1375
+ type: 'array',
1376
+ items: {
1377
+ type: 'string',
1378
+ enum: [
1379
+ 'state-refs',
1380
+ 'payload-refs',
1381
+ 'step-refs',
1382
+ 'link-refs',
1383
+ 'request-refs',
1384
+ 'connection-refs',
1385
+ 'types',
1386
+ 'schema'
1387
+ ]
1388
+ }
1389
+ }
1390
+ ]
1391
+ },
1392
+ '~r': {},
1393
+ '~l': {},
1394
+ id: {
1395
+ type: 'string',
1396
+ errorMessage: {
1397
+ type: 'MenuDivider "id" should be a string.'
1398
+ }
1399
+ },
1400
+ type: {
1401
+ type: 'string',
1402
+ errorMessage: {
1403
+ type: 'MenuDivider "type" should be a string.'
1404
+ }
1405
+ },
1406
+ style: {
1407
+ errorMessage: {
1408
+ type: 'MenuDivider "style" should be an object, string, or array.'
1409
+ }
1410
+ },
1411
+ class: {
1412
+ errorMessage: {
1413
+ type: 'MenuDivider "class" should be a string, array, or object.'
1414
+ }
1415
+ },
1416
+ properties: {
1417
+ type: 'object',
1418
+ errorMessage: {
1419
+ type: 'MenuDivider "properties" should be an object.'
1420
+ }
1421
+ }
1422
+ },
1423
+ errorMessage: {
1424
+ type: 'MenuDivider should be an object.',
1425
+ required: {
1426
+ id: 'MenuDivider should have required property "id".',
1427
+ type: 'MenuDivider should have required property "type".'
1428
+ }
1429
+ }
1430
+ },
1351
1431
  menuItem: {
1352
1432
  anyOf: [
1433
+ {
1434
+ $ref: '#/definitions/menuDivider'
1435
+ },
1353
1436
  {
1354
1437
  $ref: '#/definitions/menuGroup'
1355
1438
  },
@@ -1427,6 +1510,16 @@ export default {
1427
1510
  type: 'MenuLink "input" should be an object.'
1428
1511
  }
1429
1512
  },
1513
+ style: {
1514
+ errorMessage: {
1515
+ type: 'MenuLink "style" should be an object, string, or array.'
1516
+ }
1517
+ },
1518
+ class: {
1519
+ errorMessage: {
1520
+ type: 'MenuLink "class" should be a string, array, or object.'
1521
+ }
1522
+ },
1430
1523
  properties: {
1431
1524
  type: 'object',
1432
1525
  errorMessage: {
@@ -1631,6 +1724,20 @@ export default {
1631
1724
  type: 'App "version" should be a string.'
1632
1725
  }
1633
1726
  },
1727
+ slug: {
1728
+ type: 'string',
1729
+ pattern: '^[a-z][a-z0-9]*(-[a-z0-9]+)*$',
1730
+ errorMessage: {
1731
+ type: 'App "slug" should be a string.',
1732
+ pattern: 'App "slug" must be kebab-case: lowercase letters and digits, hyphen-separated, starting with a letter, no leading/trailing/consecutive hyphens, no underscores.'
1733
+ }
1734
+ },
1735
+ description: {
1736
+ type: 'string',
1737
+ errorMessage: {
1738
+ type: 'App "description" should be a string.'
1739
+ }
1740
+ },
1634
1741
  app: {
1635
1742
  $ref: '#/definitions/app'
1636
1743
  },
@@ -1688,6 +1795,69 @@ export default {
1688
1795
  errorMessage: {
1689
1796
  type: 'App "config.homePageId" should be a string.'
1690
1797
  }
1798
+ },
1799
+ i18n: {
1800
+ type: 'object',
1801
+ additionalProperties: false,
1802
+ required: [
1803
+ 'defaultLocale',
1804
+ 'locales'
1805
+ ],
1806
+ properties: {
1807
+ '~k': {},
1808
+ '~r': {},
1809
+ '~l': {},
1810
+ defaultLocale: {
1811
+ type: 'string',
1812
+ description: 'BCP 47 locale code used when no user preference or browser match is available.'
1813
+ },
1814
+ locales: {
1815
+ type: 'array',
1816
+ minItems: 1,
1817
+ items: {
1818
+ type: 'object',
1819
+ additionalProperties: false,
1820
+ required: [
1821
+ 'code'
1822
+ ],
1823
+ properties: {
1824
+ '~k': {},
1825
+ '~r': {},
1826
+ '~l': {},
1827
+ code: {
1828
+ type: 'string',
1829
+ description: 'BCP 47 locale code (e.g. "en-US", "de-DE").'
1830
+ },
1831
+ label: {
1832
+ type: 'string',
1833
+ description: 'Human-readable label for language pickers.'
1834
+ },
1835
+ antd: {
1836
+ type: 'string',
1837
+ description: 'Ant Design locale module name (e.g. "en_US"). Loaded from antd/locale/{name}.'
1838
+ },
1839
+ dayjs: {
1840
+ type: 'string',
1841
+ description: 'Dayjs locale id (e.g. "en", "zh-cn").'
1842
+ }
1843
+ }
1844
+ }
1845
+ },
1846
+ messages: {
1847
+ type: 'object',
1848
+ description: 'Translation messages keyed by locale code. Each locale maps to an object of { key: ICU MessageFormat string }.',
1849
+ additionalProperties: {
1850
+ type: 'object'
1851
+ }
1852
+ }
1853
+ },
1854
+ errorMessage: {
1855
+ type: 'App "config.i18n" should be an object.',
1856
+ required: {
1857
+ defaultLocale: 'App "config.i18n" requires "defaultLocale".',
1858
+ locales: 'App "config.i18n" requires a "locales" array.'
1859
+ }
1860
+ }
1691
1861
  }
1692
1862
  }
1693
1863
  },
@@ -0,0 +1,37 @@
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
+ */ import path from 'path';
17
+ import { writeFile } from '@lowdefy/node-utils';
18
+ import defaultPackages from '../defaultPackages.js';
19
+ async function generateDefaultMessagesMap() {
20
+ const defaultMessagesMap = {};
21
+ for (const packageName of defaultPackages){
22
+ let messagesModule;
23
+ try {
24
+ messagesModule = await import(`${packageName}/messages`);
25
+ } catch (e) {
26
+ continue;
27
+ }
28
+ const messages = messagesModule.default ?? messagesModule;
29
+ if (!messages || typeof messages !== 'object') continue;
30
+ defaultMessagesMap[packageName] = messages;
31
+ }
32
+ await writeFile(path.resolve(process.cwd(), './dist/defaultMessagesMap.js'), `const defaultMessagesMap = ${JSON.stringify(defaultMessagesMap, null, 2)};
33
+
34
+ export default defaultMessagesMap;
35
+ `);
36
+ }
37
+ generateDefaultMessagesMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/build",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -45,17 +45,17 @@
45
45
  "dist/*"
46
46
  ],
47
47
  "dependencies": {
48
- "@lowdefy/ai-utils": "5.3.0",
49
- "@lowdefy/ajv": "5.3.0",
50
- "@lowdefy/block-utils": "5.3.0",
51
- "@lowdefy/blocks-basic": "5.3.0",
52
- "@lowdefy/blocks-loaders": "5.3.0",
53
- "@lowdefy/errors": "5.3.0",
54
- "@lowdefy/helpers": "5.3.0",
55
- "@lowdefy/node-utils": "5.3.0",
56
- "@lowdefy/nunjucks": "5.3.0",
57
- "@lowdefy/operators": "5.3.0",
58
- "@lowdefy/operators-js": "5.3.0",
48
+ "@lowdefy/ai-utils": "5.4.0",
49
+ "@lowdefy/ajv": "5.4.0",
50
+ "@lowdefy/block-utils": "5.4.0",
51
+ "@lowdefy/blocks-basic": "5.4.0",
52
+ "@lowdefy/blocks-loaders": "5.4.0",
53
+ "@lowdefy/errors": "5.4.0",
54
+ "@lowdefy/helpers": "5.4.0",
55
+ "@lowdefy/node-utils": "5.4.0",
56
+ "@lowdefy/nunjucks": "5.4.0",
57
+ "@lowdefy/operators": "5.4.0",
58
+ "@lowdefy/operators-js": "5.4.0",
59
59
  "ajv": "8.12.0",
60
60
  "json5": "2.2.3",
61
61
  "picomatch": "4.0.1",
@@ -66,44 +66,44 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@jest/globals": "28.1.3",
69
- "@lowdefy/actions-core": "5.3.0",
70
- "@lowdefy/actions-pdf-make": "5.3.0",
71
- "@lowdefy/blocks-aggrid": "5.3.0",
72
- "@lowdefy/blocks-antd": "5.3.0",
73
- "@lowdefy/blocks-antd-x": "5.3.0",
74
- "@lowdefy/blocks-diff": "5.3.0",
75
- "@lowdefy/blocks-echarts": "5.3.0",
76
- "@lowdefy/blocks-google-maps": "5.3.0",
77
- "@lowdefy/blocks-markdown": "5.3.0",
78
- "@lowdefy/blocks-qr": "5.3.0",
79
- "@lowdefy/blocks-tiptap": "5.3.0",
80
- "@lowdefy/connection-ai-gateway": "5.3.0",
81
- "@lowdefy/connection-anthropic": "5.3.0",
82
- "@lowdefy/connection-axios-http": "5.3.0",
83
- "@lowdefy/connection-elasticsearch": "5.3.0",
84
- "@lowdefy/connection-google": "5.3.0",
85
- "@lowdefy/connection-google-sheets": "5.3.0",
86
- "@lowdefy/connection-knex": "5.3.0",
87
- "@lowdefy/connection-mcp": "5.3.0",
88
- "@lowdefy/connection-mongodb": "5.3.0",
89
- "@lowdefy/connection-openai": "5.3.0",
90
- "@lowdefy/connection-redis": "5.3.0",
91
- "@lowdefy/connection-sendgrid": "5.3.0",
92
- "@lowdefy/connection-stripe": "5.3.0",
93
- "@lowdefy/connection-test": "5.3.0",
94
- "@lowdefy/logger": "5.3.0",
95
- "@lowdefy/operators-change-case": "5.3.0",
96
- "@lowdefy/operators-dayjs": "5.3.0",
97
- "@lowdefy/operators-diff": "5.3.0",
98
- "@lowdefy/operators-jsonata": "5.3.0",
99
- "@lowdefy/operators-mql": "5.3.0",
100
- "@lowdefy/operators-nunjucks": "5.3.0",
101
- "@lowdefy/operators-uuid": "5.3.0",
102
- "@lowdefy/operators-yaml": "5.3.0",
103
- "@lowdefy/plugin-auth0": "5.3.0",
104
- "@lowdefy/plugin-aws": "5.3.0",
105
- "@lowdefy/plugin-csv": "5.3.0",
106
- "@lowdefy/plugin-next-auth": "5.3.0",
69
+ "@lowdefy/actions-core": "5.4.0",
70
+ "@lowdefy/actions-pdf-make": "5.4.0",
71
+ "@lowdefy/blocks-aggrid": "5.4.0",
72
+ "@lowdefy/blocks-antd": "5.4.0",
73
+ "@lowdefy/blocks-antd-x": "5.4.0",
74
+ "@lowdefy/blocks-diff": "5.4.0",
75
+ "@lowdefy/blocks-echarts": "5.4.0",
76
+ "@lowdefy/blocks-google-maps": "5.4.0",
77
+ "@lowdefy/blocks-markdown": "5.4.0",
78
+ "@lowdefy/blocks-qr": "5.4.0",
79
+ "@lowdefy/blocks-tiptap": "5.4.0",
80
+ "@lowdefy/connection-ai-gateway": "5.4.0",
81
+ "@lowdefy/connection-anthropic": "5.4.0",
82
+ "@lowdefy/connection-axios-http": "5.4.0",
83
+ "@lowdefy/connection-elasticsearch": "5.4.0",
84
+ "@lowdefy/connection-google": "5.4.0",
85
+ "@lowdefy/connection-google-sheets": "5.4.0",
86
+ "@lowdefy/connection-knex": "5.4.0",
87
+ "@lowdefy/connection-mcp": "5.4.0",
88
+ "@lowdefy/connection-mongodb": "5.4.0",
89
+ "@lowdefy/connection-openai": "5.4.0",
90
+ "@lowdefy/connection-redis": "5.4.0",
91
+ "@lowdefy/connection-sendgrid": "5.4.0",
92
+ "@lowdefy/connection-stripe": "5.4.0",
93
+ "@lowdefy/connection-test": "5.4.0",
94
+ "@lowdefy/logger": "5.4.0",
95
+ "@lowdefy/operators-change-case": "5.4.0",
96
+ "@lowdefy/operators-dayjs": "5.4.0",
97
+ "@lowdefy/operators-diff": "5.4.0",
98
+ "@lowdefy/operators-jsonata": "5.4.0",
99
+ "@lowdefy/operators-mql": "5.4.0",
100
+ "@lowdefy/operators-nunjucks": "5.4.0",
101
+ "@lowdefy/operators-uuid": "5.4.0",
102
+ "@lowdefy/operators-yaml": "5.4.0",
103
+ "@lowdefy/plugin-auth0": "5.4.0",
104
+ "@lowdefy/plugin-aws": "5.4.0",
105
+ "@lowdefy/plugin-csv": "5.4.0",
106
+ "@lowdefy/plugin-next-auth": "5.4.0",
107
107
  "@swc/cli": "0.8.0",
108
108
  "@swc/core": "1.15.18",
109
109
  "@swc/jest": "0.2.39",
@@ -114,7 +114,7 @@
114
114
  "access": "public"
115
115
  },
116
116
  "scripts": {
117
- "build": "swc src --out-dir dist --config-file ../../.swcrc --cli-config-file ../../.swc-cli.json && node dist/scripts/generateDefaultTypes.js",
117
+ "build": "swc src --out-dir dist --config-file ../../.swcrc --cli-config-file ../../.swc-cli.json && node dist/scripts/generateDefaultTypes.js && node dist/scripts/generateDefaultMessages.js",
118
118
  "clean": "rm -rf dist",
119
119
  "start": "node dist/scripts/run.js",
120
120
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",