@lowdefy/build 4.0.0-alpha.5 → 4.0.0-alpha.8
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 +36 -41
- package/dist/build/addDefaultPages/addDefaultPages.js +6 -2
- package/dist/build/buildAuth/getPageRoles.js +1 -2
- package/dist/build/buildConnections.js +1 -2
- package/dist/build/buildIcons.js +42 -14
- package/dist/build/buildPages/buildBlock/buildEvents.js +4 -1
- package/dist/build/buildPages/buildBlock/buildRequests.js +1 -2
- package/dist/build/buildPages/buildBlock/countBlockOperators.js +2 -4
- package/dist/build/buildRefs/buildRefs.js +2 -2
- package/dist/build/buildRefs/evaluateBuildOperators.js +35 -0
- package/dist/build/buildRefs/getRefContent.js +1 -1
- package/dist/build/buildRefs/getUserJavascriptFunction.js +6 -3
- package/dist/build/buildRefs/makeRefDefinition.js +1 -2
- package/dist/build/buildRefs/parseRefContent.js +2 -2
- package/dist/build/buildRefs/recursiveBuild.js +9 -4
- package/dist/build/buildRefs/runTransformer.js +7 -3
- package/dist/build/buildStyles.js +2 -2
- package/dist/build/buildTypes.js +35 -31
- package/dist/build/cleanBuildDirectory.js +1 -1
- package/dist/build/copyPublicFolder.js +23 -0
- package/dist/build/updateServerPackageJson.js +2 -6
- package/dist/build/validateApp.js +2 -8
- package/dist/build/validateConfig.js +12 -8
- package/dist/build/writeApp.js +1 -5
- package/dist/build/writeConfig.js +1 -5
- package/dist/build/writeConnections.js +1 -4
- package/dist/build/writeGlobal.js +2 -6
- package/dist/build/writeMenus.js +1 -4
- package/dist/build/writePages.js +2 -13
- package/dist/build/writePluginImports/generateImportFile.js +6 -6
- package/dist/build/writePluginImports/writeActionImports.js +22 -0
- package/dist/build/writePluginImports/writeBlockImports.js +4 -7
- package/dist/build/writePluginImports/writeConnectionImports.js +4 -7
- package/dist/build/writePluginImports/writeIconImports.js +10 -16
- package/dist/build/writePluginImports/writeOperatorImports.js +8 -15
- package/dist/build/writePluginImports/writeStyleImports.js +3 -6
- package/dist/build/writeRequests.js +2 -7
- package/dist/build/writeTypes.js +1 -4
- package/dist/defaultTypesMap.json +1499 -0
- package/dist/index.js +133 -124
- package/dist/lowdefySchema.js +69 -28
- package/dist/scripts/generateDefaultTypes.js +34 -70
- package/dist/scripts/run.js +7 -3
- package/dist/test/buildRefs/testBuildRefsAsyncFunction.js +2 -5
- package/dist/test/buildRefs/testBuildRefsErrorResolver.js +1 -1
- package/dist/test/buildRefs/testBuildRefsNullResolver.js +1 -1
- package/dist/test/buildRefs/testBuildRefsParsingResolver.js +1 -1
- package/dist/test/buildRefs/testBuildRefsResolver.js +1 -1
- package/dist/test/buildRefs/testBuildRefsTransform.js +1 -1
- package/dist/test/buildRefs/testBuildRefsTransformIdentity.js +1 -1
- package/dist/test/testContext.js +8 -17
- package/dist/utils/createPluginTypesMap.js +85 -0
- package/dist/utils/formatErrorMessage.js +1 -1
- package/dist/utils/{files/readConfigFile.js → readConfigFile.js} +0 -0
- package/dist/utils/{files/writeBuildArtifact.js → writeBuildArtifact.js} +2 -5
- package/package.json +47 -23
- package/dist/defaultTypes.json +0 -896
package/dist/test/testContext.js
CHANGED
|
@@ -13,20 +13,13 @@
|
|
|
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 , configDirectory , readConfigFile , logger ={
|
|
17
|
-
} } = {
|
|
18
|
-
}) {
|
|
16
|
+
function testContext({ writeBuildArtifact , configDirectory , readConfigFile , logger ={} } = {}) {
|
|
19
17
|
const defaultLogger = {
|
|
20
|
-
info: ()=>{
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
error: ()=>{
|
|
27
|
-
},
|
|
28
|
-
succeed: ()=>{
|
|
29
|
-
}
|
|
18
|
+
info: ()=>{},
|
|
19
|
+
log: ()=>{},
|
|
20
|
+
warn: ()=>{},
|
|
21
|
+
error: ()=>{},
|
|
22
|
+
succeed: ()=>{}
|
|
30
23
|
};
|
|
31
24
|
const context = {
|
|
32
25
|
id: 'test',
|
|
@@ -43,10 +36,8 @@ function testContext({ writeBuildArtifact , configDirectory , readConfigFile , l
|
|
|
43
36
|
server: createCounter()
|
|
44
37
|
}
|
|
45
38
|
},
|
|
46
|
-
writeBuildArtifact: writeBuildArtifact || (()=>{
|
|
47
|
-
})
|
|
48
|
-
readConfigFile: readConfigFile || (()=>{
|
|
49
|
-
})
|
|
39
|
+
writeBuildArtifact: writeBuildArtifact || (()=>{}),
|
|
40
|
+
readConfigFile: readConfigFile || (()=>{})
|
|
50
41
|
};
|
|
51
42
|
context.logger = {
|
|
52
43
|
...defaultLogger,
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2021 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;
|
|
@@ -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}]`;
|
|
File without changes
|
|
@@ -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.8",
|
|
4
4
|
"licence": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -18,6 +18,14 @@
|
|
|
18
18
|
{
|
|
19
19
|
"name": "Gerrie van Wyk",
|
|
20
20
|
"url": "https://github.com/Gervwyk"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "Johann Möller",
|
|
24
|
+
"url": "https://github.com/JohannMoller"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "Sandile Memela",
|
|
28
|
+
"url": "https://github.com/sah-memela"
|
|
21
29
|
}
|
|
22
30
|
],
|
|
23
31
|
"repository": {
|
|
@@ -38,35 +46,51 @@
|
|
|
38
46
|
"prepare": "yarn build",
|
|
39
47
|
"start": "node dist/scripts/run.js",
|
|
40
48
|
"swc": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start",
|
|
41
|
-
"test": "
|
|
49
|
+
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
|
|
42
50
|
},
|
|
43
51
|
"dependencies": {
|
|
44
|
-
"@lowdefy/ajv": "4.0.0-alpha.
|
|
45
|
-
"@lowdefy/helpers": "4.0.0-alpha.
|
|
46
|
-
"@lowdefy/node-utils": "4.0.0-alpha.
|
|
47
|
-
"@lowdefy/nunjucks": "4.0.0-alpha.
|
|
48
|
-
"
|
|
49
|
-
"js
|
|
52
|
+
"@lowdefy/ajv": "4.0.0-alpha.8",
|
|
53
|
+
"@lowdefy/helpers": "4.0.0-alpha.8",
|
|
54
|
+
"@lowdefy/node-utils": "4.0.0-alpha.8",
|
|
55
|
+
"@lowdefy/nunjucks": "4.0.0-alpha.8",
|
|
56
|
+
"@lowdefy/operators": "4.0.0-alpha.8",
|
|
57
|
+
"@lowdefy/operators-js": "4.0.0-alpha.8",
|
|
58
|
+
"ajv": "8.9.0",
|
|
50
59
|
"json5": "2.2.0",
|
|
51
|
-
"uuid": "8.3.2"
|
|
60
|
+
"uuid": "8.3.2",
|
|
61
|
+
"yaml": "2.0.0-10",
|
|
62
|
+
"yargs": "17.3.1"
|
|
52
63
|
},
|
|
53
64
|
"devDependencies": {
|
|
54
|
-
"@
|
|
55
|
-
"@lowdefy/
|
|
56
|
-
"@lowdefy/blocks-
|
|
57
|
-
"@lowdefy/blocks-
|
|
58
|
-
"@lowdefy/blocks-
|
|
59
|
-
"@lowdefy/blocks-
|
|
60
|
-
"@lowdefy/
|
|
61
|
-
"@lowdefy/
|
|
62
|
-
"@lowdefy/
|
|
63
|
-
"@
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
66
|
-
"
|
|
65
|
+
"@jest/globals": "27.5.1",
|
|
66
|
+
"@lowdefy/actions-core": "4.0.0-alpha.8",
|
|
67
|
+
"@lowdefy/blocks-antd": "4.0.0-alpha.8",
|
|
68
|
+
"@lowdefy/blocks-basic": "4.0.0-alpha.8",
|
|
69
|
+
"@lowdefy/blocks-color-selectors": "4.0.0-alpha.8",
|
|
70
|
+
"@lowdefy/blocks-echarts": "4.0.0-alpha.8",
|
|
71
|
+
"@lowdefy/blocks-loaders": "4.0.0-alpha.8",
|
|
72
|
+
"@lowdefy/blocks-markdown": "4.0.0-alpha.8",
|
|
73
|
+
"@lowdefy/connection-axios-http": "4.0.0-alpha.8",
|
|
74
|
+
"@lowdefy/connection-elasticsearch": "4.0.0-alpha.8",
|
|
75
|
+
"@lowdefy/connection-google-sheets": "4.0.0-alpha.8",
|
|
76
|
+
"@lowdefy/connection-knex": "4.0.0-alpha.8",
|
|
77
|
+
"@lowdefy/connection-mongodb": "4.0.0-alpha.8",
|
|
78
|
+
"@lowdefy/connection-redis": "4.0.0-alpha.8",
|
|
79
|
+
"@lowdefy/connection-sendgrid": "4.0.0-alpha.8",
|
|
80
|
+
"@lowdefy/connection-stripe": "4.0.0-alpha.8",
|
|
81
|
+
"@lowdefy/operators-change-case": "4.0.0-alpha.8",
|
|
82
|
+
"@lowdefy/operators-diff": "4.0.0-alpha.8",
|
|
83
|
+
"@lowdefy/operators-mql": "4.0.0-alpha.8",
|
|
84
|
+
"@lowdefy/operators-nunjucks": "4.0.0-alpha.8",
|
|
85
|
+
"@lowdefy/operators-uuid": "4.0.0-alpha.8",
|
|
86
|
+
"@lowdefy/operators-yaml": "4.0.0-alpha.8",
|
|
87
|
+
"@swc/cli": "0.1.55",
|
|
88
|
+
"@swc/core": "1.2.135",
|
|
89
|
+
"@swc/jest": "0.2.17",
|
|
90
|
+
"jest": "27.5.1"
|
|
67
91
|
},
|
|
68
92
|
"publishConfig": {
|
|
69
93
|
"access": "public"
|
|
70
94
|
},
|
|
71
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "9d56b83cf45e868afe3a1eeba750fe826eb74c8c"
|
|
72
96
|
}
|