@lowdefy/build 4.0.0-rc.1 → 4.0.0-rc.10
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/build/addDefaultPages/addDefaultPages.js +1 -1
- package/dist/build/addKeys.js +48 -0
- package/dist/build/buildAuth/buildAuth.js +1 -1
- package/dist/build/buildAuth/buildAuthPlugins.js +4 -4
- package/dist/build/buildAuth/buildPageAuth.js +1 -1
- package/dist/build/buildAuth/getPageRoles.js +1 -1
- package/dist/build/buildAuth/getProtectedPages.js +1 -1
- package/dist/build/buildAuth/validateAuthConfig.js +1 -1
- package/dist/build/buildConnections.js +1 -1
- package/dist/build/buildImports/buildIconImports.js +3 -3
- package/dist/build/buildImports/buildImports.js +1 -1
- package/dist/build/buildImports/buildImportsDev.js +3 -3
- package/dist/build/buildImports/buildImportsProd.js +1 -1
- package/dist/build/buildImports/buildStyleImports.js +1 -1
- package/dist/build/buildMenu.js +3 -3
- package/dist/build/buildPages/buildBlock/buildEvents.js +1 -1
- package/dist/build/buildPages/buildBlock/buildRequests.js +1 -1
- package/dist/build/buildPages/buildBlock/countBlockOperators.js +2 -2
- package/dist/build/buildPages/buildBlock/countBlockTypes.js +1 -1
- package/dist/build/buildPages/buildBlock/setBlockId.js +1 -1
- package/dist/build/buildPages/buildBlock/validateBlock.js +1 -1
- package/dist/build/buildPages/buildPage.js +1 -1
- package/dist/build/buildPages/buildPages.js +1 -1
- package/dist/build/buildPages/buildTestPage.js +1 -1
- package/dist/build/buildRefs/buildRefs.js +2 -2
- package/dist/build/buildRefs/evaluateBuildOperators.js +4 -4
- package/dist/build/buildRefs/getConfigFile.js +1 -1
- package/dist/build/buildRefs/getKey.js +1 -1
- package/dist/build/buildRefs/getRefContent.js +1 -1
- package/dist/build/buildRefs/getRefsFromFile.js +2 -2
- package/dist/build/buildRefs/getUserJavascriptFunction.js +1 -1
- package/dist/build/buildRefs/makeRefDefinition.js +10 -4
- package/dist/build/buildRefs/parseRefContent.js +2 -2
- package/dist/build/buildRefs/populateRefs.js +1 -1
- package/dist/build/buildRefs/recursiveBuild.js +20 -7
- package/dist/build/buildRefs/runRefResolver.js +1 -1
- package/dist/build/buildRefs/runTransformer.js +1 -1
- package/dist/build/buildTypes.js +3 -3
- package/dist/build/cleanBuildDirectory.js +1 -1
- package/dist/build/copyPublicFolder.js +1 -1
- package/dist/build/testSchema.js +2 -2
- package/dist/build/updateServerPackageJson.js +2 -7
- package/dist/build/validateApp.js +1 -1
- package/dist/build/validateConfig.js +1 -1
- package/dist/build/writeApp.js +5 -2
- package/dist/build/writeAuth.js +5 -2
- package/dist/build/writeConfig.js +5 -2
- package/dist/build/writeConnections.js +5 -3
- package/dist/build/writeGlobal.js +5 -3
- package/dist/build/writeMaps.js +30 -0
- package/dist/build/writeMenus.js +5 -3
- package/dist/build/writePages.js +6 -3
- package/dist/build/writePluginImports/generateImportFile.js +1 -1
- package/dist/build/writePluginImports/writeActionImports.js +1 -1
- package/dist/build/writePluginImports/writeAuthImports.js +1 -1
- package/dist/build/writePluginImports/writeBlockImports.js +1 -1
- package/dist/build/writePluginImports/writeConnectionImports.js +1 -1
- package/dist/build/writePluginImports/writeIconImports.js +1 -1
- package/dist/build/writePluginImports/writeOperatorImports.js +1 -1
- package/dist/build/writePluginImports/writePluginImports.js +1 -1
- package/dist/build/writePluginImports/writeStyleImports.js +1 -1
- package/dist/build/writeRequests.js +6 -3
- package/dist/build/writeTypes.js +5 -2
- package/dist/createContext.js +3 -1
- package/dist/defaultTypesMap.js +339 -356
- package/dist/index.js +10 -0
- package/dist/lowdefySchema.js +6 -0
- package/dist/scripts/generateDefaultTypes.js +1 -1
- package/dist/test/testContext.js +4 -2
- package/dist/utils/countOperators.js +1 -1
- package/dist/utils/createCheckDuplicateId.js +2 -2
- package/dist/utils/createPluginTypesMap.js +2 -2
- package/dist/utils/formatErrorMessage.js +3 -3
- package/dist/utils/makeId.js +20 -0
- package/dist/utils/readConfigFile.js +1 -1
- package/dist/utils/writeBuildArtifact.js +1 -1
- package/package.json +45 -46
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/ import createContext from './createContext.js';
|
|
16
16
|
import createPluginTypesMap from './utils/createPluginTypesMap.js';
|
|
17
17
|
import addDefaultPages from './build/addDefaultPages/addDefaultPages.js';
|
|
18
|
+
import addKeys from './build/addKeys.js';
|
|
18
19
|
import buildAuth from './build/buildAuth/buildAuth.js';
|
|
19
20
|
import buildConnections from './build/buildConnections.js';
|
|
20
21
|
import buildImports from './build/buildImports/buildImports.js';
|
|
@@ -34,6 +35,7 @@ import writePluginImports from './build/writePluginImports/writePluginImports.js
|
|
|
34
35
|
import writeConfig from './build/writeConfig.js';
|
|
35
36
|
import writeConnections from './build/writeConnections.js';
|
|
36
37
|
import writeGlobal from './build/writeGlobal.js';
|
|
38
|
+
import writeMaps from './build/writeMaps.js';
|
|
37
39
|
import writeMenus from './build/writeMenus.js';
|
|
38
40
|
import writePages from './build/writePages.js';
|
|
39
41
|
import writeRequests from './build/writeRequests.js';
|
|
@@ -75,6 +77,10 @@ async function build(options) {
|
|
|
75
77
|
components,
|
|
76
78
|
context
|
|
77
79
|
});
|
|
80
|
+
addKeys({
|
|
81
|
+
components,
|
|
82
|
+
context
|
|
83
|
+
});
|
|
78
84
|
buildTypes({
|
|
79
85
|
components,
|
|
80
86
|
context
|
|
@@ -114,6 +120,10 @@ async function build(options) {
|
|
|
114
120
|
components,
|
|
115
121
|
context
|
|
116
122
|
});
|
|
123
|
+
await writeMaps({
|
|
124
|
+
components,
|
|
125
|
+
context
|
|
126
|
+
});
|
|
117
127
|
await writeMenus({
|
|
118
128
|
components,
|
|
119
129
|
context
|
package/dist/lowdefySchema.js
CHANGED
|
@@ -73,7 +73,7 @@ async function generateDefaultTypesMap() {
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
await Promise.all(defaultPackages.map(async (packageName)=>{
|
|
76
|
-
const { default: types
|
|
76
|
+
const { default: types } = await import(`${packageName}/types`);
|
|
77
77
|
const version = packageFile.devDependencies[packageName] || packageFile.dependencies[packageName];
|
|
78
78
|
createPluginTypesMap({
|
|
79
79
|
packageTypes: types,
|
package/dist/test/testContext.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import createCounter from '../utils/createCounter.js';
|
|
16
|
-
function testContext({ writeBuildArtifact
|
|
16
|
+
function testContext({ writeBuildArtifact, configDirectory, readConfigFile, logger = {} } = {}) {
|
|
17
17
|
const defaultLogger = {
|
|
18
18
|
info: ()=>{},
|
|
19
19
|
log: ()=>{},
|
|
@@ -43,7 +43,9 @@ function testContext({ writeBuildArtifact , configDirectory , readConfigFile , l
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
writeBuildArtifact: writeBuildArtifact || (()=>{}),
|
|
46
|
-
readConfigFile: readConfigFile || (()=>{})
|
|
46
|
+
readConfigFile: readConfigFile || (()=>{}),
|
|
47
|
+
refMap: {},
|
|
48
|
+
keyMap: {}
|
|
47
49
|
};
|
|
48
50
|
context.logger = {
|
|
49
51
|
...defaultLogger,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
-
function countOperators(obj, { counter
|
|
16
|
+
function countOperators(obj, { counter }) {
|
|
17
17
|
function getOperatorsReviver(_, value) {
|
|
18
18
|
if (type.isObject(value) && Object.keys(value).length === 1) {
|
|
19
19
|
const key = Object.keys(value)[0];
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { nunjucksFunction } from '@lowdefy/nunjucks';
|
|
16
|
-
function createCheckDuplicateId({ message
|
|
16
|
+
function createCheckDuplicateId({ message }) {
|
|
17
17
|
const template = nunjucksFunction(message);
|
|
18
18
|
const ids = new Set();
|
|
19
|
-
function checkDuplicateId({ id
|
|
19
|
+
function checkDuplicateId({ id, blockId, eventId, menuId, pageId }) {
|
|
20
20
|
if (ids.has(id)) throw new Error(template({
|
|
21
21
|
id,
|
|
22
22
|
blockId,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
-
function createTypeDefinitions({ packageName
|
|
16
|
+
function createTypeDefinitions({ packageName, store, typeNames, typePrefix, version }) {
|
|
17
17
|
if (type.isArray(typeNames)) {
|
|
18
18
|
typeNames.forEach((typeName)=>{
|
|
19
19
|
store[`${typePrefix}${typeName}`] = {
|
|
@@ -24,7 +24,7 @@ function createTypeDefinitions({ packageName , store , typeNames , typePrefix ,
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function createPluginTypesMap({ packageName
|
|
27
|
+
function createPluginTypesMap({ packageName, packageTypes, typePrefix = '', typesMap, version }) {
|
|
28
28
|
createTypeDefinitions({
|
|
29
29
|
typeNames: packageTypes.actions,
|
|
30
30
|
store: typesMap.actions,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { get, type } from '@lowdefy/helpers';
|
|
16
|
-
function formatArrayKey({ index
|
|
16
|
+
function formatArrayKey({ index, object }) {
|
|
17
17
|
if (type.isObject(object) && (!type.isNone(object.id) || !type.isNone(object.type))) {
|
|
18
18
|
const objectId = type.isNone(object.id) ? '_ERROR_MISSING_ID_' : object.id;
|
|
19
19
|
const objectType = type.isNone(object.type) ? '_ERROR_MISSING_TYPE_' : object.type;
|
|
@@ -21,7 +21,7 @@ function formatArrayKey({ index , object }) {
|
|
|
21
21
|
}
|
|
22
22
|
return `[${index}]`;
|
|
23
23
|
}
|
|
24
|
-
function recursiveFormatPath({ data
|
|
24
|
+
function recursiveFormatPath({ data, instancePath, formattedPath = '', gap = '', root = false }) {
|
|
25
25
|
if (instancePath.length === 0) return formattedPath;
|
|
26
26
|
const key = instancePath.shift();
|
|
27
27
|
const newData = get(data, key);
|
|
@@ -43,7 +43,7 @@ ${gap}- ${formatArrayKey({
|
|
|
43
43
|
gap
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
function formatErrorMessage({ error
|
|
46
|
+
function formatErrorMessage({ error, components }) {
|
|
47
47
|
const formattedPath = recursiveFormatPath({
|
|
48
48
|
data: components,
|
|
49
49
|
instancePath: error.instancePath.split('/').slice(1),
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2023 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
|
+
*/ let id_counter = 0;
|
|
16
|
+
function makeId() {
|
|
17
|
+
id_counter++;
|
|
18
|
+
return id_counter.toString(36);
|
|
19
|
+
}
|
|
20
|
+
export default makeId;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import path from 'path';
|
|
16
16
|
import { cachedPromises } from '@lowdefy/helpers';
|
|
17
17
|
import { readFile } from '@lowdefy/node-utils';
|
|
18
|
-
function createReadConfigFile({ directories
|
|
18
|
+
function createReadConfigFile({ directories }) {
|
|
19
19
|
async function readConfigFile(filePath) {
|
|
20
20
|
return readFile(path.resolve(directories.config, filePath));
|
|
21
21
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import path from 'path';
|
|
16
16
|
import { writeFile } from '@lowdefy/node-utils';
|
|
17
|
-
function createWriteBuildArtifact({ directories
|
|
17
|
+
function createWriteBuildArtifact({ directories }) {
|
|
18
18
|
async function writeBuildArtifact(filePath, content) {
|
|
19
19
|
await writeFile(path.join(directories.build, filePath), content);
|
|
20
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/build",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -51,57 +51,56 @@
|
|
|
51
51
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@lowdefy/ajv": "4.0.0-rc.
|
|
55
|
-
"@lowdefy/blocks-basic": "4.0.0-rc.
|
|
56
|
-
"@lowdefy/blocks-loaders": "4.0.0-rc.
|
|
57
|
-
"@lowdefy/helpers": "4.0.0-rc.
|
|
58
|
-
"@lowdefy/node-utils": "4.0.0-rc.
|
|
59
|
-
"@lowdefy/nunjucks": "4.0.0-rc.
|
|
60
|
-
"@lowdefy/operators": "4.0.0-rc.
|
|
61
|
-
"@lowdefy/operators-js": "4.0.0-rc.
|
|
54
|
+
"@lowdefy/ajv": "4.0.0-rc.10",
|
|
55
|
+
"@lowdefy/blocks-basic": "4.0.0-rc.10",
|
|
56
|
+
"@lowdefy/blocks-loaders": "4.0.0-rc.10",
|
|
57
|
+
"@lowdefy/helpers": "4.0.0-rc.10",
|
|
58
|
+
"@lowdefy/node-utils": "4.0.0-rc.10",
|
|
59
|
+
"@lowdefy/nunjucks": "4.0.0-rc.10",
|
|
60
|
+
"@lowdefy/operators": "4.0.0-rc.10",
|
|
61
|
+
"@lowdefy/operators-js": "4.0.0-rc.10",
|
|
62
62
|
"ajv": "8.12.0",
|
|
63
63
|
"json5": "2.2.3",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"yargs": "17.6.2"
|
|
64
|
+
"yaml": "2.2.2",
|
|
65
|
+
"yargs": "17.7.2"
|
|
67
66
|
},
|
|
68
67
|
"devDependencies": {
|
|
69
|
-
"@jest/globals": "28.1.
|
|
70
|
-
"@lowdefy/actions-core": "4.0.0-rc.
|
|
71
|
-
"@lowdefy/actions-pdf-make": "4.0.0-rc.
|
|
72
|
-
"@lowdefy/blocks-aggrid": "4.0.0-rc.
|
|
73
|
-
"@lowdefy/blocks-antd": "4.0.0-rc.
|
|
74
|
-
"@lowdefy/blocks-color-selectors": "4.0.0-rc.
|
|
75
|
-
"@lowdefy/blocks-echarts": "4.0.0-rc.
|
|
76
|
-
"@lowdefy/blocks-google-maps": "4.0.0-rc.
|
|
77
|
-
"@lowdefy/blocks-markdown": "4.0.0-rc.
|
|
78
|
-
"@lowdefy/blocks-qr": "4.0.0-rc.
|
|
79
|
-
"@lowdefy/connection-axios-http": "4.0.0-rc.
|
|
80
|
-
"@lowdefy/connection-elasticsearch": "4.0.0-rc.
|
|
81
|
-
"@lowdefy/connection-google-sheets": "4.0.0-rc.
|
|
82
|
-
"@lowdefy/connection-knex": "4.0.0-rc.
|
|
83
|
-
"@lowdefy/connection-mongodb": "4.0.0-rc.
|
|
84
|
-
"@lowdefy/connection-redis": "4.0.0-rc.
|
|
85
|
-
"@lowdefy/connection-sendgrid": "4.0.0-rc.
|
|
86
|
-
"@lowdefy/connection-stripe": "4.0.0-rc.
|
|
87
|
-
"@lowdefy/operators-change-case": "4.0.0-rc.
|
|
88
|
-
"@lowdefy/operators-diff": "4.0.0-rc.
|
|
89
|
-
"@lowdefy/operators-moment": "4.0.0-rc.
|
|
90
|
-
"@lowdefy/operators-mql": "4.0.0-rc.
|
|
91
|
-
"@lowdefy/operators-nunjucks": "4.0.0-rc.
|
|
92
|
-
"@lowdefy/operators-uuid": "4.0.0-rc.
|
|
93
|
-
"@lowdefy/operators-yaml": "4.0.0-rc.
|
|
94
|
-
"@lowdefy/plugin-auth0": "4.0.0-rc.
|
|
95
|
-
"@lowdefy/plugin-aws": "4.0.0-rc.
|
|
96
|
-
"@lowdefy/plugin-csv": "4.0.0-rc.
|
|
97
|
-
"@lowdefy/plugin-next-auth": "4.0.0-rc.
|
|
98
|
-
"@swc/cli": "0.1.
|
|
99
|
-
"@swc/core": "1.3.
|
|
100
|
-
"@swc/jest": "0.2.
|
|
101
|
-
"jest": "28.1.
|
|
68
|
+
"@jest/globals": "28.1.3",
|
|
69
|
+
"@lowdefy/actions-core": "4.0.0-rc.10",
|
|
70
|
+
"@lowdefy/actions-pdf-make": "4.0.0-rc.10",
|
|
71
|
+
"@lowdefy/blocks-aggrid": "4.0.0-rc.10",
|
|
72
|
+
"@lowdefy/blocks-antd": "4.0.0-rc.10",
|
|
73
|
+
"@lowdefy/blocks-color-selectors": "4.0.0-rc.10",
|
|
74
|
+
"@lowdefy/blocks-echarts": "4.0.0-rc.10",
|
|
75
|
+
"@lowdefy/blocks-google-maps": "4.0.0-rc.10",
|
|
76
|
+
"@lowdefy/blocks-markdown": "4.0.0-rc.10",
|
|
77
|
+
"@lowdefy/blocks-qr": "4.0.0-rc.10",
|
|
78
|
+
"@lowdefy/connection-axios-http": "4.0.0-rc.10",
|
|
79
|
+
"@lowdefy/connection-elasticsearch": "4.0.0-rc.10",
|
|
80
|
+
"@lowdefy/connection-google-sheets": "4.0.0-rc.10",
|
|
81
|
+
"@lowdefy/connection-knex": "4.0.0-rc.10",
|
|
82
|
+
"@lowdefy/connection-mongodb": "4.0.0-rc.10",
|
|
83
|
+
"@lowdefy/connection-redis": "4.0.0-rc.10",
|
|
84
|
+
"@lowdefy/connection-sendgrid": "4.0.0-rc.10",
|
|
85
|
+
"@lowdefy/connection-stripe": "4.0.0-rc.10",
|
|
86
|
+
"@lowdefy/operators-change-case": "4.0.0-rc.10",
|
|
87
|
+
"@lowdefy/operators-diff": "4.0.0-rc.10",
|
|
88
|
+
"@lowdefy/operators-moment": "4.0.0-rc.10",
|
|
89
|
+
"@lowdefy/operators-mql": "4.0.0-rc.10",
|
|
90
|
+
"@lowdefy/operators-nunjucks": "4.0.0-rc.10",
|
|
91
|
+
"@lowdefy/operators-uuid": "4.0.0-rc.10",
|
|
92
|
+
"@lowdefy/operators-yaml": "4.0.0-rc.10",
|
|
93
|
+
"@lowdefy/plugin-auth0": "4.0.0-rc.10",
|
|
94
|
+
"@lowdefy/plugin-aws": "4.0.0-rc.10",
|
|
95
|
+
"@lowdefy/plugin-csv": "4.0.0-rc.10",
|
|
96
|
+
"@lowdefy/plugin-next-auth": "4.0.0-rc.10",
|
|
97
|
+
"@swc/cli": "0.1.62",
|
|
98
|
+
"@swc/core": "1.3.70",
|
|
99
|
+
"@swc/jest": "0.2.27",
|
|
100
|
+
"jest": "28.1.3"
|
|
102
101
|
},
|
|
103
102
|
"publishConfig": {
|
|
104
103
|
"access": "public"
|
|
105
104
|
},
|
|
106
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "537af074f27770e32da9da8d48490f2eda94b406"
|
|
107
106
|
}
|