@lowdefy/build 4.0.0-alpha.1 → 4.0.0-alpha.12
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 +37 -42
- package/dist/build/addDefaultPages/addDefaultPages.js +7 -3
- package/dist/build/buildAuth/buildAuth.js +10 -29
- package/dist/build/buildAuth/buildAuthPlugins.js +78 -0
- package/dist/build/buildAuth/buildPageAuth.js +50 -0
- package/dist/build/buildAuth/getPageRoles.js +3 -4
- package/dist/build/buildAuth/getProtectedPages.js +6 -6
- package/dist/build/buildAuth/validateAuthConfig.js +61 -0
- package/dist/build/buildConnections.js +2 -3
- package/dist/build/buildImports/buildIconImports.js +87 -0
- package/dist/build/buildImports/buildImports.js +30 -0
- package/dist/build/buildImports/buildImportsDev.js +103 -0
- package/dist/build/buildImports/buildImportsProd.js +54 -0
- package/dist/build/buildImports/buildStyleImports.js +28 -0
- package/dist/build/buildImports/defaultIconsDev.js +584 -0
- package/dist/build/buildImports/defaultIconsProd.js +21 -0
- 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 +2 -3
- package/dist/build/buildPages/buildBlock/buildSubBlocks.js +1 -1
- package/dist/build/buildPages/buildBlock/countBlockOperators.js +4 -6
- 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 +3 -3
- 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 +2 -3
- 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 +10 -5
- package/dist/build/buildRefs/runRefResolver.js +1 -1
- package/dist/build/buildRefs/runTransformer.js +8 -4
- package/dist/build/buildTypes.js +72 -43
- package/dist/build/cleanBuildDirectory.js +2 -2
- package/dist/build/copyPublicFolder.js +23 -0
- package/dist/build/testSchema.js +3 -4
- package/dist/build/updateServerPackageJson.js +49 -0
- package/dist/build/validateApp.js +3 -5
- package/dist/build/validateConfig.js +8 -28
- package/dist/build/writeApp.js +2 -6
- package/dist/build/writeAuth.js +18 -0
- package/dist/build/writeConfig.js +2 -6
- package/dist/build/writeConnections.js +2 -5
- package/dist/build/writeGlobal.js +3 -7
- package/dist/build/writeMenus.js +2 -5
- package/dist/build/writePages.js +3 -14
- package/dist/build/writePluginImports/generateImportFile.js +31 -0
- package/dist/build/writePluginImports/writeActionImports.js +22 -0
- package/dist/build/writePluginImports/writeAuthImports.js +30 -0
- package/dist/build/writePluginImports/writeBlockImports.js +6 -23
- package/dist/build/writePluginImports/writeConnectionImports.js +6 -23
- package/dist/build/writePluginImports/writeIconImports.js +31 -0
- package/dist/build/writePluginImports/writeOperatorImports.js +26 -0
- package/dist/build/writePluginImports/writePluginImports.js +52 -0
- package/dist/build/writePluginImports/writeStyleImports.js +28 -0
- package/dist/build/writeRequests.js +3 -8
- package/dist/build/writeTypes.js +2 -5
- package/dist/defaultTypesMap.json +1874 -0
- package/dist/index.js +126 -112
- package/dist/lowdefySchema.js +173 -79
- package/dist/scripts/generateDefaultTypes.js +47 -75
- package/dist/scripts/run.js +14 -12
- package/dist/test/buildRefs/testBuildRefsAsyncFunction.js +3 -6
- 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 +12 -19
- 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 +106 -0
- package/dist/utils/formatErrorMessage.js +2 -2
- package/dist/utils/{files/readConfigFile.js → readConfigFile.js} +3 -3
- package/dist/utils/{files/writeBuildArtifact.js → writeBuildArtifact.js} +4 -7
- package/package.json +48 -16
- package/dist/defaultTypes.json +0 -60
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
|
-
Copyright 2020-
|
|
3
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
4
4
|
|
|
5
5
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
you may not use this file except in compliance with the License.
|
|
@@ -14,93 +14,65 @@
|
|
|
14
14
|
See the License for the specific language governing permissions and
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*/ import path from 'path';
|
|
17
|
-
import { type } from '@lowdefy/helpers';
|
|
18
17
|
import { readFile, writeFile } from '@lowdefy/node-utils';
|
|
18
|
+
import createPluginTypesMap from '../utils/createPluginTypesMap.js';
|
|
19
19
|
const defaultPackages = [
|
|
20
|
+
'@lowdefy/actions-core',
|
|
21
|
+
'@lowdefy/blocks-antd',
|
|
20
22
|
'@lowdefy/blocks-basic',
|
|
21
|
-
'@lowdefy/
|
|
23
|
+
'@lowdefy/blocks-color-selectors',
|
|
24
|
+
'@lowdefy/blocks-echarts',
|
|
25
|
+
'@lowdefy/blocks-loaders',
|
|
26
|
+
'@lowdefy/blocks-markdown',
|
|
27
|
+
'@lowdefy/connection-axios-http',
|
|
28
|
+
'@lowdefy/connection-elasticsearch',
|
|
29
|
+
'@lowdefy/connection-google-sheets',
|
|
30
|
+
'@lowdefy/connection-knex',
|
|
31
|
+
'@lowdefy/connection-mongodb',
|
|
32
|
+
'@lowdefy/connection-redis',
|
|
33
|
+
'@lowdefy/connection-sendgrid',
|
|
34
|
+
'@lowdefy/connection-stripe',
|
|
35
|
+
'@lowdefy/operators-change-case',
|
|
36
|
+
'@lowdefy/operators-diff',
|
|
37
|
+
'@lowdefy/operators-js',
|
|
38
|
+
'@lowdefy/operators-mql',
|
|
39
|
+
'@lowdefy/operators-nunjucks',
|
|
40
|
+
'@lowdefy/operators-uuid',
|
|
41
|
+
'@lowdefy/operators-yaml',
|
|
42
|
+
'@lowdefy/plugin-next-auth',
|
|
22
43
|
];
|
|
23
|
-
function
|
|
24
|
-
if (type.isArray(typeNames)) {
|
|
25
|
-
typeNames.forEach((typeName)=>{
|
|
26
|
-
store[typeName] = {
|
|
27
|
-
package: packageName,
|
|
28
|
-
version
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
async function generateDefaultTypes() {
|
|
44
|
+
async function generateDefaultTypesMap() {
|
|
34
45
|
const packageFile = JSON.parse(await readFile(path.resolve(process.cwd(), './package.json')));
|
|
35
|
-
const
|
|
36
|
-
actions: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
requests: {
|
|
46
|
+
const defaultTypesMap = {
|
|
47
|
+
actions: {},
|
|
48
|
+
auth: {
|
|
49
|
+
callbacks: {},
|
|
50
|
+
events: {},
|
|
51
|
+
providers: {}
|
|
43
52
|
},
|
|
53
|
+
blocks: {},
|
|
54
|
+
connections: {},
|
|
55
|
+
icons: {},
|
|
44
56
|
operators: {
|
|
45
|
-
client: {
|
|
46
|
-
}
|
|
47
|
-
server: {
|
|
48
|
-
}
|
|
57
|
+
client: {},
|
|
58
|
+
server: {}
|
|
49
59
|
},
|
|
50
|
-
|
|
60
|
+
requests: {},
|
|
61
|
+
styles: {
|
|
62
|
+
packages: {},
|
|
63
|
+
blocks: {}
|
|
64
|
+
}
|
|
51
65
|
};
|
|
52
66
|
await Promise.all(defaultPackages.map(async (packageName)=>{
|
|
53
67
|
const { default: types } = await import(`${packageName}/types`);
|
|
54
|
-
const version = packageFile.devDependencies[packageName];
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
packageName,
|
|
59
|
-
version
|
|
60
|
-
});
|
|
61
|
-
createTypeDefinitions({
|
|
62
|
-
typeNames: types.blocks,
|
|
63
|
-
store: defaultTypes.blocks,
|
|
64
|
-
packageName,
|
|
65
|
-
version
|
|
66
|
-
});
|
|
67
|
-
createTypeDefinitions({
|
|
68
|
-
typeNames: types.connections,
|
|
69
|
-
store: defaultTypes.connections,
|
|
70
|
-
packageName,
|
|
71
|
-
version
|
|
72
|
-
});
|
|
73
|
-
createTypeDefinitions({
|
|
74
|
-
typeNames: types.requests,
|
|
75
|
-
store: defaultTypes.requests,
|
|
68
|
+
const version = packageFile.devDependencies[packageName] || packageFile.dependencies[packageName];
|
|
69
|
+
createPluginTypesMap({
|
|
70
|
+
packageTypes: types,
|
|
71
|
+
typesMap: defaultTypesMap,
|
|
76
72
|
packageName,
|
|
77
73
|
version
|
|
78
74
|
});
|
|
79
|
-
createTypeDefinitions({
|
|
80
|
-
typeNames: type.isObject(types.operators) ? types.operators.client : [],
|
|
81
|
-
store: defaultTypes.operators.client,
|
|
82
|
-
packageName,
|
|
83
|
-
version
|
|
84
|
-
});
|
|
85
|
-
createTypeDefinitions({
|
|
86
|
-
typeNames: type.isObject(types.operators) ? types.operators.server : [],
|
|
87
|
-
store: defaultTypes.operators.server,
|
|
88
|
-
packageName,
|
|
89
|
-
version
|
|
90
|
-
});
|
|
91
|
-
if (type.isArray(types.styles)) {
|
|
92
|
-
types.styles.forEach((pathName)=>{
|
|
93
|
-
defaultTypes.styles.push({
|
|
94
|
-
path: pathName,
|
|
95
|
-
package: packageName,
|
|
96
|
-
version: packageFile.devDependencies[packageName]
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
75
|
}));
|
|
101
|
-
await writeFile(
|
|
102
|
-
filePath: path.resolve(process.cwd(), './dist/defaultTypes.json'),
|
|
103
|
-
content: JSON.stringify(defaultTypes, null, 2)
|
|
104
|
-
});
|
|
76
|
+
await writeFile(path.resolve(process.cwd(), './dist/defaultTypesMap.json'), JSON.stringify(defaultTypesMap, null, 2));
|
|
105
77
|
}
|
|
106
|
-
|
|
78
|
+
generateDefaultTypesMap();
|
package/dist/scripts/run.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
|
-
Copyright 2020-
|
|
3
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
4
4
|
|
|
5
5
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
you may not use this file except in compliance with the License.
|
|
@@ -14,18 +14,20 @@
|
|
|
14
14
|
See the License for the specific language governing permissions and
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*/ import path from 'path';
|
|
17
|
+
import yargs from 'yargs';
|
|
18
|
+
import { hideBin } from 'yargs/helpers';
|
|
17
19
|
import build from '../index.js';
|
|
20
|
+
const argv = yargs(hideBin(process.argv)).argv;
|
|
18
21
|
async function run() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
22
|
+
await build({
|
|
23
|
+
directories: {
|
|
24
|
+
build: path.resolve(argv.buildDirectory || process.env.LOWDEFY_DIRECTORY_BUILD || path.join(process.cwd(), 'build')),
|
|
25
|
+
config: path.resolve(argv.configDirectory || process.env.LOWDEFY_DIRECTORY_CONFIG || process.cwd()),
|
|
26
|
+
server: path.resolve(argv.serverDirectory || process.env.LOWDEFY_DIRECTORY_SERVER || process.cwd())
|
|
27
|
+
},
|
|
28
|
+
logger: console,
|
|
29
|
+
refResolver: argv.refResolver || process.env.LOWDEFY_BUILD_REF_RESOLVER,
|
|
30
|
+
stage: argv.stage || process.env.LOWDEFY_BUILD_STAGE || 'prod'
|
|
31
|
+
});
|
|
30
32
|
}
|
|
31
33
|
run();
|
|
@@ -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.
|
|
@@ -12,14 +12,11 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
return new Promise((resolve)=>setTimeout(resolve, ms)
|
|
17
|
-
);
|
|
18
|
-
};
|
|
15
|
+
*/ import { wait } from '@lowdefy/helpers';
|
|
19
16
|
async function asyncFn() {
|
|
20
17
|
await wait(20);
|
|
21
18
|
return {
|
|
22
19
|
async: true
|
|
23
20
|
};
|
|
24
21
|
}
|
|
25
|
-
|
|
22
|
+
export default asyncFn;
|
|
@@ -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,4 +15,4 @@
|
|
|
15
15
|
*/ function resolver() {
|
|
16
16
|
throw new Error('Test error');
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
export default resolver;
|
|
@@ -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.
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
if (path === 'null') return null;
|
|
17
17
|
return undefined;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
export default resolver;
|
|
@@ -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.
|
|
@@ -36,4 +36,4 @@ array:
|
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
export default resolver;
|
|
@@ -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.
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
contextId: context.id
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
export default resolver;
|
|
@@ -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.
|
|
@@ -22,4 +22,4 @@ function transformer(obj, vars) {
|
|
|
22
22
|
var: vars.var1
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
export default transformer;
|
|
@@ -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.
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
vars
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
export default transformer;
|
package/dist/test/testContext.js
CHANGED
|
@@ -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.
|
|
@@ -13,24 +13,19 @@
|
|
|
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',
|
|
33
|
-
|
|
26
|
+
directories: {
|
|
27
|
+
config: configDirectory || ''
|
|
28
|
+
},
|
|
34
29
|
typeCounters: {
|
|
35
30
|
actions: createCounter(),
|
|
36
31
|
blocks: createCounter(),
|
|
@@ -41,10 +36,8 @@ function testContext({ writeBuildArtifact , configDirectory , readConfigFile , l
|
|
|
41
36
|
server: createCounter()
|
|
42
37
|
}
|
|
43
38
|
},
|
|
44
|
-
writeBuildArtifact: writeBuildArtifact || (()=>{
|
|
45
|
-
})
|
|
46
|
-
readConfigFile: readConfigFile || (()=>{
|
|
47
|
-
})
|
|
39
|
+
writeBuildArtifact: writeBuildArtifact || (()=>{}),
|
|
40
|
+
readConfigFile: readConfigFile || (()=>{})
|
|
48
41
|
};
|
|
49
42
|
context.logger = {
|
|
50
43
|
...defaultLogger,
|
|
@@ -0,0 +1,106 @@
|
|
|
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: type.isObject(packageTypes.auth) ? packageTypes.auth.callbacks : [],
|
|
37
|
+
store: typesMap.auth.callbacks,
|
|
38
|
+
packageName,
|
|
39
|
+
typePrefix,
|
|
40
|
+
version
|
|
41
|
+
});
|
|
42
|
+
createTypeDefinitions({
|
|
43
|
+
typeNames: type.isObject(packageTypes.auth) ? packageTypes.auth.events : [],
|
|
44
|
+
store: typesMap.auth.events,
|
|
45
|
+
packageName,
|
|
46
|
+
typePrefix,
|
|
47
|
+
version
|
|
48
|
+
});
|
|
49
|
+
createTypeDefinitions({
|
|
50
|
+
typeNames: type.isObject(packageTypes.auth) ? packageTypes.auth.providers : [],
|
|
51
|
+
store: typesMap.auth.providers,
|
|
52
|
+
packageName,
|
|
53
|
+
typePrefix,
|
|
54
|
+
version
|
|
55
|
+
});
|
|
56
|
+
createTypeDefinitions({
|
|
57
|
+
typeNames: packageTypes.blocks,
|
|
58
|
+
store: typesMap.blocks,
|
|
59
|
+
packageName,
|
|
60
|
+
typePrefix,
|
|
61
|
+
version
|
|
62
|
+
});
|
|
63
|
+
createTypeDefinitions({
|
|
64
|
+
typeNames: packageTypes.connections,
|
|
65
|
+
store: typesMap.connections,
|
|
66
|
+
packageName,
|
|
67
|
+
typePrefix,
|
|
68
|
+
version
|
|
69
|
+
});
|
|
70
|
+
createTypeDefinitions({
|
|
71
|
+
typeNames: type.isObject(packageTypes.operators) ? packageTypes.operators.client : [],
|
|
72
|
+
store: typesMap.operators.client,
|
|
73
|
+
packageName,
|
|
74
|
+
typePrefix,
|
|
75
|
+
version
|
|
76
|
+
});
|
|
77
|
+
createTypeDefinitions({
|
|
78
|
+
typeNames: type.isObject(packageTypes.operators) ? packageTypes.operators.server : [],
|
|
79
|
+
store: typesMap.operators.server,
|
|
80
|
+
packageName,
|
|
81
|
+
typePrefix,
|
|
82
|
+
version
|
|
83
|
+
});
|
|
84
|
+
createTypeDefinitions({
|
|
85
|
+
typeNames: packageTypes.requests,
|
|
86
|
+
store: typesMap.requests,
|
|
87
|
+
packageName,
|
|
88
|
+
typePrefix,
|
|
89
|
+
version
|
|
90
|
+
});
|
|
91
|
+
if (type.isObject(packageTypes.styles)) {
|
|
92
|
+
Object.entries(packageTypes.styles).forEach(([blockType, styles])=>{
|
|
93
|
+
if (blockType === 'default') {
|
|
94
|
+
typesMap.styles.packages[packageName] = styles;
|
|
95
|
+
} else {
|
|
96
|
+
typesMap.styles.blocks[`${typePrefix}${blockType}`] = styles;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (type.isObject(packageTypes.icons)) {
|
|
101
|
+
Object.entries(packageTypes.icons).forEach(([blockType, icons])=>{
|
|
102
|
+
typesMap.icons[`${typePrefix}${blockType}`] = icons;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
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,9 +15,9 @@
|
|
|
15
15
|
*/ import path from 'path';
|
|
16
16
|
import { cachedPromises } from '@lowdefy/helpers';
|
|
17
17
|
import { readFile } from '@lowdefy/node-utils';
|
|
18
|
-
function createReadConfigFile({
|
|
18
|
+
function createReadConfigFile({ directories }) {
|
|
19
19
|
async function readConfigFile(filePath) {
|
|
20
|
-
return readFile(path.resolve(
|
|
20
|
+
return readFile(path.resolve(directories.config, filePath));
|
|
21
21
|
}
|
|
22
22
|
return cachedPromises(readConfigFile);
|
|
23
23
|
}
|
|
@@ -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,12 +14,9 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import path from 'path';
|
|
16
16
|
import { writeFile } from '@lowdefy/node-utils';
|
|
17
|
-
function createWriteBuildArtifact({
|
|
18
|
-
async function writeBuildArtifact(
|
|
19
|
-
|
|
20
|
-
filePath: path.resolve(buildDirectory, filePath),
|
|
21
|
-
content
|
|
22
|
-
});
|
|
17
|
+
function createWriteBuildArtifact({ directories }) {
|
|
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.12",
|
|
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,28 +46,52 @@
|
|
|
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/
|
|
46
|
-
"@lowdefy/
|
|
47
|
-
"@lowdefy/
|
|
48
|
-
"
|
|
49
|
-
"
|
|
52
|
+
"@lowdefy/ajv": "4.0.0-alpha.12",
|
|
53
|
+
"@lowdefy/blocks-basic": "4.0.0-alpha.12",
|
|
54
|
+
"@lowdefy/blocks-loaders": "4.0.0-alpha.12",
|
|
55
|
+
"@lowdefy/helpers": "4.0.0-alpha.12",
|
|
56
|
+
"@lowdefy/node-utils": "4.0.0-alpha.12",
|
|
57
|
+
"@lowdefy/nunjucks": "4.0.0-alpha.12",
|
|
58
|
+
"@lowdefy/operators": "4.0.0-alpha.12",
|
|
59
|
+
"@lowdefy/operators-js": "4.0.0-alpha.12",
|
|
60
|
+
"ajv": "8.9.0",
|
|
50
61
|
"json5": "2.2.0",
|
|
51
|
-
"uuid": "8.3.2"
|
|
62
|
+
"uuid": "8.3.2",
|
|
63
|
+
"yaml": "2.0.0-10",
|
|
64
|
+
"yargs": "17.3.1"
|
|
52
65
|
},
|
|
53
66
|
"devDependencies": {
|
|
54
|
-
"@
|
|
55
|
-
"@lowdefy/
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"
|
|
67
|
+
"@jest/globals": "27.5.1",
|
|
68
|
+
"@lowdefy/actions-core": "4.0.0-alpha.12",
|
|
69
|
+
"@lowdefy/blocks-antd": "4.0.0-alpha.12",
|
|
70
|
+
"@lowdefy/blocks-color-selectors": "4.0.0-alpha.12",
|
|
71
|
+
"@lowdefy/blocks-echarts": "4.0.0-alpha.12",
|
|
72
|
+
"@lowdefy/blocks-markdown": "4.0.0-alpha.12",
|
|
73
|
+
"@lowdefy/connection-axios-http": "4.0.0-alpha.12",
|
|
74
|
+
"@lowdefy/connection-elasticsearch": "4.0.0-alpha.12",
|
|
75
|
+
"@lowdefy/connection-google-sheets": "4.0.0-alpha.12",
|
|
76
|
+
"@lowdefy/connection-knex": "4.0.0-alpha.12",
|
|
77
|
+
"@lowdefy/connection-mongodb": "4.0.0-alpha.12",
|
|
78
|
+
"@lowdefy/connection-redis": "4.0.0-alpha.12",
|
|
79
|
+
"@lowdefy/connection-sendgrid": "4.0.0-alpha.12",
|
|
80
|
+
"@lowdefy/connection-stripe": "4.0.0-alpha.12",
|
|
81
|
+
"@lowdefy/operators-change-case": "4.0.0-alpha.12",
|
|
82
|
+
"@lowdefy/operators-diff": "4.0.0-alpha.12",
|
|
83
|
+
"@lowdefy/operators-mql": "4.0.0-alpha.12",
|
|
84
|
+
"@lowdefy/operators-nunjucks": "4.0.0-alpha.12",
|
|
85
|
+
"@lowdefy/operators-uuid": "4.0.0-alpha.12",
|
|
86
|
+
"@lowdefy/operators-yaml": "4.0.0-alpha.12",
|
|
87
|
+
"@lowdefy/plugin-next-auth": "4.0.0-alpha.12",
|
|
88
|
+
"@swc/cli": "0.1.55",
|
|
89
|
+
"@swc/core": "1.2.135",
|
|
90
|
+
"@swc/jest": "0.2.17",
|
|
91
|
+
"jest": "27.5.1"
|
|
60
92
|
},
|
|
61
93
|
"publishConfig": {
|
|
62
94
|
"access": "public"
|
|
63
95
|
},
|
|
64
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "41b6138a81bee7da362dad06345bc9f87b2c2133"
|
|
65
97
|
}
|