@lowdefy/build 4.0.0-alpha.6 → 4.0.0-alpha.9
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/404.js +1 -1
- package/dist/build/addDefaultPages/addDefaultPages.js +7 -3
- package/dist/build/buildAuth/buildAuth.js +1 -1
- package/dist/build/buildAuth/getPageRoles.js +1 -1
- package/dist/build/buildAuth/getProtectedPages.js +1 -1
- package/dist/build/buildConnections.js +1 -1
- package/dist/build/buildIcons.js +3 -3
- package/dist/build/buildMenu.js +1 -1
- package/dist/build/buildPages/buildBlock/buildBlock.js +6 -2
- package/dist/build/buildPages/buildBlock/buildEvents.js +5 -2
- package/dist/build/buildPages/buildBlock/buildRequests.js +1 -1
- package/dist/build/buildPages/buildBlock/buildSubBlocks.js +1 -1
- package/dist/build/buildPages/buildBlock/countBlockOperators.js +2 -2
- package/dist/build/buildPages/buildBlock/countBlockTypes.js +18 -0
- package/dist/build/buildPages/buildBlock/moveSkeletonBlocksToArea.js +35 -0
- package/dist/build/buildPages/buildBlock/moveSubBlocksToArea.js +1 -1
- package/dist/build/buildPages/buildBlock/setBlockId.js +1 -1
- package/dist/build/buildPages/buildBlock/validateBlock.js +2 -3
- package/dist/build/buildPages/buildPage.js +1 -1
- package/dist/build/buildPages/buildPages.js +1 -1
- package/dist/build/buildRefs/buildRefs.js +2 -1
- package/dist/build/buildRefs/evaluateBuildOperators.js +35 -0
- package/dist/build/buildRefs/getConfigFile.js +1 -1
- package/dist/build/buildRefs/getRefContent.js +2 -2
- package/dist/build/buildRefs/getRefPath.js +1 -1
- package/dist/build/buildRefs/getRefsFromFile.js +1 -1
- package/dist/build/buildRefs/getUserJavascriptFunction.js +7 -4
- package/dist/build/buildRefs/makeRefDefinition.js +1 -1
- package/dist/build/buildRefs/parseNunjucks.js +1 -1
- package/dist/build/buildRefs/parseRefContent.js +3 -3
- package/dist/build/buildRefs/populateRefs.js +1 -1
- package/dist/build/buildRefs/recursiveBuild.js +9 -3
- package/dist/build/buildRefs/runRefResolver.js +1 -1
- package/dist/build/buildRefs/runTransformer.js +8 -4
- package/dist/build/buildStyles.js +3 -3
- package/dist/build/buildTypes.js +39 -20
- package/dist/build/cleanBuildDirectory.js +2 -2
- package/dist/build/copyPublicFolder.js +23 -0
- package/dist/build/testSchema.js +1 -1
- package/dist/build/updateServerPackageJson.js +2 -5
- package/dist/build/validateApp.js +1 -1
- package/dist/build/validateConfig.js +6 -1
- package/dist/build/writeApp.js +2 -5
- package/dist/build/writeConfig.js +2 -5
- package/dist/build/writeConnections.js +2 -5
- package/dist/build/writeGlobal.js +2 -5
- package/dist/build/writeMenus.js +2 -5
- package/dist/build/writePages.js +3 -14
- package/dist/build/writePluginImports/generateImportFile.js +7 -7
- package/dist/build/writePluginImports/writeActionImports.js +22 -0
- package/dist/build/writePluginImports/writeBlockImports.js +5 -8
- package/dist/build/writePluginImports/writeConnectionImports.js +5 -8
- package/dist/build/writePluginImports/writeIconImports.js +4 -7
- package/dist/build/writePluginImports/writeOperatorImports.js +9 -16
- package/dist/build/writePluginImports/writeStyleImports.js +5 -7
- package/dist/build/writeRequests.js +3 -8
- package/dist/build/writeTypes.js +2 -5
- package/dist/defaultTypesMap.json +1598 -0
- package/dist/index.js +134 -126
- package/dist/lowdefySchema.js +50 -12
- package/dist/scripts/generateDefaultTypes.js +26 -65
- package/dist/scripts/run.js +8 -4
- package/dist/test/buildRefs/testBuildRefsAsyncFunction.js +2 -2
- package/dist/test/buildRefs/testBuildRefsErrorResolver.js +2 -2
- package/dist/test/buildRefs/testBuildRefsNullResolver.js +2 -2
- package/dist/test/buildRefs/testBuildRefsParsingResolver.js +2 -2
- package/dist/test/buildRefs/testBuildRefsResolver.js +2 -2
- package/dist/test/buildRefs/testBuildRefsTransform.js +2 -2
- package/dist/test/buildRefs/testBuildRefsTransformIdentity.js +2 -2
- package/dist/test/testContext.js +1 -1
- package/dist/utils/countOperators.js +1 -1
- package/dist/utils/createCheckDuplicateId.js +1 -1
- package/dist/utils/createCounter.js +1 -1
- package/dist/utils/createPluginTypesMap.js +85 -0
- package/dist/utils/formatErrorMessage.js +2 -2
- package/dist/utils/{files/readConfigFile.js → readConfigFile.js} +1 -1
- package/dist/utils/{files/writeBuildArtifact.js → writeBuildArtifact.js} +3 -6
- package/package.json +41 -27
- package/dist/defaultTypes.json +0 -1159
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 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
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
function createTypeDefinitions({ packageName , store , typeNames , typePrefix , version }) {
|
|
17
|
+
if (type.isArray(typeNames)) {
|
|
18
|
+
typeNames.forEach((typeName)=>{
|
|
19
|
+
store[`${typePrefix}${typeName}`] = {
|
|
20
|
+
package: packageName,
|
|
21
|
+
originalTypeName: typeName,
|
|
22
|
+
version
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function createPluginTypesMap({ packageName , packageTypes , typePrefix ='' , typesMap , version }) {
|
|
28
|
+
createTypeDefinitions({
|
|
29
|
+
typeNames: packageTypes.actions,
|
|
30
|
+
store: typesMap.actions,
|
|
31
|
+
packageName,
|
|
32
|
+
typePrefix,
|
|
33
|
+
version
|
|
34
|
+
});
|
|
35
|
+
createTypeDefinitions({
|
|
36
|
+
typeNames: packageTypes.blocks,
|
|
37
|
+
store: typesMap.blocks,
|
|
38
|
+
packageName,
|
|
39
|
+
typePrefix,
|
|
40
|
+
version
|
|
41
|
+
});
|
|
42
|
+
createTypeDefinitions({
|
|
43
|
+
typeNames: packageTypes.connections,
|
|
44
|
+
store: typesMap.connections,
|
|
45
|
+
packageName,
|
|
46
|
+
typePrefix,
|
|
47
|
+
version
|
|
48
|
+
});
|
|
49
|
+
createTypeDefinitions({
|
|
50
|
+
typeNames: type.isObject(packageTypes.operators) ? packageTypes.operators.client : [],
|
|
51
|
+
store: typesMap.operators.client,
|
|
52
|
+
packageName,
|
|
53
|
+
typePrefix,
|
|
54
|
+
version
|
|
55
|
+
});
|
|
56
|
+
createTypeDefinitions({
|
|
57
|
+
typeNames: type.isObject(packageTypes.operators) ? packageTypes.operators.server : [],
|
|
58
|
+
store: typesMap.operators.server,
|
|
59
|
+
packageName,
|
|
60
|
+
typePrefix,
|
|
61
|
+
version
|
|
62
|
+
});
|
|
63
|
+
createTypeDefinitions({
|
|
64
|
+
typeNames: packageTypes.requests,
|
|
65
|
+
store: typesMap.requests,
|
|
66
|
+
packageName,
|
|
67
|
+
typePrefix,
|
|
68
|
+
version
|
|
69
|
+
});
|
|
70
|
+
if (type.isObject(packageTypes.styles)) {
|
|
71
|
+
Object.entries(packageTypes.styles).forEach(([blockType, styles])=>{
|
|
72
|
+
if (blockType === 'default') {
|
|
73
|
+
typesMap.styles.packages[packageName] = styles;
|
|
74
|
+
} else {
|
|
75
|
+
typesMap.styles.blocks[`${typePrefix}${blockType}`] = styles;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (type.isObject(packageTypes.icons)) {
|
|
80
|
+
Object.entries(packageTypes.icons).forEach(([blockType, icons])=>{
|
|
81
|
+
typesMap.icons[`${typePrefix}${blockType}`] = icons;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export default createPluginTypesMap;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { get, type } from '@lowdefy/helpers';
|
|
16
16
|
function formatArrayKey({ index , object }) {
|
|
17
|
-
if (!type.isNone(object.id) || !type.isNone(object.type)) {
|
|
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;
|
|
20
20
|
return `[${index}:${objectId}:${objectType}]`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -15,11 +15,8 @@
|
|
|
15
15
|
*/ import path from 'path';
|
|
16
16
|
import { writeFile } from '@lowdefy/node-utils';
|
|
17
17
|
function createWriteBuildArtifact({ directories }) {
|
|
18
|
-
async function writeBuildArtifact(
|
|
19
|
-
|
|
20
|
-
filePath: path.resolve(directories.build, filePath),
|
|
21
|
-
content
|
|
22
|
-
});
|
|
18
|
+
async function writeBuildArtifact(filePath, content) {
|
|
19
|
+
await writeFile(path.join(directories.build, filePath), content);
|
|
23
20
|
}
|
|
24
21
|
return writeBuildArtifact;
|
|
25
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/build",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.9",
|
|
4
4
|
"licence": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
"name": "Gerrie van Wyk",
|
|
20
20
|
"url": "https://github.com/Gervwyk"
|
|
21
21
|
},
|
|
22
|
+
{
|
|
23
|
+
"name": "Johann Möller",
|
|
24
|
+
"url": "https://github.com/JohannMoller"
|
|
25
|
+
},
|
|
22
26
|
{
|
|
23
27
|
"name": "Sandile Memela",
|
|
24
28
|
"url": "https://github.com/sah-memela"
|
|
@@ -42,41 +46,51 @@
|
|
|
42
46
|
"prepare": "yarn build",
|
|
43
47
|
"start": "node dist/scripts/run.js",
|
|
44
48
|
"swc": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start",
|
|
45
|
-
"test": "
|
|
49
|
+
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
|
|
46
50
|
},
|
|
47
51
|
"dependencies": {
|
|
48
|
-
"@lowdefy/ajv": "4.0.0-alpha.
|
|
49
|
-
"@lowdefy/
|
|
50
|
-
"@lowdefy/
|
|
51
|
-
"@lowdefy/
|
|
52
|
-
"
|
|
53
|
-
"
|
|
52
|
+
"@lowdefy/ajv": "4.0.0-alpha.9",
|
|
53
|
+
"@lowdefy/blocks-basic": "4.0.0-alpha.9",
|
|
54
|
+
"@lowdefy/blocks-loaders": "4.0.0-alpha.9",
|
|
55
|
+
"@lowdefy/helpers": "4.0.0-alpha.9",
|
|
56
|
+
"@lowdefy/node-utils": "4.0.0-alpha.9",
|
|
57
|
+
"@lowdefy/nunjucks": "4.0.0-alpha.9",
|
|
58
|
+
"@lowdefy/operators": "4.0.0-alpha.9",
|
|
59
|
+
"@lowdefy/operators-js": "4.0.0-alpha.9",
|
|
60
|
+
"ajv": "8.9.0",
|
|
54
61
|
"json5": "2.2.0",
|
|
55
|
-
"uuid": "8.3.2"
|
|
62
|
+
"uuid": "8.3.2",
|
|
63
|
+
"yaml": "2.0.0-10",
|
|
64
|
+
"yargs": "17.3.1"
|
|
56
65
|
},
|
|
57
66
|
"devDependencies": {
|
|
58
|
-
"@
|
|
59
|
-
"@lowdefy/
|
|
60
|
-
"@lowdefy/blocks-
|
|
61
|
-
"@lowdefy/blocks-
|
|
62
|
-
"@lowdefy/blocks-
|
|
63
|
-
"@lowdefy/blocks-markdown": "4.0.0-alpha.
|
|
64
|
-
"@lowdefy/connection-axios-http": "4.0.0-alpha.
|
|
65
|
-
"@lowdefy/connection-
|
|
66
|
-
"@lowdefy/
|
|
67
|
-
"@lowdefy/
|
|
68
|
-
"@lowdefy/
|
|
69
|
-
"@lowdefy/
|
|
70
|
-
"@lowdefy/
|
|
71
|
-
"@lowdefy/
|
|
72
|
-
"@lowdefy/operators-
|
|
67
|
+
"@jest/globals": "27.5.1",
|
|
68
|
+
"@lowdefy/actions-core": "4.0.0-alpha.9",
|
|
69
|
+
"@lowdefy/blocks-antd": "4.0.0-alpha.9",
|
|
70
|
+
"@lowdefy/blocks-color-selectors": "4.0.0-alpha.9",
|
|
71
|
+
"@lowdefy/blocks-echarts": "4.0.0-alpha.9",
|
|
72
|
+
"@lowdefy/blocks-markdown": "4.0.0-alpha.9",
|
|
73
|
+
"@lowdefy/connection-axios-http": "4.0.0-alpha.9",
|
|
74
|
+
"@lowdefy/connection-elasticsearch": "4.0.0-alpha.9",
|
|
75
|
+
"@lowdefy/connection-google-sheets": "4.0.0-alpha.9",
|
|
76
|
+
"@lowdefy/connection-knex": "4.0.0-alpha.9",
|
|
77
|
+
"@lowdefy/connection-mongodb": "4.0.0-alpha.9",
|
|
78
|
+
"@lowdefy/connection-redis": "4.0.0-alpha.9",
|
|
79
|
+
"@lowdefy/connection-sendgrid": "4.0.0-alpha.9",
|
|
80
|
+
"@lowdefy/connection-stripe": "4.0.0-alpha.9",
|
|
81
|
+
"@lowdefy/operators-change-case": "4.0.0-alpha.9",
|
|
82
|
+
"@lowdefy/operators-diff": "4.0.0-alpha.9",
|
|
83
|
+
"@lowdefy/operators-mql": "4.0.0-alpha.9",
|
|
84
|
+
"@lowdefy/operators-nunjucks": "4.0.0-alpha.9",
|
|
85
|
+
"@lowdefy/operators-uuid": "4.0.0-alpha.9",
|
|
86
|
+
"@lowdefy/operators-yaml": "4.0.0-alpha.9",
|
|
73
87
|
"@swc/cli": "0.1.55",
|
|
74
|
-
"@swc/core": "1.2.
|
|
88
|
+
"@swc/core": "1.2.135",
|
|
75
89
|
"@swc/jest": "0.2.17",
|
|
76
|
-
"jest": "27.
|
|
90
|
+
"jest": "27.5.1"
|
|
77
91
|
},
|
|
78
92
|
"publishConfig": {
|
|
79
93
|
"access": "public"
|
|
80
94
|
},
|
|
81
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "98b544eca231bdcfca6c3a8601a891835d5ce571"
|
|
82
96
|
}
|